Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce3b0f8d authored by Al Viro's avatar Al Viro
Browse files

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent f1191b50
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -635,7 +635,7 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
	if (dentry->d_inode)
		goto out_dput;

	mode &= ~current->fs->umask;
	mode &= ~current_umask();

	if (flags & SPU_CREATE_GANG)
		ret = spufs_create_gang(nd->path.dentry->d_inode,
+1 −1
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ int btrfs_init_acl(struct inode *inode, struct inode *dir)
		}

		if (!acl)
			inode->i_mode &= ~current->fs->umask;
			inode->i_mode &= ~current_umask();
	}

	if (IS_POSIXACL(dir) && acl) {
+1 −1
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ static noinline int btrfs_mksubvol(struct path *parent, char *name,
		goto out_dput;

	if (!IS_POSIXACL(parent->dentry->d_inode))
		mode &= ~current->fs->umask;
		mode &= ~current_umask();

	error = mnt_want_write(parent->mnt);
	if (error)
+2 −2
Original line number Diff line number Diff line
@@ -254,7 +254,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
		return -ENOMEM;
	}

	mode &= ~current->fs->umask;
	mode &= ~current_umask();
	if (oplockEnabled)
		oplock = REQ_OPLOCK;

@@ -479,7 +479,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
		rc = -ENOMEM;
	else if (pTcon->unix_ext) {
		struct cifs_unix_set_info_args args = {
			.mode	= mode & ~current->fs->umask,
			.mode	= mode & ~current_umask(),
			.ctime	= NO_CHANGE_64,
			.atime	= NO_CHANGE_64,
			.mtime	= NO_CHANGE_64,
+2 −2
Original line number Diff line number Diff line
@@ -1125,7 +1125,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
			goto mkdir_out;
		}

		mode &= ~current->fs->umask;
		mode &= ~current_umask();
		rc = CIFSPOSIXCreate(xid, pTcon, SMB_O_DIRECTORY | SMB_O_CREAT,
				mode, NULL /* netfid */, pInfo, &oplock,
				full_path, cifs_sb->local_nls,
@@ -1204,7 +1204,7 @@ mkdir_get_info:
		if ((direntry->d_inode) && (direntry->d_inode->i_nlink < 2))
				direntry->d_inode->i_nlink = 2;

		mode &= ~current->fs->umask;
		mode &= ~current_umask();
		/* must turn on setgid bit if parent dir has it */
		if (inode->i_mode & S_ISGID)
			mode |= S_ISGID;
Loading