Commit 9989a58e authored by John Hammond's avatar John Hammond Committed by Greg Kroah-Hartman

staging/lustre/llite: Rename struct vvp_thread_info to ll_thread_info

struct vvp_thread_info is used in the non-VVP parts of llite so rename
it struct ll_thread_info. Rename supporting functions accordingly.
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-5971Reviewed-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 98eae5e7
...@@ -1221,7 +1221,7 @@ static ssize_t ll_file_read_iter(struct kiocb *iocb, struct iov_iter *to) ...@@ -1221,7 +1221,7 @@ static ssize_t ll_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
if (IS_ERR(env)) if (IS_ERR(env))
return PTR_ERR(env); return PTR_ERR(env);
args = vvp_env_args(env, IO_NORMAL); args = ll_env_args(env, IO_NORMAL);
args->u.normal.via_iter = to; args->u.normal.via_iter = to;
args->u.normal.via_iocb = iocb; args->u.normal.via_iocb = iocb;
...@@ -1245,7 +1245,7 @@ static ssize_t ll_file_write_iter(struct kiocb *iocb, struct iov_iter *from) ...@@ -1245,7 +1245,7 @@ static ssize_t ll_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
if (IS_ERR(env)) if (IS_ERR(env))
return PTR_ERR(env); return PTR_ERR(env);
args = vvp_env_args(env, IO_NORMAL); args = ll_env_args(env, IO_NORMAL);
args->u.normal.via_iter = from; args->u.normal.via_iter = from;
args->u.normal.via_iocb = iocb; args->u.normal.via_iocb = iocb;
...@@ -1271,7 +1271,7 @@ static ssize_t ll_file_splice_read(struct file *in_file, loff_t *ppos, ...@@ -1271,7 +1271,7 @@ static ssize_t ll_file_splice_read(struct file *in_file, loff_t *ppos,
if (IS_ERR(env)) if (IS_ERR(env))
return PTR_ERR(env); return PTR_ERR(env);
args = vvp_env_args(env, IO_SPLICE); args = ll_env_args(env, IO_SPLICE);
args->u.splice.via_pipe = pipe; args->u.splice.via_pipe = pipe;
args->u.splice.via_flags = flags; args->u.splice.via_flags = flags;
......
...@@ -855,30 +855,30 @@ struct ll_cl_context { ...@@ -855,30 +855,30 @@ struct ll_cl_context {
int lcc_refcheck; int lcc_refcheck;
}; };
struct vvp_thread_info { struct ll_thread_info {
struct vvp_io_args vti_args; struct vvp_io_args lti_args;
struct ra_io_arg vti_ria; struct ra_io_arg lti_ria;
struct ll_cl_context vti_io_ctx; struct ll_cl_context lti_io_ctx;
}; };
static inline struct vvp_thread_info *vvp_env_info(const struct lu_env *env) extern struct lu_context_key ll_thread_key;
static inline struct ll_thread_info *ll_env_info(const struct lu_env *env)
{ {
extern struct lu_context_key vvp_key; struct ll_thread_info *lti;
struct vvp_thread_info *info;
info = lu_context_key_get(&env->le_ctx, &vvp_key); lti = lu_context_key_get(&env->le_ctx, &ll_thread_key);
LASSERT(info); LASSERT(lti);
return info; return lti;
} }
static inline struct vvp_io_args *vvp_env_args(const struct lu_env *env, static inline struct vvp_io_args *ll_env_args(const struct lu_env *env,
enum vvp_io_subtype type) enum vvp_io_subtype type)
{ {
struct vvp_io_args *ret = &vvp_env_info(env)->vti_args; struct vvp_io_args *via = &ll_env_info(env)->lti_args;
ret->via_io_subtype = type; via->via_io_subtype = type;
return ret; return via;
} }
int vvp_global_init(void); int vvp_global_init(void);
......
...@@ -102,7 +102,7 @@ struct ll_cl_context *ll_cl_init(struct file *file, struct page *vmpage) ...@@ -102,7 +102,7 @@ struct ll_cl_context *ll_cl_init(struct file *file, struct page *vmpage)
if (IS_ERR(env)) if (IS_ERR(env))
return ERR_CAST(env); return ERR_CAST(env);
lcc = &vvp_env_info(env)->vti_io_ctx; lcc = &ll_env_info(env)->lti_io_ctx;
memset(lcc, 0, sizeof(*lcc)); memset(lcc, 0, sizeof(*lcc));
lcc->lcc_env = env; lcc->lcc_env = env;
lcc->lcc_refcheck = refcheck; lcc->lcc_refcheck = refcheck;
...@@ -523,12 +523,12 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io, ...@@ -523,12 +523,12 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io,
bool hit) bool hit)
{ {
struct vvp_io *vio = vvp_env_io(env); struct vvp_io *vio = vvp_env_io(env);
struct vvp_thread_info *vti = vvp_env_info(env); struct ll_thread_info *lti = ll_env_info(env);
struct cl_attr *attr = ccc_env_thread_attr(env); struct cl_attr *attr = ccc_env_thread_attr(env);
unsigned long start = 0, end = 0, reserved; unsigned long start = 0, end = 0, reserved;
unsigned long ra_end, len, mlen = 0; unsigned long ra_end, len, mlen = 0;
struct inode *inode; struct inode *inode;
struct ra_io_arg *ria = &vti->vti_ria; struct ra_io_arg *ria = &lti->lti_ria;
struct cl_object *clob; struct cl_object *clob;
int ret = 0; int ret = 0;
__u64 kms; __u64 kms;
......
...@@ -57,12 +57,17 @@ ...@@ -57,12 +57,17 @@
* "llite_" (var. "ll_") prefix. * "llite_" (var. "ll_") prefix.
*/ */
static struct kmem_cache *ll_thread_kmem;
struct kmem_cache *vvp_lock_kmem; struct kmem_cache *vvp_lock_kmem;
struct kmem_cache *vvp_object_kmem; struct kmem_cache *vvp_object_kmem;
struct kmem_cache *vvp_req_kmem; struct kmem_cache *vvp_req_kmem;
static struct kmem_cache *vvp_thread_kmem;
static struct kmem_cache *vvp_session_kmem; static struct kmem_cache *vvp_session_kmem;
static struct lu_kmem_descr vvp_caches[] = { static struct lu_kmem_descr vvp_caches[] = {
{
.ckd_cache = &ll_thread_kmem,
.ckd_name = "ll_thread_kmem",
.ckd_size = sizeof(struct ll_thread_info),
},
{ {
.ckd_cache = &vvp_lock_kmem, .ckd_cache = &vvp_lock_kmem,
.ckd_name = "vvp_lock_kmem", .ckd_name = "vvp_lock_kmem",
...@@ -78,11 +83,6 @@ static struct lu_kmem_descr vvp_caches[] = { ...@@ -78,11 +83,6 @@ static struct lu_kmem_descr vvp_caches[] = {
.ckd_name = "vvp_req_kmem", .ckd_name = "vvp_req_kmem",
.ckd_size = sizeof(struct vvp_req), .ckd_size = sizeof(struct vvp_req),
}, },
{
.ckd_cache = &vvp_thread_kmem,
.ckd_name = "vvp_thread_kmem",
.ckd_size = sizeof(struct vvp_thread_info),
},
{ {
.ckd_cache = &vvp_session_kmem, .ckd_cache = &vvp_session_kmem,
.ckd_name = "vvp_session_kmem", .ckd_name = "vvp_session_kmem",
...@@ -93,25 +93,31 @@ static struct lu_kmem_descr vvp_caches[] = { ...@@ -93,25 +93,31 @@ static struct lu_kmem_descr vvp_caches[] = {
} }
}; };
static void *vvp_key_init(const struct lu_context *ctx, static void *ll_thread_key_init(const struct lu_context *ctx,
struct lu_context_key *key) struct lu_context_key *key)
{ {
struct vvp_thread_info *info; struct vvp_thread_info *info;
info = kmem_cache_zalloc(vvp_thread_kmem, GFP_NOFS); info = kmem_cache_zalloc(ll_thread_kmem, GFP_NOFS);
if (!info) if (!info)
info = ERR_PTR(-ENOMEM); info = ERR_PTR(-ENOMEM);
return info; return info;
} }
static void vvp_key_fini(const struct lu_context *ctx, static void ll_thread_key_fini(const struct lu_context *ctx,
struct lu_context_key *key, void *data) struct lu_context_key *key, void *data)
{ {
struct vvp_thread_info *info = data; struct vvp_thread_info *info = data;
kmem_cache_free(vvp_thread_kmem, info); kmem_cache_free(ll_thread_kmem, info);
} }
struct lu_context_key ll_thread_key = {
.lct_tags = LCT_CL_THREAD,
.lct_init = ll_thread_key_init,
.lct_fini = ll_thread_key_fini
};
static void *vvp_session_key_init(const struct lu_context *ctx, static void *vvp_session_key_init(const struct lu_context *ctx,
struct lu_context_key *key) struct lu_context_key *key)
{ {
...@@ -131,12 +137,6 @@ static void vvp_session_key_fini(const struct lu_context *ctx, ...@@ -131,12 +137,6 @@ static void vvp_session_key_fini(const struct lu_context *ctx,
kmem_cache_free(vvp_session_kmem, session); kmem_cache_free(vvp_session_kmem, session);
} }
struct lu_context_key vvp_key = {
.lct_tags = LCT_CL_THREAD,
.lct_init = vvp_key_init,
.lct_fini = vvp_key_fini
};
struct lu_context_key vvp_session_key = { struct lu_context_key vvp_session_key = {
.lct_tags = LCT_SESSION, .lct_tags = LCT_SESSION,
.lct_init = vvp_session_key_init, .lct_init = vvp_session_key_init,
...@@ -144,7 +144,7 @@ struct lu_context_key vvp_session_key = { ...@@ -144,7 +144,7 @@ struct lu_context_key vvp_session_key = {
}; };
/* type constructor/destructor: vvp_type_{init,fini,start,stop}(). */ /* type constructor/destructor: vvp_type_{init,fini,start,stop}(). */
LU_TYPE_INIT_FINI(vvp, &ccc_key, &vvp_key, &vvp_session_key); LU_TYPE_INIT_FINI(vvp, &ccc_key, &ll_thread_key, &vvp_session_key);
static const struct lu_device_operations vvp_lu_ops = { static const struct lu_device_operations vvp_lu_ops = {
.ldo_object_alloc = vvp_object_alloc .ldo_object_alloc = vvp_object_alloc
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment