From patchwork Thu May 26 14:31:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Marshall X-Patchwork-Id: 9137035 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 92CEF6075A for ; Thu, 26 May 2016 14:31:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8713E28066 for ; Thu, 26 May 2016 14:31:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B55B282F5; Thu, 26 May 2016 14:31: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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 5922B28066 for ; Thu, 26 May 2016 14:31:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754093AbcEZObo (ORCPT ); Thu, 26 May 2016 10:31:44 -0400 Received: from mail-yw0-f175.google.com ([209.85.161.175]:35661 "EHLO mail-yw0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754058AbcEZObm (ORCPT ); Thu, 26 May 2016 10:31:42 -0400 Received: by mail-yw0-f175.google.com with SMTP id o16so78112076ywd.2 for ; Thu, 26 May 2016 07:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=omnibond-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=dbXEc89tNBHh6B28DdXHxR4O2lHqYMB/vCO8IqqWwSw=; b=ICVD8W1mlTUA9Uv25IRNAuLEOIrthCchfPuslc0u8zecVLAp4EW7PgJVXgioSuTidJ 6EhkXu8pnM4IFVqBl+SCuj5DSFr1/92IDbj3vozfVBwtvgSGF/yiHqnlnVOYNt2fSx2k sYnypL6wO/K3TbCwoV3r82b025ul3Qm/5u5jbIXotE9GzAiuBb2M22y+jdN9vB71HOeO FCumiDEXbD/wkWcQypZBouDO1JiUn5XMzwiGdnerfUzB0CdDuJyIz4YaWaPBdWlPsE2k 0eurK2LghV4NnzXXZbYv95QZBiPYrfSWiAGw5yb4vDJi7frbIBJ03dppfvdfTuMqiG1H crbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dbXEc89tNBHh6B28DdXHxR4O2lHqYMB/vCO8IqqWwSw=; b=nCJS1tPuL7NRi+3DLyv3LSPOj1h/UFd0Ac7gsrxwM43jA5hXkwMwdh+IwEuFlktkuc v22rQ8H5F4eN1lNmymsALFuTCh3hoUlDaDJzIhvcqcV0g2+yvh0mfnCcxgbTQ7LnLdZN plVjK9mflf5YeShendQ1My61GHjFI5t00xWbTBG+W/1Cm0GnHeXN+n9WR5yNYo10RhJD Cen8895m0FxXia6MWEHYzVZYnnS6RYa+DHdFzXGmTAt/nmCqam/sPOdRiwUxIY3mtCP0 Xr7A2TBHkLv3hs+gbg87Jj37uU48YN9dEJF9o5b26usFivYVIVH3vcLB/Pn2BJ2EJdb3 Lo4A== X-Gm-Message-State: ALyK8tJRYTblxMqKeEdRFLEFXFDtqxhCAzPBMuKm23rWPcmbs2Xwpj8B6bhQDJ1UXMgquw== X-Received: by 10.37.221.198 with SMTP id u189mr5413900ybg.14.1464273101759; Thu, 26 May 2016 07:31:41 -0700 (PDT) Received: from logtruck.clemson.edu (logtruck.clemson.edu. [130.127.148.78]) by smtp.gmail.com with ESMTPSA id m188sm2517664ywe.46.2016.05.26.07.31.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 May 2016 07:31:41 -0700 (PDT) From: hubcap X-Google-Original-From: hubcap To: linux-fsdevel@vger.kernel.org Cc: Mike Marshall Subject: [PATCH] Orangefs: pseudo-support O_DIRECT, or, O_DIRECT as a hint. Date: Thu, 26 May 2016 10:31:34 -0400 Message-Id: <1464273094-31862-1-git-send-email-hubcap@logtruck.clemson.edu> X-Mailer: git-send-email 1.8.3.1 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mike Marshall Allow userspace applications to use O_DIRECT in open without failing on EINVAL. Signed-off-by: Mike Marshall --- There was a thread about making O_DIRECT a hint a few weeks ago - always allow it, and just let the file system deal with it however it wants. I know that would make some OrangeFS users happy, so in the mean time, here is a patch that will make OrangeFS allow O_DIRECT, if y'all think it looks OK, I'd like to try to get it pulled... fs/orangefs/inode.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index 85640e9..df53830 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -124,19 +124,17 @@ static int orangefs_releasepage(struct page *page, gfp_t foo) * will need to be able to use O_DIRECT on open in order to support * AIO. Modeled after NFS, they do this too. */ -/* - * static ssize_t orangefs_direct_IO(int rw, - * struct kiocb *iocb, - * struct iov_iter *iter, - * loff_t offset) - *{ - * gossip_debug(GOSSIP_INODE_DEBUG, - * "orangefs_direct_IO: %s\n", - * iocb->ki_filp->f_path.dentry->d_name.name); - * - * return -EINVAL; - *} - */ + +static ssize_t orangefs_direct_IO(struct kiocb *iocb, + struct iov_iter *iter, + loff_t offset) +{ + gossip_debug(GOSSIP_INODE_DEBUG, + "orangefs_direct_IO: %s\n", + iocb->ki_filp->f_path.dentry->d_name.name); + + return -EINVAL; +} struct backing_dev_info orangefs_backing_dev_info = { .name = "orangefs", @@ -150,7 +148,7 @@ const struct address_space_operations orangefs_address_operations = { .readpages = orangefs_readpages, .invalidatepage = orangefs_invalidatepage, .releasepage = orangefs_releasepage, -/* .direct_IO = orangefs_direct_IO */ + .direct_IO = orangefs_direct_IO, }; static int orangefs_setattr_size(struct inode *inode, struct iattr *iattr)