Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4828245imm; Wed, 30 May 2018 12:51:20 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJOU5FWPPv9Tq8+8DtV9axWzCnTqiGQWhscb9rSDnGIPiBqgAx3/eZB8sRZlrjWw+rnNfud X-Received: by 2002:a63:6e8f:: with SMTP id j137-v6mr3247213pgc.453.1527709880432; Wed, 30 May 2018 12:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527709880; cv=none; d=google.com; s=arc-20160816; b=am6qnkE2o4wa18gCTSZYFx39W3OPPVgz01ovrcz04TZed59VTSB0enG5/KCwDY6Iv1 sO+XUxBF2qGiZxT6asBEIaKYx2EPqYJsNdhYFIGc2gRhe7kPNSSWfhrx4jPuZ9iOmUlT BGjlJxEqhieFE/GEi4jPQp/eRNVJiYYVwASUlGpEomhc0QQ59RFuoTAnJU5VKTknGvNM hB9kzbkVvDEA7HWu2rjA29FUlwf5ICOMR/z6eZ/6JLfJ2CKsr9rLn2OTm1AnvFCZI0wF 2Pp76NP5H9gAhwm+aNtsjZ24rxNpM+Afra8bei+OlXcdl8to7F4crGXDIvsyNJwAIFF2 +mGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=Ab64oAe7K6eaaasDI3XxYhVBr7BG4VKvkzlRREBfXWY=; b=yjcqilopplo0Obe2BBLNBdyJJIkQsiNzic2j+IpPp+blDUiUFR7S3S2TipC4xcQxIN PJvbWpPy/cfhE6I85v7TPsBg00stfMtpC/zrExfBjpFfWy2ne96dJZKw6DPeWy5ZhTbR RRQD/5MuUTmSfzgx+F0MUXkTm8Y6lRabw+mK1Ldq1csZOxKhg70EEKU6+OOoGM/amYEZ y/vKwQF10neucDmbfJhWhxX39j5H3oT0d91+tOO1sw9xRFV6EW1ycahKVVEA2EWMZX0r uLTP32/zxYlcI491Qhyb/vwvJNbgG5OA3fQ7+YMmS2PQAQngjk279MGP6bWxAOZTQWZt P2rQ== ARC-Authentication-Results: i=1; mx.google.com; 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 y21-v6si35424135pll.353.2018.05.30.12.51.06; Wed, 30 May 2018 12:51:20 -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; 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 S932375AbeE3TuY (ORCPT + 99 others); Wed, 30 May 2018 15:50:24 -0400 Received: from a2nlsmtp01-03.prod.iad2.secureserver.net ([198.71.225.37]:57164 "EHLO a2nlsmtp01-03.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753556AbeE3TuJ (ORCPT ); Wed, 30 May 2018 15:50:09 -0400 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id O75ofmcAedjTiO75ofBjha; Wed, 30 May 2018 12:49:08 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.91) (envelope-from ) id 1fO75o-0008Gn-9M; Wed, 30 May 2018 12:49:08 -0700 From: Long Li To: Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org Cc: Long Li Subject: [Patch v2 15/15] CIFS: Add direct I/O functions to file_operations Date: Wed, 30 May 2018 12:48:07 -0700 Message-Id: <20180530194807.31657-16-longli@linuxonhyperv.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180530194807.31657-1-longli@linuxonhyperv.com> References: <20180530194807.31657-1-longli@linuxonhyperv.com> Reply-To: longli@microsoft.com X-CMAE-Envelope: MS4wfHt0u8uYpgPH52yJw+53ktd7A7jZoCV+8C7XONbp+Z5jrUDW4a6UXVB0q24EItuHqvhY6bxHSs01KrRGknmzeuUzv7wMb9MSk2yKPEGqZ8an2qjbhHDk kMndfLr5Jq2J6vfKeuyYCR+wCeSS+4tdZI/U0n+57FX6yNvJlXHqkIbHWCrt80sIAvVwQD7plDCncP7l8BQAr/e2ACQNJd5h94giFeRq9K8jr8L72moAcmgn jne6lFst7AWNFGOCeOexOtV/was8bIRgTZEQXmIBi5h6V4KHVA3LLQufoR/MwGeBWFNk4+8itWD2E1/Xbfy9Sn1jGJeq0dSPtmQvK4e3jZqGH60r/zK5z0Fp b3wJVZ+1uoiXu3uNUoV4T/INYZE8+qWTgF3Nzoiu2OJPSNaF9uzbSPp7Jus73psWGEvUR10Z Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Long Li With direct read/write functions implemented, add them to file_operations. When mounting with "cache=none", CIFS uses direct I/O. Signed-off-by: Long Li --- fs/cifs/cifsfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 62f1662..e84f8c2 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -1113,9 +1113,8 @@ const struct file_operations cifs_file_strict_ops = { }; const struct file_operations cifs_file_direct_ops = { - /* BB reevaluate whether they can be done with directio, no cache */ - .read_iter = cifs_user_readv, - .write_iter = cifs_user_writev, + .read_iter = cifs_direct_readv, + .write_iter = cifs_direct_writev, .open = cifs_open, .release = cifs_close, .lock = cifs_lock, -- 2.7.4