hypfs: umode_t noise and properly spelled S_ISDIR/S_ISREG
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -97,7 +97,7 @@ static void hypfs_delete_tree(struct dentry *root)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct inode *hypfs_make_inode(struct super_block *sb, int mode)
|
static struct inode *hypfs_make_inode(struct super_block *sb, umode_t mode)
|
||||||
{
|
{
|
||||||
struct inode *ret = new_inode(sb);
|
struct inode *ret = new_inode(sb);
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ static struct inode *hypfs_make_inode(struct super_block *sb, int mode)
|
|||||||
ret->i_uid = hypfs_info->uid;
|
ret->i_uid = hypfs_info->uid;
|
||||||
ret->i_gid = hypfs_info->gid;
|
ret->i_gid = hypfs_info->gid;
|
||||||
ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME;
|
ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME;
|
||||||
if (mode & S_IFDIR)
|
if (S_ISDIR(mode))
|
||||||
set_nlink(ret, 2);
|
set_nlink(ret, 2);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@@ -333,7 +333,7 @@ static void hypfs_kill_super(struct super_block *sb)
|
|||||||
|
|
||||||
static struct dentry *hypfs_create_file(struct super_block *sb,
|
static struct dentry *hypfs_create_file(struct super_block *sb,
|
||||||
struct dentry *parent, const char *name,
|
struct dentry *parent, const char *name,
|
||||||
char *data, mode_t mode)
|
char *data, umode_t mode)
|
||||||
{
|
{
|
||||||
struct dentry *dentry;
|
struct dentry *dentry;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
@@ -350,13 +350,13 @@ static struct dentry *hypfs_create_file(struct super_block *sb,
|
|||||||
dentry = ERR_PTR(-ENOMEM);
|
dentry = ERR_PTR(-ENOMEM);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (mode & S_IFREG) {
|
if (S_ISREG(mode)) {
|
||||||
inode->i_fop = &hypfs_file_ops;
|
inode->i_fop = &hypfs_file_ops;
|
||||||
if (data)
|
if (data)
|
||||||
inode->i_size = strlen(data);
|
inode->i_size = strlen(data);
|
||||||
else
|
else
|
||||||
inode->i_size = 0;
|
inode->i_size = 0;
|
||||||
} else if (mode & S_IFDIR) {
|
} else if (S_ISDIR(mode)) {
|
||||||
inode->i_op = &simple_dir_inode_operations;
|
inode->i_op = &simple_dir_inode_operations;
|
||||||
inode->i_fop = &simple_dir_operations;
|
inode->i_fop = &simple_dir_operations;
|
||||||
inc_nlink(parent->d_inode);
|
inc_nlink(parent->d_inode);
|
||||||
|
Reference in New Issue
Block a user