aboutsummaryrefslogtreecommitdiffstats
path: root/security/inode.c
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2006-12-12 18:13:32 -0500
committerDave Jones <davej@redhat.com>2006-12-12 18:13:32 -0500
commitf0eef25339f92f7cd4aeea23d9ae97987a5a1e82 (patch)
tree2472e94d39f43a9580a6d2d5d92de0b749023263 /security/inode.c
parent0cfea5dd98205f2fa318836da664a7d7df1afbc1 (diff)
parente1036502e5263851259d147771226161e5ccc85a (diff)
Merge ../linus
Diffstat (limited to 'security/inode.c')
-rw-r--r--security/inode.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/security/inode.c b/security/inode.c
index 47eb63480dac..9b16e14f3a80 100644
--- a/security/inode.c
+++ b/security/inode.c
@@ -44,8 +44,8 @@ static ssize_t default_write_file(struct file *file, const char __user *buf,
44 44
45static int default_open(struct inode *inode, struct file *file) 45static int default_open(struct inode *inode, struct file *file)
46{ 46{
47 if (inode->u.generic_ip) 47 if (inode->i_private)
48 file->private_data = inode->u.generic_ip; 48 file->private_data = inode->i_private;
49 49
50 return 0; 50 return 0;
51} 51}
@@ -64,7 +64,6 @@ static struct inode *get_inode(struct super_block *sb, int mode, dev_t dev)
64 inode->i_mode = mode; 64 inode->i_mode = mode;
65 inode->i_uid = 0; 65 inode->i_uid = 0;
66 inode->i_gid = 0; 66 inode->i_gid = 0;
67 inode->i_blksize = PAGE_CACHE_SIZE;
68 inode->i_blocks = 0; 67 inode->i_blocks = 0;
69 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 68 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
70 switch (mode & S_IFMT) { 69 switch (mode & S_IFMT) {
@@ -79,7 +78,7 @@ static struct inode *get_inode(struct super_block *sb, int mode, dev_t dev)
79 inode->i_fop = &simple_dir_operations; 78 inode->i_fop = &simple_dir_operations;
80 79
81 /* directory inodes start off with i_nlink == 2 (for "." entry) */ 80 /* directory inodes start off with i_nlink == 2 (for "." entry) */
82 inode->i_nlink++; 81 inc_nlink(inode);
83 break; 82 break;
84 } 83 }
85 } 84 }
@@ -112,7 +111,7 @@ static int mkdir(struct inode *dir, struct dentry *dentry, int mode)
112 mode = (mode & (S_IRWXUGO | S_ISVTX)) | S_IFDIR; 111 mode = (mode & (S_IRWXUGO | S_ISVTX)) | S_IFDIR;
113 res = mknod(dir, dentry, mode, 0); 112 res = mknod(dir, dentry, mode, 0);
114 if (!res) 113 if (!res)
115 dir->i_nlink++; 114 inc_nlink(dir);
116 return res; 115 return res;
117} 116}
118 117
@@ -194,7 +193,7 @@ static int create_by_name(const char *name, mode_t mode,
194 * directory dentry if set. If this paramater is NULL, then the 193 * directory dentry if set. If this paramater is NULL, then the
195 * file will be created in the root of the securityfs filesystem. 194 * file will be created in the root of the securityfs filesystem.
196 * @data: a pointer to something that the caller will want to get to later 195 * @data: a pointer to something that the caller will want to get to later
197 * on. The inode.u.generic_ip pointer will point to this value on 196 * on. The inode.i_private pointer will point to this value on
198 * the open() call. 197 * the open() call.
199 * @fops: a pointer to a struct file_operations that should be used for 198 * @fops: a pointer to a struct file_operations that should be used for
200 * this file. 199 * this file.
@@ -240,7 +239,7 @@ struct dentry *securityfs_create_file(const char *name, mode_t mode,
240 if (fops) 239 if (fops)
241 dentry->d_inode->i_fop = fops; 240 dentry->d_inode->i_fop = fops;
242 if (data) 241 if (data)
243 dentry->d_inode->u.generic_ip = data; 242 dentry->d_inode->i_private = data;
244 } 243 }
245exit: 244exit:
246 return dentry; 245 return dentry;