fat: add fat_getattr()
OGAWA Hirofumi
maintainerPATCH 1/1 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 <[email protected]>
---
fs/fat/file.c | 10 ++++++++++ fs/msdos/namei.c | 1 + fs/vfat/namei.c | 1 + include/linux/msdos_fs.h | 2 ++ 4 files changed, 14 insertions(+)
fs/fat/file.c renamed from fs/fat/file.c~fat_getattr +10 -0
@@ -303,7 +303,17 @@ void fat_truncate(struct inode *inode)fat_flush_inodes (inode->i_sb, inode,NULL ); } +int fat_getattr (struct vfsmount *mnt,struct dentry *dentry,struct kstat *stat) +{ +struct inode *inode = dentry->d_inode; +generic_fillattr (inode, stat); + stat->blksize =MSDOS_SB (inode->i_sb)->cluster_size; +return 0 ; +} +EXPORT_SYMBOL_GPL (fat_getattr); +struct inode_operations fat_file_inode_operations = { .truncate = fat_truncate, .setattr = fat_notify_change, + .getattr = fat_getattr, };
include/linux/msdos_fs.h renamed from include/linux/msdos_fs.h~fat_getattr +2 -0
@@ -402,6 +402,8 @@ extern const struct file_operations fat_extern struct inode_operations fat_file_inode_operations;extern int fat_notify_change (struct dentry * dentry,struct iattr * attr);extern void fat_truncate (struct inode *inode); +extern int fat_getattr (struct vfsmount *mnt,struct dentry *dentry, +struct kstat *stat);/* fat/inode.c */ extern void fat_attach (struct inode *inode,loff_t i_pos);
fs/msdos/namei.c renamed from fs/msdos/namei.c~fat_getattr +1 -0
@@ -654,6 +654,7 @@ static struct inode_operations msdos_dir .rmdir = msdos_rmdir, .rename = msdos_rename, .setattr = fat_notify_change, + .getattr = fat_getattr, };static int msdos_fill_super (struct super_block *sb,void *data,int silent)
fs/vfat/namei.c renamed from fs/vfat/namei.c~fat_getattr +1 -0
@@ -1004,6 +1004,7 @@ static struct inode_operations vfat_dir_ .rmdir = vfat_rmdir, .rename = vfat_rename, .setattr = fat_notify_change, + .getattr = fat_getattr, };static int vfat_fill_super (struct super_block *sb,void *data,int silent)
_
Signature · 1 line
OGAWA Hirofumi <[email protected]>