]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
[PATCH] NFS: Allow NFS versions to support different sets of inode operations.
authorJ. Bruce Fields <bfields@citi.umich.edu>
Wed, 22 Jun 2005 17:16:22 +0000 (17:16 +0000)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 22 Jun 2005 20:07:09 +0000 (16:07 -0400)
 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>
fs/nfs/inode.c
fs/nfs/nfs3proc.c
fs/nfs/nfs4proc.c
fs/nfs/proc.c
include/linux/nfs_xdr.h

index a38d4b22d1f8c41b0b4b240f24c7361c49bbebc7..a82f0340744f5efdbff4e166a9cad55cc301cff5 100644 (file)
@@ -686,7 +686,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
                /* Why so? Because we want revalidate for devices/FIFOs, and
                 * that's precisely what we have in nfs_file_inode_operations.
                 */
-               inode->i_op = &nfs_file_inode_operations;
+               inode->i_op = NFS_SB(sb)->rpc_ops->file_inode_ops;
                if (S_ISREG(inode->i_mode)) {
                        inode->i_fop = &nfs_file_operations;
                        inode->i_data.a_ops = &nfs_file_aops;
index 3878494dfc2c869302e16c3dbed93a8ede54d6d1..53953a775714b6e30f6d913ee654653b2bb01a0e 100644 (file)
@@ -826,6 +826,7 @@ struct nfs_rpc_ops  nfs_v3_clientops = {
        .version        = 3,                    /* protocol version */
        .dentry_ops     = &nfs_dentry_operations,
        .dir_inode_ops  = &nfs_dir_inode_operations,
+       .file_inode_ops = &nfs_file_inode_operations,
        .getroot        = nfs3_proc_get_root,
        .getattr        = nfs3_proc_getattr,
        .setattr        = nfs3_proc_setattr,
index a69c02b206c1b948a20790cd7b770e2362466f9e..a5a8cb3159a0982712831ed92a5dd05eb008c8eb 100644 (file)
@@ -2746,6 +2746,7 @@ struct nfs_rpc_ops        nfs_v4_clientops = {
        .version        = 4,                    /* protocol version */
        .dentry_ops     = &nfs4_dentry_operations,
        .dir_inode_ops  = &nfs4_dir_inode_operations,
+       .file_inode_ops = &nfs_file_inode_operations,
        .getroot        = nfs4_proc_get_root,
        .getattr        = nfs4_proc_getattr,
        .setattr        = nfs4_proc_setattr,
index d31b4d6e5a5e2d4f259cd3896889594d3e410575..cedf636bcf3c9f68b53b6c979d2116f5f4a4511d 100644 (file)
@@ -622,6 +622,7 @@ struct nfs_rpc_ops  nfs_v2_clientops = {
        .version        = 2,                   /* protocol version */
        .dentry_ops     = &nfs_dentry_operations,
        .dir_inode_ops  = &nfs_dir_inode_operations,
+       .file_inode_ops = &nfs_file_inode_operations,
        .getroot        = nfs_proc_get_root,
        .getattr        = nfs_proc_getattr,
        .setattr        = nfs_proc_setattr,
index 47037d9521cb04e5fdac5d76a03eb8892089a57f..5b45bafd9db5b98a7824e3e817a04e28c98c0ea0 100644 (file)
@@ -667,6 +667,7 @@ struct nfs_rpc_ops {
        int     version;                /* Protocol version */
        struct dentry_operations *dentry_ops;
        struct inode_operations *dir_inode_ops;
+       struct inode_operations *file_inode_ops;
 
        int     (*getroot) (struct nfs_server *, struct nfs_fh *,
                            struct nfs_fsinfo *);