Commit 29ac6840 authored by Chris Hanna's avatar Chris Hanna Committed by Greg Kroah-Hartman

staging: lustre: osc: clean up whitespace and align function parameters

Minor changes to remove excessive whitespace and improve
readability of osc functions.
Signed-off-by: default avatarChris Hanna <hannac@iu.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 06d0c498
...@@ -417,8 +417,8 @@ static ssize_t osc_checksum_type_seq_write(struct file *file, ...@@ -417,8 +417,8 @@ static ssize_t osc_checksum_type_seq_write(struct file *file,
LPROC_SEQ_FOPS(osc_checksum_type); LPROC_SEQ_FOPS(osc_checksum_type);
static ssize_t resend_count_show(struct kobject *kobj, static ssize_t resend_count_show(struct kobject *kobj,
struct attribute *attr, struct attribute *attr,
char *buf) char *buf)
{ {
struct obd_device *obd = container_of(kobj, struct obd_device, struct obd_device *obd = container_of(kobj, struct obd_device,
obd_kobj); obd_kobj);
...@@ -427,9 +427,9 @@ static ssize_t resend_count_show(struct kobject *kobj, ...@@ -427,9 +427,9 @@ static ssize_t resend_count_show(struct kobject *kobj,
} }
static ssize_t resend_count_store(struct kobject *kobj, static ssize_t resend_count_store(struct kobject *kobj,
struct attribute *attr, struct attribute *attr,
const char *buffer, const char *buffer,
size_t count) size_t count)
{ {
struct obd_device *obd = container_of(kobj, struct obd_device, struct obd_device *obd = container_of(kobj, struct obd_device,
obd_kobj); obd_kobj);
...@@ -682,8 +682,8 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v) ...@@ -682,8 +682,8 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v)
#undef pct #undef pct
static ssize_t osc_rpc_stats_seq_write(struct file *file, static ssize_t osc_rpc_stats_seq_write(struct file *file,
const char __user *buf, const char __user *buf,
size_t len, loff_t *off) size_t len, loff_t *off)
{ {
struct seq_file *seq = file->private_data; struct seq_file *seq = file->private_data;
struct obd_device *dev = seq->private; struct obd_device *dev = seq->private;
...@@ -721,8 +721,8 @@ static int osc_stats_seq_show(struct seq_file *seq, void *v) ...@@ -721,8 +721,8 @@ static int osc_stats_seq_show(struct seq_file *seq, void *v)
} }
static ssize_t osc_stats_seq_write(struct file *file, static ssize_t osc_stats_seq_write(struct file *file,
const char __user *buf, const char __user *buf,
size_t len, loff_t *off) size_t len, loff_t *off)
{ {
struct seq_file *seq = file->private_data; struct seq_file *seq = file->private_data;
struct obd_device *dev = seq->private; struct obd_device *dev = seq->private;
......
...@@ -118,7 +118,7 @@ static struct lu_device *osc2lu_dev(struct osc_device *osc) ...@@ -118,7 +118,7 @@ static struct lu_device *osc2lu_dev(struct osc_device *osc)
*/ */
static void *osc_key_init(const struct lu_context *ctx, static void *osc_key_init(const struct lu_context *ctx,
struct lu_context_key *key) struct lu_context_key *key)
{ {
struct osc_thread_info *info; struct osc_thread_info *info;
...@@ -248,14 +248,14 @@ static const struct lu_device_type_operations osc_device_type_ops = { ...@@ -248,14 +248,14 @@ static const struct lu_device_type_operations osc_device_type_ops = {
.ldto_device_alloc = osc_device_alloc, .ldto_device_alloc = osc_device_alloc,
.ldto_device_free = osc_device_free, .ldto_device_free = osc_device_free,
.ldto_device_init = osc_device_init, .ldto_device_init = osc_device_init,
.ldto_device_fini = osc_device_fini .ldto_device_fini = osc_device_fini
}; };
struct lu_device_type osc_device_type = { struct lu_device_type osc_device_type = {
.ldt_tags = LU_DEVICE_CL, .ldt_tags = LU_DEVICE_CL,
.ldt_name = LUSTRE_OSC_NAME, .ldt_name = LUSTRE_OSC_NAME,
.ldt_ops = &osc_device_type_ops, .ldt_ops = &osc_device_type_ops,
.ldt_ctx_tags = LCT_CL_THREAD .ldt_ctx_tags = LCT_CL_THREAD
}; };
......
...@@ -100,16 +100,16 @@ static int osc_io_submit(const struct lu_env *env, ...@@ -100,16 +100,16 @@ static int osc_io_submit(const struct lu_env *env,
const struct cl_io_slice *ios, const struct cl_io_slice *ios,
enum cl_req_type crt, struct cl_2queue *queue) enum cl_req_type crt, struct cl_2queue *queue)
{ {
struct cl_page *page; struct cl_page *page;
struct cl_page *tmp; struct cl_page *tmp;
struct client_obd *cli = NULL; struct client_obd *cli = NULL;
struct osc_object *osc = NULL; /* to keep gcc happy */ struct osc_object *osc = NULL; /* to keep gcc happy */
struct osc_page *opg; struct osc_page *opg;
struct cl_io *io; struct cl_io *io;
LIST_HEAD(list); LIST_HEAD(list);
struct cl_page_list *qin = &queue->c2_qin; struct cl_page_list *qin = &queue->c2_qin;
struct cl_page_list *qout = &queue->c2_qout; struct cl_page_list *qout = &queue->c2_qout;
int queued = 0; int queued = 0;
int result = 0; int result = 0;
int cmd; int cmd;
...@@ -189,8 +189,8 @@ static int osc_io_submit(const struct lu_env *env, ...@@ -189,8 +189,8 @@ static int osc_io_submit(const struct lu_env *env,
static void osc_page_touch_at(const struct lu_env *env, static void osc_page_touch_at(const struct lu_env *env,
struct cl_object *obj, pgoff_t idx, unsigned to) struct cl_object *obj, pgoff_t idx, unsigned to)
{ {
struct lov_oinfo *loi = cl2osc(obj)->oo_oinfo; struct lov_oinfo *loi = cl2osc(obj)->oo_oinfo;
struct cl_attr *attr = &osc_env_info(env)->oti_attr; struct cl_attr *attr = &osc_env_info(env)->oti_attr;
int valid; int valid;
__u64 kms; __u64 kms;
...@@ -233,8 +233,8 @@ static void osc_page_touch_at(const struct lu_env *env, ...@@ -233,8 +233,8 @@ static void osc_page_touch_at(const struct lu_env *env,
static void osc_page_touch(const struct lu_env *env, static void osc_page_touch(const struct lu_env *env,
struct osc_page *opage, unsigned to) struct osc_page *opage, unsigned to)
{ {
struct cl_page *page = opage->ops_cl.cpl_page; struct cl_page *page = opage->ops_cl.cpl_page;
struct cl_object *obj = opage->ops_cl.cpl_obj; struct cl_object *obj = opage->ops_cl.cpl_obj;
osc_page_touch_at(env, obj, page->cp_index, to); osc_page_touch_at(env, obj, page->cp_index, to);
} }
...@@ -260,7 +260,7 @@ static int osc_io_prepare_write(const struct lu_env *env, ...@@ -260,7 +260,7 @@ static int osc_io_prepare_write(const struct lu_env *env,
{ {
struct osc_device *dev = lu2osc_dev(slice->cpl_obj->co_lu.lo_dev); struct osc_device *dev = lu2osc_dev(slice->cpl_obj->co_lu.lo_dev);
struct obd_import *imp = class_exp2cliimp(dev->od_exp); struct obd_import *imp = class_exp2cliimp(dev->od_exp);
struct osc_io *oio = cl2osc_io(env, ios); struct osc_io *oio = cl2osc_io(env, ios);
int result = 0; int result = 0;
/* /*
...@@ -284,9 +284,9 @@ static int osc_io_commit_write(const struct lu_env *env, ...@@ -284,9 +284,9 @@ static int osc_io_commit_write(const struct lu_env *env,
const struct cl_page_slice *slice, const struct cl_page_slice *slice,
unsigned from, unsigned to) unsigned from, unsigned to)
{ {
struct osc_io *oio = cl2osc_io(env, ios); struct osc_io *oio = cl2osc_io(env, ios);
struct osc_page *opg = cl2osc_page(slice); struct osc_page *opg = cl2osc_page(slice);
struct osc_object *obj = cl2osc(opg->ops_cl.cpl_obj); struct osc_object *obj = cl2osc(opg->ops_cl.cpl_obj);
struct osc_async_page *oap = &opg->ops_oap; struct osc_async_page *oap = &opg->ops_oap;
LASSERT(to > 0); LASSERT(to > 0);
...@@ -311,10 +311,10 @@ static int osc_io_commit_write(const struct lu_env *env, ...@@ -311,10 +311,10 @@ static int osc_io_commit_write(const struct lu_env *env,
static int osc_io_fault_start(const struct lu_env *env, static int osc_io_fault_start(const struct lu_env *env,
const struct cl_io_slice *ios) const struct cl_io_slice *ios)
{ {
struct cl_io *io; struct cl_io *io;
struct cl_fault_io *fio; struct cl_fault_io *fio;
io = ios->cis_io; io = ios->cis_io;
fio = &io->u.ci_fault; fio = &io->u.ci_fault;
CDEBUG(D_INFO, "%lu %d %d\n", CDEBUG(D_INFO, "%lu %d %d\n",
fio->ft_index, fio->ft_writable, fio->ft_nob); fio->ft_index, fio->ft_writable, fio->ft_nob);
...@@ -375,11 +375,11 @@ static void osc_trunc_check(const struct lu_env *env, struct cl_io *io, ...@@ -375,11 +375,11 @@ static void osc_trunc_check(const struct lu_env *env, struct cl_io *io,
struct osc_io *oio, __u64 size) struct osc_io *oio, __u64 size)
{ {
struct cl_object *clob; struct cl_object *clob;
int partial; int partial;
pgoff_t start; pgoff_t start;
clob = oio->oi_cl.cis_obj; clob = oio->oi_cl.cis_obj;
start = cl_index(clob, size); start = cl_index(clob, size);
partial = cl_offset(clob, start) < size; partial = cl_offset(clob, start) < size;
/* /*
...@@ -392,17 +392,17 @@ static void osc_trunc_check(const struct lu_env *env, struct cl_io *io, ...@@ -392,17 +392,17 @@ static void osc_trunc_check(const struct lu_env *env, struct cl_io *io,
static int osc_io_setattr_start(const struct lu_env *env, static int osc_io_setattr_start(const struct lu_env *env,
const struct cl_io_slice *slice) const struct cl_io_slice *slice)
{ {
struct cl_io *io = slice->cis_io; struct cl_io *io = slice->cis_io;
struct osc_io *oio = cl2osc_io(env, slice); struct osc_io *oio = cl2osc_io(env, slice);
struct cl_object *obj = slice->cis_obj; struct cl_object *obj = slice->cis_obj;
struct lov_oinfo *loi = cl2osc(obj)->oo_oinfo; struct lov_oinfo *loi = cl2osc(obj)->oo_oinfo;
struct cl_attr *attr = &osc_env_info(env)->oti_attr; struct cl_attr *attr = &osc_env_info(env)->oti_attr;
struct obdo *oa = &oio->oi_oa; struct obdo *oa = &oio->oi_oa;
struct osc_async_cbargs *cbargs = &oio->oi_cbarg; struct osc_async_cbargs *cbargs = &oio->oi_cbarg;
__u64 size = io->u.ci_setattr.sa_attr.lvb_size; __u64 size = io->u.ci_setattr.sa_attr.lvb_size;
unsigned int ia_valid = io->u.ci_setattr.sa_valid; unsigned int ia_valid = io->u.ci_setattr.sa_valid;
int result = 0; int result = 0;
struct obd_info oinfo = { { { 0 } } }; struct obd_info oinfo = { { { 0 } } };
/* truncate cache dirty pages first */ /* truncate cache dirty pages first */
if (cl_io_is_trunc(io)) if (cl_io_is_trunc(io))
...@@ -477,8 +477,8 @@ static int osc_io_setattr_start(const struct lu_env *env, ...@@ -477,8 +477,8 @@ static int osc_io_setattr_start(const struct lu_env *env,
static void osc_io_setattr_end(const struct lu_env *env, static void osc_io_setattr_end(const struct lu_env *env,
const struct cl_io_slice *slice) const struct cl_io_slice *slice)
{ {
struct cl_io *io = slice->cis_io; struct cl_io *io = slice->cis_io;
struct osc_io *oio = cl2osc_io(env, slice); struct osc_io *oio = cl2osc_io(env, slice);
struct cl_object *obj = slice->cis_obj; struct cl_object *obj = slice->cis_obj;
struct osc_async_cbargs *cbargs = &oio->oi_cbarg; struct osc_async_cbargs *cbargs = &oio->oi_cbarg;
int result = 0; int result = 0;
...@@ -512,8 +512,8 @@ static void osc_io_setattr_end(const struct lu_env *env, ...@@ -512,8 +512,8 @@ static void osc_io_setattr_end(const struct lu_env *env,
static int osc_io_read_start(const struct lu_env *env, static int osc_io_read_start(const struct lu_env *env,
const struct cl_io_slice *slice) const struct cl_io_slice *slice)
{ {
struct cl_object *obj = slice->cis_obj; struct cl_object *obj = slice->cis_obj;
struct cl_attr *attr = &osc_env_info(env)->oti_attr; struct cl_attr *attr = &osc_env_info(env)->oti_attr;
int rc = 0; int rc = 0;
if (!slice->cis_io->ci_noatime) { if (!slice->cis_io->ci_noatime) {
...@@ -528,8 +528,8 @@ static int osc_io_read_start(const struct lu_env *env, ...@@ -528,8 +528,8 @@ static int osc_io_read_start(const struct lu_env *env,
static int osc_io_write_start(const struct lu_env *env, static int osc_io_write_start(const struct lu_env *env,
const struct cl_io_slice *slice) const struct cl_io_slice *slice)
{ {
struct cl_object *obj = slice->cis_obj; struct cl_object *obj = slice->cis_obj;
struct cl_attr *attr = &osc_env_info(env)->oti_attr; struct cl_attr *attr = &osc_env_info(env)->oti_attr;
int rc = 0; int rc = 0;
OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_SETTIME, 1); OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_SETTIME, 1);
...@@ -544,10 +544,10 @@ static int osc_io_write_start(const struct lu_env *env, ...@@ -544,10 +544,10 @@ static int osc_io_write_start(const struct lu_env *env,
static int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj, static int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj,
struct cl_fsync_io *fio) struct cl_fsync_io *fio)
{ {
struct osc_io *oio = osc_env_io(env); struct osc_io *oio = osc_env_io(env);
struct obdo *oa = &oio->oi_oa; struct obdo *oa = &oio->oi_oa;
struct obd_info *oinfo = &oio->oi_info; struct obd_info *oinfo = &oio->oi_info;
struct lov_oinfo *loi = obj->oo_oinfo; struct lov_oinfo *loi = obj->oo_oinfo;
struct osc_async_cbargs *cbargs = &oio->oi_cbarg; struct osc_async_cbargs *cbargs = &oio->oi_cbarg;
int rc = 0; int rc = 0;
...@@ -575,13 +575,13 @@ static int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj, ...@@ -575,13 +575,13 @@ static int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj,
static int osc_io_fsync_start(const struct lu_env *env, static int osc_io_fsync_start(const struct lu_env *env,
const struct cl_io_slice *slice) const struct cl_io_slice *slice)
{ {
struct cl_io *io = slice->cis_io; struct cl_io *io = slice->cis_io;
struct cl_fsync_io *fio = &io->u.ci_fsync; struct cl_fsync_io *fio = &io->u.ci_fsync;
struct cl_object *obj = slice->cis_obj; struct cl_object *obj = slice->cis_obj;
struct osc_object *osc = cl2osc(obj); struct osc_object *osc = cl2osc(obj);
pgoff_t start = cl_index(obj, fio->fi_start); pgoff_t start = cl_index(obj, fio->fi_start);
pgoff_t end = cl_index(obj, fio->fi_end); pgoff_t end = cl_index(obj, fio->fi_end);
int result = 0; int result = 0;
if (fio->fi_end == OBD_OBJECT_EOF) if (fio->fi_end == OBD_OBJECT_EOF)
end = CL_PAGE_EOF; end = CL_PAGE_EOF;
...@@ -615,15 +615,15 @@ static void osc_io_fsync_end(const struct lu_env *env, ...@@ -615,15 +615,15 @@ static void osc_io_fsync_end(const struct lu_env *env,
const struct cl_io_slice *slice) const struct cl_io_slice *slice)
{ {
struct cl_fsync_io *fio = &slice->cis_io->u.ci_fsync; struct cl_fsync_io *fio = &slice->cis_io->u.ci_fsync;
struct cl_object *obj = slice->cis_obj; struct cl_object *obj = slice->cis_obj;
pgoff_t start = cl_index(obj, fio->fi_start); pgoff_t start = cl_index(obj, fio->fi_start);
pgoff_t end = cl_index(obj, fio->fi_end); pgoff_t end = cl_index(obj, fio->fi_end);
int result = 0; int result = 0;
if (fio->fi_mode == CL_FSYNC_LOCAL) { if (fio->fi_mode == CL_FSYNC_LOCAL) {
result = osc_cache_wait_range(env, cl2osc(obj), start, end); result = osc_cache_wait_range(env, cl2osc(obj), start, end);
} else if (fio->fi_mode == CL_FSYNC_ALL) { } else if (fio->fi_mode == CL_FSYNC_ALL) {
struct osc_io *oio = cl2osc_io(env, slice); struct osc_io *oio = cl2osc_io(env, slice);
struct osc_async_cbargs *cbargs = &oio->oi_cbarg; struct osc_async_cbargs *cbargs = &oio->oi_cbarg;
wait_for_completion(&cbargs->opc_sync); wait_for_completion(&cbargs->opc_sync);
...@@ -717,17 +717,17 @@ static void osc_req_attr_set(const struct lu_env *env, ...@@ -717,17 +717,17 @@ static void osc_req_attr_set(const struct lu_env *env,
struct cl_req_attr *attr, u64 flags) struct cl_req_attr *attr, u64 flags)
{ {
struct lov_oinfo *oinfo; struct lov_oinfo *oinfo;
struct cl_req *clerq; struct cl_req *clerq;
struct cl_page *apage; /* _some_ page in @clerq */ struct cl_page *apage; /* _some_ page in @clerq */
struct cl_lock *lock; /* _some_ lock protecting @apage */ struct cl_lock *lock; /* _some_ lock protecting @apage */
struct osc_lock *olck; struct osc_lock *olck;
struct osc_page *opg; struct osc_page *opg;
struct obdo *oa; struct obdo *oa;
struct ost_lvb *lvb; struct ost_lvb *lvb;
oinfo = cl2osc(obj)->oo_oinfo; oinfo = cl2osc(obj)->oo_oinfo;
lvb = &oinfo->loi_lvb; lvb = &oinfo->loi_lvb;
oa = attr->cra_oa; oa = attr->cra_oa;
if ((flags & OBD_MD_FLMTIME) != 0) { if ((flags & OBD_MD_FLMTIME) != 0) {
oa->o_mtime = lvb->lvb_mtime; oa->o_mtime = lvb->lvb_mtime;
...@@ -759,7 +759,7 @@ static void osc_req_attr_set(const struct lu_env *env, ...@@ -759,7 +759,7 @@ static void osc_req_attr_set(const struct lu_env *env,
lock = cl_lock_at_page(env, apage->cp_obj, apage, NULL, 1, 1); lock = cl_lock_at_page(env, apage->cp_obj, apage, NULL, 1, 1);
if (lock == NULL) { if (lock == NULL) {
struct cl_object_header *head; struct cl_object_header *head;
struct cl_lock *scan; struct cl_lock *scan;
head = cl_object_header(apage->cp_obj); head = cl_object_header(apage->cp_obj);
list_for_each_entry(scan, &head->coh_locks, list_for_each_entry(scan, &head->coh_locks,
......
...@@ -72,7 +72,7 @@ static struct osc_object *lu2osc(const struct lu_object *obj) ...@@ -72,7 +72,7 @@ static struct osc_object *lu2osc(const struct lu_object *obj)
static int osc_object_init(const struct lu_env *env, struct lu_object *obj, static int osc_object_init(const struct lu_env *env, struct lu_object *obj,
const struct lu_object_conf *conf) const struct lu_object_conf *conf)
{ {
struct osc_object *osc = lu2osc(obj); struct osc_object *osc = lu2osc(obj);
const struct cl_object_conf *cconf = lu2cl_conf(conf); const struct cl_object_conf *cconf = lu2cl_conf(conf);
int i; int i;
...@@ -136,9 +136,9 @@ int osc_lvb_print(const struct lu_env *env, void *cookie, ...@@ -136,9 +136,9 @@ int osc_lvb_print(const struct lu_env *env, void *cookie,
static int osc_object_print(const struct lu_env *env, void *cookie, static int osc_object_print(const struct lu_env *env, void *cookie,
lu_printer_t p, const struct lu_object *obj) lu_printer_t p, const struct lu_object *obj)
{ {
struct osc_object *osc = lu2osc(obj); struct osc_object *osc = lu2osc(obj);
struct lov_oinfo *oinfo = osc->oo_oinfo; struct lov_oinfo *oinfo = osc->oo_oinfo;
struct osc_async_rc *ar = &oinfo->loi_ar; struct osc_async_rc *ar = &oinfo->loi_ar;
(*p)(env, cookie, "id: " DOSTID " idx: %d gen: %d kms_valid: %u kms %llu rc: %d force_sync: %d min_xid: %llu ", (*p)(env, cookie, "id: " DOSTID " idx: %d gen: %d kms_valid: %u kms %llu rc: %d force_sync: %d min_xid: %llu ",
POSTID(&oinfo->loi_oi), oinfo->loi_ost_idx, POSTID(&oinfo->loi_oi), oinfo->loi_ost_idx,
...@@ -163,7 +163,7 @@ int osc_attr_set(const struct lu_env *env, struct cl_object *obj, ...@@ -163,7 +163,7 @@ int osc_attr_set(const struct lu_env *env, struct cl_object *obj,
const struct cl_attr *attr, unsigned valid) const struct cl_attr *attr, unsigned valid)
{ {
struct lov_oinfo *oinfo = cl2osc(obj)->oo_oinfo; struct lov_oinfo *oinfo = cl2osc(obj)->oo_oinfo;
struct ost_lvb *lvb = &oinfo->loi_lvb; struct ost_lvb *lvb = &oinfo->loi_lvb;
if (valid & CAT_SIZE) if (valid & CAT_SIZE)
lvb->lvb_size = attr->cat_size; lvb->lvb_size = attr->cat_size;
...@@ -188,7 +188,7 @@ static int osc_object_glimpse(const struct lu_env *env, ...@@ -188,7 +188,7 @@ static int osc_object_glimpse(const struct lu_env *env,
{ {
struct lov_oinfo *oinfo = cl2osc(obj)->oo_oinfo; struct lov_oinfo *oinfo = cl2osc(obj)->oo_oinfo;
lvb->lvb_size = oinfo->loi_kms; lvb->lvb_size = oinfo->loi_kms;
lvb->lvb_blocks = oinfo->loi_lvb.lvb_blocks; lvb->lvb_blocks = oinfo->loi_lvb.lvb_blocks;
return 0; return 0;
} }
...@@ -208,9 +208,9 @@ void osc_object_clear_contended(struct osc_object *obj) ...@@ -208,9 +208,9 @@ void osc_object_clear_contended(struct osc_object *obj)
int osc_object_is_contended(struct osc_object *obj) int osc_object_is_contended(struct osc_object *obj)
{ {
struct osc_device *dev = lu2osc_dev(obj->oo_cl.co_lu.lo_dev); struct osc_device *dev = lu2osc_dev(obj->oo_cl.co_lu.lo_dev);
int osc_contention_time = dev->od_contention_time; int osc_contention_time = dev->od_contention_time;
unsigned long cur_time = cfs_time_current(); unsigned long cur_time = cfs_time_current();
unsigned long retry_time; unsigned long retry_time;
if (OBD_FAIL_CHECK(OBD_FAIL_OSC_OBJECT_CONTENTION)) if (OBD_FAIL_CHECK(OBD_FAIL_OSC_OBJECT_CONTENTION))
...@@ -255,7 +255,7 @@ struct lu_object *osc_object_alloc(const struct lu_env *env, ...@@ -255,7 +255,7 @@ struct lu_object *osc_object_alloc(const struct lu_env *env,
struct lu_device *dev) struct lu_device *dev)
{ {
struct osc_object *osc; struct osc_object *osc;
struct lu_object *obj; struct lu_object *obj;
OBD_SLAB_ALLOC_PTR_GFP(osc, osc_object_kmem, GFP_NOFS); OBD_SLAB_ALLOC_PTR_GFP(osc, osc_object_kmem, GFP_NOFS);
if (osc != NULL) { if (osc != NULL) {
......
...@@ -216,7 +216,7 @@ static int osc_page_cache_add(const struct lu_env *env, ...@@ -216,7 +216,7 @@ static int osc_page_cache_add(const struct lu_env *env,
const struct cl_page_slice *slice, const struct cl_page_slice *slice,
struct cl_io *io) struct cl_io *io)
{ {
struct osc_io *oio = osc_env_io(env); struct osc_io *oio = osc_env_io(env);
struct osc_page *opg = cl2osc_page(slice); struct osc_page *opg = cl2osc_page(slice);
int result; int result;
...@@ -247,7 +247,7 @@ void osc_index2policy(ldlm_policy_data_t *policy, const struct cl_object *obj, ...@@ -247,7 +247,7 @@ void osc_index2policy(ldlm_policy_data_t *policy, const struct cl_object *obj,
{ {
memset(policy, 0, sizeof(*policy)); memset(policy, 0, sizeof(*policy));
policy->l_extent.start = cl_offset(obj, start); policy->l_extent.start = cl_offset(obj, start);
policy->l_extent.end = cl_offset(obj, end + 1) - 1; policy->l_extent.end = cl_offset(obj, end + 1) - 1;
} }
static int osc_page_addref_lock(const struct lu_env *env, static int osc_page_addref_lock(const struct lu_env *env,
...@@ -255,7 +255,7 @@ static int osc_page_addref_lock(const struct lu_env *env, ...@@ -255,7 +255,7 @@ static int osc_page_addref_lock(const struct lu_env *env,
struct cl_lock *lock) struct cl_lock *lock)
{ {
struct osc_lock *olock; struct osc_lock *olock;
int rc; int rc;
LASSERT(opg->ops_lock == NULL); LASSERT(opg->ops_lock == NULL);
...@@ -274,7 +274,7 @@ static int osc_page_addref_lock(const struct lu_env *env, ...@@ -274,7 +274,7 @@ static int osc_page_addref_lock(const struct lu_env *env,
static void osc_page_putref_lock(const struct lu_env *env, static void osc_page_putref_lock(const struct lu_env *env,
struct osc_page *opg) struct osc_page *opg)
{ {
struct cl_lock *lock = opg->ops_lock; struct cl_lock *lock = opg->ops_lock;
struct osc_lock *olock; struct osc_lock *olock;
LASSERT(lock != NULL); LASSERT(lock != NULL);
...@@ -291,7 +291,7 @@ static int osc_page_is_under_lock(const struct lu_env *env, ...@@ -291,7 +291,7 @@ static int osc_page_is_under_lock(const struct lu_env *env,
struct cl_io *unused) struct cl_io *unused)
{ {
struct cl_lock *lock; struct cl_lock *lock;
int result = -ENODATA; int result = -ENODATA;
lock = cl_lock_at_page(env, slice->cpl_obj, slice->cpl_page, lock = cl_lock_at_page(env, slice->cpl_obj, slice->cpl_page,
NULL, 1, 0); NULL, 1, 0);
...@@ -317,7 +317,7 @@ static void osc_page_completion_read(const struct lu_env *env, ...@@ -317,7 +317,7 @@ static void osc_page_completion_read(const struct lu_env *env,
const struct cl_page_slice *slice, const struct cl_page_slice *slice,
int ioret) int ioret)
{ {
struct osc_page *opg = cl2osc_page(slice); struct osc_page *opg = cl2osc_page(slice);
struct osc_object *obj = cl2osc(opg->ops_cl.cpl_obj); struct osc_object *obj = cl2osc(opg->ops_cl.cpl_obj);
if (likely(opg->ops_lock)) if (likely(opg->ops_lock))
...@@ -329,7 +329,7 @@ static void osc_page_completion_write(const struct lu_env *env, ...@@ -329,7 +329,7 @@ static void osc_page_completion_write(const struct lu_env *env,
const struct cl_page_slice *slice, const struct cl_page_slice *slice,
int ioret) int ioret)
{ {
struct osc_page *opg = cl2osc_page(slice); struct osc_page *opg = cl2osc_page(slice);
struct osc_object *obj = cl2osc(slice->cpl_obj); struct osc_object *obj = cl2osc(slice->cpl_obj);
osc_lru_add(osc_cli(obj), opg); osc_lru_add(osc_cli(obj), opg);
...@@ -364,10 +364,10 @@ static int osc_page_print(const struct lu_env *env, ...@@ -364,10 +364,10 @@ static int osc_page_print(const struct lu_env *env,
const struct cl_page_slice *slice, const struct cl_page_slice *slice,
void *cookie, lu_printer_t printer) void *cookie, lu_printer_t printer)
{ {
struct osc_page *opg = cl2osc_page(slice); struct osc_page *opg = cl2osc_page(slice);
struct osc_async_page *oap = &opg->ops_oap; struct osc_async_page *oap = &opg->ops_oap;
struct osc_object *obj = cl2osc(slice->cpl_obj); struct osc_object *obj = cl2osc(slice->cpl_obj);
struct client_obd *cli = &osc_export(obj)->exp_obd->u.cli; struct client_obd *cli = &osc_export(obj)->exp_obd->u.cli;
return (*printer)(env, cookie, LUSTRE_OSC_NAME "-page@%p: 1< %#x %d %u %s %s > 2< %llu %u %u %#x %#x | %p %p %p > 3< %s %p %d %lu %d > 4< %d %d %d %lu %s | %s %s %s %s > 5< %s %s %s %s | %d %s | %d %s %s>\n", return (*printer)(env, cookie, LUSTRE_OSC_NAME "-page@%p: 1< %#x %d %u %s %s > 2< %llu %u %u %#x %#x | %p %p %p > 3< %s %p %d %lu %d > 4< %d %d %d %lu %s | %s %s %s %s > 5< %s %s %s %s | %d %s | %d %s %s>\n",
opg, opg,
...@@ -408,7 +408,7 @@ static int osc_page_print(const struct lu_env *env, ...@@ -408,7 +408,7 @@ static int osc_page_print(const struct lu_env *env,
static void osc_page_delete(const struct lu_env *env, static void osc_page_delete(const struct lu_env *env,
const struct cl_page_slice *slice) const struct cl_page_slice *slice)
{ {
struct osc_page *opg = cl2osc_page(slice); struct osc_page *opg = cl2osc_page(slice);
struct osc_object *obj = cl2osc(opg->ops_cl.cpl_obj); struct osc_object *obj = cl2osc(opg->ops_cl.cpl_obj);
int rc; int rc;
...@@ -437,13 +437,13 @@ static void osc_page_delete(const struct lu_env *env, ...@@ -437,13 +437,13 @@ static void osc_page_delete(const struct lu_env *env,
void osc_page_clip(const struct lu_env *env, const struct cl_page_slice *slice, void osc_page_clip(const struct lu_env *env, const struct cl_page_slice *slice,
int from, int to) int from, int to)
{ {
struct osc_page *opg = cl2osc_page(slice); struct osc_page *opg = cl2osc_page(slice);
struct osc_async_page *oap = &opg->ops_oap; struct osc_async_page *oap = &opg->ops_oap;
LINVRNT(osc_page_protected(env, opg, CLM_READ, 0)); LINVRNT(osc_page_protected(env, opg, CLM_READ, 0));
opg->ops_from = from; opg->ops_from = from;
opg->ops_to = to; opg->ops_to = to;
spin_lock(&oap->oap_lock); spin_lock(&oap->oap_lock);
oap->oap_async_flags |= ASYNC_COUNT_STABLE; oap->oap_async_flags |= ASYNC_COUNT_STABLE;
spin_unlock(&oap->oap_lock); spin_unlock(&oap->oap_lock);
...@@ -502,11 +502,11 @@ int osc_page_init(const struct lu_env *env, struct cl_object *obj, ...@@ -502,11 +502,11 @@ int osc_page_init(const struct lu_env *env, struct cl_object *obj,
struct cl_page *page, struct page *vmpage) struct cl_page *page, struct page *vmpage)
{ {
struct osc_object *osc = cl2osc(obj); struct osc_object *osc = cl2osc(obj);
struct osc_page *opg = cl_object_page_slice(obj, page); struct osc_page *opg = cl_object_page_slice(obj, page);
int result; int result;
opg->ops_from = 0; opg->ops_from = 0;
opg->ops_to = PAGE_CACHE_SIZE; opg->ops_to = PAGE_CACHE_SIZE;
result = osc_prep_async_page(osc, opg, vmpage, result = osc_prep_async_page(osc, opg, vmpage,
cl_offset(obj, page->cp_index)); cl_offset(obj, page->cp_index));
...@@ -540,7 +540,7 @@ void osc_page_submit(const struct lu_env *env, struct osc_page *opg, ...@@ -540,7 +540,7 @@ void osc_page_submit(const struct lu_env *env, struct osc_page *opg,
enum cl_req_type crt, int brw_flags) enum cl_req_type crt, int brw_flags)
{ {
struct osc_async_page *oap = &opg->ops_oap; struct osc_async_page *oap = &opg->ops_oap;
struct osc_object *obj = oap->oap_obj; struct osc_object *obj = oap->oap_obj;
LINVRNT(osc_page_protected(env, opg, LINVRNT(osc_page_protected(env, opg,
crt == CRT_WRITE ? CLM_WRITE : CLM_READ, 1)); crt == CRT_WRITE ? CLM_WRITE : CLM_READ, 1));
...@@ -550,9 +550,9 @@ void osc_page_submit(const struct lu_env *env, struct osc_page *opg, ...@@ -550,9 +550,9 @@ void osc_page_submit(const struct lu_env *env, struct osc_page *opg,
LASSERT(oap->oap_async_flags & ASYNC_READY); LASSERT(oap->oap_async_flags & ASYNC_READY);
LASSERT(oap->oap_async_flags & ASYNC_COUNT_STABLE); LASSERT(oap->oap_async_flags & ASYNC_COUNT_STABLE);
oap->oap_cmd = crt == CRT_WRITE ? OBD_BRW_WRITE : OBD_BRW_READ; oap->oap_cmd = crt == CRT_WRITE ? OBD_BRW_WRITE : OBD_BRW_READ;
oap->oap_page_off = opg->ops_from; oap->oap_page_off = opg->ops_from;
oap->oap_count = opg->ops_to - opg->ops_from; oap->oap_count = opg->ops_to - opg->ops_from;
oap->oap_brw_flags = OBD_BRW_SYNC | brw_flags; oap->oap_brw_flags = OBD_BRW_SYNC | brw_flags;
if (!client_is_remote(osc_export(obj)) && if (!client_is_remote(osc_export(obj)) &&
......
...@@ -232,7 +232,7 @@ int osc_quota_setup(struct obd_device *obd) ...@@ -232,7 +232,7 @@ int osc_quota_setup(struct obd_device *obd)
int osc_quota_cleanup(struct obd_device *obd) int osc_quota_cleanup(struct obd_device *obd)
{ {
struct client_obd *cli = &obd->u.cli; struct client_obd *cli = &obd->u.cli;
int type; int type;
for (type = 0; type < MAXQUOTAS; type++) for (type = 0; type < MAXQUOTAS; type++)
...@@ -245,8 +245,8 @@ int osc_quotactl(struct obd_device *unused, struct obd_export *exp, ...@@ -245,8 +245,8 @@ int osc_quotactl(struct obd_device *unused, struct obd_export *exp,
struct obd_quotactl *oqctl) struct obd_quotactl *oqctl)
{ {
struct ptlrpc_request *req; struct ptlrpc_request *req;
struct obd_quotactl *oqc; struct obd_quotactl *oqc;
int rc; int rc;
req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp),
&RQF_OST_QUOTACTL, LUSTRE_OST_VERSION, &RQF_OST_QUOTACTL, LUSTRE_OST_VERSION,
...@@ -285,10 +285,10 @@ int osc_quotactl(struct obd_device *unused, struct obd_export *exp, ...@@ -285,10 +285,10 @@ int osc_quotactl(struct obd_device *unused, struct obd_export *exp,
int osc_quotacheck(struct obd_device *unused, struct obd_export *exp, int osc_quotacheck(struct obd_device *unused, struct obd_export *exp,
struct obd_quotactl *oqctl) struct obd_quotactl *oqctl)
{ {
struct client_obd *cli = &exp->exp_obd->u.cli; struct client_obd *cli = &exp->exp_obd->u.cli;
struct ptlrpc_request *req; struct ptlrpc_request *req;
struct obd_quotactl *body; struct obd_quotactl *body;
int rc; int rc;
req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp),
&RQF_OST_QUOTACHECK, LUSTRE_OST_VERSION, &RQF_OST_QUOTACHECK, LUSTRE_OST_VERSION,
......
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