]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: remove libxfs_trans_iget
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 26 Apr 2019 20:39:56 +0000 (15:39 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 26 Apr 2019 20:39:56 +0000 (15:39 -0500)
libxfs_trans_iget no longer has a counterpart in the kernel.  Remove it
and make the xfs_iget/xfs_trans_ijoin usage consistent throughout
xfsprogs.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
include/xfs_trans.h
libxfs/libxfs_api_defs.h
libxfs/trans.c
libxfs/util.c
repair/phase6.c
repair/phase7.c

index 9e44d18eb2b7d522bc6da76dc99f95559dc5ffdf..e6bb74c481ca915bc98f2f6c7fb7e2222eb3f982 100644 (file)
@@ -98,8 +98,6 @@ void xfs_defer_cancel(struct xfs_trans *);
 
 struct xfs_buf *libxfs_trans_getsb(struct xfs_trans *, struct xfs_mount *, int);
 
-int    libxfs_trans_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
-                               uint, uint, struct xfs_inode **);
 void   libxfs_trans_ijoin(struct xfs_trans *, struct xfs_inode *, uint);
 void   libxfs_trans_ijoin_ref(struct xfs_trans *, struct xfs_inode *, int);
 void   libxfs_trans_log_inode (struct xfs_trans *, struct xfs_inode *,
index e10d78cd2849f04d5a53171ffad610932f415bf4..bb0f07bdb90176b0c0d685ba6368f291c27b3ab9 100644 (file)
@@ -31,7 +31,6 @@
 #define xfs_trans_del_item             libxfs_trans_del_item
 #define xfs_trans_get_buf              libxfs_trans_get_buf
 #define xfs_trans_getsb                        libxfs_trans_getsb
-#define xfs_trans_iget                 libxfs_trans_iget
 #define xfs_trans_ichgtime             libxfs_trans_ichgtime
 #define xfs_trans_ijoin                        libxfs_trans_ijoin
 #define xfs_trans_init                 libxfs_trans_init
index 7bdd154417b918fc075e2b26a3c163a42171808d..9de77c8baf3336e286cd3217c009551d87b38f60 100644 (file)
@@ -336,41 +336,6 @@ out:
        return;
 }
 
