fat: restructure export operations
Subsystems (2)
PATCH 2/6 fat: restructure export operations
From: Namjae Jeon <[email protected]>
Define two nfs export_operation structures,one for 'stale_rw' mounts and the other for 'nostale_ro'.The former uses the generic export_encode_fh function to encode file handle, while the latter uses fat_encode_fh.
Since inode number is not needed for nostale_ro, remove it from struct fat_fid and repack other needed info viz. i_pos and i_generation.
Signed-off-by Namjae Jeon <[email protected]>
Signed-off-by Ravishankar N <[email protected]>
Signed-off-by Amit Sahrawat <[email protected]>
--- fs/fat/fat.h | 2 + fs/fat/inode.c | 12 ++---- fs/fat/nfs.c | 127 +++++++++++++++++++++++++++++++++++++++++++------------- 3 files changed, 104 insertions(+), 37 deletions(-)
fs/fat/fat.h +2 -0
@@ -391,6 +391,8 @@ void fat_cache_destroy(void);/* fat/nfs.c */ struct fid ; +extern const struct export_operations fat_export_ops; +extern const struct export_operations fat_export_ops_nostale;extern int fat_encode_fh (struct inode *inode,__u32 *fh,int *lenp,struct inode *parent); extern struct dentry *fat_fh_to_dentry(struct super_block *sb, struct fid *fid,
fs/fat/inode.c +3 -9
@@ -18,7 +18,6 @@#include <linux/pagemap.h> #include <linux/mpage.h> #include <linux/buffer_head.h> -#include <linux/exportfs.h> #include <linux/mount.h> #include <linux/vfs.h> #include <linux/parser.h>
@@ -703,13 +702,6 @@ static const struct super_operations fat_sops = { .show_options = fat_show_options, }; -static const struct export_operations fat_export_ops = { - .encode_fh = fat_encode_fh, - .fh_to_dentry = fat_fh_to_dentry, - .fh_to_parent = fat_fh_to_parent, - .get_parent = fat_get_parent, -}; -static int fat_show_options (struct seq_file *m,struct dentry *root) {struct msdos_sb_info *sbi =MSDOS_SB (root->d_sb);
@@ -1118,8 +1110,10 @@ out: opts->allow_utime = ~opts->fs_dmask & (S_IWGRP |S_IWOTH );if (opts->unicode_xlate) opts->utf8 =0 ; -if (opts->nfs ==FAT_NFS_NOSTALE_RO ) +if (opts->nfs ==FAT_NFS_NOSTALE_RO ) { sb->s_flags |=MS_RDONLY ; + sb->s_export_op = &fat_export_ops_nostale; + }return 0 ; }
fs/fat/nfs.c +99 -28
193 lines not on this page · raw message
Signature · 1 line
1.7.9.5