reiserfs: 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>
This commit is contained in:
parent
454abafe9d
commit
04b7ed0d33
@ -561,23 +561,13 @@ static int drop_new_inode(struct inode *inode)
|
|||||||
*/
|
*/
|
||||||
static int new_inode_init(struct inode *inode, struct inode *dir, int mode)
|
static int new_inode_init(struct inode *inode, struct inode *dir, int mode)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* the quota init calls have to know who to charge the quota to, so
|
|
||||||
** we have to set uid and gid here
|
|
||||||
*/
|
|
||||||
inode->i_uid = current_fsuid();
|
|
||||||
inode->i_mode = mode;
|
|
||||||
/* Make inode invalid - just in case we are going to drop it before
|
/* Make inode invalid - just in case we are going to drop it before
|
||||||
* the initialization happens */
|
* the initialization happens */
|
||||||
INODE_PKEY(inode)->k_objectid = 0;
|
INODE_PKEY(inode)->k_objectid = 0;
|
||||||
|
/* the quota init calls have to know who to charge the quota to, so
|
||||||
if (dir->i_mode & S_ISGID) {
|
** we have to set uid and gid here
|
||||||
inode->i_gid = dir->i_gid;
|
*/
|
||||||
if (S_ISDIR(mode))
|
inode_init_owner(inode, dir, mode);
|
||||||
inode->i_mode |= S_ISGID;
|
|
||||||
} else {
|
|
||||||
inode->i_gid = current_fsgid();
|
|
||||||
}
|
|
||||||
dquot_initialize(inode);
|
dquot_initialize(inode);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user