]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/xfs/libxfs/xfs_bmap.h
xfs: simplify validation of the unwritten extent bit
[karo-tx-linux.git] / fs / xfs / libxfs / xfs_bmap.h
index cdef87db5262bdc2f43b17f5a1e76fb45a107233..c35a14fa15272ab5ef38f8b47953ae120d72fb4e 100644 (file)
@@ -171,6 +171,18 @@ static inline int xfs_bmapi_whichfork(int bmapi_flags)
        { BMAP_COWFORK,         "COW" }
 
 
+/*
+ * Return true if the extent is a real, allocated extent, or false if it is  a
+ * delayed allocation, and unwritten extent or a hole.
+ */
+static inline bool xfs_bmap_is_real_extent(struct xfs_bmbt_irec *irec)
+{
+       return irec->br_state != XFS_EXT_UNWRITTEN &&
+               irec->br_startblock != HOLESTARTBLOCK &&
+               irec->br_startblock != DELAYSTARTBLOCK &&
+               !isnullstartblock(irec->br_startblock);
+}
+
 /*
  * This macro is used to determine how many extents will be shifted
  * in one write transaction. We could require two splits,
@@ -232,8 +244,6 @@ int xfs_bmap_del_extent_delay(struct xfs_inode *ip, int whichfork,
                struct xfs_bmbt_irec *del);
 void   xfs_bmap_del_extent_cow(struct xfs_inode *ip, xfs_extnum_t *idx,
                struct xfs_bmbt_irec *got, struct xfs_bmbt_irec *del);
-int    xfs_check_nostate_extents(struct xfs_ifork *ifp, xfs_extnum_t idx,
-               xfs_extnum_t num);
 uint   xfs_default_attroffset(struct xfs_inode *ip);
 int    xfs_bmap_shift_extents(struct xfs_trans *tp, struct xfs_inode *ip,
                xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb,