diff options
| author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2006-11-16 04:19:28 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-11-16 14:43:38 -0500 |
| commit | da63fc7ce63b43426dc3c69c05e28de2872c159a (patch) | |
| tree | 4de7da9f3fa59e37176ebbfb364afe8b0bcdac65 | |
| parent | 565762f3fae23ec4db26607cf4726de7b5075b3b (diff) | |
[PATCH] fat: add fat_getattr()
This adds fat_getattr() for setting stat->blksize. (FAT uses the size
of cluster for proper I/O)
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | fs/fat/file.c | 10 | ||||
| -rw-r--r-- | fs/msdos/namei.c | 1 | ||||
| -rw-r--r-- | fs/vfat/namei.c | 1 | ||||
| -rw-r--r-- | include/linux/msdos_fs.h | 2 |
4 files changed, 14 insertions, 0 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c index 8337451e7897..0aa813d944a6 100644 --- a/fs/fat/file.c +++ b/fs/fat/file.c | |||
| @@ -303,7 +303,17 @@ void fat_truncate(struct inode *inode) | |||
| 303 | fat_flush_inodes(inode->i_sb, inode, NULL); | 303 | fat_flush_inodes(inode->i_sb, inode, NULL); |
| 304 | } | 304 | } |
| 305 | 305 | ||
| 306 | int fat_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | ||
| 307 | { | ||
| 308 | struct inode *inode = dentry->d_inode; | ||
| 309 | generic_fillattr(inode, stat); | ||
| 310 | stat->blksize = MSDOS_SB(inode->i_sb)->cluster_size; | ||
| 311 | return 0; | ||
| 312 | } | ||
| 313 | EXPORT_SYMBOL_GPL(fat_getattr); | ||
| 314 | |||
| 306 | struct inode_operations fat_file_inode_operations = { | 315 | struct inode_operations fat_file_inode_operations = { |
| 307 | .truncate = fat_truncate, | 316 | .truncate = fat_truncate, |
| 308 | .setattr = fat_notify_change, | 317 | .setattr = fat_notify_change, |
| 318 | .getattr = fat_getattr, | ||
| 309 | }; | 319 | }; |
diff --git a/fs/msdos/namei.c b/fs/msdos/namei.c index b0f01b3b0536..452461955cbd 100644 --- a/fs/msdos/namei.c +++ b/fs/msdos/namei.c | |||
| @@ -654,6 +654,7 @@ static struct inode_operations msdos_dir_inode_operations = { | |||
| 654 | .rmdir = msdos_rmdir, | 654 | .rmdir = msdos_rmdir, |
| 655 | .rename = msdos_rename, | 655 | .rename = msdos_rename, |
| 656 | .setattr = fat_notify_change, | 656 | .setattr = fat_notify_change, |
| 657 | .getattr = fat_getattr, | ||
| 657 | }; | 658 | }; |
| 658 | 659 | ||
| 659 | static int msdos_fill_super(struct super_block *sb, void *data, int silent) | 660 | static int msdos_fill_super(struct super_block *sb, void *data, int silent) |
diff --git a/fs/vfat/namei.c b/fs/vfat/namei.c index edb711ff7b05..0afd745a37cd 100644 --- a/fs/vfat/namei.c +++ b/fs/vfat/namei.c | |||
| @@ -1004,6 +1004,7 @@ static struct inode_operations vfat_dir_inode_operations = { | |||
| 1004 | .rmdir = vfat_rmdir, | 1004 | .rmdir = vfat_rmdir, |
| 1005 | .rename = vfat_rename, | 1005 | .rename = vfat_rename, |
| 1006 | .setattr = fat_notify_change, | 1006 | .setattr = fat_notify_change, |
| 1007 | .getattr = fat_getattr, | ||
| 1007 | }; | 1008 | }; |
| 1008 | 1009 | ||
| 1009 | static int vfat_fill_super(struct super_block *sb, void *data, int silent) | 1010 | static int vfat_fill_super(struct super_block *sb, void *data, int silent) |
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index ce6c85815cbd..24a9ef1506b6 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h | |||
| @@ -402,6 +402,8 @@ extern const struct file_operations fat_file_operations; | |||
| 402 | extern struct inode_operations fat_file_inode_operations; | 402 | extern struct inode_operations fat_file_inode_operations; |
| 403 | extern int fat_notify_change(struct dentry * dentry, struct iattr * attr); | 403 | extern int fat_notify_change(struct dentry * dentry, struct iattr * attr); |
| 404 | extern void fat_truncate(struct inode *inode); | 404 | extern void fat_truncate(struct inode *inode); |
| 405 | extern int fat_getattr(struct vfsmount *mnt, struct dentry *dentry, | ||
| 406 | struct kstat *stat); | ||
| 405 | 407 | ||
| 406 | /* fat/inode.c */ | 408 | /* fat/inode.c */ |
| 407 | extern void fat_attach(struct inode *inode, loff_t i_pos); | 409 | extern void fat_attach(struct inode *inode, loff_t i_pos); |
