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

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

staging: lustre: lov: remove LSM from struct lustre_md



In struct lustre_md replace the struct lov_stripe_md *lsm member with
an opaque struct lu_buf layout which holds the layout metadata
returned by the server. Refactor the LOV object initialization and
layout change code to accommodate this. Simplify lov_unpackmd() and
supporting functions according to the reduced number of use cases.

Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Signed-off-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5814
Reviewed-on: http://review.whamcloud.com/13722


Reviewed-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8d69af03
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ struct cl_object_conf {
		/**
		 * Object layout. This is consumed by lov.
		 */
		struct lustre_md *coc_md;
		struct lu_buf	  coc_layout;
		/**
		 * Description of particular stripe location in the
		 * cluster. This is consumed by osc.
+1 −1
Original line number Diff line number Diff line
@@ -864,7 +864,7 @@ struct obd_ops {
/* lmv structures */
struct lustre_md {
	struct mdt_body	 *body;
	struct lov_stripe_md    *lsm;
	struct lu_buf		 layout;
	struct lmv_stripe_md    *lmv;
#ifdef CONFIG_FS_POSIX_ACL
	struct posix_acl	*posix_acl;
+5 −24
Original line number Diff line number Diff line
@@ -3275,7 +3275,6 @@ static int ll_layout_lock_set(struct lustre_handle *lockh, enum ldlm_mode mode,
	struct ll_inode_info *lli = ll_i2info(inode);
	struct ll_sb_info    *sbi = ll_i2sbi(inode);
	struct ldlm_lock *lock;
	struct lustre_md md = { NULL };
	struct cl_object_conf conf;
	int rc = 0;
	bool lvb_ready;
@@ -3310,37 +3309,19 @@ static int ll_layout_lock_set(struct lustre_handle *lockh, enum ldlm_mode mode,

	/* for layout lock, lmm is returned in lock's lvb.
	 * lvb_data is immutable if the lock is held so it's safe to access it
	 * without res lock. See the description in ldlm_lock_decref_internal()
	 * for the condition to free lvb_data of layout lock
	 */
	if (lock->l_lvb_data) {
		rc = obd_unpackmd(sbi->ll_dt_exp, &md.lsm,
				  lock->l_lvb_data, lock->l_lvb_len);
		if (rc < 0) {
			CERROR("%s: file " DFID " unpackmd error: %d\n",
			       ll_get_fsname(inode->i_sb, NULL, 0),
			       PFID(&lli->lli_fid), rc);
			goto out;
		}

		LASSERTF(md.lsm, "lvb_data = %p, lvb_len = %u\n",
			 lock->l_lvb_data, lock->l_lvb_len);
		rc = 0;
	}

	/* set layout to file. Unlikely this will fail as old layout was
	 * without res lock.
	 *
	 * set layout to file. Unlikely this will fail as old layout was
	 * surely eliminated
	 */
	memset(&conf, 0, sizeof(conf));
	conf.coc_opc = OBJECT_CONF_SET;
	conf.coc_inode = inode;
	conf.coc_lock = lock;
	conf.u.coc_md = &md;
	conf.u.coc_layout.lb_buf = lock->l_lvb_data;
	conf.u.coc_layout.lb_len = lock->l_lvb_len;
	rc = ll_layout_conf(inode, &conf);

	if (md.lsm)
		obd_free_memmd(sbi->ll_dt_exp, &md.lsm);

	/* refresh layout failed, need to wait */
	wait_layout = rc == -EBUSY;

+1 −1
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
	struct cl_object_conf conf = {
		.coc_inode = inode,
		.u = {
			.coc_md    = md
			.coc_layout = md->layout,
		}
	};
	int result = 0;
+2 −9
Original line number Diff line number Diff line
@@ -469,8 +469,6 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
	ptlrpc_req_finished(request);

	if (IS_ERR(root)) {
		if (lmd.lsm)
			obd_free_memmd(sbi->ll_dt_exp, &lmd.lsm);
#ifdef CONFIG_FS_POSIX_ACL
		if (lmd.posix_acl) {
			posix_acl_release(lmd.posix_acl);
@@ -1688,11 +1686,9 @@ int ll_update_inode(struct inode *inode, struct lustre_md *md)
{
	struct ll_inode_info *lli = ll_i2info(inode);
	struct mdt_body *body = md->body;
	struct lov_stripe_md *lsm = md->lsm;
	struct ll_sb_info *sbi = ll_i2sbi(inode);

	LASSERT((lsm != NULL) == ((body->mbo_valid & OBD_MD_FLEASIZE) != 0));
	if (lsm)
	if (body->mbo_valid & OBD_MD_FLEASIZE)
		cl_file_inode_init(inode, md);

	if (S_ISDIR(inode->i_mode)) {
@@ -2135,17 +2131,14 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
			conf.coc_opc = OBJECT_CONF_SET;
			conf.coc_inode = *inode;
			conf.coc_lock = lock;
			conf.u.coc_md = &md;
			conf.u.coc_layout = md.layout;
			(void)ll_layout_conf(*inode, &conf);
		}
		LDLM_LOCK_PUT(lock);
	}

out:
	if (md.lsm)
		obd_free_memmd(sbi->ll_dt_exp, &md.lsm);
	md_free_lustre_md(sbi->ll_md_exp, &md);

cleanup:
	if (rc != 0 && it && it->it_op & IT_OPEN)
		ll_open_cleanup(sb ? sb : (*inode)->i_sb, req);
Loading