Whamcloud - gitweb
Branch b1_8
authortianzy <tianzy>
Fri, 13 Mar 2009 11:09:37 +0000 (11:09 +0000)
committertianzy <tianzy>
Fri, 13 Mar 2009 11:09:37 +0000 (11:09 +0000)
change O_CHECK_STALE to M_CHECK_STALE so that doesn't conflict with
VFS flags.
b=16277
i=green
i=adilger

lustre/include/lustre/lustre_user.h
lustre/include/lustre_mds.h
lustre/llite/dcache.c
lustre/llite/file.c
lustre/mdc/mdc_lib.c
lustre/mdc/mdc_locks.c

index 4dfafcd..09081ae 100644 (file)
@@ -114,12 +114,7 @@ struct obd_statfs;
 #define LL_IOC_OBD_STATFS       IOC_OBD_STATFS
 #define IOC_MDC_GETSTRIPE       IOC_MDC_GETFILESTRIPE
 
-/* Do not define O_CHECK_STALE as 0200000000,
- * which is conflict with MDS_OPEN_OWNEROVERRIDE */
-#define O_CHECK_STALE       020000000  /* hopefully this does not conflict */
-
 #define O_LOV_DELAY_CREATE 0100000000  /* hopefully this does not conflict */
-#define O_JOIN_FILE        0400000000  /* hopefully this does not conflict */
 
 #define LL_FILE_IGNORE_LOCK             0x00000001
 #define LL_FILE_GROUP_LOCKED            0x00000002
index 2d014a1..87c6978 100644 (file)
@@ -308,4 +308,9 @@ struct md_enqueue_info {
         void                   *mi_cbdata;
 };
 
+/* these are local flags, used only on the client, private */
+#define M_CHECK_STALE           0200000000 
+#define M_JOIN_FILE             0400000000 /* its counterpart is
+                                            * MDS_OPEN_JOIN_FILE */
+
 #endif
index 1692859..d3abbfc 100644 (file)
@@ -449,10 +449,10 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
 
 do_lock:
         it->it_create_mode &= ~current->fs->umask;
-        it->it_flags |= O_CHECK_STALE;
+        it->it_create_mode |= M_CHECK_STALE;
         rc = mdc_intent_lock(exp, &op_data, NULL, 0, it, lookup_flags,
                              &req, ll_mdc_blocking_ast, 0);
-        it->it_flags &= ~O_CHECK_STALE;
+        it->it_create_mode &= ~M_CHECK_STALE;
         if (it->it_op == IT_GETATTR && !first)
                 /* If there are too many locks on client-side, then some
                  * locks taken by statahead maybe dropped automatically
index d9f1840..a99040a 100644 (file)
@@ -524,9 +524,9 @@ restart:
                            would attempt to grab och_sem as well, that would
                            result in a deadlock */
                         up(&lli->lli_och_sem);
-                        it->it_flags |= O_CHECK_STALE;
+                        it->it_create_mode |= M_CHECK_STALE;
                         rc = ll_intent_file_open(file, NULL, 0, it);
