New helper - current_umask()
current->fs->umask is what most of fs_struct users are doing. Put that into a helper function. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -328,7 +328,7 @@ nfs3_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
|
||||
data->arg.create.verifier[1] = current->pid;
|
||||
}
|
||||
|
||||
sattr->ia_mode &= ~current->fs->umask;
|
||||
sattr->ia_mode &= ~current_umask();
|
||||
|
||||
for (;;) {
|
||||
status = nfs3_do_create(dir, dentry, data);
|
||||
@@ -528,7 +528,7 @@ nfs3_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr)
|
||||
|
||||
dprintk("NFS call mkdir %s\n", dentry->d_name.name);
|
||||
|
||||
sattr->ia_mode &= ~current->fs->umask;
|
||||
sattr->ia_mode &= ~current_umask();
|
||||
|
||||
data = nfs3_alloc_createdata();
|
||||
if (data == NULL)
|
||||
@@ -639,7 +639,7 @@ nfs3_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
|
||||
dprintk("NFS call mknod %s %u:%u\n", dentry->d_name.name,
|
||||
MAJOR(rdev), MINOR(rdev));
|
||||
|
||||
sattr->ia_mode &= ~current->fs->umask;
|
||||
sattr->ia_mode &= ~current_umask();
|
||||
|
||||
data = nfs3_alloc_createdata();
|
||||
if (data == NULL)
|
||||
|
@@ -1509,7 +1509,7 @@ nfs4_atomic_open(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
|
||||
attr.ia_mode = nd->intent.open.create_mode;
|
||||
attr.ia_valid = ATTR_MODE;
|
||||
if (!IS_POSIXACL(dir))
|
||||
attr.ia_mode &= ~current->fs->umask;
|
||||
attr.ia_mode &= ~current_umask();
|
||||
} else {
|
||||
attr.ia_valid = 0;
|
||||
BUG_ON(nd->intent.open.flags & O_CREAT);
|
||||
|
Reference in New Issue
Block a user