From: Brian Foster Date: Fri, 5 Oct 2018 02:36:08 +0000 (-0500) Subject: xfs: remove firstblock param from xfs dir ops X-Git-Tag: v4.19.0-rc0~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=015bc82e48f156c631644e829a6ec562a3cf50d7;p=thirdparty%2Fxfsprogs-dev.git xfs: remove firstblock param from xfs dir ops Source kernel commit: 381eee69f862d38bef468e91517e37fc53f60885 All callers of the xfs_dir_*() functions pass ->t_firstblock as the firstblock parameter. Drop the parameter and access ->t_firstblock directly. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_dir2.c b/libxfs/xfs_dir2.c index 26a933e8d..aff28ed44 100644 --- a/libxfs/xfs_dir2.c +++ b/libxfs/xfs_dir2.c @@ -241,7 +241,6 @@ xfs_dir_createname( struct xfs_inode *dp, struct xfs_name *name, xfs_ino_t inum, /* new entry inode number */ - xfs_fsblock_t *first, /* bmap's firstblock */ xfs_extlen_t total) /* bmap's total block count */ { struct xfs_da_args *args; @@ -249,7 +248,6 @@ xfs_dir_createname( int v; /* type-checking value */ ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); - ASSERT(tp->t_dfops || !first); if (inum) { rval = xfs_dir_ino_validate(tp->t_mountp, inum); @@ -272,7 +270,7 @@ xfs_dir_createname( args->total = total; args->whichfork = XFS_DATA_FORK; args->trans = tp; - args->firstblock = first; + args->firstblock = &tp->t_firstblock; args->op_flags = XFS_DA_OP_ADDNAME | XFS_DA_OP_OKNOENT; if (!inum) args->op_flags |= XFS_DA_OP_JUSTCHECK; @@ -418,7 +416,6 @@ xfs_dir_removename( struct xfs_inode *dp, struct xfs_name *name, xfs_ino_t ino, - xfs_fsblock_t *first, /* bmap's firstblock */ xfs_extlen_t total) /* bmap's total block count */ { struct xfs_da_args *args; @@ -440,7 +437,7 @@ xfs_dir_removename( args->hashval = dp->i_mount->m_dirnameops->hashname(name); args->inumber = ino; args->dp = dp; - args->firstblock = first; + args->firstblock = &tp->t_firstblock; args->total = total; args->whichfork = XFS_DATA_FORK; args->trans = tp; @@ -479,7 +476,6 @@ xfs_dir_replace( struct xfs_inode *dp, struct xfs_name *name, /* name of entry to replace */ xfs_ino_t inum, /* new inode number */ - xfs_fsblock_t *first, /* bmap's firstblock */ xfs_extlen_t total) /* bmap's total block count */ { struct xfs_da_args *args; @@ -504,7 +500,7 @@ xfs_dir_replace( args->hashval = dp->i_mount->m_dirnameops->hashname(name); args->inumber = inum; args->dp = dp; - args->firstblock = first; + args->firstblock = &tp->t_firstblock; args->total = total; args->whichfork = XFS_DATA_FORK; args->trans = tp; @@ -543,7 +539,7 @@ xfs_dir_canenter( xfs_inode_t *dp, struct xfs_name *name) /* name of entry to add */ { - return xfs_dir_createname(tp, dp, name, 0, NULL, 0); + return xfs_dir_createname(tp, dp, name, 0, 0); } /* diff --git a/libxfs/xfs_dir2.h b/libxfs/xfs_dir2.h index f203aebc0..ba5acd03d 100644 --- a/libxfs/xfs_dir2.h +++ b/libxfs/xfs_dir2.h @@ -118,16 +118,16 @@ extern int xfs_dir_init(struct xfs_trans *tp, struct xfs_inode *dp, struct xfs_inode *pdp); extern int xfs_dir_createname(struct xfs_trans *tp, struct xfs_inode *dp, struct xfs_name *name, xfs_ino_t inum, - xfs_fsblock_t *first, xfs_extlen_t tot); + xfs_extlen_t tot); extern int xfs_dir_lookup(struct xfs_trans *tp, struct xfs_inode *dp, struct xfs_name *name, xfs_ino_t *inum, struct xfs_name *ci_name); extern int xfs_dir_removename(struct xfs_trans *tp, struct xfs_inode *dp, struct xfs_name *name, xfs_ino_t ino, - xfs_fsblock_t *first, xfs_extlen_t tot); + xfs_extlen_t tot); extern int xfs_dir_replace(struct xfs_trans *tp, struct xfs_inode *dp, struct xfs_name *name, xfs_ino_t inum, - xfs_fsblock_t *first, xfs_extlen_t tot); + xfs_extlen_t tot); extern int xfs_dir_canenter(struct xfs_trans *tp, struct xfs_inode *dp, struct xfs_name *name); diff --git a/mkfs/proto.c b/mkfs/proto.c index 671774fff..a2a36937c 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -308,15 +308,14 @@ newdirent( xfs_trans_t *tp, xfs_inode_t *pip, struct xfs_name *name, - xfs_ino_t inum, - xfs_fsblock_t *first) + xfs_ino_t inum) { int error; int rsv; rsv = XFS_DIRENTER_SPACE_RES(mp, name->len); - error = -libxfs_dir_createname(tp, pip, name, inum, first, rsv); + error = -libxfs_dir_createname(tp, pip, name, inum, rsv); if (error) fail(_("directory createname error"), error); } @@ -454,7 +453,7 @@ parseproto( free(buf); libxfs_trans_ijoin(tp, pip, 0); xname.type = XFS_DIR3_FT_REG_FILE; - newdirent(mp, tp, pip, &xname, ip->i_ino, &first); + newdirent(mp, tp, pip, &xname, ip->i_ino); break; case IF_RESERVED: /* pre-allocated space only */ @@ -478,7 +477,7 @@ parseproto( libxfs_trans_ijoin(tp, pip, 0); xname.type = XFS_DIR3_FT_REG_FILE; - newdirent(mp, tp, pip, &xname, ip->i_ino, &first); + newdirent(mp, tp, pip, &xname, ip->i_ino); libxfs_trans_log_inode(tp, ip, flags); libxfs_defer_ijoin(&dfops, ip); @@ -502,7 +501,7 @@ parseproto( } libxfs_trans_ijoin(tp, pip, 0); xname.type = XFS_DIR3_FT_BLKDEV; - newdirent(mp, tp, pip, &xname, ip->i_ino, &first); + newdirent(mp, tp, pip, &xname, ip->i_ino); flags |= XFS_ILOG_DEV; break; @@ -517,7 +516,7 @@ parseproto( fail(_("Inode allocation failed"), error); libxfs_trans_ijoin(tp, pip, 0); xname.type = XFS_DIR3_FT_CHRDEV; - newdirent(mp, tp, pip, &xname, ip->i_ino, &first); + newdirent(mp, tp, pip, &xname, ip->i_ino); flags |= XFS_ILOG_DEV; break; @@ -530,7 +529,7 @@ parseproto( fail(_("Inode allocation failed"), error); libxfs_trans_ijoin(tp, pip, 0); xname.type = XFS_DIR3_FT_FIFO; - newdirent(mp, tp, pip, &xname, ip->i_ino, &first); + newdirent(mp, tp, pip, &xname, ip->i_ino); break; case IF_SYMLINK: buf = getstr(pp); @@ -544,7 +543,7 @@ parseproto( flags |= newfile(tp, ip, &first, 1, 1, buf, len); libxfs_trans_ijoin(tp, pip, 0); xname.type = XFS_DIR3_FT_SYMLINK; - newdirent(mp, tp, pip, &xname, ip->i_ino, &first); + newdirent(mp, tp, pip, &xname, ip->i_ino); break; case IF_DIRECTORY: tp = getres(mp, 0); @@ -562,7 +561,7 @@ parseproto( } else { libxfs_trans_ijoin(tp, pip, 0); xname.type = XFS_DIR3_FT_DIR; - newdirent(mp, tp, pip, &xname, ip->i_ino, &first); + newdirent(mp, tp, pip, &xname, ip->i_ino); inc_nlink(VFS_I(pip)); libxfs_trans_log_inode(tp, pip, XFS_ILOG_CORE); } diff --git a/repair/phase6.c b/repair/phase6.c index 4b925e7e4..f44fe6e43 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -1039,8 +1039,7 @@ mk_orphanage(xfs_mount_t *mp) /* * create the actual entry */ - error = -libxfs_dir_createname(tp, pip, &xname, ip->i_ino, &first, - nres); + error = -libxfs_dir_createname(tp, pip, &xname, ip->i_ino, nres); if (error) do_error( _("can't make %s, createname error %d\n"), @@ -1149,7 +1148,7 @@ mv_orphanage( libxfs_defer_init(tp, &dfops, &first); err = -libxfs_dir_createname(tp, orphanage_ip, &xname, - ino, &first, nres); + ino, nres); if (err) do_error( _("name create failed in %s (%d), filesystem may be out of space\n"), @@ -1162,7 +1161,7 @@ mv_orphanage( libxfs_trans_log_inode(tp, orphanage_ip, XFS_ILOG_CORE); err = -libxfs_dir_createname(tp, ino_p, &xfs_name_dotdot, - orphanage_ino, &first, nres); + orphanage_ino, nres); if (err) do_error( _("creation of .. entry failed (%d), filesystem may be out of space\n"), @@ -1193,7 +1192,7 @@ mv_orphanage( libxfs_defer_init(tp, &dfops, &first); err = -libxfs_dir_createname(tp, orphanage_ip, &xname, - ino, &first, nres); + ino, nres); if (err) do_error( _("name create failed in %s (%d), filesystem may be out of space\n"), @@ -1212,7 +1211,7 @@ mv_orphanage( if (entry_ino_num != orphanage_ino) { err = -libxfs_dir_replace(tp, ino_p, &xfs_name_dotdot, orphanage_ino, - &first, nres); + nres); if (err) do_error( _("name replace op failed (%d), filesystem may be out of space\n"), @@ -1249,7 +1248,7 @@ mv_orphanage( libxfs_defer_init(tp, &dfops, &first); err = -libxfs_dir_createname(tp, orphanage_ip, &xname, ino, - &first, nres); + nres); if (err) do_error( _("name create failed in %s (%d), filesystem may be out of space\n"), @@ -1433,7 +1432,7 @@ longform_dir2_rebuild( libxfs_defer_init(tp, &dfops, &firstblock); error = -libxfs_dir_createname(tp, ip, &p->name, p->inum, - &firstblock, nres); + nres); if (error) { do_warn( _("name create failed in ino %" PRIu64 " (%d), filesystem may be out of space\n"), @@ -3036,7 +3035,7 @@ process_dir_inode( libxfs_defer_init(tp, &dfops, &first); error = -libxfs_dir_createname(tp, ip, &xfs_name_dotdot, - ip->i_ino, &first, nres); + ip->i_ino, nres); if (error) do_error( _("can't make \"..\" entry in root inode %" PRIu64 ", createname error %d\n"), ino, error); @@ -3094,7 +3093,7 @@ process_dir_inode( libxfs_defer_init(tp, &dfops, &first); error = -libxfs_dir_createname(tp, ip, &xfs_name_dot, - ip->i_ino, &first, nres); + ip->i_ino, nres); if (error) do_error( _("can't make \".\" entry in dir ino %" PRIu64 ", createname error %d\n"),