X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=linux%2Fblkdev.c;h=270d3c899471ec298cface7265cecc5fd5927eaa;hb=55142cd0b5ef2a2150d4708dad0c3fd54a3ffd39;hp=709e770345f925e31101a82ea3bd5366525bb848;hpb=f712a866a474d70bfbe3a43aad2b04ceec13ddd3;p=bcachefs-tools-debian diff --git a/linux/blkdev.c b/linux/blkdev.c index 709e770..270d3c8 100644 --- a/linux/blkdev.c +++ b/linux/blkdev.c @@ -215,6 +215,7 @@ struct block_device *blkdev_get_by_path(const char *path, fmode_t mode, strncpy(bdev->name, path, sizeof(bdev->name)); bdev->name[sizeof(bdev->name) - 1] = '\0'; + bdev->bd_dev = xfstat(fd).st_rdev; bdev->bd_fd = fd; bdev->bd_sync_fd = sync_fd; bdev->bd_holder = holder; @@ -230,9 +231,9 @@ void bdput(struct block_device *bdev) BUG(); } -struct block_device *lookup_bdev(const char *path) +int lookup_bdev(const char *path, dev_t *dev) { - return ERR_PTR(-EINVAL); + return -EINVAL; } static int aio_completion_thread(void *arg)