summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_refcount.h
diff options
context:
space:
mode:
authorDarrick J. Wong2016-10-03 18:11:19 +0200
committerDarrick J. Wong2016-10-03 18:11:19 +0200
commitbdf28630b72154e5766cbad5874576b6f22e7237 (patch)
treead5d36401e51db87bb85a9725354977854ac465b /fs/xfs/libxfs/xfs_refcount.h
parentxfs: account for the refcount btree in the alloc/free log reservation (diff)
downloadkernel-qcow2-linux-bdf28630b72154e5766cbad5874576b6f22e7237.tar.gz
kernel-qcow2-linux-bdf28630b72154e5766cbad5874576b6f22e7237.tar.xz
kernel-qcow2-linux-bdf28630b72154e5766cbad5874576b6f22e7237.zip
xfs: add refcount btree operations
Implement the generic btree operations required to manipulate refcount btree blocks. The implementation is similar to the bmapbt, though it will only allocate and free blocks from the AG. Since the refcount root and level fields are separate from the existing roots and levels array, they need a separate logging flag. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> [hch: fix logging of AGF refcount btree fields] Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/libxfs/xfs_refcount.h')
-rw-r--r--fs/xfs/libxfs/xfs_refcount.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_refcount.h b/fs/xfs/libxfs/xfs_refcount.h
new file mode 100644
index 000000000000..4dc335a1dc73
--- /dev/null
+++ b/fs/xfs/libxfs/xfs_refcount.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2016 Oracle. All Rights Reserved.
+ *
+ * Author: Darrick J. Wong <darrick.wong@oracle.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+#ifndef __XFS_REFCOUNT_H__
+#define __XFS_REFCOUNT_H__
+
+extern int xfs_refcount_lookup_le(struct xfs_btree_cur *cur,
+ xfs_agblock_t bno, int *stat);
+extern int xfs_refcount_lookup_ge(struct xfs_btree_cur *cur,
+ xfs_agblock_t bno, int *stat);
+extern int xfs_refcount_get_rec(struct xfs_btree_cur *cur,
+ struct xfs_refcount_irec *irec, int *stat);
+
+#endif /* __XFS_REFCOUNT_H__ */