Received: by 10.192.165.148 with SMTP id m20csp4002384imm; Mon, 30 Apr 2018 09:59:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr8r65wZfSMn7BdbSkpCyzpewx0/WjS/zTFIBSqkGyXve7U5LHyzmPit6zP2I20owYuKAD5 X-Received: by 2002:a63:7b55:: with SMTP id k21-v6mr10794479pgn.364.1525107592874; Mon, 30 Apr 2018 09:59:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525107592; cv=none; d=google.com; s=arc-20160816; b=GETIAPLxAkpCiPqiAuxoRbab8hUIBIoRDojoYCyI99/KuA+4wLf9uCmqIgIrghky4b 7u1x0jTDH1NBT3Qcqlo+T4Dtq4Bw30q0HkD+uwMcjs/F7b6+n08pHRhi4irMfF5gYE21 paW7vqGiMUqBFlv1aEqL3ugsv4EDi9u54DQwpl1B4azO9kiFTQqElRvxaJGt9N+tPgQ9 lqepwa040KjmcMZvRmnfEgTypw6MzO5Mkkf2r70sDtYAk594OcGRU+7PsVGSdu+dBTh0 OIX+89m6WuSkPbWQu/GVlGdyFdBEojhJGh6tCVoMlw7brKYMFTqO59w6mdmGGIZdyuCb W/5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=WfVCSFba1UBwr/c8zQ/QmBhHZGauuinA/uQAM/TX43A=; b=ZBkrLlsE2gBhU+4t1Wrm4U0g62HHh6oAzG/TODxYBmGdtH6xj6+2zRN5Q1QzDBQZ/L icZ3SgcCvmlS0h6FRd4mwcNWW99E/CWJxq6s/a9L/xQvLmsz2yZEKVB4n6+Exl+Ph5hD dxTVkZg6PWeifwLiQI6MzkcCf0QjKLEFgZnjNGe1zLRpOg84XSqhUhX+9esOxGif6xXk w7aKsX5l7mqLwOVRExzsMK971gm8Vx/i/HpiR67xri1GU/zQa11AhPRIHJrNCEq8jA5c pqyYnqSQgyVh8l+RZp4cK4e9kqzIE02VVbTUCgCeM3b0MCoCP5t04QUFdkql2zOakSXd D9uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=J48tvXpP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m4-v6si6480349pgs.291.2018.04.30.09.59.38; Mon, 30 Apr 2018 09:59:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=J48tvXpP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755132AbeD3Q57 (ORCPT + 99 others); Mon, 30 Apr 2018 12:57:59 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:20729 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755102AbeD3Q56 (ORCPT ); Mon, 30 Apr 2018 12:57:58 -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=1525107683; x=1556643683; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=m8SxWnk6c99ThL8PmFdq7NnPTh8PykOjDb3RspSTvZ4=; b=J48tvXpP8U6c7d+t3SVtKWV/SXn1vlPHS0OCTvsAjNa/S6CM0FwkE9yU hzqQqAvGJfO/jJN24gJKbgQ12LBNUw6y+h/R1tjdkUyHnc0iFJV3gkhnM 20aG1Wdt6guADtoYaqZ75tcTeX5GdXwLX4gtNZySZ5f2Skg2fze0C80Xi vFa59bIL/mF8gj/0t9UNdSMylrweupbseuTxTThMQvREXBzMYjooVKjyD 39Xu1MD1ZxYeCz9h2vwOfrzTwU1PB5kgbUrBvY5DH/3BP1+bRv2VhkGsc waJiepsrKDlcak5ViZ8dG9mBN4HCRZMWwImcBSDlfErg2txliJqElO+gx g==; X-IronPort-AV: E=Sophos;i="5.49,346,1520870400"; d="scan'208";a="173714669" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 01 May 2018 01:01:22 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 30 Apr 2018 09:49:18 -0700 Received: from penguito-adamm.sdcorp.global.sandisk.com ([10.11.47.13]) by uls-op-cesaip02.wdc.com with ESMTP; 30 Apr 2018 09:57:58 -0700 From: adam.manzanares@wdc.com To: viro@zeniv.linux.org.uk, bcrl@kvack.org Cc: linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, linux-abi-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Adam Manzanares Subject: [PATCH 1/2] fs: add RWF_IOPRIO Date: Mon, 30 Apr 2018 09:57:39 -0700 Message-Id: <20180430165740.2842-2-adam.manzanares@wdc.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180430165740.2842-1-adam.manzanares@wdc.com> References: <20180430165740.2842-1-adam.manzanares@wdc.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Adam Manzanares This is the per-I/O equivalent of the ioprio_set system call. When the RWF_IOPRIO flag is set then the aio_reqprio field of the iocb is interpreted as an I/O scheduling class and priority. Signed-off-by: Adam Manzanares --- include/linux/fs.h | 4 ++++ include/uapi/linux/fs.h | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 760d8da1b6c7..32614eb72a4a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -292,6 +292,7 @@ enum rw_hint { #define IOCB_SYNC (1 << 5) #define IOCB_WRITE (1 << 6) #define IOCB_NOWAIT (1 << 7) +#define IOCB_IOPRIO (1 << 8) struct kiocb { struct file *ki_filp; @@ -300,6 +301,7 @@ struct kiocb { void *private; int ki_flags; enum rw_hint ki_hint; + u16 ki_ioprio; /* See linux/ioprio.h */ } __randomize_layout; static inline bool is_sync_kiocb(struct kiocb *kiocb) @@ -3243,6 +3245,8 @@ static inline int kiocb_set_rw_flags(struct kiocb *ki, rwf_t flags) ki->ki_flags |= (IOCB_DSYNC | IOCB_SYNC); if (flags & RWF_APPEND) ki->ki_flags |= IOCB_APPEND; + if (flags & RWF_IOPRIO) + ki->ki_flags |= IOCB_IOPRIO; return 0; } diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index d2a8313fabd7..c8f69a00b566 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -380,8 +380,11 @@ typedef int __bitwise __kernel_rwf_t; /* per-IO O_APPEND */ #define RWF_APPEND ((__force __kernel_rwf_t)0x00000010) +/* per-IO IOPRIO */ +#define RWF_IOPRIO ((__force __kernel_rwf_t)0x00000020) + /* mask of flags supported by the kernel */ #define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\ - RWF_APPEND) + RWF_APPEND | RWF_IOPRIO) #endif /* _UAPI_LINUX_FS_H */ -- 2.15.1