diff options
Diffstat (limited to 'security/inode.c')
-rw-r--r-- | security/inode.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/security/inode.c b/security/inode.c index c4df2fbebe6b..90a70a67d835 100644 --- a/security/inode.c +++ b/security/inode.c | |||
@@ -56,7 +56,7 @@ static const struct file_operations default_file_ops = { | |||
56 | .llseek = noop_llseek, | 56 | .llseek = noop_llseek, |
57 | }; | 57 | }; |
58 | 58 | ||
59 | static struct inode *get_inode(struct super_block *sb, int mode, dev_t dev) | 59 | static struct inode *get_inode(struct super_block *sb, umode_t mode, dev_t dev) |
60 | { | 60 | { |
61 | struct inode *inode = new_inode(sb); | 61 | struct inode *inode = new_inode(sb); |
62 | 62 | ||
@@ -85,7 +85,7 @@ static struct inode *get_inode(struct super_block *sb, int mode, dev_t dev) | |||
85 | 85 | ||
86 | /* SMP-safe */ | 86 | /* SMP-safe */ |
87 | static int mknod(struct inode *dir, struct dentry *dentry, | 87 | static int mknod(struct inode *dir, struct dentry *dentry, |
88 | int mode, dev_t dev) | 88 | umode_t mode, dev_t dev) |
89 | { | 89 | { |
90 | struct inode *inode; | 90 | struct inode *inode; |
91 | int error = -ENOMEM; | 91 | int error = -ENOMEM; |
@@ -102,7 +102,7 @@ static int mknod(struct inode *dir, struct dentry *dentry, | |||
102 | return error; | 102 | return error; |
103 | } | 103 | } |
104 | 104 | ||
105 | static int mkdir(struct inode *dir, struct dentry *dentry, int mode) | 105 | static int mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) |
106 | { | 106 | { |
107 | int res; | 107 | int res; |
108 | 108 | ||
@@ -113,7 +113,7 @@ static int mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
113 | return res; | 113 | return res; |
114 | } | 114 | } |
115 | 115 | ||
116 | static int create(struct inode *dir, struct dentry *dentry, int mode) | 116 | static int create(struct inode *dir, struct dentry *dentry, umode_t mode) |
117 | { | 117 | { |
118 | mode = (mode & S_IALLUGO) | S_IFREG; | 118 | mode = (mode & S_IALLUGO) | S_IFREG; |
119 | return mknod(dir, dentry, mode, 0); | 119 | return mknod(dir, dentry, mode, 0); |
@@ -145,7 +145,7 @@ static struct file_system_type fs_type = { | |||
145 | .kill_sb = kill_litter_super, | 145 | .kill_sb = kill_litter_super, |
146 | }; | 146 | }; |
147 | 147 | ||
148 | static int create_by_name(const char *name, mode_t mode, | 148 | static int create_by_name(const char *name, umode_t mode, |
149 | struct dentry *parent, | 149 | struct dentry *parent, |
150 | struct dentry **dentry) | 150 | struct dentry **dentry) |
151 | { | 151 | { |
@@ -159,12 +159,12 @@ static int create_by_name(const char *name, mode_t mode, | |||
159 | * have around. | 159 | * have around. |
160 | */ | 160 | */ |
161 | if (!parent) | 161 | if (!parent) |
162 | parent = mount->mnt_sb->s_root; | 162 | parent = mount->mnt_root; |
163 | 163 | ||
164 | mutex_lock(&parent->d_inode->i_mutex); | 164 | mutex_lock(&parent->d_inode->i_mutex); |
165 | *dentry = lookup_one_len(name, parent, strlen(name)); | 165 | *dentry = lookup_one_len(name, parent, strlen(name)); |
166 | if (!IS_ERR(*dentry)) { | 166 | if (!IS_ERR(*dentry)) { |
167 | if ((mode & S_IFMT) == S_IFDIR) | 167 | if (S_ISDIR(mode)) |
168 | error = mkdir(parent->d_inode, *dentry, mode); | 168 | error = mkdir(parent->d_inode, *dentry, mode); |
169 | else | 169 | else |
170 | error = create(parent->d_inode, *dentry, mode); | 170 | error = create(parent->d_inode, *dentry, mode); |
@@ -205,7 +205,7 @@ static int create_by_name(const char *name, mode_t mode, | |||
205 | * If securityfs is not enabled in the kernel, the value %-ENODEV is | 205 | * If securityfs is not enabled in the kernel, the value %-ENODEV is |
206 | * returned. | 206 | * returned. |
207 | */ | 207 | */ |
208 | struct dentry *securityfs_create_file(const char *name, mode_t mode, | 208 | struct dentry *securityfs_create_file(const char *name, umode_t mode, |
209 | struct dentry *parent, void *data, | 209 | struct dentry *parent, void *data, |
210 | const struct file_operations *fops) | 210 | const struct file_operations *fops) |
211 | { | 211 | { |