From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756890AbbDWC3u (ORCPT ); Wed, 22 Apr 2015 22:29:50 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:33776 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752529AbbDWC3r (ORCPT ); Wed, 22 Apr 2015 22:29:47 -0400 Date: Thu, 23 Apr 2015 11:29:41 +0900 From: Minchan Kim To: Sergey Senozhatsky Cc: Andrew Morton , Nitin Gupta , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCHv2 04/10] zram: factor out device reset from reset_store() Message-ID: <20150423022941.GC24928@blaptop> References: <1429185356-11096-1-git-send-email-sergey.senozhatsky@gmail.com> <1429185356-11096-5-git-send-email-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1429185356-11096-5-git-send-email-sergey.senozhatsky@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: Minchan Kim -- Kind regards, Minchan Kim