From patchwork Fri May 18 07:49:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 10408397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 41441601F9 for ; Fri, 18 May 2018 07:50:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 332A92886E for ; Fri, 18 May 2018 07:50:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 273AC28892; Fri, 18 May 2018 07:50:29 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A80672886E for ; Fri, 18 May 2018 07:50:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC0B06B0595; Fri, 18 May 2018 03:50:25 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C703B6B0596; Fri, 18 May 2018 03:50:25 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B124E6B0597; Fri, 18 May 2018 03:50:25 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f198.google.com (mail-qk0-f198.google.com [209.85.220.198]) by kanga.kvack.org (Postfix) with ESMTP id 7E17F6B0595 for ; Fri, 18 May 2018 03:50:25 -0400 (EDT) Received: by mail-qk0-f198.google.com with SMTP id y124-v6so6184456qkc.8 for ; Fri, 18 May 2018 00:50:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=Rv3LX93vzi/pAAeguDBUHSRdHWKeCE08PUlCGw8LurE=; b=C1EzyAAwZbPc3qRy804H0qG/2d3DoVtRoEcc7hPzgcaogzdIf01Gyw7gG5sncZLEDd CQWTJYRRN67eiu3P5+8hKKF8HuTnSrN7BjTUm2QglAq50JFBLEkgZOX4KPrFPqW18Nmg Ubj50ECkkNv1Zc/r2Qe2AbH7N/5hcuDs3I0ss7rQu/mmj5jwlrLDDXnB4cBSDNz/uJqy Lb9ZCcy2EJb222i+Vm/xZFAOkeXBPvySxE9UmZObdY29gaiZogUMmTbgOJ33iiPltPVS u9kAkJNv1VH3BcIgDTrrjE2+yWHW4zIy0B9pfAjOEWQtsZt+6fbtJ7to28XMZbkZGSdZ f0ow== X-Gm-Message-State: ALKqPwdKJPaKOXzAxSql2OrgYNuRwbHClFhDAJKlaq5KFunAvklkx15D YKZL5tEzCoY2P9aZY/gminUrals+lQyHTBTUzKWKCPorCYRWl1jq+v9DhPLX+RAnBJvOnb+n23K 43bDDQxc9MH1H3DCeOb8yP1ZygAKni537v/tTSM+AnHt3MkgAXpGaSC2WSE19D1lZ4jOCmEi7yn 802sOHZyl50QiyScG6FuDsiNSlYHWfGFFuFcGzNXdWmVDXtYccHpxtP9rClGJH2vkFSt3o7LOgf 7M8iJcn4UyLsPZZ/RhoI7lQINthzfgDm+3KMSIl6sRPCHy/l2D/WFlwPh2oKNTu3+O+VnJdlZ0R HNS9d5kB8dfE2WiB9q57rIJMiL+u0m0vzDH8JFUUorhlBPmfNTX7SL/EbmLjSf4WP/mDflFCP/r b X-Received: by 2002:a37:cc05:: with SMTP id r5-v6mr7546686qki.169.1526629825331; Fri, 18 May 2018 00:50:25 -0700 (PDT) X-Received: by 2002:a37:cc05:: with SMTP id r5-v6mr7546676qki.169.1526629824879; Fri, 18 May 2018 00:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526629824; cv=none; d=google.com; s=arc-20160816; b=KxLeNaeZ4C+IbjF1Dc+8TfSWh34gNEUehGjA5xJCDXH+F1UQjyX0CZ8v1MEtzK+zzB hrLqEk/yRuIUlMuX+TwESkLtg+dSnzCRelHxbojbTEp2cv3IaNVqDQrJVDPVN7xff0bn wn2jeY6p4PEZry0bQvuuzfmEPAF9aa/9jiInXmbaZSJGEodOdKhguovIPD7TcwAztfLy EK5gOWBzDOrOphItnaXIq1AT5v8sQ5VdQCmomh86zecqxTFL5IL5jPfP7pGKXU0cZqug 0HZ5HOE5pys67Y+vHixH35v2ctN+lFAX8I1ZDlB7r9OJ8TyIaHVddPE+F/hwI76b/awD oOaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Rv3LX93vzi/pAAeguDBUHSRdHWKeCE08PUlCGw8LurE=; b=En5ze3ZBL/ncl2QizhtrlUuBgIUfTQ9Aa9LIuyPT070yWjyaeoX1SqRenpXqf/rIcs rYtkD2Z5G1ddMnQP9RIGcaZLG9lu6sUNrd4Z3waOlNJMrvWgB7KXx+qspQig78jmDX4S WocbTuimHeXfgnyQJVf7utEWPR1gi/mhqinGDDzxT8Hu/PRewQFsjvQGlik5iyK7NTF0 ruRZnBOZyH5SxpybqIxrnb9MTh/1VfeoK+JfpTcdyizTz8kVs6FsD+R1jVmK6sqzmQF7 HHS9LltccVMYt1YWoJXGwklwYrhCT3Pbmyj3zVAqIiiylKCfzulbChhe0lDUkreXaJNY mc6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j9eZA86T; spf=pass (google.com: domain of kent.overstreet@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=kent.overstreet@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id m42-v6sor5165885qvg.160.2018.05.18.00.50.24 for (Google Transport Security); Fri, 18 May 2018 00:50:24 -0700 (PDT) Received-SPF: pass (google.com: domain of kent.overstreet@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j9eZA86T; spf=pass (google.com: domain of kent.overstreet@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=kent.overstreet@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Rv3LX93vzi/pAAeguDBUHSRdHWKeCE08PUlCGw8LurE=; b=j9eZA86TlNncshVcGnHDewlz4p0X7kMg9q/HeDmTcsIdhhQc5y1Xr3pEymwt/+iEQm J3RW/KgV4eqdus33bpiKBaKIjEv6onOvo87NFqglmWhTg1ILVpcgZyOosRwrZ6/PlO6u W5DiUdvYBsZYfbooigUczqm3fb/G92ASTrvjLgVLPIlwpUv8LIo/frwWI3IYPPlDh7xv 3gcP5cuvpl9gV+12OhIBXwDuIme9EL9HIKZfJqNsBCVlQM2ezwQbOfzq4K3fjxRgAH8C v1YimRkfTo6X4LMKzwIUbYn9QMWBYhw/Rs/EEqi+BV6rC0zveUuuTSJF9lSlC48rube1 vHbA== X-Google-Smtp-Source: AB8JxZp3HKLgdbQ80me75owMpd/jZDP35PO9RvAK1nnZP6V5l6nLAuUM6+OKEAeGc6Mc2VTt9emcrQ== X-Received: by 2002:a0c:bc85:: with SMTP id l5-v6mr8065388qvg.242.1526629824582; Fri, 18 May 2018 00:50:24 -0700 (PDT) Received: from localhost.localdomain (c-71-234-172-214.hsd1.vt.comcast.net. [71.234.172.214]) by smtp.gmail.com with ESMTPSA id s64-v6sm5443004qkl.85.2018.05.18.00.50.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 00:50:23 -0700 (PDT) From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, Jens Axboe , Ingo Molnar Cc: Kent Overstreet Subject: [PATCH 10/10] block: Add sysfs entry for fua support Date: Fri, 18 May 2018 03:49:17 -0400 Message-Id: <20180518074918.13816-20-kent.overstreet@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518074918.13816-1-kent.overstreet@gmail.com> References: <20180518074918.13816-1-kent.overstreet@gmail.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Kent Overstreet --- block/blk-sysfs.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index cbea895a55..d6dd7d8198 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -497,6 +497,11 @@ static ssize_t queue_wc_store(struct request_queue *q, const char *page, return count; } +static ssize_t queue_fua_show(struct request_queue *q, char *page) +{ + return sprintf(page, "%u\n", test_bit(QUEUE_FLAG_FUA, &q->queue_flags)); +} + static ssize_t queue_dax_show(struct request_queue *q, char *page) { return queue_var_show(blk_queue_dax(q), page); @@ -665,6 +670,11 @@ static struct queue_sysfs_entry queue_wc_entry = { .store = queue_wc_store, }; +static struct queue_sysfs_entry queue_fua_entry = { + .attr = {.name = "fua", .mode = S_IRUGO }, + .show = queue_fua_show, +}; + static struct queue_sysfs_entry queue_dax_entry = { .attr = {.name = "dax", .mode = S_IRUGO }, .show = queue_dax_show, @@ -714,6 +724,7 @@ static struct attribute *default_attrs[] = { &queue_random_entry.attr, &queue_poll_entry.attr, &queue_wc_entry.attr, + &queue_fua_entry.attr, &queue_dax_entry.attr, &queue_wb_lat_entry.attr, &queue_poll_delay_entry.attr,