Whamcloud - gitweb
- changes in check of intent opc
authoryury <yury>
Wed, 31 May 2006 14:24:18 +0000 (14:24 +0000)
committeryury <yury>
Wed, 31 May 2006 14:24:18 +0000 (14:24 +0000)
lustre/liblustre/namei.c
lustre/llite/dcache.c
lustre/lmv/lmv_intent.c
lustre/mdc/mdc_locks.c

index 9889994..14b0518 100644 (file)
@@ -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;
         }
index c91ff99..49da1a5 100644 (file)
@@ -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.
index bc00e51..e439e56 100644 (file)
@@ -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);
index 4f09f78..c03dcca 100644 (file)
@@ -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. */