-                        it->it_flags &= ~O_CHECK_STALE;
+                        it->it_create_mode &= ~M_CHECK_STALE;
                         if (rc) {
                                 ll_file_data_put(fd);
                                 GOTO(out_openerr, rc);
@@ -2444,7 +2444,8 @@ static int join_file(struct inode *head_inode, struct file *head_filp,
 {
         struct dentry *tail_dentry = tail_filp->f_dentry;
         struct lookup_intent oit = {.it_op = IT_OPEN,
-                                   .it_flags = head_filp->f_flags|O_JOIN_FILE};
+                                    .it_flags = head_filp->f_flags,
+                                    .it_create_mode = M_JOIN_FILE};
         struct ldlm_enqueue_info einfo = { LDLM_IBITS, LCK_PW,
                 ll_mdc_blocking_ast, ldlm_completion_ast, NULL, NULL };
 
@@ -3147,13 +3148,13 @@ int ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it)
                 /* Call getattr by fid, so do not provide name at all. */
                 ll_prepare_mdc_op_data(&op_data, dentry->d_parent->d_inode,
                                        dentry->d_inode, NULL, 0, 0, NULL);
-                oit.it_flags |= O_CHECK_STALE;
+                oit.it_create_mode |= M_CHECK_STALE;
                 rc = mdc_intent_lock(exp, &op_data, NULL, 0,
                                      /* we are not interested in name
                                         based lookup */
                                      &oit, 0, &req,
                                      ll_mdc_blocking_ast, 0);
-                oit.it_flags &= ~O_CHECK_STALE;
+                oit.it_create_mode &= ~M_CHECK_STALE;
                 if (rc < 0) {
                         rc = ll_inode_revalidate_fini(inode, rc);
                         GOTO (out, rc);
index 1e61f0f..c52aaa7 100644 (file)
@@ -234,7 +234,7 @@ void mdc_create_pack(struct ptlrpc_request *req, int offset,
                                    mode, uid, gid, cap_effective, rdev);
 }
 
-static __u32 mds_pack_open_flags(__u32 flags)
+static __u32 mds_pack_open_flags(__u32 flags, __u32 mode)
 {
         __u32 cr_flags = (flags & (FMODE_READ | FMODE_WRITE |
                                    MDS_OPEN_DELAY_CREATE | MDS_OPEN_HAS_EA |
@@ -252,7 +252,7 @@ static __u32 mds_pack_open_flags(__u32 flags)
                 cr_flags |= MDS_OPEN_SYNC;
         if (flags & O_DIRECTORY)
                 cr_flags |= MDS_OPEN_DIRECTORY;
-        if (flags & O_JOIN_FILE)
+        if (mode  & M_JOIN_FILE)
                 cr_flags |= MDS_OPEN_JOIN_FILE;
 #ifdef FMODE_EXEC
         if (flags & FMODE_EXEC)
@@ -315,7 +315,7 @@ static void mdc_open_pack_18(struct ptlrpc_request *req, int offset,
         rec->cr_fid     = op_data->fid1;
         memset(&rec->cr_replayfid, 0, sizeof(rec->cr_replayfid));
         rec->cr_mode    = mode;
-        rec->cr_flags   = mds_pack_open_flags(flags);
+        rec->cr_flags   = mds_pack_open_flags(flags, mode);
         rec->cr_rdev    = rdev;
         rec->cr_time    = op_data->mod_time;
         rec->cr_suppgid = op_data->suppgids[0];
@@ -356,7 +356,7 @@ static void mdc_open_pack_20(struct ptlrpc_request *req, int offset,
         memcpy(&rec->cr_fid1, &op_data->fid1, sizeof(op_data->fid1));
         memcpy(&rec->cr_fid2, &op_data->fid2, sizeof(op_data->fid2));
         rec->cr_mode   = mode;
-        rec->cr_flags  = mds_pack_open_flags(flags);
+        rec->cr_flags  = mds_pack_open_flags(flags, mode);
         rec->cr_rdev   = rdev;
         rec->cr_time   = op_data->mod_time;
         rec->cr_suppgid1 = op_data->suppgids[0];
index 2058b68..492eeea 100644 (file)
@@ -242,7 +242,7 @@ static struct ptlrpc_request *mdc_intent_open_pack(struct obd_export *exp,
                                                         cl_max_mds_easize,
                            [DLM_REPLY_REC_OFF+2] = LUSTRE_POSIX_ACL_MAX_SIZE };
         CFS_LIST_HEAD(cancels);
-        int do_join = (it->it_flags & O_JOIN_FILE) && data->data;
+        int do_join = (it->it_create_mode & M_JOIN_FILE) && data->data;
         int count = 0;
         int bufcount = 6;
         int repbufcount = 5;
@@ -304,7 +304,7 @@ static struct ptlrpc_request *mdc_intent_open_pack(struct obd_export *exp,
                         mdc_join_pack(req, bufcount - 1, data, head_size);
         } else {
                 req = ldlm_prep_enqueue_req(exp, bufcount, size,&cancels,count);
-                it->it_flags &= ~O_JOIN_FILE;
+                it->it_create_mode &= ~M_JOIN_FILE;
         }
 
         if (req) {
@@ -584,7 +584,7 @@ int mdc_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
                         }
                 }
                 req = mdc_intent_open_pack(exp, it, data, lmm, lmmsize);
-                if (it->it_flags & O_JOIN_FILE) {
+                if (it->it_create_mode & M_JOIN_FILE) {
                         policy.l_inodebits.bits = MDS_INODELOCK_UPDATE;
                 }
         } else if (it->it_op & IT_UNLINK) {
@@ -692,7 +692,7 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
 
         if (data->fid2.id && (it->it_op != IT_GETATTR) &&
            ( !mdc_exp_is_2_0_server(exp) ||
-             (mdc_exp_is_2_0_server(exp) && (it->it_flags & O_CHECK_STALE)))) {
+             (mdc_exp_is_2_0_server(exp) && (it->it_create_mode & M_CHECK_STALE)))) {
                 it_set_disposition(it, DISP_ENQ_COMPLETE);
 
                 /* Also: did we find the same inode? */