#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
!(flags & FMODE_WRITE));
}
+/* 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
do_lock:
it->it_create_mode &= ~current->fs->umask;
- it->it_flags |= O_CHECK_STALE;
+ it->it_create_mode |= M_CHECK_STALE;
rc = md_intent_lock(exp, op_data, NULL, 0, it,
lookup_flags,
&req, ll_md_blocking_ast, 0);
- it->it_flags &= ~O_CHECK_STALE;
+ it->it_create_mode &= ~M_CHECK_STALE;
ll_finish_md_op_data(op_data);
if (it->it_op == IT_GETATTR && !first)
/* If there are too many locks on client-side, then some
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);
{
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_CW,
ll_md_blocking_ast, ldlm_completion_ast, NULL, NULL, NULL };
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
- oit.it_flags |= O_CHECK_STALE;
+ oit.it_create_mode |= M_CHECK_STALE;
rc = md_intent_lock(exp, op_data, NULL, 0,
/* we are not interested in name
based lookup */
&oit, 0, &req,
ll_md_blocking_ast, 0);
ll_finish_md_op_data(op_data);
- 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);
#define _MDC_INTERNAL_H
#include <lustre_mdc.h>
+#include <lustre_mds.h>
#ifdef LPROCFS
void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars);
}
}
-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_HAS_EA | MDS_OPEN_HAS_OBJS |
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)
rec->cr_fid2 = op_data->op_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->op_mod_time;
rec->cr_suppgid1 = op_data->op_suppgids[0];
struct ptlrpc_request *req;
struct obd_device *obddev = class_exp2obd(exp);
struct ldlm_intent *lit;
- int joinfile = !!((it->it_flags & O_JOIN_FILE) &&
- op_data->op_data);
+ int joinfile = !!((it->it_create_mode & M_JOIN_FILE) &&
+ op_data->op_data);
CFS_LIST_HEAD(cancels);
int count = 0;
int mode;
policy = *(ldlm_policy_data_t *)lmm;
res_id.name[3] = LDLM_FLOCK;
} else if (it->it_op & IT_OPEN) {
- int joinfile = !!((it->it_flags & O_JOIN_FILE) &&
+ int joinfile = !!((it->it_create_mode & M_JOIN_FILE) &&
op_data->op_data);
req = mdc_intent_open_pack(exp, it, op_data, lmm, lmmsize,
einfo->ei_cbdata = NULL;
lmm = NULL;
} else
- it->it_flags &= ~O_JOIN_FILE;
+ it->it_create_mode &= ~M_JOIN_FILE;
} else if (it->it_op & IT_UNLINK)
req = mdc_intent_unlink_pack(exp, it, op_data);
else if (it->it_op & (IT_GETATTR | IT_LOOKUP))
/* If we were revalidating a fid/name pair, mark the intent in
* case we fail and get called again from lookup */
if (fid_is_sane(&op_data->op_fid2) &&
- it->it_flags & O_CHECK_STALE &&
+ it->it_create_mode & M_CHECK_STALE &&
it->it_op != IT_GETATTR) {
it_set_disposition(it, DISP_ENQ_COMPLETE);
if (rc < 0)
RETURN(rc);
} else if (!fid_is_sane(&op_data->op_fid2) ||
- !(it->it_flags & O_CHECK_STALE)) {
+ !(it->it_create_mode & M_CHECK_STALE)) {
/* DISP_ENQ_COMPLETE set means there is extra reference on
* request referenced from this intent, saved for subsequent
* lookup. This path is executed when we proceed to this