@@ -517,6 +517,16 @@ int blk_get_reserved_space(struct block_device *bdev, sector_t *nr_sects)
}
EXPORT_SYMBOL_GPL(blk_get_reserved_space);
+int blk_provision_space(struct block_device *bdev, sector_t offset, sector_t len)
+{
+ const struct block_device_operations *ops = bdev->bd_disk->fops;
+
+ if (!ops->provision_space)
+ return -EOPNOTSUPP;
+ return ops->provision_space(bdev, offset, len);
+}
+EXPORT_SYMBOL_GPL(blk_provision_space);
+
/*
* pseudo-fs
*/
@@ -1666,6 +1666,7 @@ struct block_device_operations {
void (*swap_slot_free_notify) (struct block_device *, unsigned long);
int (*reserve_space) (struct block_device *, sector_t);
int (*get_reserved_space) (struct block_device *, sector_t *);
+ int (*provision_space) (struct block_device *, sector_t, sector_t);
struct module *owner;
const struct pr_ops *pr_ops;
};
@@ -1679,6 +1680,7 @@ extern long bdev_direct_access(struct block_device *, struct blk_dax_ctl *);
extern int blk_reserve_space(struct block_device *, sector_t);
extern int blk_get_reserved_space(struct block_device *, sector_t *);
+extern int blk_provision_space(struct block_device *, sector_t, sector_t);
#else /* CONFIG_BLOCK */
struct block_device;
Signed-off-by: Brian Foster <bfoster@redhat.com> --- fs/block_dev.c | 10 ++++++++++ include/linux/blkdev.h | 2 ++ 2 files changed, 12 insertions(+)