diff options
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index ac2899098147..fd9a872fada0 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -47,13 +47,13 @@ static int nfs_opendir(struct inode *, struct file *); | |||
47 | static int nfs_closedir(struct inode *, struct file *); | 47 | static int nfs_closedir(struct inode *, struct file *); |
48 | static int nfs_readdir(struct file *, void *, filldir_t); | 48 | static int nfs_readdir(struct file *, void *, filldir_t); |
49 | static struct dentry *nfs_lookup(struct inode *, struct dentry *, struct nameidata *); | 49 | static struct dentry *nfs_lookup(struct inode *, struct dentry *, struct nameidata *); |
50 | static int nfs_create(struct inode *, struct dentry *, int, struct nameidata *); | 50 | static int nfs_create(struct inode *, struct dentry *, umode_t, struct nameidata *); |
51 | static int nfs_mkdir(struct inode *, struct dentry *, int); | 51 | static int nfs_mkdir(struct inode *, struct dentry *, umode_t); |
52 | static int nfs_rmdir(struct inode *, struct dentry *); | 52 | static int nfs_rmdir(struct inode *, struct dentry *); |
53 | static int nfs_unlink(struct inode *, struct dentry *); | 53 | static int nfs_unlink(struct inode *, struct dentry *); |
54 | static int nfs_symlink(struct inode *, struct dentry *, const char *); | 54 | static int nfs_symlink(struct inode *, struct dentry *, const char *); |
55 | static int nfs_link(struct dentry *, struct inode *, struct dentry *); | 55 | static int nfs_link(struct dentry *, struct inode *, struct dentry *); |
56 | static int nfs_mknod(struct inode *, struct dentry *, int, dev_t); | 56 | static int nfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); |
57 | static int nfs_rename(struct inode *, struct dentry *, | 57 | static int nfs_rename(struct inode *, struct dentry *, |
58 | struct inode *, struct dentry *); | 58 | struct inode *, struct dentry *); |
59 | static int nfs_fsync_dir(struct file *, loff_t, loff_t, int); | 59 | static int nfs_fsync_dir(struct file *, loff_t, loff_t, int); |
@@ -112,7 +112,7 @@ const struct inode_operations nfs3_dir_inode_operations = { | |||
112 | #ifdef CONFIG_NFS_V4 | 112 | #ifdef CONFIG_NFS_V4 |
113 | 113 | ||
114 | static struct dentry *nfs_atomic_lookup(struct inode *, struct dentry *, struct nameidata *); | 114 | static struct dentry *nfs_atomic_lookup(struct inode *, struct dentry *, struct nameidata *); |
115 | static int nfs_open_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd); | 115 | static int nfs_open_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *nd); |
116 | const struct inode_operations nfs4_dir_inode_operations = { | 116 | const struct inode_operations nfs4_dir_inode_operations = { |
117 | .create = nfs_open_create, | 117 | .create = nfs_open_create, |
118 | .lookup = nfs_atomic_lookup, | 118 | .lookup = nfs_atomic_lookup, |
@@ -1368,18 +1368,7 @@ static fmode_t flags_to_mode(int flags) | |||
1368 | 1368 | ||
1369 | static struct nfs_open_context *create_nfs_open_context(struct dentry *dentry, int open_flags) | 1369 | static struct nfs_open_context *create_nfs_open_context(struct dentry *dentry, int open_flags) |
1370 | { | 1370 | { |
1371 | struct nfs_open_context *ctx; | 1371 | return alloc_nfs_open_context(dentry, flags_to_mode(open_flags)); |
1372 | struct rpc_cred *cred; | ||
1373 | fmode_t fmode = flags_to_mode(open_flags); | ||
1374 | |||
1375 | cred = rpc_lookup_cred(); | ||
1376 | if (IS_ERR(cred)) | ||
1377 | return ERR_CAST(cred); | ||
1378 | ctx = alloc_nfs_open_context(dentry, cred, fmode); | ||
1379 | put_rpccred(cred); | ||
1380 | if (ctx == NULL) | ||
1381 | return ERR_PTR(-ENOMEM); | ||
1382 | return ctx; | ||
1383 | } | 1372 | } |
1384 | 1373 | ||
1385 | static int do_open(struct inode *inode, struct file *filp) | 1374 | static int do_open(struct inode *inode, struct file *filp) |
@@ -1584,8 +1573,8 @@ no_open: | |||
1584 | return nfs_lookup_revalidate(dentry, nd); | 1573 | return nfs_lookup_revalidate(dentry, nd); |
1585 | } | 1574 | } |
1586 | 1575 | ||
1587 | static int nfs_open_create(struct inode *dir, struct dentry *dentry, int mode, | 1576 | static int nfs_open_create(struct inode *dir, struct dentry *dentry, |
1588 | struct nameidata *nd) | 1577 | umode_t mode, struct nameidata *nd) |
1589 | { | 1578 | { |
1590 | struct nfs_open_context *ctx = NULL; | 1579 | struct nfs_open_context *ctx = NULL; |
1591 | struct iattr attr; | 1580 | struct iattr attr; |
@@ -1675,8 +1664,8 @@ out_error: | |||
1675 | * that the operation succeeded on the server, but an error in the | 1664 | * that the operation succeeded on the server, but an error in the |
1676 | * reply path made it appear to have failed. | 1665 | * reply path made it appear to have failed. |
1677 | */ | 1666 | */ |
1678 | static int nfs_create(struct inode *dir, struct dentry *dentry, int mode, | 1667 | static int nfs_create(struct inode *dir, struct dentry *dentry, |
1679 | struct nameidata *nd) | 1668 | umode_t mode, struct nameidata *nd) |
1680 | { | 1669 | { |
1681 | struct iattr attr; | 1670 | struct iattr attr; |
1682 | int error; | 1671 | int error; |
@@ -1704,7 +1693,7 @@ out_err: | |||
1704 | * See comments for nfs_proc_create regarding failed operations. | 1693 | * See comments for nfs_proc_create regarding failed operations. |
1705 | */ | 1694 | */ |
1706 | static int | 1695 | static int |
1707 | nfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev) | 1696 | nfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) |
1708 | { | 1697 | { |
1709 | struct iattr attr; | 1698 | struct iattr attr; |
1710 | int status; | 1699 | int status; |
@@ -1730,7 +1719,7 @@ out_err: | |||
1730 | /* | 1719 | /* |
1731 | * See comments for nfs_proc_create regarding failed operations. | 1720 | * See comments for nfs_proc_create regarding failed operations. |
1732 | */ | 1721 | */ |
1733 | static int nfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) | 1722 | static int nfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) |
1734 | { | 1723 | { |
1735 | struct iattr attr; | 1724 | struct iattr attr; |
1736 | int error; | 1725 | int error; |