]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove firstblock param from xfs dir ops
authorBrian Foster <bfoster@redhat.com>
Fri, 5 Oct 2018 02:36:08 +0000 (21:36 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 5 Oct 2018 02:36:08 +0000 (21:36 -0500)
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 <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_dir2.c
libxfs/xfs_dir2.h
mkfs/proto.c
repair/phase6.c

index 26a933e8d632adfcf46cdc0a76ae1893be35fab6..aff28ed44174fd478326039f9f49964f4d61720e 100644 (file)
@@ -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);
 }
 
 /*
index f203aebc07edcc00e48568f8cfd8f727e90719c5..ba5acd03de942a0fe1a9944553579c5112ec61df 100644 (file)
@@ -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);
 
index 671774fff1dbf1bc4c8413c9a7dbbe7dab011a20..a2a36937ce2bee88746f75f3544857d1355d9d9b 100644 (file)
@@ -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);
                }
index 4b925e7e486a074daabce084356c9a08f14c67cb..f44fe6e436de951d997b26dd7a38ed494a063c91 100644 (file)
@@ -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"),