Replace the union in struct lookup_intent with the members of struct
lustre_indent_data. Remove the then unused struct lustre_intent_data.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I47d815f7c8e51bcff33ea7dba6efbc08337ca509
Reviewed-on: http://review.whamcloud.com/17069
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
#define LUSTRE_INTENT_H
/* intent IT_XXX are defined in lustre/include/obd.h */
#define LUSTRE_INTENT_H
/* intent IT_XXX are defined in lustre/include/obd.h */
-struct lustre_intent_data {
- int it_disposition;
- int it_status;
- __u64 it_lock_handle;
- __u64 it_lock_bits;
- int it_lock_mode;
- int it_remote_lock_mode;
- __u64 it_remote_lock_handle;
- void *it_data;
- unsigned int it_lock_set:1;
-};
- int it_op;
- int it_create_mode;
- __u64 it_flags;
- union {
- struct lustre_intent_data lustre;
- } d;
+ int it_op;
+ int it_create_mode;
+ __u64 it_flags;
+ int it_disposition;
+ int it_status;
+ __u64 it_lock_handle;
+ __u64 it_lock_bits;
+ int it_lock_mode;
+ int it_remote_lock_mode;
+ __u64 it_remote_lock_handle;
+ void *it_data;
+ unsigned int it_lock_set:1;
};
static inline int it_disposition(const struct lookup_intent *it, int flag)
{
};
static inline int it_disposition(const struct lookup_intent *it, int flag)
{
- return it->d.lustre.it_disposition & flag;
+ return it->it_disposition & flag;
}
static inline void it_set_disposition(struct lookup_intent *it, int flag)
{
}
static inline void it_set_disposition(struct lookup_intent *it, int flag)
{
- it->d.lustre.it_disposition |= flag;
+ it->it_disposition |= flag;
}
static inline void it_clear_disposition(struct lookup_intent *it, int flag)
{
}
static inline void it_clear_disposition(struct lookup_intent *it, int flag)
{
- it->d.lustre.it_disposition &= ~flag;
+ it->it_disposition &= ~flag;
void ll_intent_drop_lock(struct lookup_intent *it)
{
void ll_intent_drop_lock(struct lookup_intent *it)
{
- if (it->it_op && it->d.lustre.it_lock_mode) {
+ if (it->it_op && it->it_lock_mode) {
struct lustre_handle handle;
struct lustre_handle handle;
- handle.cookie = it->d.lustre.it_lock_handle;
+ handle.cookie = it->it_lock_handle;
- CDEBUG(D_DLMTRACE, "releasing lock with cookie "LPX64
- " from it %p\n", handle.cookie, it);
- ldlm_lock_decref(&handle, it->d.lustre.it_lock_mode);
+ CDEBUG(D_DLMTRACE, "releasing lock with cookie "LPX64
+ " from it %p\n", handle.cookie, it);
+ ldlm_lock_decref(&handle, it->it_lock_mode);
- /* bug 494: intent_release may be called multiple times, from
- * this thread and we don't want to double-decref this lock */
- it->d.lustre.it_lock_mode = 0;
- if (it->d.lustre.it_remote_lock_mode != 0) {
- handle.cookie = it->d.lustre.it_remote_lock_handle;
+ /* bug 494: intent_release may be called multiple times, from
+ * this thread and we don't want to double-decref this lock */
+ it->it_lock_mode = 0;
+ if (it->it_remote_lock_mode != 0) {
+ handle.cookie = it->it_remote_lock_handle;
CDEBUG(D_DLMTRACE, "releasing remote lock with cookie"
LPX64" from it %p\n", handle.cookie, it);
ldlm_lock_decref(&handle,
CDEBUG(D_DLMTRACE, "releasing remote lock with cookie"
LPX64" from it %p\n", handle.cookie, it);
ldlm_lock_decref(&handle,
- it->d.lustre.it_remote_lock_mode);
- it->d.lustre.it_remote_lock_mode = 0;
+ it->it_remote_lock_mode);
+ it->it_remote_lock_mode = 0;
ll_intent_drop_lock(it);
/* We are still holding extra reference on a request, need to free it */
if (it_disposition(it, DISP_ENQ_OPEN_REF))
ll_intent_drop_lock(it);
/* We are still holding extra reference on a request, need to free it */
if (it_disposition(it, DISP_ENQ_OPEN_REF))
- ptlrpc_req_finished(it->d.lustre.it_data); /* ll_file_open */
+ ptlrpc_req_finished(it->it_data); /* ll_file_open */
- if (it_disposition(it, DISP_ENQ_CREATE_REF)) /* create rec */
- ptlrpc_req_finished(it->d.lustre.it_data);
+ if (it_disposition(it, DISP_ENQ_CREATE_REF)) /* create rec */
+ ptlrpc_req_finished(it->it_data);
- it->d.lustre.it_disposition = 0;
- it->d.lustre.it_data = NULL;
- EXIT;
+ it->it_disposition = 0;
+ it->it_data = NULL;
+ EXIT;
}
void ll_invalidate_aliases(struct inode *inode)
}
void ll_invalidate_aliases(struct inode *inode)
LASSERT(it != NULL);
LASSERT(dentry != NULL);
LASSERT(it != NULL);
LASSERT(dentry != NULL);
- if (it->d.lustre.it_lock_mode && dentry->d_inode != NULL) {
+ if (it->it_lock_mode && dentry->d_inode != NULL) {
struct inode *inode = dentry->d_inode;
struct ll_sb_info *sbi = ll_i2sbi(dentry->d_inode);
struct inode *inode = dentry->d_inode;
struct ll_sb_info *sbi = ll_i2sbi(dentry->d_inode);
}
rc = ll_prep_inode(&de->d_inode, req, NULL, itp);
}
rc = ll_prep_inode(&de->d_inode, req, NULL, itp);
- if (!rc && itp->d.lustre.it_lock_mode)
+ if (!rc && itp->it_lock_mode)
ll_set_lock_data(sbi->ll_md_exp, de->d_inode, itp, NULL);
out:
ll_set_lock_data(sbi->ll_md_exp, de->d_inode, itp, NULL);
out:
static int ll_och_fill(struct obd_export *md_exp, struct lookup_intent *it,
struct obd_client_handle *och)
{
static int ll_och_fill(struct obd_export *md_exp, struct lookup_intent *it,
struct obd_client_handle *och)
{
- struct ptlrpc_request *req = it->d.lustre.it_data;
+ struct ptlrpc_request *req = it->it_data;
struct mdt_body *body;
body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
och->och_fh = body->mbo_handle;
och->och_fid = body->mbo_fid1;
struct mdt_body *body;
body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
och->och_fh = body->mbo_handle;
och->och_fid = body->mbo_fid1;
- och->och_lease_handle.cookie = it->d.lustre.it_lock_handle;
+ och->och_lease_handle.cookie = it->it_lock_handle;
och->och_magic = OBD_CLIENT_HANDLE_MAGIC;
och->och_flags = it->it_flags;
och->och_magic = OBD_CLIENT_HANDLE_MAGIC;
och->och_flags = it->it_flags;
- if (!it || !it->d.lustre.it_disposition) {
+ if (!it || !it->it_disposition) {
/* Convert f_flags into access mode. We cannot use file->f_mode,
* because everything but O_ACCMODE mask was stripped from
* there */
/* Convert f_flags into access mode. We cannot use file->f_mode,
* because everything but O_ACCMODE mask was stripped from
* there */
}
} else {
LASSERT(*och_usecount == 0);
}
} else {
LASSERT(*och_usecount == 0);
- if (!it->d.lustre.it_disposition) {
+ if (!it->it_disposition) {
/* We cannot just request lock handle now, new ELC code
means that one of other OPEN locks for this file
could be cancelled, and since blocking ast handler
/* We cannot just request lock handle now, new ELC code
means that one of other OPEN locks for this file
could be cancelled, and since blocking ast handler
LASSERTF(it_disposition(it, DISP_ENQ_OPEN_REF),
"inode %p: disposition %x, status %d\n", inode,
LASSERTF(it_disposition(it, DISP_ENQ_OPEN_REF),
"inode %p: disposition %x, status %d\n", inode,
- it_disposition(it, ~0), it->d.lustre.it_status);
+ it_disposition(it, ~0), it->it_status);
rc = ll_local_open(file, it, fd, *och_p);
if (rc)
rc = ll_local_open(file, it, fd, *och_p);
if (rc)
}
if (it && it_disposition(it, DISP_ENQ_OPEN_REF)) {
}
if (it && it_disposition(it, DISP_ENQ_OPEN_REF)) {
- ptlrpc_req_finished(it->d.lustre.it_data);
+ ptlrpc_req_finished(it->it_data);
it_clear_disposition(it, DISP_ENQ_OPEN_REF);
}
it_clear_disposition(it, DISP_ENQ_OPEN_REF);
}
/* already get lease, handle lease lock */
ll_set_lock_data(sbi->ll_md_exp, inode, &it, NULL);
/* already get lease, handle lease lock */
ll_set_lock_data(sbi->ll_md_exp, inode, &it, NULL);
- if (it.d.lustre.it_lock_mode == 0 ||
- it.d.lustre.it_lock_bits != MDS_INODELOCK_OPEN) {
+ if (it.it_lock_mode == 0 ||
+ it.it_lock_bits != MDS_INODELOCK_OPEN) {
/* open lock must return for lease */
CERROR(DFID "lease granted but no open lock, %d/"LPU64".\n",
/* open lock must return for lease */
CERROR(DFID "lease granted but no open lock, %d/"LPU64".\n",
- PFID(ll_inode2fid(inode)), it.d.lustre.it_lock_mode,
- it.d.lustre.it_lock_bits);
+ PFID(ll_inode2fid(inode)), it.it_lock_mode,
+ it.it_lock_bits);
GOTO(out_close, rc = -EPROTO);
}
GOTO(out_close, rc = -EPROTO);
}
out_close:
/* Cancel open lock */
out_close:
/* Cancel open lock */
- if (it.d.lustre.it_lock_mode != 0) {
+ if (it.it_lock_mode != 0) {
ldlm_lock_decref_and_cancel(&och->och_lease_handle,
ldlm_lock_decref_and_cancel(&och->och_lease_handle,
- it.d.lustre.it_lock_mode);
- it.d.lustre.it_lock_mode = 0;
+ it.it_lock_mode);
+ it.it_lock_mode = 0;
och->och_lease_handle.cookie = 0ULL;
}
rc2 = ll_close_inode_openhandle(inode, och, 0, NULL);
och->och_lease_handle.cookie = 0ULL;
}
rc2 = ll_close_inode_openhandle(inode, och, 0, NULL);
out:
/* this one is in place of ll_file_open */
if (it_disposition(it, DISP_ENQ_OPEN_REF)) {
out:
/* this one is in place of ll_file_open */
if (it_disposition(it, DISP_ENQ_OPEN_REF)) {
- ptlrpc_req_finished(it->d.lustre.it_data);
+ ptlrpc_req_finished(it->it_data);
it_clear_disposition(it, DISP_ENQ_OPEN_REF);
}
RETURN(rc);
it_clear_disposition(it, DISP_ENQ_OPEN_REF);
}
RETURN(rc);
PFID(&lli->lli_fid), inode);
rc = md_enqueue(sbi->ll_md_exp, &einfo, NULL, &it, op_data, &lockh, 0);
PFID(&lli->lli_fid), inode);
rc = md_enqueue(sbi->ll_md_exp, &einfo, NULL, &it, op_data, &lockh, 0);
- if (it.d.lustre.it_data != NULL)
- ptlrpc_req_finished(it.d.lustre.it_data);
- it.d.lustre.it_data = NULL;
+ if (it.it_data != NULL)
+ ptlrpc_req_finished(it.it_data);
+ it.it_data = NULL;
ll_finish_md_op_data(op_data);
ll_finish_md_op_data(op_data);
- mode = it.d.lustre.it_lock_mode;
- it.d.lustre.it_lock_mode = 0;
+ mode = it.it_lock_mode;
+ it.it_lock_mode = 0;
ll_intent_drop_lock(&it);
if (rc == 0) {
ll_intent_drop_lock(&it);
if (rc == 0) {
static inline void ll_set_lock_data(struct obd_export *exp, struct inode *inode,
struct lookup_intent *it, __u64 *bits)
{
static inline void ll_set_lock_data(struct obd_export *exp, struct inode *inode,
struct lookup_intent *it, __u64 *bits)
{
- if (!it->d.lustre.it_lock_set) {
+ if (!it->it_lock_set) {
struct lustre_handle handle;
/* If this inode is a remote object, it will get two
struct lustre_handle handle;
/* If this inode is a remote object, it will get two
* UPDATE|PERM lock. The inode will be attched to both
* LOOKUP and PERM locks, so revoking either locks will
* case the dcache being cleared */
* UPDATE|PERM lock. The inode will be attched to both
* LOOKUP and PERM locks, so revoking either locks will
* case the dcache being cleared */
- if (it->d.lustre.it_remote_lock_mode) {
- handle.cookie = it->d.lustre.it_remote_lock_handle;
+ if (it->it_remote_lock_mode) {
+ handle.cookie = it->it_remote_lock_handle;
CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID
"(%p) for remote lock "LPX64"\n",
PFID(ll_inode2fid(inode)), inode,
CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID
"(%p) for remote lock "LPX64"\n",
PFID(ll_inode2fid(inode)), inode,
md_set_lock_data(exp, &handle.cookie, inode, NULL);
}
md_set_lock_data(exp, &handle.cookie, inode, NULL);
}
- handle.cookie = it->d.lustre.it_lock_handle;
+ handle.cookie = it->it_lock_handle;
CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID"(%p)"
" for lock "LPX64"\n",
PFID(ll_inode2fid(inode)), inode, handle.cookie);
md_set_lock_data(exp, &handle.cookie, inode,
CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID"(%p)"
" for lock "LPX64"\n",
PFID(ll_inode2fid(inode)), inode, handle.cookie);
md_set_lock_data(exp, &handle.cookie, inode,
- &it->d.lustre.it_lock_bits);
- it->d.lustre.it_lock_set = 1;
+ &it->it_lock_bits);
+ it->it_lock_set = 1;
- *bits = it->d.lustre.it_lock_bits;
+ *bits = it->it_lock_bits;
}
static inline void ll_lock_dcache(struct inode *inode)
}
static inline void ll_lock_dcache(struct inode *inode)
* 2. layout was changed by another client
* 3. proc2: refresh layout and layout lock granted
* 4. proc1: to apply a stale layout */
* 2. layout was changed by another client
* 3. proc2: refresh layout and layout lock granted
* 4. proc1: to apply a stale layout */
- if (it != NULL && it->d.lustre.it_lock_mode != 0) {
+ if (it != NULL && it->it_lock_mode != 0) {
struct lustre_handle lockh;
struct ldlm_lock *lock;
struct lustre_handle lockh;
struct ldlm_lock *lock;
- lockh.cookie = it->d.lustre.it_lock_handle;
+ lockh.cookie = it->it_lock_handle;
lock = ldlm_handle2lock(&lockh);
LASSERT(lock != NULL);
if (ldlm_has_layout(lock)) {
lock = ldlm_handle2lock(&lockh);
LASSERT(lock != NULL);
if (ldlm_has_layout(lock)) {
/* NB 1 request reference will be taken away by ll_intent_lock()
* when I return */
CDEBUG(D_DENTRY, "it %p it_disposition %x\n", it,
/* NB 1 request reference will be taken away by ll_intent_lock()
* when I return */
CDEBUG(D_DENTRY, "it %p it_disposition %x\n", it,
- it->d.lustre.it_disposition);
if (!it_disposition(it, DISP_LOOKUP_NEG)) {
rc = ll_prep_inode(&inode, request, (*de)->d_sb, it);
if (rc)
if (!it_disposition(it, DISP_LOOKUP_NEG)) {
rc = ll_prep_inode(&inode, request, (*de)->d_sb, it);
if (rc)
/* Check that parent has UPDATE lock. */
struct lookup_intent parent_it = {
.it_op = IT_GETATTR,
/* Check that parent has UPDATE lock. */
struct lookup_intent parent_it = {
.it_op = IT_GETATTR,
- .d.lustre.it_lock_handle = 0 };
struct lu_fid fid = ll_i2info(parent)->lli_fid;
/* If it is striped directory, get the real stripe parent */
struct lu_fid fid = ll_i2info(parent)->lli_fid;
/* If it is striped directory, get the real stripe parent */
- LASSERT(it && it->d.lustre.it_disposition);
+ LASSERT(it && it->it_disposition);
- LASSERT(it_disposition(it, DISP_ENQ_CREATE_REF));
- request = it->d.lustre.it_data;
+ LASSERT(it_disposition(it, DISP_ENQ_CREATE_REF));
+ request = it->it_data;
it_clear_disposition(it, DISP_ENQ_CREATE_REF);
rc = ll_prep_inode(&inode, request, dir->i_sb, it);
if (rc)
it_clear_disposition(it, DISP_ENQ_CREATE_REF);
rc = ll_prep_inode(&inode, request, dir->i_sb, it);
if (rc)
lld->lld_it = NULL;
/* Was there an error? Propagate it! */
lld->lld_it = NULL;
/* Was there an error? Propagate it! */
- if (it->d.lustre.it_status) {
- rc = it->d.lustre.it_status;
+ if (it->it_status) {
+ rc = it->it_status;
- it->d.lustre.it_lock_handle = entry->se_handle;
+ it->it_lock_handle = entry->se_handle;
rc = md_revalidate_lock(ll_i2mdexp(dir), it, ll_inode2fid(dir), NULL);
if (rc != 1)
GOTO(out, rc = -EAGAIN);
rc = md_revalidate_lock(ll_i2mdexp(dir), it, ll_inode2fid(dir), NULL);
if (rc != 1)
GOTO(out, rc = -EAGAIN);
* thread enqueues lock on parent in readdir and another
* process enqueues lock on child with parent lock held, eg.
* unlink. */
* thread enqueues lock on parent in readdir and another
* process enqueues lock on child with parent lock held, eg.
* unlink. */
- handle = it->d.lustre.it_lock_handle;
+ handle = it->it_lock_handle;
ll_intent_drop_lock(it);
}
ll_intent_drop_lock(it);
}
{
struct inode *inode = dentry->d_inode;
struct lookup_intent it = { .it_op = IT_GETATTR,
{
struct inode *inode = dentry->d_inode;
struct lookup_intent it = { .it_op = IT_GETATTR,
- .d.lustre.it_lock_handle = 0 };
struct md_enqueue_info *minfo;
int rc;
ENTRY;
struct md_enqueue_info *minfo;
int rc;
ENTRY;
rc = md_revalidate_lock(ll_i2mdexp(dir), &it, ll_inode2fid(inode),
NULL);
if (rc == 1) {
rc = md_revalidate_lock(ll_i2mdexp(dir), &it, ll_inode2fid(inode),
NULL);
if (rc == 1) {
- entry->se_handle = it.d.lustre.it_lock_handle;
+ entry->se_handle = it.it_lock_handle;
ll_intent_release(&it);
RETURN(1);
}
ll_intent_release(&it);
RETURN(1);
}
if (entry->se_state == SA_ENTRY_SUCC && entry->se_inode != NULL) {
struct inode *inode = entry->se_inode;
struct lookup_intent it = { .it_op = IT_GETATTR,
if (entry->se_state == SA_ENTRY_SUCC && entry->se_inode != NULL) {
struct inode *inode = entry->se_inode;
struct lookup_intent it = { .it_op = IT_GETATTR,
- .d.lustre.it_lock_handle =
entry->se_handle };
__u64 bits;
entry->se_handle };
__u64 bits;
LCK_PR);
if (mode != 0) {
/* fake oit in mdc_revalidate_lock() manner */
LCK_PR);
if (mode != 0) {
/* fake oit in mdc_revalidate_lock() manner */
- oit->d.lustre.it_lock_handle = lockh.cookie;
- oit->d.lustre.it_lock_mode = mode;
+ oit->it_lock_handle = lockh.cookie;
+ oit->it_lock_mode = mode;
- *req = (struct ptlrpc_request *)oit->d.lustre.it_data;
+ *req = (struct ptlrpc_request *)oit->it_data;
out:
down_write(&lli->lli_xattrs_list_rwsem);
mutex_unlock(&lli->lli_xattrs_enq_lock);
out:
down_write(&lli->lli_xattrs_list_rwsem);
mutex_unlock(&lli->lli_xattrs_enq_lock);
GOTO(out_maybe_drop, rc = -EIO);
}
GOTO(out_maybe_drop, rc = -EIO);
}
- if (oit->d.lustre.it_status < 0) {
+ if (oit->it_status < 0) {
CDEBUG(D_CACHE, "getxattr intent returned %d for fid "DFID"\n",
CDEBUG(D_CACHE, "getxattr intent returned %d for fid "DFID"\n",
- oit->d.lustre.it_status, PFID(ll_inode2fid(inode)));
- rc = oit->d.lustre.it_status;
+ oit->it_status, PFID(ll_inode2fid(inode)));
+ rc = oit->it_status;
/* xattr data is so large that we don't want to cache it */
if (rc == -ERANGE)
rc = -EAGAIN;
/* xattr data is so large that we don't want to cache it */
if (rc == -ERANGE)
rc = -EAGAIN;
up_write(&lli->lli_xattrs_list_rwsem);
ldlm_lock_decref_and_cancel((struct lustre_handle *)
up_write(&lli->lli_xattrs_list_rwsem);
ldlm_lock_decref_and_cancel((struct lustre_handle *)
- &oit->d.lustre.it_lock_handle,
- oit->d.lustre.it_lock_mode);
+ &oit->it_lock_handle,
+ oit->it_lock_mode);
/*
* We got LOOKUP lock, but we really need attrs.
*/
/*
* We got LOOKUP lock, but we really need attrs.
*/
- pmode = it->d.lustre.it_lock_mode;
+ pmode = it->it_lock_mode;
- plock.cookie = it->d.lustre.it_lock_handle;
- it->d.lustre.it_lock_mode = 0;
- it->d.lustre.it_data = NULL;
+ plock.cookie = it->it_lock_handle;
+ it->it_lock_mode = 0;
+ it->it_data = NULL;
}
LASSERT(fid_is_sane(&body->mbo_fid1));
}
LASSERT(fid_is_sane(&body->mbo_fid1));
* maintain dcache consistency. Thus drop UPDATE|PERM lock here
* and put LOOKUP in request.
*/
* maintain dcache consistency. Thus drop UPDATE|PERM lock here
* and put LOOKUP in request.
*/
- if (it->d.lustre.it_lock_mode != 0) {
- it->d.lustre.it_remote_lock_handle =
- it->d.lustre.it_lock_handle;
- it->d.lustre.it_remote_lock_mode = it->d.lustre.it_lock_mode;
+ if (it->it_lock_mode != 0) {
+ it->it_remote_lock_handle =
+ it->it_lock_handle;
+ it->it_remote_lock_mode = it->it_lock_mode;
- it->d.lustre.it_lock_handle = plock.cookie;
- it->d.lustre.it_lock_mode = pmode;
+ it->it_lock_handle = plock.cookie;
+ it->it_lock_mode = pmode;
if (rc < 0)
GOTO(cleanup, rc);
if (rc < 0)
GOTO(cleanup, rc);
- lockh = (struct lustre_handle *)&it.d.lustre.it_lock_handle;
+ lockh = (struct lustre_handle *)&it.it_lock_handle;
if (rc > 0 && req == NULL) {
/* slave inode is still valid */
CDEBUG(D_INODE, "slave "DFID" is still valid.\n",
if (rc > 0 && req == NULL) {
/* slave inode is still valid */
CDEBUG(D_INODE, "slave "DFID" is still valid.\n",
body = req_capsule_server_get(&req->rq_pill,
&RMF_MDT_BODY);
if (body == NULL) {
body = req_capsule_server_get(&req->rq_pill,
&RMF_MDT_BODY);
if (body == NULL) {
- if (it.d.lustre.it_lock_mode && lockh) {
+ if (it.it_lock_mode && lockh) {
- it.d.lustre.it_lock_mode);
- it.d.lustre.it_lock_mode = 0;
+ it.it_lock_mode);
+ it.it_lock_mode = 0;
}
GOTO(cleanup, rc = -ENOENT);
}
}
GOTO(cleanup, rc = -ENOENT);
}
}
md_set_lock_data(tgt->ltd_exp, &lockh->cookie, inode, NULL);
}
md_set_lock_data(tgt->ltd_exp, &lockh->cookie, inode, NULL);
- if (it.d.lustre.it_lock_mode != 0 && lockh != NULL) {
- ldlm_lock_decref(lockh, it.d.lustre.it_lock_mode);
- it.d.lustre.it_lock_mode = 0;
+ if (it.it_lock_mode != 0 && lockh != NULL) {
+ ldlm_lock_decref(lockh, it.it_lock_mode);
+ it.it_lock_mode = 0;
* Nothing is found, do not access body->fid1 as it is zero and thus
* pointless.
*/
* Nothing is found, do not access body->fid1 as it is zero and thus
* pointless.
*/
- if ((it->d.lustre.it_disposition & DISP_LOOKUP_NEG) &&
- !(it->d.lustre.it_disposition & DISP_OPEN_CREATE) &&
- !(it->d.lustre.it_disposition & DISP_OPEN_OPEN))
+ if ((it->it_disposition & DISP_LOOKUP_NEG) &&
+ !(it->it_disposition & DISP_OPEN_CREATE) &&
+ !(it->it_disposition & DISP_OPEN_OPEN))
RETURN(rc);
body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
RETURN(rc);
body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
/* release the previous request */
ptlrpc_req_finished(*reqp);
/* release the previous request */
ptlrpc_req_finished(*reqp);
- it->d.lustre.it_data = NULL;
*reqp = NULL;
oinfo = &lsm->lsm_md_oinfo[stripe_index];
*reqp = NULL;
oinfo = &lsm->lsm_md_oinfo[stripe_index];
PFID(&oinfo->lmo_fid));
op_data->op_fid1 = oinfo->lmo_fid;
PFID(&oinfo->lmo_fid));
op_data->op_fid1 = oinfo->lmo_fid;
- it->d.lustre.it_disposition &= ~DISP_ENQ_COMPLETE;
+ it->it_disposition &= ~DISP_ENQ_COMPLETE;
rc = md_intent_lock(tgt->ltd_exp, op_data, it, reqp,
cb_blocking, extra_lock_flags);
if (rc != 0)
rc = md_intent_lock(tgt->ltd_exp, op_data, it, reqp,
cb_blocking, extra_lock_flags);
if (rc != 0)
if (rc < 0) {
struct lustre_handle lock_handle;
if (rc < 0) {
struct lustre_handle lock_handle;
- if (it->d.lustre.it_lock_mode != 0) {
- lock_handle.cookie = it->d.lustre.it_lock_handle;
+ if (it->it_lock_mode != 0) {
+ lock_handle.cookie = it->it_lock_handle;
ldlm_lock_decref(&lock_handle,
ldlm_lock_decref(&lock_handle,
- it->d.lustre.it_lock_mode);
- it->d.lustre.it_lock_handle = 0;
- it->d.lustre.it_lock_mode = 0;
+ it->it_lock_handle = 0;
+ it->it_lock_mode = 0;
- if (it->d.lustre.it_remote_lock_mode != 0) {
- lock_handle.cookie = it->d.lustre.it_remote_lock_handle;
+ if (it->it_remote_lock_mode != 0) {
+ lock_handle.cookie = it->it_remote_lock_handle;
ldlm_lock_decref(&lock_handle,
ldlm_lock_decref(&lock_handle,
- it->d.lustre.it_remote_lock_mode);
+ it->it_remote_lock_mode);
- it->d.lustre.it_remote_lock_handle = 0;
- it->d.lustre.it_remote_lock_mode = 0;
+ it->it_remote_lock_handle = 0;
+ it->it_remote_lock_mode = 0;
{
if (it_disposition(it, DISP_OPEN_LEASE)) {
if (phase >= DISP_OPEN_LEASE)
{
if (it_disposition(it, DISP_OPEN_LEASE)) {
if (phase >= DISP_OPEN_LEASE)
- return it->d.lustre.it_status;
+ return it->it_status;
+ else
+ return 0;
+ }
+ if (it_disposition(it, DISP_OPEN_OPEN)) {
+ if (phase >= DISP_OPEN_OPEN)
+ return it->it_status;
- if (it_disposition(it, DISP_OPEN_OPEN)) {
- if (phase >= DISP_OPEN_OPEN)
- return it->d.lustre.it_status;
- else
- return 0;
- }
- if (it_disposition(it, DISP_OPEN_CREATE)) {
- if (phase >= DISP_OPEN_CREATE)
- return it->d.lustre.it_status;
- else
- return 0;
- }
+ if (it_disposition(it, DISP_OPEN_CREATE)) {
+ if (phase >= DISP_OPEN_CREATE)
+ return it->it_status;
+ else
+ return 0;
+ }
- if (it_disposition(it, DISP_LOOKUP_EXECD)) {
- if (phase >= DISP_LOOKUP_EXECD)
- return it->d.lustre.it_status;
- else
- return 0;
- }
+ if (it_disposition(it, DISP_LOOKUP_EXECD)) {
+ if (phase >= DISP_LOOKUP_EXECD)
+ return it->it_status;
+ else
+ return 0;
+ }
+
+ if (it_disposition(it, DISP_IT_EXECD)) {
+ if (phase >= DISP_IT_EXECD)
+ return it->it_status;
+ else
+ return 0;
+ }
+
+ CERROR("it disp: %X, status: %d\n", it->it_disposition, it->it_status);
+ LBUG();
- if (it_disposition(it, DISP_IT_EXECD)) {
- if (phase >= DISP_IT_EXECD)
- return it->d.lustre.it_status;
- else
- return 0;
- }
- CERROR("it disp: %X, status: %d\n", it->d.lustre.it_disposition,
- it->d.lustre.it_status);
- LBUG();
return 0;
}
EXPORT_SYMBOL(it_open_error);
return 0;
}
EXPORT_SYMBOL(it_open_error);
struct req_capsule *pill = &req->rq_pill;
struct ldlm_request *lockreq;
struct ldlm_reply *lockrep;
struct req_capsule *pill = &req->rq_pill;
struct ldlm_request *lockreq;
struct ldlm_reply *lockrep;
- struct lustre_intent_data *intent = &it->d.lustre;
struct ldlm_lock *lock;
void *lvb_data = NULL;
__u32 lvb_len = 0;
struct ldlm_lock *lock;
void *lvb_data = NULL;
__u32 lvb_len = 0;
lockrep = req_capsule_server_get(pill, &RMF_DLM_REP);
LASSERT(lockrep != NULL); /* checked by ldlm_cli_enqueue() */
lockrep = req_capsule_server_get(pill, &RMF_DLM_REP);
LASSERT(lockrep != NULL); /* checked by ldlm_cli_enqueue() */
- intent->it_disposition = (int)lockrep->lock_policy_res1;
- intent->it_status = (int)lockrep->lock_policy_res2;
- intent->it_lock_mode = einfo->ei_mode;
- intent->it_lock_handle = lockh->cookie;
- intent->it_data = req;
+ it->it_disposition = (int)lockrep->lock_policy_res1;
+ it->it_status = (int)lockrep->lock_policy_res2;
+ it->it_lock_mode = einfo->ei_mode;
+ it->it_lock_handle = lockh->cookie;
+ it->it_data = req;
/* Technically speaking rq_transno must already be zero if
* it_status is in error, so the check is a bit redundant */
/* Technically speaking rq_transno must already be zero if
* it_status is in error, so the check is a bit redundant */
- if ((!req->rq_transno || intent->it_status < 0) && req->rq_replay)
- mdc_clear_replay_flag(req, intent->it_status);
+ if ((!req->rq_transno || it->it_status < 0) && req->rq_replay)
+ mdc_clear_replay_flag(req, it->it_status);
/* If we're doing an IT_OPEN which did not result in an actual
* successful open, then we need to remove the bit which saves
/* If we're doing an IT_OPEN which did not result in an actual
* successful open, then we need to remove the bit which saves
* function without doing so, and try to replay a failed create
* (bug 3440) */
if (it->it_op & IT_OPEN && req->rq_replay &&
* function without doing so, and try to replay a failed create
* (bug 3440) */
if (it->it_op & IT_OPEN && req->rq_replay &&
- (!it_disposition(it, DISP_OPEN_OPEN) ||intent->it_status != 0))
- mdc_clear_replay_flag(req, intent->it_status);
+ (!it_disposition(it, DISP_OPEN_OPEN) || it->it_status != 0))
+ mdc_clear_replay_flag(req, it->it_status);
DEBUG_REQ(D_RPCTRACE, req, "op: %d disposition: %x, status: %d",
DEBUG_REQ(D_RPCTRACE, req, "op: %d disposition: %x, status: %d",
- it->it_op, intent->it_disposition, intent->it_status);
+ it->it_op, it->it_disposition, it->it_status);
/* 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)) {
/* 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)) {
}
ptlrpc_req_finished(req);
}
ptlrpc_req_finished(req);
- it->d.lustre.it_lock_handle = 0;
- it->d.lustre.it_lock_mode = 0;
- it->d.lustre.it_data = NULL;
+ it->it_lock_handle = 0;
+ it->it_lock_mode = 0;
+ it->it_data = NULL;
if (!it_disposition(it, DISP_IT_EXECD)) {
/* The server failed before it even started executing the
* intent, i.e. because it couldn't unpack the request. */
if (!it_disposition(it, DISP_IT_EXECD)) {
/* The server failed before it even started executing the
* intent, i.e. because it couldn't unpack the request. */
- LASSERT(it->d.lustre.it_status != 0);
- RETURN(it->d.lustre.it_status);
+ LASSERT(it->it_status != 0);
+ RETURN(it->it_status);
}
rc = it_open_error(DISP_IT_EXECD, it);
if (rc)
}
rc = it_open_error(DISP_IT_EXECD, it);
if (rc)
memcpy(&old_lock, lockh, sizeof(*lockh));
if (ldlm_lock_match(NULL, LDLM_FL_BLOCK_GRANTED, NULL,
LDLM_IBITS, &policy, LCK_NL, &old_lock, 0)) {
memcpy(&old_lock, lockh, sizeof(*lockh));
if (ldlm_lock_match(NULL, LDLM_FL_BLOCK_GRANTED, NULL,
LDLM_IBITS, &policy, LCK_NL, &old_lock, 0)) {
- ldlm_lock_decref_and_cancel(lockh,
- it->d.lustre.it_lock_mode);
- memcpy(lockh, &old_lock, sizeof(old_lock));
- it->d.lustre.it_lock_handle = lockh->cookie;
- }
- }
+ ldlm_lock_decref_and_cancel(lockh, it->it_lock_mode);
+ memcpy(lockh, &old_lock, sizeof(old_lock));
+ it->it_lock_handle = lockh->cookie;
+ }
+ }
+
CDEBUG(D_DENTRY,"D_IT dentry %.*s intent: %s status %d disp %x rc %d\n",
(int)op_data->op_namelen, op_data->op_name,
CDEBUG(D_DENTRY,"D_IT dentry %.*s intent: %s status %d disp %x rc %d\n",
(int)op_data->op_namelen, op_data->op_name,
- ldlm_it2str(it->it_op), it->d.lustre.it_status,
- it->d.lustre.it_disposition, rc);
+ ldlm_it2str(it->it_op), it->it_status,
+ it->it_disposition, rc);
+
enum ldlm_mode mode;
ENTRY;
enum ldlm_mode mode;
ENTRY;
- if (it->d.lustre.it_lock_handle) {
- lockh.cookie = it->d.lustre.it_lock_handle;
- mode = ldlm_revalidate_lock_handle(&lockh, bits);
+ if (it->it_lock_handle) {
+ lockh.cookie = it->it_lock_handle;
+ mode = ldlm_revalidate_lock_handle(&lockh, bits);
} else {
fid_build_reg_res_name(fid, &res_id);
switch (it->it_op) {
} else {
fid_build_reg_res_name(fid, &res_id);
switch (it->it_op) {
- if (mode) {
- it->d.lustre.it_lock_handle = lockh.cookie;
- it->d.lustre.it_lock_mode = mode;
- } else {
- it->d.lustre.it_lock_handle = 0;
- it->d.lustre.it_lock_mode = 0;
- }
+ if (mode) {
+ it->it_lock_handle = lockh.cookie;
+ it->it_lock_mode = mode;
+ } else {
+ it->it_lock_handle = 0;
+ it->it_lock_mode = 0;
+ }
* ll_create/ll_open gets called.
*
* The server will return to us, in it_disposition, an indication of
* ll_create/ll_open gets called.
*
* The server will return to us, in it_disposition, an indication of
- * exactly what d.lustre.it_status refers to.
+ * exactly what it_status refers to.
- * If DISP_OPEN_OPEN is set, then d.lustre.it_status refers to the open() call,
+ * If DISP_OPEN_OPEN is set, then it_status refers to the open() call,
* otherwise if DISP_OPEN_CREATE is set, then it status is the
* creation failure mode. In either case, one of DISP_LOOKUP_NEG or
* DISP_LOOKUP_POS will be set, indicating whether the child lookup
* was successful.
*
* otherwise if DISP_OPEN_CREATE is set, then it status is the
* creation failure mode. In either case, one of DISP_LOOKUP_NEG or
* DISP_LOOKUP_POS will be set, indicating whether the child lookup
* was successful.
*
- * Else, if DISP_LOOKUP_EXECD then d.lustre.it_status is the rc of the
+ * Else, if DISP_LOOKUP_EXECD then it_status is the rc of the
* child lookup.
*/
int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
* child lookup.
*/
int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
/* 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. */
/* 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. */
- it->d.lustre.it_lock_handle = 0;
+ it->it_lock_handle = 0;
rc = mdc_revalidate_lock(exp, it, &op_data->op_fid2, NULL);
/* Only return failure if it was not GETATTR by cfid
(from inode_revalidate) */
rc = mdc_revalidate_lock(exp, it, &op_data->op_fid2, NULL);
/* Only return failure if it was not GETATTR by cfid
(from inode_revalidate) */
- *reqp = it->d.lustre.it_data;
rc = mdc_finish_intent_lock(exp, *reqp, op_data, it, &lockh);
RETURN(rc);
}
rc = mdc_finish_intent_lock(exp, *reqp, op_data, it, &lockh);
RETURN(rc);
}
struct md_open_data *mod;
struct mdt_rec_create *rec;
struct mdt_body *body;
struct md_open_data *mod;
struct mdt_rec_create *rec;
struct mdt_body *body;
- struct ptlrpc_request *open_req = it->d.lustre.it_data;
+ struct ptlrpc_request *open_req = it->it_data;
struct obd_import *imp = open_req->rq_import;
ENTRY;
struct obd_import *imp = open_req->rq_import;
ENTRY;
- mdc_set_lock_data(exp, &it.d.lustre.it_lock_handle, dir, NULL);
+ mdc_set_lock_data(exp, &it.it_lock_handle, dir, NULL);
rp_param.rp_off = hash_offset;
rp_param.rp_hash64 = op_data->op_cli_flags & CLI_HASH64;
rp_param.rp_off = hash_offset;
rp_param.rp_hash64 = op_data->op_cli_flags & CLI_HASH64;
}
*ppage = page;
out_unlock:
}
*ppage = page;
out_unlock:
- lockh.cookie = it.d.lustre.it_lock_handle;
- ldlm_lock_decref(&lockh, it.d.lustre.it_lock_mode);
- it.d.lustre.it_lock_handle = 0;
+ lockh.cookie = it.it_lock_handle;
+ ldlm_lock_decref(&lockh, it.it_lock_mode);
+ it.it_lock_handle = 0;
return rc;
fail:
kunmap(page);
return rc;
fail:
kunmap(page);