Received: by 10.192.165.156 with SMTP id m28csp213280imm; Sun, 15 Apr 2018 21:21:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+xlQVrZ1TYejj6gILeKIc1eF+fLs7fYLdlFlI4sGY6EqqL99A8k6JunG4Nos3HSbvVfcjI X-Received: by 10.99.124.20 with SMTP id x20mr8718445pgc.161.1523852507790; Sun, 15 Apr 2018 21:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523852507; cv=none; d=google.com; s=arc-20160816; b=wtocFf/znLvTWOhlL0pKT1GjK8/xbp2Wg1z/WOUxolDprN505R8nFr/ycBBjVAL2Sh QUxiStAk5f0EmuNOZOHVZN47YksmH1N6y7BevRc19lMkiLdTDRU6t7P79DxKJe/XXLzL getPu7sAsigzC08P2pvkxsmyTNmWrUoP+Yvd6MGqZUwK6vol/abxZ/Ewm/VLKaLGoW0Y wzGIp1GzDk9gGvBNGZC0YCvJ1weF0lrFrfVnOpYsAh54a/ASOub5es+joMmerqvUYDjK oDw46KJ8u9y7kAQhTEETtMMQfllzy/EDL4UHCkKd9qiOKCyRE07a3p+iNzeYuzkr/Gnl ho9A== 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:arc-authentication-results; bh=+9kMpDEOtJ/F+vWVuEiU9M8w4MvuQpi3gTMf6P2lv9w=; b=wpyjSl08Pm3gwMMzEvt5kSN0uhH4PtvuFurqGUc0hzRAJM/3H+9KjTNq8c7M/ICrar BiITG7S+GIr4u8062wS/E0rSVUWV5+lHvVtb8dRucOsEGfqezRiG31TvPxLCWsvI94+/ UmDnWl4lSaU5oE65hADrhtuo0g2S7bkt7S2v7pNW0C0DatMwDfE1vQ53hV/sEp5kQUhw NRY1S/q64pGDOMVS6rBL6IGQfR14NZEYJRDr9EW0GnXC7gDkbOUyp0OIdooYfrom9d9A XSVY3aiHZRlclg4hwcGYV1Nm9ayR+A4dHJLDzAiTRQE/0qopTuqhMouFX0p1nUG983Xz HsFw== 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 f15si8938022pgr.138.2018.04.15.21.21.33; Sun, 15 Apr 2018 21:21:47 -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 S1754063AbeDPET6 (ORCPT + 99 others); Mon, 16 Apr 2018 00:19:58 -0400 Received: from smtp4.ccs.ornl.gov ([160.91.203.40]:35548 "EHLO smtp4.ccs.ornl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753602AbeDPEPP (ORCPT ); Mon, 16 Apr 2018 00:15:15 -0400 Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id A4651100518E; Mon, 16 Apr 2018 00:15:12 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 9EF261FD; Mon, 16 Apr 2018 00:15:12 -0400 (EDT) From: James Simmons To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin , NeilBrown Cc: Linux Kernel Mailing List , Lustre Development List , Vitaly Fertman , James Simmons Subject: [PATCH 02/22] staging: lustre: obd: create it_has_reply_body() Date: Mon, 16 Apr 2018 00:14:51 -0400 Message-Id: <1523852111-17321-3-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1523852111-17321-1-git-send-email-jsimmons@infradead.org> References: <1523852111-17321-1-git-send-email-jsimmons@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vitaly Fertman The lookup_intent it_op fields in many cases will be compared to the settings of IT_OPEN | IT_UNLINK | IT_LOOKUP | IT_GETATTR. Create a simple inline function for this common case. Signed-off-by: Vitaly Fertman Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7433 Seagate-bug-id: MRP-3072 MRP-3137 Reviewed-on: http://review.whamcloud.com/17220 Reviewed-by: Andrew Perepechko Reviewed-by: Andriy Skulysh Tested-by: Elena V. Gryaznova Reviewed-by: John L. Hammond Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/obd.h | 10 ++++++++++ drivers/staging/lustre/lustre/mdc/mdc_locks.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index f1233ca..ea6056b 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -686,6 +686,16 @@ enum md_cli_flags { CLI_MIGRATE = BIT(4), }; +/** + * GETXATTR is not included as only a couple of fields in the reply body + * is filled, but not FID which is needed for common intent handling in + * mdc_finish_intent_lock() + */ +static inline bool it_has_reply_body(const struct lookup_intent *it) +{ + return it->it_op & (IT_OPEN | IT_UNLINK | IT_LOOKUP | IT_GETATTR); +} + struct md_op_data { struct lu_fid op_fid1; /* operation fid1 (usually parent) */ struct lu_fid op_fid2; /* operation fid2 (usually child) */ diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c index 695ef44..309ead1 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c @@ -568,7 +568,7 @@ static int mdc_finish_enqueue(struct obd_export *exp, it->it_op, it->it_disposition, it->it_status); /* We know what to expect, so we do any byte flipping required here */ - if (it->it_op & (IT_OPEN | IT_UNLINK | IT_LOOKUP | IT_GETATTR)) { + if (it_has_reply_body(it)) { struct mdt_body *body; body = req_capsule_server_get(pill, &RMF_MDT_BODY); -- 1.8.3.1