lkml.org 
[lkml]   [2015]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv2 04/10] zram: factor out device reset from reset_store()
On Thu, Apr 16, 2015 at 08:55:50PM +0900, Sergey Senozhatsky wrote:
> Device reset currently includes two steps:
> a) holding ->bd_mutex we ensure that there are no device users
> (bdev->bd_openers)
>
> b) and "internal" part (executed under bdev->bd_mutex and partially
> under zram->init_lock) that resets the device - frees allocated
> memory and returns the device back to its initial state.
>
> Up until now it worked just fine. But there will be yet another device
> reset user soon -- on-demand device removal. We currently can reuse (b),
> but step (a) is done in sysfs ATTR reset_store() handler, which makes it
> hard to use it in on-demand device reset path.
>
> Rename step (b) from zram_reset_device() to zram_reset_device_internal()

Usually, we use double underbar to show interal function so I prefer
__zram_reset_device to xxx_internal.

> and factor out step (a) to zram_reset_device().
>
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>

--
Kind regards,
Minchan Kim


\
 
 \ /
  Last update: 2015-04-23 04:41    [W:0.241 / U:29.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site