aboutsummaryrefslogtreecommitdiffstats
path: root/security/inode.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-08 15:19:57 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-08 15:19:57 -0500
commit972b2c719990f91eb3b2310d44ef8a2d38955a14 (patch)
treeb25a250ec5bec4b7b6355d214642d8b57c5cab32 /security/inode.c
parent02550d61f49266930e674286379d3601006b2893 (diff)
parentc3aa077648e147783a7a53b409578234647db853 (diff)
Merge branch 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
* 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (165 commits) reiserfs: Properly display mount options in /proc/mounts vfs: prevent remount read-only if pending removes vfs: count unlinked inodes vfs: protect remounting superblock read-only vfs: keep list of mounts for each superblock vfs: switch ->show_options() to struct dentry * vfs: switch ->show_path() to struct dentry * vfs: switch ->show_devname() to struct dentry * vfs: switch ->show_stats to struct dentry * switch security_path_chmod() to struct path * vfs: prefer ->dentry->d_sb to ->mnt->mnt_sb vfs: trim includes a bit switch mnt_namespace ->root to struct mount vfs: take /proc/*/mounts and friends to fs/proc_namespace.c vfs: opencode mntget() mnt_set_mountpoint() vfs: spread struct mount - remaining argument of next_mnt() vfs: move fsnotify junk to struct mount vfs: move mnt_devname vfs: move mnt_list to struct mount vfs: switch pnode.h macros to struct mount * ...
Diffstat (limited to 'security/inode.c')
-rw-r--r--security/inode.c16
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
59static struct inode *get_inode(struct super_block *sb, int mode, dev_t dev) 59static 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 */
87static int mknod(struct inode *dir, struct dentry *dentry, 87static 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
105static int mkdir(struct inode *dir, struct dentry *dentry, int mode) 105static 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
116static int create(struct inode *dir, struct dentry *dentry, int mode) 116static 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
148static int create_by_name(const char *name, mode_t mode, 148static 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 */
208struct dentry *securityfs_create_file(const char *name, mode_t mode, 208struct 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{