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: 10408413 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 9267C601F9 for ; Fri, 18 May 2018 07:51:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 861AA2886A for ; Fri, 18 May 2018 07:51:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AD2128875; Fri, 18 May 2018 07:51:30 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 252852886A for ; Fri, 18 May 2018 07:51:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751986AbeERHvD (ORCPT ); Fri, 18 May 2018 03:51:03 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:42313 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751506AbeERHuZ (ORCPT ); Fri, 18 May 2018 03:50:25 -0400 Received: by mail-qt0-f194.google.com with SMTP id c2-v6so9162800qtn.9; Fri, 18 May 2018 00:50:25 -0700 (PDT) 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-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Rv3LX93vzi/pAAeguDBUHSRdHWKeCE08PUlCGw8LurE=; b=MexLSXbT3t0nUQLOwFjhkTpE3kKm/NVtiYZE6qSV8+EablgFlOm8VOn401neOOU3Uk lgQDfjd+XRV/N5RAXmI6xmL6mKdyWegzuNBLLYomCNVcle22B/kd7Aa8L6x0J9rSEw2r HKknmsr2zB/LHekXRCABHjLs+ndQy/eeEDvR7X23pldgxBTwdS6cvoxpK7DDZceO1ULK D1aVfZKSHHjooCb9oj7OwdTBDncLZe5AyVzzrxaS/oE4E21rdMqgblOxYmDnq/+86eUW LmHmrPKsmZDVtV64puyQjOueer7rKu40tWBxX9Hg62MDTeykb03UR+sPSnfj8dEBtQdx 63Pg== X-Gm-Message-State: ALKqPweYsZjTwn3qW/oRVvSArOH74NXHL7TIdD8lPMWNygsNkEUdhR+I LnSPI8PyhA0qLgxSvcK/daRrClv61w== 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> 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 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,