aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-07-24 13:43:19 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-03 22:55:01 -0500
commit2b15ad068418a91687c2d5819c6c03c227d391f2 (patch)
tree1a9c5a6ec12d9aa2244b4c2c052a6954ddc45b92 /fs
parent3eda0de677b5756be09a76ac0399e1a3db00f0e0 (diff)
dlmfs: use inode_init_owner()
don't open-code it... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/dlmfs/dlmfs.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
index ccb33289c29a..9e1090b8dd3b 100644
--- a/fs/ocfs2/dlmfs/dlmfs.c
+++ b/fs/ocfs2/dlmfs/dlmfs.c
@@ -407,9 +407,7 @@ static struct inode *dlmfs_get_root_inode(struct super_block *sb)
407 ip = DLMFS_I(inode); 407 ip = DLMFS_I(inode);
408 408
409 inode->i_ino = get_next_ino(); 409 inode->i_ino = get_next_ino();
410 inode->i_mode = mode; 410 inode_init_owner(inode, NULL, mode);
411 inode->i_uid = current_fsuid();
412 inode->i_gid = current_fsgid();
413 inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info; 411 inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info;
414 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 412 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
415 inc_nlink(inode); 413 inc_nlink(inode);
@@ -433,9 +431,7 @@ static struct inode *dlmfs_get_inode(struct inode *parent,
433 return NULL; 431 return NULL;
434 432
435 inode->i_ino = get_next_ino(); 433 inode->i_ino = get_next_ino();
436 inode->i_mode = mode; 434 inode_init_owner(inode, parent, mode);
437 inode->i_uid = current_fsuid();
438 inode->i_gid = current_fsgid();
439 inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info; 435 inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info;
440 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 436 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
441 437
@@ -472,13 +468,6 @@ static struct inode *dlmfs_get_inode(struct inode *parent,
472 inc_nlink(inode); 468 inc_nlink(inode);
473 break; 469 break;
474 } 470 }
475
476 if (parent->i_mode & S_ISGID) {
477 inode->i_gid = parent->i_gid;
478 if (S_ISDIR(mode))
479 inode->i_mode |= S_ISGID;
480 }
481
482 return inode; 471 return inode;
483} 472}
484 473