|
@@ -1696,3 +1696,22 @@ out_cursor:
|
|
|
xfs_trans_brelse(tp, agbp);
|
|
|
goto out_trans;
|
|
|
}
|
|
|
+
|
|
|
+/* Is there a record covering a given extent? */
|
|
|
+int
|
|
|
+xfs_refcount_has_record(
|
|
|
+ struct xfs_btree_cur *cur,
|
|
|
+ xfs_agblock_t bno,
|
|
|
+ xfs_extlen_t len,
|
|
|
+ bool *exists)
|
|
|
+{
|
|
|
+ union xfs_btree_irec low;
|
|
|
+ union xfs_btree_irec high;
|
|
|
+
|
|
|
+ memset(&low, 0, sizeof(low));
|
|
|
+ low.rc.rc_startblock = bno;
|
|
|
+ memset(&high, 0xFF, sizeof(high));
|
|
|
+ high.rc.rc_startblock = bno + len - 1;
|
|
|
+
|
|
|
+ return xfs_btree_has_record(cur, &low, &high, exists);
|
|
|
+}
|