mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-24 23:13:37 -04:00
xfs: add a xfs_rmap_inode_bmbt_owner
Add a small wrapper for initializing the bmbt owner to i_ino. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
committed by
Carlos Maiolino
parent
f8b7c9a8b0
commit
ee237a900c
@@ -602,7 +602,7 @@ xfs_bmap_btree_to_extents(
|
||||
if ((error = xfs_btree_check_block(cur, cblock, 0, cbp)))
|
||||
return error;
|
||||
|
||||
xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
|
||||
xfs_rmap_inode_bmbt_owner(&oinfo, ip, whichfork);
|
||||
error = xfs_free_extent_later(cur->bc_tp, cbno, 1, &oinfo,
|
||||
XFS_AG_RESV_NONE, 0);
|
||||
if (error)
|
||||
@@ -676,7 +676,7 @@ xfs_bmap_extents_to_btree(
|
||||
memset(&args, 0, sizeof(args));
|
||||
args.tp = tp;
|
||||
args.mp = mp;
|
||||
xfs_rmap_ino_bmbt_owner(&args.oinfo, ip->i_ino, whichfork);
|
||||
xfs_rmap_inode_bmbt_owner(&args.oinfo, ip, whichfork);
|
||||
|
||||
args.minlen = args.maxlen = args.prod = 1;
|
||||
args.wasdel = wasdel;
|
||||
|
||||
@@ -217,7 +217,7 @@ xfs_bmbt_alloc_block(
|
||||
memset(&args, 0, sizeof(args));
|
||||
args.tp = cur->bc_tp;
|
||||
args.mp = cur->bc_mp;
|
||||
xfs_rmap_ino_bmbt_owner(&args.oinfo, cur->bc_ino.ip->i_ino,
|
||||
xfs_rmap_inode_bmbt_owner(&args.oinfo, cur->bc_ino.ip,
|
||||
cur->bc_ino.whichfork);
|
||||
args.minlen = args.maxlen = args.prod = 1;
|
||||
args.wasdel = cur->bc_flags & XFS_BTREE_BMBT_WASDEL;
|
||||
@@ -280,7 +280,7 @@ xfs_bmbt_free_block(
|
||||
struct xfs_owner_info oinfo;
|
||||
int error;
|
||||
|
||||
xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, cur->bc_ino.whichfork);
|
||||
xfs_rmap_inode_bmbt_owner(&oinfo, ip, cur->bc_ino.whichfork);
|
||||
error = xfs_free_extent_later(cur->bc_tp, fsbno, 1, &oinfo,
|
||||
XFS_AG_RESV_NONE, 0);
|
||||
if (error)
|
||||
|
||||
@@ -5607,7 +5607,7 @@ xfs_btree_alloc_metafile_block(
|
||||
|
||||
ASSERT(xfs_is_metadir_inode(ip));
|
||||
|
||||
xfs_rmap_ino_bmbt_owner(&args.oinfo, ip->i_ino, cur->bc_ino.whichfork);
|
||||
xfs_rmap_inode_bmbt_owner(&args.oinfo, ip, cur->bc_ino.whichfork);
|
||||
error = xfs_alloc_vextent_start_ag(&args, XFS_INODE_TO_FSB(ip));
|
||||
if (error)
|
||||
return error;
|
||||
@@ -5639,7 +5639,7 @@ xfs_btree_free_metafile_block(
|
||||
|
||||
ASSERT(xfs_is_metadir_inode(ip));
|
||||
|
||||
xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, cur->bc_ino.whichfork);
|
||||
xfs_rmap_inode_bmbt_owner(&oinfo, ip, cur->bc_ino.whichfork);
|
||||
error = xfs_free_extent_later(tp, fsbno, 1, &oinfo, XFS_AG_RESV_METAFILE,
|
||||
0);
|
||||
if (error)
|
||||
|
||||
@@ -21,6 +21,8 @@ xfs_rmap_ino_bmbt_owner(
|
||||
if (whichfork == XFS_ATTR_FORK)
|
||||
oi->oi_flags |= XFS_OWNER_INFO_ATTR_FORK;
|
||||
}
|
||||
#define xfs_rmap_inode_bmbt_owner(oi, ip, whichfork) \
|
||||
xfs_rmap_ino_bmbt_owner(oi, (ip)->i_ino, whichfork)
|
||||
|
||||
static inline void
|
||||
xfs_rmap_ino_owner(
|
||||
|
||||
@@ -600,7 +600,7 @@ xchk_bmap_btree(
|
||||
|
||||
/* Check the btree structure. */
|
||||
cur = xfs_bmbt_init_cursor(mp, sc->tp, ip, whichfork);
|
||||
xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
|
||||
xfs_rmap_inode_bmbt_owner(&oinfo, ip, whichfork);
|
||||
error = xchk_btree(sc, cur, xchk_bmapbt_rec, &oinfo, info);
|
||||
xfs_btree_del_cursor(cur, error);
|
||||
out:
|
||||
|
||||
@@ -760,7 +760,7 @@ xrep_bmap_build_new_fork(
|
||||
* Prepare to construct the new fork by initializing the new btree
|
||||
* structure and creating a fake ifork in the ifakeroot structure.
|
||||
*/
|
||||
xfs_rmap_ino_bmbt_owner(&oinfo, sc->ip->i_ino, rb->whichfork);
|
||||
xfs_rmap_inode_bmbt_owner(&oinfo, sc->ip, rb->whichfork);
|
||||
error = xrep_newbt_init_inode(&rb->new_bmapbt, sc, rb->whichfork,
|
||||
&oinfo);
|
||||
if (error)
|
||||
@@ -833,7 +833,7 @@ xrep_bmap_remove_old_tree(
|
||||
struct xfs_owner_info oinfo;
|
||||
|
||||
/* Free the old bmbt blocks if they're not in use. */
|
||||
xfs_rmap_ino_bmbt_owner(&oinfo, sc->ip->i_ino, rb->whichfork);
|
||||
xfs_rmap_inode_bmbt_owner(&oinfo, sc->ip, rb->whichfork);
|
||||
return xrep_reap_fsblocks(sc, &rb->old_bmbt_blocks, &oinfo);
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ xrep_newbt_init_metadir_inode(
|
||||
|
||||
ASSERT(xfs_is_metadir_inode(sc->ip));
|
||||
|
||||
xfs_rmap_ino_bmbt_owner(&oinfo, sc->ip->i_ino, XFS_DATA_FORK);
|
||||
xfs_rmap_inode_bmbt_owner(&oinfo, sc->ip, XFS_DATA_FORK);
|
||||
|
||||
ifp = kmem_cache_zalloc(xfs_ifork_cache, XCHK_GFP_FLAGS);
|
||||
if (!ifp)
|
||||
|
||||
@@ -1205,7 +1205,7 @@ xrep_reap_metadir_fsblocks(
|
||||
ASSERT(xfs_is_metadir_inode(sc->ip));
|
||||
|
||||
xreap_configure_agextent_limits(&rs);
|
||||
xfs_rmap_ino_bmbt_owner(&oinfo, sc->ip->i_ino, XFS_DATA_FORK);
|
||||
xfs_rmap_inode_bmbt_owner(&oinfo, sc->ip, XFS_DATA_FORK);
|
||||
error = xfsb_bitmap_walk(bitmap, xreap_fsmeta_extent, &rs);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
@@ -555,7 +555,7 @@ xchk_rtrefcountbt(
|
||||
if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
|
||||
return error;
|
||||
|
||||
xfs_rmap_ino_bmbt_owner(&btree_oinfo, rtg_refcount(sc->sr.rtg)->i_ino,
|
||||
xfs_rmap_inode_bmbt_owner(&btree_oinfo, rtg_refcount(sc->sr.rtg),
|
||||
XFS_DATA_FORK);
|
||||
error = xchk_btree(sc, sc->sr.refc_cur, xchk_rtrefcountbt_rec,
|
||||
&btree_oinfo, &rrc);
|
||||
|
||||
@@ -244,7 +244,6 @@ int
|
||||
xchk_rtrmapbt(
|
||||
struct xfs_scrub *sc)
|
||||
{
|
||||
struct xfs_inode *ip = rtg_rmap(sc->sr.rtg);
|
||||
struct xfs_owner_info oinfo;
|
||||
struct xchk_rtrmap cr = { };
|
||||
int error;
|
||||
@@ -253,7 +252,7 @@ xchk_rtrmapbt(
|
||||
if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
|
||||
return error;
|
||||
|
||||
xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, XFS_DATA_FORK);
|
||||
xfs_rmap_inode_bmbt_owner(&oinfo, rtg_rmap(sc->sr.rtg), XFS_DATA_FORK);
|
||||
return xchk_btree(sc, sc->sr.rmap_cur, xchk_rtrmapbt_rec, &oinfo, &cr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user