mirror of
https://github.com/torvalds/linux.git
synced 2026-09-26 01:52:03 +02:00
xfs: create quota metadir inodes using xfs_metadir_create_file
Now that we have xfs_metadir_create_file() use it in xfs_dqinode_metadir_create(). Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
daf43402da
commit
e6ecb1a98d
|
|
@ -416,6 +416,15 @@ xfs_dqinode_load(
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
xfs_dqinode_init(
|
||||
struct xfs_metadir_update *upd,
|
||||
void *priv)
|
||||
{
|
||||
xfs_trans_log_inode(upd->tp, upd->ip, XFS_ILOG_CORE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Create a metadata directory quota inode. */
|
||||
int
|
||||
xfs_dqinode_metadir_create(
|
||||
|
|
@ -428,35 +437,9 @@ xfs_dqinode_metadir_create(
|
|||
.metafile_type = xfs_dqinode_metafile_type(type),
|
||||
.path = xfs_dqinode_path(type),
|
||||
};
|
||||
int error;
|
||||
|
||||
error = xfs_metadir_start_create(&upd);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
error = xfs_metadir_create(&upd, S_IFREG);
|
||||
if (error)
|
||||
goto out_cancel;
|
||||
|
||||
xfs_trans_log_inode(upd.tp, upd.ip, XFS_ILOG_CORE);
|
||||
|
||||
error = xfs_metadir_commit(&upd);
|
||||
if (error)
|
||||
goto out_irele;
|
||||
|
||||
xfs_finish_inode_setup(upd.ip);
|
||||
*ipp = upd.ip;
|
||||
return 0;
|
||||
|
||||
out_cancel:
|
||||
xfs_metadir_cancel(&upd, error);
|
||||
out_irele:
|
||||
/* Have to finish setting up the inode to ensure it's deleted. */
|
||||
if (upd.ip) {
|
||||
xfs_finish_inode_setup(upd.ip);
|
||||
xfs_irele(upd.ip);
|
||||
}
|
||||
return error;
|
||||
return xfs_metadir_create_file(&upd, S_IFREG, xfs_dqinode_init, NULL,
|
||||
ipp);
|
||||
}
|
||||
|
||||
#ifndef __KERNEL__
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user