From fee67d807bc36ff2cacb77286156798fd70e3f0c Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sun, 13 Apr 2025 08:33:40 -0400 Subject: linux shim: implement BLK_OPEN_CREAT this allows O_CREAT to be passed through, for the new image creation tool. Signed-off-by: Kent Overstreet --- c_src/tools-util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'c_src/tools-util.c') diff --git a/c_src/tools-util.c b/c_src/tools-util.c index 496c875c..ea12946c 100644 --- a/c_src/tools-util.c +++ b/c_src/tools-util.c @@ -183,7 +183,7 @@ unsigned get_blocksize(int fd) } /* Open a block device, do magic blkid stuff to probe for existing filesystems: */ -int open_for_format(struct dev_opts *dev, bool force) +int open_for_format(struct dev_opts *dev, blk_mode_t mode, bool force) { int blkid_version_code = blkid_get_library_version(NULL, NULL); if (blkid_version_code < 2401) { @@ -208,7 +208,7 @@ int open_for_format(struct dev_opts *dev, bool force) size_t fs_type_len, fs_label_len; dev->file = bdev_file_open_by_path(dev->path, - BLK_OPEN_READ|BLK_OPEN_WRITE|BLK_OPEN_EXCL|BLK_OPEN_BUFFERED, + BLK_OPEN_READ|BLK_OPEN_WRITE|BLK_OPEN_EXCL|BLK_OPEN_BUFFERED|mode, dev, NULL); int ret = PTR_ERR_OR_ZERO(dev->file); if (ret < 0) -- cgit v1.2.3