diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-03-29 19:00:13 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-03-31 23:00:26 -0400 |
commit | 3e93cd671813e204c258f1e6c797959920cf7772 (patch) | |
tree | a1e0b2d2da7d296cc1c53be9cd6efa5b94b01b5c /fs/nfsd | |
parent | f8ef3ed2bebd2c4cb9ece92efa185d7aead8831a (diff) |
Take fs_struct handling to new file (fs/fs_struct.c)
Pure code move; two new helper functions for nfsd and daemonize
(unshare_fs_struct() and daemonize_fs_struct() resp.; for now -
the same code as used to be in callers). unshare_fs_struct()
exported (for nfsd, as copy_fs_struct()/exit_fs() used to be),
copy_fs_struct() and exit_fs() don't need exports anymore.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfssvc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 07e4f5d7baa8..144d69918614 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c | |||
@@ -404,7 +404,6 @@ static int | |||
404 | nfsd(void *vrqstp) | 404 | nfsd(void *vrqstp) |
405 | { | 405 | { |
406 | struct svc_rqst *rqstp = (struct svc_rqst *) vrqstp; | 406 | struct svc_rqst *rqstp = (struct svc_rqst *) vrqstp; |
407 | struct fs_struct *fsp; | ||
408 | int err, preverr = 0; | 407 | int err, preverr = 0; |
409 | 408 | ||
410 | /* Lock module and set up kernel thread */ | 409 | /* Lock module and set up kernel thread */ |
@@ -413,13 +412,11 @@ nfsd(void *vrqstp) | |||
413 | /* At this point, the thread shares current->fs | 412 | /* At this point, the thread shares current->fs |
414 | * with the init process. We need to create files with a | 413 | * with the init process. We need to create files with a |
415 | * umask of 0 instead of init's umask. */ | 414 | * umask of 0 instead of init's umask. */ |
416 | fsp = copy_fs_struct(current->fs); | 415 | if (unshare_fs_struct() < 0) { |
417 | if (!fsp) { | ||
418 | printk("Unable to start nfsd thread: out of memory\n"); | 416 | printk("Unable to start nfsd thread: out of memory\n"); |
419 | goto out; | 417 | goto out; |
420 | } | 418 | } |
421 | exit_fs(current); | 419 | |
422 | current->fs = fsp; | ||
423 | current->fs->umask = 0; | 420 | current->fs->umask = 0; |
424 | 421 | ||
425 | /* | 422 | /* |