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);
struct xfs_da_args args = {
.trans = tp,
.dp = dp,
- .owner = dp->i_ino,
+ .owner = I_INO(dp),
.geo = dp->i_mount->m_attr_geo,
};
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);
}
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,
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);
{
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));
}
/*
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;
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:
*/
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);
*/
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);
/* 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;
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,
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;
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;
}
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);
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;
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;
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;
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;
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;
* 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)
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;
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;
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;
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;
* 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;
* 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;
* 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;
* 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;
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) {
* 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.
*/
* 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;
.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;
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;
.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;
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;
#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, (ip)->i_ino)
+ 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, (ip)->i_ino)
+ 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)))
#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, (ip)->i_ino)
+ 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))
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;
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);
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);
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),
*/
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);
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);
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)
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);
* 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;
.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;
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);
}
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);
}
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);
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);
}
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;
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. */
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);
}
/*
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. */
oi->oi_flags |= XFS_OWNER_INFO_ATTR_FORK;
}
#define xfs_rmap_inode_bmbt_owner(oi, ip, whichfork) \
- xfs_rmap_ino_bmbt_owner(oi, (ip)->i_ino, whichfork)
+ xfs_rmap_ino_bmbt_owner(oi, I_INO(ip), whichfork)
static inline void
xfs_rmap_ino_owner(
oi->oi_flags |= XFS_OWNER_INFO_ATTR_FORK;
}
#define xfs_rmap_inode_owner(oi, ip, whichfork, offset) \
- xfs_rmap_ino_owner(oi, (ip)->i_ino, whichfork, offset)
+ xfs_rmap_ino_owner(oi, I_INO(ip), whichfork, offset)
static inline bool
xfs_rmap_should_skip_owner_update(
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);
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);
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;
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;
}
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;
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;
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);
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;
*/
if (XFS_INODE_TO_AGNO(ip) != pag_agno(pag))
continue;
- first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1);
+ first_index = XFS_INO_TO_AGINO(mp, I_INO(ip) + 1);
if (first_index < XFS_INODE_TO_AGINO(ip))
done = true;
}
.namelen = namelen,
.trans = sc->tp,
.valuelen = valuelen,
- .owner = ip->i_ino,
+ .owner = I_INO(ip),
};
struct xchk_xattr_buf *ab;
int error = 0;
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;
}
.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,
* 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);
/*
.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,
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",
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;
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;
* 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);
.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);
{
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;
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);
}
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))
*/
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;
}
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);
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);
struct xfs_inode *ip)
{
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
- trace_xchk_ino_error(sc, ip->i_ino, __return_address);
+ trace_xchk_ino_error(sc, I_INO(ip), __return_address);
}
/* Record corruption in a block indexed by a file fork. */
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);
/*
* 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);
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? */
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
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), (_ip)->i_ino)
+ 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
/* 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);
}
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;
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);
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);
}
/* 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))
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);
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);
.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;
*/
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;
}
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)
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;
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:
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)
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;
}
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. */
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;
}
/* 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
* 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;
* 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,
.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);
* 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;
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;
* 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;
* 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;
}
* 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;
/*
* 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;
* 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);
* 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);
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);
*/
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;
/*
* 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;
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. */
/* 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;
}
* 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;
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;
}
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)
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));
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;
{
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));
}
}
/* 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;
* 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;
}
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;
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);
}
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;
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;
}
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;
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;
}
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_ip_set_corrupt(sc, sc->ip);
}
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);
}
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;
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);
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;
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);
/*
* 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)
* 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)
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;
}
* 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;
}
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;
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. */
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;
* 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;
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) {
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)
/* 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;
/* 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;
}
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))
.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;
/* 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;
}
/* 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;
}
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;
}
}
/* 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;
}
};
/* 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);
*/
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;
}
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)
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;
}
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);
}
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. */
* 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);
.namelen = namelen,
.trans = sc->tp,
.valuelen = valuelen,
- .owner = ip->i_ino,
+ .owner = I_INO(ip),
};
int error;
.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,
* 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)
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
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;
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;
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. */
.dp = dp,
.geo = dp->i_mount->m_dir_geo,
.trans = sc->tp,
- .owner = dp->i_ino,
+ .owner = I_INO(dp),
};
int error;
.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;
* 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);
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)
int whichfork)
{
struct xrep_rmap_ifork rf = {
- .accum = { .rm_owner = ip->i_ino, },
+ .accum = { .rm_owner = I_INO(ip), },
.rr = rr,
.whichfork = whichfork,
};
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);
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);
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);
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);
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);
* 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. */
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;
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);
}
/* 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);
}
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;
* 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;
}
),
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;
),
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;
),
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;
),
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;
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;
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);
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);
),
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;
),
),
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);
),
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);
),
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;
),
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;
),
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;
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);
__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);
),
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;
__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);
),
),
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);
),
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);
),
),
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;
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'",
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;
),
),
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;
),
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;
),
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),
),
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;
),
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;
),
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;
),
),
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);
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;
),
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),
),
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);
),
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;
),
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",
),
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;
),
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",
),
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",
),
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;
),
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);
),
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;
),
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),
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
* 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;
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)) {
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;
}
}
- 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;
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);
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);
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;
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;
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. */
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;
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)
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;
}
*/
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;
}
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);
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");
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;
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))
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);
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;
}
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);
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);
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
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;
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) {
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);
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,
*/
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;
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,
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;
*/
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);
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);
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);
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);
+ 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;
if (ip->i_nblocks != 0) {
xfs_warn(ip->i_mount,
"Corruption detected! Free inode 0x%llx has blocks allocated!",
- ip->i_ino);
+ I_INO(ip));
xfs_agno_mark_sick(ip->i_mount, XFS_INODE_TO_AGNO(ip),
XFS_SICK_AG_INOBT);
return -EFSCORRUPTED;
* 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;
/*
*/
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;
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;
*/
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);
/* 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)
*/
if (XFS_INODE_TO_AGNO(ip) != pag_agno(pag))
continue;
- first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1);
+ first_index = XFS_INO_TO_AGINO(mp, I_INO(ip) + 1);
if (first_index < XFS_INODE_TO_AGINO(ip))
done = true;
}
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);
}
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);
}
* 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;
}
* 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;
/*
*/
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]);
}
}
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) {
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)) {
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)) {
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;
}
}
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;
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;
}
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;
}
{
int error;
- if (ip1->i_ino > ip2->i_ino)
+ if (I_INO(ip1) > I_INO(ip2))
swap(ip1, ip2);
again:
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. */
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
* 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)
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
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);
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);
ilf = xlog_format_start(lfb, XLOG_REG_TYPE_IFORMAT);
ilf->ilf_type = XFS_LI_INODE;
- ilf->ilf_ino = ip->i_ino;
+ ilf->ilf_ino = I_INO(ip);
ilf->ilf_blkno = ip->i_imap.im_blkno;
ilf->ilf_len = ip->i_imap.im_len;
ilf->ilf_boffset = ip->i_imap.im_boffset;
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;
}
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;
}
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))
"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,
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;
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);
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);
xfs_iunlink_item_sort(
struct xfs_log_item *lip)
{
- return IUL_ITEM(lip)->ip->i_ino;
+ return I_INO(IUL_ITEM(lip)->ip);
}
/*
if (XFS_IS_CORRUPT(mp, !S_ISDIR(VFS_I(rip)->i_mode))) {
xfs_warn(mp, "corrupted root inode %llu: not a directory",
- (unsigned long long)rip->i_ino);
+ (unsigned long long)I_INO(rip));
xfs_iunlock(rip, XFS_ILOCK_EXCL);
error = -EFSCORRUPTED;
goto out_rele_rip;
return false;
if (!XFS_NOT_DQATTACHED(mp, ip))
return false;
- if (xfs_is_quota_inode(&mp->m_sb, ip->i_ino))
+ if (xfs_is_quota_inode(&mp->m_sb, I_INO(ip)))
return false;
if (xfs_is_metadir_inode(ip))
return false;
trace_xfs_dquot_dqdetach(ip);
- ASSERT(!xfs_is_quota_inode(&ip->i_mount->m_sb, ip->i_ino));
+ ASSERT(!xfs_is_quota_inode(&ip->i_mount->m_sb, I_INO(ip)));
if (ip->i_udquot) {
xfs_qm_dqrele(ip->i_udquot);
ip->i_udquot = NULL;
mp->m_sb.sb_qflags = mp->m_qflags & XFS_ALL_QUOTA_ACCT;
}
if (flags & XFS_QMOPT_UQUOTA)
- mp->m_sb.sb_uquotino = (*ipp)->i_ino;
+ mp->m_sb.sb_uquotino = I_INO(*ipp);
else if (flags & XFS_QMOPT_GQUOTA)
- mp->m_sb.sb_gquotino = (*ipp)->i_ino;
+ mp->m_sb.sb_gquotino = I_INO(*ipp);
else
- mp->m_sb.sb_pquotino = (*ipp)->i_ino;
+ mp->m_sb.sb_pquotino = I_INO(*ipp);
spin_unlock(&mp->m_sb_lock);
xfs_log_sb(tp);
defq = xfs_get_defquota(mp->m_quotainfo, type);
- tstate->ino = ip->i_ino;
+ tstate->ino = I_INO(ip);
tstate->flags |= QCI_SYSFILE;
tstate->blocks = ip->i_nblocks;
tstate->nextents = ip->i_df.if_nextents;
goto out_error;
/* Lock both files against IO */
- if (src->i_ino == dest->i_ino)
+ if (I_INO(src) == I_INO(dest))
xfs_ilock(src, XFS_ILOCK_EXCL);
else
xfs_lock_two_inodes(src, XFS_ILOCK_EXCL, dest, XFS_ILOCK_EXCL);
} else
xfs_iunlock(src, XFS_ILOCK_EXCL);
- if (src->i_ino == dest->i_ino)
+ if (I_INO(src) == I_INO(dest))
goto commit_flags;
if (!xfs_is_reflink_inode(dest)) {
if (pathlen < 0 || pathlen > XFS_SYMLINK_MAXLEN) {
xfs_alert(mp, "%s: inode (%llu) bad symlink length (%lld)",
- __func__, (unsigned long long) ip->i_ino,
+ __func__, (unsigned long long)I_INO(ip),
(long long) pathlen);
ASSERT(0);
goto out_corrupt;
xfs_qm_vop_create_dqattach(tp, du.ip, udqp, gdqp, pdqp);
resblks -= XFS_IALLOC_SPACE_RES(mp);
- error = xfs_symlink_write_target(tp, du.ip, du.ip->i_ino, target_path,
+ error = xfs_symlink_write_target(tp, du.ip, I_INO(du.ip), target_path,
pathlen, fs_blocks, resblks);
if (error)
goto out_trans_cancel;
if (pathlen <= 0 || pathlen > XFS_SYMLINK_MAXLEN) {
xfs_alert(mp, "%s: inode (0x%llx) bad symlink length (%d)",
- __func__, (unsigned long long)ip->i_ino, pathlen);
+ __func__, (unsigned long long)I_INO(ip), pathlen);
xfs_iunlock(ip, XFS_ILOCK_EXCL);
ASSERT(0);
xfs_inode_mark_sick(ip, XFS_SICK_INO_SYMLINK);
),
TP_fast_assign(
__entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
- __entry->ino = ctx->dp->i_ino;
+ __entry->ino = I_INO(ctx->dp);
__entry->hashval = ctx->cursor.hashval;
__entry->blkno = ctx->cursor.blkno;
__entry->offset = ctx->cursor.offset;
),
TP_fast_assign(
__entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
- __entry->ino = ctx->dp->i_ino;
+ __entry->ino = I_INO(ctx->dp);
__entry->hashval = ctx->cursor.hashval;
__entry->blkno = ctx->cursor.blkno;
__entry->offset = ctx->cursor.offset;
ifp = xfs_iext_state_to_fork(ip, state);
xfs_iext_get_extent(ifp, cur, &r);
__entry->dev = VFS_I(ip)->i_sb->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->leaf = cur->leaf;
__entry->pos = cur->pos;
__entry->startoff = r.br_startoff;
),
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->lock_flags = lock_flags;
__entry->caller_ip = caller_ip;
),
),
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;
),
TP_printk("dev %d:%d ino 0x%llx iflags 0x%lx",
),
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->order = order;
),
TP_printk("dev %d:%d ino 0x%llx order %u",
),
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->count = icount_read(VFS_I(ip));
__entry->pincount = atomic_read(&ip->i_pincount);
__entry->iflags = ip->i_flags;
),
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->blocks = blocks;
__entry->shift = shift;
__entry->writeio_blocks = writeio_blocks;
),
TP_fast_assign(
__entry->dev = VFS_I(dp)->i_sb->s_dev;
- __entry->dp_ino = dp->i_ino;
+ __entry->dp_ino = I_INO(dp);
__entry->namelen = name->len;
memcpy(__get_str(name), name->name, name->len);
),
),
TP_fast_assign(
__entry->dev = VFS_I(src_dp)->i_sb->s_dev;
- __entry->src_dp_ino = src_dp->i_ino;
- __entry->target_dp_ino = target_dp->i_ino;
+ __entry->src_dp_ino = I_INO(src_dp);
+ __entry->target_dp_ino = I_INO(target_dp);
__entry->src_namelen = src_name->len;
__entry->target_namelen = target_name->len;
memcpy(__get_str(src_name), src_name->name, src_name->len);
),
TP_fast_assign(
__entry->dev = file_inode(iocb->ki_filp)->i_sb->s_dev;
- __entry->ino = XFS_I(file_inode(iocb->ki_filp))->i_ino;
+ __entry->ino = file_inode(iocb->ki_filp)->i_ino;
__entry->size = XFS_I(file_inode(iocb->ki_filp))->i_disk_size;
__entry->offset = iocb->ki_pos;
__entry->count = iov_iter_count(iter);
),
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->offset = offset;
__entry->count = count;
),
),
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->size = ip->i_disk_size;
__entry->offset = offset;
__entry->count = count;
),
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->isize = VFS_I(ip)->i_size;
__entry->disize = ip->i_disk_size;
__entry->offset = offset;
),
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->size = ip->i_disk_size;
__entry->new_size = new_size;
),
),
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->size = ip->i_disk_size;
__entry->fileoff = fileoff;
__entry->len = len;
),
TP_fast_assign(
__entry->dev = VFS_I(args->dp)->i_sb->s_dev;
- __entry->ino = args->dp->i_ino;
+ __entry->ino = I_INO(args->dp);
if (args->namelen)
memcpy(__get_str(name), args->name, args->namelen);
__entry->namelen = args->namelen;
),
TP_fast_assign(
__entry->dev = VFS_I(args->dp)->i_sb->s_dev;
- __entry->ino = args->dp->i_ino;
+ __entry->ino = I_INO(args->dp);
if (args->namelen)
memcpy(__get_str(name), args->name, args->namelen);
__entry->namelen = args->namelen;
),
TP_fast_assign(
__entry->dev = VFS_I(args->dp)->i_sb->s_dev;
- __entry->ino = args->dp->i_ino;
+ __entry->ino = I_INO(args->dp);
__entry->op_flags = args->op_flags;
__entry->idx = idx;
),
),
TP_fast_assign(
__entry->dev = VFS_I(args->dp)->i_sb->s_dev;
- __entry->ino = args->dp->i_ino;
+ __entry->ino = I_INO(args->dp);
__entry->op_flags = args->op_flags;
__entry->src_idx = src_idx;
__entry->dst_idx = dst_idx;
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
__entry->which = which;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->format = ip->i_df.if_format;
__entry->nex = ip->i_df.if_nextents;
__entry->broot_size = ip->i_df.if_broot_bytes;
switch (cur->bc_ops->type) {
case XFS_BTREE_TYPE_INODE:
__entry->agno = 0;
- __entry->ino = cur->bc_ino.ip->i_ino;
+ __entry->ino = I_INO(cur->bc_ino.ip);
break;
case XFS_BTREE_TYPE_AG:
__entry->agno = cur->bc_group->xg_gno;
__entry->agno = xfs_daddr_to_agno(cur->bc_mp,
xfs_buf_daddr(bp));
if (cur->bc_ops->type == XFS_BTREE_TYPE_INODE)
- __entry->ino = cur->bc_ino.ip->i_ino;
+ __entry->ino = I_INO(cur->bc_ino.ip);
else
__entry->ino = 0;
__assign_str(name);
switch (cur->bc_ops->type) {
case XFS_BTREE_TYPE_INODE:
__entry->agno = 0;
- __entry->ino = cur->bc_ino.ip->i_ino;
+ __entry->ino = I_INO(cur->bc_ino.ip);
break;
case XFS_BTREE_TYPE_AG:
__entry->agno = cur->bc_group->xg_gno;
bi->bi_bmap.br_startblock,
bi->bi_group->xg_type);
}
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->whichfork = bi->bi_whichfork;
__entry->l_loff = bi->bi_bmap.br_startoff;
__entry->l_len = bi->bi_bmap.br_blockcount;
),
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->error = error;
__entry->caller_ip = caller_ip;
),
),
TP_fast_assign(
__entry->dev = VFS_I(src)->i_sb->s_dev;
- __entry->src_ino = src->i_ino;
+ __entry->src_ino = I_INO(src);
__entry->src_isize = VFS_I(src)->i_size;
__entry->src_disize = src->i_disk_size;
__entry->src_offset = soffset;
__entry->len = len;
- __entry->dest_ino = dest->i_ino;
+ __entry->dest_ino = I_INO(dest);
__entry->dest_isize = VFS_I(dest)->i_size;
__entry->dest_disize = dest->i_disk_size;
__entry->dest_offset = doffset;
),
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->lblk = irec->br_startoff;
__entry->len = irec->br_blockcount;
__entry->pblk = irec->br_startblock;
),
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->addr = iomap->addr;
__entry->pos = iomap->offset;
__entry->len = iomap->length;
),
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->addr = iomap->addr;
__entry->pos = iomap->offset;
__entry->len = iomap->length;
),
TP_fast_assign(
__entry->dev = VFS_I(src)->i_sb->s_dev;
- __entry->src_ino = src->i_ino;
+ __entry->src_ino = I_INO(src);
__entry->src_lblk = soffset;
__entry->len = len;
- __entry->dest_ino = dest->i_ino;
+ __entry->dest_ino = I_INO(dest);
__entry->dest_lblk = doffset;
),
TP_printk("dev %d:%d fsbcount 0x%llx "
),
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;
),
TP_printk("dev %d:%d ino 0x%llx flags 0x%x",
),
TP_fast_assign(
__entry->das = das;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
),
TP_printk("state change %s ino 0x%llx",
__print_symbolic(__entry->das, XFS_DAS_STRINGS),
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
__entry->whichfile = whichfile;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->format = ip->i_df.if_format;
__entry->nex = ip->i_df.if_nextents;
__entry->fork_off = xfs_inode_fork_boff(ip);
),
TP_fast_assign(
__entry->dev = VFS_I(ip1)->i_sb->s_dev;
- __entry->ip1_ino = ip1->i_ino;
+ __entry->ip1_ino = I_INO(ip1);
__entry->ip1_isize = VFS_I(ip1)->i_size;
__entry->ip1_disize = ip1->i_disk_size;
- __entry->ip2_ino = ip2->i_ino;
+ __entry->ip2_ino = I_INO(ip2);
__entry->ip2_isize = VFS_I(ip2)->i_size;
__entry->ip2_disize = ip2->i_disk_size;
struct inode *inode2 = VFS_I(ip2);
__entry->dev = inode2->i_sb->s_dev;
- __entry->ip2_ino = ip2->i_ino;
+ __entry->ip2_ino = I_INO(ip2);
ts64 = inode_get_ctime(inode2);
__entry->ip2_ctime = ts64.tv_sec;
),
TP_fast_assign(
__entry->dev = req->ip1->i_mount->m_super->s_dev;
- __entry->ino1 = req->ip1->i_ino;
- __entry->ino2 = req->ip2->i_ino;
+ __entry->ino1 = I_INO(req->ip1);
+ __entry->ino2 = I_INO(req->ip2);
__entry->startoff1 = req->startoff1;
__entry->startoff2 = req->startoff2;
__entry->blockcount = req->blockcount;
),
TP_fast_assign(
__entry->dev = mp->m_super->s_dev;
- __entry->ino1 = xmi->xmi_ip1->i_ino;
- __entry->ino2 = xmi->xmi_ip2->i_ino;
+ __entry->ino1 = I_INO(xmi->xmi_ip1);
+ __entry->ino2 = I_INO(xmi->xmi_ip2);
__entry->flags = xmi->xmi_flags;
__entry->startoff1 = xmi->xmi_startoff1;
__entry->startoff2 = xmi->xmi_startoff2;
int whichfork = xfs_exchmaps_reqfork(req);
__entry->dev = req->ip1->i_mount->m_super->s_dev;
- __entry->ino1 = req->ip1->i_ino;
- __entry->ino2 = req->ip2->i_ino;
+ __entry->ino1 = I_INO(req->ip1);
+ __entry->ino2 = I_INO(req->ip2);
__entry->nexts1 = xfs_ifork_ptr(req->ip1, whichfork)->if_nextents;
__entry->nexts2 = xfs_ifork_ptr(req->ip2, whichfork)->if_nextents;
__entry->d_nexts1 = d_nexts1;
),
TP_fast_assign(
__entry->dev = ip->i_mount->m_super->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->firstu = context->firstu;
__entry->reclen = pptr->gpr_reclen;
__entry->bufsize = ppi->gp_bufsize;
),
TP_fast_assign(
__entry->dev = ip->i_mount->m_super->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
__entry->iflags = ppi->gp_iflags;
__entry->oflags = ppi->gp_oflags;
__entry->bufsize = ppi->gp_bufsize;
),
TP_fast_assign(
__entry->dev = upd->dp->i_mount->m_super->s_dev;
- __entry->dp_ino = upd->dp->i_ino;
- __entry->ino = upd->ip ? upd->ip->i_ino : NULLFSINO;
+ __entry->dp_ino = I_INO(upd->dp);
+ __entry->ino = upd->ip ? I_INO(upd->ip) : NULLFSINO;
__assign_str(fname);
),
TP_printk("dev %d:%d dp 0x%llx fname '%s' ino 0x%llx",
),
TP_fast_assign(
__entry->dev = upd->dp->i_mount->m_super->s_dev;
- __entry->dp_ino = upd->dp->i_ino;
- __entry->ino = upd->ip ? upd->ip->i_ino : NULLFSINO;
+ __entry->dp_ino = I_INO(upd->dp);
+ __entry->ino = upd->ip ? I_INO(upd->ip) : NULLFSINO;
__entry->error = error;
__assign_str(fname);
),
),
TP_fast_assign(
__entry->dev = VFS_I(dp)->i_sb->s_dev;
- __entry->dp_ino = dp->i_ino;
+ __entry->dp_ino = I_INO(dp);
__entry->ino = ino,
__entry->ftype = name->type;
__entry->namelen = name->len;
TP_fast_assign(
__entry->dev = hm->dev;
__entry->type = p->type;
- __entry->ino = XFS_I(p->inode)->i_ino;
+ __entry->ino = p->inode->i_ino;
__entry->gen = p->inode->i_generation;
__entry->pos = p->pos;
__entry->len = p->len;
if (error)
return error;
- if (!XFS_IS_QUOTA_ON(mp) || xfs_is_quota_inode(&mp->m_sb, ip->i_ino))
+ if (!XFS_IS_QUOTA_ON(mp) || xfs_is_quota_inode(&mp->m_sb, I_INO(ip)))
return 0;
if (tp->t_flags & XFS_TRANS_RESERVE)
if (xfs_hooks_switched_on(&xfs_dqtrx_hooks_switch)) {
struct xfs_mod_ino_dqtrx_params p = {
.tx_id = (uintptr_t)tp,
- .ino = ip->i_ino,
+ .ino = I_INO(ip),
.q_type = xfs_dquot_type(dqp),
.q_id = dqp->q_id,
.delta = delta
xfs_mount_t *mp = tp->t_mountp;
if (!XFS_IS_QUOTA_ON(mp) ||
- xfs_is_quota_inode(&mp->m_sb, ip->i_ino) ||
+ xfs_is_quota_inode(&mp->m_sb, I_INO(ip)) ||
xfs_is_metadir_inode(ip))
return;
if (xfs_is_metadir_inode(ip))
return 0;
- ASSERT(!xfs_is_quota_inode(&mp->m_sb, ip->i_ino));
+ ASSERT(!xfs_is_quota_inode(&mp->m_sb, I_INO(ip)));
xfs_assert_ilocked(ip, XFS_ILOCK_EXCL);
if (force)
args->op_flags |= XFS_DA_OP_LOGGED;
}
- args->owner = args->dp->i_ino;
+ args->owner = I_INO(args->dp);
args->geo = mp->m_attr_geo;
args->whichfork = XFS_ATTR_FORK;
xfs_attr_sethash(args);