linux-2.6.33/vfs_read()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#k17aa1f4]
#backlinks
*説明 [#d8e3276d]
-パス: [[linux-2.6.33/fs/read_write.c]]
-FIXME: これは何?
--説明
**引数 [#ufe97c70]
-struct file *file
--
--[[linux-2.6.33/file]]
-char __user *buf
--
-size_t count
--
-loff_t *pos
--
**返り値 [#e47c2c45]
-ssize_t
--
**参考 [#r6ff4572]
-file_operations::read に対して、
独自の read 関数を設定しているファイルシステムと、
何も設定しない NULL のまま(=デフォルトの関数が呼ばれる)
ファイルシステムがある。
--調査データの詳細は
「file_operations::read メンバに指定される関数ポインタの...
の章を参照
-特殊パターン
.read = do_sync_read, fs/9p/vfs_file.c:279:
.read = v9fs_file_read, fs/9p/vfs_file.c:291:
-v9fs(Plan9 のファイルシステム)
--キャッシュ有効だと、
v9fs_cached_file_operations が選択されるため、
read メンバには do_sync_read が設定される。
--キャッシュ無効だと、
v9fs_file_operations が選択されるため、
read メンバには v9fs_file_read が設定される。
---[[linux-2.6.33/v9fs_file_open()]]
.read = do_sync_read, fs/fuse/file.c:1979:
.read = fuse_direct_read, fs/fuse/file.c:1998:
-FUSE(Filesystem in Userspace, ユーザ空間にファイルシス...
構築するフレームワーク)
--(FIXME: 条件がよくわからない)だと、
fuse_file_operations が選択されるため、
read メンバには do_sync_read が設定される。
--(FIXME: 条件がよくわからない)だと、
fuse_direct_io_file_operations が選択されるため、
read メンバには fuse_direct_read が設定される。
---ファイルの open 時に、
fuse_open -> fuse_open_common -> fuse_finish_open の順で...
---[[linux-2.6.33/fuse_finish_open()]]
-独自に設定しているが、標準と同じ関数を設定する(do_sync_...
ファイルシステム一覧
.read = do_sync_read, fs/adfs/file.c:26:
.read = do_sync_read, fs/affs/file.c:30:
.read = do_sync_read, fs/afs/file.c:33:
.read = do_sync_read, fs/bfs/file.c:26:
.read = do_sync_read, fs/btrfs/file.c:1155:
.read = do_sync_read, fs/ecryptfs/file.c:312:
.read = do_sync_read, fs/exofs/file.c:76:
.read = do_sync_read, fs/ext2/file.c:64:
.read = do_sync_read, fs/ext3/file.c:56:
.read = do_sync_read, fs/ext4/file.c:135:
.read = do_sync_read, fs/fat/file.c:156:
.read = do_sync_read, fs/gfs2/file.c:745:
.read = do_sync_read, fs/gfs2/file.c:775:
.read = do_sync_read, fs/hpfs/file.c:134:
.read = do_sync_read, fs/jffs2/file.c:45:
.read = do_sync_read, fs/jfs/file.c:107:
.read = do_sync_read, fs/minix/file.c:17:
.read = do_sync_read, fs/nfs/file.c:66:
.read = do_sync_read, fs/nilfs2/file.c:139:
.read = do_sync_read, fs/ntfs/file.c:2207:
.read = do_sync_read, fs/ocfs2/file.c:2282:
.read = do_sync_read, fs/ocfs2/file.c:2329:
.read = do_sync_read, fs/omfs/file.c:327:
.read = do_sync_read, fs/reiserfs/file.c:285:
.read = do_sync_read, fs/smbfs/file.c:437:
.read = do_sync_read, fs/sysv/file.c:24:
.read = do_sync_read, fs/ubifs/file.c:1573:
.read = do_sync_read, fs/udf/file.c:207:
.read = do_sync_read, fs/ufs/file.c:38:
.read = do_sync_read, fs/xfs/linux-2.6/xfs_file.c...
-独自に設定しているファイルシステム一覧
.read = configfs_read_file, fs/configfs/file.c:309:
.read = sysfs_read_file, fs/sysfs/file.c:492:
*実装 [#p0c75314]
ssize_t vfs_read(struct file *file, char __user *buf, si...
{
ssize_t ret;
if (!(file->f_mode & FMODE_READ))
return -EBADF;
if (!file->f_op || (!file->f_op->read && !file->f_op->a...
return -EINVAL;
if (unlikely(!access_ok(VERIFY_WRITE, buf, count)))
return -EFAULT;
-file->f_op は file_operations 型
--[[linux-2.6.33/file_operations]]
-
--[[linux-2.6.33/access_ok()]]
ret = rw_verify_area(READ, file, pos, count);
-
--[[linux-2.6.33/rw_verify_area()]]
if (ret >= 0) {
count = ret;
if (file->f_op->read)
ret = file->f_op->read(file, buf, count, pos);
else
ret = do_sync_read(file, buf, count, pos);
-file_operations::read に関数が設定されていたら、それを呼...
--ファイルシステムにより file_operations::read に設定され...
「参考」の章を参照のこと。
--ネットワークファイルシステムを除いて、
大抵のファイルシステムでは do_sync_read を設定しているよ...
--[[linux-2.6.33/do_sync_read()]]
if (ret > 0) {
fsnotify_access(file->f_path.dentry);
add_rchar(current, ret);
}
-
--[[linux-2.6.33/fsnotify_access()]]
-
--[[linux-2.6.33/add_rchar()]]
inc_syscr(current);
-
--[[linux-2.6.33/inc_syscr()]]
}
return ret;
}
EXPORT_SYMBOL(vfs_read);
-特にライセンスを区別せずシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL()]]
*file_operations::read メンバに指定される関数ポインタの調...
-コマンド
egrep -nr '(struct file_operations|\.read\s+=.+,)' fs | ...
-結果
fs/9p/vfs_file.c :46:static const struct file_operati...
fs/9p/vfs_file.c :277:static const struct file_operati...
fs/9p/vfs_file.c :279: .read = do_sync_read,
fs/9p/vfs_file.c :289:const struct file_operations v9f...
fs/9p/vfs_file.c :291: .read = v9fs_file_read,
fs/adfs/file.c :24:const struct file_operations adf...
fs/adfs/file.c :26: .read = do_sync_read,
fs/affs/file.c :28:const struct file_operations aff...
fs/affs/file.c :30: .read = do_sync_read,
fs/afs/file.c :29:const struct file_operations afs...
fs/afs/file.c :33: .read = do_sync_read,
fs/bfs/file.c :24:const struct file_operations bfs...
fs/bfs/file.c :26: .read = do_sync_read,
fs/btrfs/file.c :1153:const struct file_operations btr...
fs/btrfs/file.c :1155: .read = do_sync_read,
fs/coda/file.c :229:const struct file_operations cod...
fs/configfs/file.c :308:const struct file_operations con...
fs/configfs/file.c :309: .read = configfs_read_file,
fs/debugfs/file.c :42:const struct file_operations deb...
fs/debugfs/file.c :434:static const struct file_operati...
fs/debugfs/file.c :479:static const struct file_operati...
fs/ecryptfs/file.c :299:const struct file_operations ecr...
fs/ecryptfs/file.c :310:const struct file_operations ecr...
fs/ecryptfs/file.c :312: .read = do_sync_read,
fs/exofs/file.c :74:const struct file_operations exo...
fs/exofs/file.c :76: .read = do_sync_read,
fs/ext2/file.c :62:const struct file_operations ext...
fs/ext2/file.c :64: .read = do_sync_read,
fs/ext2/file.c :81:const struct file_operations ext...
fs/ext3/file.c :54:const struct file_operations ext...
fs/ext3/file.c :56: .read = do_sync_read,
fs/ext4/file.c :133:const struct file_operations ext...
fs/ext4/file.c :135: .read = do_sync_read,
fs/fat/file.c :154:const struct file_operations fat...
fs/fat/file.c :156: .read = do_sync_read,
fs/fuse/file.c :17:static const struct file_operati...
fs/fuse/file.c :1977:static const struct file_operati...
fs/fuse/file.c :1979: .read = do_sync_read,
fs/fuse/file.c :1996:static const struct file_operati...
fs/fuse/file.c :1998: .read = fuse_direct_read,
fs/gfs2/file.c :743:const struct file_operations gfs...
fs/gfs2/file.c :745: .read = do_sync_read,
fs/gfs2/file.c :761:const struct file_operations gfs...
fs/gfs2/file.c :773:const struct file_operations gfs...
fs/gfs2/file.c :775: .read = do_sync_read,
fs/gfs2/file.c :789:const struct file_operations gfs...
fs/hpfs/file.c :131:const struct file_operations hpf...
fs/hpfs/file.c :134: .read = do_sync_read,
fs/jffs2/file.c :41:const struct file_operations jff...
fs/jffs2/file.c :45: .read = do_sync_read,
fs/jfs/file.c :103:const struct file_operations jfs...
fs/jfs/file.c :107: .read = do_sync_read,
fs/minix/file.c :15:const struct file_operations min...
fs/minix/file.c :17: .read = do_sync_read,
fs/ncpfs/file.c :294:const struct file_operations ncp...
fs/nfs/file.c :64:const struct file_operations nfs...
fs/nfs/file.c :66: .read = do_sync_read,
fs/nilfs2/file.c :137:const struct file_operations nil...
fs/nilfs2/file.c :139: .read = do_sync_read,
fs/ntfs/file.c :2205:const struct file_operations ntf...
fs/ntfs/file.c :2207: .read = do_sync_read, /* Rea...
fs/ntfs/file.c :2246:const struct file_operations ntf...
fs/ocfs2/file.c :2280:const struct file_operations ocf...
fs/ocfs2/file.c :2282: .read = do_sync_read,
fs/ocfs2/file.c :2300:const struct file_operations ocf...
fs/ocfs2/file.c :2327:const struct file_operations ocf...
fs/ocfs2/file.c :2329: .read = do_sync_read,
fs/ocfs2/file.c :2346:const struct file_operations ocf...
fs/omfs/file.c :325:const struct file_operations omf...
fs/omfs/file.c :327: .read = do_sync_read,
fs/reiserfs/file.c :284:const struct file_operations rei...
fs/reiserfs/file.c :285: .read = do_sync_read,
fs/smbfs/file.c :434:const struct file_operations smb...
fs/smbfs/file.c :437: .read = do_sync_read,
fs/sysfs/file.c :491:const struct file_operations sys...
fs/sysfs/file.c :492: .read = sysfs_read_file,
fs/sysv/file.c :22:const struct file_operations sys...
fs/sysv/file.c :24: .read = do_sync_read,
fs/ubifs/file.c :1571:const struct file_operations ubi...
fs/ubifs/file.c :1573: .read = do_sync_read,
fs/udf/file.c :206:const struct file_operations udf...
fs/udf/file.c :207: .read = do_sync_read,
fs/ufs/file.c :36:const struct file_operations ufs...
fs/ufs/file.c :38: .read = do_sync_read,
fs/xfs/linux-2.6/xfs_file.c:243:const struct file_operat...
fs/xfs/linux-2.6/xfs_file.c:245: .read = do_sync_read,
fs/xfs/linux-2.6/xfs_file.c:264:const struct file_operat...
*コメント [#w59631ab]
終了行:
*参照元 [#k17aa1f4]
#backlinks
*説明 [#d8e3276d]
-パス: [[linux-2.6.33/fs/read_write.c]]
-FIXME: これは何?
--説明
**引数 [#ufe97c70]
-struct file *file
--
--[[linux-2.6.33/file]]
-char __user *buf
--
-size_t count
--
-loff_t *pos
--
**返り値 [#e47c2c45]
-ssize_t
--
**参考 [#r6ff4572]
-file_operations::read に対して、
独自の read 関数を設定しているファイルシステムと、
何も設定しない NULL のまま(=デフォルトの関数が呼ばれる)
ファイルシステムがある。
--調査データの詳細は
「file_operations::read メンバに指定される関数ポインタの...
の章を参照
-特殊パターン
.read = do_sync_read, fs/9p/vfs_file.c:279:
.read = v9fs_file_read, fs/9p/vfs_file.c:291:
-v9fs(Plan9 のファイルシステム)
--キャッシュ有効だと、
v9fs_cached_file_operations が選択されるため、
read メンバには do_sync_read が設定される。
--キャッシュ無効だと、
v9fs_file_operations が選択されるため、
read メンバには v9fs_file_read が設定される。
---[[linux-2.6.33/v9fs_file_open()]]
.read = do_sync_read, fs/fuse/file.c:1979:
.read = fuse_direct_read, fs/fuse/file.c:1998:
-FUSE(Filesystem in Userspace, ユーザ空間にファイルシス...
構築するフレームワーク)
--(FIXME: 条件がよくわからない)だと、
fuse_file_operations が選択されるため、
read メンバには do_sync_read が設定される。
--(FIXME: 条件がよくわからない)だと、
fuse_direct_io_file_operations が選択されるため、
read メンバには fuse_direct_read が設定される。
---ファイルの open 時に、
fuse_open -> fuse_open_common -> fuse_finish_open の順で...
---[[linux-2.6.33/fuse_finish_open()]]
-独自に設定しているが、標準と同じ関数を設定する(do_sync_...
ファイルシステム一覧
.read = do_sync_read, fs/adfs/file.c:26:
.read = do_sync_read, fs/affs/file.c:30:
.read = do_sync_read, fs/afs/file.c:33:
.read = do_sync_read, fs/bfs/file.c:26:
.read = do_sync_read, fs/btrfs/file.c:1155:
.read = do_sync_read, fs/ecryptfs/file.c:312:
.read = do_sync_read, fs/exofs/file.c:76:
.read = do_sync_read, fs/ext2/file.c:64:
.read = do_sync_read, fs/ext3/file.c:56:
.read = do_sync_read, fs/ext4/file.c:135:
.read = do_sync_read, fs/fat/file.c:156:
.read = do_sync_read, fs/gfs2/file.c:745:
.read = do_sync_read, fs/gfs2/file.c:775:
.read = do_sync_read, fs/hpfs/file.c:134:
.read = do_sync_read, fs/jffs2/file.c:45:
.read = do_sync_read, fs/jfs/file.c:107:
.read = do_sync_read, fs/minix/file.c:17:
.read = do_sync_read, fs/nfs/file.c:66:
.read = do_sync_read, fs/nilfs2/file.c:139:
.read = do_sync_read, fs/ntfs/file.c:2207:
.read = do_sync_read, fs/ocfs2/file.c:2282:
.read = do_sync_read, fs/ocfs2/file.c:2329:
.read = do_sync_read, fs/omfs/file.c:327:
.read = do_sync_read, fs/reiserfs/file.c:285:
.read = do_sync_read, fs/smbfs/file.c:437:
.read = do_sync_read, fs/sysv/file.c:24:
.read = do_sync_read, fs/ubifs/file.c:1573:
.read = do_sync_read, fs/udf/file.c:207:
.read = do_sync_read, fs/ufs/file.c:38:
.read = do_sync_read, fs/xfs/linux-2.6/xfs_file.c...
-独自に設定しているファイルシステム一覧
.read = configfs_read_file, fs/configfs/file.c:309:
.read = sysfs_read_file, fs/sysfs/file.c:492:
*実装 [#p0c75314]
ssize_t vfs_read(struct file *file, char __user *buf, si...
{
ssize_t ret;
if (!(file->f_mode & FMODE_READ))
return -EBADF;
if (!file->f_op || (!file->f_op->read && !file->f_op->a...
return -EINVAL;
if (unlikely(!access_ok(VERIFY_WRITE, buf, count)))
return -EFAULT;
-file->f_op は file_operations 型
--[[linux-2.6.33/file_operations]]
-
--[[linux-2.6.33/access_ok()]]
ret = rw_verify_area(READ, file, pos, count);
-
--[[linux-2.6.33/rw_verify_area()]]
if (ret >= 0) {
count = ret;
if (file->f_op->read)
ret = file->f_op->read(file, buf, count, pos);
else
ret = do_sync_read(file, buf, count, pos);
-file_operations::read に関数が設定されていたら、それを呼...
--ファイルシステムにより file_operations::read に設定され...
「参考」の章を参照のこと。
--ネットワークファイルシステムを除いて、
大抵のファイルシステムでは do_sync_read を設定しているよ...
--[[linux-2.6.33/do_sync_read()]]
if (ret > 0) {
fsnotify_access(file->f_path.dentry);
add_rchar(current, ret);
}
-
--[[linux-2.6.33/fsnotify_access()]]
-
--[[linux-2.6.33/add_rchar()]]
inc_syscr(current);
-
--[[linux-2.6.33/inc_syscr()]]
}
return ret;
}
EXPORT_SYMBOL(vfs_read);
-特にライセンスを区別せずシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL()]]
*file_operations::read メンバに指定される関数ポインタの調...
-コマンド
egrep -nr '(struct file_operations|\.read\s+=.+,)' fs | ...
-結果
fs/9p/vfs_file.c :46:static const struct file_operati...
fs/9p/vfs_file.c :277:static const struct file_operati...
fs/9p/vfs_file.c :279: .read = do_sync_read,
fs/9p/vfs_file.c :289:const struct file_operations v9f...
fs/9p/vfs_file.c :291: .read = v9fs_file_read,
fs/adfs/file.c :24:const struct file_operations adf...
fs/adfs/file.c :26: .read = do_sync_read,
fs/affs/file.c :28:const struct file_operations aff...
fs/affs/file.c :30: .read = do_sync_read,
fs/afs/file.c :29:const struct file_operations afs...
fs/afs/file.c :33: .read = do_sync_read,
fs/bfs/file.c :24:const struct file_operations bfs...
fs/bfs/file.c :26: .read = do_sync_read,
fs/btrfs/file.c :1153:const struct file_operations btr...
fs/btrfs/file.c :1155: .read = do_sync_read,
fs/coda/file.c :229:const struct file_operations cod...
fs/configfs/file.c :308:const struct file_operations con...
fs/configfs/file.c :309: .read = configfs_read_file,
fs/debugfs/file.c :42:const struct file_operations deb...
fs/debugfs/file.c :434:static const struct file_operati...
fs/debugfs/file.c :479:static const struct file_operati...
fs/ecryptfs/file.c :299:const struct file_operations ecr...
fs/ecryptfs/file.c :310:const struct file_operations ecr...
fs/ecryptfs/file.c :312: .read = do_sync_read,
fs/exofs/file.c :74:const struct file_operations exo...
fs/exofs/file.c :76: .read = do_sync_read,
fs/ext2/file.c :62:const struct file_operations ext...
fs/ext2/file.c :64: .read = do_sync_read,
fs/ext2/file.c :81:const struct file_operations ext...
fs/ext3/file.c :54:const struct file_operations ext...
fs/ext3/file.c :56: .read = do_sync_read,
fs/ext4/file.c :133:const struct file_operations ext...
fs/ext4/file.c :135: .read = do_sync_read,
fs/fat/file.c :154:const struct file_operations fat...
fs/fat/file.c :156: .read = do_sync_read,
fs/fuse/file.c :17:static const struct file_operati...
fs/fuse/file.c :1977:static const struct file_operati...
fs/fuse/file.c :1979: .read = do_sync_read,
fs/fuse/file.c :1996:static const struct file_operati...
fs/fuse/file.c :1998: .read = fuse_direct_read,
fs/gfs2/file.c :743:const struct file_operations gfs...
fs/gfs2/file.c :745: .read = do_sync_read,
fs/gfs2/file.c :761:const struct file_operations gfs...
fs/gfs2/file.c :773:const struct file_operations gfs...
fs/gfs2/file.c :775: .read = do_sync_read,
fs/gfs2/file.c :789:const struct file_operations gfs...
fs/hpfs/file.c :131:const struct file_operations hpf...
fs/hpfs/file.c :134: .read = do_sync_read,
fs/jffs2/file.c :41:const struct file_operations jff...
fs/jffs2/file.c :45: .read = do_sync_read,
fs/jfs/file.c :103:const struct file_operations jfs...
fs/jfs/file.c :107: .read = do_sync_read,
fs/minix/file.c :15:const struct file_operations min...
fs/minix/file.c :17: .read = do_sync_read,
fs/ncpfs/file.c :294:const struct file_operations ncp...
fs/nfs/file.c :64:const struct file_operations nfs...
fs/nfs/file.c :66: .read = do_sync_read,
fs/nilfs2/file.c :137:const struct file_operations nil...
fs/nilfs2/file.c :139: .read = do_sync_read,
fs/ntfs/file.c :2205:const struct file_operations ntf...
fs/ntfs/file.c :2207: .read = do_sync_read, /* Rea...
fs/ntfs/file.c :2246:const struct file_operations ntf...
fs/ocfs2/file.c :2280:const struct file_operations ocf...
fs/ocfs2/file.c :2282: .read = do_sync_read,
fs/ocfs2/file.c :2300:const struct file_operations ocf...
fs/ocfs2/file.c :2327:const struct file_operations ocf...
fs/ocfs2/file.c :2329: .read = do_sync_read,
fs/ocfs2/file.c :2346:const struct file_operations ocf...
fs/omfs/file.c :325:const struct file_operations omf...
fs/omfs/file.c :327: .read = do_sync_read,
fs/reiserfs/file.c :284:const struct file_operations rei...
fs/reiserfs/file.c :285: .read = do_sync_read,
fs/smbfs/file.c :434:const struct file_operations smb...
fs/smbfs/file.c :437: .read = do_sync_read,
fs/sysfs/file.c :491:const struct file_operations sys...
fs/sysfs/file.c :492: .read = sysfs_read_file,
fs/sysv/file.c :22:const struct file_operations sys...
fs/sysv/file.c :24: .read = do_sync_read,
fs/ubifs/file.c :1571:const struct file_operations ubi...
fs/ubifs/file.c :1573: .read = do_sync_read,
fs/udf/file.c :206:const struct file_operations udf...
fs/udf/file.c :207: .read = do_sync_read,
fs/ufs/file.c :36:const struct file_operations ufs...
fs/ufs/file.c :38: .read = do_sync_read,
fs/xfs/linux-2.6/xfs_file.c:243:const struct file_operat...
fs/xfs/linux-2.6/xfs_file.c:245: .read = do_sync_read,
fs/xfs/linux-2.6/xfs_file.c:264:const struct file_operat...
*コメント [#w59631ab]
ページ名: