Commit bad36cfd authored by Vitaly Fertman's avatar Vitaly Fertman Committed by Greg Kroah-Hartman

staging: lustre: obd: create it_has_reply_body()

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: default avatarVitaly Fertman <vitaly.fertman@seagate.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7433
Seagate-bug-id: MRP-3072 MRP-3137
Reviewed-on: http://review.whamcloud.com/17220Reviewed-by: default avatarAndrew Perepechko <andrew.perepechko@seagate.com>
Reviewed-by: default avatarAndriy Skulysh <andriy.skulysh@seagate.com>
Tested-by: default avatarElena V. Gryaznova <elena.gryaznova@seagate.com>
Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarLai Siyao <lai.siyao@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 15f7330b
...@@ -686,6 +686,16 @@ enum md_cli_flags { ...@@ -686,6 +686,16 @@ enum md_cli_flags {
CLI_MIGRATE = BIT(4), 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 md_op_data {
struct lu_fid op_fid1; /* operation fid1 (usually parent) */ struct lu_fid op_fid1; /* operation fid1 (usually parent) */
struct lu_fid op_fid2; /* operation fid2 (usually child) */ struct lu_fid op_fid2; /* operation fid2 (usually child) */
......
...@@ -568,7 +568,7 @@ static int mdc_finish_enqueue(struct obd_export *exp, ...@@ -568,7 +568,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
it->it_op, it->it_disposition, it->it_status); it->it_op, it->it_disposition, it->it_status);
/* We know what to expect, so we do any byte flipping required here */ /* 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; struct mdt_body *body;
body = req_capsule_server_get(pill, &RMF_MDT_BODY); body = req_capsule_server_get(pill, &RMF_MDT_BODY);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment