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: 10387969 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 5F17E602D8 for ; Wed, 9 May 2018 01:34:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 309D628FF5 for ; Wed, 9 May 2018 01:34:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2506628FF8; Wed, 9 May 2018 01:34:53 +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=unavailable 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 B66AA28FF5 for ; Wed, 9 May 2018 01:34:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E1236B0318; Tue, 8 May 2018 21:34:33 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9695B6B0319; Tue, 8 May 2018 21:34:33 -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 80DA56B031A; Tue, 8 May 2018 21:34:33 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f197.google.com (mail-qk0-f197.google.com [209.85.220.197]) by kanga.kvack.org (Postfix) with ESMTP id 541BC6B0318 for ; Tue, 8 May 2018 21:34:33 -0400 (EDT) Received: by mail-qk0-f197.google.com with SMTP id u127so25415850qka.9 for ; Tue, 08 May 2018 18:34:33 -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=qbJVH6Y0Ozn/W+cs8nXrH0K+joG3UEmQXUTEoLqY3WA1IJpyoEtIcBanBWbjgk7TJ5 N3O1SdRpUXtd7gUkJr4nXsQDnzc+Cy+ks8yFmbVwwm3qTby51vVGcTbCRtqPdIRIQye5 9YpZCW6bwIgk+t35ELMnKNzRgUOfg+F968hQmxrs1oOSz4cgPT0KRtuqR48WJ2xYSgOW ClJ2rvMK3hQc7hKe+e8GWlF2jTS66E+UAfy28BxocieLvZ/Ph4etDasOI5aJgVcnIy// HoQaXHwygWZV34OYtCTO0FFEpp+G5T6hAOb/32j7phTKSDkH+6jRThXN5vJZKZGBEaiM kAjg== X-Gm-Message-State: ALKqPwcbUCPTmi8FjmGSLaLtlV32RPd0QiWyiF7Cf3RU60qpGtpVPwlq XcSWDXWbBO/S0HtHA3By49Nxv7Ozt8RD1DKnyDqglhA+PmmyNGg1+5KrUNY/VCgOcHJKVjZ0TT8 Qli/qbggQ6/gNt7kGVAJr0nmq48HsbS6+76e30G56exSrhfOxqRucpsrOZ76tBoMdoyTGrAg2p/ r64LUx8pg/1yOsSSpTd1vZRFyTbo5JKVKmw5s+32o0WIAtHRD++HMkvXMS3cZUZ/nid2iPcpo2r kQz4CZ7Jx93C01cUrlhfjjUhtgVEB7zeq2HwCANh+KQyekMFsM6Son0YB9K5RpmKdiYcOvi4mu3 oy3SVcEVDruFE8xqrBIoWVgrB8vNKprRKClKZVAdwfg/O8+qs+Lq+Odq69SCQbbzIYWZeQFpro/ 6 X-Received: by 10.55.166.77 with SMTP id p74mr3644927qke.296.1525829673154; Tue, 08 May 2018 18:34:33 -0700 (PDT) X-Received: by 10.55.166.77 with SMTP id p74mr3644909qke.296.1525829672608; Tue, 08 May 2018 18:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525829672; cv=none; d=google.com; s=arc-20160816; b=d0tLfwJUHTQQZqIe31bCdy+Lk2z9mkbuiC0SiVG2JzbP8obPe8PfAHgI0Q/3ag2/Rw tNnKN6R7/EomcLDhR4GurUt21b8KThPtKBLBcReSdWNi3qEFB3kk7iF9cXGiyY8BD3uc fiWPxVutvSu0TCx+F12YtNYCalTrQJ2q3yCI2NQtQe8LpQiw8FnM4dHTxrlqpgKNiH5i iTOSVqfp/KkAqEdLsnw+aXTYSmWr0lI4rQBYdA3FiTsLcmHcqEzdLpb+gi1hE7GJ+FIP pBMoiddce/QeKiEBMJwSDD/vh7voFE8CD4Nd07UevsME58bK+mWrFaiCdoiZovzzrskD zevA== 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=TjU/9dxZwrjCVtJo0pfGkux3L7aGK/RP+RYNdmWcY690M5awz118Xm2xz4eF3TVsht t/3KF8GmkJxUiN9Wrg8RtpqcJkMNMTdIrBE9Bz7f9N03g4TM3Wq3lEox983Cusj0oBHW 2P5kRGJqYLfDMULQ2kBUwaIPgHVMecl+kK+L4x+F0SwYN0LEhGkVxLZyCrmiuW9GQv6V CX+j35xfLz9ptLvJ7OFTAHMF8Xz4DHDQkajpQWkgrip52vdWB7PDDiXw3TpSQZPNPCJZ dDeKtYYx/KvNO/53aLtsR4H21bZgUdz3je90L3Py3zayifD1IR5yKg+CDWHwFFx06Ntz QL3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ow462KOc; 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 w66sor7688486qkc.24.2018.05.08.18.34.32 for (Google Transport Security); Tue, 08 May 2018 18:34:32 -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=Ow462KOc; 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=Ow462KOc9HRyc94JsCiOtdePPYIrwTWUc634AdAT8zhrHVRmvHJ+acNS1GTVnukqBJ 5B1mqRRGMJ8hZ8dIPijGbfc9cJvzIf56FzIUoB3FPhfDREyjz5VmoXgHOV5PTlPsGOgi US1zu5i03khz1TG0GWzwWkqgbohVPRx6aXQFdRwQ2X/Dggqy8Grne53EoZVtVBhky65J MlivxXMgTxqXe0C6dXce9TXwTVQWXslNKRUxcJh/fFGxRi7Pf7Jd+S0uADGa0L4FZmHj h0nJXxfotPtp3FKRVQO4FIoFhXSXTZDFUHhhtKxf7iS+/vf7DKKKt6xpAkaTs/ZcW3Zq s1OQ== 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> 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,