* [PATCH] zram: check bd_openers instead bd_holders
@ 2015-02-03 4:50 Minchan Kim
2015-02-03 4:53 ` Sergey Senozhatsky
0 siblings, 1 reply; 2+ messages in thread
From: Minchan Kim @ 2015-02-03 4:50 UTC (permalink / raw)
To: Sergey Senozhatsky
Cc: Sergey Senozhatsky, Andrew Morton, linux-kernel, Linux-MM,
Nitin Gupta, Jerome Marchand, Ganesh Mahendran
On Tue, Feb 03, 2015 at 12:56:28PM +0900, Sergey Senozhatsky wrote:
> On (02/03/15 12:02), Minchan Kim wrote:
> > On Tue, Feb 03, 2015 at 10:54:33AM +0900, Sergey Senozhatsky wrote:
> > > On (02/02/15 16:06), Sergey Senozhatsky wrote:
> > > > So, guys, how about doing it differently, in less lines of code,
> > > > hopefully. Don't move reset_store()'s work to zram_reset_device().
> > > > Instead, move
> > > >
> > > > set_capacity(zram->disk, 0);
> > > > revalidate_disk(zram->disk);
> > > >
> > > > out from zram_reset_device() to reset_store(). this two function are
> > > > executed only when called from reset_store() anyway. this also will let
> > > > us drop `bool reset capacity' param from zram_reset_device().
> > > >
> > > >
> > > > so we will do in reset_store()
> > > >
> > > > mutex_lock(bdev->bd_mutex);
> > > >
> > > > fsync_bdev(bdev);
> > > > zram_reset_device(zram);
> > > > set_capacity(zram->disk, 0);
> > > >
> > > > mutex_unlock(&bdev->bd_mutex);
> > > >
> > > > revalidate_disk(zram->disk);
> > > > bdput(bdev);
> > > >
> > > >
> > > >
> > > > and change zram_reset_device(zram, false) call to simply zram_reset_device(zram)
> > > > in __exit zram_exit(void).
> > > >
> > >
> > > Hello,
> > >
> > > Minchan, Ganesh, I sent a patch last night, with the above solution.
> > > looks ok to you?
> >
> > Just I sent a feedback.
> >
>
> thanks.
> yeah, !FMODE_EXCL mode.
>
> how do you want to handle it -- you want to send a separate patch or
> you want me to send incremental one-liner and ask Andrew to squash them?
Send a new patch based on yours.
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] zram: check bd_openers instead bd_holders
2015-02-03 4:50 [PATCH] zram: check bd_openers instead bd_holders Minchan Kim
@ 2015-02-03 4:53 ` Sergey Senozhatsky
0 siblings, 0 replies; 2+ messages in thread
From: Sergey Senozhatsky @ 2015-02-03 4:53 UTC (permalink / raw)
To: Minchan Kim
Cc: Sergey Senozhatsky, Sergey Senozhatsky, Andrew Morton,
linux-kernel, Linux-MM, Nitin Gupta, Jerome Marchand,
Ganesh Mahendran
On (02/03/15 13:50), Minchan Kim wrote:
> Signed-off-by: Minchan Kim <minchan@kernel.org>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> ---
> drivers/block/zram/zram_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index a32069f98afa..cc0e6a3ddb4f 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -811,7 +811,7 @@ static ssize_t reset_store(struct device *dev,
>
> mutex_lock(&bdev->bd_mutex);
> /* Do not reset an active device! */
> - if (bdev->bd_holders) {
> + if (bdev->bd_openers) {
> ret = -EBUSY;
> goto out;
> }
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-03 4:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-03 4:50 [PATCH] zram: check bd_openers instead bd_holders Minchan Kim
2015-02-03 4:53 ` Sergey Senozhatsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox