From: Ryusuke Konishi <konishi.ryusuke@gmail.com> To: Jan Kara <jack@suse.cz> Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@infradead.org>, linux-nilfs@vger.kernel.org Subject: Re: [PATCH 27/32] nilfs2: Convert to use blkdev_get_handle_by_path() Date: Fri, 21 Jul 2023 14:22:00 +0900 [thread overview] Message-ID: <CAKFNMok9dE4MBB6J9_OLQMxJ=BC+kroFRZF5yCxaO3Njxr8eGw@mail.gmail.com> (raw) In-Reply-To: <20230704122224.16257-27-jack@suse.cz> On Tue, Jul 4, 2023 at 9:24 PM Jan Kara wrote: > > Convert nilfs2 to use blkdev_get_handle_by_path() and initialize the > superblock with the handle. > > CC: linux-nilfs@vger.kernel.org > Signed-off-by: Jan Kara <jack@suse.cz> > --- > fs/nilfs2/super.c | 21 ++++++++++++--------- > 1 file changed, 12 insertions(+), 9 deletions(-) Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com> You may revise this patch to reflect comments on the patch 1/32, but the changes here look fine, and I have no objection to rewriting to use bdev_handle. Thanks, Ryusuke Konishi > > diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c > index 0ef8c71bde8e..0aba0daa06d2 100644 > --- a/fs/nilfs2/super.c > +++ b/fs/nilfs2/super.c > @@ -1283,14 +1283,15 @@ static int nilfs_identify(char *data, struct nilfs_super_data *sd) > > static int nilfs_set_bdev_super(struct super_block *s, void *data) > { > - s->s_bdev = data; > + s->s_bdev_handle = data; > + s->s_bdev = s->s_bdev_handle->bdev; > s->s_dev = s->s_bdev->bd_dev; > return 0; > } > > static int nilfs_test_bdev_super(struct super_block *s, void *data) > { > - return (void *)s->s_bdev == data; > + return s->s_bdev == ((struct bdev_handle *)data)->bdev; > } > > static struct dentry * > @@ -1298,15 +1299,17 @@ nilfs_mount(struct file_system_type *fs_type, int flags, > const char *dev_name, void *data) > { > struct nilfs_super_data sd; > + struct bdev_handle *bdev_handle; > struct super_block *s; > struct dentry *root_dentry; > int err, s_new = false; > > - sd.bdev = blkdev_get_by_path(dev_name, sb_open_mode(flags), fs_type, > - NULL); > - if (IS_ERR(sd.bdev)) > - return ERR_CAST(sd.bdev); > + bdev_handle = blkdev_get_handle_by_path(dev_name, sb_open_mode(flags), > + fs_type, NULL); > + if (IS_ERR(bdev_handle)) > + return ERR_CAST(bdev_handle); > > + sd.bdev = bdev_handle->bdev; > sd.cno = 0; > sd.flags = flags; > if (nilfs_identify((char *)data, &sd)) { > @@ -1326,7 +1329,7 @@ nilfs_mount(struct file_system_type *fs_type, int flags, > goto failed; > } > s = sget(fs_type, nilfs_test_bdev_super, nilfs_set_bdev_super, flags, > - sd.bdev); > + bdev_handle); > mutex_unlock(&sd.bdev->bd_fsfreeze_mutex); > if (IS_ERR(s)) { > err = PTR_ERR(s); > @@ -1374,7 +1377,7 @@ nilfs_mount(struct file_system_type *fs_type, int flags, > } > > if (!s_new) > - blkdev_put(sd.bdev, fs_type); > + blkdev_handle_put(bdev_handle); > > return root_dentry; > > @@ -1383,7 +1386,7 @@ nilfs_mount(struct file_system_type *fs_type, int flags, > > failed: > if (!s_new) > - blkdev_put(sd.bdev, fs_type); > + blkdev_handle_put(bdev_handle); > return ERR_PTR(err); > } > > -- > 2.35.3 >
WARNING: multiple messages have this Message-ID (diff)
From: Ryusuke Konishi <konishi.ryusuke-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org> Cc: linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Jens Axboe <axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>, Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>, linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: Re: [PATCH 27/32] nilfs2: Convert to use blkdev_get_handle_by_path() Date: Fri, 21 Jul 2023 14:22:00 +0900 [thread overview] Message-ID: <CAKFNMok9dE4MBB6J9_OLQMxJ=BC+kroFRZF5yCxaO3Njxr8eGw@mail.gmail.com> (raw) In-Reply-To: <20230704122224.16257-27-jack-AlSwsSmVLrQ@public.gmane.org> On Tue, Jul 4, 2023 at 9:24 PM Jan Kara wrote: > > Convert nilfs2 to use blkdev_get_handle_by_path() and initialize the > superblock with the handle. > > CC: linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Signed-off-by: Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org> > --- > fs/nilfs2/super.c | 21 ++++++++++++--------- > 1 file changed, 12 insertions(+), 9 deletions(-) Acked-by: Ryusuke Konishi <konishi.ryusuke-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> You may revise this patch to reflect comments on the patch 1/32, but the changes here look fine, and I have no objection to rewriting to use bdev_handle. Thanks, Ryusuke Konishi > > diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c > index 0ef8c71bde8e..0aba0daa06d2 100644 > --- a/fs/nilfs2/super.c > +++ b/fs/nilfs2/super.c > @@ -1283,14 +1283,15 @@ static int nilfs_identify(char *data, struct nilfs_super_data *sd) > > static int nilfs_set_bdev_super(struct super_block *s, void *data) > { > - s->s_bdev = data; > + s->s_bdev_handle = data; > + s->s_bdev = s->s_bdev_handle->bdev; > s->s_dev = s->s_bdev->bd_dev; > return 0; > } > > static int nilfs_test_bdev_super(struct super_block *s, void *data) > { > - return (void *)s->s_bdev == data; > + return s->s_bdev == ((struct bdev_handle *)data)->bdev; > } > > static struct dentry * > @@ -1298,15 +1299,17 @@ nilfs_mount(struct file_system_type *fs_type, int flags, > const char *dev_name, void *data) > { > struct nilfs_super_data sd; > + struct bdev_handle *bdev_handle; > struct super_block *s; > struct dentry *root_dentry; > int err, s_new = false; > > - sd.bdev = blkdev_get_by_path(dev_name, sb_open_mode(flags), fs_type, > - NULL); > - if (IS_ERR(sd.bdev)) > - return ERR_CAST(sd.bdev); > + bdev_handle = blkdev_get_handle_by_path(dev_name, sb_open_mode(flags), > + fs_type, NULL); > + if (IS_ERR(bdev_handle)) > + return ERR_CAST(bdev_handle); > > + sd.bdev = bdev_handle->bdev; > sd.cno = 0; > sd.flags = flags; > if (nilfs_identify((char *)data, &sd)) { > @@ -1326,7 +1329,7 @@ nilfs_mount(struct file_system_type *fs_type, int flags, > goto failed; > } > s = sget(fs_type, nilfs_test_bdev_super, nilfs_set_bdev_super, flags, > - sd.bdev); > + bdev_handle); > mutex_unlock(&sd.bdev->bd_fsfreeze_mutex); > if (IS_ERR(s)) { > err = PTR_ERR(s); > @@ -1374,7 +1377,7 @@ nilfs_mount(struct file_system_type *fs_type, int flags, > } > > if (!s_new) > - blkdev_put(sd.bdev, fs_type); > + blkdev_handle_put(bdev_handle); > > return root_dentry; > > @@ -1383,7 +1386,7 @@ nilfs_mount(struct file_system_type *fs_type, int flags, > > failed: > if (!s_new) > - blkdev_put(sd.bdev, fs_type); > + blkdev_handle_put(bdev_handle); > return ERR_PTR(err); > } > > -- > 2.35.3 >
next prev parent reply other threads:[~2023-07-21 5:22 UTC|newest] Thread overview: 168+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-07-04 12:21 [PATCH RFC 0/32] block: Make blkdev_get_by_*() return handle Jan Kara 2023-07-04 12:21 ` Jan Kara 2023-07-04 12:21 ` [dm-devel] " Jan Kara 2023-07-04 12:21 ` [f2fs-dev] " Jan Kara 2023-07-04 12:21 ` Jan Kara 2023-07-04 12:21 ` Jan Kara 2023-07-04 12:21 ` [PATCH 01/32] block: Provide blkdev_get_handle_* functions Jan Kara 2023-07-04 12:21 ` Jan Kara 2023-07-04 12:21 ` [dm-devel] " Jan Kara 2023-07-04 12:21 ` [f2fs-dev] " Jan Kara 2023-07-04 12:21 ` Jan Kara 2023-07-04 12:21 ` Jan Kara 2023-07-04 12:43 ` Matthew Wilcox 2023-07-04 12:43 ` Matthew Wilcox 2023-07-04 12:43 ` Matthew Wilcox 2023-07-04 12:43 ` [dm-devel] " Matthew Wilcox 2023-07-04 12:43 ` Matthew Wilcox 2023-07-04 12:43 ` [f2fs-dev] " Matthew Wilcox 2023-07-04 13:03 ` Jan Kara 2023-07-04 13:03 ` Jan Kara 2023-07-04 13:03 ` [dm-devel] " Jan Kara 2023-07-04 13:03 ` Jan Kara 2023-07-04 13:03 ` [f2fs-dev] " Jan Kara 2023-07-04 13:03 ` Jan Kara 2023-07-04 14:06 ` Bart Van Assche 2023-07-04 14:06 ` Bart Van Assche 2023-07-04 14:06 ` Bart Van Assche 2023-07-04 14:06 ` [dm-devel] " Bart Van Assche 2023-07-04 14:06 ` Bart Van Assche 2023-07-04 14:06 ` [f2fs-dev] " Bart Van Assche 2023-07-04 16:14 ` Matthew Wilcox 2023-07-04 16:14 ` Matthew Wilcox 2023-07-04 16:14 ` [dm-devel] " Matthew Wilcox 2023-07-04 16:14 ` Matthew Wilcox 2023-07-04 16:14 ` Matthew Wilcox 2023-07-04 16:14 ` [f2fs-dev] " Matthew Wilcox 2023-07-05 15:19 ` Bart Van Assche 2023-07-05 15:19 ` Bart Van Assche 2023-07-05 15:19 ` [dm-devel] " Bart Van Assche 2023-07-05 15:19 ` Bart Van Assche 2023-07-05 15:19 ` Bart Van Assche 2023-07-05 15:19 ` [f2fs-dev] " Bart Van Assche 2023-07-05 16:12 ` Jan Kara 2023-07-05 16:12 ` Jan Kara 2023-07-05 16:12 ` [dm-devel] " Jan Kara 2023-07-05 16:12 ` Jan Kara 2023-07-05 16:12 ` Jan Kara 2023-07-05 16:12 ` [f2fs-dev] " Jan Kara 2023-07-04 16:28 ` Keith Busch 2023-07-04 16:28 ` Keith Busch 2023-07-04 16:28 ` Keith Busch 2023-07-04 16:28 ` [dm-devel] " Keith Busch 2023-07-04 16:28 ` Keith Busch 2023-07-04 16:28 ` [f2fs-dev] " Keith Busch 2023-07-05 10:21 ` Jan Kara 2023-07-05 10:21 ` Jan Kara 2023-07-05 10:21 ` [dm-devel] " Jan Kara 2023-07-05 10:21 ` Jan Kara 2023-07-05 10:21 ` Jan Kara 2023-07-05 10:21 ` [f2fs-dev] " Jan Kara 2023-07-06 15:38 ` Christoph Hellwig 2023-07-06 15:38 ` Christoph Hellwig 2023-07-06 15:38 ` Christoph Hellwig 2023-07-06 15:38 ` [dm-devel] " Christoph Hellwig 2023-07-06 15:38 ` Christoph Hellwig 2023-07-06 15:38 ` [f2fs-dev] " Christoph Hellwig 2023-07-06 16:14 ` Jan Kara 2023-07-06 16:14 ` Jan Kara 2023-07-06 16:14 ` [dm-devel] " Jan Kara 2023-07-06 16:14 ` Jan Kara 2023-07-06 16:14 ` Jan Kara 2023-07-06 16:14 ` [f2fs-dev] " Jan Kara 2023-07-07 11:28 ` Christoph Hellwig 2023-07-07 11:28 ` Christoph Hellwig 2023-07-07 11:28 ` Christoph Hellwig 2023-07-07 11:28 ` [dm-devel] " Christoph Hellwig 2023-07-07 11:28 ` Christoph Hellwig 2023-07-07 11:28 ` [f2fs-dev] " Christoph Hellwig 2023-07-07 12:24 ` Jan Kara 2023-07-07 12:24 ` Jan Kara 2023-07-07 12:24 ` [dm-devel] " Jan Kara 2023-07-07 12:24 ` Jan Kara 2023-07-07 12:24 ` Jan Kara 2023-07-07 12:24 ` [f2fs-dev] " Jan Kara 2023-07-12 13:39 ` Haris Iqbal 2023-07-12 13:39 ` Haris Iqbal 2023-07-12 13:39 ` [dm-devel] " Haris Iqbal 2023-07-12 13:39 ` Haris Iqbal via Linux-erofs 2023-07-12 16:06 ` Haris Iqbal 2023-07-12 16:06 ` Haris Iqbal 2023-07-12 16:06 ` [dm-devel] " Haris Iqbal 2023-07-12 16:06 ` Haris Iqbal via Linux-erofs 2023-07-12 16:06 ` Haris Iqbal 2023-07-12 16:06 ` [f2fs-dev] " Haris Iqbal via Linux-f2fs-devel 2023-07-31 10:50 ` Jan Kara 2023-07-31 10:50 ` Jan Kara 2023-07-31 10:50 ` [dm-devel] " Jan Kara 2023-07-31 10:50 ` Jan Kara 2023-07-31 10:50 ` Jan Kara 2023-07-31 10:50 ` [f2fs-dev] " Jan Kara 2023-07-31 11:13 ` Christoph Hellwig 2023-07-31 11:13 ` Christoph Hellwig 2023-07-31 11:13 ` Christoph Hellwig 2023-07-31 11:13 ` [dm-devel] " Christoph Hellwig 2023-07-31 11:13 ` [f2fs-dev] " Christoph Hellwig 2023-07-31 11:13 ` Christoph Hellwig 2023-07-04 12:21 ` [PATCH 02/32] block: Use file->f_flags for determining exclusive opens in file_to_blk_mode() Jan Kara 2023-07-06 15:35 ` Christoph Hellwig 2023-07-06 16:35 ` Jan Kara 2023-07-07 11:29 ` Christoph Hellwig 2023-07-04 12:21 ` [PATCH 03/32] block: Use blkdev_get_handle_by_dev() in blkdev_open() Jan Kara 2023-07-05 5:05 ` Kanchan Joshi 2023-07-05 10:17 ` Jan Kara 2023-07-04 12:21 ` [PATCH 04/32] block: Use blkdev_get_handle_by_dev() in disk_scan_partitions() and blkdev_bszset() Jan Kara 2023-07-04 12:21 ` [PATCH 05/32] drdb: Convert to use blkdev_get_handle_by_path() Jan Kara 2023-07-04 12:21 ` [PATCH 06/32] pktcdvd: Convert to blkdev_get_handle_by_dev() Jan Kara 2023-07-04 12:21 ` [PATCH 07/32] rnbd-srv: Convert to use blkdev_get_handle_by_path() Jan Kara 2023-07-12 15:54 ` Haris Iqbal 2023-07-04 12:21 ` [PATCH 08/32] xen/blkback: Convert to blkdev_get_handle_by_dev() Jan Kara 2023-07-04 12:21 ` [PATCH 09/32] zram: Convert to use blkdev_get_handle_by_dev() Jan Kara 2023-07-05 0:52 ` Sergey Senozhatsky 2023-07-04 12:21 ` [PATCH 10/32] bcache: Convert to blkdev_get_handle_by_path() Jan Kara 2023-07-04 13:06 ` Coly Li 2023-07-04 12:21 ` [PATCH 11/32] dm: Convert to blkdev_get_handle_by_dev() Jan Kara 2023-07-04 12:21 ` [dm-devel] " Jan Kara 2023-07-04 12:21 ` [PATCH 12/32] md: " Jan Kara 2023-07-04 12:21 ` [PATCH 13/32] mtd: block2mtd: Convert to blkdev_get_handle_by_dev/path() Jan Kara 2023-07-04 12:21 ` Jan Kara 2023-07-04 12:21 ` [PATCH 14/32] nvmet: Convert to blkdev_get_handle_by_path() Jan Kara 2023-07-04 12:21 ` [PATCH 15/32] s390/dasd: " Jan Kara 2023-07-04 12:21 ` [PATCH 16/32] scsi: target: " Jan Kara 2023-07-04 12:21 ` [PATCH 17/32] PM: hibernate: Convert to blkdev_get_handle_by_dev() Jan Kara 2023-07-04 12:21 ` [PATCH 18/32] PM: hibernate: Drop unused snapshot_test argument Jan Kara 2023-07-04 12:21 ` [PATCH 19/32] mm/swap: Convert to use blkdev_get_handle_by_dev() Jan Kara 2023-07-04 12:21 ` [PATCH 20/32] fs: Convert to blkdev_get_handle_by_path() Jan Kara 2023-07-04 12:21 ` [PATCH 21/32] btrfs: " Jan Kara 2023-07-04 12:21 ` [PATCH 22/32] erofs: Convert to use blkdev_get_handle_by_path() Jan Kara 2023-07-04 12:21 ` Jan Kara 2023-07-06 15:16 ` Gao Xiang 2023-07-06 15:16 ` Gao Xiang 2023-07-04 12:21 ` [PATCH 23/32] ext4: Convert to blkdev_get_handle_by_dev() Jan Kara 2023-07-04 12:21 ` [PATCH 24/32] f2fs: Convert to blkdev_get_handle_by_dev/path() Jan Kara 2023-07-04 12:21 ` [f2fs-dev] " Jan Kara 2023-07-04 12:21 ` [PATCH 25/32] jfs: Convert to blkdev_get_handle_by_dev() Jan Kara 2023-07-05 15:16 ` Dave Kleikamp 2023-07-04 12:21 ` [PATCH 26/32] nfs/blocklayout: Convert to use blkdev_get_handle_by_dev/path() Jan Kara 2023-07-04 12:21 ` [PATCH 27/32] nilfs2: Convert to use blkdev_get_handle_by_path() Jan Kara 2023-07-04 12:21 ` Jan Kara 2023-07-21 5:22 ` Ryusuke Konishi [this message] 2023-07-21 5:22 ` Ryusuke Konishi 2023-07-04 12:21 ` [PATCH 28/32] ocfs2: Convert to use blkdev_get_handle_by_dev() Jan Kara 2023-07-05 10:55 ` Joseph Qi 2023-07-04 12:21 ` [PATCH 29/32] reiserfs: Convert to blkdev_get_handle_by_dev/path() Jan Kara 2023-07-04 12:21 ` Jan Kara 2023-07-04 12:21 ` [PATCH 30/32] xfs: Convert to blkdev_get_handle_by_path() Jan Kara 2023-07-04 12:21 ` [PATCH 31/32] block: Remove blkdev_get_by_*() functions Jan Kara 2023-07-04 12:21 ` [PATCH 32/32] block: Rename blkdev_get_handle_by_*() and blkdev_handle_put() Jan Kara 2023-07-04 12:21 ` Jan Kara 2023-07-04 12:21 ` [dm-devel] " Jan Kara 2023-07-04 12:21 ` [f2fs-dev] " Jan Kara 2023-07-04 12:21 ` Jan Kara 2023-07-04 12:21 ` Jan Kara 2023-07-06 14:54 ` [PATCH RFC 0/32] block: Make blkdev_get_by_*() return handle Christoph Hellwig 2023-07-06 14:54 ` Christoph Hellwig 2023-07-06 14:54 ` Christoph Hellwig 2023-07-06 14:54 ` [dm-devel] " Christoph Hellwig 2023-07-06 14:54 ` [f2fs-dev] " Christoph Hellwig 2023-07-06 14:54 ` Christoph Hellwig
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='CAKFNMok9dE4MBB6J9_OLQMxJ=BC+kroFRZF5yCxaO3Njxr8eGw@mail.gmail.com' \ --to=konishi.ryusuke@gmail.com \ --cc=axboe@kernel.dk \ --cc=hch@infradead.org \ --cc=jack@suse.cz \ --cc=linux-block@vger.kernel.org \ --cc=linux-fsdevel@vger.kernel.org \ --cc=linux-nilfs@vger.kernel.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.