Commit 85640bd9d47f6ad0290558009e9313632a45861b
Committed by
Al Viro
1 parent
04b7ed0d33
Exists in
master
and in
4 other branches
sysv: replace inode uid,gid,mode initialization with helper function
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 1 changed file with 1 additions and 10 deletions Side-by-side Diff
fs/sysv/ialloc.c
... | ... | @@ -159,15 +159,7 @@ |
159 | 159 | *sbi->s_sb_fic_count = cpu_to_fs16(sbi, count); |
160 | 160 | fs16_add(sbi, sbi->s_sb_total_free_inodes, -1); |
161 | 161 | dirty_sb(sb); |
162 | - | |
163 | - if (dir->i_mode & S_ISGID) { | |
164 | - inode->i_gid = dir->i_gid; | |
165 | - if (S_ISDIR(mode)) | |
166 | - mode |= S_ISGID; | |
167 | - } else | |
168 | - inode->i_gid = current_fsgid(); | |
169 | - | |
170 | - inode->i_uid = current_fsuid(); | |
162 | + inode_init_owner(inode, dir, mode); | |
171 | 163 | inode->i_ino = fs16_to_cpu(sbi, ino); |
172 | 164 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; |
173 | 165 | inode->i_blocks = 0; |
... | ... | @@ -176,7 +168,6 @@ |
176 | 168 | insert_inode_hash(inode); |
177 | 169 | mark_inode_dirty(inode); |
178 | 170 | |
179 | - inode->i_mode = mode; /* for sysv_write_inode() */ | |
180 | 171 | sysv_write_inode(inode, 0); /* ensure inode not allocated again */ |
181 | 172 | mark_inode_dirty(inode); /* cleared by sysv_write_inode() */ |
182 | 173 | /* That's it. */ |