From d549a0d970e7622e0bcd72e500df0bc4c6e92a33 Mon Sep 17 00:00:00 2001 From: yury Date: Wed, 31 May 2006 14:24:18 +0000 Subject: [PATCH] - changes in check of intent opc --- lustre/liblustre/namei.c | 4 ++-- lustre/llite/dcache.c | 2 +- lustre/lmv/lmv_intent.c | 6 +++--- lustre/mdc/mdc_locks.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lustre/liblustre/namei.c b/lustre/liblustre/namei.c index 9889994..14b0518 100644 --- a/lustre/liblustre/namei.c +++ b/lustre/liblustre/namei.c @@ -120,7 +120,7 @@ void llu_lookup_finish_locks(struct lookup_intent *it, struct pnode *pnode) } /* drop lookup/getattr locks */ - if (it->it_op == IT_LOOKUP || it->it_op == IT_GETATTR) + if (it->it_op & (IT_LOOKUP | IT_GETATTR)) ll_intent_release(it); } @@ -547,7 +547,7 @@ translate_lookup_intent(struct intent *intent, const char *path) /* conform to kernel code, if only IT_LOOKUP was set, don't * pass down it */ - if (!it->it_op || it->it_op == IT_LOOKUP) { + if (!it->it_op || it->it_op & IT_LOOKUP) { OBD_FREE(it, sizeof(*it)); it = NULL; } diff --git a/lustre/llite/dcache.c b/lustre/llite/dcache.c index c91ff99..49da1a5 100644 --- a/lustre/llite/dcache.c +++ b/lustre/llite/dcache.c @@ -251,7 +251,7 @@ void ll_lookup_finish_locks(struct lookup_intent *it, struct dentry *dentry) } /* drop lookup or getattr locks immediately */ - if (it->it_op == IT_LOOKUP || it->it_op == IT_GETATTR) { + if (it->it_op & (IT_LOOKUP | IT_GETATTR)) { #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) /* on 2.6 there are situation when several lookups and * revalidations may be requested during single operation. diff --git a/lustre/lmv/lmv_intent.c b/lustre/lmv/lmv_intent.c index bc00e51..e439e56 100644 --- a/lustre/lmv/lmv_intent.c +++ b/lustre/lmv/lmv_intent.c @@ -79,7 +79,7 @@ int lmv_intent_remote(struct obd_export *exp, void *lmm, * oh, MDS reports that this is remote inode case i.e. we have to ask * for real attrs on another MDS. */ - if (it->it_op == IT_LOOKUP/* || it->it_op == IT_CHDIR*/) { + if (it->it_op & IT_LOOKUP/* || it->it_op & IT_CHDIR*/) { /* * unfortunately, we have to lie to MDC/MDS to retrieve * attributes llite needs. @@ -645,7 +645,7 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data, if (rc) RETURN(rc); - if (it->it_op == IT_LOOKUP) + if (it->it_op & IT_LOOKUP) rc = lmv_intent_lookup(exp, pid, name, len, lmm, lmmsize, cid, it, flags, reqp, cb_blocking, extra_lock_flags); @@ -653,7 +653,7 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data, rc = lmv_intent_open(exp, pid, name, len, lmm, lmmsize, cid, it, flags, reqp, cb_blocking, extra_lock_flags); - else if (it->it_op == IT_GETATTR/* || it->it_op == IT_CHDIR*/) + else if (it->it_op & IT_GETATTR/* || it->it_op & IT_CHDIR*/) rc = lmv_intent_getattr(exp, pid, name, len, lmm, lmmsize, cid, it, flags, reqp, cb_blocking, extra_lock_flags); diff --git a/lustre/mdc/mdc_locks.c b/lustre/mdc/mdc_locks.c index 4f09f78..c03dcca 100644 --- a/lustre/mdc/mdc_locks.c +++ b/lustre/mdc/mdc_locks.c @@ -584,7 +584,7 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data, ldlm_it2str(it->it_op), it->it_flags); if (fid_is_sane(&op_data->fid2) && - (it->it_op == IT_LOOKUP || it->it_op == IT_GETATTR)) { + (it->it_op & (IT_LOOKUP | IT_GETATTR))) { /* We could just return 1 immediately, but since we should only * be called in revalidate_it if we already have a lock, let's * verify that. */ -- 1.8.3.1