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 \
rw.o namei.o symlink.o llite_mmap.o \
xattr.o xattr_cache.o remote_perm.o llite_rmtacl.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
llite_lloop-y := lloop.o
......@@ -95,7 +95,7 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
result = 0;
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) {
/* NOTE: this looks like DLM lock request, but it may
* 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,
*envout = env;
*ioout = io;
result = 1;
} else
} else {
result = PTR_ERR(env);
} else
}
} else {
result = 0;
}
return result;
}
......@@ -247,9 +249,9 @@ int cl_local_size(struct inode *inode)
clob = io->ci_obj;
result = cl_io_init(env, io, CIT_MISC, clob);
if (result > 0)
if (result > 0) {
result = io->ci_result;
else if (result == 0) {
} else if (result == 0) {
cti = ccc_env_info(env);
descr = &cti->cti_descr;
......@@ -261,9 +263,10 @@ int cl_local_size(struct inode *inode)
cl_unuse(env, lock);
cl_lock_release(env, lock, "localsize", current);
result = 0;
} else
} else {
result = -ENODATA;
}
}
cl_io_fini(env, io);
cl_env_put(env, &refcheck);
return result;
......
......@@ -213,15 +213,16 @@ struct lu_device *ccc_device_alloc(const struct lu_env *env,
site = kzalloc(sizeof(*site), GFP_NOFS);
if (site) {
rc = cl_site_init(site, &vdv->cdv_cl);
if (rc == 0)
if (rc == 0) {
rc = lu_site_init_finish(&site->cs_lu);
else {
} else {
LASSERT(!lud->ld_site);
CERROR("Cannot init lu_site, rc %d.\n", rc);
kfree(site);
}
} else
} else {
rc = -ENOMEM;
}
if (rc != 0) {
ccc_device_free(env, lud);
lud = ERR_PTR(rc);
......@@ -255,8 +256,9 @@ int ccc_req_init(const struct lu_env *env, struct cl_device *dev,
if (vrq) {
cl_req_slice_add(req, &vrq->crq_cl, dev, &ccc_req_ops);
result = 0;
} else
} else {
result = -ENOMEM;
}
return result;
}
......@@ -287,7 +289,7 @@ int ccc_global_init(struct lu_device_type *device_type)
goto out_kmem;
ccc_inode_fini_env = cl_env_alloc(&dummy_refcheck,
LCT_REMEMBER|LCT_NOREF);
LCT_REMEMBER | LCT_NOREF);
if (IS_ERR(ccc_inode_fini_env)) {
result = PTR_ERR(ccc_inode_fini_env);
goto out_device;
......@@ -339,8 +341,9 @@ struct lu_object *ccc_object_alloc(const struct lu_env *env,
vob->cob_cl.co_ops = clops;
obj->lo_ops = luops;
} else
} else {
obj = NULL;
}
return 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);
lu_object_add(obj, below);
result = ccc_object_init0(env, vob, cconf);
} else
} else {
result = -ENOMEM;
}
return result;
}
......@@ -400,8 +404,9 @@ int ccc_lock_init(const struct lu_env *env,
if (clk) {
cl_lock_slice_add(lock, &clk->clk_cl, obj, lkops);
result = 0;
} else
} else {
result = -ENOMEM;
}
return result;
}
......@@ -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 ||
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;
else {
} else {
desc->cld_start = page->cp_index;
desc->cld_end = page->cp_index;
desc->cld_obj = page->cp_obj;
......@@ -473,8 +478,9 @@ int ccc_page_is_under_lock(const struct lu_env *env,
result = cl_queue_match(&io->ci_lockset.cls_done,
desc) ? -EBUSY : 0;
}
} else
} else {
result = 0;
}
return result;
}
......@@ -780,11 +786,9 @@ int ccc_prep_size(const struct lu_env *env, struct cl_object *obj,
*/
if (cl_isize_read(inode) < kms) {
cl_isize_write_nolock(inode, kms);
CDEBUG(D_VFSTRACE,
DFID" updating i_size %llu\n",
CDEBUG(D_VFSTRACE, DFID " updating i_size %llu\n",
PFID(lu_object_fid(&obj->co_lu)),
(__u64)cl_isize_read(inode));
}
}
ccc_object_size_unlock(obj);
......@@ -1044,8 +1048,9 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
lli->lli_clob = clob;
lli->lli_has_smd = lsm_has_objects(md->lsm);
lu_object_ref_add(&clob->co_lu, "inode", inode);
} else
} else {
result = PTR_ERR(clob);
}
} else {
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)
cl_env_put(env, &refcheck);
if (result != 0)
CERROR("Failure to initialize cl object "DFID": %d\n",
CERROR("Failure to initialize cl object " DFID ": %d\n",
PFID(fid), result);
return result;
}
......@@ -1127,8 +1132,9 @@ void cl_inode_fini(struct inode *inode)
if (emergency) {
cl_env_unplant(ccc_inode_fini_env, &refcheck);
mutex_unlock(&ccc_inode_fini_guard);
} else
} else {
cl_env_put(env, &refcheck);
}
cl_env_reexit(cookie);
}
}
......@@ -1145,7 +1151,7 @@ __u16 ll_dirent_type_get(struct lu_dirent *ent)
int len = 0;
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 = (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