Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e476f2e5 authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman
Browse files

staging/lustre/llite: flatten struct lookup_intent



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: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-on: http://review.whamcloud.com/17069
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7403


Reviewed-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarFrank Zago <fzago@cray.com>
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d55d5e8f
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -34,7 +34,11 @@
#define LUSTRE_INTENT_H

/* intent IT_XXX are defined in lustre/include/obd.h */
struct lustre_intent_data {

struct lookup_intent {
	int		it_op;
	int		it_create_mode;
	__u64		it_flags;
	int		it_disposition;
	int		it_status;
	__u64		it_lock_handle;
@@ -46,13 +50,4 @@ struct lustre_intent_data {
	unsigned int    it_lock_set:1;
};

struct lookup_intent {
	int     it_op;
	int     it_create_mode;
	__u64   it_flags;
	union {
		struct lustre_intent_data lustre;
	} d;
};

#endif
+13 −13
Original line number Diff line number Diff line
@@ -202,27 +202,27 @@ int ll_d_init(struct dentry *de)

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;

		handle.cookie = it->d.lustre.it_lock_handle;
		handle.cookie = it->it_lock_handle;

		CDEBUG(D_DLMTRACE, "releasing lock with cookie %#llx from it %p\n",
		       handle.cookie, it);
		ldlm_lock_decref(&handle, it->d.lustre.it_lock_mode);
		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;
		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%#llx 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;
		}
	}
}
@@ -233,13 +233,13 @@ void ll_intent_release(struct lookup_intent *it)
	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);
		ptlrpc_req_finished(it->it_data);

	it->d.lustre.it_disposition = 0;
	it->d.lustre.it_data = NULL;
	it->it_disposition = 0;
	it->it_data = NULL;
}

void ll_invalidate_aliases(struct inode *inode)
@@ -279,7 +279,7 @@ int ll_revalidate_it_finish(struct ptlrpc_request *request,

void ll_lookup_finish_locks(struct lookup_intent *it, struct inode *inode)
{
	if (it->d.lustre.it_lock_mode && inode) {
	if (it->it_lock_mode && inode) {
		struct ll_sb_info *sbi = ll_i2sbi(inode);

		CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID"(%p)\n",
+2 −2
Original line number Diff line number Diff line
@@ -362,7 +362,7 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash,

		ll_finish_md_op_data(op_data);

		request = (struct ptlrpc_request *)it.d.lustre.it_data;
		request = (struct ptlrpc_request *)it.it_data;
		if (request)
			ptlrpc_req_finished(request);
		if (rc < 0) {
@@ -374,7 +374,7 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
		CDEBUG(D_INODE, "setting lr_lvb_inode to inode "DFID"(%p)\n",
		       PFID(ll_inode2fid(dir)), dir);
		md_set_lock_data(ll_i2sbi(dir)->ll_md_exp,
				 &it.d.lustre.it_lock_handle, dir, NULL);
				 &it.it_lock_handle, dir, NULL);
	} else {
		/* for cross-ref object, l_ast_data of the lock may not be set,
		 * we reset it here
+22 −22
Original line number Diff line number Diff line
@@ -437,7 +437,7 @@ static int ll_intent_file_open(struct dentry *dentry, void *lmm,
	}

	rc = ll_prep_inode(&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, inode, itp, NULL);

out:
@@ -464,13 +464,13 @@ void ll_ioepoch_open(struct ll_inode_info *lli, __u64 ioepoch)
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->handle;
	och->och_fid = body->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;

@@ -488,7 +488,7 @@ static int ll_local_open(struct file *file, struct lookup_intent *it,
	LASSERT(fd);

	if (och) {
		struct ptlrpc_request *req = it->d.lustre.it_data;
		struct ptlrpc_request *req = it->it_data;
		struct mdt_body *body;
		int rc;

@@ -563,7 +563,7 @@ int ll_file_open(struct inode *inode, struct file *file)
		return 0;
	}

	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
@@ -633,7 +633,7 @@ int ll_file_open(struct inode *inode, struct file *file)
		}
	} 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
@@ -670,7 +670,7 @@ int ll_file_open(struct inode *inode, struct file *file)

		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)
@@ -713,7 +713,7 @@ int ll_file_open(struct inode *inode, struct file *file)
	}

	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);
	}

@@ -854,12 +854,12 @@ ll_lease_open(struct inode *inode, struct file *file, fmode_t fmode,

	/* 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/%llu.\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);
		rc = -EPROTO;
		goto out_close;
	}
@@ -869,10 +869,10 @@ ll_lease_open(struct inode *inode, struct file *file, fmode_t fmode,

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,
					    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(sbi->ll_md_exp, inode, och, NULL);
@@ -1388,7 +1388,7 @@ int ll_lov_setstripe_ea_info(struct inode *inode, struct dentry *dentry,
	rc = ll_intent_file_open(dentry, lum, lum_size, &oit);
	if (rc)
		goto out_unlock;
	rc = oit.d.lustre.it_status;
	rc = oit.it_status;
	if (rc < 0)
		goto out_req_free;

@@ -1401,7 +1401,7 @@ int ll_lov_setstripe_ea_info(struct inode *inode, struct dentry *dentry,
out:
	return rc;
out_req_free:
	ptlrpc_req_finished((struct ptlrpc_request *)oit.d.lustre.it_data);
	ptlrpc_req_finished((struct ptlrpc_request *)oit.it_data);
	goto out;
}

@@ -1689,7 +1689,7 @@ int ll_release_openhandle(struct inode *inode, struct lookup_intent *it)
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;
@@ -3595,13 +3595,13 @@ int ll_layout_refresh(struct inode *inode, __u32 *gen)

	rc = md_enqueue(sbi->ll_md_exp, &einfo, &it, op_data, &lockh,
			NULL, 0, NULL, 0);
	ptlrpc_req_finished(it.d.lustre.it_data);
	it.d.lustre.it_data = NULL;
	ptlrpc_req_finished(it.it_data);
	it.it_data = NULL;

	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) {
+7 −7
Original line number Diff line number Diff line
@@ -1196,7 +1196,7 @@ static inline int ll_file_nolock(const struct file *file)
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
@@ -1207,26 +1207,26 @@ static inline void ll_set_lock_data(struct obd_export *exp, struct inode *inode,
		 * 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 %#llx\n",
			       PFID(ll_inode2fid(inode)), inode,
			       handle.cookie);
			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 %#llx\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;
	}

	if (bits)
		*bits = it->d.lustre.it_lock_bits;
		*bits = it->it_lock_bits;
}

static inline int d_lustre_invalid(const struct dentry *dentry)
Loading