summaryrefslogtreecommitdiff
path: root/fs/bcachefs/darray.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-07-11 23:23:40 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-07-12 01:46:59 -0400
commit1fec9ab170e57cb40b410d2d27cddd22a6fe08db (patch)
tree6c1190f204f92166c83f66e4a550f4270b6b6c6d /fs/bcachefs/darray.h
parentef5b64f02690cd6f5cca6e854100b5a3abfd3541 (diff)
bcachefs: BCH_IOCTL_FSCKbcachefs-ioctl-fsck
This adds a new ioctl for running fsck on a list of devices. Normally, if we wish to use the kernel's implementation of fsck we'd run it at mount time with -o fsck. This ioctl lets us run fsck without mounting, so that userspace bcachefs-tools can transparently switch to the kernel's implementation of fsck when appropriate - primarily if the kernel version of bcachefs better matches the filesystem on disk. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/darray.h')
-rw-r--r--fs/bcachefs/darray.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/darray.h b/fs/bcachefs/darray.h
index d4485fa01b2a..6049a5a3cba9 100644
--- a/fs/bcachefs/darray.h
+++ b/fs/bcachefs/darray.h
@@ -41,6 +41,8 @@ static inline int __darray_make_room(darray_void *d, size_t t_size, size_t more,
#define darray_make_room(_d, _more) \
darray_make_room_gfp(_d, _more, GFP_KERNEL)
+#define darray_room(_d) ((_d).size - (_d).nr)
+
#define darray_top(_d) ((_d).data[(_d).nr])
#define darray_push_gfp(_d, _item, _gfp) \