mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-01 10:42:11 +00:00
get rid of open-coded S_ISREG(), etc.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
1b9d5ff764
commit
dba19c6064
@ -870,7 +870,7 @@ static int ceph_unlink(struct inode *dir, struct dentry *dentry)
|
|||||||
} else if (ceph_snap(dir) == CEPH_NOSNAP) {
|
} else if (ceph_snap(dir) == CEPH_NOSNAP) {
|
||||||
dout("unlink/rmdir dir %p dn %p inode %p\n",
|
dout("unlink/rmdir dir %p dn %p inode %p\n",
|
||||||
dir, dentry, inode);
|
dir, dentry, inode);
|
||||||
op = ((dentry->d_inode->i_mode & S_IFMT) == S_IFDIR) ?
|
op = S_ISDIR(dentry->d_inode->i_mode) ?
|
||||||
CEPH_MDS_OP_RMDIR : CEPH_MDS_OP_UNLINK;
|
CEPH_MDS_OP_RMDIR : CEPH_MDS_OP_UNLINK;
|
||||||
} else
|
} else
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -164,7 +164,7 @@ static int create_by_name(const char *name, mode_t mode,
|
|||||||
mutex_lock(&parent->d_inode->i_mutex);
|
mutex_lock(&parent->d_inode->i_mutex);
|
||||||
*dentry = lookup_one_len(name, parent, strlen(name));
|
*dentry = lookup_one_len(name, parent, strlen(name));
|
||||||
if (!IS_ERR(*dentry)) {
|
if (!IS_ERR(*dentry)) {
|
||||||
if ((mode & S_IFMT) == S_IFDIR)
|
if (S_ISDIR(mode))
|
||||||
error = mkdir(parent->d_inode, *dentry, mode);
|
error = mkdir(parent->d_inode, *dentry, mode);
|
||||||
else
|
else
|
||||||
error = create(parent->d_inode, *dentry, mode);
|
error = create(parent->d_inode, *dentry, mode);
|
||||||
|
@ -1740,7 +1740,7 @@ static inline u32 file_mask_to_av(int mode, int mask)
|
|||||||
{
|
{
|
||||||
u32 av = 0;
|
u32 av = 0;
|
||||||
|
|
||||||
if ((mode & S_IFMT) != S_IFDIR) {
|
if (!S_ISDIR(mode)) {
|
||||||
if (mask & MAY_EXEC)
|
if (mask & MAY_EXEC)
|
||||||
av |= FILE__EXECUTE;
|
av |= FILE__EXECUTE;
|
||||||
if (mask & MAY_READ)
|
if (mask & MAY_READ)
|
||||||
|
Loading…
Reference in New Issue
Block a user