-int
-libxfs_trans_iget(
-       xfs_mount_t             *mp,
-       xfs_trans_t             *tp,
-       xfs_ino_t               ino,
-       uint                    flags,
-       uint                    lock_flags,
-       xfs_inode_t             **ipp)
-{
-       int                     error;
-       xfs_inode_t             *ip;
-       xfs_inode_log_item_t    *iip;
-
-       if (tp == NULL)
-               return libxfs_iget(mp, tp, ino, lock_flags, ipp,
-                               &xfs_default_ifork_ops);
-
-       error = libxfs_iget(mp, tp, ino, lock_flags, &ip,
-                       &xfs_default_ifork_ops);
-       if (error)
-               return error;
-       ASSERT(ip != NULL);
-
-       if (ip->i_itemp == NULL)
-               xfs_inode_item_init(ip, mp);
-       iip = ip->i_itemp;
-       xfs_trans_add_item(tp, (xfs_log_item_t *)(iip));
-
-       /* initialize i_transp so we can find it incore */
-       ip->i_transp = tp;
-
-       *ipp = ip;
-       return 0;
-}
-
 void
 libxfs_trans_ijoin(
        xfs_trans_t             *tp,
index bd4140430734e0a73d737ab4dfc6904dbff2587c..4ac151e6b47e90fc837d51a1e4534eb5113c1996 100644 (file)
@@ -262,7 +262,8 @@ libxfs_ialloc(
        }
        ASSERT(*ialloc_context == NULL);
 
-       error = xfs_trans_iget(tp->t_mountp, tp, ino, 0, 0, &ip);
+       error = libxfs_iget(tp->t_mountp, tp, ino, 0, &ip,
+                       &xfs_default_ifork_ops);
        if (error != 0)
                return error;
        ASSERT(ip != NULL);
@@ -376,6 +377,7 @@ libxfs_ialloc(
        /*
         * Log the new values stuffed into the inode.
         */
+       xfs_trans_ijoin(tp, ip, 0);
        xfs_trans_log_inode(tp, ip, flags);
        *ipp = ip;
        return 0;
index 194cfdbf0fd2f1ffbe473c3210478065439e3c1f..28e633deb2cd4c0534da882f86be2907a2783b8b 100644 (file)
@@ -535,7 +535,8 @@ mk_rbmino(xfs_mount_t *mp)
        if (i)
                res_failed(i);
 
-       error = -libxfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, 0, &ip);
+       error = -libxfs_iget(mp, tp, mp->m_sb.sb_rbmino, 0, &ip,
+                       &xfs_default_ifork_ops);
        if (error) {
                do_error(
                _("couldn't iget realtime bitmap inode -- error - %d\n"),
@@ -572,6 +573,7 @@ mk_rbmino(xfs_mount_t *mp)
        /*
         * commit changes
         */
+       libxfs_trans_ijoin(tp, ip, 0);
        libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
        error = -libxfs_trans_commit(tp);
        if (error)
@@ -634,7 +636,8 @@ fill_rbmino(xfs_mount_t *mp)
        if (error)
                res_failed(error);
 
-       error = -libxfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, 0, &ip);
+       error = -libxfs_iget(mp, tp, mp->m_sb.sb_rbmino, 0, &ip,
+                       &xfs_default_ifork_ops);
        if (error) {
                do_error(
                _("couldn't iget realtime bitmap inode -- error - %d\n"),
@@ -645,6 +648,7 @@ fill_rbmino(xfs_mount_t *mp)
                /*
                 * fill the file one block at a time
                 */
+               libxfs_trans_ijoin(tp, ip, 0);
                nmap = 1;
                error = -libxfs_bmapi_write(tp, ip, bno, 1, 0, 1, &map, &nmap);
                if (error || nmap != 1) {
@@ -703,7 +707,8 @@ fill_rsumino(xfs_mount_t *mp)
        if (error)
                res_failed(error);
 
-       error = -libxfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 0, 0, &ip);
+       error = -libxfs_iget(mp, tp, mp->m_sb.sb_rsumino, 0, &ip,
+                       &xfs_default_ifork_ops);
        if (error) {
                do_error(
                _("couldn't iget realtime summary inode -- error - %d\n"),
@@ -714,6 +719,7 @@ fill_rsumino(xfs_mount_t *mp)
                /*
                 * fill the file one block at a time
                 */
+               libxfs_trans_ijoin(tp, ip, 0);
                nmap = 1;
                error = -libxfs_bmapi_write(tp, ip, bno, 1, 0, 1, &map, &nmap);
                if (error || nmap != 1) {
@@ -775,7 +781,8 @@ mk_rsumino(xfs_mount_t *mp)
        if (i)
                res_failed(i);
 
-       error = -libxfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 0, 0, &ip);
+       error = -libxfs_iget(mp, tp, mp->m_sb.sb_rsumino, 0, &ip,
+                       &xfs_default_ifork_ops);
        if (error) {
                do_error(
                _("couldn't iget realtime summary inode -- error - %d\n"),
@@ -812,6 +819,7 @@ mk_rsumino(xfs_mount_t *mp)
        /*
         * commit changes
         */
+       libxfs_trans_ijoin(tp, ip, 0);
        libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
        error = -libxfs_trans_commit(tp);
        if (error)
@@ -875,7 +883,8 @@ mk_root_dir(xfs_mount_t *mp)
        if (i)
                res_failed(i);
 
-       error = -libxfs_trans_iget(mp, tp, mp->m_sb.sb_rootino, 0, 0, &ip);
+       error = -libxfs_iget(mp, tp, mp->m_sb.sb_rootino, 0, &ip,
+                       &xfs_default_ifork_ops);
        if (error) {
                do_error(_("could not iget root inode -- error - %d\n"), error);
        }
@@ -900,7 +909,7 @@ mk_root_dir(xfs_mount_t *mp)
                times |= XFS_ICHGTIME_CREATE;
        }
        libxfs_trans_ichgtime(tp, ip, times);
-
+       libxfs_trans_ijoin(tp, ip, 0);
        libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
 
        /*
index c2a60a93ea66c59325e5ed86fe9240d0fe862f90..c2996470cf1e651612ce7e7518e4af01b0abddd3 100644 (file)
@@ -32,8 +32,7 @@ update_inode_nlinks(
        error = -libxfs_trans_alloc(mp, &M_RES(mp)->tr_remove, nres, 0, 0, &tp);
        ASSERT(error == 0);
 
-       error = -libxfs_trans_iget(mp, tp, ino, 0, 0, &ip);
-
+       error = -libxfs_iget(mp, tp, ino, 0, &ip, &xfs_default_ifork_ops);
        if (error)  {
                if (!no_modify)
                        do_error(
@@ -67,6 +66,7 @@ update_inode_nlinks(
        if (!dirty)  {
                libxfs_trans_cancel(tp);
        } else  {
+               libxfs_trans_ijoin(tp, ip, 0);
                libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
                /*
                 * no need to do a bmap finish since