From: Christoph Hellwig <hch@infradead.org>
To: Sergei Shtepa <sergei.shtepa@veeam.com>
Cc: axboe@kernel.dk, hch@infradead.org, corbet@lwn.net,
snitzer@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org,
dchinner@redhat.com, willy@infradead.org, dlemoal@kernel.org,
linux@weissschuh.net, jack@suse.cz, ming.lei@redhat.com,
linux-block@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v5 00/11] blksnap - block devices snapshots module
Date: Mon, 12 Jun 2023 07:32:42 -0700 [thread overview]
Message-ID: <ZIcsijGWeyk/FjHs@infradead.org> (raw)
In-Reply-To: <20230612135228.10702-1-sergei.shtepa@veeam.com>
I'm of course a little byassed by having spent a lot of my own time
on this, but this version now looks ready to merge to me:
Acked-by: Christoph Hellwig <hch@lst.de>
But as Jens just merged my series to reopen the open flag we'll also
need to fold this in:
diff --git a/drivers/block/blksnap/diff_area.c b/drivers/block/blksnap/diff_area.c
index 169fa003b6d66d..0848c947591508 100644
--- a/drivers/block/blksnap/diff_area.c
+++ b/drivers/block/blksnap/diff_area.c
@@ -128,7 +128,7 @@ void diff_area_free(struct kref *kref)
xa_destroy(&diff_area->chunk_map);
if (diff_area->orig_bdev) {
- blkdev_put(diff_area->orig_bdev, FMODE_READ | FMODE_WRITE);
+ blkdev_put(diff_area->orig_bdev, NULL);
diff_area->orig_bdev = NULL;
}
@@ -214,7 +214,8 @@ struct diff_area *diff_area_new(dev_t dev_id, struct diff_storage *diff_storage)
pr_debug("Open device [%u:%u]\n", MAJOR(dev_id), MINOR(dev_id));
- bdev = blkdev_get_by_dev(dev_id, FMODE_READ | FMODE_WRITE, NULL, NULL);
+ bdev = blkdev_get_by_dev(dev_id, BLK_OPEN_READ | BLK_OPEN_WRITE, NULL,
+ NULL);
if (IS_ERR(bdev)) {
int err = PTR_ERR(bdev);
@@ -224,7 +225,7 @@ struct diff_area *diff_area_new(dev_t dev_id, struct diff_storage *diff_storage)
diff_area = kzalloc(sizeof(struct diff_area), GFP_KERNEL);
if (!diff_area) {
- blkdev_put(bdev, FMODE_READ | FMODE_WRITE);
+ blkdev_put(bdev, NULL);
return ERR_PTR(-ENOMEM);
}
diff --git a/drivers/block/blksnap/diff_storage.c b/drivers/block/blksnap/diff_storage.c
index 1787fa6931a816..f3814474b9804a 100644
--- a/drivers/block/blksnap/diff_storage.c
+++ b/drivers/block/blksnap/diff_storage.c
@@ -123,7 +123,7 @@ void diff_storage_free(struct kref *kref)
}
while ((storage_bdev = first_storage_bdev(diff_storage))) {
- blkdev_put(storage_bdev->bdev, FMODE_READ | FMODE_WRITE);
+ blkdev_put(storage_bdev->bdev, NULL);
list_del(&storage_bdev->link);
kfree(storage_bdev);
}
@@ -138,7 +138,7 @@ static struct block_device *diff_storage_add_storage_bdev(
struct storage_bdev *storage_bdev, *existing_bdev = NULL;
struct block_device *bdev;
- bdev = blkdev_get_by_path(bdev_path, FMODE_READ | FMODE_WRITE,
+ bdev = blkdev_get_by_path(bdev_path, BLK_OPEN_READ | BLK_OPEN_WRITE,
NULL, NULL);
if (IS_ERR(bdev)) {
pr_err("Failed to open device. errno=%ld\n", PTR_ERR(bdev));
@@ -153,14 +153,14 @@ static struct block_device *diff_storage_add_storage_bdev(
spin_unlock(&diff_storage->lock);
if (existing_bdev->bdev == bdev) {
- blkdev_put(bdev, FMODE_READ | FMODE_WRITE);
+ blkdev_put(bdev, NULL);
return existing_bdev->bdev;
}
storage_bdev = kzalloc(sizeof(struct storage_bdev) +
strlen(bdev_path) + 1, GFP_KERNEL);
if (!storage_bdev) {
- blkdev_put(bdev, FMODE_READ | FMODE_WRITE);
+ blkdev_put(bdev, NULL);
return ERR_PTR(-ENOMEM);
}
next prev parent reply other threads:[~2023-06-12 14:34 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-12 13:52 [PATCH v5 00/11] blksnap - block devices snapshots module Sergei Shtepa
2023-06-12 13:52 ` [PATCH v5 01/11] documentation: Block Device Filtering Mechanism Sergei Shtepa
2023-06-12 13:52 ` [PATCH v5 02/11] block: " Sergei Shtepa
2023-07-11 2:02 ` Yu Kuai
2023-07-12 10:04 ` Yu Kuai
2023-07-12 12:34 ` Yu Kuai
2023-07-17 17:39 ` Sergei Shtepa
2023-07-18 1:21 ` Yu Kuai
2023-07-17 16:22 ` Sergei Shtepa
2023-07-17 14:39 ` Sergei Shtepa
2023-07-18 1:37 ` Yu Kuai
2023-07-18 11:25 ` Sergei Shtepa
2023-07-18 12:32 ` Yu Kuai
2023-07-18 16:33 ` Sergei Shtepa
2023-07-19 7:28 ` Yu Kuai
2023-07-19 8:36 ` Sergei Shtepa
2023-07-20 6:14 ` Christoph Hellwig
2023-06-12 13:52 ` [PATCH v5 03/11] documentation: Block Devices Snapshots Module Sergei Shtepa
2023-06-12 13:52 ` [PATCH v5 04/11] blksnap: header file of the module interface Sergei Shtepa
2023-06-13 22:25 ` Dave Chinner
2023-06-14 6:26 ` Christoph Hellwig
2023-06-14 9:26 ` Sergei Shtepa
2023-06-14 14:07 ` Christoph Hellwig
2023-06-14 16:43 ` Sergei Shtepa
2023-06-15 0:08 ` Dave Chinner
2023-07-17 18:57 ` Thomas Weißschuh
2023-07-18 9:53 ` Sergei Shtepa
2023-07-20 6:16 ` Christoph Hellwig
2023-06-12 13:52 ` [PATCH v5 05/11] blksnap: module management interface functions Sergei Shtepa
2023-06-12 13:52 ` [PATCH v5 06/11] blksnap: handling and tracking I/O units Sergei Shtepa
2023-06-12 13:52 ` [PATCH v5 07/11] blksnap: minimum data storage unit of the original block device Sergei Shtepa
2023-06-12 13:52 ` [PATCH v5 08/11] blksnap: difference storage Sergei Shtepa
2023-06-12 13:52 ` [PATCH v5 09/11] blksnap: event queue from the " Sergei Shtepa
2023-06-12 13:52 ` [PATCH v5 10/11] blksnap: snapshot and snapshot image block device Sergei Shtepa
2023-06-12 13:52 ` [PATCH v5 11/11] blksnap: Kconfig and Makefile Sergei Shtepa
2023-06-12 14:32 ` Christoph Hellwig [this message]
2023-06-12 16:19 ` [PATCH v5 00/11] blksnap - block devices snapshots module Eric Biggers
2023-06-13 5:50 ` Christoph Hellwig
2023-06-13 10:12 ` Sergei Shtepa
2023-06-14 17:22 ` Eric Biggers
-- strict thread matches above, loose matches on Subject: below --
2023-06-12 13:21 Sergei Shtepa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZIcsijGWeyk/FjHs@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=corbet@lwn.net \
--cc=dchinner@redhat.com \
--cc=dlemoal@kernel.org \
--cc=jack@suse.cz \
--cc=linux-block@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=ming.lei@redhat.com \
--cc=sergei.shtepa@veeam.com \
--cc=snitzer@kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).