]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - libxfs/util.c
xfsprogs: make static things static
[thirdparty/xfsprogs-dev.git] / libxfs / util.c
index 5eb4e557d2970665fc5eed594625c2724eb6bf53..993218615d008b745a1efb616b0e1876dab6e6ae 100644 (file)
@@ -230,7 +230,7 @@ xfs_flags2diflags2(
  * This was once shared with the kernel, but has diverged to the point
  * where it's no longer worth the hassle of maintaining common code.
  */
-int
+static int
 libxfs_ialloc(
        xfs_trans_t     *tp,
        xfs_inode_t     *pip,
@@ -354,7 +354,7 @@ libxfs_ialloc(
        case S_IFLNK:
                ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS;
                ip->i_df.if_flags = XFS_IFEXTENTS;
-               ip->i_df.if_bytes = ip->i_df.if_real_bytes = 0;
+               ip->i_df.if_bytes = 0;
                ip->i_df.if_u1.if_root = NULL;
                break;
        default:
@@ -380,13 +380,13 @@ libxfs_ialloc(
        return 0;
 }
 
-void
+static void
 libxfs_iprint(
        xfs_inode_t             *ip)
 {
        struct xfs_icdinode     *dip;
        xfs_extnum_t            i = 0;
-       xfs_ifork_t             *ifp;           /* inode fork pointer */
+       struct xfs_ifork        *ifp;           /* inode fork pointer */
        struct xfs_iext_cursor  icur;
        xfs_bmbt_irec_t         rec;
 
@@ -543,8 +543,6 @@ libxfs_alloc_file_space(
        xfs_filblks_t   datablocks;
        xfs_filblks_t   allocated_fsb;
        xfs_filblks_t   allocatesize_fsb;
-       xfs_fsblock_t   firstfsb;
-       struct xfs_defer_ops free_list;
        xfs_bmbt_irec_t *imapp;
        xfs_bmbt_irec_t imaps[1];
        int             reccount;
@@ -582,9 +580,8 @@ libxfs_alloc_file_space(
                }
                xfs_trans_ijoin(tp, ip, 0);
 
-               xfs_defer_init(&free_list, &firstfsb);
                error = xfs_bmapi_write(tp, ip, startoffset_fsb, allocatesize_fsb,
-                               xfs_bmapi_flags, &firstfsb, 0, imapp, &reccount);
+                               xfs_bmapi_flags, 0, imapp, &reccount);
 
                if (error)
                        goto error0;
@@ -592,10 +589,6 @@ libxfs_alloc_file_space(
                /*
                 * Complete the transaction
                 */
-               error = xfs_defer_finish(&tp, &free_list);
-               if (error)
-                       goto error0;
-
                error = xfs_trans_commit(tp);
                if (error)
                        break;
@@ -610,7 +603,6 @@ libxfs_alloc_file_space(
        return error;
 
 error0:        /* Cancel bmap, cancel trans */
-       xfs_defer_cancel(&free_list);
        xfs_trans_cancel(tp);
        return error;
 }
@@ -761,7 +753,7 @@ xfs_inode_verifier_error(
  * repair can validate it against the state of the log.
  */
 xfs_lsn_t      libxfs_max_lsn = 0;
-pthread_mutex_t        libxfs_max_lsn_lock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t libxfs_max_lsn_lock = PTHREAD_MUTEX_INITIALIZER;
 
 bool
 xfs_log_check_lsn(