patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / fs / xfs / xfs_bmap.c
index 0b2f4d3..d797f40 100644 (file)
@@ -69,7 +69,7 @@
 #include "xfs_buf_item.h"
 
 
-#ifdef XFSDEBUG
+#ifdef DEBUG
 STATIC void
 xfs_bmap_check_leaf_extents(xfs_btree_cur_t *cur, xfs_inode_t *ip, int whichfork);
 #endif
@@ -195,7 +195,7 @@ xfs_bmap_btree_to_extents(
        int                     *logflagsp, /* inode logging flags */
        int                     whichfork); /* data or attr fork */
 
-#ifdef XFSDEBUG
+#ifdef DEBUG
 /*
  * Check that the extents list for the inode ip is in the right order.
  */
@@ -695,7 +695,7 @@ xfs_bmap_add_extent(
                *curp = cur;
        }
 done:
-#ifdef XFSDEBUG
+#ifdef DEBUG
        if (!error)
                xfs_bmap_check_leaf_extents(*curp, ip, whichfork);
 #endif
@@ -4076,64 +4076,6 @@ xfs_bmap_cancel(
        ASSERT(flist->xbf_count == 0);
 }
 
-/*
- * Returns EINVAL if the specified file is not swappable.
- */
-int                                            /* error */
-xfs_bmap_check_swappable(
-       xfs_inode_t     *ip)                    /* incore inode */
-{
-       xfs_bmbt_rec_t  *base;                  /* base of extent array */
-       xfs_bmbt_rec_t  *ep;                    /* pointer to an extent entry */
-       xfs_fileoff_t   end_fsb;                /* last block of file within size */
-       xfs_bmbt_irec_t ext;                    /* extent list entry, decoded */
-       xfs_ifork_t     *ifp;                   /* inode fork pointer */
-       xfs_fileoff_t   lastaddr;               /* last block number seen */
-       xfs_extnum_t    nextents;               /* number of extent entries */
-       int             retval = 0;             /* return value */
-
-       xfs_ilock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL);
-
-       /*
-        * Check for a zero length file.
-        */
-       if (ip->i_d.di_size == 0)
-               goto check_done;
-
-       ASSERT(XFS_IFORK_FORMAT(ip, XFS_DATA_FORK) == XFS_DINODE_FMT_BTREE ||
-              XFS_IFORK_FORMAT(ip, XFS_DATA_FORK) == XFS_DINODE_FMT_EXTENTS);
-
-       ifp = &ip->i_df;
-       if (!(ifp->if_flags & XFS_IFEXTENTS) &&
-           (retval = xfs_iread_extents(NULL, ip, XFS_DATA_FORK)))
-               goto check_done;
-       /*
-        * Scan extents until the file size is reached. Look for
-        * holes or unwritten extents, since I/O to these would cause
-        * a transaction.
-        */
-       end_fsb = XFS_B_TO_FSB(ip->i_mount, ip->i_d.di_size);
-       nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t);
-       base = &ifp->if_u1.if_extents[0];
-       for (lastaddr = 0, ep = base; ep < &base[nextents]; ep++) {
-               xfs_bmbt_get_all(ep, &ext);
-               if (lastaddr < ext.br_startoff ||
-                   ext.br_state != XFS_EXT_NORM) {
-                       goto error_done;
-               }
-               if (end_fsb <= (lastaddr = ext.br_startoff +
-                                               ext.br_blockcount))
-                       goto check_done;
-       }
-error_done:
-       retval = XFS_ERROR(EINVAL);
-
-
-check_done:
-       xfs_iunlock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL);
-       return retval;
-}
-
 /*
  * Returns the file-relative block number of the first unused block(s)
  * in the file with at least "len" logically contiguous blocks free.
@@ -5790,7 +5732,7 @@ xfs_bmap_eof(
        return 0;
 }
 
-#ifdef XFSDEBUG
+#ifdef DEBUG
 /*
  * Check that the extents list for the inode ip is in the right order.
  */