diff options
Diffstat (limited to 'fs/nilfs2/inode.c')
-rw-r--r-- | fs/nilfs2/inode.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index 0957b58f909d..39e038ac8fcb 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c | |||
@@ -280,16 +280,7 @@ struct inode *nilfs_new_inode(struct inode *dir, int mode) | |||
280 | /* reference count of i_bh inherits from nilfs_mdt_read_block() */ | 280 | /* reference count of i_bh inherits from nilfs_mdt_read_block() */ |
281 | 281 | ||
282 | atomic_inc(&sbi->s_inodes_count); | 282 | atomic_inc(&sbi->s_inodes_count); |
283 | 283 | inode_init_owner(inode, dir, mode); | |
284 | inode->i_uid = current_fsuid(); | ||
285 | if (dir->i_mode & S_ISGID) { | ||
286 | inode->i_gid = dir->i_gid; | ||
287 | if (S_ISDIR(mode)) | ||
288 | mode |= S_ISGID; | ||
289 | } else | ||
290 | inode->i_gid = current_fsgid(); | ||
291 | |||
292 | inode->i_mode = mode; | ||
293 | inode->i_ino = ino; | 284 | inode->i_ino = ino; |
294 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 285 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
295 | 286 | ||
@@ -451,7 +442,7 @@ static int __nilfs_read_inode(struct super_block *sb, unsigned long ino, | |||
451 | inode->i_op = &nilfs_special_inode_operations; | 442 | inode->i_op = &nilfs_special_inode_operations; |
452 | init_special_inode( | 443 | init_special_inode( |
453 | inode, inode->i_mode, | 444 | inode, inode->i_mode, |
454 | new_decode_dev(le64_to_cpu(raw_inode->i_device_code))); | 445 | huge_decode_dev(le64_to_cpu(raw_inode->i_device_code))); |
455 | } | 446 | } |
456 | nilfs_ifile_unmap_inode(sbi->s_ifile, ino, bh); | 447 | nilfs_ifile_unmap_inode(sbi->s_ifile, ino, bh); |
457 | brelse(bh); | 448 | brelse(bh); |
@@ -511,7 +502,7 @@ void nilfs_write_inode_common(struct inode *inode, | |||
511 | nilfs_bmap_write(ii->i_bmap, raw_inode); | 502 | nilfs_bmap_write(ii->i_bmap, raw_inode); |
512 | else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) | 503 | else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) |
513 | raw_inode->i_device_code = | 504 | raw_inode->i_device_code = |
514 | cpu_to_le64(new_encode_dev(inode->i_rdev)); | 505 | cpu_to_le64(huge_encode_dev(inode->i_rdev)); |
515 | /* When extending inode, nilfs->ns_inode_size should be checked | 506 | /* When extending inode, nilfs->ns_inode_size should be checked |
516 | for substitutions of appended fields */ | 507 | for substitutions of appended fields */ |
517 | } | 508 | } |