From patchwork Thu Jul 11 17:53:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11040609 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 284FE112C for ; Thu, 11 Jul 2019 17:54:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19C8728B35 for ; Thu, 11 Jul 2019 17:54:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E31828B38; Thu, 11 Jul 2019 17:54:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AACA228B35 for ; Thu, 11 Jul 2019 17:54:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728506AbfGKRyl (ORCPT ); Thu, 11 Jul 2019 13:54:41 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:53317 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728355AbfGKRyl (ORCPT ); Thu, 11 Jul 2019 13:54:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1562867781; x=1594403781; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=0kR/LVp4gkK7dEG1CCXX7pXv456iO8kz4Pv9gPI+EsM=; b=Z0MwpfaEpiYibZaE7UoklfoLLD/VCN2sSit7AdvRog8Cfas4SI7RVhJ3 KRlFz4vazPE+DPBd8ODcOdhIn0YprQfd+d9aZtxjeE2+n3hXh7yAwJwRv 99dsEm+IQFKT55bjCLSoO06uos3GN0eEI+ku6dmT6LA0bj1nCabRLTWoL IdVdm5UgWJeHTIrsEE5UtgP/zx5KzksNhzPfuwGeLzsonkMnhCHTYzmct 6xyGXoytLsrRsB/zcVegraZQtA8pu5BJ1vx1wpjqZo/Q/d64n0CczBP1j iDwKjPspepjMUWlAa+Cqhi9sUlAnB9b3TWH7+z6LYBfTBBbQcNVT/134f g==; IronPort-SDR: PDikRJ7bDr/KZFo7LGKvKb5BCoOlVZ2JbTMIIgvkRo4dC2b6fNIKrT2IyIKC0UNpCmnpKwcWvO qcvbBl/8eZv27Do//OWCVwJUbkGVzANdchDwdjMQm2V/p3SfjpgsXAL3PM/k/9//p2rznMfbiF 7cEklCkzQOgcImbp8EtvteAKWYo4LZr2neZ5T4mBWZAW0bM9gOjbrlFzm48fzTD5rzKeOwBAOG zUQJgofChjBAcqLRT03Uh/WKI/aDVpKyHvhGF5Z9Eu8uX68wKpw3Gmxw7SUP8ehDh9cAe9vXyF +HE= X-IronPort-AV: E=Sophos;i="5.63,479,1557158400"; d="scan'208";a="212743457" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 12 Jul 2019 01:56:21 +0800 IronPort-SDR: marXlQ5+XwECqVPBUMoocqVjQsuMoVE6Kq763GtAzTAD4wocXQMhPMXWKbUmxn5RBjiL582Ltp nVVFU0n/LU1vpDl25K6nspMjv6dDlAHMTyE9wagLVNGXoUVQYEDcr83zcoJ8Jw/ez2o11G4Iw1 tpAnERptYVPXgw9JNjXB0di6ZbxssDnDBqRCNJHZyiiKcBdh9CENjil4wNotXCX/PdgqYSSmoo BSfaON+QMnqqrMbfxF9r8YhPlYEKytKxWRElm2k4X3GFc1kwif4jFiWxYRux7Y/Mpl33AtVjKG 7/Kd3oiLafONaRh2t74H06sY Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 11 Jul 2019 10:53:17 -0700 IronPort-SDR: qI3xwlKL3Y0mzoBWFCOUX962FlyEf26e/QeDjsupfoxlnGJNjEnGXZscuSdMzRrN/LJkdUFUgs WcSeJSu4rOPw8XPr/bgAlaxezMF8WHXprKRkV1Ypsrim7SyJ8papAfah7eU1aEg/EEcxNY+aXF Fa8IKBGxnQBSFBSNLOr7LzB75plBwIm7HjCuvroRtZR8Ol9JTc5pHtngfx193fJfhY/XOzq+GU M0BxQ4+xovOlV7hYIotVRH3cEN2kfAw0XkLjVKrPFEI3eFh22Ubk+S/BkgojJQTPjLuOyzglrc 8Ps= Received: from cvenusqemu.hgst.com ([10.202.66.73]) by uls-op-cesaip02.wdc.com with ESMTP; 11 Jul 2019 10:54:40 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: axboe@kernel.dk, hch@lst.de, Chaitanya Kulkarni Subject: [PATCH 7/8] null_blk: add support for configfs write_zeroes Date: Thu, 11 Jul 2019 10:53:27 -0700 Message-Id: <20190711175328.16430-8-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190711175328.16430-1-chaitanya.kulkarni@wdc.com> References: <20190711175328.16430-1-chaitanya.kulkarni@wdc.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds a new configfs parameter to enable REQ_OP_WRITE_ZEROES feature for null_blk similar to REQ_OP_DISCARD when device is memory backed. Signed-off-by: Chaitanya Kulkarni --- drivers/block/null_blk_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c index 30cb90553167..c734ddaa697f 100644 --- a/drivers/block/null_blk_main.c +++ b/drivers/block/null_blk_main.c @@ -308,6 +308,7 @@ NULLB_DEVICE_ATTR(blocking, bool); NULLB_DEVICE_ATTR(use_per_node_hctx, bool); NULLB_DEVICE_ATTR(memory_backed, bool); NULLB_DEVICE_ATTR(discard, bool); +NULLB_DEVICE_ATTR(write_zeroes, bool); NULLB_DEVICE_ATTR(mbps, uint); NULLB_DEVICE_ATTR(cache_size, ulong); NULLB_DEVICE_ATTR(zoned, bool); @@ -423,6 +424,7 @@ static struct configfs_attribute *nullb_device_attrs[] = { &nullb_device_attr_power, &nullb_device_attr_memory_backed, &nullb_device_attr_discard, + &nullb_device_attr_write_zeroes, &nullb_device_attr_mbps, &nullb_device_attr_cache_size, &nullb_device_attr_badblocks, @@ -481,7 +483,7 @@ nullb_group_drop_item(struct config_group *group, struct config_item *item) static ssize_t memb_group_features_show(struct config_item *item, char *page) { - return snprintf(page, PAGE_SIZE, "memory_backed,discard,bandwidth,cache,badblocks,zoned,zone_size\n"); + return snprintf(page, PAGE_SIZE, "memory_backed,discard,write_zeroes,bandwidth,cache,badblocks,zoned,zone_size\n"); } CONFIGFS_ATTR_RO(memb_group_, features);