Merge commit 'origin' into devel
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 8 Mar 2008 16:49:24 +0000 (11:49 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 8 Mar 2008 16:49:24 +0000 (11:49 -0500)
1  2 
fs/nfs/inode.c
fs/nfs/internal.h

diff --combined fs/nfs/inode.c
index 36cb99985d22255f2747a74f9d5058c66a75464f,a4c7cf2bff3a61131d1de68dbb770833e3c8e124..c49f6d8b42d2d62beb13b554cba102ae4acfbd8e
@@@ -299,6 -299,7 +299,7 @@@ nfs_fhget(struct super_block *sb, struc
                                else
                                        inode->i_op = &nfs_mountpoint_inode_operations;
                                inode->i_fop = NULL;
+                               set_bit(NFS_INO_MOUNTPOINT, &nfsi->flags);
                        }
                } else if (S_ISLNK(inode->i_mode))
                        inode->i_op = &nfs_symlink_inode_operations;
@@@ -521,12 -522,8 +522,12 @@@ struct nfs_open_context *get_nfs_open_c
  
  static void __put_nfs_open_context(struct nfs_open_context *ctx, int wait)
  {
 -      struct inode *inode = ctx->path.dentry->d_inode;
 +      struct inode *inode;
  
 +      if (ctx == NULL)
 +              return;
 +
 +      inode = ctx->path.dentry->d_inode;
        if (!atomic_dec_and_lock(&ctx->count, &inode->i_lock))
                return;
        list_del(&ctx->list);
@@@ -1007,8 -1004,9 +1008,9 @@@ static int nfs_update_inode(struct inod
  
        server = NFS_SERVER(inode);
        /* Update the fsid? */
-       if (S_ISDIR(inode->i_mode)
-                       && !nfs_fsid_equal(&server->fsid, &fattr->fsid))
+       if (S_ISDIR(inode->i_mode) &&
+                       !nfs_fsid_equal(&server->fsid, &fattr->fsid) &&
+                       !test_bit(NFS_INO_MOUNTPOINT, &nfsi->flags))
                server->fsid = fattr->fsid;
  
        /*
@@@ -1219,36 -1217,6 +1221,36 @@@ static void nfs_destroy_inodecache(void
        kmem_cache_destroy(nfs_inode_cachep);
  }
  
 +struct workqueue_struct *nfsiod_workqueue;
 +
 +/*
 + * start up the nfsiod workqueue
 + */
 +static int nfsiod_start(void)
 +{
 +      struct workqueue_struct *wq;
 +      dprintk("RPC:       creating workqueue nfsiod\n");
 +      wq = create_singlethread_workqueue("nfsiod");
 +      if (wq == NULL)
 +              return -ENOMEM;
 +      nfsiod_workqueue = wq;
 +      return 0;
 +}
 +
 +/*
 + * Destroy the nfsiod workqueue
 + */
 +static void nfsiod_stop(void)
 +{
 +      struct workqueue_struct *wq;
 +
 +      wq = nfsiod_workqueue;
 +      if (wq == NULL)
 +              return;
 +      nfsiod_workqueue = NULL;
 +      destroy_workqueue(wq);
 +}
 +
  /*
   * Initialize NFS
   */
@@@ -1256,10 -1224,6 +1258,10 @@@ static int __init init_nfs_fs(void
  {
        int err;
  
 +      err = nfsiod_start();
 +      if (err)
 +              goto out6;
 +
        err = nfs_fs_proc_init();
        if (err)
                goto out5;
@@@ -1306,8 -1270,6 +1308,8 @@@ out3
  out4:
        nfs_fs_proc_exit();
  out5:
 +      nfsiod_stop();
 +out6:
        return err;
  }
  
@@@ -1323,7 -1285,6 +1325,7 @@@ static void __exit exit_nfs_fs(void
  #endif
        unregister_nfs_fs();
        nfs_fs_proc_exit();
 +      nfsiod_stop();
  }
  
  /* Not quite true; I just maintain it */
diff --combined fs/nfs/internal.h
index 985dc2931031e05a70157141c93aed2ed1c2f77b,931992763e68c2e68f7e1f3501de25a8340dc50b..4c1122a1384435e0c9bb6df952d6573e2e6cfc98
@@@ -3,6 -3,7 +3,7 @@@
   */
  
  #include <linux/mount.h>
+ #include <linux/security.h>
  
  struct nfs_string;
  
@@@ -57,6 -58,8 +58,8 @@@ struct nfs_parsed_mount_data 
                char                    *export_path;
                int                     protocol;
        } nfs_server;
+       struct security_mnt_opts lsm_opts;
  };
  
  /* client.c */
@@@ -143,7 -146,6 +146,7 @@@ extern struct rpc_procinfo nfs4_procedu
  extern int nfs_access_cache_shrinker(int nr_to_scan, gfp_t gfp_mask);
  
  /* inode.c */
 +extern struct workqueue_struct *nfsiod_workqueue;
  extern struct inode *nfs_alloc_inode(struct super_block *sb);
  extern void nfs_destroy_inode(struct inode *);
  extern int nfs_write_inode(struct inode *,int);