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

Commit 9acc4500 authored by John Hammond's avatar John Hammond Committed by Greg Kroah-Hartman
Browse files

staging/lustre/llite: rename struct ccc_thread_info to vvp_thread_info



struct ccc_thread_info is used in the VVP parts of llite so rename
it struct vvp_thread_info. Rename supporting functions accordingly.
Move init code from lcommon_cl.c to vvp_dev.c

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


Reviewed-by: default avatarBobi Jam <bobijam@hotmail.com>
Reviewed-by: default avatarJames Simmons <uja.ornl@gmail.com>
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9989a58e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -998,7 +998,7 @@ int ll_merge_attr(const struct lu_env *env, struct inode *inode)
{
	struct ll_inode_info *lli = ll_i2info(inode);
	struct cl_object *obj = lli->lli_clob;
	struct cl_attr *attr = ccc_env_thread_attr(env);
	struct cl_attr *attr = vvp_env_thread_attr(env);
	s64 atime;
	s64 mtime;
	s64 ctime;
@@ -1131,7 +1131,7 @@ ll_file_io_generic(const struct lu_env *env, struct vvp_io_args *args,
	       file->f_path.dentry->d_name.name, iot, *ppos, count);

restart:
	io = ccc_env_thread_io(env);
	io = vvp_env_thread_io(env);
	ll_io_init(io, file, iot == CIT_WRITE);

	if (cl_io_rw_init(env, io, iot, *ppos, count) == 0) {
@@ -2612,7 +2612,7 @@ int cl_sync_file_range(struct inode *inode, loff_t start, loff_t end,
	if (IS_ERR(env))
		return PTR_ERR(env);

	io = ccc_env_thread_io(env);
	io = vvp_env_thread_io(env);
	io->ci_obj = ll_i2info(inode)->lli_clob;
	io->ci_ignore_layout = ignore_layout;

+3 −3
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
	if (!(lli->lli_flags & LLIF_MDS_SIZE_LOCK)) {
		CDEBUG(D_DLMTRACE, "Glimpsing inode " DFID "\n", PFID(fid));
		if (lli->lli_has_smd) {
			struct cl_lock *lock = ccc_env_lock(env);
			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
@@ -163,7 +163,7 @@ static int cl_io_get(struct inode *inode, struct lu_env **envout,
	if (S_ISREG(inode->i_mode)) {
		env = cl_env_get(refcheck);
		if (!IS_ERR(env)) {
			io = ccc_env_thread_io(env);
			io = vvp_env_thread_io(env);
			io->ci_obj = clob;
			*envout = env;
			*ioout  = io;
@@ -238,7 +238,7 @@ int cl_local_size(struct inode *inode)
	if (result > 0) {
		result = io->ci_result;
	} else if (result == 0) {
		struct cl_lock *lock = ccc_env_lock(env);
		struct cl_lock *lock = vvp_env_lock(env);

		lock->cll_descr = whole_file;
		lock->cll_descr.cld_enq_flags = CEF_PEEK;
+2 −46
Original line number Diff line number Diff line
@@ -65,49 +65,12 @@
 * ccc_ prefix stands for "Common Client Code".
 */

static struct kmem_cache *ccc_thread_kmem;

static struct lu_kmem_descr ccc_caches[] = {
	{
		.ckd_cache = &ccc_thread_kmem,
		.ckd_name  = "ccc_thread_kmem",
		.ckd_size  = sizeof(struct ccc_thread_info),
	},
	{
		.ckd_cache = NULL
	}
};

/*****************************************************************************
 *
 * Vvp device and device type functions.
 *
 */

void *ccc_key_init(const struct lu_context *ctx, struct lu_context_key *key)
{
	struct ccc_thread_info *info;

	info = kmem_cache_zalloc(ccc_thread_kmem, GFP_NOFS);
	if (!info)
		info = ERR_PTR(-ENOMEM);
	return info;
}

void ccc_key_fini(const struct lu_context *ctx,
		  struct lu_context_key *key, void *data)
{
	struct ccc_thread_info *info = data;

	kmem_cache_free(ccc_thread_kmem, info);
}

struct lu_context_key ccc_key = {
	.lct_tags = LCT_CL_THREAD,
	.lct_init = ccc_key_init,
	.lct_fini = ccc_key_fini
};

/**
 * An `emergency' environment used by ccc_inode_fini() when cl_env_get()
 * fails. Access to this environment is serialized by ccc_inode_fini_guard
@@ -126,13 +89,9 @@ int ccc_global_init(struct lu_device_type *device_type)
{
	int result;

	result = lu_kmem_init(ccc_caches);
	if (result)
		return result;

	result = lu_device_type_init(device_type);
	if (result)
		goto out_kmem;
		return result;

	ccc_inode_fini_env = cl_env_alloc(&dummy_refcheck,
					  LCT_REMEMBER | LCT_NOREF);
@@ -145,8 +104,6 @@ int ccc_global_init(struct lu_device_type *device_type)
	return 0;
out_device:
	lu_device_type_fini(device_type);
out_kmem:
	lu_kmem_fini(ccc_caches);
	return result;
}

@@ -157,7 +114,6 @@ void ccc_global_fini(struct lu_device_type *device_type)
		ccc_inode_fini_env = NULL;
	}
	lu_device_type_fini(device_type);
	lu_kmem_fini(ccc_caches);
}

int cl_setattr_ost(struct inode *inode, const struct iattr *attr)
@@ -171,7 +127,7 @@ int cl_setattr_ost(struct inode *inode, const struct iattr *attr)
	if (IS_ERR(env))
		return PTR_ERR(env);

	io = ccc_env_thread_io(env);
	io = vvp_env_thread_io(env);
	io->ci_obj = ll_i2info(inode)->lli_clob;

	io->u.ci_setattr.sa_attr.lvb_atime = LTIME_S(attr->ia_atime);
+2 −2
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
	if (IS_ERR(env))
		return PTR_ERR(env);

	io = ccc_env_thread_io(env);
	io = vvp_env_thread_io(env);
	io->ci_obj = obj;
	io->ci_ignore_layout = 1;

@@ -154,7 +154,7 @@ int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
		return rc;
	}

	lock = ccc_env_lock(env);
	lock = vvp_env_lock(env);
	descr = &lock->cll_descr;
	descr->cld_obj = obj;
	descr->cld_start = 0;
+1 −1
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ ll_fault_io_init(struct vm_area_struct *vma, struct lu_env **env_ret,

	*env_ret = env;

	io = ccc_env_thread_io(env);
	io = vvp_env_thread_io(env);
	io->ci_obj = ll_i2info(inode)->lli_clob;
	LASSERT(io->ci_obj);

Loading