From patchwork Wed May 9 01:33:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 10387973 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 2E1F1602D8 for ; Wed, 9 May 2018 01:35:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3068285F0 for ; Wed, 9 May 2018 01:35:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E69EA28FF6; Wed, 9 May 2018 01:35:00 +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 948B8285F0 for ; Wed, 9 May 2018 01:35:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933611AbeEIBeh (ORCPT ); Tue, 8 May 2018 21:34:37 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:46509 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933576AbeEIBed (ORCPT ); Tue, 8 May 2018 21:34:33 -0400 Received: by mail-qk0-f196.google.com with SMTP id s70so26302545qks.13; Tue, 08 May 2018 18:34:33 -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=Ow462KOc9HRyc94JsCiOtdePPYIrwTWUc634AdAT8zhrHVRmvHJ+acNS1GTVnukqBJ 5B1mqRRGMJ8hZ8dIPijGbfc9cJvzIf56FzIUoB3FPhfDREyjz5VmoXgHOV5PTlPsGOgi US1zu5i03khz1TG0GWzwWkqgbohVPRx6aXQFdRwQ2X/Dggqy8Grne53EoZVtVBhky65J MlivxXMgTxqXe0C6dXce9TXwTVQWXslNKRUxcJh/fFGxRi7Pf7Jd+S0uADGa0L4FZmHj h0nJXxfotPtp3FKRVQO4FIoFhXSXTZDFUHhhtKxf7iS+/vf7DKKKt6xpAkaTs/ZcW3Zq s1OQ== 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=meDAGy9MsJlePdO5+eiyEPpAYyAJL19WRasuuSOWBFOwE6TBOIkif19/HEk6qLazN2 l6xm/3a0imal7+8n9Z13KY93HZw9m3gjisRtLuXBXxpd/sNYrTrPYedk9r1uoA6Qm5oe zZ3dWH6thlIvdiOkRKbqwaP7twt/efrFvIdN36Cv7VxlDD/aKb95nvDw365GbAYnGX5M +TeZJ71neFHQMUHYmQzIrF+HpmypS/i1dkpRn6gBIZB+WnmdDbjpcZ9Nmy0RXpzo8EPN pJkn67D21ZvFA4bvsTXWv8dnYiNS0LywSdtyKkDL8608p5tdnKQtiW/ruIqfr7YS3ZUP z2yQ== X-Gm-Message-State: ALKqPwdL7lhJLFLGrXmxERjD2a+LozX1/97hpYhV/DqiDo5x395PjCTG dvd9eeADe+9MjhaLrKO+v5WWsHVc0A== X-Google-Smtp-Source: AB8JxZpqB5spnt8gZ0KEnndPfFJmdEynRyjXHiQbKTGgru5xFKm2oxH3/sjfW1Ow1Z4A0H63CSS1gA== X-Received: by 10.55.188.68 with SMTP id m65mr16019141qkf.87.1525829672286; Tue, 08 May 2018 18:34:32 -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 x28-v6sm23719003qtx.95.2018.05.08.18.34.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 May 2018 18:34:31 -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: Tue, 8 May 2018 21:33:58 -0400 Message-Id: <20180509013358.16399-11-kent.overstreet@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509013358.16399-1-kent.overstreet@gmail.com> References: <20180509013358.16399-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,