mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
xfs: new code for Linux 7.2
Signed-off-by: Carlos Maiolino <cem@kernel.org> -----BEGIN PGP SIGNATURE----- iJUEABMJAB0WIQSmtYVZ/MfVMGUq1GNcsMJ8RxYuYwUCai/ATAAKCRBcsMJ8RxYu YwizAX9pr/FDF4FJEob18Juys/r+VvptqdJxx/e2igubyOzhz0MrDHSbzfF8Z1d2 lY4oa9EBgKrLjV/v+erpxxg9+i3Dqya/QvsHAzm/7k/fbA3udeiop71PlqRKF1SD clzkim/DSg== =qpVD -----END PGP SIGNATURE----- Merge tag 'xfs-merge-7.2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs updates from Carlos Maiolino: "The main highlight is the removal of experimental tag of the zone allocator feature. Besides that, this contains a collection of bug fixes and code refactoring but no new features have been added" * tag 'xfs-merge-7.2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (29 commits) xfs: shut down the filesystem on a failed mount xfs: skip inode inactivation on a shut down mount xfs: move XFS_LSN_CMP to xfs_log_format.h xfs: shut down zoned file systems on writeback errors xfs: cleanup xfs_growfs_compute_deltas xfs: pass back updated nb from xfs_growfs_compute_deltas xfs: fix pointer arithmetic error on 32-bit systems xfs: initialize iomap->flags earlier in xfs_bmbt_to_iomap xfs: only log freed extents for the current RTG in zoned growfs xfs: add newly added RTGs to the free pool in growfs xfs: factor out a xfs_zone_mark_free helper xfs: mark struct xfs_imap as __packed xfs: store an agbno in struct xfs_imap xfs: massage xfs_imap_to_bp into xfs_read_icluster xfs: remove im_len field in struct xfs_imap xfs: cleanup xfs_imap xfs: remove the call to xfs_buf_reverify in xfs_trans_read_buf_map xfs: remove the i_ino field in struct xfs_inode xfs: remove xfs_setup_existing_inode xfs: convert xchk_inode_xref_set_corrupt to xchk_ip_xref_set_corrupt ...
This commit is contained in:
commit
6271f6ea7f
|
|
@ -863,32 +863,30 @@ xfs_ag_shrink_space(
|
|||
return err2;
|
||||
}
|
||||
|
||||
void
|
||||
xfs_growfs_compute_deltas(
|
||||
/*
|
||||
* Return the agcount for the new file system size passed in *nb and adjust *nb
|
||||
* when it has to be reduced because of maximum AG count or because it would
|
||||
* create a below minimum size AG.
|
||||
*/
|
||||
xfs_agnumber_t
|
||||
xfs_growfs_compute_agcount(
|
||||
struct xfs_mount *mp,
|
||||
xfs_rfsblock_t nb,
|
||||
int64_t *deltap,
|
||||
xfs_agnumber_t *nagcountp)
|
||||
xfs_rfsblock_t *nb)
|
||||
{
|
||||
xfs_rfsblock_t nb_div, nb_mod;
|
||||
int64_t delta;
|
||||
xfs_agnumber_t nagcount;
|
||||
uint64_t agcount; /* 64-bits wide to catch overflows */
|
||||
xfs_extlen_t remainder;
|
||||
|
||||
nb_div = nb;
|
||||
nb_mod = do_div(nb_div, mp->m_sb.sb_agblocks);
|
||||
if (nb_mod && nb_mod >= XFS_MIN_AG_BLOCKS)
|
||||
nb_div++;
|
||||
else if (nb_mod)
|
||||
nb = nb_div * mp->m_sb.sb_agblocks;
|
||||
|
||||
if (nb_div > XFS_MAX_AGNUMBER + 1) {
|
||||
nb_div = XFS_MAX_AGNUMBER + 1;
|
||||
nb = nb_div * mp->m_sb.sb_agblocks;
|
||||
agcount = div_u64_rem(*nb, mp->m_sb.sb_agblocks, &remainder);
|
||||
if (agcount >= XFS_MAX_AGNUMBER + 1) {
|
||||
agcount = XFS_MAX_AGNUMBER + 1;
|
||||
remainder = 0;
|
||||
}
|
||||
nagcount = nb_div;
|
||||
delta = nb - mp->m_sb.sb_dblocks;
|
||||
*deltap = delta;
|
||||
*nagcountp = nagcount;
|
||||
*nb = (xfs_rfsblock_t)agcount * mp->m_sb.sb_agblocks;
|
||||
if (remainder >= XFS_MIN_AG_BLOCKS) {
|
||||
*nb += remainder;
|
||||
agcount++;
|
||||
}
|
||||
return agcount;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -329,12 +329,11 @@ struct aghdr_init_data {
|
|||
int xfs_ag_init_headers(struct xfs_mount *mp, struct aghdr_init_data *id);
|
||||
int xfs_ag_shrink_space(struct xfs_perag *pag, struct xfs_trans **tpp,
|
||||
xfs_extlen_t delta);
|
||||
void
|
||||
xfs_growfs_compute_deltas(struct xfs_mount *mp, xfs_rfsblock_t nb,
|
||||
int64_t *deltap, xfs_agnumber_t *nagcountp);
|
||||
int xfs_ag_extend_space(struct xfs_perag *pag, struct xfs_trans *tp,
|
||||
xfs_extlen_t len);
|
||||
int xfs_ag_get_geometry(struct xfs_perag *pag, struct xfs_ag_geometry *ageo);
|
||||
xfs_agnumber_t xfs_growfs_compute_agcount(struct xfs_mount *mp,
|
||||
xfs_rfsblock_t *nb);
|
||||
|
||||
static inline xfs_fsblock_t
|
||||
xfs_agbno_to_fsb(
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ xfs_attr_get(
|
|||
return -EIO;
|
||||
|
||||
if (!args->owner)
|
||||
args->owner = args->dp->i_ino;
|
||||
args->owner = I_INO(args->dp);
|
||||
args->geo = args->dp->i_mount->m_attr_geo;
|
||||
args->whichfork = XFS_ATTR_FORK;
|
||||
xfs_attr_sethash(args);
|
||||
|
|
|
|||
|
|
@ -1429,7 +1429,7 @@ xfs_attr3_leaf_init(
|
|||
struct xfs_da_args args = {
|
||||
.trans = tp,
|
||||
.dp = dp,
|
||||
.owner = dp->i_ino,
|
||||
.owner = I_INO(dp),
|
||||
.geo = dp->i_mount->m_attr_geo,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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,13 +676,12 @@ 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;
|
||||
*logflagsp = 0;
|
||||
error = xfs_alloc_vextent_start_ag(&args,
|
||||
XFS_INO_TO_FSB(mp, ip->i_ino));
|
||||
error = xfs_alloc_vextent_start_ag(&args, XFS_INODE_TO_FSB(ip));
|
||||
if (error)
|
||||
goto out_root_realloc;
|
||||
|
||||
|
|
@ -820,7 +819,7 @@ xfs_bmap_local_to_extents(
|
|||
args.mp = ip->i_mount;
|
||||
args.total = total;
|
||||
args.minlen = args.maxlen = args.prod = 1;
|
||||
xfs_rmap_ino_owner(&args.oinfo, ip->i_ino, whichfork, 0);
|
||||
xfs_rmap_inode_owner(&args.oinfo, ip, whichfork, 0);
|
||||
|
||||
/*
|
||||
* Allocate a block. We know we need only one, since the
|
||||
|
|
@ -828,8 +827,7 @@ xfs_bmap_local_to_extents(
|
|||
*/
|
||||
args.total = total;
|
||||
args.minlen = args.maxlen = args.prod = 1;
|
||||
error = xfs_alloc_vextent_start_ag(&args,
|
||||
XFS_INO_TO_FSB(args.mp, ip->i_ino));
|
||||
error = xfs_alloc_vextent_start_ag(&args, XFS_INODE_TO_FSB(ip));
|
||||
if (error)
|
||||
goto done;
|
||||
|
||||
|
|
@ -976,7 +974,7 @@ xfs_bmap_add_attrfork_local(
|
|||
dargs.total = dargs.geo->fsbcount;
|
||||
dargs.whichfork = XFS_DATA_FORK;
|
||||
dargs.trans = tp;
|
||||
dargs.owner = ip->i_ino;
|
||||
dargs.owner = I_INO(ip);
|
||||
return xfs_dir2_sf_to_block(&dargs);
|
||||
}
|
||||
|
||||
|
|
@ -1110,7 +1108,7 @@ xfs_bmap_complain_bad_rec(
|
|||
|
||||
xfs_warn(mp,
|
||||
"Bmap BTree record corruption in inode 0x%llx %s fork detected at %pS!",
|
||||
ip->i_ino, forkname, fa);
|
||||
I_INO(ip), forkname, fa);
|
||||
xfs_warn(mp,
|
||||
"Offset 0x%llx, start block 0x%llx, block count 0x%llx state 0x%x",
|
||||
irec->br_startoff, irec->br_startblock, irec->br_blockcount,
|
||||
|
|
@ -1143,7 +1141,7 @@ xfs_iread_bmbt_block(
|
|||
num_recs = xfs_btree_get_numrecs(block);
|
||||
if (unlikely(ir->loaded + num_recs > ifp->if_nextents)) {
|
||||
xfs_warn(ip->i_mount, "corrupt dinode %llu, (btree extents).",
|
||||
(unsigned long long)ip->i_ino);
|
||||
(unsigned long long)I_INO(ip));
|
||||
xfs_inode_verifier_error(ip, -EFSCORRUPTED, __func__, block,
|
||||
sizeof(*block), __this_address);
|
||||
xfs_bmap_mark_sick(ip, whichfork);
|
||||
|
|
@ -3590,7 +3588,7 @@ xfs_bmap_btalloc_best_length(
|
|||
xfs_extlen_t blen = 0;
|
||||
int error;
|
||||
|
||||
ap->blkno = XFS_INO_TO_FSB(args->mp, ap->ip->i_ino);
|
||||
ap->blkno = XFS_INODE_TO_FSB(ap->ip);
|
||||
if (!xfs_bmap_adjacent(ap))
|
||||
ap->eof = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ xfs_bmbt_init_block(
|
|||
{
|
||||
if (bp)
|
||||
xfs_btree_init_buf(ip->i_mount, bp, &xfs_bmbt_ops, level,
|
||||
numrecs, ip->i_ino);
|
||||
numrecs, I_INO(ip));
|
||||
else
|
||||
xfs_btree_init_block(ip->i_mount, buf, &xfs_bmbt_ops, level,
|
||||
numrecs, ip->i_ino);
|
||||
numrecs, I_INO(ip));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ xfs_bmbt_key_addr(
|
|||
{
|
||||
return (struct xfs_bmbt_key *)
|
||||
((char *)block + xfs_bmbt_block_len(mp) +
|
||||
(index - 1) * sizeof(struct xfs_bmbt_key *));
|
||||
(index - 1) * sizeof(struct xfs_bmbt_key));
|
||||
}
|
||||
|
||||
static inline xfs_bmbt_ptr_t *
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ xfs_btree_check_ptr(
|
|||
case XFS_BTREE_TYPE_INODE:
|
||||
xfs_err(cur->bc_mp,
|
||||
"Inode %llu fork %d: Corrupt %sbt pointer at level %d index %d.",
|
||||
cur->bc_ino.ip->i_ino,
|
||||
I_INO(cur->bc_ino.ip),
|
||||
cur->bc_ino.whichfork, cur->bc_ops->name,
|
||||
level, index);
|
||||
break;
|
||||
|
|
@ -1305,7 +1305,7 @@ xfs_btree_owner(
|
|||
case XFS_BTREE_TYPE_MEM:
|
||||
return cur->bc_mem.xfbtree->owner;
|
||||
case XFS_BTREE_TYPE_INODE:
|
||||
return cur->bc_ino.ip->i_ino;
|
||||
return I_INO(cur->bc_ino.ip);
|
||||
case XFS_BTREE_TYPE_AG:
|
||||
return cur->bc_group->xg_gno;
|
||||
default:
|
||||
|
|
@ -3129,7 +3129,7 @@ xfs_btree_promote_leaf_iroot(
|
|||
*/
|
||||
broot = cur->bc_ops->broot_realloc(cur, 1);
|
||||
xfs_btree_init_block(cur->bc_mp, broot, cur->bc_ops,
|
||||
cur->bc_nlevels - 1, 1, cur->bc_ino.ip->i_ino);
|
||||
cur->bc_nlevels - 1, 1, I_INO(cur->bc_ino.ip));
|
||||
|
||||
pp = xfs_btree_ptr_addr(cur, 1, broot);
|
||||
kp = xfs_btree_key_addr(cur, 1, broot);
|
||||
|
|
@ -3243,8 +3243,7 @@ xfs_btree_new_iroot(
|
|||
if (level > 0)
|
||||
aptr = *xfs_btree_ptr_addr(cur, 1, block);
|
||||
else
|
||||
aptr.l = cpu_to_be64(XFS_INO_TO_FSB(cur->bc_mp,
|
||||
cur->bc_ino.ip->i_ino));
|
||||
aptr.l = cpu_to_be64(XFS_INODE_TO_FSB(cur->bc_ino.ip));
|
||||
|
||||
/* Allocate the new block. If we can't do it, we're toast. Give up. */
|
||||
error = xfs_btree_alloc_block(cur, &aptr, &nptr, stat);
|
||||
|
|
@ -3827,7 +3826,7 @@ xfs_btree_demote_leaf_child(
|
|||
*/
|
||||
broot = cur->bc_ops->broot_realloc(cur, numrecs);
|
||||
xfs_btree_init_block(cur->bc_mp, broot, cur->bc_ops, 0, numrecs,
|
||||
cur->bc_ino.ip->i_ino);
|
||||
I_INO(cur->bc_ino.ip));
|
||||
|
||||
rp = xfs_btree_rec_addr(cur, 1, broot);
|
||||
crp = xfs_btree_rec_addr(cur, 1, cblock);
|
||||
|
|
@ -5608,9 +5607,8 @@ 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);
|
||||
error = xfs_alloc_vextent_start_ag(&args,
|
||||
XFS_INO_TO_FSB(cur->bc_mp, ip->i_ino));
|
||||
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;
|
||||
if (args.fsbno == NULLFSBLOCK) {
|
||||
|
|
@ -5641,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)
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ xfs_btree_bload_prep_block(
|
|||
|
||||
/* Initialize it and send it out. */
|
||||
xfs_btree_init_block(cur->bc_mp, ifp->if_broot, cur->bc_ops,
|
||||
level, nr_this_block, cur->bc_ino.ip->i_ino);
|
||||
level, nr_this_block, I_INO(cur->bc_ino.ip));
|
||||
|
||||
*bpp = NULL;
|
||||
*blockp = ifp->if_broot;
|
||||
|
|
|
|||
|
|
@ -2780,7 +2780,7 @@ xfs_dabuf_map(
|
|||
error = -EFSCORRUPTED;
|
||||
if (xfs_error_level >= XFS_ERRLEVEL_LOW) {
|
||||
xfs_alert(mp, "%s: bno %u inode %llu",
|
||||
__func__, bno, dp->i_ino);
|
||||
__func__, bno, I_INO(dp));
|
||||
|
||||
for (i = 0; i < nirecs; i++) {
|
||||
xfs_alert(mp,
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ xfs_dir_init(
|
|||
int error;
|
||||
|
||||
ASSERT(S_ISDIR(VFS_I(dp)->i_mode));
|
||||
error = xfs_dir_ino_validate(tp->t_mountp, pdp->i_ino);
|
||||
error = xfs_dir_ino_validate(tp->t_mountp, I_INO(pdp));
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
@ -255,8 +255,8 @@ xfs_dir_init(
|
|||
args->geo = dp->i_mount->m_dir_geo;
|
||||
args->dp = dp;
|
||||
args->trans = tp;
|
||||
args->owner = dp->i_ino;
|
||||
error = xfs_dir2_sf_create(args, pdp->i_ino);
|
||||
args->owner = I_INO(dp);
|
||||
error = xfs_dir2_sf_create(args, I_INO(pdp));
|
||||
kfree(args);
|
||||
return error;
|
||||
}
|
||||
|
|
@ -356,7 +356,7 @@ xfs_dir_createname(
|
|||
args->whichfork = XFS_DATA_FORK;
|
||||
args->trans = tp;
|
||||
args->op_flags = XFS_DA_OP_ADDNAME | XFS_DA_OP_OKNOENT;
|
||||
args->owner = dp->i_ino;
|
||||
args->owner = I_INO(dp);
|
||||
|
||||
rval = xfs_dir_createname_args(args);
|
||||
kfree(args);
|
||||
|
|
@ -447,7 +447,7 @@ xfs_dir_lookup(
|
|||
args->whichfork = XFS_DATA_FORK;
|
||||
args->trans = tp;
|
||||
args->op_flags = XFS_DA_OP_OKNOENT;
|
||||
args->owner = dp->i_ino;
|
||||
args->owner = I_INO(dp);
|
||||
if (ci_name)
|
||||
args->op_flags |= XFS_DA_OP_CILOOKUP;
|
||||
|
||||
|
|
@ -516,7 +516,7 @@ xfs_dir_removename(
|
|||
args->total = total;
|
||||
args->whichfork = XFS_DATA_FORK;
|
||||
args->trans = tp;
|
||||
args->owner = dp->i_ino;
|
||||
args->owner = I_INO(dp);
|
||||
rval = xfs_dir_removename_args(args);
|
||||
kfree(args);
|
||||
return rval;
|
||||
|
|
@ -576,7 +576,7 @@ xfs_dir_replace(
|
|||
args->total = total;
|
||||
args->whichfork = XFS_DATA_FORK;
|
||||
args->trans = tp;
|
||||
args->owner = dp->i_ino;
|
||||
args->owner = I_INO(dp);
|
||||
rval = xfs_dir_replace_args(args);
|
||||
kfree(args);
|
||||
return rval;
|
||||
|
|
@ -855,7 +855,7 @@ xfs_dir_create_child(
|
|||
xfs_assert_ilocked(ip, XFS_ILOCK_EXCL);
|
||||
xfs_assert_ilocked(dp, XFS_ILOCK_EXCL);
|
||||
|
||||
error = xfs_dir_createname(tp, dp, name, ip->i_ino, resblks);
|
||||
error = xfs_dir_createname(tp, dp, name, I_INO(ip), resblks);
|
||||
if (error) {
|
||||
ASSERT(error != -ENOSPC);
|
||||
return error;
|
||||
|
|
@ -919,14 +919,14 @@ xfs_dir_add_child(
|
|||
if (VFS_I(ip)->i_nlink == 0) {
|
||||
struct xfs_perag *pag;
|
||||
|
||||
pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
|
||||
pag = xfs_perag_get(mp, XFS_INODE_TO_AGNO(ip));
|
||||
error = xfs_iunlink_remove(tp, pag, ip);
|
||||
xfs_perag_put(pag);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
|
||||
error = xfs_dir_createname(tp, dp, name, ip->i_ino, resblks);
|
||||
error = xfs_dir_createname(tp, dp, name, I_INO(ip), resblks);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
@ -995,7 +995,7 @@ xfs_dir_remove_child(
|
|||
* get freed before the child directory is closed. If the fs
|
||||
* gets shrunk, this can lead to dirent inode validation errors.
|
||||
*/
|
||||
if (dp->i_ino != tp->t_mountp->m_sb.sb_rootino) {
|
||||
if (I_INO(dp) != tp->t_mountp->m_sb.sb_rootino) {
|
||||
error = xfs_dir_replace(tp, ip, &xfs_name_dotdot,
|
||||
tp->t_mountp->m_sb.sb_rootino, 0);
|
||||
if (error)
|
||||
|
|
@ -1016,7 +1016,7 @@ xfs_dir_remove_child(
|
|||
if (error)
|
||||
return error;
|
||||
|
||||
error = xfs_dir_removename(tp, dp, name, ip->i_ino, resblks);
|
||||
error = xfs_dir_removename(tp, dp, name, I_INO(ip), resblks);
|
||||
if (error) {
|
||||
ASSERT(error != -ENOENT);
|
||||
return error;
|
||||
|
|
@ -1059,12 +1059,12 @@ xfs_dir_exchange_children(
|
|||
int error;
|
||||
|
||||
/* Swap inode number for dirent in first parent */
|
||||
error = xfs_dir_replace(tp, dp1, name1, ip2->i_ino, spaceres);
|
||||
error = xfs_dir_replace(tp, dp1, name1, I_INO(ip2), spaceres);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
/* Swap inode number for dirent in second parent */
|
||||
error = xfs_dir_replace(tp, dp2, name2, ip1->i_ino, spaceres);
|
||||
error = xfs_dir_replace(tp, dp2, name2, I_INO(ip1), spaceres);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
@ -1078,7 +1078,7 @@ xfs_dir_exchange_children(
|
|||
|
||||
if (S_ISDIR(VFS_I(ip2)->i_mode)) {
|
||||
error = xfs_dir_replace(tp, ip2, &xfs_name_dotdot,
|
||||
dp1->i_ino, spaceres);
|
||||
I_INO(dp1), spaceres);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
@ -1102,7 +1102,7 @@ xfs_dir_exchange_children(
|
|||
|
||||
if (S_ISDIR(VFS_I(ip1)->i_mode)) {
|
||||
error = xfs_dir_replace(tp, ip1, &xfs_name_dotdot,
|
||||
dp2->i_ino, spaceres);
|
||||
I_INO(dp2), spaceres);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
@ -1246,7 +1246,7 @@ xfs_dir_rename_children(
|
|||
|
||||
ASSERT(VFS_I(du_wip->ip)->i_nlink == 0);
|
||||
|
||||
pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, du_wip->ip->i_ino));
|
||||
pag = xfs_perag_get(mp, XFS_INODE_TO_AGNO(du_wip->ip));
|
||||
error = xfs_iunlink_remove(tp, pag, du_wip->ip);
|
||||
xfs_perag_put(pag);
|
||||
if (error)
|
||||
|
|
@ -1265,7 +1265,7 @@ xfs_dir_rename_children(
|
|||
* to account for the ".." reference from the new entry.
|
||||
*/
|
||||
error = xfs_dir_createname(tp, target_dp, target_name,
|
||||
src_ip->i_ino, spaceres);
|
||||
I_INO(src_ip), spaceres);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
@ -1286,7 +1286,7 @@ xfs_dir_rename_children(
|
|||
* name at the destination directory, remove it first.
|
||||
*/
|
||||
error = xfs_dir_replace(tp, target_dp, target_name,
|
||||
src_ip->i_ino, spaceres);
|
||||
I_INO(src_ip), spaceres);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
@ -1320,7 +1320,7 @@ xfs_dir_rename_children(
|
|||
* directory.
|
||||
*/
|
||||
error = xfs_dir_replace(tp, src_ip, &xfs_name_dotdot,
|
||||
target_dp->i_ino, spaceres);
|
||||
I_INO(target_dp), spaceres);
|
||||
ASSERT(error != -EEXIST);
|
||||
if (error)
|
||||
return error;
|
||||
|
|
@ -1358,10 +1358,10 @@ xfs_dir_rename_children(
|
|||
* altogether.
|
||||
*/
|
||||
if (du_wip->ip)
|
||||
error = xfs_dir_replace(tp, src_dp, src_name, du_wip->ip->i_ino,
|
||||
error = xfs_dir_replace(tp, src_dp, src_name, I_INO(du_wip->ip),
|
||||
spaceres);
|
||||
else
|
||||
error = xfs_dir_removename(tp, src_dp, src_name, src_ip->i_ino,
|
||||
error = xfs_dir_removename(tp, src_dp, src_name, I_INO(src_ip),
|
||||
spaceres);
|
||||
if (error)
|
||||
return error;
|
||||
|
|
|
|||
|
|
@ -1739,7 +1739,7 @@ xfs_dir2_node_add_datablk(
|
|||
fbno)) {
|
||||
xfs_alert(mp,
|
||||
"%s: dir ino %llu needed freesp block %lld for data block %lld, got %lld",
|
||||
__func__, (unsigned long long)dp->i_ino,
|
||||
__func__, (unsigned long long)I_INO(dp),
|
||||
(long long)xfs_dir2_db_to_fdb(args->geo, *dbno),
|
||||
(long long)*dbno, (long long)fbno);
|
||||
if (fblk) {
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@ xfs_dir2_block_to_sf(
|
|||
* Skip .
|
||||
*/
|
||||
if (dep->namelen == 1 && dep->name[0] == '.')
|
||||
ASSERT(be64_to_cpu(dep->inumber) == dp->i_ino);
|
||||
ASSERT(be64_to_cpu(dep->inumber) == I_INO(dp));
|
||||
/*
|
||||
* Skip .., but make sure the inode number is right.
|
||||
*/
|
||||
|
|
@ -863,7 +863,7 @@ xfs_dir2_sf_lookup(
|
|||
* Special case for .
|
||||
*/
|
||||
if (args->namelen == 1 && args->name[0] == '.') {
|
||||
args->inumber = dp->i_ino;
|
||||
args->inumber = I_INO(dp);
|
||||
args->cmpresult = XFS_CMP_EXACT;
|
||||
args->filetype = XFS_DIR3_FT_DIR;
|
||||
return -EEXIST;
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ xfs_exchmaps_attr_to_sf(
|
|||
.geo = tp->t_mountp->m_attr_geo,
|
||||
.whichfork = XFS_ATTR_FORK,
|
||||
.trans = tp,
|
||||
.owner = xmi->xmi_ip2->i_ino,
|
||||
.owner = I_INO(xmi->xmi_ip2),
|
||||
};
|
||||
struct xfs_buf *bp;
|
||||
int forkoff;
|
||||
|
|
@ -438,7 +438,7 @@ xfs_exchmaps_attr_to_sf(
|
|||
if (!xfs_attr_is_leaf(xmi->xmi_ip2))
|
||||
return 0;
|
||||
|
||||
error = xfs_attr3_leaf_read(tp, xmi->xmi_ip2, xmi->xmi_ip2->i_ino, 0,
|
||||
error = xfs_attr3_leaf_read(tp, xmi->xmi_ip2, I_INO(xmi->xmi_ip2), 0,
|
||||
&bp);
|
||||
if (error)
|
||||
return error;
|
||||
|
|
@ -461,7 +461,7 @@ xfs_exchmaps_dir_to_sf(
|
|||
.geo = tp->t_mountp->m_dir_geo,
|
||||
.whichfork = XFS_DATA_FORK,
|
||||
.trans = tp,
|
||||
.owner = xmi->xmi_ip2->i_ino,
|
||||
.owner = I_INO(xmi->xmi_ip2),
|
||||
};
|
||||
struct xfs_dir2_sf_hdr sfh;
|
||||
struct xfs_buf *bp;
|
||||
|
|
@ -471,7 +471,7 @@ xfs_exchmaps_dir_to_sf(
|
|||
if (xfs_dir2_format(&args, &error) != XFS_DIR2_FMT_BLOCK)
|
||||
return error;
|
||||
|
||||
error = xfs_dir3_block_read(tp, xmi->xmi_ip2, xmi->xmi_ip2->i_ino, &bp);
|
||||
error = xfs_dir3_block_read(tp, xmi->xmi_ip2, I_INO(xmi->xmi_ip2), &bp);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
@ -711,7 +711,7 @@ xfs_exchmaps_estimate_overhead(
|
|||
return -ENOSPC;
|
||||
|
||||
/* Can't actually reserve more than UINT_MAX blocks. */
|
||||
if (req->resblks > UINT_MAX)
|
||||
if (resblks > UINT_MAX)
|
||||
return -ENOSPC;
|
||||
|
||||
req->resblks = resblks;
|
||||
|
|
|
|||
|
|
@ -1276,8 +1276,12 @@ static inline bool xfs_dinode_is_metadir(const struct xfs_dinode *dip)
|
|||
XFS_INO_AGNO_BITS(mp) + XFS_INO_AGINO_BITS(mp)
|
||||
#define XFS_INO_TO_AGNO(mp,i) \
|
||||
((xfs_agnumber_t)((i) >> XFS_INO_AGINO_BITS(mp)))
|
||||
#define XFS_INODE_TO_AGNO(ip) \
|
||||
XFS_INO_TO_AGNO((ip)->i_mount, I_INO(ip))
|
||||
#define XFS_INO_TO_AGINO(mp,i) \
|
||||
((xfs_agino_t)(i) & XFS_INO_MASK(XFS_INO_AGINO_BITS(mp)))
|
||||
#define XFS_INODE_TO_AGINO(ip) \
|
||||
XFS_INO_TO_AGINO((ip)->i_mount, I_INO(ip))
|
||||
#define XFS_INO_TO_AGBNO(mp,i) \
|
||||
(((xfs_agblock_t)(i) >> XFS_INO_OFFSET_BITS(mp)) & \
|
||||
XFS_INO_MASK(XFS_INO_AGBNO_BITS(mp)))
|
||||
|
|
@ -1285,6 +1289,8 @@ static inline bool xfs_dinode_is_metadir(const struct xfs_dinode *dip)
|
|||
((int)(i) & XFS_INO_MASK(XFS_INO_OFFSET_BITS(mp)))
|
||||
#define XFS_INO_TO_FSB(mp,i) \
|
||||
XFS_AGB_TO_FSB(mp, XFS_INO_TO_AGNO(mp,i), XFS_INO_TO_AGBNO(mp,i))
|
||||
#define XFS_INODE_TO_FSB(ip) \
|
||||
XFS_INO_TO_FSB((ip)->i_mount, I_INO(ip))
|
||||
#define XFS_AGINO_TO_INO(mp,a,i) \
|
||||
(((xfs_ino_t)(a) << XFS_INO_AGINO_BITS(mp)) | (i))
|
||||
#define XFS_AGINO_TO_AGBNO(mp,i) ((i) >> XFS_INO_OFFSET_BITS(mp))
|
||||
|
|
|
|||
|
|
@ -1075,7 +1075,7 @@ xfs_dialloc_check_ino(
|
|||
if (error)
|
||||
return -EAGAIN;
|
||||
|
||||
error = xfs_imap_to_bp(pag_mount(pag), tp, &imap, &bp);
|
||||
error = xfs_read_icluster(pag, tp, imap.im_agbno, &bp);
|
||||
if (error)
|
||||
return -EAGAIN;
|
||||
|
||||
|
|
@ -1870,7 +1870,7 @@ xfs_dialloc_pick_ag(
|
|||
if (S_ISDIR(mode))
|
||||
return (atomic_inc_return(&mp->m_agirotor) - 1) % mp->m_maxagi;
|
||||
|
||||
start_agno = XFS_INO_TO_AGNO(mp, dp->i_ino);
|
||||
start_agno = XFS_INODE_TO_AGNO(dp);
|
||||
if (start_agno >= mp->m_maxagi)
|
||||
start_agno = 0;
|
||||
|
||||
|
|
@ -1895,7 +1895,7 @@ xfs_dialloc(
|
|||
struct xfs_perag *pag;
|
||||
struct xfs_ino_geometry *igeo = M_IGEO(mp);
|
||||
xfs_ino_t ino = NULLFSINO;
|
||||
xfs_ino_t parent = args->pip ? args->pip->i_ino : 0;
|
||||
xfs_ino_t parent = args->pip ? I_INO(args->pip) : 0;
|
||||
xfs_agnumber_t agno;
|
||||
xfs_agnumber_t start_agno;
|
||||
umode_t mode = args->mode & S_IFMT;
|
||||
|
|
@ -2511,43 +2511,37 @@ xfs_imap(
|
|||
* inodes in stale state on disk. Hence we have to do a btree lookup
|
||||
* in all cases where an untrusted inode number is passed.
|
||||
*/
|
||||
if (flags & XFS_IGET_UNTRUSTED) {
|
||||
error = xfs_imap_lookup(pag, tp, agino, agbno,
|
||||
&chunk_agbno, &offset_agbno, flags);
|
||||
if (error)
|
||||
return error;
|
||||
goto out_map;
|
||||
if (!(flags & XFS_IGET_UNTRUSTED)) {
|
||||
/*
|
||||
* If the inode cluster size is the same or smaller than the
|
||||
* blocksize, get to the buffer by simple arithmetics.
|
||||
*/
|
||||
if (M_IGEO(mp)->blocks_per_cluster == 1) {
|
||||
cluster_agbno = agbno;
|
||||
offset = XFS_INO_TO_OFFSET(mp, ino);
|
||||
ASSERT(offset < mp->m_sb.sb_inopblock);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the inode chunks are aligned, use simple maths to find the
|
||||
* location.
|
||||
*/
|
||||
if (M_IGEO(mp)->inoalign_mask) {
|
||||
offset_agbno = agbno & M_IGEO(mp)->inoalign_mask;
|
||||
chunk_agbno = agbno - offset_agbno;
|
||||
goto out_map;
|
||||
}
|
||||
|
||||
/*
|
||||
* Otherwise we have to do a btree lookup to find the location.
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
* If the inode cluster size is the same as the blocksize or
|
||||
* smaller we get to the buffer by simple arithmetics.
|
||||
*/
|
||||
if (M_IGEO(mp)->blocks_per_cluster == 1) {
|
||||
offset = XFS_INO_TO_OFFSET(mp, ino);
|
||||
ASSERT(offset < mp->m_sb.sb_inopblock);
|
||||
|
||||
imap->im_blkno = xfs_agbno_to_daddr(pag, agbno);
|
||||
imap->im_len = XFS_FSB_TO_BB(mp, 1);
|
||||
imap->im_boffset = (unsigned short)(offset <<
|
||||
mp->m_sb.sb_inodelog);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the inode chunks are aligned then use simple maths to
|
||||
* find the location. Otherwise we have to do a btree
|
||||
* lookup to find the location.
|
||||
*/
|
||||
if (M_IGEO(mp)->inoalign_mask) {
|
||||
offset_agbno = agbno & M_IGEO(mp)->inoalign_mask;
|
||||
chunk_agbno = agbno - offset_agbno;
|
||||
} else {
|
||||
error = xfs_imap_lookup(pag, tp, agino, agbno,
|
||||
&chunk_agbno, &offset_agbno, flags);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
error = xfs_imap_lookup(pag, tp, agino, agbno, &chunk_agbno,
|
||||
&offset_agbno, flags);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
out_map:
|
||||
ASSERT(agbno >= chunk_agbno);
|
||||
|
|
@ -2556,24 +2550,14 @@ xfs_imap(
|
|||
M_IGEO(mp)->blocks_per_cluster);
|
||||
offset = ((agbno - cluster_agbno) * mp->m_sb.sb_inopblock) +
|
||||
XFS_INO_TO_OFFSET(mp, ino);
|
||||
|
||||
imap->im_blkno = xfs_agbno_to_daddr(pag, cluster_agbno);
|
||||
imap->im_len = XFS_FSB_TO_BB(mp, M_IGEO(mp)->blocks_per_cluster);
|
||||
out:
|
||||
imap->im_agbno = cluster_agbno;
|
||||
imap->im_boffset = (unsigned short)(offset << mp->m_sb.sb_inodelog);
|
||||
|
||||
/*
|
||||
* If the inode number maps to a block outside the bounds
|
||||
* of the file system then return NULL rather than calling
|
||||
* read_buf and panicing when we get an error from the
|
||||
* driver.
|
||||
*/
|
||||
if ((imap->im_blkno + imap->im_len) >
|
||||
XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)) {
|
||||
xfs_alert(mp,
|
||||
"%s: (im_blkno (0x%llx) + im_len (0x%llx)) > sb_dblocks (0x%llx)",
|
||||
__func__, (unsigned long long) imap->im_blkno,
|
||||
(unsigned long long) imap->im_len,
|
||||
XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks));
|
||||
if (imap->im_agbno + M_IGEO(mp)->blocks_per_cluster >
|
||||
pag_group(pag)->xg_block_count) {
|
||||
xfs_alert(mp, "inode cluster out of range: %u/%u > %u",
|
||||
imap->im_agbno, M_IGEO(mp)->blocks_per_cluster,
|
||||
pag_group(pag)->xg_block_count);
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -123,24 +123,24 @@ const struct xfs_buf_ops xfs_inode_buf_ra_ops = {
|
|||
|
||||
|
||||
/*
|
||||
* This routine is called to map an inode to the buffer containing the on-disk
|
||||
* version of the inode. It returns a pointer to the buffer containing the
|
||||
* on-disk inode in the bpp parameter.
|
||||
* Read the inode cluster at @bno and return it in @bpp.
|
||||
*/
|
||||
int
|
||||
xfs_imap_to_bp(
|
||||
struct xfs_mount *mp,
|
||||
xfs_read_icluster(
|
||||
struct xfs_perag *pag,
|
||||
struct xfs_trans *tp,
|
||||
struct xfs_imap *imap,
|
||||
xfs_agblock_t agbno,
|
||||
struct xfs_buf **bpp)
|
||||
{
|
||||
struct xfs_mount *mp = pag_mount(pag);
|
||||
int error;
|
||||
|
||||
error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, imap->im_blkno,
|
||||
imap->im_len, 0, bpp, &xfs_inode_buf_ops);
|
||||
error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp,
|
||||
xfs_agbno_to_daddr(pag, agbno),
|
||||
XFS_FSB_TO_BB(mp, M_IGEO(mp)->blocks_per_cluster),
|
||||
0, bpp, &xfs_inode_buf_ops);
|
||||
if (xfs_metadata_is_sick(error))
|
||||
xfs_agno_mark_sick(mp, xfs_daddr_to_agno(mp, imap->im_blkno),
|
||||
XFS_SICK_AG_INODES);
|
||||
xfs_agno_mark_sick(mp, pag_agno(pag), XFS_SICK_AG_INODES);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ xfs_inode_from_disk(
|
|||
|
||||
ASSERT(ip->i_cowfp == NULL);
|
||||
|
||||
fa = xfs_dinode_verify(ip->i_mount, ip->i_ino, from);
|
||||
fa = xfs_dinode_verify(ip->i_mount, I_INO(ip), from);
|
||||
if (fa) {
|
||||
xfs_inode_verifier_error(ip, -EFSCORRUPTED, "dinode", from,
|
||||
sizeof(*from), fa);
|
||||
|
|
@ -358,7 +358,7 @@ xfs_inode_to_disk(
|
|||
to->di_flags2 = cpu_to_be64(ip->i_diflags2);
|
||||
/* also covers the di_used_blocks union arm: */
|
||||
to->di_cowextsize = cpu_to_be32(ip->i_cowextsize);
|
||||
to->di_ino = cpu_to_be64(ip->i_ino);
|
||||
to->di_ino = cpu_to_be64(I_INO(ip));
|
||||
to->di_lsn = cpu_to_be64(lsn);
|
||||
memset(to->di_pad2, 0, sizeof(to->di_pad2));
|
||||
uuid_copy(&to->di_uuid, &ip->i_mount->m_sb.sb_meta_uuid);
|
||||
|
|
|
|||
|
|
@ -11,16 +11,15 @@ struct xfs_dinode;
|
|||
|
||||
/*
|
||||
* Inode location information. Stored in the inode and passed to
|
||||
* xfs_imap_to_bp() to get a buffer and dinode for a given inode.
|
||||
* xfs_read_icluster() to get a buffer and dinode for a given inode.
|
||||
*/
|
||||
struct xfs_imap {
|
||||
xfs_daddr_t im_blkno; /* starting BB of inode chunk */
|
||||
unsigned short im_len; /* length in BBs of inode chunk */
|
||||
unsigned short im_boffset; /* inode offset in block in bytes */
|
||||
};
|
||||
xfs_agblock_t im_agbno; /* starting agbno of inode cluster */
|
||||
unsigned short im_boffset; /* offset in inode cluster in bytes */
|
||||
} __packed;
|
||||
|
||||
int xfs_imap_to_bp(struct xfs_mount *mp, struct xfs_trans *tp,
|
||||
struct xfs_imap *imap, struct xfs_buf **bpp);
|
||||
int xfs_read_icluster(struct xfs_perag *pag, struct xfs_trans *tp,
|
||||
xfs_agblock_t agbno, struct xfs_buf **bpp);
|
||||
void xfs_dinode_calc_crc(struct xfs_mount *mp, struct xfs_dinode *dip);
|
||||
void xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to,
|
||||
xfs_lsn_t lsn);
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ xfs_iformat_local(
|
|||
if (unlikely(size > XFS_DFORK_SIZE(dip, ip->i_mount, whichfork))) {
|
||||
xfs_warn(ip->i_mount,
|
||||
"corrupt inode %llu (bad size %d for local fork, size = %zd).",
|
||||
(unsigned long long) ip->i_ino, size,
|
||||
(unsigned long long)I_INO(ip), size,
|
||||
XFS_DFORK_SIZE(dip, ip->i_mount, whichfork));
|
||||
xfs_inode_verifier_error(ip, -EFSCORRUPTED,
|
||||
"xfs_iformat_local", dip, sizeof(*dip),
|
||||
|
|
@ -126,7 +126,7 @@ xfs_iformat_extents(
|
|||
*/
|
||||
if (unlikely(size < 0 || size > XFS_DFORK_SIZE(dip, mp, whichfork))) {
|
||||
xfs_warn(ip->i_mount, "corrupt inode %llu ((a)extents = %llu).",
|
||||
ip->i_ino, nex);
|
||||
I_INO(ip), nex);
|
||||
xfs_inode_verifier_error(ip, -EFSCORRUPTED,
|
||||
"xfs_iformat_extents(1)", dip, sizeof(*dip),
|
||||
__this_address);
|
||||
|
|
@ -205,7 +205,7 @@ xfs_iformat_btree(
|
|||
ifp->if_nextents > ip->i_nblocks) ||
|
||||
level == 0 || level > XFS_BM_MAXLEVELS(mp, whichfork)) {
|
||||
xfs_warn(mp, "corrupt inode %llu (btree).",
|
||||
(unsigned long long) ip->i_ino);
|
||||
(unsigned long long)I_INO(ip));
|
||||
xfs_inode_verifier_error(ip, -EFSCORRUPTED,
|
||||
"xfs_iformat_btree", dfp, size,
|
||||
__this_address);
|
||||
|
|
|
|||
|
|
@ -464,10 +464,9 @@ xfs_iunlink_insert_inode(
|
|||
struct xfs_buf *agibp,
|
||||
struct xfs_inode *ip)
|
||||
{
|
||||
struct xfs_mount *mp = tp->t_mountp;
|
||||
struct xfs_agi *agi = agibp->b_addr;
|
||||
xfs_agino_t next_agino;
|
||||
xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ip->i_ino);
|
||||
xfs_agino_t agino = XFS_INODE_TO_AGINO(ip);
|
||||
short bucket_index = agino % XFS_AGI_UNLINKED_BUCKETS;
|
||||
int error;
|
||||
|
||||
|
|
@ -531,7 +530,7 @@ xfs_iunlink(
|
|||
ASSERT(VFS_I(ip)->i_mode != 0);
|
||||
trace_xfs_iunlink(ip);
|
||||
|
||||
pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
|
||||
pag = xfs_perag_get(mp, XFS_INODE_TO_AGNO(ip));
|
||||
|
||||
/* Get the agi buffer first. It ensures lock ordering on the list. */
|
||||
error = xfs_read_agi(pag, tp, 0, &agibp);
|
||||
|
|
@ -553,7 +552,7 @@ xfs_iunlink_remove_inode(
|
|||
{
|
||||
struct xfs_mount *mp = tp->t_mountp;
|
||||
struct xfs_agi *agi = agibp->b_addr;
|
||||
xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ip->i_ino);
|
||||
xfs_agino_t agino = XFS_INODE_TO_AGINO(ip);
|
||||
xfs_agino_t head_agino;
|
||||
short bucket_index = agino % XFS_AGI_UNLINKED_BUCKETS;
|
||||
int error;
|
||||
|
|
@ -655,7 +654,7 @@ xfs_droplink(
|
|||
if (inode->i_nlink == 0) {
|
||||
xfs_info_ratelimited(tp->t_mountp,
|
||||
"Inode 0x%llx link count dropped below zero. Pinning link count.",
|
||||
ip->i_ino);
|
||||
I_INO(ip));
|
||||
set_nlink(inode, XFS_NLINK_PINNED);
|
||||
}
|
||||
if (inode->i_nlink != XFS_NLINK_PINNED)
|
||||
|
|
@ -684,7 +683,7 @@ xfs_bumplink(
|
|||
if (inode->i_nlink == XFS_NLINK_PINNED - 1)
|
||||
xfs_info_ratelimited(tp->t_mountp,
|
||||
"Inode 0x%llx link count exceeded maximum. Pinning link count.",
|
||||
ip->i_ino);
|
||||
I_INO(ip));
|
||||
if (inode->i_nlink != XFS_NLINK_PINNED)
|
||||
inc_nlink(inode);
|
||||
|
||||
|
|
@ -708,7 +707,7 @@ xfs_inode_uninit(
|
|||
* makes the AGI lock -> unlinked list modification order the same as
|
||||
* used in O_TMPFILE creation.
|
||||
*/
|
||||
error = xfs_difree(tp, pag, ip->i_ino, xic);
|
||||
error = xfs_difree(tp, pag, I_INO(ip), xic);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,19 @@ typedef uint32_t xlog_tid_t;
|
|||
#define CYCLE_LSN(lsn) ((uint)((lsn)>>32))
|
||||
#define BLOCK_LSN(lsn) ((uint)(lsn))
|
||||
|
||||
/*
|
||||
* By comparing each component, we don't have to worry about extra endian issues
|
||||
* in treating two 32 bit numbers as one 64 bit number
|
||||
*/
|
||||
static inline xfs_lsn_t XFS_LSN_CMP(xfs_lsn_t lsn1, xfs_lsn_t lsn2)
|
||||
{
|
||||
if (CYCLE_LSN(lsn1) != CYCLE_LSN(lsn2))
|
||||
return CYCLE_LSN(lsn1) < CYCLE_LSN(lsn2) ? -999 : 999;
|
||||
if (BLOCK_LSN(lsn1) != BLOCK_LSN(lsn2))
|
||||
return BLOCK_LSN(lsn1) < BLOCK_LSN(lsn2) ? -999 : 999;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* this is used in a spot where we might otherwise double-endian-flip */
|
||||
#define CYCLE_LSN_DISK(lsn) (((__be32 *)&(lsn))[0])
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ xfs_metadir_lookup(
|
|||
.hashval = xfs_dir2_hashname(mp, xname),
|
||||
.whichfork = XFS_DATA_FORK,
|
||||
.op_flags = XFS_DA_OP_OKNOENT,
|
||||
.owner = dp->i_ino,
|
||||
.owner = I_INO(dp),
|
||||
};
|
||||
int error;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include "xfs_attr_sf.h"
|
||||
#include "xfs_bmap.h"
|
||||
#include "xfs_defer.h"
|
||||
#include "xfs_log.h"
|
||||
#include "xfs_xattr.h"
|
||||
#include "xfs_parent.h"
|
||||
#include "xfs_trans_space.h"
|
||||
|
|
@ -202,7 +201,7 @@ xfs_parent_addname(
|
|||
|
||||
xfs_inode_to_parent_rec(&ppargs->rec, dp);
|
||||
xfs_parent_da_args_init(&ppargs->args, tp, &ppargs->rec, child,
|
||||
child->i_ino, parent_name);
|
||||
I_INO(child), parent_name);
|
||||
|
||||
return xfs_attr_setname(&ppargs->args, 0);
|
||||
}
|
||||
|
|
@ -224,7 +223,7 @@ xfs_parent_removename(
|
|||
|
||||
xfs_inode_to_parent_rec(&ppargs->rec, dp);
|
||||
xfs_parent_da_args_init(&ppargs->args, tp, &ppargs->rec, child,
|
||||
child->i_ino, parent_name);
|
||||
I_INO(child), parent_name);
|
||||
|
||||
return xfs_attr_removename(&ppargs->args);
|
||||
}
|
||||
|
|
@ -248,7 +247,7 @@ xfs_parent_replacename(
|
|||
|
||||
xfs_inode_to_parent_rec(&ppargs->rec, old_dp);
|
||||
xfs_parent_da_args_init(&ppargs->args, tp, &ppargs->rec, child,
|
||||
child->i_ino, old_name);
|
||||
I_INO(child), old_name);
|
||||
|
||||
xfs_inode_to_parent_rec(&ppargs->new_rec, new_dp);
|
||||
|
||||
|
|
@ -312,7 +311,7 @@ xfs_parent_lookup(
|
|||
struct xfs_da_args *scratch)
|
||||
{
|
||||
memset(scratch, 0, sizeof(struct xfs_da_args));
|
||||
xfs_parent_da_args_init(scratch, tp, pptr, ip, ip->i_ino, parent_name);
|
||||
xfs_parent_da_args_init(scratch, tp, pptr, ip, I_INO(ip), parent_name);
|
||||
return xfs_attr_get_ilocked(scratch);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ xfs_inode_to_parent_rec(
|
|||
struct xfs_parent_rec *rec,
|
||||
const struct xfs_inode *dp)
|
||||
{
|
||||
xfs_parent_rec_init(rec, dp->i_ino, VFS_IC(dp)->i_generation);
|
||||
xfs_parent_rec_init(rec, I_INO(dp), VFS_IC(dp)->i_generation);
|
||||
}
|
||||
|
||||
extern struct kmem_cache *xfs_parent_args_cache;
|
||||
|
|
|
|||
|
|
@ -2780,7 +2780,7 @@ xfs_rmap_map_extent(
|
|||
if (whichfork != XFS_ATTR_FORK && xfs_is_reflink_inode(ip))
|
||||
type = XFS_RMAP_MAP_SHARED;
|
||||
|
||||
__xfs_rmap_add(tp, type, ip->i_ino, isrt, whichfork, PREV);
|
||||
__xfs_rmap_add(tp, type, I_INO(ip), isrt, whichfork, PREV);
|
||||
}
|
||||
|
||||
/* Unmap an extent out of a file. */
|
||||
|
|
@ -2800,7 +2800,7 @@ xfs_rmap_unmap_extent(
|
|||
if (whichfork != XFS_ATTR_FORK && xfs_is_reflink_inode(ip))
|
||||
type = XFS_RMAP_UNMAP_SHARED;
|
||||
|
||||
__xfs_rmap_add(tp, type, ip->i_ino, isrt, whichfork, PREV);
|
||||
__xfs_rmap_add(tp, type, I_INO(ip), isrt, whichfork, PREV);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2826,7 +2826,7 @@ xfs_rmap_convert_extent(
|
|||
if (whichfork != XFS_ATTR_FORK && xfs_is_reflink_inode(ip))
|
||||
type = XFS_RMAP_CONVERT_SHARED;
|
||||
|
||||
__xfs_rmap_add(tp, type, ip->i_ino, isrt, whichfork, PREV);
|
||||
__xfs_rmap_add(tp, type, I_INO(ip), isrt, whichfork, PREV);
|
||||
}
|
||||
|
||||
/* Schedule the creation of an rmap for non-file data. */
|
||||
|
|
|
|||
|
|
@ -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, I_INO(ip), whichfork)
|
||||
|
||||
static inline void
|
||||
xfs_rmap_ino_owner(
|
||||
|
|
@ -35,6 +37,8 @@ xfs_rmap_ino_owner(
|
|||
if (whichfork == XFS_ATTR_FORK)
|
||||
oi->oi_flags |= XFS_OWNER_INFO_ATTR_FORK;
|
||||
}
|
||||
#define xfs_rmap_inode_owner(oi, ip, whichfork, offset) \
|
||||
xfs_rmap_ino_owner(oi, I_INO(ip), whichfork, offset)
|
||||
|
||||
static inline bool
|
||||
xfs_rmap_should_skip_owner_update(
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ xfs_rtbuf_get(
|
|||
if (xfs_has_rtgroups(mp)) {
|
||||
struct xfs_rtbuf_blkinfo *hdr = bp->b_addr;
|
||||
|
||||
if (hdr->rt_owner != cpu_to_be64(ip->i_ino)) {
|
||||
if (hdr->rt_owner != cpu_to_be64(I_INO(ip))) {
|
||||
xfs_buf_mark_corrupt(bp);
|
||||
xfs_trans_brelse(args->tp, bp);
|
||||
xfs_rtginode_mark_sick(args->rtg, type);
|
||||
|
|
@ -1409,7 +1409,7 @@ xfs_rtfile_initialize_block(
|
|||
hdr->rt_magic = cpu_to_be32(XFS_RTBITMAP_MAGIC);
|
||||
else
|
||||
hdr->rt_magic = cpu_to_be32(XFS_RTSUMMARY_MAGIC);
|
||||
hdr->rt_owner = cpu_to_be64(ip->i_ino);
|
||||
hdr->rt_owner = cpu_to_be64(I_INO(ip));
|
||||
hdr->rt_blkno = cpu_to_be64(XFS_FSB_TO_DADDR(mp, fsbno));
|
||||
hdr->rt_lsn = 0;
|
||||
uuid_copy(&hdr->rt_uuid, &mp->m_sb.sb_meta_uuid);
|
||||
|
|
|
|||
|
|
@ -602,7 +602,7 @@ xfs_rtrefcountbt_from_disk(
|
|||
rblocklen = xfs_rtrefcount_broot_space(mp, dblock);
|
||||
|
||||
xfs_btree_init_block(mp, rblock, &xfs_rtrefcountbt_ops, 0, 0,
|
||||
ip->i_ino);
|
||||
I_INO(ip));
|
||||
|
||||
rblock->bb_level = dblock->bb_level;
|
||||
rblock->bb_numrecs = dblock->bb_numrecs;
|
||||
|
|
@ -751,7 +751,7 @@ xfs_rtrefcountbt_create(
|
|||
xfs_rtrefcount_broot_space_calc(mp, 0, 0));
|
||||
if (broot)
|
||||
xfs_btree_init_block(mp, broot, &xfs_rtrefcountbt_ops, 0, 0,
|
||||
ip->i_ino);
|
||||
I_INO(ip));
|
||||
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE | XFS_ILOG_DBROOT);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -839,7 +839,7 @@ xfs_rtrmapbt_from_disk(
|
|||
unsigned int numrecs;
|
||||
unsigned int maxrecs;
|
||||
|
||||
xfs_btree_init_block(mp, rblock, &xfs_rtrmapbt_ops, 0, 0, ip->i_ino);
|
||||
xfs_btree_init_block(mp, rblock, &xfs_rtrmapbt_ops, 0, 0, I_INO(ip));
|
||||
|
||||
rblock->bb_level = dblock->bb_level;
|
||||
rblock->bb_numrecs = dblock->bb_numrecs;
|
||||
|
|
@ -981,7 +981,7 @@ xfs_rtrmapbt_create(
|
|||
broot = xfs_broot_realloc(ifp, xfs_rtrmap_broot_space_calc(mp, 0, 0));
|
||||
if (broot)
|
||||
xfs_btree_init_block(mp, broot, &xfs_rtrmapbt_ops, 0, 0,
|
||||
ip->i_ino);
|
||||
I_INO(ip));
|
||||
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE | XFS_ILOG_DBROOT);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ xfs_symlink_local_to_remote(
|
|||
bp->b_ops = &xfs_symlink_buf_ops;
|
||||
|
||||
buf = bp->b_addr;
|
||||
buf += xfs_symlink_hdr_set(mp, ip->i_ino, 0, ifp->if_bytes, bp);
|
||||
buf += xfs_symlink_hdr_set(mp, I_INO(ip), 0, ifp->if_bytes, bp);
|
||||
memcpy(buf, ifp->if_data, ifp->if_bytes);
|
||||
xfs_trans_log_buf(tp, bp, 0, sizeof(struct xfs_dsymlink_hdr) +
|
||||
ifp->if_bytes - 1);
|
||||
|
|
@ -277,13 +277,13 @@ xfs_symlink_remote_read(
|
|||
|
||||
cur_chunk = bp->b_addr;
|
||||
if (xfs_has_crc(mp)) {
|
||||
if (!xfs_symlink_hdr_ok(ip->i_ino, offset,
|
||||
if (!xfs_symlink_hdr_ok(I_INO(ip), offset,
|
||||
byte_cnt, bp)) {
|
||||
xfs_inode_mark_sick(ip, XFS_SICK_INO_SYMLINK);
|
||||
error = -EFSCORRUPTED;
|
||||
xfs_alert(mp,
|
||||
"symlink header does not match required off/len/owner (0x%x/0x%x,0x%llx)",
|
||||
offset, byte_cnt, ip->i_ino);
|
||||
offset, byte_cnt, I_INO(ip));
|
||||
xfs_buf_relse(bp);
|
||||
goto out;
|
||||
|
||||
|
|
|
|||
|
|
@ -1116,9 +1116,7 @@ xrep_iunlink_igrab(
|
|||
struct xfs_perag *pag,
|
||||
struct xfs_inode *ip)
|
||||
{
|
||||
struct xfs_mount *mp = pag_mount(pag);
|
||||
|
||||
if (XFS_INO_TO_AGNO(mp, ip->i_ino) != pag_agno(pag))
|
||||
if (XFS_INODE_TO_AGNO(ip) != pag_agno(pag))
|
||||
return false;
|
||||
|
||||
if (!xfs_inode_on_unlinked_list(ip))
|
||||
|
|
@ -1136,18 +1134,14 @@ xrep_iunlink_visit(
|
|||
struct xrep_agi *ragi,
|
||||
unsigned int batch_idx)
|
||||
{
|
||||
struct xfs_mount *mp = ragi->sc->mp;
|
||||
struct xfs_inode *ip = ragi->lookup_batch[batch_idx];
|
||||
xfs_agino_t agino;
|
||||
unsigned int bucket;
|
||||
xfs_agino_t agino = XFS_INODE_TO_AGINO(ip);
|
||||
unsigned int bucket = agino % XFS_AGI_UNLINKED_BUCKETS;
|
||||
int error;
|
||||
|
||||
ASSERT(XFS_INO_TO_AGNO(mp, ip->i_ino) == pag_agno(ragi->sc->sa.pag));
|
||||
ASSERT(XFS_INODE_TO_AGNO(ip) == pag_agno(ragi->sc->sa.pag));
|
||||
ASSERT(xfs_inode_on_unlinked_list(ip));
|
||||
|
||||
agino = XFS_INO_TO_AGINO(mp, ip->i_ino);
|
||||
bucket = agino % XFS_AGI_UNLINKED_BUCKETS;
|
||||
|
||||
trace_xrep_iunlink_visit(ragi->sc->sa.pag, bucket,
|
||||
ragi->iunlink_heads[bucket], ip);
|
||||
|
||||
|
|
@ -1213,10 +1207,10 @@ xrep_iunlink_mark_incore(
|
|||
* us to see this inode, so another lookup from the
|
||||
* same index will not find it again.
|
||||
*/
|
||||
if (XFS_INO_TO_AGNO(mp, ip->i_ino) != pag_agno(pag))
|
||||
if (XFS_INODE_TO_AGNO(ip) != pag_agno(pag))
|
||||
continue;
|
||||
first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1);
|
||||
if (first_index < XFS_INO_TO_AGINO(mp, ip->i_ino))
|
||||
first_index = XFS_INO_TO_AGINO(mp, I_INO(ip) + 1);
|
||||
if (first_index < XFS_INODE_TO_AGINO(ip))
|
||||
done = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ xchk_xattr_actor(
|
|||
.namelen = namelen,
|
||||
.trans = sc->tp,
|
||||
.valuelen = valuelen,
|
||||
.owner = ip->i_ino,
|
||||
.owner = I_INO(ip),
|
||||
};
|
||||
struct xchk_xattr_buf *ab;
|
||||
int error = 0;
|
||||
|
|
@ -199,7 +199,7 @@ xchk_xattr_actor(
|
|||
|
||||
if (attr_flags & XFS_ATTR_INCOMPLETE) {
|
||||
/* Incomplete attr key, just mark the inode for preening. */
|
||||
xchk_ino_set_preen(sc, ip->i_ino);
|
||||
xchk_ino_set_preen(sc, I_INO(ip));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ xrep_xattr_salvage_remote_attr(
|
|||
.dp = rx->sc->ip,
|
||||
.index = ent_idx,
|
||||
.geo = rx->sc->mp->m_attr_geo,
|
||||
.owner = rx->sc->ip->i_ino,
|
||||
.owner = I_INO(rx->sc->ip),
|
||||
.attr_filter = ent->flags & XFS_ATTR_NSP_ONDISK_MASK,
|
||||
.namelen = rentry->namelen,
|
||||
.name = rentry->name,
|
||||
|
|
@ -590,7 +590,7 @@ xrep_xattr_recover_block(
|
|||
* as much as we can from the block. */
|
||||
if (info->magic == cpu_to_be16(XFS_ATTR3_LEAF_MAGIC) &&
|
||||
xrep_buf_verify_struct(bp, &xfs_attr3_leaf_buf_ops) &&
|
||||
xfs_attr3_leaf_header_check(bp, rx->sc->ip->i_ino) == NULL)
|
||||
xfs_attr3_leaf_header_check(bp, I_INO(rx->sc->ip)) == NULL)
|
||||
error = xrep_xattr_recover_leaf(rx, bp);
|
||||
|
||||
/*
|
||||
|
|
@ -617,7 +617,7 @@ xrep_xattr_insert_rec(
|
|||
.attr_filter = key->flags,
|
||||
.namelen = key->namelen,
|
||||
.valuelen = key->valuelen,
|
||||
.owner = rx->sc->ip->i_ino,
|
||||
.owner = I_INO(rx->sc->ip),
|
||||
.geo = rx->sc->mp->m_attr_geo,
|
||||
.whichfork = XFS_ATTR_FORK,
|
||||
.op_flags = XFS_DA_OP_OKNOENT,
|
||||
|
|
@ -982,7 +982,7 @@ xrep_xattr_fork_remove(
|
|||
|
||||
xfs_emerg(sc->mp,
|
||||
"inode 0x%llx attr fork still has %llu attr extents, format %d?!",
|
||||
ip->i_ino, ifp->if_nextents, ifp->if_format);
|
||||
I_INO(ip), ifp->if_nextents, ifp->if_format);
|
||||
for_each_xfs_iext(ifp, &icur, &irec) {
|
||||
xfs_err(sc->mp,
|
||||
"[%u]: startoff %llu startblock %llu blockcount %llu state %u",
|
||||
|
|
@ -1116,7 +1116,7 @@ xrep_xattr_replay_pptr_update(
|
|||
trace_xrep_xattr_replay_parentadd(sc->tempip, xname,
|
||||
&pptr->pptr_rec);
|
||||
|
||||
error = xfs_parent_set(sc->tempip, sc->ip->i_ino, xname,
|
||||
error = xfs_parent_set(sc->tempip, I_INO(sc->ip), xname,
|
||||
&pptr->pptr_rec, &rx->pptr_args);
|
||||
ASSERT(error != -EEXIST);
|
||||
return error;
|
||||
|
|
@ -1125,7 +1125,7 @@ xrep_xattr_replay_pptr_update(
|
|||
trace_xrep_xattr_replay_parentremove(sc->tempip, xname,
|
||||
&pptr->pptr_rec);
|
||||
|
||||
error = xfs_parent_unset(sc->tempip, sc->ip->i_ino, xname,
|
||||
error = xfs_parent_unset(sc->tempip, I_INO(sc->ip), xname,
|
||||
&pptr->pptr_rec, &rx->pptr_args);
|
||||
ASSERT(error != -ENOATTR);
|
||||
return error;
|
||||
|
|
@ -1256,7 +1256,7 @@ xrep_xattr_live_dirent_update(
|
|||
* repairing, so stash the update for replay against the temporary
|
||||
* file.
|
||||
*/
|
||||
if (p->ip->i_ino != sc->ip->i_ino)
|
||||
if (I_INO(p->ip) != I_INO(sc->ip))
|
||||
return NOTIFY_DONE;
|
||||
|
||||
mutex_lock(&rx->lock);
|
||||
|
|
@ -1295,7 +1295,7 @@ xrep_xattr_swap_prep(
|
|||
.whichfork = XFS_ATTR_FORK,
|
||||
.trans = sc->tp,
|
||||
.total = 1,
|
||||
.owner = sc->ip->i_ino,
|
||||
.owner = I_INO(sc->ip),
|
||||
};
|
||||
|
||||
error = xfs_attr_shortform_to_leaf(&args);
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ xchk_bmap_xref_rmap(
|
|||
{
|
||||
struct xfs_rmap_irec rmap;
|
||||
unsigned long long rmap_end;
|
||||
uint64_t owner = info->sc->ip->i_ino;
|
||||
uint64_t owner = I_INO(info->sc->ip);
|
||||
|
||||
if (xchk_skip_xref(info->sc->sm))
|
||||
return;
|
||||
|
|
@ -352,7 +352,7 @@ xchk_bmap_rt_iextent_xref(
|
|||
case XFS_DATA_FORK:
|
||||
xchk_bmap_xref_rmap(info, irec, rgbno);
|
||||
if (!xfs_is_reflink_inode(info->sc->ip)) {
|
||||
xfs_rmap_ino_owner(&oinfo, info->sc->ip->i_ino,
|
||||
xfs_rmap_inode_owner(&oinfo, info->sc->ip,
|
||||
info->whichfork, irec->br_startoff);
|
||||
xchk_xref_is_only_rt_owned_by(info->sc, rgbno,
|
||||
irec->br_blockcount, &oinfo);
|
||||
|
|
@ -407,7 +407,7 @@ xchk_bmap_iextent_xref(
|
|||
case XFS_DATA_FORK:
|
||||
xchk_bmap_xref_rmap(info, irec, agbno);
|
||||
if (!xfs_is_reflink_inode(info->sc->ip)) {
|
||||
xfs_rmap_ino_owner(&oinfo, info->sc->ip->i_ino,
|
||||
xfs_rmap_inode_owner(&oinfo, info->sc->ip,
|
||||
info->whichfork, irec->br_startoff);
|
||||
xchk_xref_is_only_owned_by(info->sc, agbno,
|
||||
irec->br_blockcount, &oinfo);
|
||||
|
|
@ -419,7 +419,7 @@ xchk_bmap_iextent_xref(
|
|||
break;
|
||||
case XFS_ATTR_FORK:
|
||||
xchk_bmap_xref_rmap(info, irec, agbno);
|
||||
xfs_rmap_ino_owner(&oinfo, info->sc->ip->i_ino,
|
||||
xfs_rmap_inode_owner(&oinfo, info->sc->ip,
|
||||
info->whichfork, irec->br_startoff);
|
||||
xchk_xref_is_only_owned_by(info->sc, agbno, irec->br_blockcount,
|
||||
&oinfo);
|
||||
|
|
@ -543,7 +543,7 @@ xchk_bmapbt_rec(
|
|||
for (i = 0; i < bs->cur->bc_nlevels - 1; i++) {
|
||||
block = xfs_btree_get_block(bs->cur, i, &bp);
|
||||
owner = be64_to_cpu(block->bb_u.l.bb_owner);
|
||||
if (owner != ip->i_ino)
|
||||
if (owner != I_INO(ip))
|
||||
xchk_fblock_set_corrupt(bs->sc,
|
||||
info->whichfork, 0);
|
||||
}
|
||||
|
|
@ -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:
|
||||
|
|
@ -628,7 +628,7 @@ xchk_bmap_check_rmap(
|
|||
bool have_map;
|
||||
|
||||
/* Is this even the right fork? */
|
||||
if (rec->rm_owner != sc->ip->i_ino)
|
||||
if (rec->rm_owner != I_INO(sc->ip))
|
||||
return 0;
|
||||
if ((sbcri->whichfork == XFS_ATTR_FORK) ^
|
||||
!!(rec->rm_flags & XFS_RMAP_ATTR_FORK))
|
||||
|
|
@ -1003,7 +1003,7 @@ xchk_bmap_iext_iter(
|
|||
*/
|
||||
if (nr > 1 && info->whichfork != XFS_COW_FORK &&
|
||||
howmany_64(irec->br_blockcount, XFS_MAX_BMBT_EXTLEN) < nr)
|
||||
xchk_ino_set_preen(info->sc, info->sc->ip->i_ino);
|
||||
xchk_ino_set_preen(info->sc, I_INO(info->sc->ip));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1040,7 +1040,7 @@ xchk_bmap(
|
|||
case XFS_COW_FORK:
|
||||
/* No CoW forks filesystem doesn't support out of place writes */
|
||||
if (!xfs_has_reflink(mp) && !xfs_has_zoned(mp)) {
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
|
@ -1052,7 +1052,7 @@ xchk_bmap(
|
|||
* attr here.
|
||||
*/
|
||||
if (!xfs_has_attr(mp))
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
break;
|
||||
default:
|
||||
ASSERT(whichfork == XFS_DATA_FORK);
|
||||
|
|
@ -1137,7 +1137,7 @@ xchk_bmap_data(
|
|||
int error;
|
||||
|
||||
if (xchk_file_looks_zapped(sc, XFS_SICK_INO_BMBTD_ZAPPED)) {
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1165,7 +1165,7 @@ xchk_bmap_attr(
|
|||
* returning immediately.
|
||||
*/
|
||||
if (xchk_file_looks_zapped(sc, XFS_SICK_INO_BMBTA_ZAPPED)) {
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ xrep_bmap_walk_rmap(
|
|||
if (xchk_should_terminate(rb->sc, &error))
|
||||
return error;
|
||||
|
||||
if (rec->rm_owner != rb->sc->ip->i_ino)
|
||||
if (rec->rm_owner != I_INO(rb->sc->ip))
|
||||
return 0;
|
||||
|
||||
error = xrep_bmap_check_fork_rmap(rb, cur, rec);
|
||||
|
|
@ -416,7 +416,7 @@ xrep_bmap_walk_rtrmap(
|
|||
return error;
|
||||
|
||||
/* Skip extents which are not owned by this inode and fork. */
|
||||
if (rec->rm_owner != rb->sc->ip->i_ino)
|
||||
if (rec->rm_owner != I_INO(rb->sc->ip))
|
||||
return 0;
|
||||
|
||||
error = xrep_bmap_check_rtfork_rmap(rb->sc, cur, rec);
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -320,12 +320,12 @@ xchk_ino_set_corrupt(
|
|||
|
||||
/* Record a corruption while cross-referencing with an inode. */
|
||||
void
|
||||
xchk_ino_xref_set_corrupt(
|
||||
xchk_ip_xref_set_corrupt(
|
||||
struct xfs_scrub *sc,
|
||||
xfs_ino_t ino)
|
||||
struct xfs_inode *ip)
|
||||
{
|
||||
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
|
||||
trace_xchk_ino_error(sc, ino, __return_address);
|
||||
trace_xchk_ino_error(sc, I_INO(ip), __return_address);
|
||||
}
|
||||
|
||||
/* Record corruption in a block indexed by a file fork. */
|
||||
|
|
@ -1110,7 +1110,7 @@ xchk_install_live_inode(
|
|||
struct xfs_inode *ip)
|
||||
{
|
||||
if (!igrab(VFS_I(ip))) {
|
||||
xchk_ino_set_corrupt(sc, ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, ip);
|
||||
return -EFSCORRUPTED;
|
||||
}
|
||||
|
||||
|
|
@ -1141,7 +1141,7 @@ xchk_iget_for_scrubbing(
|
|||
ASSERT(sc->tp == NULL);
|
||||
|
||||
/* We want to scan the inode we already had opened. */
|
||||
if (sc->sm->sm_ino == 0 || sc->sm->sm_ino == ip_in->i_ino)
|
||||
if (sc->sm->sm_ino == 0 || sc->sm->sm_ino == I_INO(ip_in))
|
||||
return xchk_install_live_inode(sc, ip_in);
|
||||
|
||||
/*
|
||||
|
|
@ -1439,13 +1439,13 @@ xchk_metadata_inode_forks(
|
|||
|
||||
/* Metadata inodes don't live on the rt device. */
|
||||
if (sc->ip->i_diflags & XFS_DIFLAG_REALTIME) {
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* They should never participate in reflink. */
|
||||
if (xfs_is_reflink_inode(sc->ip)) {
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1462,7 +1462,7 @@ xchk_metadata_inode_forks(
|
|||
&error))
|
||||
return error;
|
||||
if (shared)
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1471,7 +1471,7 @@ xchk_metadata_inode_forks(
|
|||
*/
|
||||
if (xfs_inode_hasattr(sc->ip)) {
|
||||
if (!xfs_has_metadir(sc->mp)) {
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1573,7 +1573,7 @@ xchk_inode_is_allocated(
|
|||
* This isn't the inode we want.
|
||||
*/
|
||||
spin_lock(&ip->i_flags_lock);
|
||||
if (ip->i_ino != ino)
|
||||
if (I_INO(ip) != ino)
|
||||
goto out_skip;
|
||||
|
||||
trace_xchk_inode_is_allocated(ip);
|
||||
|
|
@ -1681,7 +1681,7 @@ bool
|
|||
xchk_inode_is_sb_rooted(const struct xfs_inode *ip)
|
||||
{
|
||||
return xchk_inode_is_dirtree_root(ip) ||
|
||||
xfs_is_sb_inum(ip->i_mount, ip->i_ino);
|
||||
xfs_is_sb_inum(ip->i_mount, I_INO(ip));
|
||||
}
|
||||
|
||||
/* What is the root directory inumber for this inode? */
|
||||
|
|
@ -1691,8 +1691,8 @@ xchk_inode_rootdir_inum(const struct xfs_inode *ip)
|
|||
struct xfs_mount *mp = ip->i_mount;
|
||||
|
||||
if (xfs_is_metadir_inode(ip))
|
||||
return mp->m_metadirip->i_ino;
|
||||
return mp->m_rootip->i_ino;
|
||||
return I_INO(mp->m_metadirip);
|
||||
return I_INO(mp->m_rootip);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ void xchk_set_corrupt(struct xfs_scrub *sc);
|
|||
void xchk_block_set_corrupt(struct xfs_scrub *sc,
|
||||
struct xfs_buf *bp);
|
||||
void xchk_ino_set_corrupt(struct xfs_scrub *sc, xfs_ino_t ino);
|
||||
#define xchk_ip_set_corrupt(_sc, _ip) \
|
||||
xchk_ino_set_corrupt((_sc), I_INO(_ip))
|
||||
void xchk_fblock_set_corrupt(struct xfs_scrub *sc, int whichfork,
|
||||
xfs_fileoff_t offset);
|
||||
#ifdef CONFIG_XFS_QUOTA
|
||||
|
|
@ -41,8 +43,8 @@ void xchk_qcheck_set_corrupt(struct xfs_scrub *sc, unsigned int dqtype,
|
|||
|
||||
void xchk_block_xref_set_corrupt(struct xfs_scrub *sc,
|
||||
struct xfs_buf *bp);
|
||||
void xchk_ino_xref_set_corrupt(struct xfs_scrub *sc,
|
||||
xfs_ino_t ino);
|
||||
void xchk_ip_xref_set_corrupt(struct xfs_scrub *sc,
|
||||
struct xfs_inode *ip);
|
||||
void xchk_fblock_xref_set_corrupt(struct xfs_scrub *sc,
|
||||
int whichfork, xfs_fileoff_t offset);
|
||||
|
||||
|
|
|
|||
|
|
@ -420,8 +420,7 @@ xrep_cow_alloc(
|
|||
if (error)
|
||||
return error;
|
||||
|
||||
error = xfs_alloc_vextent_start_ag(&args,
|
||||
XFS_INO_TO_FSB(sc->mp, sc->ip->i_ino));
|
||||
error = xfs_alloc_vextent_start_ag(&args, XFS_INODE_TO_FSB(sc->ip));
|
||||
if (error)
|
||||
return error;
|
||||
if (args.fsbno == NULLFSBLOCK)
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ xchk_da_btree_block(
|
|||
/* Check the owner. */
|
||||
if (xfs_has_crc(ip->i_mount)) {
|
||||
owner = be64_to_cpu(hdr3->owner);
|
||||
if (owner != ip->i_ino)
|
||||
if (owner != I_INO(ip))
|
||||
xchk_da_set_corrupt(ds, level);
|
||||
}
|
||||
|
||||
|
|
@ -524,7 +524,7 @@ xchk_da_btree(
|
|||
ds->dargs.whichfork = whichfork;
|
||||
ds->dargs.trans = sc->tp;
|
||||
ds->dargs.op_flags = XFS_DA_OP_OKNOENT;
|
||||
ds->dargs.owner = sc->ip->i_ino;
|
||||
ds->dargs.owner = I_INO(sc->ip);
|
||||
ds->state = xfs_da_state_alloc(&ds->dargs);
|
||||
ds->sc = sc;
|
||||
ds->private = private;
|
||||
|
|
|
|||
|
|
@ -187,11 +187,11 @@ xchk_dir_check_pptr_fast(
|
|||
if (!lockmode) {
|
||||
struct xchk_dirent save_de = {
|
||||
.namelen = name->len,
|
||||
.ino = ip->i_ino,
|
||||
.ino = I_INO(ip),
|
||||
};
|
||||
|
||||
/* Couldn't lock the inode, so save the dirent for later. */
|
||||
trace_xchk_dir_defer(sc->ip, name, ip->i_ino);
|
||||
trace_xchk_dir_defer(sc->ip, name, I_INO(ip));
|
||||
|
||||
error = xfblob_storename(sd->dir_names, &save_de.name_cookie,
|
||||
name);
|
||||
|
|
@ -254,14 +254,14 @@ xchk_dir_actor(
|
|||
|
||||
if (xfs_dir2_samename(name, &xfs_name_dot)) {
|
||||
/* If this is "." then check that the inum matches the dir. */
|
||||
if (ino != dp->i_ino)
|
||||
if (ino != I_INO(dp))
|
||||
xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
|
||||
} else if (xfs_dir2_samename(name, &xfs_name_dotdot)) {
|
||||
/*
|
||||
* If this is ".." in the root inode, check that the inum
|
||||
* matches this dir.
|
||||
*/
|
||||
if (xchk_inode_is_dirtree_root(dp) && ino != dp->i_ino)
|
||||
if (xchk_inode_is_dirtree_root(dp) && ino != I_INO(dp))
|
||||
xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, offset);
|
||||
}
|
||||
|
||||
|
|
@ -482,10 +482,10 @@ xchk_directory_data_bestfree(
|
|||
/* dir block format */
|
||||
if (lblk != XFS_B_TO_FSBT(mp, XFS_DIR2_DATA_OFFSET))
|
||||
xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
|
||||
error = xfs_dir3_block_read(sc->tp, sc->ip, sc->ip->i_ino, &bp);
|
||||
error = xfs_dir3_block_read(sc->tp, sc->ip, I_INO(sc->ip), &bp);
|
||||
} else {
|
||||
/* dir data format */
|
||||
error = xfs_dir3_data_read(sc->tp, sc->ip, sc->ip->i_ino, lblk,
|
||||
error = xfs_dir3_data_read(sc->tp, sc->ip, I_INO(sc->ip), lblk,
|
||||
0, &bp);
|
||||
}
|
||||
if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
|
||||
|
|
@ -643,7 +643,7 @@ xchk_directory_leaf1_bestfree(
|
|||
int error;
|
||||
|
||||
/* Read the free space block. */
|
||||
error = xfs_dir3_leaf_read(sc->tp, sc->ip, sc->ip->i_ino, lblk, &bp);
|
||||
error = xfs_dir3_leaf_read(sc->tp, sc->ip, I_INO(sc->ip), lblk, &bp);
|
||||
if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
|
||||
return error;
|
||||
xchk_buffer_recheck(sc, bp);
|
||||
|
|
@ -749,7 +749,7 @@ xchk_directory_free_bestfree(
|
|||
int error;
|
||||
|
||||
/* Read the free space block */
|
||||
error = xfs_dir2_free_read(sc->tp, sc->ip, sc->ip->i_ino, lblk, &bp);
|
||||
error = xfs_dir2_free_read(sc->tp, sc->ip, I_INO(sc->ip), lblk, &bp);
|
||||
if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, lblk, &error))
|
||||
return error;
|
||||
xchk_buffer_recheck(sc, bp);
|
||||
|
|
@ -797,7 +797,7 @@ xchk_directory_blocks(
|
|||
.whichfork = XFS_DATA_FORK,
|
||||
.geo = sc->mp->m_dir_geo,
|
||||
.trans = sc->tp,
|
||||
.owner = sc->ip->i_ino,
|
||||
.owner = I_INO(sc->ip),
|
||||
};
|
||||
struct xfs_ifork *ifp = xfs_ifork_ptr(sc->ip, XFS_DATA_FORK);
|
||||
struct xfs_mount *mp = sc->mp;
|
||||
|
|
@ -996,7 +996,7 @@ xchk_dir_slow_dirent(
|
|||
*/
|
||||
lockmode = xchk_dir_lock_child(sc, ip);
|
||||
if (lockmode) {
|
||||
trace_xchk_dir_slowpath(sc->ip, xname, ip->i_ino);
|
||||
trace_xchk_dir_slowpath(sc->ip, xname, I_INO(ip));
|
||||
goto check_pptr;
|
||||
}
|
||||
|
||||
|
|
@ -1007,7 +1007,7 @@ xchk_dir_slow_dirent(
|
|||
xchk_iunlock(sc, sc->ilock_flags);
|
||||
sd->need_revalidate = true;
|
||||
|
||||
trace_xchk_dir_ultraslowpath(sc->ip, xname, ip->i_ino);
|
||||
trace_xchk_dir_ultraslowpath(sc->ip, xname, I_INO(ip));
|
||||
|
||||
error = xchk_dir_trylock_for_pptrs(sc, ip, &lockmode);
|
||||
if (error)
|
||||
|
|
@ -1080,7 +1080,7 @@ xchk_directory(
|
|||
|
||||
/* Plausible size? */
|
||||
if (sc->ip->i_disk_size < xfs_dir2_sf_hdr_size(0)) {
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ xrep_dir_want_salvage(
|
|||
struct xfs_mount *mp = rd->sc->mp;
|
||||
|
||||
/* No pointers to ourselves or to garbage. */
|
||||
if (ino == rd->sc->ip->i_ino)
|
||||
if (ino == I_INO(rd->sc->ip))
|
||||
return false;
|
||||
if (!xfs_verify_dir_ino(mp, ino))
|
||||
return false;
|
||||
|
|
@ -644,14 +644,14 @@ xrep_dir_recover_dirblock(
|
|||
case cpu_to_be32(XFS_DIR3_BLOCK_MAGIC):
|
||||
if (!xrep_buf_verify_struct(bp, &xfs_dir3_block_buf_ops))
|
||||
goto out;
|
||||
if (xfs_dir3_block_header_check(bp, rd->sc->ip->i_ino) != NULL)
|
||||
if (xfs_dir3_block_header_check(bp, I_INO(rd->sc->ip)) != NULL)
|
||||
goto out;
|
||||
break;
|
||||
case cpu_to_be32(XFS_DIR2_DATA_MAGIC):
|
||||
case cpu_to_be32(XFS_DIR3_DATA_MAGIC):
|
||||
if (!xrep_buf_verify_struct(bp, &xfs_dir3_data_buf_ops))
|
||||
goto out;
|
||||
if (xfs_dir3_data_header_check(bp, rd->sc->ip->i_ino) != NULL)
|
||||
if (xfs_dir3_data_header_check(bp, I_INO(rd->sc->ip)) != NULL)
|
||||
goto out;
|
||||
break;
|
||||
default:
|
||||
|
|
@ -676,7 +676,7 @@ xrep_dir_init_args(
|
|||
memset(&rd->args, 0, sizeof(struct xfs_da_args));
|
||||
rd->args.geo = rd->sc->mp->m_dir_geo;
|
||||
rd->args.whichfork = XFS_DATA_FORK;
|
||||
rd->args.owner = rd->sc->ip->i_ino;
|
||||
rd->args.owner = I_INO(rd->sc->ip);
|
||||
rd->args.trans = rd->sc->tp;
|
||||
rd->args.dp = dp;
|
||||
if (!name)
|
||||
|
|
@ -1125,12 +1125,12 @@ xrep_dir_scan_pptr(
|
|||
if (error)
|
||||
return error;
|
||||
|
||||
if (parent_ino != sc->ip->i_ino ||
|
||||
if (parent_ino != I_INO(sc->ip) ||
|
||||
parent_gen != VFS_I(sc->ip)->i_generation)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&rd->pscan.lock);
|
||||
error = xrep_dir_stash_createname(rd, &xname, ip->i_ino);
|
||||
error = xrep_dir_stash_createname(rd, &xname, I_INO(ip));
|
||||
mutex_unlock(&rd->pscan.lock);
|
||||
return error;
|
||||
}
|
||||
|
|
@ -1151,7 +1151,7 @@ xrep_dir_scan_dirent(
|
|||
struct xrep_dir *rd = priv;
|
||||
|
||||
/* Dirent doesn't point to this directory. */
|
||||
if (ino != rd->sc->ip->i_ino)
|
||||
if (ino != I_INO(rd->sc->ip))
|
||||
return 0;
|
||||
|
||||
/* Ignore garbage inum. */
|
||||
|
|
@ -1168,9 +1168,9 @@ xrep_dir_scan_dirent(
|
|||
return 0;
|
||||
|
||||
trace_xrep_dir_stash_createname(sc->tempip, &xfs_name_dotdot,
|
||||
dp->i_ino);
|
||||
I_INO(dp));
|
||||
|
||||
xrep_findparent_scan_found(&rd->pscan, dp->i_ino);
|
||||
xrep_findparent_scan_found(&rd->pscan, I_INO(dp));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1281,7 +1281,7 @@ xrep_dir_scan_dirtree(
|
|||
|
||||
/* Roots of directory trees are their own parents. */
|
||||
if (xchk_inode_is_dirtree_root(sc->ip))
|
||||
xrep_findparent_scan_found(&rd->pscan, sc->ip->i_ino);
|
||||
xrep_findparent_scan_found(&rd->pscan, I_INO(sc->ip));
|
||||
|
||||
/*
|
||||
* Filesystem scans are time consuming. Drop the directory ILOCK and
|
||||
|
|
@ -1369,15 +1369,15 @@ xrep_dir_live_update(
|
|||
* rebuilding. Stash the update for replay against the temporary
|
||||
* directory.
|
||||
*/
|
||||
if (p->dp->i_ino == sc->ip->i_ino &&
|
||||
xchk_iscan_want_live_update(&rd->pscan.iscan, p->ip->i_ino)) {
|
||||
if (I_INO(p->dp) == I_INO(sc->ip) &&
|
||||
xchk_iscan_want_live_update(&rd->pscan.iscan, I_INO(p->ip))) {
|
||||
mutex_lock(&rd->pscan.lock);
|
||||
if (p->delta > 0)
|
||||
error = xrep_dir_stash_createname(rd, p->name,
|
||||
p->ip->i_ino);
|
||||
I_INO(p->ip));
|
||||
else
|
||||
error = xrep_dir_stash_removename(rd, p->name,
|
||||
p->ip->i_ino);
|
||||
I_INO(p->ip));
|
||||
mutex_unlock(&rd->pscan.lock);
|
||||
if (error)
|
||||
goto out_abort;
|
||||
|
|
@ -1388,14 +1388,14 @@ xrep_dir_live_update(
|
|||
* the directory that we're rebuilding, so remember the new dotdot
|
||||
* target.
|
||||
*/
|
||||
if (p->ip->i_ino == sc->ip->i_ino &&
|
||||
xchk_iscan_want_live_update(&rd->pscan.iscan, p->dp->i_ino)) {
|
||||
if (I_INO(p->ip) == I_INO(sc->ip) &&
|
||||
xchk_iscan_want_live_update(&rd->pscan.iscan, I_INO(p->dp))) {
|
||||
if (p->delta > 0) {
|
||||
trace_xrep_dir_stash_createname(sc->tempip,
|
||||
&xfs_name_dotdot,
|
||||
p->dp->i_ino);
|
||||
I_INO(p->dp));
|
||||
|
||||
xrep_findparent_scan_found(&rd->pscan, p->dp->i_ino);
|
||||
xrep_findparent_scan_found(&rd->pscan, I_INO(p->dp));
|
||||
} else {
|
||||
trace_xrep_dir_stash_removename(sc->tempip,
|
||||
&xfs_name_dotdot,
|
||||
|
|
@ -1468,7 +1468,7 @@ xrep_dir_swap_prep(
|
|||
.whichfork = XFS_DATA_FORK,
|
||||
.trans = sc->tp,
|
||||
.total = 1,
|
||||
.owner = sc->ip->i_ino,
|
||||
.owner = I_INO(sc->ip),
|
||||
};
|
||||
|
||||
error = xfs_dir2_sf_to_block(&args);
|
||||
|
|
@ -1576,7 +1576,7 @@ xrep_dir_set_nlink(
|
|||
* count. If the directory has no parent, it will be moved to the
|
||||
* orphanage.
|
||||
*/
|
||||
pag = xfs_perag_get(sc->mp, XFS_INO_TO_AGNO(sc->mp, dp->i_ino));
|
||||
pag = xfs_perag_get(sc->mp, XFS_INODE_TO_AGNO(dp));
|
||||
if (!pag) {
|
||||
ASSERT(0);
|
||||
return -EFSCORRUPTED;
|
||||
|
|
@ -1764,7 +1764,7 @@ xrep_dir_rebuild_tree(
|
|||
* directory to an empty shortform directory because inactivation does
|
||||
* nothing for directories.
|
||||
*/
|
||||
error = xrep_dir_reset_fork(rd, sc->mp->m_rootip->i_ino);
|
||||
error = xrep_dir_reset_fork(rd, I_INO(sc->mp->m_rootip));
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ xchk_dirpath_append(
|
|||
if (error)
|
||||
return error;
|
||||
|
||||
error = xino_bitmap_set(&path->seen_inodes, ip->i_ino);
|
||||
error = xino_bitmap_set(&path->seen_inodes, I_INO(ip));
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
@ -394,7 +394,7 @@ xchk_dirpath_step_up(
|
|||
* The inode being scanned is its own distant ancestor! Get rid of
|
||||
* this path.
|
||||
*/
|
||||
if (parent_ino == sc->ip->i_ino) {
|
||||
if (parent_ino == I_INO(sc->ip)) {
|
||||
xchk_dirpath_set_outcome(dl, path, XCHK_DIRPATH_DELETE);
|
||||
error = 0;
|
||||
goto out_scanlock;
|
||||
|
|
@ -533,7 +533,7 @@ xchk_dirpath_walk_upwards(
|
|||
* The inode being scanned is its own direct ancestor!
|
||||
* Get rid of this path.
|
||||
*/
|
||||
if (be64_to_cpu(dl->pptr_rec.p_ino) == sc->ip->i_ino) {
|
||||
if (be64_to_cpu(dl->pptr_rec.p_ino) == I_INO(sc->ip)) {
|
||||
xchk_dirpath_set_outcome(dl, path, XCHK_DIRPATH_DELETE);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -610,7 +610,7 @@ xchk_dirpath_step_is_stale(
|
|||
* If the parent and child being updated are not the ones mentioned in
|
||||
* this path step, the scan data is still ok.
|
||||
*/
|
||||
if (p->ip->i_ino != child_ino || p->dp->i_ino != *cursor)
|
||||
if (I_INO(p->ip) != child_ino || I_INO(p->dp) != *cursor)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
|
|
@ -632,13 +632,13 @@ xchk_dirpath_step_is_stale(
|
|||
* If the update comes from the repair code itself, walk the state
|
||||
* machine forward.
|
||||
*/
|
||||
if (p->ip->i_ino == dl->scan_ino &&
|
||||
if (I_INO(p->ip) == dl->scan_ino &&
|
||||
path->outcome == XREP_DIRPATH_ADOPTING) {
|
||||
xchk_dirpath_set_outcome(dl, path, XREP_DIRPATH_ADOPTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (p->ip->i_ino == dl->scan_ino &&
|
||||
if (I_INO(p->ip) == dl->scan_ino &&
|
||||
path->outcome == XREP_DIRPATH_DELETING) {
|
||||
xchk_dirpath_set_outcome(dl, path, XREP_DIRPATH_DELETED);
|
||||
return 0;
|
||||
|
|
@ -669,7 +669,7 @@ xchk_dirpath_is_stale(
|
|||
* The child being updated has not been seen by this path at all; this
|
||||
* path cannot be stale.
|
||||
*/
|
||||
if (!xino_bitmap_test(&path->seen_inodes, p->ip->i_ino))
|
||||
if (!xino_bitmap_test(&path->seen_inodes, I_INO(p->ip)))
|
||||
return 0;
|
||||
|
||||
ret = xchk_dirpath_step_is_stale(dl, path, 0, idx, p, &cursor);
|
||||
|
|
@ -928,7 +928,7 @@ xchk_dirtree(
|
|||
* released during teardown.
|
||||
*/
|
||||
dl->root_ino = xchk_inode_rootdir_inum(sc->ip);
|
||||
dl->scan_ino = sc->ip->i_ino;
|
||||
dl->scan_ino = I_INO(sc->ip);
|
||||
|
||||
trace_xchk_dirtree_start(sc->ip, sc->sm, 0);
|
||||
|
||||
|
|
@ -954,7 +954,7 @@ xchk_dirtree(
|
|||
* parent pointers are corrupt; this scan cannot be completed
|
||||
* without full information.
|
||||
*/
|
||||
xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_xref_set_corrupt(sc, sc->ip);
|
||||
error = 0;
|
||||
goto out_scanlock;
|
||||
}
|
||||
|
|
@ -979,12 +979,12 @@ xchk_dirtree(
|
|||
xchk_dirtree_evaluate(dl, &oc);
|
||||
if (xchk_dirtree_parentless(dl)) {
|
||||
if (oc.good || oc.bad || oc.suspect)
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
} else {
|
||||
if (oc.bad || oc.good + oc.suspect != 1)
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
if (oc.suspect)
|
||||
xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_xref_set_corrupt(sc, sc->ip);
|
||||
}
|
||||
|
||||
out_scanlock:
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ xrep_dirtree_unlink(
|
|||
if (error)
|
||||
goto out_trans_cancel;
|
||||
|
||||
error = xfs_dir_removename(sc->tp, dp, &dl->xname, sc->ip->i_ino,
|
||||
error = xfs_dir_removename(sc->tp, dp, &dl->xname, I_INO(sc->ip),
|
||||
resblks);
|
||||
if (error) {
|
||||
ASSERT(error != -ENOENT);
|
||||
|
|
@ -583,7 +583,7 @@ xrep_dirtree_create_adoption_path(
|
|||
*/
|
||||
xfs_inode_to_parent_rec(&dl->pptr_rec, sc->orphanage);
|
||||
|
||||
error = xino_bitmap_set(&path->seen_inodes, sc->orphanage->i_ino);
|
||||
error = xino_bitmap_set(&path->seen_inodes, I_INO(sc->orphanage));
|
||||
if (error)
|
||||
goto out_path;
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ struct xrep_findparent_info {
|
|||
|
||||
/*
|
||||
* Scrub context. We're looking for a @dp containing a directory
|
||||
* entry pointing to sc->ip->i_ino.
|
||||
* entry pointing to I_INO(sc->ip).
|
||||
*/
|
||||
struct xfs_scrub *sc;
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ xrep_findparent_dirent(
|
|||
if (xchk_should_terminate(fpi->sc, &error))
|
||||
return error;
|
||||
|
||||
if (ino != fpi->sc->ip->i_ino)
|
||||
if (ino != I_INO(fpi->sc->ip))
|
||||
return 0;
|
||||
|
||||
/* Ignore garbage directory entry names. */
|
||||
|
|
@ -123,18 +123,18 @@ xrep_findparent_dirent(
|
|||
|
||||
/* Uhoh, more than one parent for a dir? */
|
||||
if (fpi->found_parent != NULLFSINO &&
|
||||
!(fpi->parent_tentative && fpi->found_parent == fpi->dp->i_ino)) {
|
||||
!(fpi->parent_tentative && fpi->found_parent == I_INO(fpi->dp))) {
|
||||
trace_xrep_findparent_dirent(fpi->sc->ip, 0);
|
||||
return -EFSCORRUPTED;
|
||||
}
|
||||
|
||||
/* We found a potential parent; remember this. */
|
||||
trace_xrep_findparent_dirent(fpi->sc->ip, fpi->dp->i_ino);
|
||||
fpi->found_parent = fpi->dp->i_ino;
|
||||
trace_xrep_findparent_dirent(fpi->sc->ip, I_INO(fpi->dp));
|
||||
fpi->found_parent = I_INO(fpi->dp);
|
||||
fpi->parent_tentative = false;
|
||||
|
||||
if (fpi->parent_scan)
|
||||
xrep_findparent_scan_found(fpi->parent_scan, fpi->dp->i_ino);
|
||||
xrep_findparent_scan_found(fpi->parent_scan, I_INO(fpi->dp));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -227,13 +227,12 @@ xrep_findparent_live_update(
|
|||
* already scanned @p->dp, update the dotdot target inumber to the
|
||||
* parent inode.
|
||||
*/
|
||||
if (p->ip->i_ino == sc->ip->i_ino &&
|
||||
xchk_iscan_want_live_update(&pscan->iscan, p->dp->i_ino)) {
|
||||
if (p->delta > 0) {
|
||||
xrep_findparent_scan_found(pscan, p->dp->i_ino);
|
||||
} else {
|
||||
if (I_INO(p->ip) == I_INO(sc->ip) &&
|
||||
xchk_iscan_want_live_update(&pscan->iscan, I_INO(p->dp))) {
|
||||
if (p->delta > 0)
|
||||
xrep_findparent_scan_found(pscan, I_INO(p->dp));
|
||||
else
|
||||
xrep_findparent_scan_found(pscan, NULLFSINO);
|
||||
}
|
||||
}
|
||||
|
||||
return NOTIFY_DONE;
|
||||
|
|
@ -388,7 +387,7 @@ xrep_findparent_confirm(
|
|||
if (*parent_ino == NULLFSINO)
|
||||
return 0;
|
||||
if (!xfs_verify_dir_ino(sc->mp, *parent_ino) ||
|
||||
*parent_ino == sc->ip->i_ino) {
|
||||
*parent_ino == I_INO(sc->ip)) {
|
||||
*parent_ino = NULLFSINO;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -422,10 +421,10 @@ xfs_ino_t
|
|||
xrep_findparent_self_reference(
|
||||
struct xfs_scrub *sc)
|
||||
{
|
||||
if (sc->ip->i_ino == sc->mp->m_sb.sb_rootino)
|
||||
if (I_INO(sc->ip) == sc->mp->m_sb.sb_rootino)
|
||||
return sc->mp->m_sb.sb_rootino;
|
||||
|
||||
if (sc->ip->i_ino == sc->mp->m_sb.sb_metadirino)
|
||||
if (I_INO(sc->ip) == sc->mp->m_sb.sb_metadirino)
|
||||
return sc->mp->m_sb.sb_metadirino;
|
||||
|
||||
if (VFS_I(sc->ip)->i_nlink == 0)
|
||||
|
|
@ -457,8 +456,8 @@ xrep_findparent_from_dcache(
|
|||
dput(parent);
|
||||
|
||||
if (S_ISDIR(pip->i_mode)) {
|
||||
trace_xrep_findparent_from_dcache(sc->ip, XFS_I(pip)->i_ino);
|
||||
ret = XFS_I(pip)->i_ino;
|
||||
ret = pip->i_ino;
|
||||
trace_xrep_findparent_from_dcache(sc->ip, ret);
|
||||
}
|
||||
|
||||
xchk_irele(sc, XFS_I(pip));
|
||||
|
|
|
|||
|
|
@ -363,6 +363,7 @@ xchk_iallocbt_check_cluster(
|
|||
struct xfs_inobt_rec_incore *irec,
|
||||
unsigned int cluster_base)
|
||||
{
|
||||
struct xfs_perag *pag = to_perag(bs->cur->bc_group);
|
||||
struct xfs_imap imap;
|
||||
struct xfs_mount *mp = bs->cur->bc_mp;
|
||||
struct xfs_buf *cluster_bp;
|
||||
|
|
@ -394,8 +395,7 @@ xchk_iallocbt_check_cluster(
|
|||
* ir_startino can be large enough to make im_boffset nonzero.
|
||||
*/
|
||||
ir_holemask = (irec->ir_holemask & cluster_mask);
|
||||
imap.im_blkno = xfs_agbno_to_daddr(to_perag(bs->cur->bc_group), agbno);
|
||||
imap.im_len = XFS_FSB_TO_BB(mp, M_IGEO(mp)->blocks_per_cluster);
|
||||
imap.im_agbno = agbno;
|
||||
imap.im_boffset = XFS_INO_TO_OFFSET(mp, irec->ir_startino) <<
|
||||
mp->m_sb.sb_inodelog;
|
||||
|
||||
|
|
@ -405,8 +405,8 @@ xchk_iallocbt_check_cluster(
|
|||
return 0;
|
||||
}
|
||||
|
||||
trace_xchk_iallocbt_check_cluster(to_perag(bs->cur->bc_group),
|
||||
irec->ir_startino, imap.im_blkno, imap.im_len,
|
||||
trace_xchk_iallocbt_check_cluster(pag, irec->ir_startino, imap.im_agbno,
|
||||
XFS_FSB_TO_BB(mp, M_IGEO(mp)->blocks_per_cluster),
|
||||
cluster_base, nr_inodes, cluster_mask, ir_holemask,
|
||||
XFS_INO_TO_OFFSET(mp, irec->ir_startino +
|
||||
cluster_base));
|
||||
|
|
@ -429,7 +429,8 @@ xchk_iallocbt_check_cluster(
|
|||
&XFS_RMAP_OINFO_INODES);
|
||||
|
||||
/* Grab the inode cluster buffer. */
|
||||
error = xfs_imap_to_bp(mp, bs->cur->bc_tp, &imap, &cluster_bp);
|
||||
error = xfs_read_icluster(pag, bs->cur->bc_tp, imap.im_agbno,
|
||||
&cluster_bp);
|
||||
if (!xchk_btree_xref_process_error(bs->sc, bs->cur, 0, &error))
|
||||
return error;
|
||||
|
||||
|
|
|
|||
|
|
@ -287,7 +287,6 @@ xrep_ibt_process_cluster(
|
|||
struct xrep_ibt *ri,
|
||||
xfs_agblock_t cluster_bno)
|
||||
{
|
||||
struct xfs_imap imap;
|
||||
struct xfs_buf *cluster_bp;
|
||||
struct xfs_scrub *sc = ri->sc;
|
||||
struct xfs_mount *mp = sc->mp;
|
||||
|
|
@ -305,10 +304,8 @@ xrep_ibt_process_cluster(
|
|||
* inobt because imap_to_bp directly maps the buffer without touching
|
||||
* either inode btree.
|
||||
*/
|
||||
imap.im_blkno = xfs_agbno_to_daddr(sc->sa.pag, cluster_bno);
|
||||
imap.im_len = XFS_FSB_TO_BB(mp, igeo->blocks_per_cluster);
|
||||
imap.im_boffset = 0;
|
||||
error = xfs_imap_to_bp(mp, sc->tp, &imap, &cluster_bp);
|
||||
error = xfs_read_icluster(sc->sa.pag, sc->tp, cluster_bno,
|
||||
&cluster_bp);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ xchk_setup_inode(
|
|||
xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN);
|
||||
|
||||
/* We want to scan the opened inode, so lock it and exit. */
|
||||
if (sc->sm->sm_ino == 0 || sc->sm->sm_ino == ip_in->i_ino) {
|
||||
if (sc->sm->sm_ino == 0 || sc->sm->sm_ino == I_INO(ip_in)) {
|
||||
error = xchk_install_live_inode(sc, ip_in);
|
||||
if (error)
|
||||
return error;
|
||||
|
|
@ -710,17 +710,17 @@ xchk_inode_xref_bmap(
|
|||
if (!xchk_should_check_xref(sc, &error, NULL))
|
||||
return;
|
||||
if (nextents < xfs_dfork_data_extents(dip))
|
||||
xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_xref_set_corrupt(sc, sc->ip);
|
||||
|
||||
error = xchk_inode_count_blocks(sc, XFS_ATTR_FORK, &nextents, &acount);
|
||||
if (!xchk_should_check_xref(sc, &error, NULL))
|
||||
return;
|
||||
if (nextents != xfs_dfork_attr_extents(dip))
|
||||
xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_xref_set_corrupt(sc, sc->ip);
|
||||
|
||||
/* Check nblocks against the inode. */
|
||||
if (count + acount != be64_to_cpu(dip->di_nblocks))
|
||||
xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_xref_set_corrupt(sc, sc->ip);
|
||||
}
|
||||
|
||||
/* Cross-reference with the other btrees. */
|
||||
|
|
@ -794,10 +794,10 @@ xchk_inode_check_unlinked(
|
|||
{
|
||||
if (VFS_I(sc->ip)->i_nlink == 0) {
|
||||
if (!xfs_inode_on_unlinked_list(sc->ip))
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ino_set_corrupt(sc, I_INO(sc->ip));
|
||||
} else {
|
||||
if (xfs_inode_on_unlinked_list(sc->ip))
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ino_set_corrupt(sc, I_INO(sc->ip));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -821,7 +821,7 @@ xchk_inode(
|
|||
|
||||
/* Scrub the inode core. */
|
||||
xfs_inode_to_disk(sc->ip, &di, 0);
|
||||
xchk_dinode(sc, &di, sc->ip->i_ino);
|
||||
xchk_dinode(sc, &di, I_INO(sc->ip));
|
||||
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
|
||||
goto out;
|
||||
|
||||
|
|
@ -831,11 +831,11 @@ xchk_inode(
|
|||
* we scrubbed the dinode.
|
||||
*/
|
||||
if (S_ISREG(VFS_I(sc->ip)->i_mode))
|
||||
xchk_inode_check_reflink_iflag(sc, sc->ip->i_ino);
|
||||
xchk_inode_check_reflink_iflag(sc, I_INO(sc->ip));
|
||||
|
||||
xchk_inode_check_unlinked(sc);
|
||||
|
||||
xchk_inode_xref(sc, sc->ip->i_ino, &di);
|
||||
xchk_inode_xref(sc, I_INO(sc->ip), &di);
|
||||
out:
|
||||
return error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1547,6 +1547,7 @@ xrep_dinode_core(
|
|||
struct xrep_inode *ri)
|
||||
{
|
||||
struct xfs_scrub *sc = ri->sc;
|
||||
struct xfs_mount *mp = sc->mp;
|
||||
struct xfs_buf *bp;
|
||||
struct xfs_dinode *dip;
|
||||
xfs_ino_t ino = sc->sm->sm_ino;
|
||||
|
|
@ -1559,8 +1560,11 @@ xrep_dinode_core(
|
|||
return error;
|
||||
|
||||
/* Read the inode cluster buffer. */
|
||||
error = xfs_trans_read_buf(sc->mp, sc->tp, sc->mp->m_ddev_targp,
|
||||
ri->imap.im_blkno, ri->imap.im_len, 0, &bp, NULL);
|
||||
error = xfs_trans_read_buf(mp, sc->tp, mp->m_ddev_targp,
|
||||
XFS_AGB_TO_DADDR(mp, XFS_INO_TO_AGNO(mp, ino),
|
||||
ri->imap.im_agbno),
|
||||
XFS_FSB_TO_BB(mp, M_IGEO(mp)->blocks_per_cluster),
|
||||
0, &bp, NULL);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
@ -1583,10 +1587,10 @@ xrep_dinode_core(
|
|||
write:
|
||||
/* Write out the inode. */
|
||||
trace_xrep_dinode_fixed(sc, dip);
|
||||
xfs_dinode_calc_crc(sc->mp, dip);
|
||||
xfs_dinode_calc_crc(mp, dip);
|
||||
xfs_trans_buf_set_type(sc->tp, bp, XFS_BLFT_DINO_BUF);
|
||||
xfs_trans_log_buf(sc->tp, bp, ri->imap.im_boffset,
|
||||
ri->imap.im_boffset + sc->mp->m_sb.sb_inodesize - 1);
|
||||
ri->imap.im_boffset + mp->m_sb.sb_inodesize - 1);
|
||||
|
||||
/*
|
||||
* In theory, we've fixed the ondisk inode record enough that we should
|
||||
|
|
@ -1796,7 +1800,7 @@ xrep_inode_flags(
|
|||
sc->ip->i_diflags &= ~XFS_DIFLAG_ANY;
|
||||
|
||||
/* NEWRTBM only applies to realtime bitmaps */
|
||||
if (sc->ip->i_ino == sc->mp->m_sb.sb_rbmino)
|
||||
if (I_INO(sc->ip) == sc->mp->m_sb.sb_rbmino)
|
||||
sc->ip->i_diflags |= XFS_DIFLAG_NEWRTBM;
|
||||
else
|
||||
sc->ip->i_diflags &= ~XFS_DIFLAG_NEWRTBM;
|
||||
|
|
@ -2011,8 +2015,7 @@ xrep_inode_unlinked(
|
|||
struct xfs_perag *pag;
|
||||
int error;
|
||||
|
||||
pag = xfs_perag_get(sc->mp,
|
||||
XFS_INO_TO_AGNO(sc->mp, sc->ip->i_ino));
|
||||
pag = xfs_perag_get(sc->mp, XFS_INODE_TO_AGNO(sc->ip));
|
||||
error = xfs_iunlink_remove(sc->tp, pag, sc->ip);
|
||||
xfs_perag_put(pag);
|
||||
if (error)
|
||||
|
|
|
|||
|
|
@ -728,7 +728,7 @@ xchk_iscan_mark_visited(
|
|||
struct xfs_inode *ip)
|
||||
{
|
||||
mutex_lock(&iscan->lock);
|
||||
iscan->__visited_ino = ip->i_ino;
|
||||
iscan->__visited_ino = I_INO(ip);
|
||||
trace_xchk_iscan_visit(iscan);
|
||||
mutex_unlock(&iscan->lock);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ xchk_xattr_walk_leaf(
|
|||
struct xfs_buf *leaf_bp;
|
||||
int error;
|
||||
|
||||
error = xfs_attr3_leaf_read(sc->tp, ip, ip->i_ino, 0, &leaf_bp);
|
||||
error = xfs_attr3_leaf_read(sc->tp, ip, I_INO(ip), 0, &leaf_bp);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ xchk_xattr_find_leftmost_leaf(
|
|||
magic != XFS_DA3_NODE_MAGIC)
|
||||
goto out_buf;
|
||||
|
||||
fa = xfs_da3_node_header_check(bp, ip->i_ino);
|
||||
fa = xfs_da3_node_header_check(bp, I_INO(ip));
|
||||
if (fa)
|
||||
goto out_buf;
|
||||
|
||||
|
|
@ -195,7 +195,7 @@ xchk_xattr_find_leftmost_leaf(
|
|||
}
|
||||
|
||||
error = -EFSCORRUPTED;
|
||||
fa = xfs_attr3_leaf_header_check(bp, ip->i_ino);
|
||||
fa = xfs_attr3_leaf_header_check(bp, I_INO(ip));
|
||||
if (fa)
|
||||
goto out_buf;
|
||||
|
||||
|
|
@ -266,8 +266,8 @@ xchk_xattr_walk_node(
|
|||
goto out_bitmap;
|
||||
}
|
||||
|
||||
error = xfs_attr3_leaf_read(sc->tp, ip, ip->i_ino,
|
||||
leafhdr.forw, &leaf_bp);
|
||||
error = xfs_attr3_leaf_read(sc->tp, ip, I_INO(ip), leafhdr.forw,
|
||||
&leaf_bp);
|
||||
if (error)
|
||||
goto out_bitmap;
|
||||
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ xchk_metapath(
|
|||
|
||||
/* Parent required to do anything else. */
|
||||
if (mpath->dp == NULL) {
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -329,15 +329,15 @@ xchk_metapath(
|
|||
trace_xchk_metapath_lookup(sc, mpath->path, mpath->dp, ino);
|
||||
if (error == -ENOENT) {
|
||||
/* No directory entry at all */
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
error = 0;
|
||||
goto out_ilock;
|
||||
}
|
||||
if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
|
||||
goto out_ilock;
|
||||
if (ino != sc->ip->i_ino) {
|
||||
if (ino != I_INO(sc->ip)) {
|
||||
/* Pointing to wrong inode */
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
}
|
||||
|
||||
out_ilock:
|
||||
|
|
@ -364,7 +364,7 @@ xrep_metapath_link(
|
|||
else
|
||||
mpath->du.ppargs = NULL;
|
||||
|
||||
trace_xrep_metapath_link(sc, mpath->path, mpath->dp, sc->ip->i_ino);
|
||||
trace_xrep_metapath_link(sc, mpath->path, mpath->dp, I_INO(sc->ip));
|
||||
|
||||
return xfs_dir_add_child(sc->tp, mpath->link_resblks, &mpath->du);
|
||||
}
|
||||
|
|
@ -462,7 +462,7 @@ xrep_metapath_try_link(
|
|||
if (error)
|
||||
goto out_cancel;
|
||||
|
||||
if (ino == sc->ip->i_ino) {
|
||||
if (ino == I_INO(sc->ip)) {
|
||||
/* The dirent already points to @sc->ip; we're done. */
|
||||
error = 0;
|
||||
goto out_cancel;
|
||||
|
|
@ -530,7 +530,7 @@ xrep_metapath_try_unlink(
|
|||
xfs_ino_t ino;
|
||||
int error;
|
||||
|
||||
ASSERT(*alleged_child != sc->ip->i_ino);
|
||||
ASSERT(*alleged_child != I_INO(sc->ip));
|
||||
|
||||
trace_xrep_metapath_try_unlink(sc, mpath->path, mpath->dp,
|
||||
*alleged_child);
|
||||
|
|
@ -575,7 +575,7 @@ xrep_metapath_try_unlink(
|
|||
if (error)
|
||||
goto out_cancel;
|
||||
|
||||
if (ino == sc->ip->i_ino) {
|
||||
if (ino == I_INO(sc->ip)) {
|
||||
/* The dirent already points to @sc->ip; we're done. */
|
||||
error = -EEXIST;
|
||||
goto out_cancel;
|
||||
|
|
|
|||
|
|
@ -123,8 +123,7 @@ xrep_newbt_init_inode(
|
|||
if (!ifp)
|
||||
return -ENOMEM;
|
||||
|
||||
xrep_newbt_init_ag(xnr, sc, oinfo,
|
||||
XFS_INO_TO_FSB(sc->mp, sc->ip->i_ino),
|
||||
xrep_newbt_init_ag(xnr, sc, oinfo, XFS_INODE_TO_FSB(sc->ip),
|
||||
XFS_AG_RESV_NONE);
|
||||
xnr->ifake.if_fork = ifp;
|
||||
xnr->ifake.if_fork_size = xfs_inode_fork_size(sc->ip, whichfork);
|
||||
|
|
@ -146,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)
|
||||
|
|
@ -160,8 +159,7 @@ xrep_newbt_init_metadir_inode(
|
|||
* as if they were regular file blocks. This exposes us to a higher
|
||||
* risk of the repair being cancelled due to ENOSPC.
|
||||
*/
|
||||
xrep_newbt_init_ag(xnr, sc, &oinfo,
|
||||
XFS_INO_TO_FSB(sc->mp, sc->ip->i_ino),
|
||||
xrep_newbt_init_ag(xnr, sc, &oinfo, XFS_INODE_TO_FSB(sc->ip),
|
||||
XFS_AG_RESV_NONE);
|
||||
xnr->ifake.if_fork = ifp;
|
||||
xnr->ifake.if_fork_size = xfs_inode_fork_size(sc->ip, XFS_DATA_FORK);
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ xchk_nlinks_live_update(
|
|||
if (xrep_is_tempfile(p->dp))
|
||||
return NOTIFY_DONE;
|
||||
|
||||
trace_xchk_nlinks_live_update(xnc->sc->mp, p->dp, action, p->ip->i_ino,
|
||||
trace_xchk_nlinks_live_update(xnc->sc->mp, p->dp, action, I_INO(p->ip),
|
||||
p->delta, p->name->name, p->name->len);
|
||||
|
||||
/*
|
||||
|
|
@ -183,12 +183,12 @@ xchk_nlinks_live_update(
|
|||
* to @ip. If @ip is a subdirectory, update the number of child links
|
||||
* going out of @dp.
|
||||
*/
|
||||
if (xchk_iscan_want_live_update(&xnc->collect_iscan, p->dp->i_ino)) {
|
||||
if (xchk_iscan_want_live_update(&xnc->collect_iscan, I_INO(p->dp))) {
|
||||
mutex_lock(&xnc->lock);
|
||||
error = xchk_nlinks_update_incore(xnc, p->ip->i_ino, p->delta,
|
||||
error = xchk_nlinks_update_incore(xnc, I_INO(p->ip), p->delta,
|
||||
0, 0);
|
||||
if (!error && S_ISDIR(VFS_IC(p->ip)->i_mode))
|
||||
error = xchk_nlinks_update_incore(xnc, p->dp->i_ino, 0,
|
||||
error = xchk_nlinks_update_incore(xnc, I_INO(p->dp), 0,
|
||||
0, p->delta);
|
||||
mutex_unlock(&xnc->lock);
|
||||
if (error)
|
||||
|
|
@ -200,9 +200,9 @@ xchk_nlinks_live_update(
|
|||
* number of backrefs pointing to @dp.
|
||||
*/
|
||||
if (S_ISDIR(VFS_IC(p->ip)->i_mode) &&
|
||||
xchk_iscan_want_live_update(&xnc->collect_iscan, p->ip->i_ino)) {
|
||||
xchk_iscan_want_live_update(&xnc->collect_iscan, I_INO(p->ip))) {
|
||||
mutex_lock(&xnc->lock);
|
||||
error = xchk_nlinks_update_incore(xnc, p->dp->i_ino, 0,
|
||||
error = xchk_nlinks_update_incore(xnc, I_INO(p->dp), 0,
|
||||
p->delta, 0);
|
||||
mutex_unlock(&xnc->lock);
|
||||
if (error)
|
||||
|
|
@ -243,7 +243,7 @@ xchk_nlinks_collect_dirent(
|
|||
dotdot = true;
|
||||
|
||||
/* Don't accept a '.' entry that points somewhere else. */
|
||||
if (dot && ino != dp->i_ino) {
|
||||
if (dot && ino != I_INO(dp)) {
|
||||
error = -ECANCELED;
|
||||
goto out_abort;
|
||||
}
|
||||
|
|
@ -304,7 +304,7 @@ xchk_nlinks_collect_dirent(
|
|||
* number of child links of dp.
|
||||
*/
|
||||
if (!dot && !dotdot && name->type == XFS_DIR3_FT_DIR) {
|
||||
error = xchk_nlinks_update_incore(xnc, dp->i_ino, 0, 0, 1);
|
||||
error = xchk_nlinks_update_incore(xnc, I_INO(dp), 0, 0, 1);
|
||||
if (error)
|
||||
goto out_unlock;
|
||||
}
|
||||
|
|
@ -692,7 +692,7 @@ xchk_nlinks_compare_inode(
|
|||
goto out_scanlock;
|
||||
}
|
||||
|
||||
error = xchk_nlinks_comparison_read(xnc, ip->i_ino, &obs);
|
||||
error = xchk_nlinks_comparison_read(xnc, I_INO(ip), &obs);
|
||||
if (error)
|
||||
goto out_scanlock;
|
||||
|
||||
|
|
@ -718,15 +718,15 @@ xchk_nlinks_compare_inode(
|
|||
* count, but it will let them decrease it.
|
||||
*/
|
||||
if (total_links > XFS_NLINK_PINNED) {
|
||||
xchk_ino_set_corrupt(sc, ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, ip);
|
||||
goto out_corrupt;
|
||||
} else if (total_links > XFS_MAXLINK) {
|
||||
xchk_ino_set_warning(sc, ip->i_ino);
|
||||
xchk_ino_set_warning(sc, I_INO(ip));
|
||||
}
|
||||
|
||||
/* Link counts should match. */
|
||||
if (total_links != actual_nlink) {
|
||||
xchk_ino_set_corrupt(sc, ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, ip);
|
||||
goto out_corrupt;
|
||||
}
|
||||
|
||||
|
|
@ -740,14 +740,14 @@ xchk_nlinks_compare_inode(
|
|||
* number of subdirectory entries in the directory.
|
||||
*/
|
||||
if (obs.children != obs.backrefs)
|
||||
xchk_ino_xref_set_corrupt(sc, ip->i_ino);
|
||||
xchk_ip_xref_set_corrupt(sc, ip);
|
||||
} else {
|
||||
/*
|
||||
* Non-directories and unlinked directories should not have
|
||||
* back references.
|
||||
*/
|
||||
if (obs.backrefs != 0) {
|
||||
xchk_ino_set_corrupt(sc, ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, ip);
|
||||
goto out_corrupt;
|
||||
}
|
||||
|
||||
|
|
@ -756,7 +756,7 @@ xchk_nlinks_compare_inode(
|
|||
* children.
|
||||
*/
|
||||
if (obs.children != 0) {
|
||||
xchk_ino_set_corrupt(sc, ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, ip);
|
||||
goto out_corrupt;
|
||||
}
|
||||
}
|
||||
|
|
@ -769,7 +769,7 @@ xchk_nlinks_compare_inode(
|
|||
* the root directory.
|
||||
*/
|
||||
if (obs.parents != 1) {
|
||||
xchk_ino_set_corrupt(sc, ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, ip);
|
||||
goto out_corrupt;
|
||||
}
|
||||
} else if (actual_nlink > 0) {
|
||||
|
|
@ -778,7 +778,7 @@ xchk_nlinks_compare_inode(
|
|||
* least one parent.
|
||||
*/
|
||||
if (obs.parents == 0) {
|
||||
xchk_ino_set_corrupt(sc, ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, ip);
|
||||
goto out_corrupt;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ xrep_nlinks_iunlink_remove(
|
|||
struct xfs_perag *pag;
|
||||
int error;
|
||||
|
||||
pag = xfs_perag_get(sc->mp, XFS_INO_TO_AGNO(sc->mp, sc->ip->i_ino));
|
||||
pag = xfs_perag_get(sc->mp, XFS_INODE_TO_AGNO(sc->ip));
|
||||
error = xfs_iunlink_remove(sc->tp, pag, sc->ip);
|
||||
xfs_perag_put(pag);
|
||||
return error;
|
||||
|
|
@ -152,7 +152,7 @@ xrep_nlinks_repair_inode(
|
|||
goto out_scanlock;
|
||||
}
|
||||
|
||||
error = xfarray_load_sparse(xnc->nlinks, ip->i_ino, &obs);
|
||||
error = xfarray_load_sparse(xnc->nlinks, I_INO(ip), &obs);
|
||||
if (error)
|
||||
goto out_scanlock;
|
||||
|
||||
|
|
@ -206,7 +206,7 @@ xrep_nlinks_repair_inode(
|
|||
* updated our scan info.
|
||||
*/
|
||||
mutex_lock(&xnc->lock);
|
||||
error = xfarray_load_sparse(xnc->nlinks, ip->i_ino, &obs);
|
||||
error = xfarray_load_sparse(xnc->nlinks, I_INO(ip), &obs);
|
||||
mutex_unlock(&xnc->lock);
|
||||
if (error)
|
||||
goto out_trans;
|
||||
|
|
|
|||
|
|
@ -402,14 +402,14 @@ xrep_adoption_compute_name(
|
|||
int error = 0;
|
||||
|
||||
adopt->xname = xname;
|
||||
xname->len = snprintf(namebuf, MAXNAMELEN, "%llu", sc->ip->i_ino);
|
||||
xname->len = snprintf(namebuf, MAXNAMELEN, "%llu", I_INO(sc->ip));
|
||||
xname->type = xfs_mode_to_ftype(VFS_I(sc->ip)->i_mode);
|
||||
|
||||
/* Make sure the filename is unique in the lost+found. */
|
||||
error = xchk_dir_lookup(sc, sc->orphanage, xname, &ino);
|
||||
while (error == 0 && incr < 10000) {
|
||||
xname->len = snprintf(namebuf, MAXNAMELEN, "%llu.%u",
|
||||
sc->ip->i_ino, ++incr);
|
||||
I_INO(sc->ip), ++incr);
|
||||
error = xchk_dir_lookup(sc, sc->orphanage, xname, &ino);
|
||||
}
|
||||
if (error == 0) {
|
||||
|
|
@ -532,7 +532,7 @@ xrep_adoption_move(
|
|||
int error;
|
||||
|
||||
trace_xrep_adoption_reparent(sc->orphanage, adopt->xname,
|
||||
sc->ip->i_ino);
|
||||
I_INO(sc->ip));
|
||||
|
||||
error = xrep_adoption_check_dcache(adopt);
|
||||
if (error)
|
||||
|
|
@ -553,7 +553,7 @@ xrep_adoption_move(
|
|||
|
||||
/* Create the new name in the orphanage. */
|
||||
error = xfs_dir_createname(sc->tp, sc->orphanage, adopt->xname,
|
||||
sc->ip->i_ino, adopt->orphanage_blkres);
|
||||
I_INO(sc->ip), adopt->orphanage_blkres);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
@ -576,7 +576,7 @@ xrep_adoption_move(
|
|||
/* Replace the dotdot entry if the child is a subdirectory. */
|
||||
if (isdir) {
|
||||
error = xfs_dir_replace(sc->tp, sc->ip, &xfs_name_dotdot,
|
||||
sc->orphanage->i_ino, adopt->child_blkres);
|
||||
I_INO(sc->orphanage), adopt->child_blkres);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ xchk_parent_actor(
|
|||
if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
|
||||
return error;
|
||||
|
||||
if (sc->ip->i_ino == ino)
|
||||
if (I_INO(sc->ip) == ino)
|
||||
spc->nlink++;
|
||||
|
||||
if (xchk_should_terminate(spc->sc, &error))
|
||||
|
|
@ -119,6 +119,7 @@ xchk_parent_validate(
|
|||
.nlink = 0,
|
||||
};
|
||||
struct xfs_mount *mp = sc->mp;
|
||||
xfs_ino_t ino = I_INO(sc->ip);
|
||||
struct xfs_inode *dp = NULL;
|
||||
xfs_nlink_t expected_nlink;
|
||||
unsigned int lock_mode;
|
||||
|
|
@ -126,22 +127,20 @@ xchk_parent_validate(
|
|||
|
||||
/* Is this the root dir? Then '..' must point to itself. */
|
||||
if (sc->ip == mp->m_rootip) {
|
||||
if (sc->ip->i_ino != mp->m_sb.sb_rootino ||
|
||||
sc->ip->i_ino != parent_ino)
|
||||
if (ino != mp->m_sb.sb_rootino || ino != parent_ino)
|
||||
xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Is this the metadata root dir? Then '..' must point to itself. */
|
||||
if (sc->ip == mp->m_metadirip) {
|
||||
if (sc->ip->i_ino != mp->m_sb.sb_metadirino ||
|
||||
sc->ip->i_ino != parent_ino)
|
||||
if (ino != mp->m_sb.sb_metadirino || ino != parent_ino)
|
||||
xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* '..' must not point to ourselves. */
|
||||
if (sc->ip->i_ino == parent_ino) {
|
||||
if (ino == parent_ino) {
|
||||
xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -315,7 +314,7 @@ xchk_parent_pptr_and_dotdot(
|
|||
|
||||
/* Is this the root dir? Then '..' must point to itself. */
|
||||
if (xchk_inode_is_dirtree_root(sc->ip)) {
|
||||
if (sc->ip->i_ino != pp->parent_ino)
|
||||
if (I_INO(sc->ip) != pp->parent_ino)
|
||||
xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -398,7 +397,7 @@ xchk_parent_dirent(
|
|||
return error;
|
||||
|
||||
/* Does the inode number match? */
|
||||
if (child_ino != sc->ip->i_ino) {
|
||||
if (child_ino != I_INO(sc->ip)) {
|
||||
xchk_fblock_xref_set_corrupt(sc, XFS_ATTR_FORK, 0);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -490,7 +489,7 @@ xchk_parent_scan_attr(
|
|||
}
|
||||
|
||||
/* No self-referential parent pointers. */
|
||||
if (parent_ino == sc->ip->i_ino) {
|
||||
if (parent_ino == I_INO(sc->ip)) {
|
||||
xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, 0);
|
||||
return -ECANCELED;
|
||||
}
|
||||
|
|
@ -512,7 +511,7 @@ xchk_parent_scan_attr(
|
|||
};
|
||||
|
||||
/* Couldn't lock the inode, so save the pptr for later. */
|
||||
trace_xchk_parent_defer(sc->ip, &xname, dp->i_ino);
|
||||
trace_xchk_parent_defer(sc->ip, &xname, I_INO(dp));
|
||||
|
||||
error = xfblob_storename(pp->pptr_names, &save_pp.name_cookie,
|
||||
&xname);
|
||||
|
|
@ -599,7 +598,7 @@ xchk_parent_slow_pptr(
|
|||
*/
|
||||
lockmode = xchk_parent_lock_dir(sc, dp);
|
||||
if (lockmode) {
|
||||
trace_xchk_parent_slowpath(sc->ip, xname, dp->i_ino);
|
||||
trace_xchk_parent_slowpath(sc->ip, xname, I_INO(dp));
|
||||
goto check_dirent;
|
||||
}
|
||||
|
||||
|
|
@ -610,7 +609,7 @@ xchk_parent_slow_pptr(
|
|||
xchk_iunlock(sc, sc->ilock_flags);
|
||||
pp->need_revalidate = true;
|
||||
|
||||
trace_xchk_parent_ultraslowpath(sc->ip, xname, dp->i_ino);
|
||||
trace_xchk_parent_ultraslowpath(sc->ip, xname, I_INO(dp));
|
||||
|
||||
error = xchk_dir_trylock_for_pptrs(sc, dp, &lockmode);
|
||||
if (error)
|
||||
|
|
@ -729,10 +728,10 @@ xchk_parent_count_pptrs(
|
|||
pp->pptrs_found++;
|
||||
|
||||
if (VFS_I(sc->ip)->i_nlink == 0 && pp->pptrs_found > 0)
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
else if (VFS_I(sc->ip)->i_nlink > 0 &&
|
||||
pp->pptrs_found == 0)
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
} else {
|
||||
/*
|
||||
* Starting with metadir, we allow checking of parent pointers
|
||||
|
|
@ -743,7 +742,7 @@ xchk_parent_count_pptrs(
|
|||
pp->pptrs_found++;
|
||||
|
||||
if (VFS_I(sc->ip)->i_nlink != pp->pptrs_found)
|
||||
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, sc->ip);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -856,7 +855,7 @@ xchk_parent(
|
|||
return -ENOENT;
|
||||
|
||||
/* We're not a special inode, are we? */
|
||||
if (!xfs_verify_dir_ino(mp, sc->ip->i_ino)) {
|
||||
if (!xfs_verify_dir_ino(mp, I_INO(sc->ip))) {
|
||||
xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -302,14 +302,14 @@ xrep_parent_replay_update(
|
|||
trace_xrep_parent_replay_parentadd(sc->tempip, xname,
|
||||
&pptr->pptr_rec);
|
||||
|
||||
return xfs_parent_set(sc->tempip, sc->ip->i_ino, xname,
|
||||
return xfs_parent_set(sc->tempip, I_INO(sc->ip), xname,
|
||||
&pptr->pptr_rec, &rp->pptr_args);
|
||||
case XREP_PPTR_REMOVE:
|
||||
/* Remove parent pointer. */
|
||||
trace_xrep_parent_replay_parentremove(sc->tempip, xname,
|
||||
&pptr->pptr_rec);
|
||||
|
||||
return xfs_parent_unset(sc->tempip, sc->ip->i_ino, xname,
|
||||
return xfs_parent_unset(sc->tempip, I_INO(sc->ip), xname,
|
||||
&pptr->pptr_rec, &rp->pptr_args);
|
||||
}
|
||||
|
||||
|
|
@ -434,7 +434,7 @@ xrep_parent_scan_dirent(
|
|||
int error;
|
||||
|
||||
/* Dirent doesn't point to this directory. */
|
||||
if (ino != rp->sc->ip->i_ino)
|
||||
if (ino != I_INO(rp->sc->ip))
|
||||
return 0;
|
||||
|
||||
/* No weird looking names. */
|
||||
|
|
@ -645,8 +645,8 @@ xrep_parent_live_update(
|
|||
* repairing, so stash the update for replay against the temporary
|
||||
* file.
|
||||
*/
|
||||
if (p->ip->i_ino == sc->ip->i_ino &&
|
||||
xchk_iscan_want_live_update(&rp->pscan.iscan, p->dp->i_ino)) {
|
||||
if (I_INO(p->ip) == I_INO(sc->ip) &&
|
||||
xchk_iscan_want_live_update(&rp->pscan.iscan, I_INO(p->dp))) {
|
||||
mutex_lock(&rp->pscan.lock);
|
||||
if (p->delta > 0)
|
||||
error = xrep_parent_stash_parentadd(rp, p->name, p->dp);
|
||||
|
|
@ -906,7 +906,7 @@ xrep_parent_fetch_xattr_remote(
|
|||
.namelen = namelen,
|
||||
.trans = sc->tp,
|
||||
.valuelen = valuelen,
|
||||
.owner = ip->i_ino,
|
||||
.owner = I_INO(ip),
|
||||
};
|
||||
int error;
|
||||
|
||||
|
|
@ -984,7 +984,7 @@ xrep_parent_insert_xattr(
|
|||
.attr_filter = key->flags,
|
||||
.namelen = key->namelen,
|
||||
.valuelen = key->valuelen,
|
||||
.owner = rp->sc->ip->i_ino,
|
||||
.owner = I_INO(rp->sc->ip),
|
||||
.geo = rp->sc->mp->m_attr_geo,
|
||||
.whichfork = XFS_ATTR_FORK,
|
||||
.op_flags = XFS_DA_OP_OKNOENT,
|
||||
|
|
@ -1329,7 +1329,7 @@ xrep_parent_rebuild_pptrs(
|
|||
* For this purpose, root directories are their own parents.
|
||||
*/
|
||||
if (xchk_inode_is_dirtree_root(sc->ip)) {
|
||||
xrep_findparent_scan_found(&rp->pscan, sc->ip->i_ino);
|
||||
xrep_findparent_scan_found(&rp->pscan, I_INO(sc->ip));
|
||||
} else {
|
||||
error = xrep_parent_lookup_pptrs(sc, &parent_ino);
|
||||
if (error)
|
||||
|
|
@ -1451,7 +1451,7 @@ xrep_parent_set_nondir_nlink(
|
|||
* The file is on the unlinked list but we found parents.
|
||||
* Remove the file from the unlinked list.
|
||||
*/
|
||||
pag = xfs_perag_get(sc->mp, XFS_INO_TO_AGNO(sc->mp, ip->i_ino));
|
||||
pag = xfs_perag_get(sc->mp, XFS_INODE_TO_AGNO(ip));
|
||||
if (!pag) {
|
||||
ASSERT(0);
|
||||
return -EFSCORRUPTED;
|
||||
|
|
|
|||
|
|
@ -399,7 +399,7 @@ xqcheck_collect_inode(
|
|||
int error = 0;
|
||||
|
||||
if (xfs_is_metadir_inode(ip) ||
|
||||
xfs_is_quota_inode(&tp->t_mountp->m_sb, ip->i_ino)) {
|
||||
xfs_is_quota_inode(&tp->t_mountp->m_sb, I_INO(ip))) {
|
||||
/*
|
||||
* Quota files are never counted towards quota, so we do not
|
||||
* need to take the lock. Files do not switch between the
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ xchk_dir_walk_sf(
|
|||
dapos = xfs_dir2_db_off_to_dataptr(geo, geo->datablk,
|
||||
geo->data_entry_offset);
|
||||
|
||||
error = dirent_fn(sc, dp, dapos, &name, dp->i_ino, priv);
|
||||
error = dirent_fn(sc, dp, dapos, &name, I_INO(dp), priv);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ xchk_dir_walk_block(
|
|||
unsigned int off, next_off, end;
|
||||
int error;
|
||||
|
||||
error = xfs_dir3_block_read(sc->tp, dp, dp->i_ino, &bp);
|
||||
error = xfs_dir3_block_read(sc->tp, dp, I_INO(dp), &bp);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ xchk_read_leaf_dir_buf(
|
|||
if (new_off > *curoff)
|
||||
*curoff = new_off;
|
||||
|
||||
return xfs_dir3_data_read(tp, dp, dp->i_ino, map.br_startoff, 0, bpp);
|
||||
return xfs_dir3_data_read(tp, dp, I_INO(dp), map.br_startoff, 0, bpp);
|
||||
}
|
||||
|
||||
/* Call a function for every entry in a leaf directory. */
|
||||
|
|
@ -274,7 +274,7 @@ xchk_dir_walk(
|
|||
.dp = dp,
|
||||
.geo = dp->i_mount->m_dir_geo,
|
||||
.trans = sc->tp,
|
||||
.owner = dp->i_ino,
|
||||
.owner = I_INO(dp),
|
||||
};
|
||||
int error;
|
||||
|
||||
|
|
@ -320,7 +320,7 @@ xchk_dir_lookup(
|
|||
.hashval = xfs_dir2_hashname(dp->i_mount, name),
|
||||
.whichfork = XFS_DATA_FORK,
|
||||
.op_flags = XFS_DA_OP_OKNOENT,
|
||||
.owner = dp->i_ino,
|
||||
.owner = I_INO(dp),
|
||||
};
|
||||
int error;
|
||||
|
||||
|
|
@ -332,7 +332,7 @@ xchk_dir_lookup(
|
|||
* set to sc->ip, so we must switch the owner here for the lookup.
|
||||
*/
|
||||
if (dp == sc->tempip)
|
||||
args.owner = sc->ip->i_ino;
|
||||
args.owner = I_INO(sc->ip);
|
||||
|
||||
ASSERT(S_ISDIR(VFS_I(dp)->i_mode));
|
||||
xfs_assert_ilocked(dp, XFS_ILOCK_SHARED | XFS_ILOCK_EXCL);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -1249,8 +1249,7 @@ xreap_bmapi_select(
|
|||
cur = xfs_rmapbt_init_cursor(sc->mp, sc->tp, sc->sa.agf_bp,
|
||||
sc->sa.pag);
|
||||
|
||||
xfs_rmap_ino_owner(&oinfo, rs->ip->i_ino, rs->whichfork,
|
||||
imap->br_startoff);
|
||||
xfs_rmap_inode_owner(&oinfo, rs->ip, rs->whichfork, imap->br_startoff);
|
||||
error = xfs_rmap_has_other_keys(cur, agbno, 1, &oinfo, crosslinked);
|
||||
if (error)
|
||||
goto out_cur;
|
||||
|
|
|
|||
|
|
@ -816,7 +816,7 @@ xrep_ino_dqattach(
|
|||
case -ENOENT:
|
||||
xfs_err_ratelimited(sc->mp,
|
||||
"inode %llu repair encountered quota error %d, quotacheck forced.",
|
||||
(unsigned long long)sc->ip->i_ino, error);
|
||||
(unsigned long long)I_INO(sc->ip), error);
|
||||
if (XFS_IS_UQUOTA_ON(sc->mp) && !sc->ip->i_udquot)
|
||||
xrep_force_quotacheck(sc, XFS_DQTYPE_USER);
|
||||
if (XFS_IS_GQUOTA_ON(sc->mp) && !sc->ip->i_gdquot)
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ xrep_rmap_scan_ifork(
|
|||
int whichfork)
|
||||
{
|
||||
struct xrep_rmap_ifork rf = {
|
||||
.accum = { .rm_owner = ip->i_ino, },
|
||||
.accum = { .rm_owner = I_INO(ip), },
|
||||
.rr = rr,
|
||||
.whichfork = whichfork,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -200,13 +200,13 @@ xchk_rtbitmap(
|
|||
|
||||
/* Is sb_rextents correct? */
|
||||
if (mp->m_sb.sb_rextents != rtb->rextents) {
|
||||
xchk_ino_set_corrupt(sc, rbmip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, rbmip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Is sb_rextslog correct? */
|
||||
if (mp->m_sb.sb_rextslog != rtb->rextslog) {
|
||||
xchk_ino_set_corrupt(sc, rbmip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, rbmip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -215,17 +215,17 @@ xchk_rtbitmap(
|
|||
* case can we exceed 4bn bitmap blocks since the super field is a u32.
|
||||
*/
|
||||
if (rtb->rbmblocks > U32_MAX) {
|
||||
xchk_ino_set_corrupt(sc, rbmip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, rbmip);
|
||||
return 0;
|
||||
}
|
||||
if (mp->m_sb.sb_rbmblocks != rtb->rbmblocks) {
|
||||
xchk_ino_set_corrupt(sc, rbmip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, rbmip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* The bitmap file length must be aligned to an fsblock. */
|
||||
if (rbmip->i_disk_size & mp->m_blockmask) {
|
||||
xchk_ino_set_corrupt(sc, rbmip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, rbmip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -235,7 +235,7 @@ xchk_rtbitmap(
|
|||
* file can be larger than sb_rbmblocks.
|
||||
*/
|
||||
if (rbmip->i_disk_size < XFS_FSB_TO_B(mp, rtb->rbmblocks)) {
|
||||
xchk_ino_set_corrupt(sc, rbmip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, rbmip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -284,7 +284,7 @@ xchk_xref_is_used_rt_space(
|
|||
if (xfs_has_zoned(sc->mp)) {
|
||||
if (!xfs_zone_rgbno_is_valid(rtg,
|
||||
xfs_rtb_to_rgbno(sc->mp, rtbno) + len - 1))
|
||||
xchk_ino_xref_set_corrupt(sc, rtg_rmap(rtg)->i_ino);
|
||||
xchk_ip_xref_set_corrupt(sc, rtg_rmap(rtg));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -295,5 +295,5 @@ xchk_xref_is_used_rt_space(
|
|||
if (!xchk_should_check_xref(sc, &error, NULL))
|
||||
return;
|
||||
if (is_free)
|
||||
xchk_ino_xref_set_corrupt(sc, rtg_bitmap(rtg)->i_ino);
|
||||
xchk_ip_xref_set_corrupt(sc, rtg_bitmap(rtg));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -382,7 +382,7 @@ xrep_rtbitmap_prep_buf(
|
|||
struct xfs_rtbuf_blkinfo *hdr = bp->b_addr;
|
||||
|
||||
hdr->rt_magic = cpu_to_be32(XFS_RTBITMAP_MAGIC);
|
||||
hdr->rt_owner = cpu_to_be64(sc->ip->i_ino);
|
||||
hdr->rt_owner = cpu_to_be64(I_INO(sc->ip));
|
||||
hdr->rt_blkno = cpu_to_be64(xfs_buf_daddr(bp));
|
||||
hdr->rt_lsn = 0;
|
||||
uuid_copy(&hdr->rt_uuid, &sc->mp->m_sb.sb_meta_uuid);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ xrep_rtrefc_walk_rmap(
|
|||
return error;
|
||||
|
||||
/* Skip extents which are not owned by this inode and fork. */
|
||||
if (rec->rm_owner != rr->sc->ip->i_ino)
|
||||
if (rec->rm_owner != I_INO(rr->sc->ip))
|
||||
return 0;
|
||||
|
||||
error = xrep_check_ino_btree_mapping(rr->sc, rec);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -324,7 +324,7 @@ xrep_rtrmap_scan_dfork(
|
|||
struct xfs_inode *ip)
|
||||
{
|
||||
struct xrep_rtrmap_ifork rf = {
|
||||
.accum = { .rm_owner = ip->i_ino, },
|
||||
.accum = { .rm_owner = I_INO(ip), },
|
||||
.rr = rr,
|
||||
};
|
||||
struct xfs_ifork *ifp = xfs_ifork_ptr(ip, XFS_DATA_FORK);
|
||||
|
|
@ -392,7 +392,7 @@ xrep_rtrmap_walk_rmap(
|
|||
return error;
|
||||
|
||||
/* Skip extents which are not owned by this inode and fork. */
|
||||
if (rec->rm_owner != rr->sc->ip->i_ino)
|
||||
if (rec->rm_owner != I_INO(rr->sc->ip))
|
||||
return 0;
|
||||
|
||||
error = xrep_check_ino_btree_mapping(rr->sc, rec);
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ xchk_rtsum_record_free(
|
|||
rtlen = xfs_rtxlen_to_extlen(mp, rec->ar_extcount);
|
||||
|
||||
if (!xfs_verify_rtbext(mp, rtbno, rtlen)) {
|
||||
xchk_ino_xref_set_corrupt(sc, rtg_bitmap(rtg)->i_ino);
|
||||
xchk_ip_xref_set_corrupt(sc, rtg_bitmap(rtg));
|
||||
return -EFSCORRUPTED;
|
||||
}
|
||||
|
||||
|
|
@ -314,25 +314,25 @@ xchk_rtsummary(
|
|||
|
||||
/* Is sb_rextents correct? */
|
||||
if (mp->m_sb.sb_rextents != rts->rextents) {
|
||||
xchk_ino_set_corrupt(sc, rbmip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, rbmip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Is m_rsumlevels correct? */
|
||||
if (mp->m_rsumlevels != rts->rsumlevels) {
|
||||
xchk_ino_set_corrupt(sc, rsumip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, rsumip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Is m_rsumsize correct? */
|
||||
if (mp->m_rsumblocks != rts->rsumblocks) {
|
||||
xchk_ino_set_corrupt(sc, rsumip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, rsumip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* The summary file length must be aligned to an fsblock. */
|
||||
if (rsumip->i_disk_size & mp->m_blockmask) {
|
||||
xchk_ino_set_corrupt(sc, rsumip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, rsumip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -342,7 +342,7 @@ xchk_rtsummary(
|
|||
* the file can be larger than rsumsize.
|
||||
*/
|
||||
if (rsumip->i_disk_size < XFS_FSB_TO_B(mp, rts->rsumblocks)) {
|
||||
xchk_ino_set_corrupt(sc, rsumip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, rsumip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -358,7 +358,7 @@ xchk_rtsummary(
|
|||
* EFSCORRUPTED means the rtbitmap is corrupt, which is an xref
|
||||
* error since we're checking the summary file.
|
||||
*/
|
||||
xchk_ino_set_corrupt(sc, rbmip->i_ino);
|
||||
xchk_ip_set_corrupt(sc, rbmip);
|
||||
return 0;
|
||||
}
|
||||
if (error)
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ xrep_rtsummary_prep_buf(
|
|||
struct xfs_rtbuf_blkinfo *hdr = bp->b_addr;
|
||||
|
||||
hdr->rt_magic = cpu_to_be32(XFS_RTSUMMARY_MAGIC);
|
||||
hdr->rt_owner = cpu_to_be64(sc->ip->i_ino);
|
||||
hdr->rt_owner = cpu_to_be64(I_INO(sc->ip));
|
||||
hdr->rt_blkno = cpu_to_be64(xfs_buf_daddr(bp));
|
||||
hdr->rt_lsn = 0;
|
||||
uuid_copy(&hdr->rt_uuid, &sc->mp->m_sb.sb_meta_uuid);
|
||||
|
|
|
|||
|
|
@ -955,7 +955,7 @@ xfs_ioc_scrubv_metadata(
|
|||
* because each scrubber gets to decide its own strategy and return
|
||||
* values for getting an inode.
|
||||
*/
|
||||
if (head.svh_ino && head.svh_ino != ip_in->i_ino)
|
||||
if (head.svh_ino && head.svh_ino != I_INO(ip_in))
|
||||
handle_ip = xchk_scrubv_open_by_handle(mp, &head);
|
||||
|
||||
/* Run all the scrubbers. */
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ xrep_symlink_salvage_remote(
|
|||
fa = bp->b_ops->verify_struct(bp);
|
||||
dsl = bp->b_addr;
|
||||
magic_ok = dsl->sl_magic == cpu_to_be32(XFS_SYMLINK_MAGIC);
|
||||
hdr_ok = xfs_symlink_hdr_ok(ip->i_ino, offset, byte_cnt, bp);
|
||||
hdr_ok = xfs_symlink_hdr_ok(I_INO(ip), offset, byte_cnt, bp);
|
||||
if (!hdr_ok || (fa != NULL && !magic_ok))
|
||||
break;
|
||||
|
||||
|
|
@ -259,7 +259,7 @@ xrep_symlink_local_to_remote(
|
|||
if (!xfs_has_crc(sc->mp))
|
||||
return;
|
||||
|
||||
dsl->sl_owner = cpu_to_be64(sc->ip->i_ino);
|
||||
dsl->sl_owner = cpu_to_be64(I_INO(sc->ip));
|
||||
xfs_trans_log_buf(tp, bp, 0,
|
||||
sizeof(struct xfs_dsymlink_hdr) + ifp->if_bytes - 1);
|
||||
}
|
||||
|
|
@ -375,7 +375,7 @@ xrep_symlink_reset_fork(
|
|||
|
||||
/* Reset the temp symlink target to dummy content. */
|
||||
xfs_idestroy_fork(ifp);
|
||||
return xfs_symlink_write_target(sc->tp, sc->tempip, sc->tempip->i_ino,
|
||||
return xfs_symlink_write_target(sc->tp, sc->tempip, I_INO(sc->tempip),
|
||||
"?", 1, 0, 0);
|
||||
}
|
||||
|
||||
|
|
@ -434,7 +434,7 @@ xrep_symlink_rebuild(
|
|||
sc->tempip->i_df.if_format = XFS_DINODE_FMT_EXTENTS;
|
||||
|
||||
/* Write the salvaged target to the temporary link. */
|
||||
error = xfs_symlink_write_target(sc->tp, sc->tempip, sc->ip->i_ino,
|
||||
error = xfs_symlink_write_target(sc->tp, sc->tempip, I_INO(sc->ip),
|
||||
target_buf, target_len, fs_blocks, resblks);
|
||||
if (error)
|
||||
return error;
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ xrep_tempfile_create(
|
|||
* remote target block, so the owner is irrelevant.
|
||||
*/
|
||||
error = xfs_symlink_write_target(tp, sc->tempip,
|
||||
sc->tempip->i_ino, ".", 1, 0, 0);
|
||||
I_INO(sc->tempip), ".", 1, 0, 0);
|
||||
if (error)
|
||||
goto out_trans_cancel;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ xchk_btree_cur_fsbno(
|
|||
|
||||
if (level == cur->bc_nlevels - 1 &&
|
||||
cur->bc_ops->type == XFS_BTREE_TYPE_INODE)
|
||||
return XFS_INO_TO_FSB(cur->bc_mp, cur->bc_ino.ip->i_ino);
|
||||
return XFS_INODE_TO_FSB(cur->bc_ino.ip);
|
||||
|
||||
return NULLFSBLOCK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ DECLARE_EVENT_CLASS(xchk_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->type = sm->sm_type;
|
||||
__entry->agno = sm->sm_agno;
|
||||
__entry->inum = sm->sm_ino;
|
||||
|
|
@ -236,7 +236,7 @@ DECLARE_EVENT_CLASS(xchk_vector_head_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->agno = vhead->svh_agno;
|
||||
__entry->inum = vhead->svh_ino;
|
||||
__entry->gen = vhead->svh_gen;
|
||||
|
|
@ -340,7 +340,7 @@ TRACE_EVENT(xchk_file_op_error,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = sc->ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = sc->ip->i_ino;
|
||||
__entry->ino = I_INO(sc->ip);
|
||||
__entry->whichfork = whichfork;
|
||||
__entry->type = sc->sm->sm_type;
|
||||
__entry->offset = offset;
|
||||
|
|
@ -438,7 +438,7 @@ DECLARE_EVENT_CLASS(xchk_fblock_error_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = sc->ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = sc->ip->i_ino;
|
||||
__entry->ino = I_INO(sc->ip);
|
||||
__entry->whichfork = whichfork;
|
||||
__entry->type = sc->sm->sm_type;
|
||||
__entry->offset = offset;
|
||||
|
|
@ -481,7 +481,7 @@ DECLARE_EVENT_CLASS(xchk_dqiter_class,
|
|||
TP_fast_assign(
|
||||
__entry->dev = cursor->sc->mp->m_super->s_dev;
|
||||
__entry->dqtype = cursor->dqtype;
|
||||
__entry->ino = cursor->quota_ip->i_ino;
|
||||
__entry->ino = I_INO(cursor->quota_ip);
|
||||
__entry->cur_id = cursor->id;
|
||||
__entry->startoff = cursor->bmap.br_startoff;
|
||||
__entry->startblock = cursor->bmap.br_startblock;
|
||||
|
|
@ -613,7 +613,7 @@ TRACE_EVENT(xchk_ifork_btree_op_error,
|
|||
TP_fast_assign(
|
||||
xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
|
||||
__entry->dev = sc->mp->m_super->s_dev;
|
||||
__entry->ino = cur->bc_ino.ip->i_ino;
|
||||
__entry->ino = I_INO(cur->bc_ino.ip);
|
||||
__entry->whichfork = cur->bc_ino.whichfork;
|
||||
__entry->type = sc->sm->sm_type;
|
||||
__assign_str(name);
|
||||
|
|
@ -693,7 +693,7 @@ TRACE_EVENT(xchk_ifork_btree_error,
|
|||
TP_fast_assign(
|
||||
xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
|
||||
__entry->dev = sc->mp->m_super->s_dev;
|
||||
__entry->ino = sc->ip->i_ino;
|
||||
__entry->ino = I_INO(sc->ip);
|
||||
__entry->whichfork = cur->bc_ino.whichfork;
|
||||
__entry->type = sc->sm->sm_type;
|
||||
__assign_str(name);
|
||||
|
|
@ -785,17 +785,17 @@ TRACE_EVENT(xchk_xref_error,
|
|||
|
||||
TRACE_EVENT(xchk_iallocbt_check_cluster,
|
||||
TP_PROTO(const struct xfs_perag *pag, xfs_agino_t startino,
|
||||
xfs_daddr_t map_daddr, unsigned short map_len,
|
||||
xfs_agblock_t map_agblock, unsigned short map_len,
|
||||
unsigned int chunk_ino, unsigned int nr_inodes,
|
||||
uint16_t cluster_mask, uint16_t holemask,
|
||||
unsigned int cluster_ino),
|
||||
TP_ARGS(pag, startino, map_daddr, map_len, chunk_ino, nr_inodes,
|
||||
TP_ARGS(pag, startino, map_agblock, map_len, chunk_ino, nr_inodes,
|
||||
cluster_mask, holemask, cluster_ino),
|
||||
TP_STRUCT__entry(
|
||||
__field(dev_t, dev)
|
||||
__field(xfs_agnumber_t, agno)
|
||||
__field(xfs_agino_t, startino)
|
||||
__field(xfs_daddr_t, map_daddr)
|
||||
__field(xfs_agblock_t, map_agblock)
|
||||
__field(unsigned short, map_len)
|
||||
__field(unsigned int, chunk_ino)
|
||||
__field(unsigned int, nr_inodes)
|
||||
|
|
@ -807,7 +807,7 @@ TRACE_EVENT(xchk_iallocbt_check_cluster,
|
|||
__entry->dev = pag_mount(pag)->m_super->s_dev;
|
||||
__entry->agno = pag_agno(pag);
|
||||
__entry->startino = startino;
|
||||
__entry->map_daddr = map_daddr;
|
||||
__entry->map_agblock = map_agblock;
|
||||
__entry->map_len = map_len;
|
||||
__entry->chunk_ino = chunk_ino;
|
||||
__entry->nr_inodes = nr_inodes;
|
||||
|
|
@ -815,11 +815,11 @@ TRACE_EVENT(xchk_iallocbt_check_cluster,
|
|||
__entry->holemask = holemask;
|
||||
__entry->cluster_ino = cluster_ino;
|
||||
),
|
||||
TP_printk("dev %d:%d agno 0x%x startino 0x%x daddr 0x%llx bbcount 0x%x chunkino 0x%x nr_inodes %u cluster_mask 0x%x holemask 0x%x cluster_ino 0x%x",
|
||||
TP_printk("dev %d:%d agno 0x%x startino 0x%x agblock 0x%x bbcount 0x%x chunkino 0x%x nr_inodes %u cluster_mask 0x%x holemask 0x%x cluster_ino 0x%x",
|
||||
MAJOR(__entry->dev), MINOR(__entry->dev),
|
||||
__entry->agno,
|
||||
__entry->startino,
|
||||
__entry->map_daddr,
|
||||
__entry->map_agblock,
|
||||
__entry->map_len,
|
||||
__entry->chunk_ino,
|
||||
__entry->nr_inodes,
|
||||
|
|
@ -839,7 +839,7 @@ TRACE_EVENT(xchk_inode_is_allocated,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = VFS_I(ip)->i_sb->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->iflags = ip->i_flags;
|
||||
__entry->mode = VFS_I(ip)->i_mode;
|
||||
),
|
||||
|
|
@ -1437,7 +1437,7 @@ TRACE_EVENT(xchk_nlinks_collect_dirent,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = mp->m_super->s_dev;
|
||||
__entry->dir = dp->i_ino;
|
||||
__entry->dir = I_INO(dp);
|
||||
__entry->ino = ino;
|
||||
__entry->namelen = name->len;
|
||||
memcpy(__get_str(name), name->name, name->len);
|
||||
|
|
@ -1464,7 +1464,7 @@ TRACE_EVENT(xchk_nlinks_collect_pptr,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = mp->m_super->s_dev;
|
||||
__entry->dir = dp->i_ino;
|
||||
__entry->dir = I_INO(dp);
|
||||
__entry->ino = be64_to_cpu(pptr->p_ino);
|
||||
__entry->namelen = name->len;
|
||||
memcpy(__get_str(name), name->name, name->len);
|
||||
|
|
@ -1509,7 +1509,7 @@ TRACE_EVENT(xchk_nlinks_live_update,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = mp->m_super->s_dev;
|
||||
__entry->dir = dp ? dp->i_ino : NULLFSINO;
|
||||
__entry->dir = dp ? I_INO(dp) : NULLFSINO;
|
||||
__entry->action = action;
|
||||
__entry->ino = ino;
|
||||
__entry->delta = delta;
|
||||
|
|
@ -1602,7 +1602,7 @@ DECLARE_EVENT_CLASS(xchk_nlinks_diff_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = mp->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->ftype = xfs_mode_to_ftype(VFS_I(ip)->i_mode);
|
||||
__entry->nlink = VFS_I(ip)->i_nlink;
|
||||
__entry->parents = live->parents;
|
||||
|
|
@ -1638,7 +1638,7 @@ DECLARE_EVENT_CLASS(xchk_pptr_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->namelen = name->len;
|
||||
memcpy(__get_str(name), name, name->len);
|
||||
__entry->far_ino = far_ino;
|
||||
|
|
@ -1680,7 +1680,7 @@ DECLARE_EVENT_CLASS(xchk_dirtree_class,
|
|||
TP_fast_assign(
|
||||
__entry->dev = sc->mp->m_super->s_dev;
|
||||
__entry->path_nr = path_nr;
|
||||
__entry->child_ino = ip->i_ino;
|
||||
__entry->child_ino = I_INO(ip);
|
||||
__entry->child_gen = VFS_I(ip)->i_generation;
|
||||
__entry->parent_ino = be64_to_cpu(pptr->p_ino);
|
||||
__entry->parent_gen = be32_to_cpu(pptr->p_gen);
|
||||
|
|
@ -1727,7 +1727,7 @@ DECLARE_EVENT_CLASS(xchk_dirpath_class,
|
|||
__entry->dev = sc->mp->m_super->s_dev;
|
||||
__entry->path_nr = path_nr;
|
||||
__entry->step_nr = step_nr;
|
||||
__entry->child_ino = ip->i_ino;
|
||||
__entry->child_ino = I_INO(ip);
|
||||
__entry->child_gen = VFS_I(ip)->i_generation;
|
||||
__entry->parent_ino = be64_to_cpu(pptr->p_ino);
|
||||
__entry->parent_gen = be32_to_cpu(pptr->p_gen);
|
||||
|
|
@ -1830,7 +1830,7 @@ DECLARE_EVENT_CLASS(xchk_dirtree_evaluate_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = dl->sc->mp->m_super->s_dev;
|
||||
__entry->ino = dl->sc->ip->i_ino;
|
||||
__entry->ino = I_INO(dl->sc->ip);
|
||||
__entry->rootino = dl->root_ino;
|
||||
__entry->nr_paths = dl->nr_paths;
|
||||
__entry->bad = oc->bad;
|
||||
|
|
@ -1873,8 +1873,8 @@ TRACE_EVENT(xchk_dirpath_changed,
|
|||
__entry->dev = sc->mp->m_super->s_dev;
|
||||
__entry->path_nr = path_nr;
|
||||
__entry->step_nr = step_nr;
|
||||
__entry->child_ino = ip->i_ino;
|
||||
__entry->parent_ino = dp->i_ino;
|
||||
__entry->child_ino = I_INO(ip);
|
||||
__entry->parent_ino = I_INO(dp);
|
||||
__entry->namelen = xname->len;
|
||||
memcpy(__get_str(name), xname->name, xname->len);
|
||||
),
|
||||
|
|
@ -1904,9 +1904,9 @@ TRACE_EVENT(xchk_dirtree_live_update,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = sc->mp->m_super->s_dev;
|
||||
__entry->parent_ino = dp->i_ino;
|
||||
__entry->parent_ino = I_INO(dp);
|
||||
__entry->action = action;
|
||||
__entry->child_ino = ip->i_ino;
|
||||
__entry->child_ino = I_INO(ip);
|
||||
__entry->delta = delta;
|
||||
__entry->namelen = xname->len;
|
||||
memcpy(__get_str(name), xname->name, xname->len);
|
||||
|
|
@ -1933,8 +1933,8 @@ DECLARE_EVENT_CLASS(xchk_metapath_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = sc->mp->m_super->s_dev;
|
||||
__entry->scrub_ino = sc->ip ? sc->ip->i_ino : NULLFSINO;
|
||||
__entry->parent_ino = dp ? dp->i_ino : NULLFSINO;
|
||||
__entry->scrub_ino = sc->ip ? I_INO(sc->ip) : NULLFSINO;
|
||||
__entry->parent_ino = dp ? I_INO(dp) : NULLFSINO;
|
||||
__entry->ino = ino;
|
||||
__assign_str(name);
|
||||
),
|
||||
|
|
@ -2208,7 +2208,7 @@ TRACE_EVENT(xrep_bmap_found,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = VFS_I(ip)->i_sb->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->whichfork = whichfork;
|
||||
__entry->lblk = irec->br_startoff;
|
||||
__entry->len = irec->br_blockcount;
|
||||
|
|
@ -2609,7 +2609,7 @@ TRACE_EVENT(xrep_dinode_findmode_dirent,
|
|||
TP_fast_assign(
|
||||
__entry->dev = sc->mp->m_super->s_dev;
|
||||
__entry->ino = sc->sm->sm_ino;
|
||||
__entry->parent_ino = dp->i_ino;
|
||||
__entry->parent_ino = I_INO(dp);
|
||||
__entry->ftype = ftype;
|
||||
),
|
||||
TP_printk("dev %d:%d ino 0x%llx parent_ino 0x%llx ftype '%s'",
|
||||
|
|
@ -2633,7 +2633,7 @@ TRACE_EVENT(xrep_dinode_findmode_dirent_inval,
|
|||
TP_fast_assign(
|
||||
__entry->dev = sc->mp->m_super->s_dev;
|
||||
__entry->ino = sc->sm->sm_ino;
|
||||
__entry->parent_ino = dp->i_ino;
|
||||
__entry->parent_ino = I_INO(dp);
|
||||
__entry->ftype = ftype;
|
||||
__entry->found_ftype = found_ftype;
|
||||
),
|
||||
|
|
@ -2658,7 +2658,7 @@ TRACE_EVENT(xrep_cow_mark_file_range,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->startoff = startoff;
|
||||
__entry->startblock = startblock;
|
||||
__entry->blockcount = blockcount;
|
||||
|
|
@ -2687,7 +2687,7 @@ TRACE_EVENT(xrep_cow_replace_mapping,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->startoff = irec->br_startoff;
|
||||
__entry->startblock = irec->br_startblock;
|
||||
__entry->blockcount = irec->br_blockcount;
|
||||
|
|
@ -2817,13 +2817,13 @@ TRACE_EVENT(xrep_tempfile_create,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = sc->mp->m_super->s_dev;
|
||||
__entry->ino = sc->file ? XFS_I(file_inode(sc->file))->i_ino : 0;
|
||||
__entry->ino = sc->file ? file_inode(sc->file)->i_ino : 0;
|
||||
__entry->type = sc->sm->sm_type;
|
||||
__entry->agno = sc->sm->sm_agno;
|
||||
__entry->inum = sc->sm->sm_ino;
|
||||
__entry->gen = sc->sm->sm_gen;
|
||||
__entry->flags = sc->sm->sm_flags;
|
||||
__entry->temp_inum = sc->tempip->i_ino;
|
||||
__entry->temp_inum = I_INO(sc->tempip);
|
||||
),
|
||||
TP_printk("dev %d:%d ino 0x%llx type %s inum 0x%llx gen 0x%x flags 0x%x temp_inum 0x%llx",
|
||||
MAJOR(__entry->dev), MINOR(__entry->dev),
|
||||
|
|
@ -2850,7 +2850,7 @@ DECLARE_EVENT_CLASS(xrep_tempfile_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = sc->mp->m_super->s_dev;
|
||||
__entry->ino = sc->tempip->i_ino;
|
||||
__entry->ino = I_INO(sc->tempip);
|
||||
__entry->whichfork = whichfork;
|
||||
__entry->lblk = irec->br_startoff;
|
||||
__entry->len = irec->br_blockcount;
|
||||
|
|
@ -2890,7 +2890,7 @@ TRACE_EVENT(xreap_ifork_extent,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = sc->mp->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->whichfork = whichfork;
|
||||
__entry->fileoff = irec->br_startoff;
|
||||
__entry->len = irec->br_blockcount;
|
||||
|
|
@ -2946,7 +2946,7 @@ TRACE_EVENT(xrep_xattr_recover_leafblock,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->dabno = dabno;
|
||||
__entry->magic = magic;
|
||||
),
|
||||
|
|
@ -2971,7 +2971,7 @@ DECLARE_EVENT_CLASS(xrep_xattr_salvage_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->flags = flags;
|
||||
__entry->namelen = namelen;
|
||||
memcpy(__get_str(name), name, namelen);
|
||||
|
|
@ -3011,7 +3011,7 @@ DECLARE_EVENT_CLASS(xrep_pptr_salvage_class,
|
|||
const struct xfs_parent_rec *rec = value;
|
||||
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->parent_ino = be64_to_cpu(rec->p_ino);
|
||||
__entry->parent_gen = be32_to_cpu(rec->p_gen);
|
||||
__entry->namelen = namelen;
|
||||
|
|
@ -3043,8 +3043,8 @@ DECLARE_EVENT_CLASS(xrep_xattr_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->src_ino = arg_ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->src_ino = I_INO(arg_ip);
|
||||
),
|
||||
TP_printk("dev %d:%d ino 0x%llx src 0x%llx",
|
||||
MAJOR(__entry->dev), MINOR(__entry->dev),
|
||||
|
|
@ -3073,8 +3073,8 @@ DECLARE_EVENT_CLASS(xrep_xattr_pptr_scan_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->parent_ino = dp->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->parent_ino = I_INO(dp);
|
||||
__entry->parent_gen = VFS_IC(dp)->i_generation;
|
||||
__entry->namelen = name->len;
|
||||
memcpy(__get_str(name), name->name, name->len);
|
||||
|
|
@ -3108,7 +3108,7 @@ TRACE_EVENT(xrep_dir_recover_dirblock,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = dp->i_mount->m_super->s_dev;
|
||||
__entry->dir_ino = dp->i_ino;
|
||||
__entry->dir_ino = I_INO(dp);
|
||||
__entry->dabno = dabno;
|
||||
__entry->magic = magic;
|
||||
__entry->magic_guess = magic_guess;
|
||||
|
|
@ -3131,7 +3131,7 @@ DECLARE_EVENT_CLASS(xrep_dir_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = dp->i_mount->m_super->s_dev;
|
||||
__entry->dir_ino = dp->i_ino;
|
||||
__entry->dir_ino = I_INO(dp);
|
||||
__entry->parent_ino = parent_ino;
|
||||
),
|
||||
TP_printk("dev %d:%d dir 0x%llx parent 0x%llx",
|
||||
|
|
@ -3161,7 +3161,7 @@ DECLARE_EVENT_CLASS(xrep_dirent_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = dp->i_mount->m_super->s_dev;
|
||||
__entry->dir_ino = dp->i_ino;
|
||||
__entry->dir_ino = I_INO(dp);
|
||||
__entry->namelen = name->len;
|
||||
memcpy(__get_str(name), name->name, name->len);
|
||||
__entry->ino = ino;
|
||||
|
|
@ -3198,8 +3198,8 @@ DECLARE_EVENT_CLASS(xrep_adoption_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = dp->i_mount->m_super->s_dev;
|
||||
__entry->dir_ino = dp->i_ino;
|
||||
__entry->child_ino = ip->i_ino;
|
||||
__entry->dir_ino = I_INO(dp);
|
||||
__entry->child_ino = I_INO(ip);
|
||||
__entry->moved = moved;
|
||||
),
|
||||
TP_printk("dev %d:%d dir 0x%llx child 0x%llx moved? %d",
|
||||
|
|
@ -3224,7 +3224,7 @@ DECLARE_EVENT_CLASS(xrep_parent_salvage_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = dp->i_mount->m_super->s_dev;
|
||||
__entry->dir_ino = dp->i_ino;
|
||||
__entry->dir_ino = I_INO(dp);
|
||||
__entry->ino = ino;
|
||||
),
|
||||
TP_printk("dev %d:%d dir 0x%llx parent 0x%llx",
|
||||
|
|
@ -3254,7 +3254,7 @@ DECLARE_EVENT_CLASS(xrep_pptr_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->parent_ino = be64_to_cpu(pptr->p_ino);
|
||||
__entry->parent_gen = be32_to_cpu(pptr->p_gen);
|
||||
__entry->namelen = name->len;
|
||||
|
|
@ -3292,8 +3292,8 @@ DECLARE_EVENT_CLASS(xrep_pptr_scan_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->parent_ino = dp->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->parent_ino = I_INO(dp);
|
||||
__entry->parent_gen = VFS_IC(dp)->i_generation;
|
||||
__entry->namelen = name->len;
|
||||
memcpy(__get_str(name), name->name, name->len);
|
||||
|
|
@ -3392,7 +3392,7 @@ TRACE_EVENT(xrep_symlink_salvage_target,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
__entry->targetlen = targetlen;
|
||||
memcpy(__get_str(target), target, targetlen);
|
||||
__get_str(target)[targetlen] = 0;
|
||||
|
|
@ -3413,7 +3413,7 @@ DECLARE_EVENT_CLASS(xrep_symlink_class,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->ino = ip->i_ino;
|
||||
__entry->ino = I_INO(ip);
|
||||
),
|
||||
TP_printk("dev %d:%d ip 0x%llx",
|
||||
MAJOR(__entry->dev), MINOR(__entry->dev),
|
||||
|
|
@ -3443,7 +3443,7 @@ TRACE_EVENT(xrep_iunlink_visit,
|
|||
TP_fast_assign(
|
||||
__entry->dev = pag_mount(pag)->m_super->s_dev;
|
||||
__entry->agno = pag_agno(pag);
|
||||
__entry->agino = XFS_INO_TO_AGINO(pag_mount(pag), ip->i_ino);
|
||||
__entry->agino = XFS_INODE_TO_AGINO(ip);
|
||||
__entry->bucket = bucket;
|
||||
__entry->bucket_agino = bucket_agino;
|
||||
__entry->prev_agino = ip->i_prev_unlinked;
|
||||
|
|
@ -3473,8 +3473,8 @@ TRACE_EVENT(xrep_iunlink_reload_next,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
|
||||
__entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
|
||||
__entry->agno = XFS_INODE_TO_AGNO(ip);
|
||||
__entry->agino = XFS_INODE_TO_AGINO(ip);
|
||||
__entry->old_prev_agino = ip->i_prev_unlinked;
|
||||
__entry->prev_agino = prev_agino;
|
||||
__entry->next_agino = ip->i_next_unlinked;
|
||||
|
|
@ -3503,8 +3503,8 @@ TRACE_EVENT(xrep_iunlink_reload_ondisk,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
|
||||
__entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
|
||||
__entry->agno = XFS_INODE_TO_AGNO(ip);
|
||||
__entry->agino = XFS_INODE_TO_AGINO(ip);
|
||||
__entry->nlink = VFS_I(ip)->i_nlink;
|
||||
__entry->next_agino = ip->i_next_unlinked;
|
||||
),
|
||||
|
|
@ -3590,8 +3590,8 @@ TRACE_EVENT(xrep_iunlink_relink_next,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
|
||||
__entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
|
||||
__entry->agno = XFS_INODE_TO_AGNO(ip);
|
||||
__entry->agino = XFS_INODE_TO_AGINO(ip);
|
||||
__entry->next_agino = ip->i_next_unlinked;
|
||||
__entry->new_next_agino = next_agino;
|
||||
),
|
||||
|
|
@ -3616,8 +3616,8 @@ TRACE_EVENT(xrep_iunlink_relink_prev,
|
|||
),
|
||||
TP_fast_assign(
|
||||
__entry->dev = ip->i_mount->m_super->s_dev;
|
||||
__entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
|
||||
__entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
|
||||
__entry->agno = XFS_INODE_TO_AGNO(ip);
|
||||
__entry->agino = XFS_INODE_TO_AGINO(ip);
|
||||
__entry->prev_agino = ip->i_prev_unlinked;
|
||||
__entry->new_prev_agino = prev_agino;
|
||||
),
|
||||
|
|
|
|||
|
|
@ -139,6 +139,17 @@ xfs_end_ioend_write(
|
|||
*/
|
||||
error = blk_status_to_errno(ioend->io_bio.bi_status);
|
||||
if (unlikely(error)) {
|
||||
/*
|
||||
* Zoned writes update the in-core open zone accounting before
|
||||
* I/O submission. A failed write leaves that state
|
||||
* inconsistent, so shut down the filesystem instead of letting
|
||||
* later writers wait forever for open zone space to become
|
||||
* available.
|
||||
*/
|
||||
if (is_zoned) {
|
||||
xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
|
||||
goto done;
|
||||
}
|
||||
if (ioend->io_flags & IOMAP_IOEND_SHARED) {
|
||||
ASSERT(!is_zoned);
|
||||
xfs_reflink_cancel_cow_range(ip, offset, size, true);
|
||||
|
|
@ -268,7 +279,7 @@ xfs_discard_folio(
|
|||
|
||||
xfs_alert_ratelimited(mp,
|
||||
"page discard on page "PTR_FMT", inode 0x%llx, pos %llu.",
|
||||
folio, ip->i_ino, pos);
|
||||
folio, I_INO(ip), pos);
|
||||
|
||||
/*
|
||||
* The end of the punch range is always the offset of the first
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ xfs_attr_log_item(
|
|||
* structure with fields from this xfs_attr_intent
|
||||
*/
|
||||
attrp = &attrip->attri_format;
|
||||
attrp->alfi_ino = args->dp->i_ino;
|
||||
attrp->alfi_ino = I_INO(args->dp);
|
||||
ASSERT(!(attr->xattri_op_flags & ~XFS_ATTRI_OP_FLAGS_TYPE_MASK));
|
||||
attrp->alfi_op_flags = attr->xattri_op_flags;
|
||||
attrp->alfi_value_len = nv->value.iov_len;
|
||||
|
|
@ -695,7 +695,7 @@ xfs_attri_recover_work(
|
|||
args->attr_filter = attrp->alfi_attr_filter & XFS_ATTRI_FILTER_MASK;
|
||||
args->op_flags = XFS_DA_OP_RECOVERY | XFS_DA_OP_OKNOENT |
|
||||
XFS_DA_OP_LOGGED;
|
||||
args->owner = args->dp->i_ino;
|
||||
args->owner = I_INO(args->dp);
|
||||
xfs_attr_sethash(args);
|
||||
|
||||
switch (xfs_attr_intent_op(attr)) {
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ xfs_attr_node_list_lookup(
|
|||
goto out_corruptbuf;
|
||||
}
|
||||
|
||||
fa = xfs_da3_node_header_check(bp, dp->i_ino);
|
||||
fa = xfs_da3_node_header_check(bp, I_INO(dp));
|
||||
if (fa)
|
||||
goto out_corruptbuf;
|
||||
|
||||
|
|
@ -287,7 +287,7 @@ xfs_attr_node_list_lookup(
|
|||
}
|
||||
}
|
||||
|
||||
fa = xfs_attr3_leaf_header_check(bp, dp->i_ino);
|
||||
fa = xfs_attr3_leaf_header_check(bp, I_INO(dp));
|
||||
if (fa) {
|
||||
__xfs_buf_mark_corrupt(bp, fa);
|
||||
goto out_releasebuf;
|
||||
|
|
@ -348,7 +348,7 @@ xfs_attr_node_list(
|
|||
case XFS_DA_NODE_MAGIC:
|
||||
case XFS_DA3_NODE_MAGIC:
|
||||
trace_xfs_attr_list_wrong_blk(context);
|
||||
fa = xfs_da3_node_header_check(bp, dp->i_ino);
|
||||
fa = xfs_da3_node_header_check(bp, I_INO(dp));
|
||||
if (fa) {
|
||||
__xfs_buf_mark_corrupt(bp, fa);
|
||||
xfs_dirattr_mark_sick(dp, XFS_ATTR_FORK);
|
||||
|
|
@ -359,7 +359,7 @@ xfs_attr_node_list(
|
|||
case XFS_ATTR_LEAF_MAGIC:
|
||||
case XFS_ATTR3_LEAF_MAGIC:
|
||||
leaf = bp->b_addr;
|
||||
fa = xfs_attr3_leaf_header_check(bp, dp->i_ino);
|
||||
fa = xfs_attr3_leaf_header_check(bp, I_INO(dp));
|
||||
if (fa) {
|
||||
__xfs_buf_mark_corrupt(bp, fa);
|
||||
xfs_trans_brelse(context->tp, bp);
|
||||
|
|
@ -417,7 +417,7 @@ xfs_attr_node_list(
|
|||
break;
|
||||
cursor->blkno = leafhdr.forw;
|
||||
xfs_trans_brelse(context->tp, bp);
|
||||
error = xfs_attr3_leaf_read(context->tp, dp, dp->i_ino,
|
||||
error = xfs_attr3_leaf_read(context->tp, dp, I_INO(dp),
|
||||
cursor->blkno, &bp);
|
||||
if (error)
|
||||
return error;
|
||||
|
|
@ -543,7 +543,7 @@ xfs_attr_leaf_list(
|
|||
|
||||
context->cursor.blkno = 0;
|
||||
error = xfs_attr3_leaf_read(context->tp, context->dp,
|
||||
context->dp->i_ino, 0, &bp);
|
||||
I_INO(context->dp), 0, &bp);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ xfs_bmap_update_diff_items(
|
|||
struct xfs_bmap_intent *ba = bi_entry(a);
|
||||
struct xfs_bmap_intent *bb = bi_entry(b);
|
||||
|
||||
return cmp_int(ba->bi_owner->i_ino, bb->bi_owner->i_ino);
|
||||
return cmp_int(I_INO(ba->bi_owner), I_INO(bb->bi_owner));
|
||||
}
|
||||
|
||||
/* Log bmap updates in the intent item. */
|
||||
|
|
@ -266,7 +266,7 @@ xfs_bmap_update_log_item(
|
|||
next_extent = atomic_inc_return(&buip->bui_next_extent) - 1;
|
||||
ASSERT(next_extent < buip->bui_format.bui_nextents);
|
||||
map = &buip->bui_format.bui_extents[next_extent];
|
||||
map->me_owner = bi->bi_owner->i_ino;
|
||||
map->me_owner = I_INO(bi->bi_owner);
|
||||
map->me_startblock = bi->bi_bmap.br_startblock;
|
||||
map->me_startoff = bi->bi_bmap.br_startoff;
|
||||
map->me_len = bi->bi_bmap.br_blockcount;
|
||||
|
|
|
|||
|
|
@ -1479,7 +1479,7 @@ xfs_swap_change_owner(
|
|||
struct xfs_trans *tp = *tpp;
|
||||
|
||||
do {
|
||||
error = xfs_bmbt_change_owner(tp, ip, XFS_DATA_FORK, ip->i_ino,
|
||||
error = xfs_bmbt_change_owner(tp, ip, XFS_DATA_FORK, I_INO(ip),
|
||||
NULL);
|
||||
/* success or fatal error */
|
||||
if (error != -EAGAIN)
|
||||
|
|
@ -1631,7 +1631,7 @@ xfs_swap_extents(
|
|||
if (error) {
|
||||
xfs_notice(mp,
|
||||
"%s: inode 0x%llx format is incompatible for exchanging.",
|
||||
__func__, ip->i_ino);
|
||||
__func__, I_INO(ip));
|
||||
goto out_trans_cancel;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -623,7 +623,7 @@ _xfs_buf_read(
|
|||
* type. If repair can't establish that, the buffer will be left in memory
|
||||
* with NULL buffer ops.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
xfs_buf_reverify(
|
||||
struct xfs_buf *bp,
|
||||
const struct xfs_buf_ops *ops)
|
||||
|
|
|
|||
|
|
@ -365,7 +365,6 @@ int xfs_configure_buftarg(struct xfs_buftarg *btp, unsigned int sectorsize,
|
|||
|
||||
#define xfs_readonly_buftarg(buftarg) bdev_read_only((buftarg)->bt_bdev)
|
||||
|
||||
int xfs_buf_reverify(struct xfs_buf *bp, const struct xfs_buf_ops *ops);
|
||||
bool xfs_verify_magic(struct xfs_buf *bp, __be32 dmagic);
|
||||
bool xfs_verify_magic16(struct xfs_buf *bp, __be16 dmagic);
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ xfs_dir2_sf_getdents(
|
|||
*/
|
||||
if (ctx->pos <= dot_offset) {
|
||||
ctx->pos = dot_offset & 0x7fffffff;
|
||||
if (!dir_emit(ctx, ".", 1, dp->i_ino, DT_DIR))
|
||||
if (!dir_emit(ctx, ".", 1, I_INO(dp), DT_DIR))
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -532,7 +532,7 @@ xfs_readdir(
|
|||
args.dp = dp;
|
||||
args.geo = dp->i_mount->m_dir_geo;
|
||||
args.trans = tp;
|
||||
args.owner = dp->i_ino;
|
||||
args.owner = I_INO(dp);
|
||||
|
||||
if (dp->i_df.if_format == XFS_DINODE_FMT_LOCAL)
|
||||
return xfs_dir2_sf_getdents(&args, ctx);
|
||||
|
|
|
|||
|
|
@ -1216,6 +1216,14 @@ xfs_qm_dqflush_check(
|
|||
type != XFS_DQTYPE_PROJ)
|
||||
return __this_address;
|
||||
|
||||
/* bigtime flag should never be set on root dquots */
|
||||
if (dqp->q_type & XFS_DQTYPE_BIGTIME) {
|
||||
if (!xfs_has_bigtime(dqp->q_mount))
|
||||
return __this_address;
|
||||
if (dqp->q_id == 0)
|
||||
return __this_address;
|
||||
}
|
||||
|
||||
if (dqp->q_id == 0)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -1231,14 +1239,6 @@ xfs_qm_dqflush_check(
|
|||
!dqp->q_rtb.timer)
|
||||
return __this_address;
|
||||
|
||||
/* bigtime flag should never be set on root dquots */
|
||||
if (dqp->q_type & XFS_DQTYPE_BIGTIME) {
|
||||
if (!xfs_has_bigtime(dqp->q_mount))
|
||||
return __this_address;
|
||||
if (dqp->q_id == 0)
|
||||
return __this_address;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -369,7 +369,7 @@ xfs_inode_verifier_error(
|
|||
|
||||
xfs_alert(mp, "Metadata %s detected at %pS, inode 0x%llx %s",
|
||||
error == -EFSBADCRC ? "CRC error" : "corruption",
|
||||
fa, ip->i_ino, name);
|
||||
fa, I_INO(ip), name);
|
||||
|
||||
xfs_alert(mp, "Unmount and run xfs_repair");
|
||||
|
||||
|
|
|
|||
|
|
@ -227,9 +227,9 @@ xfs_exchmaps_create_intent(
|
|||
xmi_lip = xfs_xmi_init(tp->t_mountp);
|
||||
xlf = &xmi_lip->xmi_format;
|
||||
|
||||
xlf->xmi_inode1 = xmi->xmi_ip1->i_ino;
|
||||
xlf->xmi_inode1 = I_INO(xmi->xmi_ip1);
|
||||
xlf->xmi_igen1 = VFS_I(xmi->xmi_ip1)->i_generation;
|
||||
xlf->xmi_inode2 = xmi->xmi_ip2->i_ino;
|
||||
xlf->xmi_inode2 = I_INO(xmi->xmi_ip2);
|
||||
xlf->xmi_igen2 = VFS_I(xmi->xmi_ip2)->i_generation;
|
||||
xlf->xmi_startoff1 = xmi->xmi_startoff1;
|
||||
xlf->xmi_startoff2 = xmi->xmi_startoff2;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ xfs_exchrange_check_freshness(
|
|||
trace_xfs_exchrange_freshness(fxr, ip2);
|
||||
|
||||
/* Check that file2 hasn't otherwise been modified. */
|
||||
if (fxr->file2_ino != ip2->i_ino ||
|
||||
if (fxr->file2_ino != inode2->i_ino ||
|
||||
fxr->file2_gen != inode2->i_generation ||
|
||||
!timespec64_equal(&fxr->file2_ctime, &ctime) ||
|
||||
!timespec64_equal(&fxr->file2_mtime, &mtime))
|
||||
|
|
@ -863,7 +863,7 @@ xfs_ioc_start_commit(
|
|||
kern_f->file2_ctime_nsec = kstat.ctime.tv_nsec;
|
||||
kern_f->file2_mtime = kstat.mtime.tv_sec;
|
||||
kern_f->file2_mtime_nsec = kstat.mtime.tv_nsec;
|
||||
kern_f->file2_ino = ip2->i_ino;
|
||||
kern_f->file2_ino = inode2->i_ino;
|
||||
kern_f->file2_gen = inode2->i_generation;
|
||||
kern_f->magic = XCR_FRESH_MAGIC;
|
||||
xfs_iunlock(ip2, lockflags);
|
||||
|
|
|
|||
|
|
@ -82,19 +82,19 @@ xfs_fs_encode_fh(
|
|||
|
||||
switch (fileid_type) {
|
||||
case FILEID_INO32_GEN_PARENT:
|
||||
fid->i32.parent_ino = XFS_I(parent)->i_ino;
|
||||
fid->i32.parent_ino = parent->i_ino;
|
||||
fid->i32.parent_gen = parent->i_generation;
|
||||
fallthrough;
|
||||
case FILEID_INO32_GEN:
|
||||
fid->i32.ino = XFS_I(inode)->i_ino;
|
||||
fid->i32.ino = inode->i_ino;
|
||||
fid->i32.gen = inode->i_generation;
|
||||
break;
|
||||
case FILEID_INO32_GEN_PARENT | XFS_FILEID_TYPE_64FLAG:
|
||||
fid64->parent_ino = XFS_I(parent)->i_ino;
|
||||
fid64->parent_ino = parent->i_ino;
|
||||
fid64->parent_gen = parent->i_generation;
|
||||
fallthrough;
|
||||
case FILEID_INO32_GEN | XFS_FILEID_TYPE_64FLAG:
|
||||
fid64->ino = XFS_I(inode)->i_ino;
|
||||
fid64->ino = inode->i_ino;
|
||||
fid64->gen = inode->i_generation;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ xfs_filestream_lookup_association(
|
|||
atomic_inc(&pag_group(pag)->xg_active_ref);
|
||||
xfs_mru_cache_done(mp->m_filestream);
|
||||
|
||||
trace_xfs_filestream_lookup(pag, ap->ip->i_ino);
|
||||
trace_xfs_filestream_lookup(pag, I_INO(ap->ip));
|
||||
|
||||
ap->blkno = xfs_agbno_to_fsb(pag, 0);
|
||||
xfs_bmap_adjacent(ap);
|
||||
|
|
@ -345,7 +345,7 @@ xfs_filestream_select_ag(
|
|||
args->total = ap->total;
|
||||
pip = xfs_filestream_get_parent(ap->ip);
|
||||
if (pip) {
|
||||
ino = pip->i_ino;
|
||||
ino = I_INO(pip);
|
||||
error = xfs_filestream_lookup_association(ap, args, ino,
|
||||
longest);
|
||||
xfs_irele(pip);
|
||||
|
|
@ -370,7 +370,7 @@ void
|
|||
xfs_filestream_deassociate(
|
||||
struct xfs_inode *ip)
|
||||
{
|
||||
xfs_mru_cache_delete(ip->i_mount->m_filestream, ip->i_ino);
|
||||
xfs_mru_cache_delete(ip->i_mount->m_filestream, I_INO(ip));
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -124,7 +124,9 @@ xfs_growfs_data_private(
|
|||
mp->m_sb.sb_rextsize);
|
||||
if (error)
|
||||
return error;
|
||||
xfs_growfs_compute_deltas(mp, nb, &delta, &nagcount);
|
||||
|
||||
nagcount = xfs_growfs_compute_agcount(mp, &nb);
|
||||
delta = nb - mp->m_sb.sb_dblocks;
|
||||
|
||||
/*
|
||||
* Reject filesystems with a single AG because they are not
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ xfs_find_handle(
|
|||
if (cmd == XFS_IOC_PATH_TO_FSHANDLE)
|
||||
hsize = xfs_fshandle_init(ip->i_mount, &handle);
|
||||
else
|
||||
hsize = xfs_filehandle_init(ip->i_mount, ip->i_ino,
|
||||
hsize = xfs_filehandle_init(ip->i_mount, inode->i_ino,
|
||||
inode->i_generation, &handle);
|
||||
|
||||
error = -EFAULT;
|
||||
|
|
@ -808,7 +808,7 @@ xfs_getparents(
|
|||
sizeof(struct xfs_attrlist_cursor));
|
||||
|
||||
/* Is this the root directory? */
|
||||
if (ip->i_ino == mp->m_sb.sb_rootino)
|
||||
if (I_INO(ip) == mp->m_sb.sb_rootino)
|
||||
gp->gp_oflags |= XFS_GETPARENTS_OFLAG_ROOT;
|
||||
|
||||
if (gpx->context.seen_enough == 0) {
|
||||
|
|
|
|||
|
|
@ -533,7 +533,7 @@ xfs_healthmon_report_inode(
|
|||
struct xfs_healthmon_event event = {
|
||||
.type = type,
|
||||
.domain = XFS_HEALTHMON_INODE,
|
||||
.ino = ip->i_ino,
|
||||
.ino = I_INO(ip),
|
||||
.gen = VFS_I(ip)->i_generation,
|
||||
};
|
||||
struct xfs_healthmon *hm = xfs_healthmon_get(ip->i_mount);
|
||||
|
|
@ -646,7 +646,7 @@ xfs_healthmon_report_file_ioerror(
|
|||
struct xfs_healthmon_event event = {
|
||||
.type = file_ioerr_type(p->type),
|
||||
.domain = XFS_HEALTHMON_FILERANGE,
|
||||
.fino = ip->i_ino,
|
||||
.fino = I_INO(ip),
|
||||
.fgen = VFS_I(ip)->i_generation,
|
||||
.fpos = p->pos,
|
||||
.flen = p->len,
|
||||
|
|
@ -1182,7 +1182,7 @@ xfs_ioc_health_monitor(
|
|||
*/
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return -EPERM;
|
||||
if (ip->i_ino != mp->m_sb.sb_rootino)
|
||||
if (I_INO(ip) != mp->m_sb.sb_rootino)
|
||||
return -EPERM;
|
||||
if (current_user_ns() != &init_user_ns)
|
||||
return -EPERM;
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ xfs_inode_alloc(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
VFS_I(ip)->i_ino = ino;
|
||||
/* VFS doesn't initialise i_mode! */
|
||||
VFS_I(ip)->i_mode = 0;
|
||||
mapping_set_folio_min_order(VFS_I(ip)->i_mapping,
|
||||
|
|
@ -108,10 +109,8 @@ xfs_inode_alloc(
|
|||
|
||||
XFS_STATS_INC(mp, xs_inodes_active);
|
||||
ASSERT(atomic_read(&ip->i_pincount) == 0);
|
||||
ASSERT(ip->i_ino == 0);
|
||||
|
||||
/* initialise the xfs inode */
|
||||
ip->i_ino = ino;
|
||||
ip->i_mount = mp;
|
||||
memset(&ip->i_imap, 0, sizeof(struct xfs_imap));
|
||||
ip->i_cowfp = NULL;
|
||||
|
|
@ -193,7 +192,7 @@ xfs_inode_free(
|
|||
*/
|
||||
spin_lock(&ip->i_flags_lock);
|
||||
ip->i_flags = XFS_IRECLAIM;
|
||||
ip->i_ino = 0;
|
||||
VFS_I(ip)->i_ino = 0;
|
||||
spin_unlock(&ip->i_flags_lock);
|
||||
|
||||
__xfs_inode_free(ip);
|
||||
|
|
@ -329,6 +328,7 @@ xfs_reinit_inode(
|
|||
struct inode *inode)
|
||||
{
|
||||
int error;
|
||||
u64 ino = inode->i_ino;
|
||||
uint32_t nlink = inode->i_nlink;
|
||||
uint32_t generation = inode->i_generation;
|
||||
uint64_t version = inode_peek_iversion(inode);
|
||||
|
|
@ -340,6 +340,7 @@ xfs_reinit_inode(
|
|||
|
||||
error = inode_init_always(mp->m_super, inode);
|
||||
|
||||
inode->i_ino = ino;
|
||||
set_nlink(inode, nlink);
|
||||
inode->i_generation = generation;
|
||||
inode_set_iversion_queried(inode, version);
|
||||
|
|
@ -397,7 +398,7 @@ xfs_iget_recycle(
|
|||
*/
|
||||
ip->i_flags &= ~XFS_IRECLAIM_RESET_FLAGS;
|
||||
ip->i_flags |= XFS_INEW;
|
||||
xfs_perag_clear_inode_tag(pag, XFS_INO_TO_AGINO(mp, ip->i_ino),
|
||||
xfs_perag_clear_inode_tag(pag, XFS_INODE_TO_AGINO(ip),
|
||||
XFS_ICI_RECLAIM_TAG);
|
||||
inode_state_assign_raw(inode, I_NEW);
|
||||
spin_unlock(&ip->i_flags_lock);
|
||||
|
|
@ -426,9 +427,8 @@ xfs_iget_check_free_state(
|
|||
if (VFS_I(ip)->i_mode != 0) {
|
||||
xfs_warn(ip->i_mount,
|
||||
"Corruption detected! Free inode 0x%llx not marked free! (mode 0x%x)",
|
||||
ip->i_ino, VFS_I(ip)->i_mode);
|
||||
xfs_agno_mark_sick(ip->i_mount,
|
||||
XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino),
|
||||
I_INO(ip), VFS_I(ip)->i_mode);
|
||||
xfs_agno_mark_sick(ip->i_mount, XFS_INODE_TO_AGNO(ip),
|
||||
XFS_SICK_AG_INOBT);
|
||||
return -EFSCORRUPTED;
|
||||
}
|
||||
|
|
@ -436,9 +436,8 @@ xfs_iget_check_free_state(
|
|||
if (ip->i_nblocks != 0) {
|
||||
xfs_warn(ip->i_mount,
|
||||
"Corruption detected! Free inode 0x%llx has blocks allocated!",
|
||||
ip->i_ino);
|
||||
xfs_agno_mark_sick(ip->i_mount,
|
||||
XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino),
|
||||
I_INO(ip));
|
||||
xfs_agno_mark_sick(ip->i_mount, XFS_INODE_TO_AGNO(ip),
|
||||
XFS_SICK_AG_INOBT);
|
||||
return -EFSCORRUPTED;
|
||||
}
|
||||
|
|
@ -516,7 +515,7 @@ xfs_iget_cache_hit(
|
|||
* will not match, so check for that, too.
|
||||
*/
|
||||
spin_lock(&ip->i_flags_lock);
|
||||
if (ip->i_ino != ino)
|
||||
if (I_INO(ip) != ino)
|
||||
goto out_skip;
|
||||
|
||||
/*
|
||||
|
|
@ -646,7 +645,7 @@ xfs_iget_cache_miss(
|
|||
*/
|
||||
xfs_iflags_set(ip, XFS_INEW);
|
||||
|
||||
error = xfs_imap(pag, tp, ip->i_ino, &ip->i_imap, flags);
|
||||
error = xfs_imap(pag, tp, I_INO(ip), &ip->i_imap, flags);
|
||||
if (error)
|
||||
goto out_destroy;
|
||||
|
||||
|
|
@ -664,7 +663,7 @@ xfs_iget_cache_miss(
|
|||
} else {
|
||||
struct xfs_buf *bp;
|
||||
|
||||
error = xfs_imap_to_bp(mp, tp, &ip->i_imap, &bp);
|
||||
error = xfs_read_icluster(pag, tp, ip->i_imap.im_agbno, &bp);
|
||||
if (error)
|
||||
goto out_destroy;
|
||||
|
||||
|
|
@ -819,8 +818,11 @@ xfs_iget(
|
|||
* now. If it's a new inode being created, xfs_init_new_inode will
|
||||
* handle it.
|
||||
*/
|
||||
if (xfs_iflags_test(ip, XFS_INEW) && VFS_I(ip)->i_mode != 0)
|
||||
xfs_setup_existing_inode(ip);
|
||||
if (xfs_iflags_test(ip, XFS_INEW) && VFS_I(ip)->i_mode != 0) {
|
||||
xfs_setup_inode(ip);
|
||||
xfs_setup_iops(ip);
|
||||
xfs_finish_inode_setup(ip);
|
||||
}
|
||||
return 0;
|
||||
|
||||
out_error_or_again:
|
||||
|
|
@ -962,7 +964,7 @@ xfs_reclaim_inode(
|
|||
struct xfs_inode *ip,
|
||||
struct xfs_perag *pag)
|
||||
{
|
||||
xfs_ino_t ino = ip->i_ino; /* for radix_tree_delete */
|
||||
xfs_ino_t ino = I_INO(ip); /* for radix_tree_delete */
|
||||
|
||||
if (!xfs_ilock_nowait(ip, XFS_ILOCK_EXCL))
|
||||
goto out;
|
||||
|
|
@ -1010,7 +1012,7 @@ xfs_reclaim_inode(
|
|||
*/
|
||||
spin_lock(&ip->i_flags_lock);
|
||||
ip->i_flags = XFS_IRECLAIM;
|
||||
ip->i_ino = 0;
|
||||
VFS_I(ip)->i_ino = 0;
|
||||
ip->i_sick = 0;
|
||||
ip->i_checked = 0;
|
||||
spin_unlock(&ip->i_flags_lock);
|
||||
|
|
@ -1287,10 +1289,10 @@ xfs_blockgc_set_iflag(
|
|||
ip->i_flags |= iflag;
|
||||
spin_unlock(&ip->i_flags_lock);
|
||||
|
||||
pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
|
||||
pag = xfs_perag_get(mp, XFS_INODE_TO_AGNO(ip));
|
||||
spin_lock(&pag->pag_ici_lock);
|
||||
|
||||
xfs_perag_set_inode_tag(pag, XFS_INO_TO_AGINO(mp, ip->i_ino),
|
||||
xfs_perag_set_inode_tag(pag, XFS_INODE_TO_AGINO(ip),
|
||||
XFS_ICI_BLOCKGC_TAG);
|
||||
|
||||
spin_unlock(&pag->pag_ici_lock);
|
||||
|
|
@ -1324,10 +1326,10 @@ xfs_blockgc_clear_iflag(
|
|||
if (!clear_tag)
|
||||
return;
|
||||
|
||||
pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
|
||||
pag = xfs_perag_get(mp, XFS_INODE_TO_AGNO(ip));
|
||||
spin_lock(&pag->pag_ici_lock);
|
||||
|
||||
xfs_perag_clear_inode_tag(pag, XFS_INO_TO_AGINO(mp, ip->i_ino),
|
||||
xfs_perag_clear_inode_tag(pag, XFS_INODE_TO_AGINO(ip),
|
||||
XFS_ICI_BLOCKGC_TAG);
|
||||
|
||||
spin_unlock(&pag->pag_ici_lock);
|
||||
|
|
@ -1510,7 +1512,7 @@ xfs_blockgc_igrab(
|
|||
|
||||
/* Check for stale RCU freed inode */
|
||||
spin_lock(&ip->i_flags_lock);
|
||||
if (!ip->i_ino)
|
||||
if (!I_INO(ip))
|
||||
goto out_unlock_noent;
|
||||
|
||||
if (ip->i_flags & XFS_BLOCKGC_NOGRAB_IFLAGS)
|
||||
|
|
@ -1802,10 +1804,10 @@ xfs_icwalk_ag(
|
|||
* us to see this inode, so another lookup from the
|
||||
* same index will not find it again.
|
||||
*/
|
||||
if (XFS_INO_TO_AGNO(mp, ip->i_ino) != pag_agno(pag))
|
||||
if (XFS_INODE_TO_AGNO(ip) != pag_agno(pag))
|
||||
continue;
|
||||
first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1);
|
||||
if (first_index < XFS_INO_TO_AGINO(mp, ip->i_ino))
|
||||
first_index = XFS_INO_TO_AGINO(mp, I_INO(ip) + 1);
|
||||
if (first_index < XFS_INODE_TO_AGINO(ip))
|
||||
done = true;
|
||||
}
|
||||
|
||||
|
|
@ -1892,7 +1894,7 @@ xfs_check_delalloc(
|
|||
if (isnullstartblock(got.br_startblock)) {
|
||||
xfs_warn(ip->i_mount,
|
||||
"ino %llx %s fork has delalloc extent at [0x%llx:0x%llx]",
|
||||
ip->i_ino,
|
||||
I_INO(ip),
|
||||
whichfork == XFS_DATA_FORK ? "data" : "cow",
|
||||
got.br_startoff, got.br_blockcount);
|
||||
}
|
||||
|
|
@ -1916,14 +1918,14 @@ xfs_inodegc_set_reclaimable(
|
|||
ASSERT(0);
|
||||
}
|
||||
|
||||
pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
|
||||
pag = xfs_perag_get(mp, XFS_INODE_TO_AGNO(ip));
|
||||
spin_lock(&pag->pag_ici_lock);
|
||||
spin_lock(&ip->i_flags_lock);
|
||||
|
||||
trace_xfs_inode_set_reclaimable(ip);
|
||||
ip->i_flags &= ~(XFS_NEED_INACTIVE | XFS_INACTIVATING);
|
||||
ip->i_flags |= XFS_IRECLAIMABLE;
|
||||
xfs_perag_set_inode_tag(pag, XFS_INO_TO_AGINO(mp, ip->i_ino),
|
||||
xfs_perag_set_inode_tag(pag, XFS_INODE_TO_AGINO(ip),
|
||||
XFS_ICI_RECLAIM_TAG);
|
||||
|
||||
spin_unlock(&ip->i_flags_lock);
|
||||
|
|
|
|||
|
|
@ -495,9 +495,9 @@ xfs_lock_two_inodes(
|
|||
ASSERT(!(ip1_mode & (XFS_IOLOCK_SHARED|XFS_IOLOCK_EXCL)));
|
||||
ASSERT(!(ip0_mode & (XFS_MMAPLOCK_SHARED|XFS_MMAPLOCK_EXCL)));
|
||||
ASSERT(!(ip1_mode & (XFS_MMAPLOCK_SHARED|XFS_MMAPLOCK_EXCL)));
|
||||
ASSERT(ip0->i_ino != ip1->i_ino);
|
||||
ASSERT(I_INO(ip0) != I_INO(ip1));
|
||||
|
||||
if (ip0->i_ino > ip1->i_ino) {
|
||||
if (I_INO(ip0) > I_INO(ip1)) {
|
||||
swap(ip0, ip1);
|
||||
swap(ip0_mode, ip1_mode);
|
||||
}
|
||||
|
|
@ -1357,7 +1357,7 @@ xfs_inactive_health(
|
|||
if (sick & XFS_SICK_INO_FORGET)
|
||||
return;
|
||||
|
||||
pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
|
||||
pag = xfs_perag_get(mp, XFS_INODE_TO_AGNO(ip));
|
||||
if (!pag) {
|
||||
/* There had better still be a perag structure! */
|
||||
ASSERT(0);
|
||||
|
|
@ -1380,7 +1380,7 @@ int
|
|||
xfs_inactive(
|
||||
xfs_inode_t *ip)
|
||||
{
|
||||
struct xfs_mount *mp;
|
||||
struct xfs_mount *mp = ip->i_mount;
|
||||
int error = 0;
|
||||
int truncate = 0;
|
||||
|
||||
|
|
@ -1393,7 +1393,20 @@ xfs_inactive(
|
|||
goto out;
|
||||
}
|
||||
|
||||
mp = ip->i_mount;
|
||||
/*
|
||||
* If the filesystem has been shut down - for example a mount that
|
||||
* failed after background inactivation was enabled - do not
|
||||
* inactivate the inode. Inactivation modifies persistent metadata,
|
||||
* its transactions cannot complete on a shut down mount, and the
|
||||
* subsystems it relies on (e.g. quota, mp->m_quotainfo) may not be
|
||||
* set up. The attached dquots are dropped at the out: label and the
|
||||
* inode then goes straight to reclaim, the same way
|
||||
* xfs_inode_needs_inactive() already declines to inactivate on a shut
|
||||
* down mount at queue time.
|
||||
*/
|
||||
if (xfs_is_shutdown(mp))
|
||||
goto out;
|
||||
|
||||
ASSERT(!xfs_iflags_test(ip, XFS_IRECOVERY));
|
||||
|
||||
xfs_inactive_health(ip);
|
||||
|
|
@ -1513,7 +1526,7 @@ xfs_iunlink_lookup(
|
|||
* Inode in RCU freeing limbo should not happen. Warn about this and
|
||||
* let the caller handle the failure.
|
||||
*/
|
||||
if (WARN_ON_ONCE(!ip->i_ino)) {
|
||||
if (WARN_ON_ONCE(!I_INO(ip))) {
|
||||
rcu_read_unlock();
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -1614,7 +1627,7 @@ xfs_ifree_mark_inode_stale(
|
|||
* valid, the wrong inode or stale.
|
||||
*/
|
||||
spin_lock(&ip->i_flags_lock);
|
||||
if (ip->i_ino != inum || __xfs_iflags_test(ip, XFS_ISTALE))
|
||||
if (I_INO(ip) != inum || __xfs_iflags_test(ip, XFS_ISTALE))
|
||||
goto out_iflags_unlock;
|
||||
|
||||
/*
|
||||
|
|
@ -1796,7 +1809,7 @@ xfs_ifree(
|
|||
ASSERT(ip->i_disk_size == 0 || !S_ISREG(VFS_I(ip)->i_mode));
|
||||
ASSERT(ip->i_nblocks == 0);
|
||||
|
||||
pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
|
||||
pag = xfs_perag_get(mp, XFS_INODE_TO_AGNO(ip));
|
||||
|
||||
error = xfs_inode_uninit(tp, pag, ip, &xic);
|
||||
if (error)
|
||||
|
|
@ -2055,7 +2068,7 @@ xfs_sort_inodes(
|
|||
*/
|
||||
for (i = 0; i < num_inodes; i++) {
|
||||
for (j = 1; j < num_inodes; j++) {
|
||||
if (i_tab[j]->i_ino < i_tab[j-1]->i_ino)
|
||||
if (I_INO(i_tab[j]) < I_INO(i_tab[j-1]))
|
||||
swap(i_tab[j], i_tab[j - 1]);
|
||||
}
|
||||
}
|
||||
|
|
@ -2305,8 +2318,7 @@ xfs_rename(
|
|||
struct xfs_perag *pag;
|
||||
struct xfs_buf *bp;
|
||||
|
||||
pag = xfs_perag_get(mp,
|
||||
XFS_INO_TO_AGNO(mp, inodes[i]->i_ino));
|
||||
pag = xfs_perag_get(mp, XFS_INODE_TO_AGNO(inodes[i]));
|
||||
error = xfs_read_agi(pag, tp, 0, &bp);
|
||||
xfs_perag_put(pag);
|
||||
if (error)
|
||||
|
|
@ -2387,7 +2399,7 @@ xfs_iflush(
|
|||
XFS_TEST_ERROR(mp, XFS_ERRTAG_IFLUSH_1)) {
|
||||
xfs_alert_tag(mp, XFS_PTAG_IFLUSH,
|
||||
"%s: Bad inode %llu magic number 0x%x, ptr "PTR_FMT,
|
||||
__func__, ip->i_ino, be16_to_cpu(dip->di_magic), dip);
|
||||
__func__, I_INO(ip), be16_to_cpu(dip->di_magic), dip);
|
||||
goto flush_out;
|
||||
}
|
||||
if (ip->i_df.if_format == XFS_DINODE_FMT_META_BTREE) {
|
||||
|
|
@ -2396,7 +2408,7 @@ xfs_iflush(
|
|||
xfs_alert_tag(mp, XFS_PTAG_IFLUSH,
|
||||
"%s: Bad %s meta btree inode %Lu, ptr "PTR_FMT,
|
||||
__func__, xfs_metafile_type_str(ip->i_metatype),
|
||||
ip->i_ino, ip);
|
||||
I_INO(ip), ip);
|
||||
goto flush_out;
|
||||
}
|
||||
} else if (S_ISREG(VFS_I(ip)->i_mode)) {
|
||||
|
|
@ -2405,7 +2417,7 @@ xfs_iflush(
|
|||
XFS_TEST_ERROR(mp, XFS_ERRTAG_IFLUSH_3)) {
|
||||
xfs_alert_tag(mp, XFS_PTAG_IFLUSH,
|
||||
"%s: Bad regular inode %llu, ptr "PTR_FMT,
|
||||
__func__, ip->i_ino, ip);
|
||||
__func__, I_INO(ip), ip);
|
||||
goto flush_out;
|
||||
}
|
||||
} else if (S_ISDIR(VFS_I(ip)->i_mode)) {
|
||||
|
|
@ -2415,7 +2427,7 @@ xfs_iflush(
|
|||
XFS_TEST_ERROR(mp, XFS_ERRTAG_IFLUSH_4)) {
|
||||
xfs_alert_tag(mp, XFS_PTAG_IFLUSH,
|
||||
"%s: Bad directory inode %llu, ptr "PTR_FMT,
|
||||
__func__, ip->i_ino, ip);
|
||||
__func__, I_INO(ip), ip);
|
||||
goto flush_out;
|
||||
}
|
||||
}
|
||||
|
|
@ -2424,7 +2436,7 @@ xfs_iflush(
|
|||
xfs_alert_tag(mp, XFS_PTAG_IFLUSH,
|
||||
"%s: detected corrupt incore inode %llu, "
|
||||
"total extents = %llu nblocks = %lld, ptr "PTR_FMT,
|
||||
__func__, ip->i_ino,
|
||||
__func__, I_INO(ip),
|
||||
ip->i_df.if_nextents + xfs_ifork_nextents(&ip->i_af),
|
||||
ip->i_nblocks, ip);
|
||||
goto flush_out;
|
||||
|
|
@ -2433,7 +2445,7 @@ xfs_iflush(
|
|||
XFS_TEST_ERROR(mp, XFS_ERRTAG_IFLUSH_6)) {
|
||||
xfs_alert_tag(mp, XFS_PTAG_IFLUSH,
|
||||
"%s: bad inode %llu, forkoff 0x%x, ptr "PTR_FMT,
|
||||
__func__, ip->i_ino, ip->i_forkoff, ip);
|
||||
__func__, I_INO(ip), ip->i_forkoff, ip);
|
||||
goto flush_out;
|
||||
}
|
||||
|
||||
|
|
@ -2441,7 +2453,7 @@ xfs_iflush(
|
|||
ip->i_af.if_format == XFS_DINODE_FMT_META_BTREE) {
|
||||
xfs_alert_tag(mp, XFS_PTAG_IFLUSH,
|
||||
"%s: meta btree in inode %Lu attr fork, ptr "PTR_FMT,
|
||||
__func__, ip->i_ino, ip);
|
||||
__func__, I_INO(ip), ip);
|
||||
goto flush_out;
|
||||
}
|
||||
|
||||
|
|
@ -2741,7 +2753,7 @@ xfs_mmaplock_two_inodes_and_break_dax_layout(
|
|||
{
|
||||
int error;
|
||||
|
||||
if (ip1->i_ino > ip2->i_ino)
|
||||
if (I_INO(ip1) > I_INO(ip2))
|
||||
swap(ip1, ip2);
|
||||
|
||||
again:
|
||||
|
|
@ -2853,8 +2865,8 @@ xfs_inode_reload_unlinked_bucket(
|
|||
struct xfs_buf *agibp;
|
||||
struct xfs_agi *agi;
|
||||
struct xfs_perag *pag;
|
||||
xfs_agnumber_t agno = XFS_INO_TO_AGNO(mp, ip->i_ino);
|
||||
xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ip->i_ino);
|
||||
xfs_agnumber_t agno = XFS_INODE_TO_AGNO(ip);
|
||||
xfs_agino_t agino = XFS_INODE_TO_AGINO(ip);
|
||||
xfs_agino_t prev_agino, next_agino;
|
||||
unsigned int bucket;
|
||||
bool foundit = false;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ typedef struct xfs_inode {
|
|||
struct xfs_dquot *i_pdquot; /* project dquot */
|
||||
|
||||
/* Inode location stuff */
|
||||
xfs_ino_t i_ino; /* inode number (agno/agino)*/
|
||||
struct xfs_imap i_imap; /* location for xfs_imap() */
|
||||
|
||||
/* Extent information. */
|
||||
|
|
@ -184,6 +183,11 @@ static inline const struct inode *VFS_IC(const struct xfs_inode *ip)
|
|||
return &ip->i_vnode;
|
||||
}
|
||||
|
||||
static inline xfs_ino_t I_INO(const struct xfs_inode *ip)
|
||||
{
|
||||
return VFS_IC(ip)->i_ino;
|
||||
}
|
||||
|
||||
/*
|
||||
* For regular files we only update the on-disk filesize when actually
|
||||
* writing data back to disk. Until then only the copy in the VFS inode
|
||||
|
|
@ -299,9 +303,9 @@ static inline bool xfs_is_internal_inode(const struct xfs_inode *ip)
|
|||
* Before metadata directories, the only metadata inodes were the
|
||||
* three quota files, the realtime bitmap, and the realtime summary.
|
||||
*/
|
||||
return ip->i_ino == mp->m_sb.sb_rbmino ||
|
||||
ip->i_ino == mp->m_sb.sb_rsumino ||
|
||||
xfs_is_quota_inode(&mp->m_sb, ip->i_ino);
|
||||
return I_INO(ip) == mp->m_sb.sb_rbmino ||
|
||||
I_INO(ip) == mp->m_sb.sb_rsumino ||
|
||||
xfs_is_quota_inode(&mp->m_sb, I_INO(ip));
|
||||
}
|
||||
|
||||
static inline bool xfs_is_zoned_inode(const struct xfs_inode *ip)
|
||||
|
|
@ -630,13 +634,6 @@ static inline void xfs_finish_inode_setup(struct xfs_inode *ip)
|
|||
unlock_new_inode(VFS_I(ip));
|
||||
}
|
||||
|
||||
static inline void xfs_setup_existing_inode(struct xfs_inode *ip)
|
||||
{
|
||||
xfs_setup_inode(ip);
|
||||
xfs_setup_iops(ip);
|
||||
xfs_finish_inode_setup(ip);
|
||||
}
|
||||
|
||||
void xfs_irele(struct xfs_inode *ip);
|
||||
|
||||
extern struct kmem_cache *xfs_inode_cache;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#include "xfs_buf_item.h"
|
||||
#include "xfs_log.h"
|
||||
#include "xfs_log_priv.h"
|
||||
#include "xfs_ag.h"
|
||||
#include "xfs_error.h"
|
||||
#include "xfs_rtbitmap.h"
|
||||
|
||||
|
|
@ -34,7 +35,7 @@ static uint64_t
|
|||
xfs_inode_item_sort(
|
||||
struct xfs_log_item *lip)
|
||||
{
|
||||
return INODE_ITEM(lip)->ili_inode->i_ino;
|
||||
return I_INO(INODE_ITEM(lip)->ili_inode);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_EXPENSIVE
|
||||
|
|
@ -54,7 +55,7 @@ xfs_inode_item_precommit_check(
|
|||
|
||||
xfs_inode_to_disk(ip, dip, 0);
|
||||
xfs_dinode_calc_crc(mp, dip);
|
||||
fa = xfs_dinode_verify(mp, ip->i_ino, dip);
|
||||
fa = xfs_dinode_verify(mp, I_INO(ip), dip);
|
||||
if (fa) {
|
||||
xfs_inode_verifier_error(ip, -EFSCORRUPTED, __func__, dip,
|
||||
sizeof(*dip), fa);
|
||||
|
|
@ -104,6 +105,7 @@ xfs_inode_item_precommit(
|
|||
{
|
||||
struct xfs_inode_log_item *iip = INODE_ITEM(lip);
|
||||
struct xfs_inode *ip = iip->ili_inode;
|
||||
struct xfs_mount *mp = ip->i_mount;
|
||||
struct inode *inode = VFS_I(ip);
|
||||
unsigned int flags = iip->ili_dirty_flags;
|
||||
|
||||
|
|
@ -124,8 +126,7 @@ xfs_inode_item_precommit(
|
|||
* to upgrade this inode to bigtime format, do so now.
|
||||
*/
|
||||
if ((flags & (XFS_ILOG_CORE | XFS_ILOG_TIMESTAMP)) &&
|
||||
xfs_has_bigtime(ip->i_mount) &&
|
||||
!xfs_inode_has_bigtime(ip)) {
|
||||
xfs_has_bigtime(mp) && !xfs_inode_has_bigtime(ip)) {
|
||||
ip->i_diflags2 |= XFS_DIFLAG2_BIGTIME;
|
||||
flags |= XFS_ILOG_CORE;
|
||||
}
|
||||
|
|
@ -138,14 +139,14 @@ xfs_inode_item_precommit(
|
|||
*/
|
||||
if (ip->i_diflags & XFS_DIFLAG_RTINHERIT) {
|
||||
if ((ip->i_diflags & XFS_DIFLAG_EXTSZINHERIT) &&
|
||||
xfs_extlen_to_rtxmod(ip->i_mount, ip->i_extsize) > 0) {
|
||||
xfs_extlen_to_rtxmod(mp, ip->i_extsize) > 0) {
|
||||
ip->i_diflags &= ~(XFS_DIFLAG_EXTSIZE |
|
||||
XFS_DIFLAG_EXTSZINHERIT);
|
||||
ip->i_extsize = 0;
|
||||
flags |= XFS_ILOG_CORE;
|
||||
}
|
||||
if ((ip->i_diflags2 & XFS_DIFLAG2_COWEXTSIZE) &&
|
||||
xfs_extlen_to_rtxmod(ip->i_mount, ip->i_cowextsize) > 0) {
|
||||
xfs_extlen_to_rtxmod(mp, ip->i_cowextsize) > 0) {
|
||||
ip->i_diflags2 &= ~XFS_DIFLAG2_COWEXTSIZE;
|
||||
ip->i_cowextsize = 0;
|
||||
flags |= XFS_ILOG_CORE;
|
||||
|
|
@ -154,6 +155,7 @@ xfs_inode_item_precommit(
|
|||
|
||||
spin_lock(&iip->ili_lock);
|
||||
if (!iip->ili_item.li_buf) {
|
||||
struct xfs_perag *pag;
|
||||
struct xfs_buf *bp;
|
||||
int error;
|
||||
|
||||
|
|
@ -167,7 +169,9 @@ xfs_inode_item_precommit(
|
|||
* here.
|
||||
*/
|
||||
spin_unlock(&iip->ili_lock);
|
||||
error = xfs_imap_to_bp(ip->i_mount, tp, &ip->i_imap, &bp);
|
||||
pag = xfs_perag_get(mp, XFS_INODE_TO_AGNO(ip));
|
||||
error = xfs_read_icluster(pag, tp, ip->i_imap.im_agbno, &bp);
|
||||
xfs_perag_put(pag);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
|
@ -588,7 +592,7 @@ xfs_inode_to_log_dinode(
|
|||
to->di_flags2 = ip->i_diflags2;
|
||||
/* also covers the di_used_blocks union arm: */
|
||||
to->di_cowextsize = ip->i_cowextsize;
|
||||
to->di_ino = ip->i_ino;
|
||||
to->di_ino = I_INO(ip);
|
||||
to->di_lsn = lsn;
|
||||
memset(to->di_pad2, 0, sizeof(to->di_pad2));
|
||||
uuid_copy(&to->di_uuid, &ip->i_mount->m_sb.sb_meta_uuid);
|
||||
|
|
@ -647,13 +651,15 @@ xfs_inode_item_format(
|
|||
{
|
||||
struct xfs_inode_log_item *iip = INODE_ITEM(lip);
|
||||
struct xfs_inode *ip = iip->ili_inode;
|
||||
struct xfs_mount *mp = ip->i_mount;
|
||||
struct xfs_inode_log_format *ilf;
|
||||
|
||||
ilf = xlog_format_start(lfb, XLOG_REG_TYPE_IFORMAT);
|
||||
ilf->ilf_type = XFS_LI_INODE;
|
||||
ilf->ilf_ino = ip->i_ino;
|
||||
ilf->ilf_blkno = ip->i_imap.im_blkno;
|
||||
ilf->ilf_len = ip->i_imap.im_len;
|
||||
ilf->ilf_ino = I_INO(ip);
|
||||
ilf->ilf_blkno = XFS_AGB_TO_DADDR(mp, XFS_INODE_TO_AGNO(ip),
|
||||
ip->i_imap.im_agbno);
|
||||
ilf->ilf_len = XFS_FSB_TO_BB(mp, M_IGEO(mp)->blocks_per_cluster);
|
||||
ilf->ilf_boffset = ip->i_imap.im_boffset;
|
||||
ilf->ilf_fields = XFS_ILOG_CORE;
|
||||
ilf->ilf_size = 2; /* format + core */
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ xfs_recover_inode_owner_change(
|
|||
if (in_f->ilf_fields & XFS_ILOG_DOWNER) {
|
||||
ASSERT(in_f->ilf_fields & XFS_ILOG_DBROOT);
|
||||
error = xfs_bmbt_change_owner(NULL, ip, XFS_DATA_FORK,
|
||||
ip->i_ino, buffer_list);
|
||||
I_INO(ip), buffer_list);
|
||||
if (error)
|
||||
goto out_free_ip;
|
||||
}
|
||||
|
|
@ -107,7 +107,7 @@ xfs_recover_inode_owner_change(
|
|||
if (in_f->ilf_fields & XFS_ILOG_AOWNER) {
|
||||
ASSERT(in_f->ilf_fields & XFS_ILOG_ABROOT);
|
||||
error = xfs_bmbt_change_owner(NULL, ip, XFS_ATTR_FORK,
|
||||
ip->i_ino, buffer_list);
|
||||
I_INO(ip), buffer_list);
|
||||
if (error)
|
||||
goto out_free_ip;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1005,7 +1005,7 @@ xfs_ioc_swapext(
|
|||
if (ip->i_mount != tip->i_mount)
|
||||
return -EINVAL;
|
||||
|
||||
if (ip->i_ino == tip->i_ino)
|
||||
if (I_INO(ip) == I_INO(tip))
|
||||
return -EINVAL;
|
||||
|
||||
if (xfs_is_shutdown(ip->i_mount))
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ xfs_alert_fsblock_zero(
|
|||
"Access to block zero in inode %llu "
|
||||
"start_block: %llx start_off: %llx "
|
||||
"blkcnt: %llx extent-state: %x",
|
||||
(unsigned long long)ip->i_ino,
|
||||
(unsigned long long)I_INO(ip),
|
||||
(unsigned long long)imap->br_startblock,
|
||||
(unsigned long long)imap->br_startoff,
|
||||
(unsigned long long)imap->br_blockcount,
|
||||
|
|
@ -113,6 +113,7 @@ xfs_bmbt_to_iomap(
|
|||
return xfs_alert_fsblock_zero(ip, imap);
|
||||
}
|
||||
|
||||
iomap->flags = iomap_flags;
|
||||
if (imap->br_startblock == HOLESTARTBLOCK) {
|
||||
iomap->addr = IOMAP_NULL_ADDR;
|
||||
iomap->type = IOMAP_HOLE;
|
||||
|
|
@ -143,7 +144,6 @@ xfs_bmbt_to_iomap(
|
|||
}
|
||||
iomap->offset = XFS_FSB_TO_B(mp, imap->br_startoff);
|
||||
iomap->length = XFS_FSB_TO_B(mp, imap->br_blockcount);
|
||||
iomap->flags = iomap_flags;
|
||||
if (mapping_flags & IOMAP_DAX) {
|
||||
iomap->dax_dev = target->bt_daxdev;
|
||||
} else {
|
||||
|
|
@ -1736,7 +1736,7 @@ xfs_zoned_buffered_write_iomap_begin(
|
|||
if (count_fsb > ac->reserved_blocks) {
|
||||
xfs_warn_ratelimited(mp,
|
||||
"Short write on ino 0x%llx comm %.20s due to three-way race with write fault and direct I/O",
|
||||
ip->i_ino, current->comm);
|
||||
I_INO(ip), current->comm);
|
||||
count_fsb = ac->reserved_blocks;
|
||||
if (!count_fsb) {
|
||||
error = -EIO;
|
||||
|
|
|
|||
|
|
@ -703,7 +703,7 @@ xfs_vn_getattr(
|
|||
stat->nlink = inode->i_nlink;
|
||||
stat->uid = vfsuid_into_kuid(vfsuid);
|
||||
stat->gid = vfsgid_into_kgid(vfsgid);
|
||||
stat->ino = ip->i_ino;
|
||||
stat->ino = inode->i_ino;
|
||||
stat->atime = inode_get_atime(inode);
|
||||
|
||||
fill_mg_cmtime(stat, request_mask, inode);
|
||||
|
|
@ -1423,7 +1423,6 @@ xfs_setup_inode(
|
|||
gfp_t gfp_mask;
|
||||
bool is_meta = xfs_is_internal_inode(ip);
|
||||
|
||||
inode->i_ino = ip->i_ino;
|
||||
inode_state_set_raw(inode, I_NEW);
|
||||
|
||||
inode_sb_list_add(inode);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user