]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/nfsd/nfssvc.c
Take fs_struct handling to new file (fs/fs_struct.c)
[net-next-2.6.git] / fs / nfsd / nfssvc.c
index 07e4f5d7baa8c63f3639cfee85cb043d0ae8cd84..144d6991861464fc80529923273c55bef9322382 100644 (file)
@@ -404,7 +404,6 @@ static int
 nfsd(void *vrqstp)
 {
        struct svc_rqst *rqstp = (struct svc_rqst *) vrqstp;
-       struct fs_struct *fsp;
        int err, preverr = 0;
 
        /* Lock module and set up kernel thread */
@@ -413,13 +412,11 @@ nfsd(void *vrqstp)
        /* At this point, the thread shares current->fs
         * with the init process. We need to create files with a
         * umask of 0 instead of init's umask. */
-       fsp = copy_fs_struct(current->fs);
-       if (!fsp) {
+       if (unshare_fs_struct() < 0) {
                printk("Unable to start nfsd thread: out of memory\n");
                goto out;
        }
-       exit_fs(current);
-       current->fs = fsp;
+
        current->fs->umask = 0;
 
        /*