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

Commit 85cb63bc authored by Jinshan Xiong's avatar Jinshan Xiong Committed by Greg Kroah-Hartman
Browse files

staging: lustre: llite: remove lli_has_smd



Remove the lli_has_smd flag from struct ll_inode_info. The empty
layout case will be handled by the LOV layer. Remove the unused
function cl_local_size().

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


Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.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 55554f31
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -632,12 +632,6 @@ int ll_file_open(struct inode *inode, struct file *file)
	if (!S_ISREG(inode->i_mode))
		goto out_och_free;

	if (!lli->lli_has_smd &&
	    (cl_is_lov_delay_create(file->f_flags) ||
	     (file->f_mode & FMODE_WRITE) == 0)) {
		CDEBUG(D_INODE, "object creation was delayed\n");
		goto out_och_free;
	}
	cl_lov_delay_create_clear(&file->f_flags);
	goto out_och_free;

@@ -3185,7 +3179,6 @@ int ll_layout_conf(struct inode *inode, const struct cl_object_conf *conf)
		       PFID(&lli->lli_fid), ll_layout_version_get(lli),
		       cl.cl_layout_gen);
		ll_layout_version_set(lli, cl.cl_layout_gen);
		lli->lli_has_smd = lsm_has_objects(conf->u.coc_md->lsm);
	}
out:
	cl_env_nested_put(&nest, env);
+46 −88
Original line number Diff line number Diff line
@@ -80,14 +80,12 @@ blkcnt_t dirty_cnt(struct inode *inode)
int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
		    struct inode *inode, struct cl_object *clob, int agl)
{
	struct ll_inode_info *lli   = ll_i2info(inode);
	const struct lu_fid  *fid   = lu_object_fid(&clob->co_lu);
	struct cl_lock *lock = vvp_env_lock(env);
	struct cl_lock_descr *descr = &lock->cll_descr;
	int result = 0;

	CDEBUG(D_DLMTRACE, "Glimpsing inode " DFID "\n", PFID(fid));
	if (lli->lli_has_smd) {
		struct cl_lock *lock = vvp_env_lock(env);
		struct cl_lock_descr *descr = &lock->cll_descr;

	/* NOTE: this looks like DLM lock request, but it may
	 *       not be one. Due to CEF_ASYNC flag (translated
@@ -135,10 +133,6 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
	}

	cl_lock_release(env, lock);
	} else {
		CDEBUG(D_DLMTRACE, "No objects for inode\n");
		ll_merge_attr(env, inode);
	}

	return result;
}
@@ -209,39 +203,3 @@ int cl_glimpse_size0(struct inode *inode, int agl)
	}
	return result;
}

int cl_local_size(struct inode *inode)
{
	struct lu_env	   *env = NULL;
	struct cl_io	    *io  = NULL;
	struct cl_object	*clob;
	int		      result;
	int		      refcheck;

	if (!ll_i2info(inode)->lli_has_smd)
		return 0;

	result = cl_io_get(inode, &env, &io, &refcheck);
	if (result <= 0)
		return result;

	clob = io->ci_obj;
	result = cl_io_init(env, io, CIT_MISC, clob);
	if (result > 0) {
		result = io->ci_result;
	} else if (result == 0) {
		struct cl_lock *lock = vvp_env_lock(env);

		lock->cll_descr = whole_file;
		lock->cll_descr.cld_enq_flags = CEF_PEEK;
		lock->cll_descr.cld_obj = clob;
		result = cl_lock_request(env, io, lock);
		if (result == 0) {
			ll_merge_attr(env, inode);
			cl_lock_release(env, lock);
		}
	}
	cl_io_fini(env, io);
	cl_env_put(env, &refcheck);
	return result;
}
+0 −1
Original line number Diff line number Diff line
@@ -184,7 +184,6 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
			 * locked by I_NEW bit.
			 */
			lli->lli_clob = clob;
			lli->lli_has_smd = lsm_has_objects(md->lsm);
			lu_object_ref_add(&clob->co_lu, "inode", inode);
		} else {
			result = PTR_ERR(clob);
+0 −2
Original line number Diff line number Diff line
@@ -226,7 +226,6 @@ struct ll_inode_info {
	 *      In the future, if more members are added only for directory,
	 *      some of the following members can be moved into u.f.
	 */
	bool			    lli_has_smd;
	struct cl_object	       *lli_clob;

	/* mutex to request for layout lock exclusively. */
@@ -1337,7 +1336,6 @@ extern int cl_inode_fini_refcheck;

int cl_file_inode_init(struct inode *inode, struct lustre_md *md);
void cl_inode_fini(struct inode *inode);
int cl_local_size(struct inode *inode);

__u64 cl_fid_build_ino(const struct lu_fid *fid, int api32);
__u32 cl_fid_build_gen(const struct lu_fid *fid);
+1 −7
Original line number Diff line number Diff line
@@ -798,7 +798,6 @@ void ll_lli_init(struct ll_inode_info *lli)
	lli->lli_open_fd_exec_count = 0;
	mutex_init(&lli->lli_och_mutex);
	spin_lock_init(&lli->lli_agl_lock);
	lli->lli_has_smd = false;
	spin_lock_init(&lli->lli_layout_lock);
	ll_layout_version_set(lli, CL_LAYOUT_GEN_NONE);
	lli->lli_clob = NULL;
@@ -1290,7 +1289,6 @@ void ll_clear_inode(struct inode *inode)
	 * cl_object still uses inode lsm.
	 */
	cl_inode_fini(inode);
	lli->lli_has_smd = false;
}

#define TIMES_SET_FLAGS (ATTR_MTIME_SET | ATTR_ATIME_SET | ATTR_TIMES_SET)
@@ -1688,8 +1686,6 @@ int ll_update_inode(struct inode *inode, struct lustre_md *md)

	LASSERT((lsm != NULL) == ((body->mbo_valid & OBD_MD_FLEASIZE) != 0));
	if (lsm) {
		if (!lli->lli_has_smd &&
		    !(sbi->ll_flags & LL_SBI_LAYOUT_LOCK))
		cl_file_inode_init(inode, md);

		lli->lli_maxbytes = lsm->lsm_maxbytes;
@@ -1802,8 +1798,6 @@ int ll_read_inode2(struct inode *inode, void *opaque)
	CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p)\n",
	       PFID(&lli->lli_fid), inode);

	LASSERT(!lli->lli_has_smd);

	/* Core attributes from the MDS first.  This is a new inode, and
	 * the VFS doesn't zero times in the core inode so we have to do
	 * it ourselves.  They will be overwritten by either MDS or OST
Loading