Commit a7d516d6 authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman

staging/lustre: merge lclient/*.c into llite/

Separate lclient was necessary to be shared between
different client implementations, make no sense to have
them separate in Linux kernel.
Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Based-on: http://review.whamcloud.com/10171Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 616387e8
...@@ -4,7 +4,7 @@ lustre-y := dcache.o dir.o file.o llite_close.o llite_lib.o llite_nfs.o \ ...@@ -4,7 +4,7 @@ lustre-y := dcache.o dir.o file.o llite_close.o llite_lib.o llite_nfs.o \
rw.o namei.o symlink.o llite_mmap.o \ rw.o namei.o symlink.o llite_mmap.o \
xattr.o xattr_cache.o remote_perm.o llite_rmtacl.o \ xattr.o xattr_cache.o remote_perm.o llite_rmtacl.o \
rw26.o super25.o statahead.o \ rw26.o super25.o statahead.o \
../lclient/glimpse.o ../lclient/lcommon_cl.o ../lclient/lcommon_misc.o \ glimpse.o lcommon_cl.o lcommon_misc.o \
vvp_dev.o vvp_page.o vvp_lock.o vvp_io.o vvp_object.o lproc_llite.o vvp_dev.o vvp_page.o vvp_lock.o vvp_io.o vvp_object.o lproc_llite.o
llite_lloop-y := lloop.o llite_lloop-y := lloop.o
...@@ -95,7 +95,7 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io, ...@@ -95,7 +95,7 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
result = 0; result = 0;
if (!(lli->lli_flags & LLIF_MDS_SIZE_LOCK)) { if (!(lli->lli_flags & LLIF_MDS_SIZE_LOCK)) {
CDEBUG(D_DLMTRACE, "Glimpsing inode "DFID"\n", PFID(fid)); CDEBUG(D_DLMTRACE, "Glimpsing inode " DFID "\n", PFID(fid));
if (lli->lli_has_smd) { if (lli->lli_has_smd) {
/* NOTE: this looks like DLM lock request, but it may /* NOTE: this looks like DLM lock request, but it may
* not be one. Due to CEF_ASYNC flag (translated * not be one. Due to CEF_ASYNC flag (translated
...@@ -179,10 +179,12 @@ static int cl_io_get(struct inode *inode, struct lu_env **envout, ...@@ -179,10 +179,12 @@ static int cl_io_get(struct inode *inode, struct lu_env **envout,
*envout = env; *envout = env;
*ioout = io; *ioout = io;
result = 1; result = 1;
} else } else {
result = PTR_ERR(env); result = PTR_ERR(env);
} else }
} else {
result = 0; result = 0;
}
return result; return result;
} }
...@@ -247,9 +249,9 @@ int cl_local_size(struct inode *inode) ...@@ -247,9 +249,9 @@ int cl_local_size(struct inode *inode)
clob = io->ci_obj; clob = io->ci_obj;
result = cl_io_init(env, io, CIT_MISC, clob); result = cl_io_init(env, io, CIT_MISC, clob);
if (result > 0) if (result > 0) {
result = io->ci_result; result = io->ci_result;
else if (result == 0) { } else if (result == 0) {
cti = ccc_env_info(env); cti = ccc_env_info(env);
descr = &cti->cti_descr; descr = &cti->cti_descr;
...@@ -261,9 +263,10 @@ int cl_local_size(struct inode *inode) ...@@ -261,9 +263,10 @@ int cl_local_size(struct inode *inode)
cl_unuse(env, lock); cl_unuse(env, lock);
cl_lock_release(env, lock, "localsize", current); cl_lock_release(env, lock, "localsize", current);
result = 0; result = 0;
} else } else {
result = -ENODATA; result = -ENODATA;
} }
}
cl_io_fini(env, io); cl_io_fini(env, io);
cl_env_put(env, &refcheck); cl_env_put(env, &refcheck);
return result; return result;
......
...@@ -213,15 +213,16 @@ struct lu_device *ccc_device_alloc(const struct lu_env *env, ...@@ -213,15 +213,16 @@ struct lu_device *ccc_device_alloc(const struct lu_env *env,
site = kzalloc(sizeof(*site), GFP_NOFS); site = kzalloc(sizeof(*site), GFP_NOFS);
if (site) { if (site) {
rc = cl_site_init(site, &vdv->cdv_cl); rc = cl_site_init(site, &vdv->cdv_cl);
if (rc == 0) if (rc == 0) {
rc = lu_site_init_finish(&site->cs_lu); rc = lu_site_init_finish(&site->cs_lu);
else { } else {
LASSERT(!lud->ld_site); LASSERT(!lud->ld_site);
CERROR("Cannot init lu_site, rc %d.\n", rc); CERROR("Cannot init lu_site, rc %d.\n", rc);
kfree(site); kfree(site);
} }
} else } else {
rc = -ENOMEM; rc = -ENOMEM;
}
if (rc != 0) { if (rc != 0) {
ccc_device_free(env, lud); ccc_device_free(env, lud);
lud = ERR_PTR(rc); lud = ERR_PTR(rc);
...@@ -255,8 +256,9 @@ int ccc_req_init(const struct lu_env *env, struct cl_device *dev, ...@@ -255,8 +256,9 @@ int ccc_req_init(const struct lu_env *env, struct cl_device *dev,
if (vrq) { if (vrq) {
cl_req_slice_add(req, &vrq->crq_cl, dev, &ccc_req_ops); cl_req_slice_add(req, &vrq->crq_cl, dev, &ccc_req_ops);
result = 0; result = 0;
} else } else {
result = -ENOMEM; result = -ENOMEM;
}
return result; return result;
} }
...@@ -287,7 +289,7 @@ int ccc_global_init(struct lu_device_type *device_type) ...@@ -287,7 +289,7 @@ int ccc_global_init(struct lu_device_type *device_type)
goto out_kmem; goto out_kmem;
ccc_inode_fini_env = cl_env_alloc(&dummy_refcheck, ccc_inode_fini_env = cl_env_alloc(&dummy_refcheck,
LCT_REMEMBER|LCT_NOREF); LCT_REMEMBER | LCT_NOREF);
if (IS_ERR(ccc_inode_fini_env)) { if (IS_ERR(ccc_inode_fini_env)) {
result = PTR_ERR(ccc_inode_fini_env); result = PTR_ERR(ccc_inode_fini_env);
goto out_device; goto out_device;
...@@ -339,8 +341,9 @@ struct lu_object *ccc_object_alloc(const struct lu_env *env, ...@@ -339,8 +341,9 @@ struct lu_object *ccc_object_alloc(const struct lu_env *env,
vob->cob_cl.co_ops = clops; vob->cob_cl.co_ops = clops;
obj->lo_ops = luops; obj->lo_ops = luops;
} else } else {
obj = NULL; obj = NULL;
}
return obj; return obj;
} }
...@@ -372,8 +375,9 @@ int ccc_object_init(const struct lu_env *env, struct lu_object *obj, ...@@ -372,8 +375,9 @@ int ccc_object_init(const struct lu_env *env, struct lu_object *obj,
INIT_LIST_HEAD(&vob->cob_pending_list); INIT_LIST_HEAD(&vob->cob_pending_list);
lu_object_add(obj, below); lu_object_add(obj, below);
result = ccc_object_init0(env, vob, cconf); result = ccc_object_init0(env, vob, cconf);
} else } else {
result = -ENOMEM; result = -ENOMEM;
}
return result; return result;
} }
...@@ -400,8 +404,9 @@ int ccc_lock_init(const struct lu_env *env, ...@@ -400,8 +404,9 @@ int ccc_lock_init(const struct lu_env *env,
if (clk) { if (clk) {
cl_lock_slice_add(lock, &clk->clk_cl, obj, lkops); cl_lock_slice_add(lock, &clk->clk_cl, obj, lkops);
result = 0; result = 0;
} else } else {
result = -ENOMEM; result = -ENOMEM;
}
return result; return result;
} }
...@@ -463,9 +468,9 @@ int ccc_page_is_under_lock(const struct lu_env *env, ...@@ -463,9 +468,9 @@ int ccc_page_is_under_lock(const struct lu_env *env,
if (io->ci_type == CIT_READ || io->ci_type == CIT_WRITE || if (io->ci_type == CIT_READ || io->ci_type == CIT_WRITE ||
io->ci_type == CIT_FAULT) { io->ci_type == CIT_FAULT) {
if (cio->cui_fd->fd_flags & LL_FILE_GROUP_LOCKED) if (cio->cui_fd->fd_flags & LL_FILE_GROUP_LOCKED) {
result = -EBUSY; result = -EBUSY;
else { } else {
desc->cld_start = page->cp_index; desc->cld_start = page->cp_index;
desc->cld_end = page->cp_index; desc->cld_end = page->cp_index;
desc->cld_obj = page->cp_obj; desc->cld_obj = page->cp_obj;
...@@ -473,8 +478,9 @@ int ccc_page_is_under_lock(const struct lu_env *env, ...@@ -473,8 +478,9 @@ int ccc_page_is_under_lock(const struct lu_env *env,
result = cl_queue_match(&io->ci_lockset.cls_done, result = cl_queue_match(&io->ci_lockset.cls_done,
desc) ? -EBUSY : 0; desc) ? -EBUSY : 0;
} }
} else } else {
result = 0; result = 0;
}
return result; return result;
} }
...@@ -780,11 +786,9 @@ int ccc_prep_size(const struct lu_env *env, struct cl_object *obj, ...@@ -780,11 +786,9 @@ int ccc_prep_size(const struct lu_env *env, struct cl_object *obj,
*/ */
if (cl_isize_read(inode) < kms) { if (cl_isize_read(inode) < kms) {
cl_isize_write_nolock(inode, kms); cl_isize_write_nolock(inode, kms);
CDEBUG(D_VFSTRACE, CDEBUG(D_VFSTRACE, DFID " updating i_size %llu\n",
DFID" updating i_size %llu\n",
PFID(lu_object_fid(&obj->co_lu)), PFID(lu_object_fid(&obj->co_lu)),
(__u64)cl_isize_read(inode)); (__u64)cl_isize_read(inode));
} }
} }
ccc_object_size_unlock(obj); ccc_object_size_unlock(obj);
...@@ -1044,8 +1048,9 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md) ...@@ -1044,8 +1048,9 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
lli->lli_clob = clob; lli->lli_clob = clob;
lli->lli_has_smd = lsm_has_objects(md->lsm); lli->lli_has_smd = lsm_has_objects(md->lsm);
lu_object_ref_add(&clob->co_lu, "inode", inode); lu_object_ref_add(&clob->co_lu, "inode", inode);
} else } else {
result = PTR_ERR(clob); result = PTR_ERR(clob);
}
} else { } else {
result = cl_conf_set(env, lli->lli_clob, &conf); result = cl_conf_set(env, lli->lli_clob, &conf);
} }
...@@ -1053,7 +1058,7 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md) ...@@ -1053,7 +1058,7 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
cl_env_put(env, &refcheck); cl_env_put(env, &refcheck);
if (result != 0) if (result != 0)
CERROR("Failure to initialize cl object "DFID": %d\n", CERROR("Failure to initialize cl object " DFID ": %d\n",
PFID(fid), result); PFID(fid), result);
return result; return result;
} }
...@@ -1127,8 +1132,9 @@ void cl_inode_fini(struct inode *inode) ...@@ -1127,8 +1132,9 @@ void cl_inode_fini(struct inode *inode)
if (emergency) { if (emergency) {
cl_env_unplant(ccc_inode_fini_env, &refcheck); cl_env_unplant(ccc_inode_fini_env, &refcheck);
mutex_unlock(&ccc_inode_fini_guard); mutex_unlock(&ccc_inode_fini_guard);
} else } else {
cl_env_put(env, &refcheck); cl_env_put(env, &refcheck);
}
cl_env_reexit(cookie); cl_env_reexit(cookie);
} }
} }
...@@ -1145,7 +1151,7 @@ __u16 ll_dirent_type_get(struct lu_dirent *ent) ...@@ -1145,7 +1151,7 @@ __u16 ll_dirent_type_get(struct lu_dirent *ent)
int len = 0; int len = 0;
if (le32_to_cpu(ent->lde_attrs) & LUDA_TYPE) { if (le32_to_cpu(ent->lde_attrs) & LUDA_TYPE) {
const unsigned align = sizeof(struct luda_type) - 1; const unsigned int align = sizeof(struct luda_type) - 1;
len = le16_to_cpu(ent->lde_namelen); len = le16_to_cpu(ent->lde_namelen);
len = (len + align) & ~align; len = (len + align) & ~align;
......
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