| To: | Takashi Sato <t-sato@xxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: [RFC PATCH 1/3] Implement generic freeze feature |
| From: | Christoph Hellwig <hch@xxxxxxxxxxxxx> |
| Date: | Sun, 25 May 2008 15:32:11 -0400 |
| Cc: | "linux-ext4@xxxxxxxxxxxxxxx" <linux-ext4@xxxxxxxxxxxxxxx>, "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>, "dm-devel@xxxxxxxxxx" <dm-devel@xxxxxxxxxx>, "linux-fsdevel@xxxxxxxxxxxxxxx" <linux-fsdevel@xxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx> |
| In-reply-to: | <20080522175020t-sato@mail.jp.nec.com> |
| References: | <20080522175020t-sato@mail.jp.nec.com> |
| Sender: | xfs-bounce@xxxxxxxxxxx |
| User-agent: | Mutt/1.5.17 (2007-11-01) |
> + if (test_and_set_bit(BD_FREEZE_OP, &bdev->bd_state))
> + return ERR_PTR(-EBUSY);
> +
> + sb = get_super_without_lock(bdev);
> +
> + /* If super_block has been already frozen, return. */
> + if (sb && sb->s_frozen != SB_UNFROZEN) {
> + put_super(sb);
> + clear_bit(BD_FREEZE_OP, &bdev->bd_state);
> + return sb;
> + }
The BD_FREEZE_OP flag in the block_device already prevents multiple
freezes for a singe block device, so there is no need for this
additional check and the get_super_without_lock helper.
> down(&bdev->bd_mount_sem);
And with that flag bd_mount_sem is also obsolete for preventing the
multiple freeze operations. We still need investigate what
synchronization we need vs unmount which also takes bd_mount_sem without
every having document what it exactly protects.
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: TAKE streamline init/exit path, Christoph Hellwig |
|---|---|
| Next by Date: | Re: [PATCH] use generic_*xattr routines, Timothy Shimmin |
| Previous by Thread: | [RFC PATCH 1/3] Implement generic freeze feature, Takashi Sato |
| Next by Thread: | Re: [RFC PATCH 1/3] Implement generic freeze feature, Takashi Sato |
| Indexes: | [Date] [Thread] [Top] [All Lists] |