Do not group pages by mobility type on low memory systems
[sfrench/cifs-2.6.git] / fs / nfsd / nfsctl.c
index eedf2e3990a9a8f3d0bdad85faa119f4eef4ef97..77dc9893b7bab462b65ebd751d9cc0c01273891f 100644 (file)
@@ -35,7 +35,6 @@
 #include <linux/nfsd/cache.h>
 #include <linux/nfsd/xdr.h>
 #include <linux/nfsd/syscall.h>
-#include <linux/nfsd/interface.h>
 
 #include <asm/uaccess.h>
 
@@ -123,7 +122,7 @@ static ssize_t nfsctl_transaction_write(struct file *file, const char __user *bu
                return PTR_ERR(data);
 
        rv =  write_op[ino](file, data, size);
-       if (rv>0) {
+       if (rv >= 0) {
                simple_transaction_set(file, rv);
                rv = size;
        }
@@ -245,7 +244,7 @@ static ssize_t write_getfs(struct file *file, char *buf, size_t size)
        }
        exp_readunlock();
        if (err == 0)
-               err = res->fh_size + (int)&((struct knfsd_fh*)0)->fh_base;
+               err = res->fh_size + offsetof(struct knfsd_fh, fh_base);
  out:
        return err;
 }
@@ -299,7 +298,7 @@ static ssize_t write_filehandle(struct file *file, char *buf, size_t size)
         * qword quoting is used, so filehandle will be \x....
         */
        char *dname, *path;
-       int maxsize;
+       int uninitialized_var(maxsize);
        char *mesg = buf;
        int len;
        struct auth_domain *dom;
@@ -680,11 +679,13 @@ static int __init init_nfsd(void)
        int retval;
        printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n");
 
+       retval = nfs4_state_init(); /* nfs4 locking state */
+       if (retval)
+               return retval;
        nfsd_stat_init();       /* Statistics */
        nfsd_cache_init();      /* RPC reply cache */
        nfsd_export_init();     /* Exports table */
        nfsd_lockd_init();      /* lockd->nfsd callbacks */
-       nfs4_state_init();      /* NFSv4 locking state */
        nfsd_idmap_init();      /* Name to ID mapping */
        if (proc_mkdir("fs/nfs", NULL)) {
                struct proc_dir_entry *entry;
@@ -713,6 +714,7 @@ static void __exit exit_nfsd(void)
        nfsd_stat_shutdown();
        nfsd_lockd_shutdown();
        nfsd_idmap_shutdown();
+       nfsd4_free_slabs();
        unregister_filesystem(&nfsd_fs_type);
 }