NFS: Share NFS superblocks per-protocol per-server per-FSID
[deliverable/linux.git] / fs / nfs / inode.c
index c5b916605fb012b856bdee1c5cc8c8b4d9a8c81a..a547c58a83e6bdaa2a8cb8a4b76c265643b98cac 100644 (file)
@@ -13,7 +13,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
@@ -77,19 +76,14 @@ int nfs_write_inode(struct inode *inode, int sync)
 
 void nfs_clear_inode(struct inode *inode)
 {
-       struct nfs_inode *nfsi = NFS_I(inode);
-       struct rpc_cred *cred;
-
        /*
         * The following should never happen...
         */
        BUG_ON(nfs_have_writebacks(inode));
-       BUG_ON (!list_empty(&nfsi->open_files));
+       BUG_ON(!list_empty(&NFS_I(inode)->open_files));
+       BUG_ON(atomic_read(&NFS_I(inode)->data_updates) != 0);
        nfs_zap_acl_cache(inode);
-       cred = nfsi->cache_access.cred;
-       if (cred)
-               put_rpccred(cred);
-       BUG_ON(atomic_read(&nfsi->data_updates) != 0);
+       nfs_access_zap_cache(inode);
 }
 
 /**
@@ -243,13 +237,13 @@ 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_SB(sb)->rpc_ops->file_inode_ops;
+               inode->i_op = NFS_SB(sb)->nfs_client->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;
                        inode->i_data.backing_dev_info = &NFS_SB(sb)->backing_dev_info;
                } else if (S_ISDIR(inode->i_mode)) {
-                       inode->i_op = NFS_SB(sb)->rpc_ops->dir_inode_ops;
+                       inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->dir_inode_ops;
                        inode->i_fop = &nfs_dir_operations;
                        if (nfs_server_capable(inode, NFS_CAP_READDIRPLUS)
                            && fattr->size <= NFS_LIMIT_READDIRPLUS)
@@ -291,7 +285,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
                nfsi->attrtimeo = NFS_MINATTRTIMEO(inode);
                nfsi->attrtimeo_timestamp = jiffies;
                memset(nfsi->cookieverf, 0, sizeof(nfsi->cookieverf));
-               nfsi->cache_access.cred = NULL;
+               nfsi->access_cache = RB_ROOT;
 
                unlock_new_inode(inode);
        } else
@@ -1026,7 +1020,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
  out_fileid:
        printk(KERN_ERR "NFS: server %s error: fileid changed\n"
                "fsid %s: expected fileid 0x%Lx, got 0x%Lx\n",
-               NFS_SERVER(inode)->hostname, inode->i_sb->s_id,
+               NFS_SERVER(inode)->nfs_client->cl_hostname, inode->i_sb->s_id,
                (long long)nfsi->fileid, (long long)fattr->fileid);
        goto out_err;
 }
@@ -1110,6 +1104,8 @@ static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
                INIT_LIST_HEAD(&nfsi->dirty);
                INIT_LIST_HEAD(&nfsi->commit);
                INIT_LIST_HEAD(&nfsi->open_files);
+               INIT_LIST_HEAD(&nfsi->access_cache_entry_lru);
+               INIT_LIST_HEAD(&nfsi->access_cache_inode_lru);
                INIT_RADIX_TREE(&nfsi->nfs_page_tree, GFP_ATOMIC);
                atomic_set(&nfsi->data_updates, 0);
                nfsi->ndirty = 0;
This page took 0.028715 seconds and 5 git commands to generate.