diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2005-06-22 13:16:22 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-06-22 16:07:09 -0400 |
commit | 92cfc62cb8412c9563860b1bf70cd4701f03092e (patch) | |
tree | 13b75734522c0cbf6d1ba0663d07ecc13a4f464c | |
parent | 464a98bd70bae8c559cfc82af799faf44824ce64 (diff) |
[PATCH] NFS: Allow NFS versions to support different sets of inode operations.
ACL support will require supporting additional inode operations in v4
(getxattr, setxattr, listxattr). This patch allows different protocol versions
to support different inode operations by adding a file_inode_ops to the
nfs_rpc_ops (to match the existing dir_inode_ops).
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/inode.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs3proc.c | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 1 | ||||
-rw-r--r-- | fs/nfs/proc.c | 1 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 1 |
5 files changed, 5 insertions, 1 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index a38d4b22d1f8..a82f0340744f 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -686,7 +686,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
686 | /* Why so? Because we want revalidate for devices/FIFOs, and | 686 | /* Why so? Because we want revalidate for devices/FIFOs, and |
687 | * that's precisely what we have in nfs_file_inode_operations. | 687 | * that's precisely what we have in nfs_file_inode_operations. |
688 | */ | 688 | */ |
689 | inode->i_op = &nfs_file_inode_operations; | 689 | inode->i_op = NFS_SB(sb)->rpc_ops->file_inode_ops; |
690 | if (S_ISREG(inode->i_mode)) { | 690 | if (S_ISREG(inode->i_mode)) { |
691 | inode->i_fop = &nfs_file_operations; | 691 | inode->i_fop = &nfs_file_operations; |
692 | inode->i_data.a_ops = &nfs_file_aops; | 692 | inode->i_data.a_ops = &nfs_file_aops; |
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 3878494dfc2c..53953a775714 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
@@ -826,6 +826,7 @@ struct nfs_rpc_ops nfs_v3_clientops = { | |||
826 | .version = 3, /* protocol version */ | 826 | .version = 3, /* protocol version */ |
827 | .dentry_ops = &nfs_dentry_operations, | 827 | .dentry_ops = &nfs_dentry_operations, |
828 | .dir_inode_ops = &nfs_dir_inode_operations, | 828 | .dir_inode_ops = &nfs_dir_inode_operations, |
829 | .file_inode_ops = &nfs_file_inode_operations, | ||
829 | .getroot = nfs3_proc_get_root, | 830 | .getroot = nfs3_proc_get_root, |
830 | .getattr = nfs3_proc_getattr, | 831 | .getattr = nfs3_proc_getattr, |
831 | .setattr = nfs3_proc_setattr, | 832 | .setattr = nfs3_proc_setattr, |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index a69c02b206c1..a5a8cb3159a0 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -2746,6 +2746,7 @@ struct nfs_rpc_ops nfs_v4_clientops = { | |||
2746 | .version = 4, /* protocol version */ | 2746 | .version = 4, /* protocol version */ |
2747 | .dentry_ops = &nfs4_dentry_operations, | 2747 | .dentry_ops = &nfs4_dentry_operations, |
2748 | .dir_inode_ops = &nfs4_dir_inode_operations, | 2748 | .dir_inode_ops = &nfs4_dir_inode_operations, |
2749 | .file_inode_ops = &nfs_file_inode_operations, | ||
2749 | .getroot = nfs4_proc_get_root, | 2750 | .getroot = nfs4_proc_get_root, |
2750 | .getattr = nfs4_proc_getattr, | 2751 | .getattr = nfs4_proc_getattr, |
2751 | .setattr = nfs4_proc_setattr, | 2752 | .setattr = nfs4_proc_setattr, |
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index d31b4d6e5a5e..cedf636bcf3c 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c | |||
@@ -622,6 +622,7 @@ struct nfs_rpc_ops nfs_v2_clientops = { | |||
622 | .version = 2, /* protocol version */ | 622 | .version = 2, /* protocol version */ |
623 | .dentry_ops = &nfs_dentry_operations, | 623 | .dentry_ops = &nfs_dentry_operations, |
624 | .dir_inode_ops = &nfs_dir_inode_operations, | 624 | .dir_inode_ops = &nfs_dir_inode_operations, |
625 | .file_inode_ops = &nfs_file_inode_operations, | ||
625 | .getroot = nfs_proc_get_root, | 626 | .getroot = nfs_proc_get_root, |
626 | .getattr = nfs_proc_getattr, | 627 | .getattr = nfs_proc_getattr, |
627 | .setattr = nfs_proc_setattr, | 628 | .setattr = nfs_proc_setattr, |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 47037d9521cb..5b45bafd9db5 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -667,6 +667,7 @@ struct nfs_rpc_ops { | |||
667 | int version; /* Protocol version */ | 667 | int version; /* Protocol version */ |
668 | struct dentry_operations *dentry_ops; | 668 | struct dentry_operations *dentry_ops; |
669 | struct inode_operations *dir_inode_ops; | 669 | struct inode_operations *dir_inode_ops; |
670 | struct inode_operations *file_inode_ops; | ||
670 | 671 | ||
671 | int (*getroot) (struct nfs_server *, struct nfs_fh *, | 672 | int (*getroot) (struct nfs_server *, struct nfs_fh *, |
672 | struct nfs_fsinfo *); | 673 | struct nfs_fsinfo *); |