From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756311AbbCCMtc (ORCPT ); Tue, 3 Mar 2015 07:49:32 -0500 Received: from mail-pd0-f179.google.com ([209.85.192.179]:38077 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755896AbbCCMtb (ORCPT ); Tue, 3 Mar 2015 07:49:31 -0500 From: Sergey Senozhatsky To: Andrew Morton , Minchan Kim Cc: Nitin Gupta , linux-kernel@vger.kernel.org, Sergey Senozhatsky , Sergey Senozhatsky Subject: [PATCHv3 0/8] introduce dynamic device creation/removal Date: Tue, 3 Mar 2015 21:49:42 +0900 Message-Id: <1425386990-6339-1-git-send-email-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.3.1.167.g7f4ba4b Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, This patchset introduces zram-control sysfs class, which has two sysfs attrs: - zram_add -- add a new specific (device_id) zram device - zram_remove -- remove a specific (device_id) zram device Usage example: # add a new specific zram device echo 4 > /sys/class/zram-control/zram_add # remove a specific zram device echo 4 > /sys/class/zram-control/zram_remove Patch set also does some cleanups and huge code reorganization. v3: -- add missing add/remove documentation -- add patch 0008 -- pair class register with unregister, not class destroy function -- do not leak class on register_blkdev() error -- fix kernel version typo (should be 4.1) in documentation v2: -- switch to sysfs class, rather than using /dev/zram-control node and doing IOCTL on it. we lose some features, though. like automatic device_id generation. Sergey Senozhatsky (8): zram: cosmetic ZRAM_ATTR_RO code formatting tweak zram: use idr instead of `zram_devices' array zram: factor out device reset from reset_store() zram: reorganize code layout zram: add dynamic device add/remove functionality zram: remove max_num_devices limitation zram: report every added and removed device zram: trivial: correct flag operations comment Documentation/ABI/testing/sysfs-class-zram | 23 + Documentation/blockdev/zram.txt | 21 +- drivers/block/zram/zram_drv.c | 795 +++++++++++++++++------------ drivers/block/zram/zram_drv.h | 6 - 4 files changed, 499 insertions(+), 346 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-class-zram -- 2.3.1.167.g7f4ba4b