diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-12-09 09:34:39 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-01-05 11:54:28 -0500 |
commit | 56ff5efad96182f4d3cb3dc6b07396762c658f16 (patch) | |
tree | cb91f93aa2324573527165d56d230b606a3111ed | |
parent | acfa4380efe77e290d3a96b11cd4c9f24f4fbb18 (diff) |
zero i_uid/i_gid on inode allocation
... and don't bother in callers. Don't bother with zeroing i_blocks,
while we are at it - it's already been zeroed.
i_mode is not worth the effort; it has no common default value.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
31 files changed, 2 insertions, 66 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 6296bfd9cb0b..e309ef70a531 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -97,7 +97,6 @@ spufs_new_inode(struct super_block *sb, int mode) | |||
97 | inode->i_mode = mode; | 97 | inode->i_mode = mode; |
98 | inode->i_uid = current_fsuid(); | 98 | inode->i_uid = current_fsuid(); |
99 | inode->i_gid = current_fsgid(); | 99 | inode->i_gid = current_fsgid(); |
100 | inode->i_blocks = 0; | ||
101 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 100 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
102 | out: | 101 | out: |
103 | return inode; | 102 | return inode; |
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index 9d4f8e6c0800..5a805df216bb 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c | |||
@@ -106,7 +106,6 @@ static struct inode *hypfs_make_inode(struct super_block *sb, int mode) | |||
106 | ret->i_mode = mode; | 106 | ret->i_mode = mode; |
107 | ret->i_uid = hypfs_info->uid; | 107 | ret->i_uid = hypfs_info->uid; |
108 | ret->i_gid = hypfs_info->gid; | 108 | ret->i_gid = hypfs_info->gid; |
109 | ret->i_blocks = 0; | ||
110 | ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; | 109 | ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; |
111 | if (mode & S_IFDIR) | 110 | if (mode & S_IFDIR) |
112 | ret->i_nlink = 2; | 111 | ret->i_nlink = 2; |
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c index 53912c327bfe..8dc2bb781605 100644 --- a/drivers/infiniband/hw/ipath/ipath_fs.c +++ b/drivers/infiniband/hw/ipath/ipath_fs.c | |||
@@ -57,9 +57,6 @@ static int ipathfs_mknod(struct inode *dir, struct dentry *dentry, | |||
57 | } | 57 | } |
58 | 58 | ||
59 | inode->i_mode = mode; | 59 | inode->i_mode = mode; |
60 | inode->i_uid = 0; | ||
61 | inode->i_gid = 0; | ||
62 | inode->i_blocks = 0; | ||
63 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 60 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
64 | inode->i_private = data; | 61 | inode->i_private = data; |
65 | if ((mode & S_IFMT) == S_IFDIR) { | 62 | if ((mode & S_IFMT) == S_IFDIR) { |
diff --git a/drivers/isdn/capi/capifs.c b/drivers/isdn/capi/capifs.c index 0aa66ec4cbdd..b129409925af 100644 --- a/drivers/isdn/capi/capifs.c +++ b/drivers/isdn/capi/capifs.c | |||
@@ -111,8 +111,6 @@ capifs_fill_super(struct super_block *s, void *data, int silent) | |||
111 | goto fail; | 111 | goto fail; |
112 | inode->i_ino = 1; | 112 | inode->i_ino = 1; |
113 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 113 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
114 | inode->i_blocks = 0; | ||
115 | inode->i_uid = inode->i_gid = 0; | ||
116 | inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR; | 114 | inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR; |
117 | inode->i_op = &simple_dir_inode_operations; | 115 | inode->i_op = &simple_dir_inode_operations; |
118 | inode->i_fop = &simple_dir_operations; | 116 | inode->i_fop = &simple_dir_operations; |
diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c index 22a7e8ba211d..de966a6fb7e6 100644 --- a/drivers/misc/ibmasm/ibmasmfs.c +++ b/drivers/misc/ibmasm/ibmasmfs.c | |||
@@ -146,8 +146,6 @@ static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode) | |||
146 | 146 | ||
147 | if (ret) { | 147 | if (ret) { |
148 | ret->i_mode = mode; | 148 | ret->i_mode = mode; |
149 | ret->i_uid = ret->i_gid = 0; | ||
150 | ret->i_blocks = 0; | ||
151 | ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; | 149 | ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; |
152 | } | 150 | } |
153 | return ret; | 151 | return ret; |
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c index ddc4c59f02dc..b7e4cee24269 100644 --- a/drivers/oprofile/oprofilefs.c +++ b/drivers/oprofile/oprofilefs.c | |||
@@ -29,9 +29,6 @@ static struct inode *oprofilefs_get_inode(struct super_block *sb, int mode) | |||
29 | 29 | ||
30 | if (inode) { | 30 | if (inode) { |
31 | inode->i_mode = mode; | 31 | inode->i_mode = mode; |
32 | inode->i_uid = 0; | ||
33 | inode->i_gid = 0; | ||
34 | inode->i_blocks = 0; | ||
35 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 32 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
36 | } | 33 | } |
37 | return inode; | 34 | return inode; |
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 185be760833e..2a129cb7bb56 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c | |||
@@ -279,7 +279,6 @@ static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t de | |||
279 | inode->i_mode = mode; | 279 | inode->i_mode = mode; |
280 | inode->i_uid = current_fsuid(); | 280 | inode->i_uid = current_fsuid(); |
281 | inode->i_gid = current_fsgid(); | 281 | inode->i_gid = current_fsgid(); |
282 | inode->i_blocks = 0; | ||
283 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 282 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
284 | switch (mode & S_IFMT) { | 283 | switch (mode & S_IFMT) { |
285 | default: | 284 | default: |
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index eeb26c0f88e5..317b48fdbf01 100644 --- a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c | |||
@@ -2001,7 +2001,6 @@ gadgetfs_make_inode (struct super_block *sb, | |||
2001 | inode->i_mode = mode; | 2001 | inode->i_mode = mode; |
2002 | inode->i_uid = default_uid; | 2002 | inode->i_uid = default_uid; |
2003 | inode->i_gid = default_gid; | 2003 | inode->i_gid = default_gid; |
2004 | inode->i_blocks = 0; | ||
2005 | inode->i_atime = inode->i_mtime = inode->i_ctime | 2004 | inode->i_atime = inode->i_mtime = inode->i_ctime |
2006 | = CURRENT_TIME; | 2005 | = CURRENT_TIME; |
2007 | inode->i_private = data; | 2006 | inode->i_private = data; |
diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c index c773680d5c60..e1734f2d6e26 100644 --- a/fs/autofs/inode.c +++ b/fs/autofs/inode.c | |||
@@ -251,13 +251,11 @@ struct inode *autofs_iget(struct super_block *sb, unsigned long ino) | |||
251 | inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO; | 251 | inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO; |
252 | inode->i_nlink = 2; | 252 | inode->i_nlink = 2; |
253 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 253 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
254 | inode->i_blocks = 0; | ||
255 | 254 | ||
256 | if (ino == AUTOFS_ROOT_INO) { | 255 | if (ino == AUTOFS_ROOT_INO) { |
257 | inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR; | 256 | inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR; |
258 | inode->i_op = &autofs_root_inode_operations; | 257 | inode->i_op = &autofs_root_inode_operations; |
259 | inode->i_fop = &autofs_root_operations; | 258 | inode->i_fop = &autofs_root_operations; |
260 | inode->i_uid = inode->i_gid = 0; /* Changed in read_super */ | ||
261 | goto done; | 259 | goto done; |
262 | } | 260 | } |
263 | 261 | ||
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index 7b19802cfef4..cfc23e53b6f4 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c | |||
@@ -455,11 +455,7 @@ struct inode *autofs4_get_inode(struct super_block *sb, | |||
455 | if (sb->s_root) { | 455 | if (sb->s_root) { |
456 | inode->i_uid = sb->s_root->d_inode->i_uid; | 456 | inode->i_uid = sb->s_root->d_inode->i_uid; |
457 | inode->i_gid = sb->s_root->d_inode->i_gid; | 457 | inode->i_gid = sb->s_root->d_inode->i_gid; |
458 | } else { | ||
459 | inode->i_uid = 0; | ||
460 | inode->i_gid = 0; | ||
461 | } | 458 | } |
462 | inode->i_blocks = 0; | ||
463 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 459 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
464 | 460 | ||
465 | if (S_ISDIR(inf->mode)) { | 461 | if (S_ISDIR(inf->mode)) { |
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index f2744ab4e5b3..e1158cb4fbd6 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c | |||
@@ -496,9 +496,6 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode) | |||
496 | 496 | ||
497 | if (inode) { | 497 | if (inode) { |
498 | inode->i_mode = mode; | 498 | inode->i_mode = mode; |
499 | inode->i_uid = 0; | ||
500 | inode->i_gid = 0; | ||
501 | inode->i_blocks = 0; | ||
502 | inode->i_atime = inode->i_mtime = inode->i_ctime = | 499 | inode->i_atime = inode->i_mtime = inode->i_ctime = |
503 | current_fs_time(inode->i_sb); | 500 | current_fs_time(inode->i_sb); |
504 | } | 501 | } |
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index 4803ccc94480..5d349d38e056 100644 --- a/fs/configfs/inode.c +++ b/fs/configfs/inode.c | |||
@@ -117,8 +117,6 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr) | |||
117 | static inline void set_default_inode_attr(struct inode * inode, mode_t mode) | 117 | static inline void set_default_inode_attr(struct inode * inode, mode_t mode) |
118 | { | 118 | { |
119 | inode->i_mode = mode; | 119 | inode->i_mode = mode; |
120 | inode->i_uid = 0; | ||
121 | inode->i_gid = 0; | ||
122 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 120 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
123 | } | 121 | } |
124 | 122 | ||
@@ -136,7 +134,6 @@ struct inode * configfs_new_inode(mode_t mode, struct configfs_dirent * sd) | |||
136 | { | 134 | { |
137 | struct inode * inode = new_inode(configfs_sb); | 135 | struct inode * inode = new_inode(configfs_sb); |
138 | if (inode) { | 136 | if (inode) { |
139 | inode->i_blocks = 0; | ||
140 | inode->i_mapping->a_ops = &configfs_aops; | 137 | inode->i_mapping->a_ops = &configfs_aops; |
141 | inode->i_mapping->backing_dev_info = &configfs_backing_dev_info; | 138 | inode->i_mapping->backing_dev_info = &configfs_backing_dev_info; |
142 | inode->i_op = &configfs_inode_operations; | 139 | inode->i_op = &configfs_inode_operations; |
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index f40423eb1a14..a07338d2d140 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c | |||
@@ -83,8 +83,6 @@ static struct inode *get_cramfs_inode(struct super_block *sb, | |||
83 | inode->i_op = &page_symlink_inode_operations; | 83 | inode->i_op = &page_symlink_inode_operations; |
84 | inode->i_data.a_ops = &cramfs_aops; | 84 | inode->i_data.a_ops = &cramfs_aops; |
85 | } else { | 85 | } else { |
86 | inode->i_size = 0; | ||
87 | inode->i_blocks = 0; | ||
88 | init_special_inode(inode, inode->i_mode, | 86 | init_special_inode(inode, inode->i_mode, |
89 | old_decode_dev(cramfs_inode->size)); | 87 | old_decode_dev(cramfs_inode->size)); |
90 | } | 88 | } |
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 3dbe2169cf36..81ae9ea3c6e1 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c | |||
@@ -37,9 +37,6 @@ static struct inode *debugfs_get_inode(struct super_block *sb, int mode, dev_t d | |||
37 | 37 | ||
38 | if (inode) { | 38 | if (inode) { |
39 | inode->i_mode = mode; | 39 | inode->i_mode = mode; |
40 | inode->i_uid = 0; | ||
41 | inode->i_gid = 0; | ||
42 | inode->i_blocks = 0; | ||
43 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 40 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
44 | switch (mode & S_IFMT) { | 41 | switch (mode & S_IFMT) { |
45 | default: | 42 | default: |
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index fff96e152c0c..5f3231b9633f 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c | |||
@@ -189,8 +189,6 @@ static int mknod_ptmx(struct super_block *sb) | |||
189 | } | 189 | } |
190 | 190 | ||
191 | inode->i_ino = 2; | 191 | inode->i_ino = 2; |
192 | inode->i_uid = inode->i_gid = 0; | ||
193 | inode->i_blocks = 0; | ||
194 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 192 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
195 | 193 | ||
196 | mode = S_IFCHR|opts->ptmxmode; | 194 | mode = S_IFCHR|opts->ptmxmode; |
@@ -300,8 +298,6 @@ devpts_fill_super(struct super_block *s, void *data, int silent) | |||
300 | goto free_fsi; | 298 | goto free_fsi; |
301 | inode->i_ino = 1; | 299 | inode->i_ino = 1; |
302 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 300 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
303 | inode->i_blocks = 0; | ||
304 | inode->i_uid = inode->i_gid = 0; | ||
305 | inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR; | 301 | inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR; |
306 | inode->i_op = &simple_dir_inode_operations; | 302 | inode->i_op = &simple_dir_inode_operations; |
307 | inode->i_fop = &simple_dir_operations; | 303 | inode->i_fop = &simple_dir_operations; |
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 7d479ce3aceb..0ab0c6f5f438 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -506,7 +506,6 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, uid_t uid, | |||
506 | inode->i_mode = mode; | 506 | inode->i_mode = mode; |
507 | inode->i_uid = uid; | 507 | inode->i_uid = uid; |
508 | inode->i_gid = gid; | 508 | inode->i_gid = gid; |
509 | inode->i_blocks = 0; | ||
510 | inode->i_mapping->a_ops = &hugetlbfs_aops; | 509 | inode->i_mapping->a_ops = &hugetlbfs_aops; |
511 | inode->i_mapping->backing_dev_info =&hugetlbfs_backing_dev_info; | 510 | inode->i_mapping->backing_dev_info =&hugetlbfs_backing_dev_info; |
512 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 511 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
diff --git a/fs/inode.c b/fs/inode.c index 7de1cda92489..bd48e5e6d3e8 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -131,6 +131,8 @@ struct inode *inode_init_always(struct super_block *sb, struct inode *inode) | |||
131 | inode->i_op = &empty_iops; | 131 | inode->i_op = &empty_iops; |
132 | inode->i_fop = &empty_fops; | 132 | inode->i_fop = &empty_fops; |
133 | inode->i_nlink = 1; | 133 | inode->i_nlink = 1; |
134 | inode->i_uid = 0; | ||
135 | inode->i_gid = 0; | ||
134 | atomic_set(&inode->i_writecount, 0); | 136 | atomic_set(&inode->i_writecount, 0); |
135 | inode->i_size = 0; | 137 | inode->i_size = 0; |
136 | inode->i_blocks = 0; | 138 | inode->i_blocks = 0; |
diff --git a/fs/libfs.c b/fs/libfs.c index e960a8321902..7de05f7ce746 100644 --- a/fs/libfs.c +++ b/fs/libfs.c | |||
@@ -231,7 +231,6 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name, | |||
231 | */ | 231 | */ |
232 | root->i_ino = 1; | 232 | root->i_ino = 1; |
233 | root->i_mode = S_IFDIR | S_IRUSR | S_IWUSR; | 233 | root->i_mode = S_IFDIR | S_IRUSR | S_IWUSR; |
234 | root->i_uid = root->i_gid = 0; | ||
235 | root->i_atime = root->i_mtime = root->i_ctime = CURRENT_TIME; | 234 | root->i_atime = root->i_mtime = root->i_ctime = CURRENT_TIME; |
236 | dentry = d_alloc(NULL, &d_name); | 235 | dentry = d_alloc(NULL, &d_name); |
237 | if (!dentry) { | 236 | if (!dentry) { |
@@ -436,8 +435,6 @@ int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files | |||
436 | */ | 435 | */ |
437 | inode->i_ino = 1; | 436 | inode->i_ino = 1; |
438 | inode->i_mode = S_IFDIR | 0755; | 437 | inode->i_mode = S_IFDIR | 0755; |
439 | inode->i_uid = inode->i_gid = 0; | ||
440 | inode->i_blocks = 0; | ||
441 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 438 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
442 | inode->i_op = &simple_dir_inode_operations; | 439 | inode->i_op = &simple_dir_inode_operations; |
443 | inode->i_fop = &simple_dir_operations; | 440 | inode->i_fop = &simple_dir_operations; |
@@ -464,8 +461,6 @@ int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files | |||
464 | if (!inode) | 461 | if (!inode) |
465 | goto out; | 462 | goto out; |
466 | inode->i_mode = S_IFREG | files->mode; | 463 | inode->i_mode = S_IFREG | files->mode; |
467 | inode->i_uid = inode->i_gid = 0; | ||
468 | inode->i_blocks = 0; | ||
469 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 464 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
470 | inode->i_fop = files->ops; | 465 | inode->i_fop = files->ops; |
471 | inode->i_ino = i; | 466 | inode->i_ino = i; |
diff --git a/fs/ocfs2/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c index 6f7a77d54020..1c9efb406a96 100644 --- a/fs/ocfs2/dlm/dlmfs.c +++ b/fs/ocfs2/dlm/dlmfs.c | |||
@@ -341,7 +341,6 @@ static struct inode *dlmfs_get_root_inode(struct super_block *sb) | |||
341 | inode->i_mode = mode; | 341 | inode->i_mode = mode; |
342 | inode->i_uid = current_fsuid(); | 342 | inode->i_uid = current_fsuid(); |
343 | inode->i_gid = current_fsgid(); | 343 | inode->i_gid = current_fsgid(); |
344 | inode->i_blocks = 0; | ||
345 | inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info; | 344 | inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info; |
346 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 345 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
347 | inc_nlink(inode); | 346 | inc_nlink(inode); |
@@ -367,7 +366,6 @@ static struct inode *dlmfs_get_inode(struct inode *parent, | |||
367 | inode->i_mode = mode; | 366 | inode->i_mode = mode; |
368 | inode->i_uid = current_fsuid(); | 367 | inode->i_uid = current_fsuid(); |
369 | inode->i_gid = current_fsgid(); | 368 | inode->i_gid = current_fsgid(); |
370 | inode->i_blocks = 0; | ||
371 | inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info; | 369 | inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info; |
372 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 370 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
373 | 371 | ||
diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index 6afe57c84f84..633e9dc972bb 100644 --- a/fs/omfs/inode.c +++ b/fs/omfs/inode.c | |||
@@ -39,7 +39,6 @@ struct inode *omfs_new_inode(struct inode *dir, int mode) | |||
39 | inode->i_mode = mode; | 39 | inode->i_mode = mode; |
40 | inode->i_uid = current_fsuid(); | 40 | inode->i_uid = current_fsuid(); |
41 | inode->i_gid = current_fsgid(); | 41 | inode->i_gid = current_fsgid(); |
42 | inode->i_blocks = 0; | ||
43 | inode->i_mapping->a_ops = &omfs_aops; | 42 | inode->i_mapping->a_ops = &omfs_aops; |
44 | 43 | ||
45 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 44 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c index d41bdc784de4..ffcd04f0012c 100644 --- a/fs/openpromfs/inode.c +++ b/fs/openpromfs/inode.c | |||
@@ -256,9 +256,6 @@ found: | |||
256 | break; | 256 | break; |
257 | } | 257 | } |
258 | 258 | ||
259 | inode->i_gid = 0; | ||
260 | inode->i_uid = 0; | ||
261 | |||
262 | d_add(dentry, inode); | 259 | d_add(dentry, inode); |
263 | return NULL; | 260 | return NULL; |
264 | } | 261 | } |
diff --git a/fs/proc/base.c b/fs/proc/base.c index cad92c1ac2b3..10fd5223d600 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1426,8 +1426,6 @@ static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_st | |||
1426 | if (!ei->pid) | 1426 | if (!ei->pid) |
1427 | goto out_unlock; | 1427 | goto out_unlock; |
1428 | 1428 | ||
1429 | inode->i_uid = 0; | ||
1430 | inode->i_gid = 0; | ||
1431 | if (task_dumpable(task)) { | 1429 | if (task_dumpable(task)) { |
1432 | rcu_read_lock(); | 1430 | rcu_read_lock(); |
1433 | cred = __task_cred(task); | 1431 | cred = __task_cred(task); |
@@ -2349,8 +2347,6 @@ static struct dentry *proc_base_instantiate(struct inode *dir, | |||
2349 | if (!ei->pid) | 2347 | if (!ei->pid) |
2350 | goto out_iput; | 2348 | goto out_iput; |
2351 | 2349 | ||
2352 | inode->i_uid = 0; | ||
2353 | inode->i_gid = 0; | ||
2354 | inode->i_mode = p->mode; | 2350 | inode->i_mode = p->mode; |
2355 | if (S_ISDIR(inode->i_mode)) | 2351 | if (S_ISDIR(inode->i_mode)) |
2356 | inode->i_nlink = 2; | 2352 | inode->i_nlink = 2; |
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 06ed10b7da9e..94fcfff6863a 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c | |||
@@ -31,7 +31,6 @@ static struct inode *proc_sys_make_inode(struct super_block *sb, | |||
31 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 31 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
32 | inode->i_flags |= S_PRIVATE; /* tell selinux to ignore this inode */ | 32 | inode->i_flags |= S_PRIVATE; /* tell selinux to ignore this inode */ |
33 | inode->i_mode = table->mode; | 33 | inode->i_mode = table->mode; |
34 | inode->i_uid = inode->i_gid = 0; | ||
35 | if (!table->child) { | 34 | if (!table->child) { |
36 | inode->i_mode |= S_IFREG; | 35 | inode->i_mode |= S_IFREG; |
37 | inode->i_op = &proc_sys_inode_operations; | 36 | inode->i_op = &proc_sys_inode_operations; |
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c index a83a3518ae33..b7e6ac706b87 100644 --- a/fs/ramfs/inode.c +++ b/fs/ramfs/inode.c | |||
@@ -57,7 +57,6 @@ struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev) | |||
57 | inode->i_mode = mode; | 57 | inode->i_mode = mode; |
58 | inode->i_uid = current_fsuid(); | 58 | inode->i_uid = current_fsuid(); |
59 | inode->i_gid = current_fsgid(); | 59 | inode->i_gid = current_fsgid(); |
60 | inode->i_blocks = 0; | ||
61 | inode->i_mapping->a_ops = &ramfs_aops; | 60 | inode->i_mapping->a_ops = &ramfs_aops; |
62 | inode->i_mapping->backing_dev_info = &ramfs_backing_dev_info; | 61 | inode->i_mapping->backing_dev_info = &ramfs_backing_dev_info; |
63 | mapping_set_gfp_mask(inode->i_mapping, GFP_HIGHUSER); | 62 | mapping_set_gfp_mask(inode->i_mapping, GFP_HIGHUSER); |
diff --git a/fs/romfs/inode.c b/fs/romfs/inode.c index 60d2f822e87b..c97d4c931715 100644 --- a/fs/romfs/inode.c +++ b/fs/romfs/inode.c | |||
@@ -524,7 +524,6 @@ romfs_iget(struct super_block *sb, unsigned long ino) | |||
524 | i->i_size = be32_to_cpu(ri.size); | 524 | i->i_size = be32_to_cpu(ri.size); |
525 | i->i_mtime.tv_sec = i->i_atime.tv_sec = i->i_ctime.tv_sec = 0; | 525 | i->i_mtime.tv_sec = i->i_atime.tv_sec = i->i_ctime.tv_sec = 0; |
526 | i->i_mtime.tv_nsec = i->i_atime.tv_nsec = i->i_ctime.tv_nsec = 0; | 526 | i->i_mtime.tv_nsec = i->i_atime.tv_nsec = i->i_ctime.tv_nsec = 0; |
527 | i->i_uid = i->i_gid = 0; | ||
528 | 527 | ||
529 | /* Precalculate the data offset */ | 528 | /* Precalculate the data offset */ |
530 | ino = romfs_strnlen(i, ino+ROMFH_SIZE, ROMFS_MAXFN); | 529 | ino = romfs_strnlen(i, ino+ROMFH_SIZE, ROMFS_MAXFN); |
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index eb53c632f856..dfa3d94cfc74 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -107,8 +107,6 @@ int sysfs_setattr(struct dentry * dentry, struct iattr * iattr) | |||
107 | static inline void set_default_inode_attr(struct inode * inode, mode_t mode) | 107 | static inline void set_default_inode_attr(struct inode * inode, mode_t mode) |
108 | { | 108 | { |
109 | inode->i_mode = mode; | 109 | inode->i_mode = mode; |
110 | inode->i_uid = 0; | ||
111 | inode->i_gid = 0; | ||
112 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 110 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
113 | } | 111 | } |
114 | 112 | ||
@@ -149,7 +147,6 @@ static void sysfs_init_inode(struct sysfs_dirent *sd, struct inode *inode) | |||
149 | { | 147 | { |
150 | struct bin_attribute *bin_attr; | 148 | struct bin_attribute *bin_attr; |
151 | 149 | ||
152 | inode->i_blocks = 0; | ||
153 | inode->i_mapping->a_ops = &sysfs_aops; | 150 | inode->i_mapping->a_ops = &sysfs_aops; |
154 | inode->i_mapping->backing_dev_info = &sysfs_backing_dev_info; | 151 | inode->i_mapping->backing_dev_info = &sysfs_backing_dev_info; |
155 | inode->i_op = &sysfs_inode_operations; | 152 | inode->i_op = &sysfs_inode_operations; |
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index d9393f8e4c3e..41b72f02fa70 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -120,7 +120,6 @@ static struct inode *mqueue_get_inode(struct super_block *sb, int mode, | |||
120 | inode->i_mode = mode; | 120 | inode->i_mode = mode; |
121 | inode->i_uid = current_fsuid(); | 121 | inode->i_uid = current_fsuid(); |
122 | inode->i_gid = current_fsgid(); | 122 | inode->i_gid = current_fsgid(); |
123 | inode->i_blocks = 0; | ||
124 | inode->i_mtime = inode->i_ctime = inode->i_atime = | 123 | inode->i_mtime = inode->i_ctime = inode->i_atime = |
125 | CURRENT_TIME; | 124 | CURRENT_TIME; |
126 | 125 | ||
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 48348dde6d81..f7c5099a0572 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -573,7 +573,6 @@ static struct inode *cgroup_new_inode(mode_t mode, struct super_block *sb) | |||
573 | inode->i_mode = mode; | 573 | inode->i_mode = mode; |
574 | inode->i_uid = current_fsuid(); | 574 | inode->i_uid = current_fsuid(); |
575 | inode->i_gid = current_fsgid(); | 575 | inode->i_gid = current_fsgid(); |
576 | inode->i_blocks = 0; | ||
577 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 576 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
578 | inode->i_mapping->backing_dev_info = &cgroup_backing_dev_info; | 577 | inode->i_mapping->backing_dev_info = &cgroup_backing_dev_info; |
579 | } | 578 | } |
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 192453248870..577385a4a5dc 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
@@ -522,8 +522,6 @@ rpc_get_inode(struct super_block *sb, int mode) | |||
522 | if (!inode) | 522 | if (!inode) |
523 | return NULL; | 523 | return NULL; |
524 | inode->i_mode = mode; | 524 | inode->i_mode = mode; |
525 | inode->i_uid = inode->i_gid = 0; | ||
526 | inode->i_blocks = 0; | ||
527 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 525 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
528 | switch(mode & S_IFMT) { | 526 | switch(mode & S_IFMT) { |
529 | case S_IFDIR: | 527 | case S_IFDIR: |
diff --git a/security/inode.c b/security/inode.c index efea5a605466..007ef252dde7 100644 --- a/security/inode.c +++ b/security/inode.c | |||
@@ -61,9 +61,6 @@ static struct inode *get_inode(struct super_block *sb, int mode, dev_t dev) | |||
61 | 61 | ||
62 | if (inode) { | 62 | if (inode) { |
63 | inode->i_mode = mode; | 63 | inode->i_mode = mode; |
64 | inode->i_uid = 0; | ||
65 | inode->i_gid = 0; | ||
66 | inode->i_blocks = 0; | ||
67 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 64 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
68 | switch (mode & S_IFMT) { | 65 | switch (mode & S_IFMT) { |
69 | default: | 66 | default: |
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index e5520996a75b..8f612c8becb5 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c | |||
@@ -847,8 +847,6 @@ static struct inode *sel_make_inode(struct super_block *sb, int mode) | |||
847 | 847 | ||
848 | if (ret) { | 848 | if (ret) { |
849 | ret->i_mode = mode; | 849 | ret->i_mode = mode; |
850 | ret->i_uid = ret->i_gid = 0; | ||
851 | ret->i_blocks = 0; | ||
852 | ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; | 850 | ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; |
853 | } | 851 | } |
854 | return ret; | 852 | return ret; |