[PATCH v2 57/84] staging/lustre: Remove stray space before newline in messages

2016-02-24 Thread green
From: Oleg Drokin 

There were some messages in Lustre that ended with a space followed by
a newline which is pointless, so remove the extra spaces.
Found with checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/lloop.c  | 2 +-
 drivers/staging/lustre/lustre/llite/rw.c | 8 
 drivers/staging/lustre/lustre/lov/lov_pack.c | 2 +-
 drivers/staging/lustre/lustre/obdclass/cl_lock.c | 2 +-
 drivers/staging/lustre/lustre/osc/osc_request.c  | 4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/lloop.c 
b/drivers/staging/lustre/lustre/llite/lloop.c
index 20fecaf..3f53292 100644
--- a/drivers/staging/lustre/lustre/llite/lloop.c
+++ b/drivers/staging/lustre/lustre/llite/lloop.c
@@ -307,7 +307,7 @@ static unsigned int loop_get_bio(struct lloop_device *lo, 
struct bio **req)
rw = first->bi_rw;
bio = &lo->lo_bio;
while (*bio && (*bio)->bi_rw == rw) {
-   CDEBUG(D_INFO, "bio sector %llu size %u count %u vcnt%u \n",
+   CDEBUG(D_INFO, "bio sector %llu size %u count %u vcnt%u\n",
   (unsigned long long)(*bio)->bi_iter.bi_sector,
   (*bio)->bi_iter.bi_size,
   page_count, (*bio)->bi_vcnt);
diff --git a/drivers/staging/lustre/lustre/llite/rw.c 
b/drivers/staging/lustre/lustre/llite/rw.c
index 0e5bd4f..671039a 100644
--- a/drivers/staging/lustre/lustre/llite/rw.c
+++ b/drivers/staging/lustre/lustre/llite/rw.c
@@ -367,7 +367,7 @@ void ll_ra_stats_inc(struct address_space *mapping, enum 
ra_stat which)
 #define RAS_CDEBUG(ras) \
CDEBUG(D_READA,   \
   "lrp %lu cr %lu cp %lu ws %lu wl %lu nra %lu r %lu ri %lu"\
-  "csr %lu sf %lu sp %lu sl %lu \n",   \
+  "csr %lu sf %lu sp %lu sl %lu\n",\
   ras->ras_last_readpage, ras->ras_consecutive_requests,   \
   ras->ras_consecutive_pages, ras->ras_window_start,   \
   ras->ras_window_len, ras->ras_next_readahead, \
@@ -575,7 +575,7 @@ stride_pg_count(pgoff_t st_off, unsigned long st_len, 
unsigned long st_pgs,
if (end_left > st_pgs)
end_left = st_pgs;
 
-   CDEBUG(D_READA, "start %llu, end %llu start_left %lu end_left %lu \n",
+   CDEBUG(D_READA, "start %llu, end %llu start_left %lu end_left %lu\n",
   start, end, start_left, end_left);
 
if (start == end)
@@ -655,7 +655,7 @@ static int ll_read_ahead_pages(const struct lu_env *env,
offset = offset % (ria->ria_length);
if (offset > ria->ria_pages) {
page_idx += ria->ria_length - offset;
-   CDEBUG(D_READA, "i %lu skip %lu \n", page_idx,
+   CDEBUG(D_READA, "i %lu skip %lu\n", page_idx,
   ria->ria_length - offset);
continue;
}
@@ -785,7 +785,7 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io,
 * if the region we failed to issue read-ahead on is still ahead
 * of the app and behind the next index to start read-ahead from
 */
-   CDEBUG(D_READA, "ra_end %lu end %lu stride end %lu \n",
+   CDEBUG(D_READA, "ra_end %lu end %lu stride end %lu\n",
   ra_end, end, ria->ria_end);
 
if (ra_end != end + 1) {
diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c 
b/drivers/staging/lustre/lustre/lov/lov_pack.c
index 8871bce..9235d7d 100644
--- a/drivers/staging/lustre/lustre/lov/lov_pack.c
+++ b/drivers/staging/lustre/lustre/lov/lov_pack.c
@@ -185,7 +185,7 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md 
**lmmp,
return -ENOMEM;
}
 
-   CDEBUG(D_INFO, "lov_packmd: LOV_MAGIC 0x%08X, lmm_size = %d \n",
+   CDEBUG(D_INFO, "lov_packmd: LOV_MAGIC 0x%08X, lmm_size = %d\n",
   lmm_magic, lmm_size);
 
lmmv1 = *lmmp;
diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c 
b/drivers/staging/lustre/lustre/obdclass/cl_lock.c
index 6f44dde..7b7f344 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_lock.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_lock.c
@@ -1453,7 +1453,7 @@ int cl_wait(const struct lu_env *env, struct cl_lock 
*lock)
 
LINVRNT(cl_lock_invariant(env, lock));
LASSERTF(lock->cll_state == CLS_ENQUEUED || lock->cll_state == CLS_HELD,
-"Wrong state %d \n", lock->cll_state);
+"Wrong state %d\n", lock->cll_state);
LASSERT(lock->cll_holds > 0);
 
do {
diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c 
b/drivers/staging/lustre/lustre/osc/osc_request.c
index 53668e2..10f262f 100644
--- a/drivers/staging/lustre/lustre/osc/osc_request.c
+++ b/drive

[PATCH v2 52/84] staging/lustre/obdclass: Adjust comments to better conform to coding style

2016-02-24 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/obdclass/cl_io.c | 13 +++--
 drivers/staging/lustre/lustre/obdclass/cl_lock.c   | 24 +---
 drivers/staging/lustre/lustre/obdclass/class_obd.c |  5 +-
 drivers/staging/lustre/lustre/obdclass/genops.c| 42 --
 .../lustre/lustre/obdclass/linux/linux-module.c|  3 +-
 drivers/staging/lustre/lustre/obdclass/llog.c  |  6 +-
 drivers/staging/lustre/lustre/obdclass/llog_obd.c  |  3 +-
 drivers/staging/lustre/lustre/obdclass/llog_swab.c |  3 +-
 .../lustre/lustre/obdclass/lprocfs_counters.c  |  6 +-
 drivers/staging/lustre/lustre/obdclass/lu_object.c |  3 +-
 .../lustre/lustre/obdclass/lustre_handles.c|  3 +-
 .../staging/lustre/lustre/obdclass/lustre_peer.c   |  3 +-
 .../staging/lustre/lustre/obdclass/obd_config.c| 42 +-
 drivers/staging/lustre/lustre/obdclass/obd_mount.c | 67 ++
 drivers/staging/lustre/lustre/obdclass/obdo.c  |  6 +-
 15 files changed, 144 insertions(+), 85 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c 
b/drivers/staging/lustre/lustre/obdclass/cl_io.c
index 58b46a7..8cc7aa1 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_io.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c
@@ -44,6 +44,7 @@
 #include "../include/obd_support.h"
 #include "../include/lustre_fid.h"
 #include 
+#include 
 #include "../include/cl_object.h"
 #include "cl_internal.h"
 
@@ -308,7 +309,8 @@ static void cl_io_locks_sort(struct cl_io *io)
   &prev->cill_linkage);
done = 0;
continue; /* don't change prev: it's
-  * still "previous" */
+  * still "previous"
+  */
case -1: /* already in order */
break;
}
@@ -419,7 +421,8 @@ static int cl_lockset_lock(const struct lu_env *env, struct 
cl_io *io,
list_for_each_entry_safe(link, temp, &set->cls_todo, cill_linkage) {
if (!cl_lockset_match(set, &link->cill_descr)) {
/* XXX some locking to guarantee that locks aren't
-* expanded in between. */
+* expanded in between.
+*/
result = cl_lockset_lock_one(env, io, set, link);
if (result != 0)
break;
@@ -1053,7 +1056,8 @@ EXPORT_SYMBOL(cl_page_list_init);
 void cl_page_list_add(struct cl_page_list *plist, struct cl_page *page)
 {
/* it would be better to check that page is owned by "current" io, but
-* it is not passed here. */
+* it is not passed here.
+*/
LASSERT(page->cp_owner);
LINVRNT(plist->pl_owner == current);
 
@@ -1510,9 +1514,6 @@ void cl_req_attr_set(const struct lu_env *env, struct 
cl_req *req,
 }
 EXPORT_SYMBOL(cl_req_attr_set);
 
-/* XXX complete(), init_completion(), and wait_for_completion(), until they are
- * implemented in libcfs. */
-# include 
 
 /**
  * Initialize synchronous io wait anchor, for transfer of \a nrpages pages.
diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c 
b/drivers/staging/lustre/lustre/obdclass/cl_lock.c
index 57cb100..6f44dde 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_lock.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_lock.c
@@ -935,7 +935,8 @@ int cl_lock_state_wait(const struct lu_env *env, struct 
cl_lock *lock)
if (result == 0) {
/* To avoid being interrupted by the 'non-fatal' signals
 * (SIGCHLD, for instance), we'd block them temporarily.
-* LU-305 */
+* LU-305
+*/
blocked = cfs_block_sigsinv(LUSTRE_FATAL_SIGS);
 
init_waitqueue_entry(&waiter, current);
@@ -946,7 +947,8 @@ int cl_lock_state_wait(const struct lu_env *env, struct 
cl_lock *lock)
LASSERT(cl_lock_nr_mutexed(env) == 0);
 
/* Returning ERESTARTSYS instead of EINTR so syscalls
-* can be restarted if signals are pending here */
+* can be restarted if signals are pending here
+*/
result = -ERESTARTSYS;
if (likely(!OBD_FAIL_CHECK(OBD_FAIL_LOCK_STATE_WAIT_INTR))) {
schedule();
@@ -1170,7 +1172,8 @@ int cl_enqueue_try(const struct lu_env *env, struct 
cl_lock *lock,
/* kick layers. */
result = cl_enqueue_kick(env, lock, io, flags);
/* For AGL case, the cl_lock::cll_st

[PATCH v2 83/84] staging/lustre: Remove unneeded {} in lprocfs_stats_unlock()

2016-02-24 Thread green
From: Oleg Drokin 

Since there's only one call in those if () else branches, the
braces are not really necessary.

Highlighted by checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lprocfs_status.h | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h 
b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 89052b2..4146c9c 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -426,11 +426,10 @@ static inline void lprocfs_stats_unlock(struct 
lprocfs_stats *stats, int opc,
 
case LPROCFS_GET_SMP_ID:
if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) {
-   if (stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) {
+   if (stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE)
spin_unlock_irqrestore(&stats->ls_lock, *flags);
-   } else {
+   else
spin_unlock(&stats->ls_lock);
-   }
} else {
put_cpu();
}
@@ -438,11 +437,10 @@ static inline void lprocfs_stats_unlock(struct 
lprocfs_stats *stats, int opc,
 
case LPROCFS_GET_NUM_CPU:
if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) {
-   if (stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) {
+   if (stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE)
spin_unlock_irqrestore(&stats->ls_lock, *flags);
-   } else {
+   else
spin_unlock(&stats->ls_lock);
-   }
}
return;
}
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 80/84] staging/lustre/lmv: Fix style vs open parenthesis alignment

2016-02-24 Thread green
From: Oleg Drokin 

This mostly fixes checkpatch complaints about
"Alignment should match open parenthesis"

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/lmv/lmv_intent.c   |  2 +-
 drivers/staging/lustre/lustre/lmv/lmv_internal.h |  4 ++--
 drivers/staging/lustre/lustre/lmv/lmv_obd.c  | 28 +++-
 3 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lmv/lmv_intent.c 
b/drivers/staging/lustre/lustre/lmv/lmv_intent.c
index 259b211..e0958ea 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_intent.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_intent.c
@@ -271,7 +271,7 @@ static int lmv_intent_lookup(struct obd_export *exp,
op_data->op_bias &= ~MDS_CROSS_REF;
 
rc = md_intent_lock(tgt->ltd_exp, op_data, lmm, lmmsize, it,
-flags, reqp, cb_blocking, extra_lock_flags);
+   flags, reqp, cb_blocking, extra_lock_flags);
 
if (rc < 0 || !*reqp)
return rc;
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_internal.h 
b/drivers/staging/lustre/lustre/lmv/lmv_internal.h
index 041d30f33..8a00871 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_internal.h
+++ b/drivers/staging/lustre/lustre/lmv/lmv_internal.h
@@ -78,8 +78,8 @@ static inline struct lmv_stripe_md *lmv_get_mea(struct 
ptlrpc_request *req)
if (mea->mea_count == 0)
return NULL;
if (mea->mea_magic != MEA_MAGIC_LAST_CHAR &&
-   mea->mea_magic != MEA_MAGIC_ALL_CHARS &&
-   mea->mea_magic != MEA_MAGIC_HASH_SEGMENT)
+   mea->mea_magic != MEA_MAGIC_ALL_CHARS &&
+   mea->mea_magic != MEA_MAGIC_HASH_SEGMENT)
return NULL;
 
return mea;
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c 
b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index b5fc337..68afc29 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -339,9 +339,8 @@ static int lmv_connect_mdc(struct obd_device *obd, struct 
lmv_tgt_desc *tgt)
}
 
CDEBUG(D_CONFIG, "connect to %s(%s) - %s, %s FOR %s\n",
-   mdc_obd->obd_name, mdc_obd->obd_uuid.uuid,
-   tgt->ltd_uuid.uuid, obd->obd_uuid.uuid,
-   cluuid->uuid);
+  mdc_obd->obd_name, mdc_obd->obd_uuid.uuid,
+  tgt->ltd_uuid.uuid, obd->obd_uuid.uuid, cluuid->uuid);
 
if (!mdc_obd->obd_set_up) {
CERROR("target %s is not set up\n", tgt->ltd_uuid.uuid);
@@ -397,8 +396,8 @@ static int lmv_connect_mdc(struct obd_device *obd, struct 
lmv_tgt_desc *tgt)
lmv->max_cookiesize, lmv->max_def_cookiesize);
 
CDEBUG(D_CONFIG, "Connected to %s(%s) successfully (%d)\n",
-   mdc_obd->obd_name, mdc_obd->obd_uuid.uuid,
-   atomic_read(&obd->obd_refcount));
+  mdc_obd->obd_name, mdc_obd->obd_uuid.uuid,
+  atomic_read(&obd->obd_refcount));
 
if (lmv->lmv_tgts_kobj)
/* Even if we failed to create the link, that's fine */
@@ -418,7 +417,7 @@ static void lmv_del_target(struct lmv_obd *lmv, int index)
 }
 
 static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
-  __u32 index, int gen)
+ __u32 index, int gen)
 {
struct lmv_obd  *lmv = &obd->u.lmv;
struct lmv_tgt_desc *tgt;
@@ -776,7 +775,7 @@ static void lmv_hsm_req_build(struct lmv_obd *lmv,
nr_out = 0;
for (i = 0; i < hur_in->hur_request.hr_itemcount; i++) {
curr_tgt = lmv_find_target(lmv,
-   &hur_in->hur_user_item[i].hui_fid);
+  &hur_in->hur_user_item[i].hui_fid);
if (obd_uuid_equals(&curr_tgt->ltd_uuid, &tgt_mds->ltd_uuid)) {
hur_out->hur_user_item[nr_out] =
hur_in->hur_user_item[i];
@@ -826,8 +825,7 @@ static int lmv_hsm_ct_register(struct lmv_obd *lmv, 
unsigned int cmd, int len,
 * except if it because of inactive target.
 */
for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
-   err = obd_iocontrol(cmd, lmv->tgts[i]->ltd_exp,
-  len, lk, uarg);
+   err = obd_iocontrol(cmd, lmv->tgts[i]->ltd_exp, len, lk, uarg);
if (err) {
if (lmv->tgts[i]->ltd_active) {
/* permanent error */
@@ -839,8 +837,8 @@ static int lmv_hsm_ct_register(struct lmv_obd *lmv, 
unsigned int cmd, int len,
/* unregister from previous MDS */
for (j = 0; j < i; j++)
obd_iocontrol(cmd,
- lmv->tgts[j]->ltd_exp,
- len, lk, uarg);
+  

[PATCH v2 76/84] staging/lustre/lov: Fix style vs open parenthesis alignment

2016-02-24 Thread green
From: Oleg Drokin 

This mostly fixes checkpatch complaints about
"Alignment should match open parenthesis"

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/lov/lov_cl_internal.h| 87 +++---
 drivers/staging/lustre/lustre/lov/lov_ea.c |  2 +-
 drivers/staging/lustre/lustre/lov/lov_internal.h   |  6 +-
 drivers/staging/lustre/lustre/lov/lov_io.c |  2 +-
 drivers/staging/lustre/lustre/lov/lov_lock.c   |  7 +-
 drivers/staging/lustre/lustre/lov/lov_obd.c| 35 -
 drivers/staging/lustre/lustre/lov/lov_object.c | 40 +-
 drivers/staging/lustre/lustre/lov/lov_offset.c |  3 +-
 drivers/staging/lustre/lustre/lov/lov_pack.c   |  7 +-
 drivers/staging/lustre/lustre/lov/lov_page.c   |  3 +-
 drivers/staging/lustre/lustre/lov/lov_pool.c   |  4 +-
 drivers/staging/lustre/lustre/lov/lovsub_lock.c|  2 +-
 drivers/staging/lustre/lustre/lov/lovsub_page.c|  2 +-
 drivers/staging/lustre/lustre/lov/lproc_lov.c  | 16 ++--
 14 files changed, 106 insertions(+), 110 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_cl_internal.h 
b/drivers/staging/lustre/lustre/lov/lov_cl_internal.h
index b5fc159..7dd3162 100644
--- a/drivers/staging/lustre/lustre/lov/lov_cl_internal.h
+++ b/drivers/staging/lustre/lustre/lov/lov_cl_internal.h
@@ -579,51 +579,49 @@ extern struct kmem_cache *lovsub_req_kmem;
 
 extern struct kmem_cache *lov_lock_link_kmem;
 
-int   lov_object_init(const struct lu_env *env, struct lu_object *obj,
-  const struct lu_object_conf *conf);
-int   lovsub_object_init(const struct lu_env *env, struct lu_object *obj,
-  const struct lu_object_conf *conf);
-int   lov_lock_init(const struct lu_env *env, struct cl_object *obj,
-  struct cl_lock *lock, const struct cl_io *io);
-int   lov_io_init(const struct lu_env *env, struct cl_object *obj,
-  struct cl_io *io);
-int   lovsub_lock_init(const struct lu_env *env, struct cl_object *obj,
-  struct cl_lock *lock, const struct cl_io *io);
-
-int   lov_lock_init_raid0(const struct lu_env *env, struct cl_object *obj,
-  struct cl_lock *lock, const struct cl_io *io);
-int   lov_lock_init_empty(const struct lu_env *env, struct cl_object *obj,
-  struct cl_lock *lock, const struct cl_io *io);
-int   lov_io_init_raid0(const struct lu_env *env, struct cl_object *obj,
-  struct cl_io *io);
-int   lov_io_init_empty(const struct lu_env *env, struct cl_object *obj,
-  struct cl_io *io);
-int   lov_io_init_released(const struct lu_env *env, struct cl_object *obj,
-  struct cl_io *io);
-void  lov_lock_unlink(const struct lu_env *env, struct lov_lock_link *link,
-  struct lovsub_lock *sub);
+int lov_object_init(const struct lu_env *env, struct lu_object *obj,
+   const struct lu_object_conf *conf);
+int lovsub_object_init(const struct lu_env *env, struct lu_object *obj,
+  const struct lu_object_conf *conf);
+int lov_lock_init(const struct lu_env *env, struct cl_object *obj,
+ struct cl_lock *lock, const struct cl_io *io);
+int lov_io_init(const struct lu_env *env, struct cl_object *obj,
+   struct cl_io *io);
+int lovsub_lock_init(const struct lu_env *env, struct cl_object *obj,
+struct cl_lock *lock, const struct cl_io *io);
+
+int lov_lock_init_raid0(const struct lu_env *env, struct cl_object *obj,
+   struct cl_lock *lock, const struct cl_io *io);
+int lov_lock_init_empty(const struct lu_env *env, struct cl_object *obj,
+   struct cl_lock *lock, const struct cl_io *io);
+int lov_io_init_raid0(const struct lu_env *env, struct cl_object *obj,
+ struct cl_io *io);
+int lov_io_init_empty(const struct lu_env *env, struct cl_object *obj,
+ struct cl_io *io);
+int lov_io_init_released(const struct lu_env *env, struct cl_object *obj,
+struct cl_io *io);
+void lov_lock_unlink(const struct lu_env *env, struct lov_lock_link *link,
+struct lovsub_lock *sub);
 
 struct lov_io_sub *lov_sub_get(const struct lu_env *env, struct lov_io *lio,
   int stripe);
-void  lov_sub_put(struct lov_io_sub *sub);
-int   lov_sublock_modify(const struct lu_env *env, struct lov_lock *lov,
-  struct lovsub_lock *sublock,
-  const struct cl_lock_descr *d, int idx);
-
-int   lov_page_init(const struct lu_env *env, struct cl_object *ob,
-  struct cl_page *page, struct page *vmpage);
-int   lovsub_page_init(const struct lu_env *env, struct cl_object *ob,
-  struct cl_page *page, struct page *vmpage);
-
-int   lov_page_init_empty

[PATCH v2 51/84] staging/lustre/mgc: Adjust comments to better conform to coding style

2016-02-24 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/mgc/mgc_request.c | 71 -
 1 file changed, 46 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c 
b/drivers/staging/lustre/lustre/mgc/mgc_request.c
index 9764e57..6fc8225 100644
--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
@@ -90,7 +90,8 @@ static int mgc_name2resid(char *name, int len, struct 
ldlm_res_id *res_id,
 int mgc_fsname2resid(char *fsname, struct ldlm_res_id *res_id, int type)
 {
/* fsname is at most 8 chars long, maybe contain "-".
-* e.g. "lustre", "SUN-000" */
+* e.g. "lustre", "SUN-000"
+*/
return mgc_name2resid(fsname, strlen(fsname), res_id, type);
 }
 EXPORT_SYMBOL(mgc_fsname2resid);
@@ -102,7 +103,8 @@ static int mgc_logname2resid(char *logname, struct 
ldlm_res_id *res_id, int type
 
/* logname consists of "fsname-nodetype".
 * e.g. "lustre-MDT0001", "SUN-000-client"
-* there is an exception: llog "params" */
+* there is an exception: llog "params"
+*/
name_end = strrchr(logname, '-');
if (!name_end)
len = strlen(logname);
@@ -125,7 +127,8 @@ static int config_log_get(struct config_llog_data *cld)
 }
 
 /* Drop a reference to a config log.  When no longer referenced,
-   we can free the config log data */
+ * we can free the config log data
+ */
 static void config_log_put(struct config_llog_data *cld)
 {
CDEBUG(D_INFO, "log %s refs %d\n", cld->cld_logname,
@@ -252,7 +255,8 @@ static struct config_llog_data 
*config_recover_log_add(struct obd_device *obd,
char logname[32];
 
/* we have to use different llog for clients and mdts for cmd
-* where only clients are notified if one of cmd server restarts */
+* where only clients are notified if one of cmd server restarts
+*/
LASSERT(strlen(fsname) < sizeof(logname) / 2);
strcpy(logname, fsname);
LASSERT(lcfg.cfg_instance);
@@ -483,8 +487,9 @@ static void do_requeue(struct config_llog_data *cld)
LASSERT(atomic_read(&cld->cld_refcount) > 0);
 
/* Do not run mgc_process_log on a disconnected export or an
-  export which is being disconnected. Take the client
-  semaphore to make the check non-racy. */
+* export which is being disconnected. Take the client
+* semaphore to make the check non-racy.
+*/
down_read(&cld->cld_mgcexp->exp_obd->u.cli.cl_sem);
if (cld->cld_mgcexp->exp_obd->u.cli.cl_conn_count != 0) {
CDEBUG(D_MGC, "updating log %s\n", cld->cld_logname);
@@ -529,8 +534,9 @@ static int mgc_requeue_thread(void *data)
}
 
/* Always wait a few seconds to allow the server who
-  caused the lock revocation to finish its setup, plus some
-  random so everyone doesn't try to reconnect at once. */
+* caused the lock revocation to finish its setup, plus some
+* random so everyone doesn't try to reconnect at once.
+*/
to = MGC_TIMEOUT_MIN_SECONDS * HZ;
to += rand * HZ / 100; /* rand is centi-seconds */
lwi = LWI_TIMEOUT(to, NULL, NULL);
@@ -559,7 +565,8 @@ static int mgc_requeue_thread(void *data)
LASSERT(atomic_read(&cld->cld_refcount) > 0);
 
/* Whether we enqueued again or not in mgc_process_log,
-* we're done with the ref from the old enqueue */
+* we're done with the ref from the old enqueue
+*/
if (cld_prev)
config_log_put(cld_prev);
cld_prev = cld;
@@ -575,7 +582,8 @@ static int mgc_requeue_thread(void *data)
config_log_put(cld_prev);
 
/* break after scanning the list so that we can drop
-* refcount to losing lock clds */
+* refcount to losing lock clds
+*/
if (unlikely(stopped)) {
spin_lock(&config_list_lock);
break;
@@ -598,7 +606,8 @@ static int mgc_requeue_thread(void *data)
 }
 
 /* Add a cld to the list to requeue.  Start the requeue thread if needed.
-   We are responsible for dropping the config log reference from here on out. 
*/
+ * We are responsible for dropping the config log reference from here on out.
+ */
 static void mgc_requeue_add(struct config_llog_data *cld)
 {
CDEBUG(D_INFO, "log %s: requeue (r=%d sp=%d st=%x)\n",
@@ -635,7 +644,8 @@ static int mgc_llog_init(const struct lu_env *env, struct 
obd_device *obd)
int  

[PATCH v2 61/84] staging/lustre/include: Fix style of function declarations

2016-02-24 Thread green
From: Oleg Drokin 

This mostly fixes checkpatch complaints about
"Alignment should match open parenthesis" and
"space prohibited between function name and open parenthesis"

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/cl_object.h  | 410 ++---
 .../staging/lustre/lustre/include/lprocfs_status.h |   6 +-
 .../lustre/lustre/include/lustre/lustre_idl.h  |  10 +-
 drivers/staging/lustre/lustre/include/lustre_fid.h |   2 +-
 drivers/staging/lustre/lustre/include/lustre_net.h |  19 +-
 .../lustre/lustre/include/lustre_req_layout.h  |   4 +-
 drivers/staging/lustre/lustre/include/lustre_sec.h | 128 +++
 drivers/staging/lustre/lustre/include/obd.h|   6 +-
 drivers/staging/lustre/lustre/include/obd_class.h  |  14 +-
 9 files changed, 281 insertions(+), 318 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/cl_object.h 
b/drivers/staging/lustre/lustre/include/cl_object.h
index 2a77ea2f8..4b3055d 100644
--- a/drivers/staging/lustre/lustre/include/cl_object.h
+++ b/drivers/staging/lustre/lustre/include/cl_object.h
@@ -322,7 +322,7 @@ struct cl_object_operations {
 *   to be used instead of newly created.
 */
int  (*coo_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);
/**
 * Initialize lock slice for this layer. Called top-to-bottom through
 * every object layer when a new cl_lock is instantiated. Layer
@@ -849,7 +849,7 @@ struct cl_page_operations {
 * \return the underlying VM page. Optional.
 */
struct page *(*cpo_vmpage)(const struct lu_env *env,
- const struct cl_page_slice *slice);
+  const struct cl_page_slice *slice);
/**
 * Called when \a io acquires this page into the exclusive
 * ownership. When this method returns, it is guaranteed that the is
@@ -2051,8 +2051,8 @@ struct cl_io_operations {
 *
 * \see cl_io_operations::cio_iter_fini()
 */
-   int (*cio_iter_init) (const struct lu_env *env,
- const struct cl_io_slice *slice);
+   int (*cio_iter_init)(const struct lu_env *env,
+const struct cl_io_slice *slice);
/**
 * Finalize io iteration.
 *
@@ -2062,8 +2062,8 @@ struct cl_io_operations {
 *
 * \see cl_io_operations::cio_iter_init()
 */
-   void (*cio_iter_fini) (const struct lu_env *env,
-  const struct cl_io_slice *slice);
+   void (*cio_iter_fini)(const struct lu_env *env,
+ const struct cl_io_slice *slice);
/**
 * Collect locks for the current iteration of io.
 *
@@ -2073,8 +2073,8 @@ struct cl_io_operations {
 * cl_io_lock_add(). Once all locks are collected, they are
 * sorted and enqueued in the proper order.
 */
-   int  (*cio_lock) (const struct lu_env *env,
- const struct cl_io_slice *slice);
+   int  (*cio_lock)(const struct lu_env *env,
+const struct cl_io_slice *slice);
/**
 * Finalize unlocking.
 *
@@ -2099,8 +2099,8 @@ struct cl_io_operations {
 * Called top-to-bottom at the end of io loop. Here layer
 * might wait for an unfinished asynchronous io.
 */
-   void (*cio_end)  (const struct lu_env *env,
- const struct cl_io_slice *slice);
+   void (*cio_end)(const struct lu_env *env,
+   const struct cl_io_slice *slice);
/**
 * Called bottom-to-top to notify layers that read/write IO
 * iteration finished, with \a nob bytes transferred.
@@ -2111,8 +2111,8 @@ struct cl_io_operations {
/**
 * Called once per io, bottom-to-top to release io resources.
 */
-   void (*cio_fini) (const struct lu_env *env,
- const struct cl_io_slice *slice);
+   void (*cio_fini)(const struct lu_env *env,
+const struct cl_io_slice *slice);
} op[CIT_OP_NR];
struct {
/**
@@ -2232,7 +2232,7 @@ struct cl_io_lock_link {
struct cl_lock  *cill_lock;
/** optional destructor */
void   (*cill_fini)(const struct lu_env *env,
-   struct cl_io_lock_link *link);
+   

[PATCH v2 73/84] staging/lustre/ptlrpc: Fix style vs open parenthesis alignment

2016-02-24 Thread green
From: Oleg Drokin 

This mostly fixes checkpatch complaints about
"Alignment should match open parenthesis"

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ptlrpc/client.c  | 40 +---
 drivers/staging/lustre/lustre/ptlrpc/import.c  | 21 +++
 drivers/staging/lustre/lustre/ptlrpc/layout.c  | 35 +--
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c| 15 +++--
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c  |  4 +-
 drivers/staging/lustre/lustre/ptlrpc/nrs.c | 19 +++---
 drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c|  2 +-
 .../staging/lustre/lustre/ptlrpc/pack_generic.c|  4 +-
 drivers/staging/lustre/lustre/ptlrpc/pinger.c  |  5 +-
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c |  9 ++-
 drivers/staging/lustre/lustre/ptlrpc/recover.c |  6 +-
 drivers/staging/lustre/lustre/ptlrpc/sec.c |  6 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_config.c  |  2 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_gc.c  |  4 +-
 drivers/staging/lustre/lustre/ptlrpc/service.c | 73 ++
 15 files changed, 111 insertions(+), 134 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c 
b/drivers/staging/lustre/lustre/ptlrpc/client.c
index 9b89068..0003158 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -557,7 +557,7 @@ ptlrpc_prep_req_from_pool(struct ptlrpc_request_pool *pool)
}
 
request = list_entry(pool->prp_req_list.next, struct ptlrpc_request,
-rq_list);
+rq_list);
list_del_init(&request->rq_list);
spin_unlock(&pool->prp_lock);
 
@@ -725,7 +725,7 @@ struct ptlrpc_request *__ptlrpc_request_alloc(struct 
obd_import *imp,
LASSERTF((unsigned long)imp > 0x1000, "%p", imp);
LASSERT(imp != LP_POISON);
LASSERTF((unsigned long)imp->imp_client > 0x1000, "%p",
-   imp->imp_client);
+imp->imp_client);
LASSERT(imp->imp_client != LP_POISON);
 
request->rq_import = class_import_get(imp);
@@ -896,8 +896,7 @@ void ptlrpc_set_destroy(struct ptlrpc_request_set *set)
 RQ_PHASE_COMPLETE : RQ_PHASE_NEW;
list_for_each(tmp, &set->set_requests) {
struct ptlrpc_request *req =
-   list_entry(tmp, struct ptlrpc_request,
-  rq_set_chain);
+   list_entry(tmp, struct ptlrpc_request, rq_set_chain);
 
LASSERT(req->rq_phase == expected_phase);
n++;
@@ -909,8 +908,7 @@ void ptlrpc_set_destroy(struct ptlrpc_request_set *set)
 
list_for_each_safe(tmp, next, &set->set_requests) {
struct ptlrpc_request *req =
-   list_entry(tmp, struct ptlrpc_request,
-  rq_set_chain);
+   list_entry(tmp, struct ptlrpc_request, rq_set_chain);
list_del_init(&req->rq_set_chain);
 
LASSERT(req->rq_phase == expected_phase);
@@ -1331,8 +1329,8 @@ static int after_reply(struct ptlrpc_request *req)
struct ptlrpc_request *last;
 
last = list_entry(imp->imp_replay_list.prev,
- struct ptlrpc_request,
- rq_replay_list);
+ struct ptlrpc_request,
+ rq_replay_list);
/*
 * Requests with rq_replay stay on the list even if no
 * commit is expected.
@@ -1475,8 +1473,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct 
ptlrpc_request_set *set)
INIT_LIST_HEAD(&comp_reqs);
list_for_each_safe(tmp, next, &set->set_requests) {
struct ptlrpc_request *req =
-   list_entry(tmp, struct ptlrpc_request,
-  rq_set_chain);
+   list_entry(tmp, struct ptlrpc_request, rq_set_chain);
struct obd_import *imp = req->rq_import;
int unregistered = 0;
int rc = 0;
@@ -1618,8 +1615,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct 
ptlrpc_request_set *set)
 */
list_del_init(&req->rq_list);
list_add_tail(&req->rq_list,
- &imp->
- imp_delayed_list);
+ &imp->imp_delayed_list);
spin_unlock(&imp->imp_lock);
continue;
   

[PATCH v2 62/84] staging/lustre/fld: Fix style vs open parenthesis alignment

2016-02-24 Thread green
From: Oleg Drokin 

This mostly fixes checkpatch complaints about
"Alignment should match open parenthesis"

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/fld/fld_cache.c   | 14 +++---
 drivers/staging/lustre/lustre/fld/fld_request.c | 17 +++--
 drivers/staging/lustre/lustre/fld/lproc_fld.c   |  3 +--
 3 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c 
b/drivers/staging/lustre/lustre/fld/fld_cache.c
index 2b09b76..062f388 100644
--- a/drivers/staging/lustre/lustre/fld/fld_cache.c
+++ b/drivers/staging/lustre/lustre/fld/fld_cache.c
@@ -233,7 +233,7 @@ static int fld_cache_shrink(struct fld_cache *cache)
}
 
CDEBUG(D_INFO, "%s: FLD cache - Shrunk by %d entries\n",
-   cache->fci_name, num);
+  cache->fci_name, num);
 
return 0;
 }
@@ -294,8 +294,8 @@ static void fld_cache_punch_hole(struct fld_cache *cache,
  * handle range overlap in fld cache.
  */
 static void fld_cache_overlap_handle(struct fld_cache *cache,
-   struct fld_cache_entry *f_curr,
-   struct fld_cache_entry *f_new)
+struct fld_cache_entry *f_curr,
+struct fld_cache_entry *f_new)
 {
const struct lu_seq_range *range = &f_new->fce_range;
const u64 new_start  = range->lsr_start;
@@ -402,8 +402,8 @@ static int fld_cache_insert_nolock(struct fld_cache *cache,
list_for_each_entry_safe(f_curr, n, head, fce_list) {
/* add list if next is end of list */
if (new_end < f_curr->fce_range.lsr_start ||
-  (new_end == f_curr->fce_range.lsr_start &&
-   new_flags != f_curr->fce_range.lsr_flags))
+   (new_end == f_curr->fce_range.lsr_start &&
+new_flags != f_curr->fce_range.lsr_flags))
break;
 
prev = &f_curr->fce_list;
@@ -460,8 +460,8 @@ struct fld_cache_entry
head = &cache->fci_entries_head;
list_for_each_entry(flde, head, fce_list) {
if (range->lsr_start == flde->fce_range.lsr_start ||
-  (range->lsr_end == flde->fce_range.lsr_end &&
-   range->lsr_flags == flde->fce_range.lsr_flags)) {
+   (range->lsr_end == flde->fce_range.lsr_end &&
+range->lsr_flags == flde->fce_range.lsr_flags)) {
got = flde;
break;
}
diff --git a/drivers/staging/lustre/lustre/fld/fld_request.c 
b/drivers/staging/lustre/lustre/fld/fld_request.c
index b50a57b..19b81c9 100644
--- a/drivers/staging/lustre/lustre/fld/fld_request.c
+++ b/drivers/staging/lustre/lustre/fld/fld_request.c
@@ -148,7 +148,7 @@ again:
}
 
CERROR("%s: Can't find target by hash %d (seq %#llx). Targets (%d):\n",
-   fld->lcf_name, hash, seq, fld->lcf_count);
+  fld->lcf_name, hash, seq, fld->lcf_count);
 
list_for_each_entry(target, &fld->lcf_targets, ft_chain) {
const char *srv_name = target->ft_srv ?
@@ -217,11 +217,11 @@ int fld_client_add_target(struct lu_client_fld *fld,
 
if (fld->lcf_flags != LUSTRE_FLD_INIT) {
CERROR("%s: Attempt to add target %s (idx %llu) on fly - skip 
it\n",
-   fld->lcf_name, name, tar->ft_idx);
+  fld->lcf_name, name, tar->ft_idx);
return 0;
}
CDEBUG(D_INFO, "%s: Adding target %s (idx %llu)\n",
-   fld->lcf_name, name, tar->ft_idx);
+  fld->lcf_name, name, tar->ft_idx);
 
target = kzalloc(sizeof(*target), GFP_NOFS);
if (!target)
@@ -244,8 +244,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
target->ft_srv = tar->ft_srv;
target->ft_idx = tar->ft_idx;
 
-   list_add_tail(&target->ft_chain,
- &fld->lcf_targets);
+   list_add_tail(&target->ft_chain, &fld->lcf_targets);
 
fld->lcf_count++;
spin_unlock(&fld->lcf_lock);
@@ -260,8 +259,7 @@ int fld_client_del_target(struct lu_client_fld *fld, __u64 
idx)
struct lu_fld_target *target, *tmp;
 
spin_lock(&fld->lcf_lock);
-   list_for_each_entry_safe(target, tmp,
-&fld->lcf_targets, ft_chain) {
+   list_for_each_entry_safe(target, tmp, &fld->lcf_targets, ft_chain) {
if (target->ft_idx == idx) {
fld->lcf_count--;
list_del(&target->ft_chain);
@@ -376,8 +374,7 @@ void fld_client_fini(struct lu_client_fld *fld)
struct lu_fld_target *target, *tmp;
 
spin_lock(&fld->lcf_lock);
-   list_for_each_entry_safe(target, tmp,
-&fld->lcf_targets, ft_chain) {
+   list_for_each_entry_safe(target, tmp, &fld->

[PATCH v2 74/84] staging/lustre/osc: Fix style vs open parenthesis alignment

2016-02-24 Thread green
From: Oleg Drokin 

This mostly fixes checkpatch complaints about
"Alignment should match open parenthesis"

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/osc/lproc_osc.c   | 20 ++---
 drivers/staging/lustre/lustre/osc/osc_cache.c   | 18 +---
 drivers/staging/lustre/lustre/osc/osc_io.c  |  5 ++--
 drivers/staging/lustre/lustre/osc/osc_lock.c| 27 +-
 drivers/staging/lustre/lustre/osc/osc_page.c| 37 -
 drivers/staging/lustre/lustre/osc/osc_request.c | 17 ++--
 6 files changed, 59 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c 
b/drivers/staging/lustre/lustre/osc/lproc_osc.c
index b5df5e6..57c43c5 100644
--- a/drivers/staging/lustre/lustre/osc/lproc_osc.c
+++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c
@@ -397,8 +397,8 @@ static int osc_checksum_type_seq_show(struct seq_file *m, 
void *v)
 }
 
 static ssize_t osc_checksum_type_seq_write(struct file *file,
-   const char __user *buffer,
-   size_t count, loff_t *off)
+  const char __user *buffer,
+  size_t count, loff_t *off)
 {
struct obd_device *obd = ((struct seq_file 
*)file->private_data)->private;
int i;
@@ -652,10 +652,10 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, 
void *v)
read_cum += r;
write_cum += w;
seq_printf(seq, "%d:\t\t%10lu %3lu %3lu   | %10lu %3lu %3lu\n",
-1 << i, r, pct(r, read_tot),
-pct(read_cum, read_tot), w,
-pct(w, write_tot),
-pct(write_cum, write_tot));
+  1 << i, r, pct(r, read_tot),
+  pct(read_cum, read_tot), w,
+  pct(w, write_tot),
+  pct(write_cum, write_tot));
if (read_cum == read_tot && write_cum == write_tot)
break;
}
@@ -676,10 +676,10 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, 
void *v)
read_cum += r;
write_cum += w;
seq_printf(seq, "%d:\t\t%10lu %3lu %3lu   | %10lu %3lu %3lu\n",
-i, r, pct(r, read_tot),
-pct(read_cum, read_tot), w,
-pct(w, write_tot),
-pct(write_cum, write_tot));
+  i, r, pct(r, read_tot),
+  pct(read_cum, read_tot), w,
+  pct(w, write_tot),
+  pct(write_cum, write_tot));
if (read_cum == read_tot && write_cum == write_tot)
break;
}
diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c 
b/drivers/staging/lustre/lustre/osc/osc_cache.c
index c6623c1..031746a 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -603,7 +603,7 @@ void osc_extent_release(const struct lu_env *env, struct 
osc_extent *ext)
 
if (ext->oe_urgent)
list_move_tail(&ext->oe_link,
-  &obj->oo_urgent_exts);
+  &obj->oo_urgent_exts);
}
osc_object_unlock(obj);
 
@@ -855,8 +855,7 @@ int osc_extent_finish(const struct lu_env *env, struct 
osc_extent *ext,
 
ext->oe_rc = rc ?: ext->oe_nr_pages;
EASSERT(ergo(rc == 0, ext->oe_state == OES_RPC), ext);
-   list_for_each_entry_safe(oap, tmp, &ext->oe_pages,
-oap_pending_item) {
+   list_for_each_entry_safe(oap, tmp, &ext->oe_pages, oap_pending_item) {
list_del_init(&oap->oap_rpc_item);
list_del_init(&oap->oap_pending_item);
if (last_off <= oap->oap_obj_off) {
@@ -989,8 +988,7 @@ static int osc_extent_truncate(struct osc_extent *ext, 
pgoff_t trunc_index,
goto out;
 
/* discard all pages with index greater then trunc_index */
-   list_for_each_entry_safe(oap, tmp, &ext->oe_pages,
-oap_pending_item) {
+   list_for_each_entry_safe(oap, tmp, &ext->oe_pages, oap_pending_item) {
struct cl_page *sub = oap2cl_page(oap);
struct cl_page *page = cl_page_top(sub);
 
@@ -1912,7 +1910,7 @@ static int get_write_extents(struct osc_object *obj, 
struct list_head *rpclist)
LASSERT(osc_object_is_locked(obj));
while (!list_empty(&obj->oo_hp_exts)) {
ext = list_entry(obj->oo_hp_exts.next, struct osc_extent,
-oe_link);
+oe_link);

[PATCH v2 55/84] staging/lustre/ptlrpc: Adjust comments to better conform to coding style

2016-02-24 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ptlrpc/connection.c  |   3 +-
 drivers/staging/lustre/lustre/ptlrpc/events.c  |  51 ++---
 drivers/staging/lustre/lustre/ptlrpc/import.c  | 114 
 drivers/staging/lustre/lustre/ptlrpc/llog_client.c |   8 +-
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c|   9 +-
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c  |  42 +---
 drivers/staging/lustre/lustre/ptlrpc/nrs.c |   6 +-
 .../staging/lustre/lustre/ptlrpc/pack_generic.c|  33 --
 drivers/staging/lustre/lustre/ptlrpc/pinger.c  |  11 +-
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |   2 -
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c |   9 +-
 drivers/staging/lustre/lustre/ptlrpc/recover.c |  18 ++--
 drivers/staging/lustre/lustre/ptlrpc/sec.c |  27 +++--
 drivers/staging/lustre/lustre/ptlrpc/sec_gc.c  |   6 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_null.c|   3 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_plain.c   |   6 +-
 drivers/staging/lustre/lustre/ptlrpc/service.c | 117 ++---
 17 files changed, 301 insertions(+), 164 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/connection.c 
b/drivers/staging/lustre/lustre/ptlrpc/connection.c
index 062db13..a14daff 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/connection.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/connection.c
@@ -72,7 +72,8 @@ ptlrpc_connection_get(lnet_process_id_t peer, lnet_nid_t self,
 * returned and may be compared against out object.
 */
/* In the function below, .hs_keycmp resolves to
-* conn_keycmp() */
+* conn_keycmp()
+*/
/* coverity[overrun-buffer-val] */
conn2 = cfs_hash_findadd_unique(conn_hash, &peer, &conn->c_hash);
if (conn != conn2) {
diff --git a/drivers/staging/lustre/lustre/ptlrpc/events.c 
b/drivers/staging/lustre/lustre/ptlrpc/events.c
index ffceba5..47be21a 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/events.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/events.c
@@ -71,7 +71,8 @@ void request_out_callback(lnet_event_t *ev)
if (ev->type == LNET_EVENT_UNLINK || ev->status != 0) {
 
/* Failed send: make it seem like the reply timed out, just
-* like failing sends in client.c does currently...  */
+* like failing sends in client.c does currently...
+*/
 
req->rq_net_err = 1;
ptlrpc_client_wake_req(req);
@@ -95,7 +96,8 @@ void reply_in_callback(lnet_event_t *ev)
LASSERT(ev->md.start == req->rq_repbuf);
LASSERT(ev->offset + ev->mlength <= req->rq_repbuf_len);
/* We've set LNET_MD_MANAGE_REMOTE for all outgoing requests
-  for adaptive timeouts' early reply. */
+* for adaptive timeouts' early reply.
+*/
LASSERT((ev->md.options & LNET_MD_MANAGE_REMOTE) != 0);
 
spin_lock(&req->rq_lock);
@@ -151,7 +153,8 @@ void reply_in_callback(lnet_event_t *ev)
req->rq_reply_off = ev->offset;
req->rq_nob_received = ev->mlength;
/* LNetMDUnlink can't be called under the LNET_LOCK,
-  so we must unlink in ptlrpc_unregister_reply */
+* so we must unlink in ptlrpc_unregister_reply
+*/
DEBUG_REQ(D_INFO, req,
  "reply in flags=%x mlen=%u offset=%d replen=%d",
  lustre_msg_get_flags(req->rq_reqmsg),
@@ -162,7 +165,8 @@ void reply_in_callback(lnet_event_t *ev)
 
 out_wake:
/* NB don't unlock till after wakeup; req can disappear under us
-* since we don't have our own ref */
+* since we don't have our own ref
+*/
ptlrpc_client_wake_req(req);
spin_unlock(&req->rq_lock);
 }
@@ -213,7 +217,8 @@ void client_bulk_callback(lnet_event_t *ev)
desc->bd_failure = 1;
 
/* NB don't unlock till after wakeup; desc can disappear under us
-* otherwise */
+* otherwise
+*/
if (desc->bd_md_count == 0)
ptlrpc_client_wake_req(desc->bd_req);
 
@@ -250,7 +255,8 @@ static void ptlrpc_req_add_history(struct 
ptlrpc_service_part *svcpt,
__u64 new_seq;
 
/* set sequence ID for request and add it to history list,
-* it must be called with hold svcpt::scp_lock */
+* it must be called with hold svcpt::scp_lock
+*/
 
new_seq = (sec << REQS_SEC_SHIFT) |
  (usec << REQS_USEC_SHIFT) |
@@ -258,7 +264,8 @@ static void ptlrpc_req_add_history(struct 
ptlrpc_service_part *svcpt,
 
if (new_seq > svcpt->scp_hist_seq) {
/* This handles the initial case of scp_hist_seq == 0 or
-* we just jumped into a new time window *

[PATCH v2 60/84] staging/lustre/llite: Fix style vs open parenthesis alignment

2016-02-24 Thread green
From: Oleg Drokin 

This mostly fixes checkpatch complaints about
"Alignment should match open parenthesis"

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/dcache.c   |  3 +-
 drivers/staging/lustre/lustre/llite/dir.c  |  6 +-
 drivers/staging/lustre/lustre/llite/file.c | 72 +++---
 drivers/staging/lustre/lustre/llite/llite_close.c  |  5 +-
 .../staging/lustre/lustre/llite/llite_internal.h   | 11 ++--
 drivers/staging/lustre/lustre/llite/llite_lib.c| 28 -
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |  4 +-
 drivers/staging/lustre/lustre/llite/llite_nfs.c| 12 ++--
 drivers/staging/lustre/lustre/llite/llite_rmtacl.c |  8 +--
 drivers/staging/lustre/lustre/llite/lproc_llite.c  | 14 ++---
 drivers/staging/lustre/lustre/llite/namei.c|  8 +--
 drivers/staging/lustre/lustre/llite/rw.c   |  6 +-
 drivers/staging/lustre/lustre/llite/rw26.c |  8 +--
 drivers/staging/lustre/lustre/llite/statahead.c| 18 +++---
 drivers/staging/lustre/lustre/llite/super25.c  |  4 +-
 drivers/staging/lustre/lustre/llite/symlink.c  |  2 +-
 drivers/staging/lustre/lustre/llite/vvp_internal.h | 13 ++--
 drivers/staging/lustre/lustre/llite/vvp_io.c   | 14 ++---
 drivers/staging/lustre/lustre/llite/vvp_page.c | 12 ++--
 drivers/staging/lustre/lustre/llite/xattr.c|  8 +--
 drivers/staging/lustre/lustre/llite/xattr_cache.c  | 19 +++---
 21 files changed, 133 insertions(+), 142 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dcache.c 
b/drivers/staging/lustre/lustre/llite/dcache.c
index 0bc0fb9f..dd1c827 100644
--- a/drivers/staging/lustre/lustre/llite/dcache.c
+++ b/drivers/staging/lustre/lustre/llite/dcache.c
@@ -183,8 +183,7 @@ static int ll_ddelete(const struct dentry *de)
 int ll_d_init(struct dentry *de)
 {
CDEBUG(D_DENTRY, "ldd on dentry %pd (%p) parent %p inode %p refc %d\n",
-   de, de, de->d_parent, d_inode(de),
-   d_count(de));
+  de, de, de->d_parent, d_inode(de), d_count(de));
 
if (!de->d_fsdata) {
struct ll_dentry_data *lld;
diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index bd88a3b..394ec33 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -355,7 +355,7 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
struct md_op_data *op_data;
 
op_data = ll_prep_md_op_data(NULL, dir, dir, NULL, 0, 0,
-   LUSTRE_OPC_ANY, NULL);
+LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
return (void *)op_data;
 
@@ -368,8 +368,8 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
if (request)
ptlrpc_req_finished(request);
if (rc < 0) {
-   CERROR("lock enqueue: "DFID" at %llu: rc %d\n",
-   PFID(ll_inode2fid(dir)), hash, rc);
+   CERROR("lock enqueue: " DFID " at %llu: rc %d\n",
+  PFID(ll_inode2fid(dir)), hash, rc);
return ERR_PTR(rc);
}
 
diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index 4c25cf2..477dc0e 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -287,8 +287,9 @@ static int ll_md_close(struct obd_export *md_exp, struct 
inode *inode,
 * application crashed, we need to release here.
 */
rc = ll_lease_close(fd->fd_lease_och, inode, &lease_broken);
-   CDEBUG(rc ? D_ERROR : D_INODE, "Clean up lease "DFID" %d/%d\n",
-   PFID(&lli->lli_fid), rc, lease_broken);
+   CDEBUG(rc ? D_ERROR : D_INODE,
+  "Clean up lease " DFID " %d/%d\n",
+  PFID(&lli->lli_fid), rc, lease_broken);
 
fd->fd_lease_och = NULL;
}
@@ -432,7 +433,7 @@ static int ll_intent_file_open(struct dentry *dentry, void 
*lmm,
* with messages with -ESTALE errors.
*/
if (!it_disposition(itp, DISP_OPEN_OPEN) ||
-it_open_error(DISP_OPEN_OPEN, itp))
+   it_open_error(DISP_OPEN_OPEN, itp))
goto out;
ll_release_openhandle(inode, itp);
goto out;
@@ -727,7 +728,8 @@ out_openerr:
 }
 
 static int ll_md_blocking_lease_ast(struct ldlm_lock *lock,
-   struct ldlm_lock_desc *desc, void *data, int flag)
+   struct ldlm_lock_desc *desc,
+   void *data, int flag)
 {
int rc;
struct lustre_handle lockh;
@@ -814,7 +816,7 @@ ll_lease_open(struct inode

[PATCH v2 58/84] staging/lustre: Remove commented out obd functions

2016-02-24 Thread green
From: Oleg Drokin 

obd_register_page_removal_cb, obd_unregister_page_removal_cb
obd_register_lock_cancel_cb, obd_unregister_lock_cancel_cb

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/obd_class.h | 51 ---
 1 file changed, 51 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_class.h 
b/drivers/staging/lustre/lustre/include/obd_class.h
index 7ea5801..8515218 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -1328,57 +1328,6 @@ static inline int obd_register_observer(struct 
obd_device *obd,
return 0;
 }
 
-#if 0
-static inline int obd_register_page_removal_cb(struct obd_export *exp,
-  obd_page_removal_cb_t cb,
-  obd_pin_extent_cb pin_cb)
-{
-   int rc;
-
-   OBD_CHECK_DT_OP(exp->exp_obd, register_page_removal_cb, 0);
-   OBD_COUNTER_INCREMENT(exp->exp_obd, register_page_removal_cb);
-
-   rc = OBP(exp->exp_obd, register_page_removal_cb)(exp, cb, pin_cb);
-   return rc;
-}
-
-static inline int obd_unregister_page_removal_cb(struct obd_export *exp,
-obd_page_removal_cb_t cb)
-{
-   int rc;
-
-   OBD_CHECK_DT_OP(exp->exp_obd, unregister_page_removal_cb, 0);
-   OBD_COUNTER_INCREMENT(exp->exp_obd, unregister_page_removal_cb);
-
-   rc = OBP(exp->exp_obd, unregister_page_removal_cb)(exp, cb);
-   return rc;
-}
-
-static inline int obd_register_lock_cancel_cb(struct obd_export *exp,
- obd_lock_cancel_cb cb)
-{
-   int rc;
-
-   OBD_CHECK_DT_OP(exp->exp_obd, register_lock_cancel_cb, 0);
-   OBD_COUNTER_INCREMENT(exp->exp_obd, register_lock_cancel_cb);
-
-   rc = OBP(exp->exp_obd, register_lock_cancel_cb)(exp, cb);
-   return rc;
-}
-
-static inline int obd_unregister_lock_cancel_cb(struct obd_export *exp,
-obd_lock_cancel_cb cb)
-{
-   int rc;
-
-   OBD_CHECK_DT_OP(exp->exp_obd, unregister_lock_cancel_cb, 0);
-   OBD_COUNTER_INCREMENT(exp->exp_obd, unregister_lock_cancel_cb);
-
-   rc = OBP(exp->exp_obd, unregister_lock_cancel_cb)(exp, cb);
-   return rc;
-}
-#endif
-
 /* metadata helpers */
 static inline int md_getstatus(struct obd_export *exp, struct lu_fid *fid)
 {
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 47/84] staging/lustre/llite: Adjust comments to better conform to coding style

2016-02-24 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/dcache.c   |  18 ++-
 drivers/staging/lustre/lustre/llite/dir.c  |  29 ++--
 drivers/staging/lustre/lustre/llite/file.c | 161 +
 drivers/staging/lustre/lustre/llite/llite_close.c  |  18 ++-
 .../staging/lustre/lustre/llite/llite_internal.h   | 109 --
 drivers/staging/lustre/lustre/llite/llite_lib.c|  86 +++
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |  20 ++-
 drivers/staging/lustre/lustre/llite/llite_nfs.c|   6 +-
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |   3 +-
 drivers/staging/lustre/lustre/llite/namei.c|  41 --
 drivers/staging/lustre/lustre/llite/rw.c   |  70 ++---
 drivers/staging/lustre/lustre/llite/rw26.c |  21 ++-
 drivers/staging/lustre/lustre/llite/statahead.c|  36 +++--
 drivers/staging/lustre/lustre/llite/super25.c  |   6 +-
 drivers/staging/lustre/lustre/llite/symlink.c  |   3 +-
 drivers/staging/lustre/lustre/llite/vvp_io.c   |  42 --
 drivers/staging/lustre/lustre/llite/vvp_object.c   |   3 +-
 drivers/staging/lustre/lustre/llite/vvp_page.c |   9 +-
 drivers/staging/lustre/lustre/llite/xattr.c|  15 +-
 drivers/staging/lustre/lustre/llite/xattr_cache.c  |   6 +-
 20 files changed, 451 insertions(+), 251 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dcache.c 
b/drivers/staging/lustre/lustre/llite/dcache.c
index 34eb17c..0bc0fb9f 100644
--- a/drivers/staging/lustre/lustre/llite/dcache.c
+++ b/drivers/staging/lustre/lustre/llite/dcache.c
@@ -80,7 +80,8 @@ static void ll_release(struct dentry *de)
  * This avoids a race where ll_lookup_it() instantiates a dentry, but we get
  * an AST before calling d_revalidate_it().  The dentry still exists (marked
  * INVALID) so d_lookup() matches it, but we have no lock on it (so
- * lock_match() fails) and we spin around real_lookup(). */
+ * lock_match() fails) and we spin around real_lookup().
+ */
 static int ll_dcompare(const struct dentry *parent, const struct dentry 
*dentry,
   unsigned int len, const char *str,
   const struct qstr *name)
@@ -117,7 +118,8 @@ static inline int return_if_equal(struct ldlm_lock *lock, 
void *data)
 /* find any ldlm lock of the inode in mdc and lov
  * return 0not find
  * 1find one
- *  < 0error */
+ *  < 0error
+ */
 static int find_cbdata(struct inode *inode)
 {
struct ll_sb_info *sbi = ll_i2sbi(inode);
@@ -163,10 +165,12 @@ static int ll_ddelete(const struct dentry *de)
/* Disable this piece of code temporarily because this is called
 * inside dcache_lock so it's not appropriate to do lots of work
 * here. ATTENTION: Before this piece of code enabling, LU-2487 must be
-* resolved. */
+* resolved.
+*/
 #if 0
/* if not ldlm lock for this inode, set i_nlink to 0 so that
-* this inode can be recycled later b=20433 */
+* this inode can be recycled later b=20433
+*/
if (d_really_is_positive(de) && !find_cbdata(d_inode(de)))
clear_nlink(d_inode(de));
 #endif
@@ -216,7 +220,8 @@ void ll_intent_drop_lock(struct lookup_intent *it)
ldlm_lock_decref(&handle, it->d.lustre.it_lock_mode);
 
/* bug 494: intent_release may be called multiple times, from
-* this thread and we don't want to double-decref this lock */
+* this thread and we don't want to double-decref this lock
+*/
it->d.lustre.it_lock_mode = 0;
if (it->d.lustre.it_remote_lock_mode != 0) {
handle.cookie = it->d.lustre.it_remote_lock_handle;
@@ -294,7 +299,8 @@ void ll_lookup_finish_locks(struct lookup_intent *it, 
struct inode *inode)
if (it->it_op == IT_LOOKUP || it->it_op == IT_GETATTR) {
/* on 2.6 there are situation when several lookups and
 * revalidations may be requested during single operation.
-* therefore, we don't release intent here -bzzz */
+* therefore, we don't release intent here -bzzz
+*/
ll_intent_drop_lock(it);
}
 }
diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index c2ee7fc..bd88a3b 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -379,7 +379,8 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
 &it.d.lustre.it_lock_handle, dir, NULL);
} else {
/* for cross-ref object, l_ast_data of the lock may not be set,
-* we reset it here */
+* we reset it here
+*/
   

[PATCH v2 56/84] staging/lustre: Fix indentation mistakes

2016-02-24 Thread green
From: Oleg Drokin 

none look like bugs or bugs-inducing, mostly just
off by a couple of spaces all around.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lprocfs_status.h |  2 +-
 .../lustre/lustre/include/lustre/lustre_idl.h  |  8 ++--
 .../lustre/lustre/include/lustre/lustre_user.h |  2 +-
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |  2 +-
 drivers/staging/lustre/lustre/llite/rw.c   |  4 +-
 drivers/staging/lustre/lustre/llite/rw26.c |  2 +-
 drivers/staging/lustre/lustre/lov/lov_obd.c|  8 ++--
 drivers/staging/lustre/lustre/lov/lov_pool.c   |  2 +-
 drivers/staging/lustre/lustre/obdclass/cl_io.c | 45 +++---
 .../lustre/lustre/obdclass/lprocfs_status.c|  2 +-
 .../staging/lustre/lustre/obdclass/obd_config.c|  2 +-
 drivers/staging/lustre/lustre/osc/lproc_osc.c  |  4 +-
 drivers/staging/lustre/lustre/osc/osc_request.c|  2 +-
 13 files changed, 42 insertions(+), 43 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h 
b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index eb693a1..0d98111 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -276,7 +276,7 @@ static inline int opcode_offset(__u32 opc)
OPC_RANGE(OST));
} else if (opc < FLD_LAST_OPC) {
/* FLD opcode */
-return (opc - FLD_FIRST_OPC +
+   return (opc - FLD_FIRST_OPC +
OPC_RANGE(SEC) +
OPC_RANGE(SEQ) +
OPC_RANGE(QUOTA) +
diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index e32163b..284affb 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -700,9 +700,9 @@ static inline int ostid_to_fid(struct lu_fid *fid, struct 
ost_id *ostid,
 * of 1M objects/s/OST for 9 years, or combinations thereof.
 */
if (ostid_id(ostid) >= IDIF_MAX_OID) {
-CERROR("bad MDT0 id, "DOSTID" ost_idx:%u\n",
-   POSTID(ostid), ost_idx);
-return -EBADF;
+   CERROR("bad MDT0 id, " DOSTID " ost_idx:%u\n",
+  POSTID(ostid), ost_idx);
+   return -EBADF;
}
fid->f_seq = fid_idif_seq(ostid_id(ostid), ost_idx);
/* truncate to 32 bits by assignment */
@@ -3154,7 +3154,7 @@ static inline void lustre_get_wire_obdo(struct 
obd_connect_data *ocd,
__u32 local_flags = 0;
 
if (lobdo->o_valid & OBD_MD_FLFLAGS)
-local_flags = lobdo->o_flags & OBD_FL_LOCAL_MASK;
+   local_flags = lobdo->o_flags & OBD_FL_LOCAL_MASK;
 
*lobdo = *wobdo;
if (local_flags != 0) {
diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
index 60c40ca..2e9f025 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
@@ -473,7 +473,7 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, 
int buflen)
buf[buflen - 1] = '\0';
p = strrchr(buf, '-');
if (p)
-  *p = '\0';
+   *p = '\0';
 }
 
 /* printf display format
diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c 
b/drivers/staging/lustre/lustre/llite/llite_mmap.c
index d8c39fb..31abdb7f 100644
--- a/drivers/staging/lustre/lustre/llite/llite_mmap.c
+++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c
@@ -119,7 +119,7 @@ ll_fault_io_init(struct vm_area_struct *vma, struct lu_env 
**env_ret,
 */
env = cl_env_nested_get(nest);
if (IS_ERR(env))
-return ERR_PTR(-EINVAL);
+   return ERR_PTR(-EINVAL);
 
*env_ret = env;
 
diff --git a/drivers/staging/lustre/lustre/llite/rw.c 
b/drivers/staging/lustre/lustre/llite/rw.c
index d685c8f..0e5bd4f 100644
--- a/drivers/staging/lustre/lustre/llite/rw.c
+++ b/drivers/staging/lustre/lustre/llite/rw.c
@@ -381,9 +381,9 @@ static int index_in_window(unsigned long index, unsigned 
long point,
unsigned long start = point - before, end = point + after;
 
if (start > point)
-  start = 0;
+   start = 0;
if (end < point)
-  end = ~0;
+   end = ~0;
 
return start <= index && index <= end;
 }
diff --git a/drivers/staging/lustre/lustre/llite/rw26.c 
b/drivers/staging/lustre/lustre/llite/rw26.c
index 89fd513..b0f7ffa 100644
--- a/drivers/staging/lustre/lustre/llite/rw26.c
+++ b/drivers/staging/lustre/lustre/llite/rw26.c
@@ -248,7 +248,7 @@ ssize_t ll_direct_rw_pages(const str

[PATCH v2 59/84] staging/lustre: Remove unused members of struct ll_sb_info

2016-02-24 Thread green
From: Oleg Drokin 

ll_orphan_dentry_list and ll_conn_chain are not used
and could be removed.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/llite_internal.h | 2 --
 drivers/staging/lustre/lustre/llite/llite_lib.c  | 4 
 2 files changed, 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h 
b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 12fdca9..f6921ff 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -478,10 +478,8 @@ struct ll_sb_info {
intll_flags;
unsigned int  ll_umounting:1,
  ll_xattr_cache_enabled:1;
-   struct list_headll_conn_chain; /* per-conn chain of SBs 
*/
struct lustre_client_ocd  ll_lco;
 
-   struct list_headll_orphan_dentry_list; /*please don't 
ask -p*/
struct ll_close_queue*ll_lcq;
 
struct lprocfs_stats *ll_stats; /* lprocfs stats counter */
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index d03f884..9ae1cc8 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -102,8 +102,6 @@ static struct ll_sb_info *ll_init_sbi(struct super_block 
*sb)
sbi->ll_ra_info.ra_max_pages = sbi->ll_ra_info.ra_max_pages_per_file;
sbi->ll_ra_info.ra_max_read_ahead_whole_pages =
   SBI_DEFAULT_READAHEAD_WHOLE_MAX;
-   INIT_LIST_HEAD(&sbi->ll_conn_chain);
-   INIT_LIST_HEAD(&sbi->ll_orphan_dentry_list);
 
ll_generate_random_uuid(uuid);
class_uuid_unparse(uuid, &sbi->ll_sb_uuid);
@@ -626,8 +624,6 @@ static void client_common_put_super(struct super_block *sb)
 
cl_sb_fini(sb);
 
-   list_del(&sbi->ll_conn_chain);
-
obd_fid_fini(sbi->ll_dt_exp->exp_obd);
obd_disconnect(sbi->ll_dt_exp);
sbi->ll_dt_exp = NULL;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 54/84] staging/lustre/osc: Adjust comments to better conform to coding style

2016-02-24 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/osc/osc_cache.c  | 168 ++---
 .../staging/lustre/lustre/osc/osc_cl_internal.h|  33 ++--
 drivers/staging/lustre/lustre/osc/osc_internal.h   |   8 +-
 drivers/staging/lustre/lustre/osc/osc_io.c |   6 +-
 drivers/staging/lustre/lustre/osc/osc_lock.c   |  45 --
 drivers/staging/lustre/lustre/osc/osc_page.c   |  42 --
 drivers/staging/lustre/lustre/osc/osc_quota.c  |  16 +-
 drivers/staging/lustre/lustre/osc/osc_request.c| 151 +++---
 8 files changed, 310 insertions(+), 159 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c 
b/drivers/staging/lustre/lustre/osc/osc_cache.c
index d006566..c6623c1 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -262,7 +262,8 @@ static int osc_extent_sanity_check0(struct osc_extent *ext,
}
 
/* Do not verify page list if extent is in RPC. This is because an
-* in-RPC extent is supposed to be exclusively accessible w/o lock. */
+* in-RPC extent is supposed to be exclusively accessible w/o lock.
+*/
if (ext->oe_state > OES_CACHE) {
rc = 0;
goto out;
@@ -587,7 +588,8 @@ void osc_extent_release(const struct lu_env *env, struct 
osc_extent *ext)
if (ext->oe_trunc_pending) {
/* a truncate process is waiting for this extent.
 * This may happen due to a race, check
-* osc_cache_truncate_start(). */
+* osc_cache_truncate_start().
+*/
osc_extent_state_set(ext, OES_TRUNC);
ext->oe_trunc_pending = 0;
} else {
@@ -704,18 +706,21 @@ restart:
 
/* ok, from now on, ext and cur have these attrs:
 * 1. covered by the same lock
-* 2. contiguous at chunk level or overlapping. */
+* 2. contiguous at chunk level or overlapping.
+*/
 
if (overlapped(ext, cur)) {
/* cur is the minimum unit, so overlapping means
-* full contain. */
+* full contain.
+*/
EASSERTF((ext->oe_start <= cur->oe_start &&
  ext->oe_end >= cur->oe_end),
 ext, EXTSTR, EXTPARA(cur));
 
if (ext->oe_state > OES_CACHE || ext->oe_fsync_wait) {
/* for simplicity, we wait for this extent to
-* finish before going forward. */
+* finish before going forward.
+*/
conflict = osc_extent_get(ext);
break;
}
@@ -728,17 +733,20 @@ restart:
if (ext->oe_state != OES_CACHE || ext->oe_fsync_wait) {
/* we can't do anything for a non OES_CACHE extent, or
 * if there is someone waiting for this extent to be
-* flushed, try next one. */
+* flushed, try next one.
+*/
ext = next_extent(ext);
continue;
}
 
/* check if they belong to the same rpc slot before trying to
 * merge. the extents are not overlapped and contiguous at
-* chunk level to get here. */
+* chunk level to get here.
+*/
if (ext->oe_max_end != max_end) {
/* if they don't belong to the same RPC slot or
-* max_pages_per_rpc has ever changed, do not merge. */
+* max_pages_per_rpc has ever changed, do not merge.
+*/
ext = next_extent(ext);
continue;
}
@@ -747,7 +755,8 @@ restart:
 * level so that we know the whole extent is covered by grant
 * (the pages in the extent are NOT required to be contiguous).
 * Otherwise, it will be too much difficult to know which
-* chunks have grants allocated. */
+* chunks have grants allocated.
+*/
 
/* try to do front merge - extend ext's start */
if (chunk + 1 == ext_chk_start) {
@@ -767,7 +776,8 @@ restart:
*grants -= chunksize;
 
/* try to merge with the next one because we just fill
-* in a gap */
+

[PATCH v2 66/84] staging/lustre: Remove misleading liblustre comments.

2016-02-24 Thread green
From: Oleg Drokin 

These two comments certainly refer to some ifdefed code that is
no longer present, so remove them too.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/lov/lov_pool.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_pool.c 
b/drivers/staging/lustre/lustre/lov/lov_pool.c
index 210304f..8608b09 100644
--- a/drivers/staging/lustre/lustre/lov/lov_pool.c
+++ b/drivers/staging/lustre/lustre/lov/lov_pool.c
@@ -152,7 +152,6 @@ struct cfs_hash_ops pool_hash_operations = {
 
 };
 
-/* ifdef needed for liblustre support */
 /*
  * pool debugfs seq_file methods
  */
@@ -432,7 +431,6 @@ int lov_pool_new(struct obd_device *obd, char *poolname)
 
INIT_HLIST_NODE(&new_pool->pool_hash);
 
-   /* we need this assert seq_file is not implemented for liblustre */
/* get ref for debugfs file */
lov_pool_getref(new_pool);
new_pool->pool_debugfs_entry = ldebugfs_add_simple(
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 36/84] staging/lustre: Remove server data from struct obd_export

2016-02-24 Thread green
From: Oleg Drokin 

Despite it's name struct obd_export could exist on the client too
(used for reverse exports), but all the actual server bits
are not needed there, so could be dropped. This is mostly
various target-related stuff.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lustre_export.h  | 70 --
 1 file changed, 70 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_export.h 
b/drivers/staging/lustre/lustre/include/lustre_export.h
index 86f91ce..30ae096 100644
--- a/drivers/staging/lustre/lustre/include/lustre_export.h
+++ b/drivers/staging/lustre/lustre/include/lustre_export.h
@@ -50,62 +50,6 @@
 #include "lustre/lustre_idl.h"
 #include "lustre_dlm.h"
 
-struct mds_client_data;
-struct mdt_client_data;
-struct mds_idmap_table;
-struct mdt_idmap_table;
-
-/**
- * Target-specific export data
- */
-struct tg_export_data {
-   /** Protects led_lcd below */
-   struct mutexted_lcd_lock;
-   /** Per-client data for each export */
-   struct lsd_client_data  *ted_lcd;
-   /** Offset of record in last_rcvd file */
-   loff_t  ted_lr_off;
-   /** Client index in last_rcvd file */
-   int ted_lr_idx;
-};
-
-/**
- * MDT-specific export data
- */
-struct mdt_export_data {
-   struct tg_export_data   med_ted;
-   /** List of all files opened by client on this MDT */
-   struct list_headmed_open_head;
-   spinlock_t  med_open_lock; /* med_open_head, mfd_list */
-   /** Bitmask of all ibit locks this MDT understands */
-   __u64   med_ibits_known;
-   struct mutexmed_idmap_mutex;
-   struct lustre_idmap_table *med_idmap;
-};
-
-struct ec_export_data { /* echo client */
-   struct list_head eced_locks;
-};
-
-/* In-memory access to client data from OST struct */
-/** Filter (oss-side) specific import data */
-struct filter_export_data {
-   struct tg_export_data   fed_ted;
-   spinlock_t  fed_lock;   /**< protects fed_mod_list */
-   long   fed_dirty;/* in bytes */
-   long   fed_grant;/* in bytes */
-   struct list_head fed_mod_list; /* files being modified 
*/
-   int fed_mod_count;/* items in fed_writing list */
-   long   fed_pending;  /* bytes just being written */
-   __u32 fed_group;
-   __u8   fed_pagesize; /* log2 of client page size */
-};
-
-struct mgs_export_data {
-   struct list_headmed_clients;/* mgc fs client via 
this exp */
-   spinlock_t  med_lock;   /* protect med_clients */
-};
-
 enum obd_option {
OBD_OPT_FORCE =  0x0001,
OBD_OPT_FAILOVER =  0x0002,
@@ -200,22 +144,8 @@ struct obd_export {
/** blocking dlm lock list, protected by exp_bl_list_lock */
struct list_headexp_bl_list;
spinlock_texp_bl_list_lock;
-
-   /** Target specific data */
-   union {
-   struct tg_export_data eu_target_data;
-   struct mdt_export_dataeu_mdt_data;
-   struct filter_export_data eu_filter_data;
-   struct ec_export_data eu_ec_data;
-   struct mgs_export_dataeu_mgs_data;
-   } u;
 };
 
-#define exp_target_data u.eu_target_data
-#define exp_mdt_datau.eu_mdt_data
-#define exp_filter_data u.eu_filter_data
-#define exp_ec_data u.eu_ec_data
-
 static inline __u64 *exp_connect_flags_ptr(struct obd_export *exp)
 {
return &exp->exp_connect_data.ocd_connect_flags;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 49/84] staging/lustre/lov: Adjust comments to better conform to coding style

2016-02-24 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/lov/lov_ea.c   |  3 +-
 drivers/staging/lustre/lustre/lov/lov_internal.h |  6 +-
 drivers/staging/lustre/lustre/lov/lov_lock.c | 32 ++
 drivers/staging/lustre/lustre/lov/lov_obd.c  | 78 
 drivers/staging/lustre/lustre/lov/lov_object.c   | 24 +---
 drivers/staging/lustre/lustre/lov/lov_offset.c   | 12 ++--
 drivers/staging/lustre/lustre/lov/lov_pack.c | 12 ++--
 drivers/staging/lustre/lustre/lov/lov_pool.c | 12 ++--
 drivers/staging/lustre/lustre/lov/lov_request.c  | 18 --
 drivers/staging/lustre/lustre/lov/lovsub_lock.c  |  6 +-
 10 files changed, 134 insertions(+), 69 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_ea.c 
b/drivers/staging/lustre/lustre/lov/lov_ea.c
index 6c8381a..c27b884 100644
--- a/drivers/staging/lustre/lustre/lov/lov_ea.c
+++ b/drivers/staging/lustre/lustre/lov/lov_ea.c
@@ -162,7 +162,8 @@ static int lsm_destroy_plain(struct lov_stripe_md *lsm, 
struct obdo *oa,
 }
 
 /* Find minimum stripe maxbytes value.  For inactive or
- * reconnecting targets use LUSTRE_STRIPE_MAXBYTES. */
+ * reconnecting targets use LUSTRE_STRIPE_MAXBYTES.
+ */
 static void lov_tgt_maxbytes(struct lov_tgt_desc *tgt, __u64 *stripe_maxbytes)
 {
struct obd_import *imp = tgt->ltd_obd->u.cli.cl_import;
diff --git a/drivers/staging/lustre/lustre/lov/lov_internal.h 
b/drivers/staging/lustre/lustre/lov/lov_internal.h
index d4522ba..725ebf9 100644
--- a/drivers/staging/lustre/lustre/lov/lov_internal.h
+++ b/drivers/staging/lustre/lustre/lov/lov_internal.h
@@ -43,7 +43,8 @@
 /* lov_do_div64(a, b) returns a % b, and a = a / b.
  * The 32-bit code is LOV-specific due to knowing about stripe limits in
  * order to reduce the divisor to a 32-bit number.  If the divisor is
- * already a 32-bit value the compiler handles this directly. */
+ * already a 32-bit value the compiler handles this directly.
+ */
 #if BITS_PER_LONG == 64
 # define lov_do_div64(n, base) ({  \
uint64_t __base = (base);   \
@@ -92,7 +93,8 @@ struct lov_request_set {
atomic_tset_refcount;
struct obd_export   *set_exp;
/* XXX: There is @set_exp already, however obd_statfs gets obd_device
-  only. */
+* only.
+*/
struct obd_device   *set_obd;
int set_count;
atomic_tset_completes;
diff --git a/drivers/staging/lustre/lustre/lov/lov_lock.c 
b/drivers/staging/lustre/lustre/lov/lov_lock.c
index e6b0437..e0a6438 100644
--- a/drivers/staging/lustre/lustre/lov/lov_lock.c
+++ b/drivers/staging/lustre/lustre/lov/lov_lock.c
@@ -160,7 +160,8 @@ static struct cl_lock *lov_sublock_alloc(const struct 
lu_env *env,
 * to remember the subio. This is because lock is able
 * to be cached, but this is not true for IO. This
 * further means a sublock might be referenced in
-* different io context. -jay */
+* different io context. -jay
+*/
 
sublock = cl_lock_hold(subenv->lse_env, subenv->lse_io,
   descr, "lov-parent", parent);
@@ -477,7 +478,8 @@ static int lov_lock_enqueue_one(const struct lu_env *env, 
struct lov_lock *lck,
result = cl_enqueue_try(env, sublock, io, enqflags);
if ((sublock->cll_state == CLS_ENQUEUED) && !(enqflags & CEF_AGL)) {
/* if it is enqueued, try to `wait' on it---maybe it's already
-* granted */
+* granted
+*/
result = cl_wait_try(env, sublock);
if (result == CLO_REENQUEUED)
result = CLO_WAIT;
@@ -518,7 +520,8 @@ static int lov_sublock_fill(const struct lu_env *env, 
struct cl_lock *parent,
} else {
kmem_cache_free(lov_lock_link_kmem, link);
/* other thread allocated sub-lock, or enqueue is no
-* longer going on */
+* longer going on
+*/
cl_lock_mutex_put(env, parent);
cl_lock_unhold(env, sublock, "lov-parent", parent);
cl_lock_mutex_get(env, parent);
@@ -575,7 +578,8 @@ static int lov_lock_enqueue(const struct lu_env *env,
if (!sub) {
result = lov_sublock_fill(env, lock, io, lck, i);
/* lov_sublock_fill() released @lock mutex,
-* restart. */
+* restart.
+*/
  

[PATCH v2 50/84] staging/lustre/mdc: Adjust comments to better conform to coding style

2016-02-24 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/mdc/mdc_lib.c |  3 +-
 drivers/staging/lustre/lustre/mdc/mdc_locks.c   | 87 -
 drivers/staging/lustre/lustre/mdc/mdc_reint.c   | 12 ++--
 drivers/staging/lustre/lustre/mdc/mdc_request.c | 27 +---
 4 files changed, 84 insertions(+), 45 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c 
b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
index ea2ab23..b3bfdcb 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
@@ -489,7 +489,8 @@ static int mdc_req_avail(struct client_obd *cli, struct 
mdc_cache_waiter *mcw)
 
 /* We record requests in flight in cli->cl_r_in_flight here.
  * There is only one write rpc possible in mdc anyway. If this to change
- * in the future - the code may need to be revisited. */
+ * in the future - the code may need to be revisited.
+ */
 int mdc_enter_request(struct client_obd *cli)
 {
int rc = 0;
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c 
b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index ae648d0..6dae574 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -210,7 +210,8 @@ int mdc_null_inode(struct obd_export *exp,
 /* find any ldlm lock of the inode in mdc
  * return 0not find
  * 1find one
- *  < 0error */
+ *  < 0error
+ */
 int mdc_find_cbdata(struct obd_export *exp,
const struct lu_fid *fid,
ldlm_iterator_t it, void *data)
@@ -252,7 +253,8 @@ static inline void mdc_clear_replay_flag(struct 
ptlrpc_request *req, int rc)
  * OOM here may cause recovery failure if lmm is needed (only for the
  * original open if the MDS crashed just when this client also OOM'd)
  * but this is incredibly unlikely, and questionable whether the client
- * could do MDS recovery under OOM anyways... */
+ * could do MDS recovery under OOM anyways...
+ */
 static void mdc_realloc_openmsg(struct ptlrpc_request *req,
struct mdt_body *body)
 {
@@ -514,7 +516,8 @@ static struct ptlrpc_request *mdc_intent_layout_pack(struct 
obd_export *exp,
/* pack the layout intent request */
layout = req_capsule_client_get(&req->rq_pill, &RMF_LAYOUT_INTENT);
/* LAYOUT_INTENT_ACCESS is generic, specific operation will be
-* set for replication */
+* set for replication
+*/
layout->li_opc = LAYOUT_INTENT_ACCESS;
 
req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER,
@@ -561,7 +564,8 @@ static int mdc_finish_enqueue(struct obd_export *exp,
 
LASSERT(rc >= 0);
/* Similarly, if we're going to replay this request, we don't want to
-* actually get a lock, just perform the intent. */
+* actually get a lock, just perform the intent.
+*/
if (req->rq_transno || req->rq_replay) {
lockreq = req_capsule_client_get(pill, &RMF_DLM_REQ);
lockreq->lock_flags |= ldlm_flags_to_wire(LDLM_FL_INTENT_ONLY);
@@ -575,7 +579,8 @@ static int mdc_finish_enqueue(struct obd_export *exp,
lock = ldlm_handle2lock(lockh);
 
/* If the server gave us back a different lock mode, we should
-* fix up our variables. */
+* fix up our variables.
+*/
if (lock->l_req_mode != einfo->ei_mode) {
ldlm_lock_addref(lockh, lock->l_req_mode);
ldlm_lock_decref(lockh, einfo->ei_mode);
@@ -593,7 +598,8 @@ static int mdc_finish_enqueue(struct obd_export *exp,
intent->it_data = req;
 
/* Technically speaking rq_transno must already be zero if
-* it_status is in error, so the check is a bit redundant */
+* it_status is in error, so the check is a bit redundant
+*/
if ((!req->rq_transno || intent->it_status < 0) && req->rq_replay)
mdc_clear_replay_flag(req, intent->it_status);
 
@@ -603,7 +609,8 @@ static int mdc_finish_enqueue(struct obd_export *exp,
 *
 * It's important that we do this first!  Otherwise we might exit the
 * function without doing so, and try to replay a failed create
-* (bug 3440) */
+* (bug 3440)
+*/
if (it->it_op & IT_OPEN && req->rq_replay &&
(!it_disposition(it, DISP_OPEN_OPEN) || intent->it_status != 0))
mdc_clear_replay_flag(req, intent->it_status);
@@ -647,7 +654,8 @@ static int mdc_finish_enqueue(struct obd_export *exp,
return -EPROTO;
 
/* save lvb data and length in case this is for layout
-* lock */
+* lock
+*/

[PATCH v2 53/84] staging/lustre/obdecho: Adjust comments to better conform to coding style

2016-02-24 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/obdecho/echo_client.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c 
b/drivers/staging/lustre/lustre/obdecho/echo_client.c
index ca87cc2..3be28c5 100644
--- a/drivers/staging/lustre/lustre/obdecho/echo_client.c
+++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c
@@ -746,7 +746,8 @@ static struct lu_device *echo_device_alloc(const struct 
lu_env *env,
cleanup = 4;
 
/* if echo client is to be stacked upon ost device, the next is
-* NULL since ost is not a clio device so far */
+* NULL since ost is not a clio device so far
+*/
if (next && !lu_device_is_cl(next))
next = NULL;
 
@@ -965,7 +966,8 @@ static struct echo_object *cl_echo_object_find(struct 
echo_device *d,
}
 
/* In the function below, .hs_keycmp resolves to
-* lu_obj_hop_keycmp() */
+* lu_obj_hop_keycmp()
+*/
/* coverity[overrun-buffer-val] */
obj = cl_object_find(env, echo_dev2cl(d), fid, &conf->eoc_cl);
if (IS_ERR(obj)) {
@@ -1164,7 +1166,8 @@ static int cl_echo_object_brw(struct echo_object *eco, 
int rw, u64 offset,
cl_page_list_add(&queue->c2_qin, clp);
 
/* drop the reference count for cl_page_find, so that the page
-* will be freed in cl_2queue_fini. */
+* will be freed in cl_2queue_fini.
+*/
cl_page_put(env, clp);
cl_page_clip(env, clp, 0, page_size);
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 42/84] staging/lustre/include: Adjust comment style

2016-02-24 Thread green
From: Oleg Drokin 

This fixes most of the
"Block comments use a trailing */ on a separate line" checkpatch
warnings, also some slight reformats of structures or comments
at places.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/cl_object.h  | 69 ++
 drivers/staging/lustre/lustre/include/lclient.h|  3 +-
 .../staging/lustre/lustre/include/lprocfs_status.h | 13 ++--
 drivers/staging/lustre/lustre/include/lu_object.h  |  6 +-
 .../lustre/lustre/include/lustre/ll_fiemap.h   | 63 
 .../lustre/lustre/include/lustre/lustre_user.h | 52 ++--
 drivers/staging/lustre/lustre/include/lustre_cfg.h |  9 ++-
 .../staging/lustre/lustre/include/lustre_disk.h| 27 +
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 29 +
 .../lustre/lustre/include/lustre_dlm_flags.h   | 51 ++--
 .../staging/lustre/lustre/include/lustre_export.h  |  3 +-
 drivers/staging/lustre/lustre/include/lustre_fid.h | 18 --
 drivers/staging/lustre/lustre/include/lustre_fld.h | 33 ---
 .../staging/lustre/lustre/include/lustre_handles.h |  3 +-
 .../staging/lustre/lustre/include/lustre_import.h  |  3 +-
 drivers/staging/lustre/lustre/include/lustre_lib.h |  3 +-
 drivers/staging/lustre/lustre/include/lustre_log.h |  3 +-
 drivers/staging/lustre/lustre/include/lustre_mdc.h |  6 +-
 drivers/staging/lustre/lustre/include/lustre_net.h | 39 +++-
 drivers/staging/lustre/lustre/include/obd.h| 58 ++
 drivers/staging/lustre/lustre/include/obd_cksum.h  |  9 ++-
 drivers/staging/lustre/lustre/include/obd_class.h  | 50 ++--
 .../staging/lustre/lustre/include/obd_support.h| 18 +++---
 23 files changed, 352 insertions(+), 216 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/cl_object.h 
b/drivers/staging/lustre/lustre/include/cl_object.h
index 373e772..2a77ea2f8 100644
--- a/drivers/staging/lustre/lustre/include/cl_object.h
+++ b/drivers/staging/lustre/lustre/include/cl_object.h
@@ -157,7 +157,8 @@ struct cl_device {
 };
 
 /** \addtogroup cl_object cl_object
- * @{ */
+ * @{
+ */
 /**
  * "Data attributes" of cl_object. Data attributes can be updated
  * independently for a sub-object, and top-object's attributes are calculated
@@ -288,13 +289,14 @@ struct cl_object_conf {
 
 enum {
/** configure layout, set up a new stripe, must be called while
-* holding layout lock. */
+* holding layout lock.
+*/
OBJECT_CONF_SET = 0,
/** invalidate the current stripe configuration due to losing
-* layout lock. */
+* layout lock.
+*/
OBJECT_CONF_INVALIDATE = 1,
-   /** wait for old layout to go away so that new layout can be
-* set up. */
+   /** wait for old layout to go away so that new layout can be set up. */
OBJECT_CONF_WAIT = 2
 };
 
@@ -393,7 +395,8 @@ struct cl_object_operations {
  */
 struct cl_object_header {
/** Standard lu_object_header. cl_object::co_lu::lo_header points
-* here. */
+* here.
+*/
struct lu_object_header  coh_lu;
/** \name locks
 * \todo XXX move locks below to the separate cache-lines, they are
@@ -464,7 +467,8 @@ struct cl_object_header {
 #define CL_PAGE_EOF ((pgoff_t)~0ull)
 
 /** \addtogroup cl_page cl_page
- * @{ */
+ * @{
+ */
 
 /** \struct cl_page
  * Layered client page.
@@ -687,12 +691,14 @@ enum cl_page_state {
 
 enum cl_page_type {
/** Host page, the page is from the host inode which the cl_page
-* belongs to. */
+* belongs to.
+*/
CPT_CACHEABLE = 1,
 
/** Transient page, the transient cl_page is used to bind a cl_page
 *  to vmpage which is not belonging to the same object of cl_page.
-*  it is used in DirectIO, lockless IO and liblustre. */
+*  it is used in DirectIO, lockless IO and liblustre.
+*/
CPT_TRANSIENT,
 };
 
@@ -728,7 +734,8 @@ struct cl_page {
/** Parent page, NULL for top-level page. Immutable after creation. */
struct cl_page*cp_parent;
/** Lower-layer page. NULL for bottommost page. Immutable after
-* creation. */
+* creation.
+*/
struct cl_page*cp_child;
/**
 * Page state. This field is const to avoid accidental update, it is
@@ -1126,7 +1133,8 @@ static inline int __page_in_use(const struct cl_page 
*page, int refc)
 /** @} cl_page */
 
 /** \addtogroup cl_lock cl_lock
- * @{ */
+ * @{
+ */
 /** \struct cl_lock
  *
  * Extent locking on the client.
@@ -1641,7 +1649,8 @@ struct cl_lock {
 struct cl_lock_slice {
struct cl_lock*cls_lock;
/** Object slice corresponding to this lock slice. Immutable after
-* creation. */
+* creation.
+*/
struct cl_object*cls_obj;
const struct cl_lock_operations *cls_ops;
/** Linkag

[PATCH v2 32/84] staging/lustre: Remove lquota_glb_rec, lquota_slv_rec and lquota_acct_rec

2016-02-24 Thread green
From: Oleg Drokin 

These server-only structures and some supporting defines are unused
on the client.

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 52 --
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c| 44 --
 2 files changed, 96 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 607bfde..b5f8453 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -1819,58 +1819,6 @@ do { \
Q_COPY(out, in, qc_dqblk);  \
 } while (0)
 
-/* Quota types currently supported */
-enum {
-   LQUOTA_TYPE_USR = 0x00, /* maps to USRQUOTA */
-   LQUOTA_TYPE_GRP = 0x01, /* maps to GRPQUOTA */
-   LQUOTA_TYPE_MAX
-};
-
-/* There are 2 different resource types on which a quota limit can be enforced:
- * - inodes on the MDTs
- * - blocks on the OSTs */
-enum {
-   LQUOTA_RES_MD   = 0x01, /* skip 0 to avoid null oid in FID */
-   LQUOTA_RES_DT   = 0x02,
-   LQUOTA_LAST_RES,
-   LQUOTA_FIRST_RES= LQUOTA_RES_MD
-};
-
-#define LQUOTA_NR_RES (LQUOTA_LAST_RES - LQUOTA_FIRST_RES + 1)
-
-/*
- * Space accounting support
- * Format of an accounting record, providing disk usage information for a given
- * user or group
- */
-struct lquota_acct_rec { /* 16 bytes */
-   __u64 bspace;  /* current space in use */
-   __u64 ispace;  /* current # inodes in use */
-};
-
-/*
- * Global quota index support
- * Format of a global record, providing global quota settings for a given quota
- * identifier
- */
-struct lquota_glb_rec { /* 32 bytes */
-   __u64 qbr_hardlimit; /* quota hard limit, in #inodes or kbytes */
-   __u64 qbr_softlimit; /* quota soft limit, in #inodes or kbytes */
-   __u64 qbr_time;  /* grace time, in seconds */
-   __u64 qbr_granted;   /* how much is granted to slaves, in #inodes or
- * kbytes */
-};
-
-/*
- * Slave index support
- * Format of a slave record, recording how much space is granted to a given
- * slave
- */
-struct lquota_slv_rec { /* 8 bytes */
-   __u64 qsr_granted; /* space granted to the slave for the key=ID,
-   * in #inodes or kbytes */
-};
-
 /* Data structures associated with the quota locks */
 
 /* Glimpse descriptor used for the index & per-ID quota locks */
diff --git a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c 
b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
index c61d46f..249f9b3 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
@@ -336,10 +336,6 @@ void lustre_assert_wire_constants(void)
CLASSERT(LUSTRE_RES_ID_QUOTA_SEQ_OFF == 2);
CLASSERT(LUSTRE_RES_ID_QUOTA_VER_OID_OFF == 3);
CLASSERT(LUSTRE_RES_ID_HSH_OFF == 3);
-   CLASSERT(LQUOTA_TYPE_USR == 0);
-   CLASSERT(LQUOTA_TYPE_GRP == 1);
-   CLASSERT(LQUOTA_RES_MD == 1);
-   CLASSERT(LQUOTA_RES_DT == 2);
LASSERTF(OBD_PING == 400, "found %lld\n",
 (long long)OBD_PING);
LASSERTF(OBD_LOG_CANCEL == 401, "found %lld\n",
@@ -1609,46 +1605,6 @@ void lustre_assert_wire_constants(void)
LASSERTF(Q_FINVALIDATE == 0x800104, "found 0x%.8x\n",
Q_FINVALIDATE);
 
-   /* Checks for struct lquota_acct_rec */
-   LASSERTF((int)sizeof(struct lquota_acct_rec) == 16, "found %lld\n",
-(long long)(int)sizeof(struct lquota_acct_rec));
-   LASSERTF((int)offsetof(struct lquota_acct_rec, bspace) == 0, "found 
%lld\n",
-(long long)(int)offsetof(struct lquota_acct_rec, bspace));
-   LASSERTF((int)sizeof(((struct lquota_acct_rec *)0)->bspace) == 8, 
"found %lld\n",
-(long long)(int)sizeof(((struct lquota_acct_rec *)0)->bspace));
-   LASSERTF((int)offsetof(struct lquota_acct_rec, ispace) == 8, "found 
%lld\n",
-(long long)(int)offsetof(struct lquota_acct_rec, ispace));
-   LASSERTF((int)sizeof(((struct lquota_acct_rec *)0)->ispace) == 8, 
"found %lld\n",
-(long long)(int)sizeof(((struct lquota_acct_rec *)0)->ispace));
-
-   /* Checks for struct lquota_glb_rec */
-   LASSERTF((int)sizeof(struct lquota_glb_rec) == 32, "found %lld\n",
-(long long)(int)sizeof(struct lquota_glb_rec));
-   LASSERTF((int)offsetof(struct lquota_glb_rec, qbr_hardlimit) == 0, 
"found %lld\n",
-(long long)(int)offsetof(struct lquota_glb_rec, 
qbr_hardlimit));
-   LASSERTF((int)sizeof(((struct lquota_glb_rec *)0)->qbr_hardlimit) == 8, 
"found %lld\n",
-(long long)(int)sizeof(((struct lquota_glb_rec 
*)0)->qbr_hardlimit));
-   LASSERTF((int)offsetof(struct lquota_glb_rec, qbr_softlimit) == 8, 
"found %lld\n",
-(long long)(int)o

[PATCH v2 48/84] staging/lustre/lmv: Adjust comments to better conform to coding style

2016-02-24 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/lmv/lmv_fld.c|  3 ++-
 drivers/staging/lustre/lustre/lmv/lmv_intent.c |  9 ---
 drivers/staging/lustre/lustre/lmv/lmv_obd.c| 37 +-
 3 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lmv/lmv_fld.c 
b/drivers/staging/lustre/lustre/lmv/lmv_fld.c
index ee23592..378691b 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_fld.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_fld.c
@@ -58,7 +58,8 @@ int lmv_fld_lookup(struct lmv_obd *lmv,
int rc;
 
/* FIXME: Currently ZFS still use local seq for ROOT unfortunately, and
-* this fid_is_local check should be removed once LU-2240 is fixed */
+* this fid_is_local check should be removed once LU-2240 is fixed
+*/
LASSERTF((fid_seq_in_fldb(fid_seq(fid)) ||
  fid_seq_is_local_file(fid_seq(fid))) &&
 fid_is_sane(fid), DFID" is insane!\n", PFID(fid));
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_intent.c 
b/drivers/staging/lustre/lustre/lmv/lmv_intent.c
index cb1ed42..259b211 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_intent.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_intent.c
@@ -110,11 +110,13 @@ static int lmv_intent_remote(struct obd_export *exp, void 
*lmm,
if (parent_fid) {
/* The parent fid is only for remote open to
 * check whether the open is from OBF,
-* see mdt_cross_open */
+* see mdt_cross_open
+*/
LASSERT(it->it_op & IT_OPEN);
op_data->op_fid2 = *parent_fid;
/* Add object FID to op_fid3, in case it needs to check stale
-* (M_CHECK_STALE), see mdc_finish_intent_lock */
+* (M_CHECK_STALE), see mdc_finish_intent_lock
+*/
op_data->op_fid3 = body->fid1;
}
 
@@ -173,7 +175,8 @@ static int lmv_intent_open(struct obd_export *exp, struct 
md_op_data *op_data,
return PTR_ERR(tgt);
 
/* If it is ready to open the file by FID, do not need
-* allocate FID at all, otherwise it will confuse MDT */
+* allocate FID at all, otherwise it will confuse MDT
+*/
if ((it->it_op & IT_CREAT) &&
!(it->it_flags & MDS_OPEN_BY_FID)) {
/*
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c 
b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index eb1c85f..67746c9 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -679,7 +679,8 @@ repeat_fid2path:
goto out_fid2path;
 
/* If remote_gf != NULL, it means just building the
-* path on the remote MDT, copy this path segment to gf */
+* path on the remote MDT, copy this path segment to gf
+*/
if (remote_gf) {
struct getinfo_fid2path *ori_gf;
char *ptr;
@@ -797,7 +798,8 @@ static int lmv_hsm_ct_unregister(struct lmv_obd *lmv, 
unsigned int cmd, int len,
/* unregister request (call from llapi_hsm_copytool_fini) */
for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
/* best effort: try to clean as much as possible
-* (continue on error) */
+* (continue on error)
+*/
obd_iocontrol(cmd, lmv->tgts[i]->ltd_exp, len, lk, uarg);
}
 
@@ -821,7 +823,8 @@ static int lmv_hsm_ct_register(struct lmv_obd *lmv, 
unsigned int cmd, int len,
 
/* All or nothing: try to register to all MDS.
 * In case of failure, unregister from previous MDS,
-* except if it because of inactive target. */
+* except if it because of inactive target.
+*/
for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
err = obd_iocontrol(cmd, lmv->tgts[i]->ltd_exp,
   len, lk, uarg);
@@ -841,8 +844,8 @@ static int lmv_hsm_ct_register(struct lmv_obd *lmv, 
unsigned int cmd, int len,
return rc;
}
/* else: transient error.
-* kuc will register to the missing MDT
-* when it is back */
+* kuc will register to the missing MDT when it is back
+*/
} else {
any_set = true;
}
@@ -1028,7 +1031,8 @@ static int lmv_iocontrol(unsigned int cmd, struct 
obd_export *exp,
 
/* if the request is about a single fid
 * or if there is a single MDS, no need to split
-* the request. */
+* the request.
+*/
if (reqcount == 1 || count == 1)

[PATCH v2 46/84] staging/lustre/ldlm: Adjust comments to better conform to coding style

2016-02-24 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ldlm/interval_tree.c |   6 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c   |  12 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c|  43 ---
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h |   3 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c  |  27 +++--
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |  63 ++
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c|  36 --
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  | 132 ++---
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |  36 --
 9 files changed, 236 insertions(+), 122 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/interval_tree.c 
b/drivers/staging/lustre/lustre/ldlm/interval_tree.c
index fd70f65..3230606 100644
--- a/drivers/staging/lustre/lustre/ldlm/interval_tree.c
+++ b/drivers/staging/lustre/lustre/ldlm/interval_tree.c
@@ -133,7 +133,8 @@ static void __rotate_change_maxhigh(struct interval_node 
*node,
 
 /* The left rotation "pivots" around the link from node to node->right, and
  * - node will be linked to node->right's left child, and
- * - node->right's left child will be linked to node's right child.  */
+ * - node->right's left child will be linked to node's right child.
+ */
 static void __rotate_left(struct interval_node *node,
  struct interval_node **root)
 {
@@ -162,7 +163,8 @@ static void __rotate_left(struct interval_node *node,
 
 /* The right rotation "pivots" around the link from node to node->left, and
  * - node will be linked to node->left's right child, and
- * - node->left's right child will be linked to node's left child.  */
+ * - node->left's right child will be linked to node's left child.
+ */
 static void __rotate_right(struct interval_node *node,
   struct interval_node **root)
 {
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
index f07a077..222cb62 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
@@ -62,7 +62,8 @@
  * is the "highest lock".  This function returns the new KMS value.
  * Caller must hold lr_lock already.
  *
- * NB: A lock on [x,y] protects a KMS of up to y + 1 bytes! */
+ * NB: A lock on [x,y] protects a KMS of up to y + 1 bytes!
+ */
 __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 old_kms)
 {
struct ldlm_resource *res = lock->l_resource;
@@ -72,7 +73,8 @@ __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 
old_kms)
 
/* don't let another thread in ldlm_extent_shift_kms race in
 * just after we finish and take our lock into account in its
-* calculation of the kms */
+* calculation of the kms
+*/
lock->l_flags |= LDLM_FL_KMS_IGNORE;
 
list_for_each(tmp, &res->lr_granted) {
@@ -85,7 +87,8 @@ __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 
old_kms)
return old_kms;
 
/* This extent _has_ to be smaller than old_kms (checked above)
-* so kms can only ever be smaller or the same as old_kms. */
+* so kms can only ever be smaller or the same as old_kms.
+*/
if (lck->l_policy_data.l_extent.end + 1 > kms)
kms = lck->l_policy_data.l_extent.end + 1;
}
@@ -191,7 +194,8 @@ void ldlm_extent_add_lock(struct ldlm_resource *res,
res->lr_itree[idx].lit_size++;
 
/* even though we use interval tree to manage the extent lock, we also
-* add the locks into grant list, for debug purpose, .. */
+* add the locks into grant list, for debug purpose, ..
+*/
ldlm_resource_add_lock(res, &res->lr_granted, lock);
 }
 
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
index 8bd6a18..b88b786 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
@@ -107,7 +107,8 @@ ldlm_flock_destroy(struct ldlm_lock *lock, enum ldlm_mode 
mode, __u64 flags)
lock->l_flags |= LDLM_FL_LOCAL_ONLY | LDLM_FL_CBPENDING;
 
/* when reaching here, it is under lock_res_and_lock(). Thus,
-  need call the nolock version of ldlm_lock_decref_internal*/
+* need call the nolock version of ldlm_lock_decref_internal
+*/
ldlm_lock_decref_internal_nolock(lock, mode);
}
 
@@ -159,13 +160,15 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req, 
__u64 *flags,
*err = ELDLM_OK;
 
/* No blocking ASTs are sent to the clients for
-* Posix file & record locks */
+* Posix file & record locks
+*/
  

[PATCH v2 78/84] staging/lustre/mgc: Fix style vs open parenthesis alignment

2016-02-24 Thread green
From: Oleg Drokin 

This mostly fixes checkpatch complaints about
"Alignment should match open parenthesis"

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/mgc/mgc_request.c | 28 -
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c 
b/drivers/staging/lustre/lustre/mgc/mgc_request.c
index 6fc8225..68c3c84 100644
--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
@@ -245,10 +245,10 @@ struct config_llog_data *do_config_log_add(struct 
obd_device *obd,
return cld;
 }
 
-static struct config_llog_data *config_recover_log_add(struct obd_device *obd,
-   char *fsname,
-   struct config_llog_instance *cfg,
-   struct super_block *sb)
+static struct config_llog_data *
+config_recover_log_add(struct obd_device *obd, char *fsname,
+  struct config_llog_instance *cfg,
+  struct super_block *sb)
 {
struct config_llog_instance lcfg = *cfg;
struct config_llog_data *cld;
@@ -266,8 +266,9 @@ static struct config_llog_data 
*config_recover_log_add(struct obd_device *obd,
return cld;
 }
 
-static struct config_llog_data *config_params_log_add(struct obd_device *obd,
-   struct config_llog_instance *cfg, struct super_block *sb)
+static struct config_llog_data *
+config_params_log_add(struct obd_device *obd,
+ struct config_llog_instance *cfg, struct super_block *sb)
 {
struct config_llog_instance lcfg = *cfg;
struct config_llog_data *cld;
@@ -454,16 +455,16 @@ int lprocfs_mgc_rd_ir_state(struct seq_file *m, void 
*data)
ocd = &imp->imp_connect_data;
 
seq_printf(m, "imperative_recovery: %s\n",
- OCD_HAS_FLAG(ocd, IMP_RECOV) ? "ENABLED" : "DISABLED");
+  OCD_HAS_FLAG(ocd, IMP_RECOV) ? "ENABLED" : "DISABLED");
seq_printf(m, "client_state:\n");
 
spin_lock(&config_list_lock);
list_for_each_entry(cld, &config_llog_list, cld_list_chain) {
if (!cld->cld_recover)
continue;
-   seq_printf(m,  "- { client: %s, nidtbl_version: %u }\n",
-  cld->cld_logname,
-  cld->cld_recover->cld_cfg.cfg_last_idx);
+   seq_printf(m, "- { client: %s, nidtbl_version: %u }\n",
+  cld->cld_logname,
+  cld->cld_recover->cld_cfg.cfg_last_idx);
}
spin_unlock(&config_list_lock);
 
@@ -555,8 +556,7 @@ static int mgc_requeue_thread(void *data)
 
spin_lock(&config_list_lock);
rq_state &= ~RQ_PRECLEANUP;
-   list_for_each_entry(cld, &config_llog_list,
-   cld_list_chain) {
+   list_for_each_entry(cld, &config_llog_list, cld_list_chain) {
if (!cld->cld_lostlock)
continue;
 
@@ -966,8 +966,8 @@ static int mgc_target_register(struct obd_export *exp,
 }
 
 static int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
-  u32 keylen, void *key, u32 vallen,
-  void *val, struct ptlrpc_request_set *set)
+ u32 keylen, void *key, u32 vallen,
+ void *val, struct ptlrpc_request_set *set)
 {
int rc = -EINVAL;
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 84/84] staging/lustre/ptlrpc: Fix ENABLE_PINGER ifdef

2016-02-24 Thread green
From: Oleg Drokin 

As it is ENABLE_PINGER is never defined, but in reality
it's the code that is now compiled out that should be used
since all other instances were converted like that too.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ptlrpc/import.c | 28 ---
 1 file changed, 28 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c 
b/drivers/staging/lustre/lustre/ptlrpc/import.c
index 9a9c4d3..041e7ce 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/import.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/import.c
@@ -433,7 +433,6 @@ EXPORT_SYMBOL(ptlrpc_fail_import);
 
 int ptlrpc_reconnect_import(struct obd_import *imp)
 {
-#ifdef ENABLE_PINGER
struct l_wait_info lwi;
int secs = cfs_time_seconds(obd_timeout);
int rc;
@@ -449,33 +448,6 @@ int ptlrpc_reconnect_import(struct obd_import *imp)
CDEBUG(D_HA, "%s: recovery finished s:%s\n", obd2cli_tgt(imp->imp_obd),
   ptlrpc_import_state_name(imp->imp_state));
return rc;
-#else
-   ptlrpc_set_import_discon(imp, 0);
-   /* Force a new connect attempt */
-   ptlrpc_invalidate_import(imp);
-   /* Do a fresh connect next time by zeroing the handle */
-   ptlrpc_disconnect_import(imp, 1);
-   /* Wait for all invalidate calls to finish */
-   if (atomic_read(&imp->imp_inval_count) > 0) {
-   int rc;
-   struct l_wait_info lwi = LWI_INTR(LWI_ON_SIGNAL_NOOP, NULL);
-
-   rc = l_wait_event(imp->imp_recovery_waitq,
- (atomic_read(&imp->imp_inval_count) == 0),
- &lwi);
-   if (rc)
-   CERROR("Interrupted, inval=%d\n",
-  atomic_read(&imp->imp_inval_count));
-   }
-
-   /* Allow reconnect attempts */
-   imp->imp_obd->obd_no_recov = 0;
-   /* Remove 'invalid' flag */
-   ptlrpc_activate_import(imp);
-   /* Attempt a new connect */
-   ptlrpc_recover_import(imp, NULL, 0);
-   return 0;
-#endif
 }
 EXPORT_SYMBOL(ptlrpc_reconnect_import);
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 41/84] staging/lustre: Reformat comments and structures in lustre_idl.h

2016-02-24 Thread green
From: Oleg Drokin 

This file mostly contains various on the wire data and got
significantly mangled in transition.
This patch rectifies the situation somewhat. Also fixes the
comment style for block comments.

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 286 -
 1 file changed, 165 insertions(+), 121 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index c272c18..e32163b 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -146,7 +146,9 @@
 #define SEQ_CONTROLLER_PORTAL32
 #define MGS_BULK_PORTAL33
 
-/* Portal 63 is reserved for the Cray Inc DVS - n...@cray.com, r...@cray.com, 
n8...@cray.com */
+/* Portal 63 is reserved for the Cray Inc DVS - n...@cray.com, r...@cray.com,
+ * n8...@cray.com
+ */
 
 /* packet types */
 #define PTL_RPC_MSG_REQUEST 4711
@@ -295,7 +297,8 @@ static inline int range_compare_loc(const struct 
lu_seq_range *r1,
fld_range_is_mdt(range) ? "mdt" : "ost"
 
 /** \defgroup lu_fid lu_fid
- * @{ */
+ * @{
+ */
 
 /**
  * Flags for lustre_mdt_attrs::lma_compat and lustre_mdt_attrs::lma_incompat.
@@ -307,7 +310,8 @@ enum lma_compat {
LMAC_SOM= 0x0002,
LMAC_NOT_IN_OI  = 0x0004, /* the object does NOT need OI mapping */
LMAC_FID_ON_OST = 0x0008, /* For OST-object, its OI mapping is
-  * under /O//d. */
+  * under /O//d.
+  */
 };
 
 /**
@@ -319,7 +323,8 @@ enum lma_incompat {
LMAI_RELEASED   = 0x0001, /* file is released */
LMAI_AGENT  = 0x0002, /* agent inode */
LMAI_REMOTE_PARENT  = 0x0004, /* the parent of the object
-is on the remote MDT */
+  * is on the remote MDT
+  */
 };
 
 #define LMA_INCOMPAT_SUPP  (LMAI_AGENT | LMAI_REMOTE_PARENT)
@@ -395,12 +400,14 @@ enum fid_seq {
FID_SEQ_LOCAL_FILE  = 0x20001ULL,
FID_SEQ_DOT_LUSTRE  = 0x20002ULL,
/* sequence is used for local named objects FIDs generated
-* by local_object_storage library */
+* by local_object_storage library
+*/
FID_SEQ_LOCAL_NAME  = 0x20003ULL,
/* Because current FLD will only cache the fid sequence, instead
 * of oid on the client side, if the FID needs to be exposed to
 * clients sides, it needs to make sure all of fids under one
-* sequence will be located in one MDT. */
+* sequence will be located in one MDT.
+*/
FID_SEQ_SPECIAL = 0x20004ULL,
FID_SEQ_QUOTA   = 0x20005ULL,
FID_SEQ_QUOTA_GLB   = 0x20006ULL,
@@ -601,7 +608,8 @@ static inline void ostid_set_seq(struct ost_id *oi, __u64 
seq)
oi->oi_fid.f_seq = seq;
/* Note: if f_oid + f_ver is zero, we need init it
 * to be 1, otherwise, ostid_seq will treat this
-* as old ostid (oi_seq == 0) */
+* as old ostid (oi_seq == 0)
+*/
if (oi->oi_fid.f_oid == 0 && oi->oi_fid.f_ver == 0)
oi->oi_fid.f_oid = LUSTRE_FID_INIT_OID;
}
@@ -689,7 +697,8 @@ static inline int ostid_to_fid(struct lu_fid *fid, struct 
ost_id *ostid,
 * that we map into the IDIF namespace.  It allows up to 2^48
 * objects per OST, as this is the object namespace that has
 * been in production for years.  This can handle create rates
-* of 1M objects/s/OST for 9 years, or combinations thereof. */
+* of 1M objects/s/OST for 9 years, or combinations thereof.
+*/
if (ostid_id(ostid) >= IDIF_MAX_OID) {
 CERROR("bad MDT0 id, "DOSTID" ost_idx:%u\n",
POSTID(ostid), ost_idx);
@@ -704,7 +713,8 @@ static inline int ostid_to_fid(struct lu_fid *fid, struct 
ost_id *ostid,
   /* This is either an IDIF object, which identifies objects across
* all OSTs, or a regular FID.  The IDIF namespace maps legacy
* OST objects into the FID namespace.  In both cases, we just
-   * pass the FID through, no conversion needed. */
+   * pass the FID through, no conversion needed.
+   */
if (ostid->oi_fid.f_ver != 0) {
CERROR("bad MDT0 id, "DOSTID" ost_idx:%u\n",
POSTID(ostid), ost_idx);
@@ -868,7 +878,8 @@ static inline void ostid_le_to_cpu(const stru

[PATCH v2 44/84] staging/lustre/fid: Adjust comments to better conform to coding style

2016-02-24 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/fid/fid_request.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c 
b/drivers/staging/lustre/lustre/fid/fid_request.c
index 7ca65df..70400aa 100644
--- a/drivers/staging/lustre/lustre/fid/fid_request.c
+++ b/drivers/staging/lustre/lustre/fid/fid_request.c
@@ -95,7 +95,8 @@ static int seq_client_rpc(struct lu_client_seq *seq,
 * precreating objects on this OST), and it will send the
 * request to MDT0 here, so we can not keep resending the
 * request here, otherwise if MDT0 is failed(umounted),
-* it can not release the export of MDT0 */
+* it can not release the export of MDT0
+*/
if (seq->lcs_type == LUSTRE_SEQ_DATA)
req->rq_no_delay = req->rq_no_resend = 1;
debug_mask = D_CONSOLE;
@@ -152,7 +153,8 @@ static int seq_client_alloc_meta(const struct lu_env *env,
/* If meta server return -EINPROGRESS or EAGAIN,
 * it means meta server might not be ready to
 * allocate super sequence from sequence controller
-* (MDT0)yet */
+* (MDT0)yet
+*/
rc = seq_client_rpc(seq, &seq->lcs_space,
SEQ_ALLOC_META, "meta");
} while (rc == -EINPROGRESS || rc == -EAGAIN);
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 79/84] staging/lustre/obdecho: Fix style vs open parenthesis alignment

2016-02-24 Thread green
From: Oleg Drokin 

This mostly fixes checkpatch complaints about
"Alignment should match open parenthesis"

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/obdecho/echo_client.c| 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c 
b/drivers/staging/lustre/lustre/obdecho/echo_client.c
index 3be28c5..ab56e67 100644
--- a/drivers/staging/lustre/lustre/obdecho/echo_client.c
+++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c
@@ -220,7 +220,7 @@ static struct lu_kmem_descr echo_caches[] = {
  * @{
  */
 static struct page *echo_page_vmpage(const struct lu_env *env,
-   const struct cl_page_slice *slice)
+const struct cl_page_slice *slice)
 {
return cl2echo_page(slice)->ep_vmpage;
 }
@@ -367,7 +367,7 @@ static struct cl_lock_operations echo_lock_ops = {
  * @{
  */
 static int echo_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 echo_page *ep = cl_object_page_slice(obj, page);
struct echo_object *eco = cl2echo_obj(obj);
@@ -529,7 +529,7 @@ static void echo_object_free(const struct lu_env *env, 
struct lu_object *obj)
 }
 
 static int echo_object_print(const struct lu_env *env, void *cookie,
-   lu_printer_t p, const struct lu_object *o)
+lu_printer_t p, const struct lu_object *o)
 {
struct echo_object *obj = cl2echo_obj(lu2cl(o));
 
@@ -621,7 +621,7 @@ static void echo_site_fini(const struct lu_env *env, struct 
echo_device *ed)
 }
 
 static void *echo_thread_key_init(const struct lu_context *ctx,
- struct lu_context_key *key)
+ struct lu_context_key *key)
 {
struct echo_thread_info *info;
 
@@ -632,7 +632,7 @@ static void *echo_thread_key_init(const struct lu_context 
*ctx,
 }
 
 static void echo_thread_key_fini(const struct lu_context *ctx,
-struct lu_context_key *key, void *data)
+struct lu_context_key *key, void *data)
 {
struct echo_thread_info *info = data;
 
@@ -640,7 +640,7 @@ static void echo_thread_key_fini(const struct lu_context 
*ctx,
 }
 
 static void echo_thread_key_exit(const struct lu_context *ctx,
-struct lu_context_key *key, void *data)
+struct lu_context_key *key, void *data)
 {
 }
 
@@ -652,7 +652,7 @@ static struct lu_context_key echo_thread_key = {
 };
 
 static void *echo_session_key_init(const struct lu_context *ctx,
- struct lu_context_key *key)
+  struct lu_context_key *key)
 {
struct echo_session_info *session;
 
@@ -663,7 +663,7 @@ static void *echo_session_key_init(const struct lu_context 
*ctx,
 }
 
 static void echo_session_key_fini(const struct lu_context *ctx,
-struct lu_context_key *key, void *data)
+ struct lu_context_key *key, void *data)
 {
struct echo_session_info *session = data;
 
@@ -671,7 +671,7 @@ static void echo_session_key_fini(const struct lu_context 
*ctx,
 }
 
 static void echo_session_key_exit(const struct lu_context *ctx,
-struct lu_context_key *key, void *data)
+ struct lu_context_key *key, void *data)
 {
 }
 
@@ -720,7 +720,7 @@ static struct lu_device *echo_device_alloc(const struct 
lu_env *env,
tgt = class_name2obd(lustre_cfg_string(cfg, 1));
if (!tgt) {
CERROR("Can not find tgt device %s\n",
-   lustre_cfg_string(cfg, 1));
+  lustre_cfg_string(cfg, 1));
rc = -ENODEV;
goto out;
}
@@ -796,7 +796,7 @@ out:
 }
 
 static int echo_device_init(const struct lu_env *env, struct lu_device *d,
- const char *name, struct lu_device *next)
+   const char *name, struct lu_device *next)
 {
LBUG();
return 0;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 45/84] staging/lustre/lclient: Adjust comments to better conform to coding style

2016-02-24 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/lclient/glimpse.c|  3 ++-
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c | 24 ++
 .../staging/lustre/lustre/lclient/lcommon_misc.c   |  6 --
 3 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lclient/glimpse.c 
b/drivers/staging/lustre/lustre/lclient/glimpse.c
index 8533a1e..c4e8a08 100644
--- a/drivers/staging/lustre/lustre/lclient/glimpse.c
+++ b/drivers/staging/lustre/lustre/lclient/glimpse.c
@@ -109,7 +109,8 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io 
*io,
 *   if there were no conflicting locks. If there
 *   were conflicting locks, enqueuing or waiting
 *   fails with -ENAVAIL, but valid inode
-*   attributes are returned anyway. */
+*   attributes are returned anyway.
+*/
*descr = whole_file;
descr->cld_obj   = clob;
descr->cld_mode  = CLM_PHANTOM;
diff --git a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c 
b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
index efa6e2e..30651f2 100644
--- a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
+++ b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
@@ -613,7 +613,8 @@ void ccc_lock_state(const struct lu_env *env,
 * stale i_size when doing appending writes and effectively
 * cancel the result of the truncate.  Getting the
 * ll_inode_size_lock() after the enqueue maintains the DLM
-* -> ll_inode_size_lock() acquiring order. */
+* -> ll_inode_size_lock() acquiring order.
+*/
if (lock->cll_descr.cld_start == 0 &&
lock->cll_descr.cld_end == CL_PAGE_EOF)
cl_merge_lvb(env, inode);
@@ -754,7 +755,8 @@ int ccc_prep_size(const struct lu_env *env, struct 
cl_object *obj,
 * page index, return directly. Do not expect
 * kernel will check such case correctly.
 * linux-2.6.18-128.1.1 miss to do that.
-* --bug 17336 */
+* --bug 17336
+*/
loff_t size = cl_isize_read(inode);
loff_t cur_index = start >> PAGE_CACHE_SHIFT;
loff_t size_index = (size - 1) >>
@@ -884,7 +886,8 @@ again:
 
if (attr->ia_valid & ATTR_FILE)
/* populate the file descriptor for ftruncate to honor
-* group lock - see LU-787 */
+* group lock - see LU-787
+*/
cio->cui_fd = cl_iattr2fd(inode, attr);
 
result = cl_io_loop(env, io);
@@ -896,7 +899,8 @@ again:
goto again;
/* HSM import case: file is released, cannot be restored
 * no need to fail except if restore registration failed
-* with -ENODATA */
+* with -ENODATA
+*/
if (result == -ENODATA && io->ci_restore_needed &&
io->ci_result != -ENODATA)
result = 0;
@@ -1026,7 +1030,8 @@ int cl_file_inode_init(struct inode *inode, struct 
lustre_md *md)
/* clob is slave of inode, empty lli_clob means for new inode,
 * there is no clob in cache with the given fid, so it is
 * unnecessary to perform lookup-alloc-lookup-insert, just
-* alloc and insert directly. */
+* alloc and insert directly.
+*/
LASSERT(inode->i_state & I_NEW);
conf.coc_lu.loc_flags = LOC_F_NEW;
clob = cl_object_find(env, lu2cl_dev(site->ls_top_dev),
@@ -1151,7 +1156,8 @@ __u16 ll_dirent_type_get(struct lu_dirent *ent)
 }
 
 /**
- * build inode number from passed @fid */
+ * build inode number from passed @fid
+ */
 __u64 cl_fid_build_ino(const struct lu_fid *fid, int api32)
 {
if (BITS_PER_LONG == 32 || api32)
@@ -1162,7 +1168,8 @@ __u64 cl_fid_build_ino(const struct lu_fid *fid, int 
api32)
 
 /**
  * build inode generation from passed @fid.  If our FID overflows the 32-bit
- * inode number then return a non-zero generation to distinguish them. */
+ * inode number then return a non-zero generation to distinguish them.
+ */
 __u32 cl_fid_build_gen(const struct lu_fid *fid)
 {
__u32 gen;
@@ -1183,7 +1190,8 @@ __u32 cl_fid_build_gen(const struct lu_fid *fid)
  * have to wait for the refcount to become zero to destroy the older layout.
  *
  * Not

[PATCH v2 40/84] staging/lustre: Remove unused lli_open_count from struct ll_inode_info

2016-02-24 Thread green
From: Oleg Drokin 

Capabilities code was the only user and it is long gone.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/llite_internal.h | 6 ++
 drivers/staging/lustre/lustre/llite/llite_lib.c  | 1 -
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h 
b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 46144ff..bbd5ab8f 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -133,10 +133,8 @@ struct ll_inode_info {
 * for allocating OST objects after a mknod() and later open-by-FID. */
struct lu_fid  lli_pfid;
 
-   struct list_head  lli_close_list;
-   /* open count currently used by capability only, indicate whether
-* capability needs renewal */
-   atomic_tlli_open_count;
+   struct list_head  lli_close_list;
+
unsigned long lli_rmtperm_time;
 
/* handle is to be sent to MDS later on done_writing and setattr.
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 67b4b80..b652aee 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -797,7 +797,6 @@ void ll_lli_init(struct ll_inode_info *lli)
/* Do not set lli_fid, it has been initialized already. */
fid_zero(&lli->lli_pfid);
INIT_LIST_HEAD(&lli->lli_close_list);
-   atomic_set(&lli->lli_open_count, 0);
lli->lli_rmtperm_time = 0;
lli->lli_pending_och = NULL;
lli->lli_mds_read_och = NULL;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 33/84] staging/lustre: S_DIRSYNC is always defined in kernel

2016-02-24 Thread green
From: Oleg Drokin 

No need to check for it.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index b5f8453..ad77d33 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2013,9 +2013,7 @@ static inline int ll_ext_to_inode_flags(int flags)
return (((flags & LUSTRE_SYNC_FL)  ? S_SYNC  : 0) |
((flags & LUSTRE_NOATIME_FL)   ? S_NOATIME   : 0) |
((flags & LUSTRE_APPEND_FL)? S_APPEND: 0) |
-#if defined(S_DIRSYNC)
((flags & LUSTRE_DIRSYNC_FL)   ? S_DIRSYNC   : 0) |
-#endif
((flags & LUSTRE_IMMUTABLE_FL) ? S_IMMUTABLE : 0));
 }
 
@@ -2024,9 +2022,7 @@ static inline int ll_inode_to_ext_flags(int iflags)
return (((iflags & S_SYNC)  ? LUSTRE_SYNC_FL  : 0) |
((iflags & S_NOATIME)   ? LUSTRE_NOATIME_FL   : 0) |
((iflags & S_APPEND)? LUSTRE_APPEND_FL: 0) |
-#if defined(S_DIRSYNC)
((iflags & S_DIRSYNC)   ? LUSTRE_DIRSYNC_FL   : 0) |
-#endif
((iflags & S_IMMUTABLE) ? LUSTRE_IMMUTABLE_FL : 0));
 }
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 81/84] staging/lustre: Fix lines that start with spaces

2016-02-24 Thread green
From: Oleg Drokin 

Found with checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_cfg.h |  2 +-
 drivers/staging/lustre/lustre/include/lustre_dlm.h |  4 ++--
 drivers/staging/lustre/lustre/llite/llite_nfs.c|  6 +++---
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |  2 +-
 drivers/staging/lustre/lustre/llite/rw26.c | 17 +
 5 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_cfg.h 
b/drivers/staging/lustre/lustre/include/lustre_cfg.h
index 23ae832..bb16ae9 100644
--- a/drivers/staging/lustre/lustre/include/lustre_cfg.h
+++ b/drivers/staging/lustre/lustre/include/lustre_cfg.h
@@ -50,7 +50,7 @@
 #define LUSTRE_CFG_MAX_BUFCOUNT 8
 
 #define LCFG_HDR_SIZE(count) \
-cfs_size_round(offsetof (struct lustre_cfg, lcfg_buflens[(count)]))
+   cfs_size_round(offsetof(struct lustre_cfg, lcfg_buflens[(count)]))
 
 /** If the LCFG_REQUIRED bit is set in a configuration command,
  * then the client is required to understand this parameter
diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 144b5af..8b0364f 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -149,13 +149,13 @@ extern enum ldlm_mode lck_compat_array[];
 
 static inline void lockmode_verify(enum ldlm_mode mode)
 {
-   LASSERT(mode > LCK_MINMODE && mode < LCK_MAXMODE);
+   LASSERT(mode > LCK_MINMODE && mode < LCK_MAXMODE);
 }
 
 static inline int lockmode_compat(enum ldlm_mode exist_mode,
  enum ldlm_mode new_mode)
 {
-   return (lck_compat_array[exist_mode] & new_mode);
+   return (lck_compat_array[exist_mode] & new_mode);
 }
 
 /*
diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c 
b/drivers/staging/lustre/lustre/llite/llite_nfs.c
index 69d30aa..193aab8 100644
--- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
+++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
@@ -330,9 +330,9 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
 }
 
 const struct export_operations lustre_export_operations = {
-   .get_parent = ll_get_parent,
-   .encode_fh  = ll_encode_fh,
-   .get_name   = ll_get_name,
+   .get_parent = ll_get_parent,
+   .encode_fh  = ll_encode_fh,
+   .get_name   = ll_get_name,
.fh_to_dentry = ll_fh_to_dentry,
.fh_to_parent = ll_fh_to_parent,
 };
diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c 
b/drivers/staging/lustre/lustre/llite/lproc_llite.c
index 8a27f69..45941a6 100644
--- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
+++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
@@ -1504,5 +1504,5 @@ LPROC_SEQ_FOPS(ll_rw_offset_stats);
 
 void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars)
 {
-lvars->obd_vars = lprocfs_llite_obd_vars;
+   lvars->obd_vars = lprocfs_llite_obd_vars;
 }
diff --git a/drivers/staging/lustre/lustre/llite/rw26.c 
b/drivers/staging/lustre/lustre/llite/rw26.c
index 6a5762e..b9d8e73 100644
--- a/drivers/staging/lustre/lustre/llite/rw26.c
+++ b/drivers/staging/lustre/lustre/llite/rw26.c
@@ -339,14 +339,15 @@ static ssize_t ll_direct_IO_26_seg(const struct lu_env 
*env, struct cl_io *io,
   size_t size, loff_t file_offset,
   struct page **pages, int page_count)
 {
-struct ll_dio_pages pvec = { .ldp_pages= pages,
-.ldp_nr   = page_count,
-.ldp_size   = size,
-.ldp_offsets  = NULL,
-.ldp_start_offset = file_offset
-  };
-
-return ll_direct_rw_pages(env, io, rw, inode, &pvec);
+   struct ll_dio_pages pvec = {
+   .ldp_pages  = pages,
+   .ldp_nr = page_count,
+   .ldp_size   = size,
+   .ldp_offsets= NULL,
+   .ldp_start_offset = file_offset
+   };
+
+   return ll_direct_rw_pages(env, io, rw, inode, &pvec);
 }
 
 #ifdef KMALLOC_MAX_SIZE
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 39/84] staging/lustre: MAY_NOT_BLOCK is always defined, don't check for it.

2016-02-24 Thread green
From: Oleg Drokin 

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/file.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index bbe6ebf..ba65fc0 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -3071,10 +3071,8 @@ int ll_inode_permission(struct inode *inode, int mask)
 {
int rc = 0;
 
-#ifdef MAY_NOT_BLOCK
if (mask & MAY_NOT_BLOCK)
return -ECHILD;
-#endif
 
/* as root inode are NOT getting validated in lookup operation,
* need to do it before permission check. */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 82/84] staging/lustre: Rework MAX_DIO_SIZE macro

2016-02-24 Thread green
From: Oleg Drokin 

KMALLOC_MAX_SIZE is always defined in the kernel, so no point
in checking for it, just use t directly.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/rw26.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/rw26.c 
b/drivers/staging/lustre/lustre/llite/rw26.c
index b9d8e73..7a5db67 100644
--- a/drivers/staging/lustre/lustre/llite/rw26.c
+++ b/drivers/staging/lustre/lustre/llite/rw26.c
@@ -350,20 +350,14 @@ static ssize_t ll_direct_IO_26_seg(const struct lu_env 
*env, struct cl_io *io,
return ll_direct_rw_pages(env, io, rw, inode, &pvec);
 }
 
-#ifdef KMALLOC_MAX_SIZE
-#define MAX_MALLOC KMALLOC_MAX_SIZE
-#else
-#define MAX_MALLOC (128 * 1024)
-#endif
-
 /* This is the maximum size of a single O_DIRECT request, based on the
  * kmalloc limit.  We need to fit all of the brw_page structs, each one
  * representing PAGE_SIZE worth of user data, into a single buffer, and
  * then truncate this to be a full-sized RPC.  For 4kB PAGE_SIZE this is
  * up to 22MB for 128kB kmalloc and up to 682MB for 4MB kmalloc.
  */
-#define MAX_DIO_SIZE ((MAX_MALLOC / sizeof(struct brw_page) * PAGE_CACHE_SIZE) 
& \
- ~(DT_MAX_BRW_SIZE - 1))
+#define MAX_DIO_SIZE ((KMALLOC_MAX_SIZE / sizeof(struct brw_page) *  \
+  PAGE_CACHE_SIZE) & ~(DT_MAX_BRW_SIZE - 1))
 static ssize_t ll_direct_IO_26(struct kiocb *iocb, struct iov_iter *iter,
   loff_t file_offset)
 {
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 75/84] staging/lustre/obdclass: Fix style vs open parenthesis alignment

2016-02-24 Thread green
From: Oleg Drokin 

This mostly fixes checkpatch complaints about
"Alignment should match open parenthesis"

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/obdclass/cl_io.c |  20 ++--
 drivers/staging/lustre/lustre/obdclass/cl_lock.c   |  21 ++--
 drivers/staging/lustre/lustre/obdclass/cl_object.c |  10 +-
 drivers/staging/lustre/lustre/obdclass/cl_page.c   |  10 +-
 drivers/staging/lustre/lustre/obdclass/class_obd.c |   3 +-
 drivers/staging/lustre/lustre/obdclass/genops.c|  26 ++---
 .../lustre/lustre/obdclass/linux/linux-sysctl.c|   8 +-
 drivers/staging/lustre/lustre/obdclass/llog_cat.c  |   4 +-
 .../lustre/lustre/obdclass/lprocfs_status.c| 125 ++---
 drivers/staging/lustre/lustre/obdclass/lu_object.c |   3 +-
 .../staging/lustre/lustre/obdclass/lustre_peer.c   |   2 +-
 .../staging/lustre/lustre/obdclass/obd_config.c|   6 +-
 drivers/staging/lustre/lustre/obdclass/obd_mount.c |   8 +-
 13 files changed, 119 insertions(+), 127 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c 
b/drivers/staging/lustre/lustre/obdclass/cl_io.c
index 191ec43..f5128b4 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_io.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c
@@ -139,7 +139,7 @@ void cl_io_fini(const struct lu_env *env, struct cl_io *io)
case CIT_MISC:
/* Check ignore layout change conf */
LASSERT(ergo(io->ci_ignore_layout || !io->ci_verify_layout,
-   !io->ci_need_restart));
+!io->ci_need_restart));
break;
default:
LBUG();
@@ -291,11 +291,11 @@ static void cl_io_locks_sort(struct cl_io *io)
prev = NULL;
 
list_for_each_entry_safe(curr, temp,
-&io->ci_lockset.cls_todo,
-cill_linkage) {
+&io->ci_lockset.cls_todo,
+cill_linkage) {
if (prev) {
switch (cl_lock_descr_sort(&prev->cill_descr,
- &curr->cill_descr)) {
+  &curr->cill_descr)) {
case 0:
/*
 * IMPOSSIBLE: Identical locks are
@@ -306,7 +306,7 @@ static void cl_io_locks_sort(struct cl_io *io)
LBUG();
case 1:
list_move_tail(&curr->cill_linkage,
-  &prev->cill_linkage);
+  &prev->cill_linkage);
done = 0;
continue; /* don't change prev: it's
   * still "previous"
@@ -385,8 +385,7 @@ static int cl_lockset_lock_one(const struct lu_env *env,
if (!(link->cill_descr.cld_enq_flags & CEF_ASYNC)) {
result = cl_wait(env, lock);
if (result == 0)
-   list_move(&link->cill_linkage,
- &set->cls_done);
+   list_move(&link->cill_linkage, &set->cls_done);
} else
result = 0;
} else
@@ -430,12 +429,11 @@ static int cl_lockset_lock(const struct lu_env *env, 
struct cl_io *io,
}
if (result == 0) {
list_for_each_entry_safe(link, temp,
-&set->cls_curr, cill_linkage) {
+&set->cls_curr, cill_linkage) {
lock = link->cill_lock;
result = cl_wait(env, lock);
if (result == 0)
-   list_move(&link->cill_linkage,
- &set->cls_done);
+   list_move(&link->cill_linkage, &set->cls_done);
else
break;
}
@@ -1354,7 +1352,7 @@ void cl_req_completion(const struct lu_env *env, struct 
cl_req *req, int rc)
 */
while (!list_empty(&req->crq_layers)) {
slice = list_entry(req->crq_layers.prev,
-  struct cl_req_slice, crs_linkage);
+  struct cl_req_slice, crs_linkage);
list_del_init(&slice->crs_linkage);
if (slice->crs_ops->cro_completion)
slice->crs_ops->cro_completion(env, slice, rc);
diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c 
b/drivers/stagi

[PATCH v2 77/84] staging/lustre/mdc: Fix style vs open parenthesis alignment

2016-02-24 Thread green
From: Oleg Drokin 

This mostly fixes checkpatch complaints about
"Alignment should match open parenthesis"

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/mdc/mdc_internal.h |  2 +-
 drivers/staging/lustre/lustre/mdc/mdc_locks.c| 26 +++-
 drivers/staging/lustre/lustre/mdc/mdc_reint.c|  2 +-
 drivers/staging/lustre/lustre/mdc/mdc_request.c  | 12 +--
 4 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_internal.h 
b/drivers/staging/lustre/lustre/mdc/mdc_internal.h
index 54f4ca6..c5519ae 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_internal.h
+++ b/drivers/staging/lustre/lustre/mdc/mdc_internal.h
@@ -53,7 +53,7 @@ void mdc_readdir_pack(struct ptlrpc_request *req, __u64 
pgoff, __u32 size,
 void mdc_getattr_pack(struct ptlrpc_request *req, __u64 valid, int flags,
  struct md_op_data *data, int ea_size);
 void mdc_setattr_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
-void *ea, int ealen, void *ea2, int ea2len);
+ void *ea, int ealen, void *ea2, int ea2len);
 void mdc_create_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 const void *data, int datalen, __u32 mode, __u32 uid,
 __u32 gid, cfs_cap_t capability, __u64 rdev);
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c 
b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index 6dae574..958a164 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -366,7 +366,7 @@ mdc_intent_getxattr_pack(struct obd_export *exp,
LIST_HEAD(cancels);
 
req = ptlrpc_request_alloc(class_exp2cliimp(exp),
-   &RQF_LDLM_INTENT_GETXATTR);
+  &RQF_LDLM_INTENT_GETXATTR);
if (!req)
return ERR_PTR(-ENOMEM);
 
@@ -386,14 +386,12 @@ mdc_intent_getxattr_pack(struct obd_export *exp,
mdc_pack_body(req, &op_data->op_fid1, op_data->op_valid, maxdata, -1,
  0);
 
-   req_capsule_set_size(&req->rq_pill, &RMF_EADATA,
-   RCL_SERVER, maxdata);
+   req_capsule_set_size(&req->rq_pill, &RMF_EADATA, RCL_SERVER, maxdata);
 
-   req_capsule_set_size(&req->rq_pill, &RMF_EAVALS,
-   RCL_SERVER, maxdata);
+   req_capsule_set_size(&req->rq_pill, &RMF_EAVALS, RCL_SERVER, maxdata);
 
req_capsule_set_size(&req->rq_pill, &RMF_EAVALS_LENS,
-   RCL_SERVER, maxdata);
+RCL_SERVER, maxdata);
 
ptlrpc_request_set_replen(req);
 
@@ -439,8 +437,8 @@ static struct ptlrpc_request *mdc_intent_unlink_pack(struct 
obd_export *exp,
 }
 
 static struct ptlrpc_request *mdc_intent_getattr_pack(struct obd_export *exp,
-   struct lookup_intent *it,
-   struct md_op_data *op_data)
+ struct lookup_intent *it,
+struct md_op_data *op_data)
 {
struct ptlrpc_request *req;
struct obd_device *obddev = class_exp2obd(exp);
@@ -498,7 +496,7 @@ static struct ptlrpc_request *mdc_intent_layout_pack(struct 
obd_export *exp,
int rc;
 
req = ptlrpc_request_alloc(class_exp2cliimp(exp),
-   &RQF_LDLM_INTENT_LAYOUT);
+  &RQF_LDLM_INTENT_LAYOUT);
if (!req)
return ERR_PTR(-ENOMEM);
 
@@ -718,7 +716,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
void *lmm;
 
LDLM_DEBUG(lock, "layout lock returned by: %s, lvb_len: %d\n",
-   ldlm_it2str(it->it_op), lvb_len);
+  ldlm_it2str(it->it_op), lvb_len);
 
lmm = libcfs_kvzalloc(lvb_len, GFP_NOFS);
if (!lmm) {
@@ -1094,7 +1092,7 @@ int mdc_revalidate_lock(struct obd_export *exp, struct 
lookup_intent *it,
}
 
mode = mdc_lock_match(exp, LDLM_FL_BLOCK_GRANTED, fid,
-  LDLM_IBITS, &policy,
+ LDLM_IBITS, &policy,
  LCK_CR | LCK_CW | LCK_PR | LCK_PW,
  &lockh);
}
@@ -1264,9 +1262,9 @@ int mdc_intent_getattr_async(struct obd_export *exp,
__u64   flags = LDLM_FL_HAS_INTENT;
 
CDEBUG(D_DLMTRACE,
-   "name: %.*s in inode "DFID", intent: %s flags %#Lo\n",
-   op_data->op_namelen, op_data->op_name, PFID(&op_data->op_fid1),
-   ldlm_it2str(it->it_op), it->it_flags);
+  "name: %.*s in inode " DFID ", intent: %s flags %#Lo\n",
+  op_data->op_namelen, op_data->

[PATCH v2 34/84] staging/lustre: FMODE_READ and FMODE_WRITE are always defined in the kernel

2016-02-24 Thread green
From: Oleg Drokin 

So no need to see if they are.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index ad77d33..7b5c132 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2158,11 +2158,6 @@ void lustre_swab_mdt_rec_setattr(struct mdt_rec_setattr 
*sa);
 #define MDS_ATTR_FROM_OPEN  0x4000ULL /* = 16384, called from open path, ie 
O_TRUNC */
 #define MDS_ATTR_BLOCKS 0x8000ULL /* = 32768 */
 
-#ifndef FMODE_READ
-#define FMODE_READ0001
-#define FMODE_WRITE  0002
-#endif
-
 #define MDS_FMODE_CLOSED
 #define MDS_FMODE_EXEC0004
 /* IO Epoch is opened on a closed file. */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 43/84] staging/lustre/fld: Adjust comments to better conform to coding style

2016-02-24 Thread green
From: Oleg Drokin 

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/fld/fld_cache.c|  9 ++---
 drivers/staging/lustre/lustre/fld/fld_internal.h | 24 
 drivers/staging/lustre/lustre/fld/fld_request.c  |  9 ++---
 3 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c 
b/drivers/staging/lustre/lustre/fld/fld_cache.c
index a7026a9..2b09b76 100644
--- a/drivers/staging/lustre/lustre/fld/fld_cache.c
+++ b/drivers/staging/lustre/lustre/fld/fld_cache.c
@@ -183,7 +183,8 @@ restart_fixup:
}
 
/* we could have overlap over next
-* range too. better restart. */
+* range too. better restart.
+*/
goto restart_fixup;
}
 
@@ -302,7 +303,8 @@ static void fld_cache_overlap_handle(struct fld_cache 
*cache,
const u32 mdt = range->lsr_index;
 
/* this is overlap case, these case are checking overlapping with
-* prev range only. fixup will handle overlapping with next range. */
+* prev range only. fixup will handle overlapping with next range.
+*/
 
if (f_curr->fce_range.lsr_index == mdt) {
f_curr->fce_range.lsr_start = min(f_curr->fce_range.lsr_start,
@@ -317,7 +319,8 @@ static void fld_cache_overlap_handle(struct fld_cache 
*cache,
} else if (new_start <= f_curr->fce_range.lsr_start &&
f_curr->fce_range.lsr_end <= new_end) {
/* case 1: new range completely overshadowed existing range.
-*   e.g. whole range migrated. update fld cache entry */
+*   e.g. whole range migrated. update fld cache entry
+*/
 
f_curr->fce_range = *range;
kfree(f_new);
diff --git a/drivers/staging/lustre/lustre/fld/fld_internal.h 
b/drivers/staging/lustre/lustre/fld/fld_internal.h
index ee36d6b..e8a3caf 100644
--- a/drivers/staging/lustre/lustre/fld/fld_internal.h
+++ b/drivers/staging/lustre/lustre/fld/fld_internal.h
@@ -67,8 +67,7 @@ struct lu_fld_hash {
 struct fld_cache_entry {
struct list_head   fce_lru;
struct list_head   fce_list;
-   /**
-* fld cache entries are sorted on range->lsr_start field. */
+   /** fld cache entries are sorted on range->lsr_start field. */
struct lu_seq_range  fce_range;
 };
 
@@ -79,32 +78,25 @@ struct fld_cache {
 */
rwlock_t fci_lock;
 
-   /**
-* Cache shrink threshold */
+   /** Cache shrink threshold */
int   fci_threshold;
 
-   /**
-* Preferred number of cached entries */
+   /** Preferred number of cached entries */
int   fci_cache_size;
 
-   /**
-* Current number of cached entries. Protected by \a fci_lock */
+   /** Current number of cached entries. Protected by \a fci_lock */
int   fci_cache_count;
 
-   /**
-* LRU list fld entries. */
+   /** LRU list fld entries. */
struct list_head   fci_lru;
 
-   /**
-* sorted fld entries. */
+   /** sorted fld entries. */
struct list_head   fci_entries_head;
 
-   /**
-* Cache statistics. */
+   /** Cache statistics. */
struct fld_stats fci_stat;
 
-   /**
-* Cache name used for debug and messages. */
+   /** Cache name used for debug and messages. */
char fci_name[LUSTRE_MDT_MAXNAMELEN];
unsigned int fci_no_shrink:1;
 };
diff --git a/drivers/staging/lustre/lustre/fld/fld_request.c 
b/drivers/staging/lustre/lustre/fld/fld_request.c
index 0f0fbe4..b50a57b 100644
--- a/drivers/staging/lustre/lustre/fld/fld_request.c
+++ b/drivers/staging/lustre/lustre/fld/fld_request.c
@@ -58,7 +58,8 @@
 #include "fld_internal.h"
 
 /* TODO: these 3 functions are copies of flow-control code from mdc_lib.c
- * It should be common thing. The same about mdc RPC lock */
+ * It should be common thing. The same about mdc RPC lock
+ */
 static int fld_req_avail(struct client_obd *cli, struct mdc_cache_waiter *mcw)
 {
int rc;
@@ -124,7 +125,8 @@ fld_rrb_scan(struct lu_client_fld *fld, u64 seq)
 * it should go to index 0 directly, instead of calculating
 * hash again, and also if other MDTs is not being connected,
 * the fld lookup requests(for seq on MDT0) should not be
-* blocked because of other MDTs */
+* blocked because of other MDTs
+*/
if (fid_seq_is_norm(seq))
hash = fld_rrb_hash(fld, seq);
else
@@ -139,7 +141,8 @@ again:
if (hash != 0) {
/* It i

[PATCH v2 37/84] staging/lustre: Remove last_rcvd-file related data

2016-02-24 Thread green
From: Oleg Drokin 

last_rcvd (last received) is a special server-side file on the
Lustre FS that stores information about server filesystem and
also list of connected clients and their state. There's no
point in having any of tha ton the client, though.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lustre_disk.h| 225 -
 1 file changed, 225 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_disk.h 
b/drivers/staging/lustre/lustre/include/lustre_disk.h
index 7c6933f..b69bd9d 100644
--- a/drivers/staging/lustre/lustre/include/lustre_disk.h
+++ b/drivers/staging/lustre/lustre/include/lustre_disk.h
@@ -116,231 +116,6 @@ struct lustre_mount_data {
 #define LR_EXPIRE_INTERVALS 16 /**< number of intervals to track transno */
 #define ENOENT_VERSION 1 /** 'virtual' version of non-existent object */
 
-#define LR_SERVER_SIZE   512
-#define LR_CLIENT_START 8192
-#define LR_CLIENT_SIZE   128
-#if LR_CLIENT_START < LR_SERVER_SIZE
-#error "Can't have LR_CLIENT_START < LR_SERVER_SIZE"
-#endif
-
-/*
- * This limit is arbitrary (131072 clients on x86), but it is convenient to use
- * 2^n * PAGE_CACHE_SIZE * 8 for the number of bits that fit an order-n 
allocation.
- * If we need more than 131072 clients (order-2 allocation on x86) then this
- * should become an array of single-page pointers that are allocated on demand.
- */
-#if (128 * 1024UL) > (PAGE_CACHE_SIZE * 8)
-#define LR_MAX_CLIENTS (128 * 1024UL)
-#else
-#define LR_MAX_CLIENTS (PAGE_CACHE_SIZE * 8)
-#endif
-
-/** COMPAT_146: this is an OST (temporary) */
-#define OBD_COMPAT_OST   0x0002
-/** COMPAT_146: this is an MDT (temporary) */
-#define OBD_COMPAT_MDT   0x0004
-/** 2.0 server, interop flag to show server version is changed */
-#define OBD_COMPAT_20 0x0008
-
-/** MDS handles LOV_OBJID file */
-#define OBD_ROCOMPAT_LOVOBJID   0x0001
-
-/** OST handles group subdirs */
-#define OBD_INCOMPAT_GROUPS 0x0001
-/** this is an OST */
-#define OBD_INCOMPAT_OST   0x0002
-/** this is an MDT */
-#define OBD_INCOMPAT_MDT   0x0004
-/** common last_rvcd format */
-#define OBD_INCOMPAT_COMMON_LR  0x0008
-/** FID is enabled */
-#define OBD_INCOMPAT_FID   0x0010
-/** Size-on-MDS is enabled */
-#define OBD_INCOMPAT_SOM   0x0020
-/** filesystem using iam format to store directory entries */
-#define OBD_INCOMPAT_IAM_DIR0x0040
-/** LMA attribute contains per-inode incompatible flags */
-#define OBD_INCOMPAT_LMA   0x0080
-/** lmm_stripe_count has been shrunk from __u32 to __u16 and the remaining 16
- * bits are now used to store a generation. Once we start changing the layout
- * and bumping the generation, old versions expecting a 32-bit lmm_stripe_count
- * will be confused by interpreting stripe_count | gen << 16 as the actual
- * stripe count */
-#define OBD_INCOMPAT_LMM_VER0x0100
-/** multiple OI files for MDT */
-#define OBD_INCOMPAT_MULTI_OI   0x0200
-
-/* Data stored per server at the head of the last_rcvd file.  In le32 order.
-   This should be common to filter_internal.h, lustre_mds.h */
-struct lr_server_data {
-   __u8  lsd_uuid[40]; /* server UUID */
-   __u64 lsd_last_transno;/* last completed transaction ID */
-   __u64 lsd_compat14; /* reserved - compat with old last_rcvd */
-   __u64 lsd_mount_count; /* incarnation number */
-   __u32 lsd_feature_compat;  /* compatible feature flags */
-   __u32 lsd_feature_rocompat;/* read-only compatible feature flags */
-   __u32 lsd_feature_incompat;/* incompatible feature flags */
-   __u32 lsd_server_size; /* size of server data area */
-   __u32 lsd_client_start;/* start of per-client data area */
-   __u16 lsd_client_size; /* size of per-client data area */
-   __u16 lsd_subdir_count;/* number of subdirectories for objects */
-   __u64 lsd_catalog_oid; /* recovery catalog object id */
-   __u32 lsd_catalog_ogen;/* recovery catalog inode generation */
-   __u8  lsd_peeruuid[40];/* UUID of MDS associated with this OST */
-   __u32 lsd_osd_index;   /* index number of OST in LOV */
-   __u32 lsd_padding1; /* was lsd_mdt_index, unused in 2.4.0 */
-   __u32 lsd_start_epoch; /* VBR: start epoch from last boot */
-   /** transaction values since lsd_trans_table_time */
-   __u64 lsd_trans_table[LR_EXPIRE_INTERVALS];
-   /** start point of transno table below */
-   __u32 lsd_trans_table_time; /* time of first slot in table above */
-   __u32 lsd_expire_intervals; /* LR_EXPIRE_INTERVALS */
-   __u8  lsd_padding[LR_SERVER_SIZE - 288];
-};
-
-/* Data stored per client in the last_rcvd file.  In le32 order. */
-struct lsd_client_data {
-   __u8  lcd_uuid[40];  /* client UUID */
-   __u64 lcd_last_transno; /* last completed transaction ID */
-   __u64 lcd_last_xid; /* xid for the last transaction */
-   __u32 

[PATCH v2 72/84] staging/lustre: NEED_QUOTA_DEFS is never defined, drop it.

2016-02-24 Thread green
From: Oleg Drokin 

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lustre/lustre_user.h   | 16 
 1 file changed, 16 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
index 2e9f025..9f026bd 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
@@ -552,22 +552,6 @@ enum {
RMT_RGETFACL= 4
 };
 
-#ifdef NEED_QUOTA_DEFS
-#ifndef QIF_BLIMITS
-#define QIF_BLIMITS 1
-#define QIF_SPACE   2
-#define QIF_ILIMITS 4
-#define QIF_INODES  8
-#define QIF_BTIME   16
-#define QIF_ITIME   32
-#define QIF_LIMITS  (QIF_BLIMITS | QIF_ILIMITS)
-#define QIF_USAGE   (QIF_SPACE | QIF_INODES)
-#define QIF_TIMES   (QIF_BTIME | QIF_ITIME)
-#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
-#endif
-
-#endif /* !__KERNEL__ */
-
 /* lustre volatile file support
  * file name header: .^L^S^T^R:volatile"
  */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 38/84] staging/lustre: Remove dead code in ldlm_lock_destroy_internal

2016-02-24 Thread green
From: Oleg Drokin 

This code has been commented out since end of 2012, so it's
clearly not needed here.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index 07e83e5..65d0cfe 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -337,16 +337,6 @@ static int ldlm_lock_destroy_internal(struct ldlm_lock 
*lock)
ldlm_lock_remove_from_lru(lock);
class_handle_unhash(&lock->l_handle);
 
-#if 0
-   /* Wake anyone waiting for this lock */
-   /* FIXME: I should probably add yet another flag, instead of using
-* l_export to only call this on clients */
-   if (lock->l_export)
-   class_export_put(lock->l_export);
-   lock->l_export = NULL;
-   if (lock->l_export && lock->l_completion_ast)
-   lock->l_completion_ast(lock, 0);
-#endif
return 1;
 }
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 22/84] staging/lustre: Get rid of ldlm_cancel_flags_t typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace it with enum ldlm_cancel_flags

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 18 ++
 drivers/staging/lustre/lustre/include/obd.h|  2 +-
 drivers/staging/lustre/lustre/include/obd_class.h  |  2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h |  6 +++---
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c| 10 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  | 20 +++-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c|  2 +-
 drivers/staging/lustre/lustre/mdc/mdc_internal.h   |  2 +-
 drivers/staging/lustre/lustre/mdc/mdc_locks.c  |  2 +-
 9 files changed, 34 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index ab40bc7..4ab34dd 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -533,12 +533,12 @@ struct ldlm_interval_tree {
 #define LUSTRE_TRACKS_LOCK_EXP_REFS (0)
 
 /** Cancel flags. */
-typedef enum {
+enum ldlm_cancel_flags {
LCF_ASYNC  = 0x1, /* Cancel locks asynchronously. */
LCF_LOCAL  = 0x2, /* Cancel locks locally, not notifing server */
LCF_BL_AST = 0x4, /* Cancel locks marked as LDLM_FL_BL_AST
   * in the same RPC */
-} ldlm_cancel_flags_t;
+};
 
 struct ldlm_flock {
__u64 start;
@@ -1245,24 +1245,26 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, 
struct ptlrpc_request *req,
  struct lustre_handle *lockh, int rc);
 int ldlm_cli_update_pool(struct ptlrpc_request *req);
 int ldlm_cli_cancel(struct lustre_handle *lockh,
-   ldlm_cancel_flags_t cancel_flags);
+   enum ldlm_cancel_flags cancel_flags);
 int ldlm_cli_cancel_unused(struct ldlm_namespace *, const struct ldlm_res_id *,
-  ldlm_cancel_flags_t flags, void *opaque);
+  enum ldlm_cancel_flags flags, void *opaque);
 int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns,
const struct ldlm_res_id *res_id,
ldlm_policy_data_t *policy,
enum ldlm_mode mode,
-   ldlm_cancel_flags_t flags,
+   enum ldlm_cancel_flags flags,
void *opaque);
 int ldlm_cancel_resource_local(struct ldlm_resource *res,
   struct list_head *cancels,
   ldlm_policy_data_t *policy,
   enum ldlm_mode mode, __u64 lock_flags,
-  ldlm_cancel_flags_t cancel_flags, void *opaque);
+  enum ldlm_cancel_flags cancel_flags,
+  void *opaque);
 int ldlm_cli_cancel_list_local(struct list_head *cancels, int count,
-  ldlm_cancel_flags_t flags);
+  enum ldlm_cancel_flags flags);
 int ldlm_cli_cancel_list(struct list_head *head, int count,
-struct ptlrpc_request *req, ldlm_cancel_flags_t flags);
+struct ptlrpc_request *req,
+enum ldlm_cancel_flags flags);
 /** @} ldlm_cli_api */
 
 /* mds/handler.c */
diff --git a/drivers/staging/lustre/lustre/include/obd.h 
b/drivers/staging/lustre/lustre/include/obd.h
index 802d867..1d9207b 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -1167,7 +1167,7 @@ struct md_ops {
 
int (*cancel_unused)(struct obd_export *, const struct lu_fid *,
 ldlm_policy_data_t *, enum ldlm_mode,
-ldlm_cancel_flags_t flags, void *opaque);
+enum ldlm_cancel_flags flags, void *opaque);
 
int (*get_remote_perm)(struct obd_export *, const struct lu_fid *,
   __u32, struct ptlrpc_request **);
diff --git a/drivers/staging/lustre/lustre/include/obd_class.h 
b/drivers/staging/lustre/lustre/include/obd_class.h
index c161a66..163dd55 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -1657,7 +1657,7 @@ static inline int md_cancel_unused(struct obd_export *exp,
   const struct lu_fid *fid,
   ldlm_policy_data_t *policy,
   enum ldlm_mode mode,
-  ldlm_cancel_flags_t flags,
+  enum ldlm_cancel_flags flags,
   void *opaque)
 {
int rc;
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h 
b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
index e

[PATCH v2 19/84] staging/lustre: Get rid of ldlm_error_t typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace it with enum ldlm_error

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 8 
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c| 4 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 4 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c  | 4 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 6 +++---
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 87806a6..924e68f 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -69,7 +69,7 @@ struct obd_device;
 /**
  * LDLM non-error return states
  */
-typedef enum {
+enum ldlm_error {
ELDLM_OK = 0,
 
ELDLM_LOCK_CHANGED = 300,
@@ -80,7 +80,7 @@ typedef enum {
 
ELDLM_NAMESPACE_EXISTS = 400,
ELDLM_BAD_NAMESPACE= 401
-} ldlm_error_t;
+};
 
 /**
  * LDLM namespace type.
@@ -1019,7 +1019,7 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
 } while (0)
 
 typedef int (*ldlm_processing_policy)(struct ldlm_lock *lock, __u64 *flags,
- int first_enq, ldlm_error_t *err,
+ int first_enq, enum ldlm_error *err,
  struct list_head *work_list);
 
 /**
@@ -1105,7 +1105,7 @@ static inline int ldlm_res_lvbo_update(struct 
ldlm_resource *res,
return 0;
 }
 
-int ldlm_error2errno(ldlm_error_t error);
+int ldlm_error2errno(enum ldlm_error error);
 
 #if LUSTRE_TRACKS_LOCK_EXP_REFS
 void ldlm_dump_export_locks(struct obd_export *exp);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
index 699e81d..8bd6a18 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
@@ -133,7 +133,7 @@ ldlm_flock_destroy(struct ldlm_lock *lock, enum ldlm_mode 
mode, __u64 flags)
  * would be collected and ASTs sent.
  */
 static int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags,
-  int first_enq, ldlm_error_t *err,
+  int first_enq, enum ldlm_error *err,
   struct list_head *work_list)
 {
struct ldlm_resource *res = req->l_resource;
@@ -449,7 +449,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 
flags, void *data)
struct obd_import *imp = NULL;
struct ldlm_flock_wait_data fwd;
struct l_wait_infolwi;
-   ldlm_error_terr;
+   enum ldlm_error err;
int  rc = 0;
 
CDEBUG(D_DLMTRACE, "flags: 0x%llx data: %p getlk: %p\n",
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h 
b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
index 6d4f324..ed27822 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
@@ -136,8 +136,8 @@ ldlm_lock_create(struct ldlm_namespace *ns, const struct 
ldlm_res_id *,
 enum ldlm_type type, enum ldlm_mode mode,
 const struct ldlm_callback_suite *cbs,
 void *data, __u32 lvb_len, enum lvb_type lvb_type);
-ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *, struct ldlm_lock **,
-  void *cookie, __u64 *flags);
+enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *, struct ldlm_lock **,
+ void *cookie, __u64 *flags);
 void ldlm_lock_addref_internal(struct ldlm_lock *, __u32 mode);
 void ldlm_lock_addref_internal_nolock(struct ldlm_lock *, __u32 mode);
 void ldlm_lock_decref_internal(struct ldlm_lock *, __u32 mode);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
index 68bf57b..c22370b 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
@@ -733,7 +733,7 @@ enum ldlm_mode lck_compat_array[] = {
  * Rather arbitrary mapping from LDLM error codes to errno values. This should
  * not escape to the user level.
  */
-int ldlm_error2errno(ldlm_error_t error)
+int ldlm_error2errno(enum ldlm_error error)
 {
int result;
 
@@ -761,7 +761,7 @@ int ldlm_error2errno(ldlm_error_t error)
break;
default:
if (((int)error) < 0)  /* cast to signed type */
-   result = error; /* as ldlm_error_t can be unsigned */
+   result = error; /* as enum ldlm_error can be unsigned */
else {
CERROR("Invalid DLM result code: %d\n", error);
result = -EPROTO;
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_loc

[PATCH v2 35/84] staging/lustre: Remove index file transfer structures

2016-02-24 Thread green
From: Oleg Drokin 

struct idx_info, struct lu_idxpage, lustre_swab_idx_info,
request formats and related defines are all unused and could
only happen for between-servers communications, so remove them
from the client code.

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 86 
 .../lustre/lustre/include/lustre_req_layout.h  |  2 -
 drivers/staging/lustre/lustre/ptlrpc/layout.c  | 21 -
 .../staging/lustre/lustre/ptlrpc/pack_generic.c| 14 
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c| 95 --
 5 files changed, 218 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 7b5c132..c272c18 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -3168,92 +3168,6 @@ void dump_ioo(struct obd_ioobj *nb);
 void dump_ost_body(struct ost_body *ob);
 void dump_rcs(__u32 *rc);
 
-#define IDX_INFO_MAGIC 0x3D37CC37
-
-/* Index file transfer through the network. The server serializes the index 
into
- * a byte stream which is sent to the client via a bulk transfer */
-struct idx_info {
-   __u32   ii_magic;
-
-   /* reply: see idx_info_flags below */
-   __u32   ii_flags;
-
-   /* request & reply: number of lu_idxpage (to be) transferred */
-   __u16   ii_count;
-   __u16   ii_pad0;
-
-   /* request: requested attributes passed down to the iterator API */
-   __u32   ii_attrs;
-
-   /* request & reply: index file identifier (FID) */
-   struct lu_fid   ii_fid;
-
-   /* reply: version of the index file before starting to walk the index.
-* Please note that the version can be modified at any time during the
-* transfer */
-   __u64   ii_version;
-
-   /* request: hash to start with:
-* reply: hash of the first entry of the first lu_idxpage and hash
-*  of the entry to read next if any */
-   __u64   ii_hash_start;
-   __u64   ii_hash_end;
-
-   /* reply: size of keys in lu_idxpages, minimal one if II_FL_VARKEY is
-* set */
-   __u16   ii_keysize;
-
-   /* reply: size of records in lu_idxpages, minimal one if II_FL_VARREC
-* is set */
-   __u16   ii_recsize;
-
-   __u32   ii_pad1;
-   __u64   ii_pad2;
-   __u64   ii_pad3;
-};
-
-void lustre_swab_idx_info(struct idx_info *ii);
-
-#define II_END_OFF MDS_DIR_END_OFF /* all entries have been read */
-
-/* List of flags used in idx_info::ii_flags */
-enum idx_info_flags {
-   II_FL_NOHASH= 1 << 0, /* client doesn't care about hash value */
-   II_FL_VARKEY= 1 << 1, /* keys can be of variable size */
-   II_FL_VARREC= 1 << 2, /* records can be of variable size */
-   II_FL_NONUNQ= 1 << 3, /* index supports non-unique keys */
-};
-
-#define LIP_MAGIC 0x8A6D6B6C
-
-/* 4KB (= LU_PAGE_SIZE) container gathering key/record pairs */
-struct lu_idxpage {
-   /* 16-byte header */
-   __u32   lip_magic;
-   __u16   lip_flags;
-   __u16   lip_nr;   /* number of entries in the container */
-   __u64   lip_pad0; /* additional padding for future use */
-
-   /* key/record pairs are stored in the remaining 4080 bytes.
-* depending upon the flags in idx_info::ii_flags, each key/record
-* pair might be preceded by:
-* - a hash value
-* - the key size (II_FL_VARKEY is set)
-* - the record size (II_FL_VARREC is set)
-*
-* For the time being, we only support fixed-size key & record. */
-   charlip_entries[0];
-};
-
-#define LIP_HDR_SIZE (offsetof(struct lu_idxpage, lip_entries))
-
-/* Gather all possible type associated with a 4KB container */
-union lu_page {
-   struct lu_dirpage   lp_dir; /* for MDS_READPAGE */
-   struct lu_idxpage   lp_idx; /* for OBD_IDX_READ */
-   charlp_array[LU_PAGE_SIZE];
-};
-
 /* security opcodes */
 enum sec_cmd {
SEC_CTX_INIT= 801,
diff --git a/drivers/staging/lustre/lustre/include/lustre_req_layout.h 
b/drivers/staging/lustre/lustre/include/lustre_req_layout.h
index fdcdd7a..b5128e4 100644
--- a/drivers/staging/lustre/lustre/include/lustre_req_layout.h
+++ b/drivers/staging/lustre/lustre/include/lustre_req_layout.h
@@ -130,7 +130,6 @@ void req_layout_fini(void);
 extern struct req_format RQF_OBD_PING;
 extern struct req_format RQF_OBD_SET_INFO;
 extern struct req_format RQF_SEC_CTX;
-extern struct req_format RQF_OBD_IDX_READ;
 /* MGS req_format */
 extern struct req_format RQF_MGS_TARGET_REG;
 extern struct req_format RQF_MGS_SET_INFO;
@@ -249,7 +248,6 @@ extern struct req_msg_field RMF_SETINFO_KEY;
 extern struct req_msg_field RMF_GETINFO_VAL;
 extern struct req_msg_field RMF_G

[PATCH v2 68/84] staging/lustre/lmv: Remove commented out MDS selection policies

2016-02-24 Thread green
From: Oleg Drokin 

The new DNE code does not use them either so they are not longer needed.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/lmv/lmv_obd.c | 45 -
 1 file changed, 45 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c 
b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index 67746c9..b5fc337 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -1133,51 +1133,6 @@ static int lmv_iocontrol(unsigned int cmd, struct 
obd_export *exp,
return rc;
 }
 
-#if 0
-static int lmv_all_chars_policy(int count, const char *name,
-   int len)
-{
-   unsigned int c = 0;
-
-   while (len > 0)
-   c += name[--len];
-   c = c % count;
-   return c;
-}
-
-static int lmv_nid_policy(struct lmv_obd *lmv)
-{
-   struct obd_import *imp;
-   __u32 id;
-
-   /*
-* XXX: To get nid we assume that underlying obd device is mdc.
-*/
-   imp = class_exp2cliimp(lmv->tgts[0].ltd_exp);
-   id = imp->imp_connection->c_self ^ (imp->imp_connection->c_self >> 32);
-   return id % lmv->desc.ld_tgt_count;
-}
-
-static int lmv_choose_mds(struct lmv_obd *lmv, struct md_op_data *op_data,
- enum placement_policy placement)
-{
-   switch (placement) {
-   case PLACEMENT_CHAR_POLICY:
-   return lmv_all_chars_policy(lmv->desc.ld_tgt_count,
-   op_data->op_name,
-   op_data->op_namelen);
-   case PLACEMENT_NID_POLICY:
-   return lmv_nid_policy(lmv);
-
-   default:
-   break;
-   }
-
-   CERROR("Unsupported placement policy %x\n", placement);
-   return -EINVAL;
-}
-#endif
-
 /**
  * This is _inode_ placement policy function (not name).
  */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 27/84] staging/lustre: Remove FSF mailing address from GPL notices

2016-02-24 Thread green
From: Oleg Drokin 

This patch removes remaining several places that still had that
extra paragraph included in Lustre code.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h  | 5 -
 drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h | 5 -
 drivers/staging/lustre/lnet/lnet/lib-ptl.c| 5 -
 drivers/staging/lustre/lustre/obdecho/echo_internal.h | 5 -
 drivers/staging/lustre/lustre/osc/osc_quota.c | 5 -
 5 files changed, 25 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
index 1530b04..9e62c59 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
@@ -13,11 +13,6 @@
  * General Public License version 2 for more details (a copy is included
  * in the LICENSE file that accompanied this code).
  *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA
- *
  * GPL HEADER END
  */
 /*
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h 
b/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h
index 520209f..c04979a 100644
--- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h
+++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h
@@ -13,11 +13,6 @@
  * General Public License version 2 for more details (a copy is included
  * in the LICENSE file that accompanied this code).
  *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA
- *
  * GPL HEADER END
  */
 /*
diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c 
b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
index 5a9ab87..0281c6a 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
@@ -13,11 +13,6 @@
  * General Public License version 2 for more details (a copy is included
  * in the LICENSE file that accompanied this code).
  *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA
- *
  * GPL HEADER END
  */
 /*
diff --git a/drivers/staging/lustre/lustre/obdecho/echo_internal.h 
b/drivers/staging/lustre/lustre/obdecho/echo_internal.h
index 69063fa..f5034a2 100644
--- a/drivers/staging/lustre/lustre/obdecho/echo_internal.h
+++ b/drivers/staging/lustre/lustre/obdecho/echo_internal.h
@@ -13,11 +13,6 @@
  * General Public License version 2 for more details (a copy is included
  * in the LICENSE file that accompanied this code).
  *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA
- *
  * GPL HEADER END
  */
 /*
diff --git a/drivers/staging/lustre/lustre/osc/osc_quota.c 
b/drivers/staging/lustre/lustre/osc/osc_quota.c
index d6731c5..508fcf2 100644
--- a/drivers/staging/lustre/lustre/osc/osc_quota.c
+++ b/drivers/staging/lustre/lustre/osc/osc_quota.c
@@ -13,11 +13,6 @@
  * General Public License version 2 for more details (a copy is included
  * in the LICENSE file that accompanied this code).
  *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA
- *
  * GPL HEADER END
  */
 /*
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 11/84] staging/lustre: Remove ldlm type/mode typedefs

2016-02-24 Thread green
From: Oleg Drokin 

Replace ldlm_mode_t with enum ldlm_mode,
ldlm_type_t with enum ldlm_type

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 14 
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 39 --
 drivers/staging/lustre/lustre/include/lustre_net.h |  2 +-
 drivers/staging/lustre/lustre/include/obd.h| 10 +++---
 drivers/staging/lustre/lustre/include/obd_class.h  | 14 
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c   |  2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c|  4 +--
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h |  2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c  |  2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 28 
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |  7 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |  3 +-
 drivers/staging/lustre/lustre/llite/dir.c  |  2 +-
 drivers/staging/lustre/lustre/llite/file.c | 19 ++-
 .../staging/lustre/lustre/llite/llite_internal.h   |  8 ++---
 drivers/staging/lustre/lustre/llite/llite_lib.c|  2 +-
 drivers/staging/lustre/lustre/llite/xattr_cache.c  |  2 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c| 17 ++
 drivers/staging/lustre/lustre/mdc/mdc_internal.h   | 12 +++
 drivers/staging/lustre/lustre/mdc/mdc_locks.c  | 14 
 drivers/staging/lustre/lustre/mdc/mdc_reint.c  |  2 +-
 .../staging/lustre/lustre/osc/osc_cl_internal.h|  4 +--
 drivers/staging/lustre/lustre/osc/osc_request.c|  8 ++---
 23 files changed, 114 insertions(+), 103 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 938f91b..d3fb6f9 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2687,7 +2687,7 @@ static inline int ldlm_res_eq(const struct ldlm_res_id 
*res0,
 }
 
 /* lock types */
-typedef enum {
+enum ldlm_mode {
LCK_MINMODE = 0,
LCK_EX  = 1,
LCK_PW  = 2,
@@ -2698,17 +2698,17 @@ typedef enum {
LCK_GROUP   = 64,
LCK_COS = 128,
LCK_MAXMODE
-} ldlm_mode_t;
+};
 
 #define LCK_MODE_NUM8
 
-typedef enum {
+enum ldlm_type {
LDLM_PLAIN = 10,
LDLM_EXTENT= 11,
LDLM_FLOCK = 12,
LDLM_IBITS = 13,
LDLM_MAX_TYPE
-} ldlm_type_t;
+};
 
 #define LDLM_MIN_TYPE LDLM_PLAIN
 
@@ -2768,15 +2768,15 @@ struct ldlm_intent {
 void lustre_swab_ldlm_intent(struct ldlm_intent *i);
 
 struct ldlm_resource_desc {
-   ldlm_type_t lr_type;
+   enum ldlm_type lr_type;
__u32 lr_padding;   /* also fix lustre_swab_ldlm_resource_desc */
struct ldlm_res_id lr_name;
 };
 
 struct ldlm_lock_desc {
struct ldlm_resource_desc l_resource;
-   ldlm_mode_t l_req_mode;
-   ldlm_mode_t l_granted_mode;
+   enum ldlm_mode l_req_mode;
+   enum ldlm_mode l_granted_mode;
ldlm_wire_policy_data_t l_policy_data;
 };
 
diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 4aeaac9..87806a6 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -145,14 +145,15 @@ typedef enum {
 #define LCK_COMPAT_COS (LCK_COS)
 /** @} Lock Compatibility Matrix */
 
-extern ldlm_mode_t lck_compat_array[];
+extern enum ldlm_mode lck_compat_array[];
 
-static inline void lockmode_verify(ldlm_mode_t mode)
+static inline void lockmode_verify(enum ldlm_mode mode)
 {
LASSERT(mode > LCK_MINMODE && mode < LCK_MAXMODE);
 }
 
-static inline int lockmode_compat(ldlm_mode_t exist_mode, ldlm_mode_t new_mode)
+static inline int lockmode_compat(enum ldlm_mode exist_mode,
+ enum ldlm_mode new_mode)
 {
return (lck_compat_array[exist_mode] & new_mode);
 }
@@ -524,7 +525,7 @@ struct ldlm_interval {
 struct ldlm_interval_tree {
/** Tree size. */
int lit_size;
-   ldlm_mode_t lit_mode;  /* lock mode */
+   enum ldlm_mode  lit_mode;  /* lock mode */
struct interval_node*lit_root; /* actual ldlm_interval */
 };
 
@@ -556,7 +557,7 @@ typedef union {
struct ldlm_inodebits l_inodebits;
 } ldlm_policy_data_t;
 
-void ldlm_convert_policy_to_local(struct obd_export *exp, ldlm_type_t type,
+void ldlm_convert_policy_to_local(struct obd_export *exp, enum ldlm_type type,
  const ldlm_wire_policy_data_t *wpolicy,
  ldlm_policy_data_t *lpolicy);
 
@@ -634,11 +635,11 @@ struct ldlm_lock {
 * Requested mode.
 * Protected by lr_lock.
 */
-   ldlm_mode_t l_req_mode;
+   enum ldlm_mode  l_req_mode;
/**
 * Granted mode

[PATCH v2 30/84] staging/lustre: Remove duplicated quota defines

2016-02-24 Thread green
From: Oleg Drokin 

QUOTABLOCK_BITS, QUOTABLOCK_SIZE and toqb are only used on the server
and are copied from kernel code anyway.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 12 
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c   |  5 -
 2 files changed, 17 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 26f1c43..ccb1b85 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -1778,18 +1778,6 @@ void lustre_swab_ost_lvb(struct ost_lvb *lvb);
  *   lquota data structures
  */
 
-#ifndef QUOTABLOCK_BITS
-#define QUOTABLOCK_BITS 10
-#endif
-
-#ifndef QUOTABLOCK_SIZE
-#define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS)
-#endif
-
-#ifndef toqb
-#define toqb(x) (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS)
-#endif
-
 /* The lquota_id structure is an union of all the possible identifier types 
that
  * can be used with quota, this includes:
  * - 64-bit user ID
diff --git a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c 
b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
index 3f9acc2..799a85ac 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
@@ -1507,11 +1507,6 @@ void lustre_assert_wire_constants(void)
LASSERTF((int)sizeof(union lquota_id) == 16, "found %lld\n",
 (long long)(int)sizeof(union lquota_id));
 
-   LASSERTF(QUOTABLOCK_BITS == 10, "found %lld\n",
-(long long)QUOTABLOCK_BITS);
-   LASSERTF(QUOTABLOCK_SIZE == 1024, "found %lld\n",
-(long long)QUOTABLOCK_SIZE);
-
/* Checks for struct obd_quotactl */
LASSERTF((int)sizeof(struct obd_quotactl) == 112, "found %lld\n",
 (long long)(int)sizeof(struct obd_quotactl));
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 31/84] staging/lustre: Remove unused struct quota_body

2016-02-24 Thread green
From: Oleg Drokin 

It's only used for communications between servers.

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 31 ---
 .../lustre/lustre/include/lustre_req_layout.h  |  3 --
 drivers/staging/lustre/lustre/ptlrpc/layout.c  | 36 --
 .../staging/lustre/lustre/ptlrpc/pack_generic.c| 10 -
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c| 44 --
 5 files changed, 124 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index ccb1b85..607bfde 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -1819,37 +1819,6 @@ do { \
Q_COPY(out, in, qc_dqblk);  \
 } while (0)
 
-/* Body of quota request used for quota acquire/release RPCs between quota
- * master (aka QMT) and slaves (ak QSD). */
-struct quota_body {
-   struct lu_fid   qb_fid; /* FID of global index packing the pool ID
- * and type (data or metadata) as well as
- * the quota type (user or group). */
-   union lquota_id qb_id;  /* uid or gid or directory FID */
-   __u32   qb_flags;   /* see below */
-   __u32   qb_padding;
-   __u64   qb_count;   /* acquire/release count (kbytes/inodes) */
-   __u64   qb_usage;   /* current slave usage (kbytes/inodes) */
-   __u64   qb_slv_ver; /* slave index file version */
-   struct lustre_handleqb_lockh; /* per-ID lock handle */
-   struct lustre_handleqb_glb_lockh; /* global lock handle */
-   __u64   qb_padding1[4];
-};
-
-/* When the quota_body is used in the reply of quota global intent
- * lock (IT_QUOTA_CONN) reply, qb_fid contains slave index file FID. */
-#define qb_slv_fid qb_fid
-/* qb_usage is the current qunit (in kbytes/inodes) when quota_body is used in
- * quota reply */
-#define qb_qunit   qb_usage
-
-#define QUOTA_DQACQ_FL_ACQ 0x1  /* acquire quota */
-#define QUOTA_DQACQ_FL_PREACQ  0x2  /* pre-acquire */
-#define QUOTA_DQACQ_FL_REL 0x4  /* release quota */
-#define QUOTA_DQACQ_FL_REPORT  0x8  /* report usage */
-
-void lustre_swab_quota_body(struct quota_body *b);
-
 /* Quota types currently supported */
 enum {
LQUOTA_TYPE_USR = 0x00, /* maps to USRQUOTA */
diff --git a/drivers/staging/lustre/lustre/include/lustre_req_layout.h 
b/drivers/staging/lustre/lustre/include/lustre_req_layout.h
index b8a83a1..fdcdd7a 100644
--- a/drivers/staging/lustre/lustre/include/lustre_req_layout.h
+++ b/drivers/staging/lustre/lustre/include/lustre_req_layout.h
@@ -176,7 +176,6 @@ extern struct req_format RQF_MDS_REINT_SETXATTR;
 extern struct req_format RQF_MDS_QUOTACHECK;
 extern struct req_format RQF_MDS_QUOTACTL;
 extern struct req_format RQF_QC_CALLBACK;
-extern struct req_format RQF_QUOTA_DQACQ;
 extern struct req_format RQF_MDS_SWAP_LAYOUTS;
 /* MDS hsm formats */
 extern struct req_format RQF_MDS_HSM_STATE_GET;
@@ -219,7 +218,6 @@ extern struct req_format RQF_LDLM_INTENT_OPEN;
 extern struct req_format RQF_LDLM_INTENT_CREATE;
 extern struct req_format RQF_LDLM_INTENT_UNLINK;
 extern struct req_format RQF_LDLM_INTENT_GETXATTR;
-extern struct req_format RQF_LDLM_INTENT_QUOTA;
 extern struct req_format RQF_LDLM_CANCEL;
 extern struct req_format RQF_LDLM_CALLBACK;
 extern struct req_format RQF_LDLM_CP_CALLBACK;
@@ -276,7 +274,6 @@ extern struct req_msg_field RMF_CAPA1;
 extern struct req_msg_field RMF_CAPA2;
 extern struct req_msg_field RMF_OBD_QUOTACHECK;
 extern struct req_msg_field RMF_OBD_QUOTACTL;
-extern struct req_msg_field RMF_QUOTA_BODY;
 extern struct req_msg_field RMF_STRING;
 extern struct req_msg_field RMF_SWAP_LAYOUTS;
 extern struct req_msg_field RMF_MDS_HSM_PROGRESS;
diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c 
b/drivers/staging/lustre/lustre/ptlrpc/layout.c
index aff9bf5..715088f 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/layout.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c
@@ -118,25 +118,6 @@ static const struct req_msg_field *quotactl_only[] = {
&RMF_OBD_QUOTACTL
 };
 
-static const struct req_msg_field *quota_body_only[] = {
-   &RMF_PTLRPC_BODY,
-   &RMF_QUOTA_BODY
-};
-
-static const struct req_msg_field *ldlm_intent_quota_client[] = {
-   &RMF_PTLRPC_BODY,
-   &RMF_DLM_REQ,
-   &RMF_LDLM_INTENT,
-   &RMF_QUOTA_BODY
-};
-
-static const struct req_msg_field *ldlm_intent_quota_server[] = {
-   &RMF_PTLRPC_BODY,
-   &RMF_DLM_REP,
-   &RMF_DLM_LVB,
-   &RMF_QUOTA_BODY
-};
-
 static const struct req_msg_field *mdt_close_client[] = {
&RMF_PTLRPC_BODY,
&RMF_MDT_EPOCH,
@@ -748,8 +729,6 @@ static struct req_format *req_formats[] = {
&RQF_LDLM_INTENT_CREATE,
&RQF_

[PATCH v2 29/84] staging/lustre: Remove *_CONNECT_SUPPORTED defines

2016-02-24 Thread green
From: Oleg Drokin 

These defines are only used on the servers to determine
what connect flags corresponding servers support:
MDT_CONNECT_SUPPORTED
OST_CONNECT_SUPPORTED
MGS_CONNECT_SUPPORTED
ECHO_CONNECT_SUPPORTED

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 50 ++
 1 file changed, 4 insertions(+), 46 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index eeb0542..26f1c43 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -1248,61 +1248,19 @@ void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
  * submit a small patch against EVERY branch that ONLY adds the new flag,
  * updates obd_connect_names[] for lprocfs_rd_connect_flags(), adds the
  * flag to check_obd_connect_data(), and updates wiretests accordingly, so it
- * can be approved and landed easily to reserve the flag for future use. */
+ * can be approved and landed easily to reserve the flag for future use.
+ */
 
 /* The MNE_SWAB flag is overloading the MDS_MDS bit only for the MGS
  * connection.  It is a temporary bug fix for Imperative Recovery interop
  * between 2.2 and 2.3 x86/ppc nodes, and can be removed when interop for
- * 2.2 clients/servers is no longer needed.  LU-1252/LU-1644. */
+ * 2.2 clients/servers is no longer needed.  LU-1252/LU-1644.
+ */
 #define OBD_CONNECT_MNE_SWABOBD_CONNECT_MDS_MDS
 
 #define OCD_HAS_FLAG(ocd, flg)  \
(!!((ocd)->ocd_connect_flags & OBD_CONNECT_##flg))
 
-#define LRU_RESIZE_CONNECT_FLAG OBD_CONNECT_LRU_RESIZE
-
-#define MDT_CONNECT_SUPPORTED  (OBD_CONNECT_RDONLY | OBD_CONNECT_VERSION | \
-   OBD_CONNECT_ACL | OBD_CONNECT_XATTR | \
-   OBD_CONNECT_IBITS | \
-   OBD_CONNECT_NODEVOH | OBD_CONNECT_ATTRFID | \
-   OBD_CONNECT_CANCELSET | OBD_CONNECT_AT | \
-   OBD_CONNECT_RMT_CLIENT | \
-   OBD_CONNECT_RMT_CLIENT_FORCE | \
-   OBD_CONNECT_BRW_SIZE | OBD_CONNECT_MDS_CAPA | \
-   OBD_CONNECT_OSS_CAPA | OBD_CONNECT_MDS_MDS | \
-   OBD_CONNECT_FID | LRU_RESIZE_CONNECT_FLAG | \
-   OBD_CONNECT_VBR | OBD_CONNECT_LOV_V3 | \
-   OBD_CONNECT_SOM | OBD_CONNECT_FULL20 | \
-   OBD_CONNECT_64BITHASH | OBD_CONNECT_JOBSTATS | \
-   OBD_CONNECT_EINPROGRESS | \
-   OBD_CONNECT_LIGHTWEIGHT | OBD_CONNECT_UMASK | \
-   OBD_CONNECT_LVB_TYPE | OBD_CONNECT_LAYOUTLOCK |\
-   OBD_CONNECT_PINGLESS | OBD_CONNECT_MAX_EASIZE |\
-   OBD_CONNECT_FLOCK_DEAD | \
-   OBD_CONNECT_DISP_STRIPE)
-
-#define OST_CONNECT_SUPPORTED  (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \
-   OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \
-   OBD_CONNECT_TRUNCLOCK | OBD_CONNECT_INDEX | \
-   OBD_CONNECT_BRW_SIZE | OBD_CONNECT_OSS_CAPA | \
-   OBD_CONNECT_CANCELSET | OBD_CONNECT_AT | \
-   LRU_RESIZE_CONNECT_FLAG | OBD_CONNECT_CKSUM | \
-   OBD_CONNECT_RMT_CLIENT | \
-   OBD_CONNECT_RMT_CLIENT_FORCE | OBD_CONNECT_VBR 
| \
-   OBD_CONNECT_MDS | OBD_CONNECT_SKIP_ORPHAN | \
-   OBD_CONNECT_GRANT_SHRINK | OBD_CONNECT_FULL20 | 
\
-   OBD_CONNECT_64BITHASH | OBD_CONNECT_MAXBYTES | \
-   OBD_CONNECT_MAX_EASIZE | \
-   OBD_CONNECT_EINPROGRESS | \
-   OBD_CONNECT_JOBSTATS | \
-   OBD_CONNECT_LIGHTWEIGHT | OBD_CONNECT_LVB_TYPE|\
-   OBD_CONNECT_LAYOUTLOCK | OBD_CONNECT_FID | \
-   OBD_CONNECT_PINGLESS)
-#define ECHO_CONNECT_SUPPORTED (0)
-#define MGS_CONNECT_SUPPORTED  (OBD_CONNECT_VERSION | OBD_CONNECT_AT | \
-   OBD_CONNECT_FULL20 | OBD_CONNECT_IMP_RECOV | \
-   OBD_CONNECT_MNE_SWAB | OBD_CONNECT_PINGLESS)
-
 /* Features required for this version of the client to work with server */
 #define CLIENT_CONNECT_MDT_REQD (OBD_CONNECT_IBITS | OBD_CONNECT_FID | \
 OBD_CONNECT_FULL20)
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 25/84] staging/lustre: Get rid of C99 comments in lustre_idl.h

2016-02-24 Thread green
From: Oleg Drokin 

lustre_idl.h contains various protocol data. In order to avoid
reusal of values that might have meant something else in the past,
the old no longer used values are commented out, convert the
comments into regular comments from C99 where appropriate.

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h| 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 4188402..90ff181 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -113,25 +113,25 @@
 
 #define CONNMGR_REQUEST_PORTAL   1
 #define CONNMGR_REPLY_PORTAL   2
-//#define OSC_REQUEST_PORTAL   3
+/*#define OSC_REQUEST_PORTAL   3 */
 #define OSC_REPLY_PORTAL   4
-//#define OSC_BULK_PORTAL 5
+/*#define OSC_BULK_PORTAL 5 */
 #define OST_IO_PORTAL 6
 #define OST_CREATE_PORTAL 7
 #define OST_BULK_PORTAL 8
-//#define MDC_REQUEST_PORTAL   9
+/*#define MDC_REQUEST_PORTAL   9 */
 #define MDC_REPLY_PORTAL  10
-//#define MDC_BULK_PORTAL11
+/*#define MDC_BULK_PORTAL11 */
 #define MDS_REQUEST_PORTAL  12
-//#define MDS_REPLY_PORTAL  13
+/*#define MDS_REPLY_PORTAL  13 */
 #define MDS_BULK_PORTAL14
 #define LDLM_CB_REQUEST_PORTAL  15
 #define LDLM_CB_REPLY_PORTAL  16
 #define LDLM_CANCEL_REQUEST_PORTAL 17
 #define LDLM_CANCEL_REPLY_PORTAL   18
-//#define PTLBD_REQUEST_PORTAL19
-//#define PTLBD_REPLY_PORTAL20
-//#define PTLBD_BULK_PORTAL  21
+/*#define PTLBD_REQUEST_PORTAL19 */
+/*#define PTLBD_REPLY_PORTAL20 */
+/*#define PTLBD_BULK_PORTAL  21 */
 #define MDS_SETATTR_PORTAL  22
 #define MDS_READPAGE_PORTAL23
 #define OUT_PORTAL 24
@@ -1187,7 +1187,7 @@ void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
 #define MSG_CONNECT_RECOVERING  0x0001
 #define MSG_CONNECT_RECONNECT   0x0002
 #define MSG_CONNECT_REPLAYABLE  0x0004
-//#define MSG_CONNECT_PEER 0x8
+/*#define MSG_CONNECT_PEER 0x8 */
 #define MSG_CONNECT_LIBCLIENT   0x0010
 #define MSG_CONNECT_INITIAL 0x0020
 #define MSG_CONNECT_ASYNC   0x0040
@@ -2066,7 +2066,7 @@ enum mdt_reint_cmd {
REINT_OPEN = 6,
REINT_SETXATTR = 7,
REINT_RMENTRY  = 8,
-//  REINT_WRITE= 9,
+/*  REINT_WRITE= 9, */
REINT_MAX
 };
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 24/84] staging/lustre: Remove lustre_build_version.h

2016-02-24 Thread green
From: Oleg Drokin 

of the two macroses is contained the LUSTRE_RELEASE was unused and
BUILD_VERSION is too generically named and was replaced with
LUSTRE_VERSION_STRING with all the users (provided by lustre_ver.h)

With in-kernel client the build version should be combined with
kernel build information anyway.

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_build_version.h   |  2 --
 drivers/staging/lustre/lustre/obdclass/class_obd.c| 11 +--
 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c   |  1 -
 3 files changed, 5 insertions(+), 9 deletions(-)
 delete mode 100644 
drivers/staging/lustre/lustre/include/lustre/lustre_build_version.h

diff --git 
a/drivers/staging/lustre/lustre/include/lustre/lustre_build_version.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_build_version.h
deleted file mode 100644
index 93a3d7d..000
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_build_version.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#define BUILD_VERSION "v2_3_64_0-g6e62c21-CHANGED-3.9.0"
-#define LUSTRE_RELEASE 3.9.0_g6e62c21
diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c 
b/drivers/staging/lustre/lustre/obdclass/class_obd.c
index 4b7e21f..f805693 100644
--- a/drivers/staging/lustre/lustre/obdclass/class_obd.c
+++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c
@@ -42,7 +42,6 @@
 #include "../../include/linux/lnet/lnetctl.h"
 #include "../include/lustre_debug.h"
 #include "../include/lprocfs_status.h"
-#include "../include/lustre/lustre_build_version.h"
 #include 
 #include "../include/cl_object.h"
 #include "llog_internal.h"
@@ -218,14 +217,14 @@ int class_handle_ioctl(unsigned int cmd, unsigned long 
arg)
goto out;
}
 
-   if (strlen(BUILD_VERSION) + 1 > data->ioc_inllen1) {
+   if (strlen(LUSTRE_VERSION_STRING) + 1 > data->ioc_inllen1) {
CERROR("ioctl buffer too small to hold version\n");
err = -EINVAL;
goto out;
}
 
-   memcpy(data->ioc_bulk, BUILD_VERSION,
-  strlen(BUILD_VERSION) + 1);
+   memcpy(data->ioc_bulk, LUSTRE_VERSION_STRING,
+  strlen(LUSTRE_VERSION_STRING) + 1);
 
err = obd_ioctl_popdata((void __user *)arg, data, len);
if (err)
@@ -481,7 +480,7 @@ static int __init init_obdclass(void)
 
int lustre_register_fs(void);
 
-   LCONSOLE_INFO("Lustre: Build Version: "BUILD_VERSION"\n");
+   LCONSOLE_INFO("Lustre: Build Version: " LUSTRE_VERSION_STRING "\n");
 
spin_lock_init(&obd_types_lock);
obd_zombie_impexp_init();
@@ -579,7 +578,7 @@ static void cleanup_obdclass(void)
 }
 
 MODULE_AUTHOR("OpenSFS, Inc. ");
-MODULE_DESCRIPTION("Lustre Class Driver Build Version: " BUILD_VERSION);
+MODULE_DESCRIPTION("Lustre Class Driver Build Version: " 
LUSTRE_VERSION_STRING);
 MODULE_LICENSE("GPL");
 MODULE_VERSION(LUSTRE_VERSION_STRING);
 
diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 689f33a..f3c4a17 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -70,7 +70,6 @@
 #include "../../include/obd_class.h"
 #include "../../include/lprocfs_status.h"
 #include "../../include/lustre_ver.h"
-#include "../../include/lustre/lustre_build_version.h"
 
 /* buffer MUST be at least the size of obd_ioctl_hdr */
 int obd_ioctl_getdata(char **buf, int *len, void __user *arg)
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 70/84] staging/lustre: MS_POSIXACL is always defined, don't check for it

2016-02-24 Thread green
From: Oleg Drokin 

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 5b155b2..db9072c 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -309,15 +309,11 @@ static int client_common_fill_super(struct super_block 
*sb, char *md, char *dt,
}
 
if (data->ocd_connect_flags & OBD_CONNECT_ACL) {
-#ifdef MS_POSIXACL
sb->s_flags |= MS_POSIXACL;
-#endif
sbi->ll_flags |= LL_SBI_ACL;
} else {
LCONSOLE_INFO("client wants to enable acl, but mdt not!\n");
-#ifdef MS_POSIXACL
sb->s_flags &= ~MS_POSIXACL;
-#endif
sbi->ll_flags &= ~LL_SBI_ACL;
}
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 65/84] staging/lustre: Convert ptlrpc_at_check_timed to void

2016-02-24 Thread green
From: Oleg Drokin 

The only caller was not looking at the return value,
and liblustre, that cared about it is not part of the kernel client.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ptlrpc/service.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c 
b/drivers/staging/lustre/lustre/ptlrpc/service.c
index 6f71ecc..89039bf 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/service.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/service.c
@@ -1137,7 +1137,7 @@ out_free:
 /* Send early replies to everybody expiring within at_early_margin
  * asking for at_extra time
  */
-static int ptlrpc_at_check_timed(struct ptlrpc_service_part *svcpt)
+static void ptlrpc_at_check_timed(struct ptlrpc_service_part *svcpt)
 {
struct ptlrpc_at_array *array = &svcpt->scp_at_array;
struct ptlrpc_request *rq, *n;
@@ -1151,14 +1151,14 @@ static int ptlrpc_at_check_timed(struct 
ptlrpc_service_part *svcpt)
spin_lock(&svcpt->scp_at_lock);
if (svcpt->scp_at_check == 0) {
spin_unlock(&svcpt->scp_at_lock);
-   return 0;
+   return;
}
delay = cfs_time_sub(cfs_time_current(), svcpt->scp_at_checktime);
svcpt->scp_at_check = 0;
 
if (array->paa_count == 0) {
spin_unlock(&svcpt->scp_at_lock);
-   return 0;
+   return;
}
 
/* The timer went off, but maybe the nearest rpc already completed. */
@@ -1167,7 +1167,7 @@ static int ptlrpc_at_check_timed(struct 
ptlrpc_service_part *svcpt)
/* We've still got plenty of time.  Reset the timer. */
ptlrpc_at_set_timer(svcpt);
spin_unlock(&svcpt->scp_at_lock);
-   return 0;
+   return;
}
 
/* We're close to a timeout, and we don't know how much longer the
@@ -1237,8 +1237,6 @@ static int ptlrpc_at_check_timed(struct 
ptlrpc_service_part *svcpt)
 
ptlrpc_server_drop_request(rq);
}
-
-   return 1; /* return "did_something" for liblustre */
 }
 
 /**
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 71/84] staging/lustre: Remove RELEASEPAGE_ARG_TYPE compat macro

2016-02-24 Thread green
From: Oleg Drokin 

Not used in the kernel proper.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/rw26.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/rw26.c 
b/drivers/staging/lustre/lustre/llite/rw26.c
index 64110c5..6a5762e 100644
--- a/drivers/staging/lustre/lustre/llite/rw26.c
+++ b/drivers/staging/lustre/lustre/llite/rw26.c
@@ -109,12 +109,7 @@ static void ll_invalidatepage(struct page *vmpage, 
unsigned int offset,
}
 }
 
-#ifdef HAVE_RELEASEPAGE_WITH_INT
-#define RELEASEPAGE_ARG_TYPE int
-#else
-#define RELEASEPAGE_ARG_TYPE gfp_t
-#endif
-static int ll_releasepage(struct page *vmpage, RELEASEPAGE_ARG_TYPE gfp_mask)
+static int ll_releasepage(struct page *vmpage, gfp_t gfp_mask)
 {
struct cl_env_nest nest;
struct lu_env *env;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 69/84] staging/lustre: F_SETLKW64 F_SETLK64 F_GETLK64 are always defined

2016-02-24 Thread green
From: Oleg Drokin 

Remove the ifdefs for the around usage.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/file.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index 477dc0e..2e30c52 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -2746,21 +2746,15 @@ ll_file_flock(struct file *file, int cmd, struct 
file_lock *file_lock)
 
switch (cmd) {
case F_SETLKW:
-#ifdef F_SETLKW64
case F_SETLKW64:
-#endif
flags = 0;
break;
case F_SETLK:
-#ifdef F_SETLK64
case F_SETLK64:
-#endif
flags = LDLM_FL_BLOCK_NOWAIT;
break;
case F_GETLK:
-#ifdef F_GETLK64
case F_GETLK64:
-#endif
flags = LDLM_FL_TEST_LOCK;
/* Save the old mode so that if the mode in the lock changes we
 * can decrement the appropriate reader or writer refcount.
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 26/84] staging/lustre: Remove server-side changelog defines

2016-02-24 Thread green
From: Oleg Drokin 

CHANGELOG_MAGIC, CHANGELOG_MINMASK, CHANGELOG_ALLMASK,
CHANGELOG_DEFMASK and CHANGELOG_USER_PREFIX are all unused
on the client.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 11 ---
 1 file changed, 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 90ff181..d2f05e3 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -3039,15 +3039,6 @@ struct llog_size_change_rec {
struct llog_rec_taillsc_tail;
 } __packed;
 
-#define CHANGELOG_MAGIC 0xca103000
-
-/** \a changelog_rec_type's that can't be masked */
-#define CHANGELOG_MINMASK (1 << CL_MARK)
-/** bits covering all \a changelog_rec_type's */
-#define CHANGELOG_ALLMASK 0X
-/** default \a changelog_rec_type mask */
-#define CHANGELOG_DEFMASK CHANGELOG_ALLMASK & ~(1 << CL_ATIME | 1 << CL_CLOSE)
-
 /* changelog llog name, needed by client replicators */
 #define CHANGELOG_CATALOG "changelog_catalog"
 
@@ -3069,8 +3060,6 @@ struct llog_changelog_ext_rec {
struct llog_rec_tail cr_tail; /**< for_sizezof_only */
 } __packed;
 
-#define CHANGELOG_USER_PREFIX "cl"
-
 struct llog_changelog_user_rec {
struct llog_rec_hdr   cur_hdr;
__u32cur_id;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 28/84] staging/lustre: Remove server-only values from enum lu_dirent_attrs

2016-02-24 Thread green
From: Oleg Drokin 

These values cannot be seen on the client so we probably should
not even be aware of them on the client.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lustre/lustre_idl.h| 16 
 1 file changed, 16 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index d2f05e3..eeb0542 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -880,24 +880,8 @@ enum lu_dirent_attrs {
LUDA_FID= 0x0001,
LUDA_TYPE   = 0x0002,
LUDA_64BITHASH  = 0x0004,
-
-   /* The following attrs are used for MDT internal only,
-* not visible to client */
-
-   /* Verify the dirent consistency */
-   LUDA_VERIFY = 0x8000,
-   /* Only check but not repair the dirent inconsistency */
-   LUDA_VERIFY_DRYRUN  = 0x4000,
-   /* The dirent has been repaired, or to be repaired (dryrun). */
-   LUDA_REPAIR = 0x2000,
-   /* The system is upgraded, has beed or to be repaired (dryrun). */
-   LUDA_UPGRADE= 0x1000,
-   /* Ignore this record, go to next directly. */
-   LUDA_IGNORE = 0x0800,
 };
 
-#define LU_DIRENT_ATTRS_MASK   0xf800
-
 /**
  * Layout of readdir pages, as transmitted on wire.
  */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 67/84] staging/lustre: Remove liblustre references from explanations

2016-02-24 Thread green
From: Oleg Drokin 

Since liblustre is no longer with us, referencing to it in the
explanations only makes things less clear

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/cl_object.h   | 4 ++--
 drivers/staging/lustre/lustre/include/lustre_lite.h | 2 +-
 drivers/staging/lustre/lustre/include/obd.h | 2 +-
 drivers/staging/lustre/lustre/obdclass/cl_object.c  | 1 -
 drivers/staging/lustre/lustre/osc/osc_lock.c| 3 +--
 5 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/cl_object.h 
b/drivers/staging/lustre/lustre/include/cl_object.h
index 4b3055d..fb971de 100644
--- a/drivers/staging/lustre/lustre/include/cl_object.h
+++ b/drivers/staging/lustre/lustre/include/cl_object.h
@@ -697,7 +697,7 @@ enum cl_page_type {
 
/** Transient page, the transient cl_page is used to bind a cl_page
 *  to vmpage which is not belonging to the same object of cl_page.
-*  it is used in DirectIO, lockless IO and liblustre.
+*  it is used in DirectIO and lockless IO.
 */
CPT_TRANSIENT,
 };
@@ -2282,7 +2282,7 @@ enum cl_io_lock_dmd {
CILR_MANDATORY = 0,
/** Layers are free to decide between local and global locking. */
CILR_MAYBE,
-   /** Never lock: there is no cache (e.g., liblustre). */
+   /** Never lock: there is no cache (e.g., lockless IO). */
CILR_NEVER
 };
 
diff --git a/drivers/staging/lustre/lustre/include/lustre_lite.h 
b/drivers/staging/lustre/lustre/include/lustre_lite.h
index 9852325..fcc5ebb 100644
--- a/drivers/staging/lustre/lustre/include/lustre_lite.h
+++ b/drivers/staging/lustre/lustre/include/lustre_lite.h
@@ -54,7 +54,7 @@
 #define LL_MAX_BLKSIZE   (1UL

[PATCH v2 63/84] staging/lustre: Remove unused liblustre_check_services prototype

2016-02-24 Thread green
From: Oleg Drokin 

liblustre_check_services is no longer present in the tree.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_net.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h 
b/drivers/staging/lustre/lustre/include/lustre_net.h
index b857055..4fa1a18 100644
--- a/drivers/staging/lustre/lustre/include/lustre_net.h
+++ b/drivers/staging/lustre/lustre/include/lustre_net.h
@@ -2515,7 +2515,6 @@ struct ptlrpc_service *ptlrpc_register_service(struct 
ptlrpc_service_conf *conf,
 
 int ptlrpc_start_threads(struct ptlrpc_service *svc);
 int ptlrpc_unregister_service(struct ptlrpc_service *service);
-int liblustre_check_services(void *arg);
 
 int ptlrpc_hr_init(void);
 void ptlrpc_hr_fini(void);
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 64/84] staging/lustre: Remove unused lustre_build_lock_params()

2016-02-24 Thread green
From: Oleg Drokin 

And also struct lustre_rw_params that is only referenced by it.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lustre_lite.h| 48 --
 1 file changed, 48 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_lite.h 
b/drivers/staging/lustre/lustre/include/lustre_lite.h
index f6d7aae..9852325 100644
--- a/drivers/staging/lustre/lustre/include/lustre_lite.h
+++ b/drivers/staging/lustre/lustre/include/lustre_lite.h
@@ -53,54 +53,6 @@
 #define LL_MAX_BLKSIZE_BITS (22)
 #define LL_MAX_BLKSIZE   (1ULlrp_brw_flags = 0;
-
-   params->lrp_policy.l_extent.start = pos;
-   params->lrp_policy.l_extent.end = pos + len - 1;
-   /*
-* for now O_APPEND always takes local locks.
-*/
-   if (cmd == OBD_BRW_WRITE && (open_flags & O_APPEND)) {
-   params->lrp_policy.l_extent.start = 0;
-   params->lrp_policy.l_extent.end   = OBD_OBJECT_EOF;
-   } else if (LIBLUSTRE_CLIENT && (connect_flags & OBD_CONNECT_SRVLOCK)) {
-   /*
-* liblustre: OST-side locking for all non-O_APPEND
-* reads/writes.
-*/
-   params->lrp_lock_mode = LCK_NL;
-   params->lrp_brw_flags = OBD_BRW_SRVLOCK;
-   } else {
-   /*
-* nothing special for the kernel. In the future llite may use
-* OST-side locks for small writes into highly contended
-* files.
-*/
-   }
-   params->lrp_ast_flags = (open_flags & O_NONBLOCK) ?
-   LDLM_FL_BLOCK_NOWAIT : 0;
-}
-
 /*
  * This is embedded into liblustre and llite super-blocks to keep track of
  * connect flags (capabilities) supported by all imports given mount is
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 23/84] staging/lustre/llite: Get rid of se_stat_t typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace it with enum se_stat

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/statahead.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/statahead.c 
b/drivers/staging/lustre/lustre/llite/statahead.c
index 4b215d3..db220f2 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -49,13 +49,13 @@
 
 #define SA_OMITTED_ENTRY_MAX 8ULL
 
-typedef enum {
+enum se_stat {
/** negative values are for error cases */
SA_ENTRY_INIT = 0,  /** init entry */
SA_ENTRY_SUCC = 1,  /** stat succeed */
SA_ENTRY_INVA = 2,  /** invalid entry */
SA_ENTRY_DEST = 3,  /** entry to be destroyed */
-} se_stat_t;
+};
 
 struct ll_sa_entry {
/* link into sai->sai_entries */
@@ -71,7 +71,7 @@ struct ll_sa_entry {
/* low layer ldlm lock handle */
__u64  se_handle;
/* entry status */
-   se_stat_t  se_stat;
+   enum se_stat   se_stat;
/* entry size, contains name */
int  se_size;
/* pointer to async getattr enqueue info */
@@ -366,7 +366,7 @@ ll_sa_entry_fini(struct ll_statahead_info *sai, struct 
ll_sa_entry *entry)
  */
 static void
 do_sa_entry_to_stated(struct ll_statahead_info *sai,
- struct ll_sa_entry *entry, se_stat_t stat)
+ struct ll_sa_entry *entry, enum se_stat stat)
 {
struct ll_sa_entry *se;
struct list_head *pos = &sai->sai_entries_stated;
@@ -392,7 +392,7 @@ do_sa_entry_to_stated(struct ll_statahead_info *sai,
  */
 static int
 ll_sa_entry_to_stated(struct ll_statahead_info *sai,
- struct ll_sa_entry *entry, se_stat_t stat)
+ struct ll_sa_entry *entry, enum se_stat stat)
 {
struct ll_inode_info *lli = ll_i2info(sai->sai_inode);
intret = 1;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 21/84] staging/lustre: Get rid of ldlm_ns_type_t typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace it with enum ldlm_ns_type

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 6 +++---
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c  | 2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 0f229b9..ab40bc7 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -318,7 +318,7 @@ enum {
LDLM_NSS_LAST
 };
 
-typedef enum {
+enum ldlm_ns_type {
/** invalid type */
LDLM_NS_TYPE_UNKNOWN= 0,
/** mdc namespace */
@@ -333,7 +333,7 @@ typedef enum {
LDLM_NS_TYPE_MGC,
/** mgs namespace */
LDLM_NS_TYPE_MGT,
-} ldlm_ns_type_t;
+};
 
 /**
  * LDLM Namespace.
@@ -1177,7 +1177,7 @@ void ldlm_unlink_lock_skiplist(struct ldlm_lock *req);
 struct ldlm_namespace *
 ldlm_namespace_new(struct obd_device *obd, char *name,
   ldlm_side_t client, enum ldlm_appetite apt,
-  ldlm_ns_type_t ns_type);
+  enum ldlm_ns_type ns_type);
 int ldlm_namespace_cleanup(struct ldlm_namespace *ns, __u64 flags);
 void ldlm_namespace_get(struct ldlm_namespace *ns);
 void ldlm_namespace_put(struct ldlm_namespace *ns);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
index c22370b..d0ad28d 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
@@ -241,7 +241,7 @@ int client_obd_setup(struct obd_device *obddev, struct 
lustre_cfg *lcfg)
struct obd_uuid server_uuid;
int rq_portal, rp_portal, connect_op;
char *name = obddev->obd_type->typ_name;
-   ldlm_ns_type_t ns_type = LDLM_NS_TYPE_UNKNOWN;
+   enum ldlm_ns_type ns_type = LDLM_NS_TYPE_UNKNOWN;
int rc;
 
/* In a more perfect world, we would hang a ptlrpc_client off of
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index 582cb21..9ab4452 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -554,7 +554,7 @@ static struct cfs_hash_ops ldlm_ns_fid_hash_ops = {
 };
 
 struct ldlm_ns_hash_def {
-   ldlm_ns_type_t  nsd_type;
+   enum ldlm_ns_type nsd_type;
/** hash bucket bits */
unsignednsd_bkt_bits;
/** hash bits */
@@ -622,7 +622,7 @@ static void ldlm_namespace_register(struct ldlm_namespace 
*ns,
 struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name,
  ldlm_side_t client,
  enum ldlm_appetite apt,
- ldlm_ns_type_t ns_type)
+ enum ldlm_ns_type ns_type)
 {
struct ldlm_namespace *ns = NULL;
struct ldlm_ns_bucket *nsb;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 18/84] staging/lustre: Get rid of lustre_quota_version typedef

2016-02-24 Thread green
From: Oleg Drokin 

Does not appear to be used anywhere.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
index a4765c2..57d42a3 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
@@ -566,9 +566,9 @@ enum {
 /* hdr + MDT index */
 #define LUSTRE_VOLATILE_IDXLUSTRE_VOLATILE_HDR":%.4X:"
 
-typedef enum lustre_quota_version {
+enum lustre_quota_version {
LUSTRE_QUOTA_V2 = 1
-} lustre_quota_version_t;
+};
 
 /* XXX: same as if_dqinfo struct in kernel */
 struct obd_dqinfo {
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 20/84] staging/lustre: Remove ldlm_appetite_t typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace it with enum ldlm_appetite

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 8 
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 924e68f..0f229b9 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -296,10 +296,10 @@ struct ldlm_valblock_ops {
  * LDLM pools related, type of lock pool in the namespace.
  * Greedy means release cached locks aggressively
  */
-typedef enum {
+enum ldlm_appetite {
LDLM_NAMESPACE_GREEDY = 1 << 0,
LDLM_NAMESPACE_MODEST = 1 << 1
-} ldlm_appetite_t;
+};
 
 struct ldlm_ns_bucket {
/** back pointer to namespace */
@@ -440,7 +440,7 @@ struct ldlm_namespace {
/** LDLM pool structure for this namespace */
struct ldlm_poolns_pool;
/** Definition of how eagerly unused locks will be released from LRU */
-   ldlm_appetite_t ns_appetite;
+   enum ldlm_appetite  ns_appetite;
 
/** Limit of parallel AST RPC count. */
unsignedns_max_parallel_ast;
@@ -1176,7 +1176,7 @@ void ldlm_unlink_lock_skiplist(struct ldlm_lock *req);
 /* resource.c */
 struct ldlm_namespace *
 ldlm_namespace_new(struct obd_device *obd, char *name,
-  ldlm_side_t client, ldlm_appetite_t apt,
+  ldlm_side_t client, enum ldlm_appetite apt,
   ldlm_ns_type_t ns_type);
 int ldlm_namespace_cleanup(struct ldlm_namespace *ns, __u64 flags);
 void ldlm_namespace_get(struct ldlm_namespace *ns);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index f9d0383..582cb21 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -621,7 +621,7 @@ static void ldlm_namespace_register(struct ldlm_namespace 
*ns,
  */
 struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name,
  ldlm_side_t client,
- ldlm_appetite_t apt,
+ enum ldlm_appetite apt,
  ldlm_ns_type_t ns_type)
 {
struct ldlm_namespace *ns = NULL;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 13/84] staging/lustre: Get rid of obd_cmd_t typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace with enum obd_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 19a99c5..27ee853 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2918,13 +2918,13 @@ void lustre_swab_cfg_marker(struct cfg_marker *marker, 
int swab, int size);
  * Opcodes for multiple servers.
  */
 
-typedef enum {
+enum obd_cmd {
OBD_PING = 400,
OBD_LOG_CANCEL,
OBD_QC_CALLBACK,
OBD_IDX_READ,
OBD_LAST_OPC
-} obd_cmd_t;
+};
 #define OBD_FIRST_OPC OBD_PING
 
 /* catalog of log objects */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 14/84] staging/lustre: Get rid of llog_op_type typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace with enum llog_op_type

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 27ee853..bb82a87 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2950,7 +2950,7 @@ struct llog_catid {
 #define LLOG_OP_MAGIC 0x1060
 #define LLOG_OP_MASK  0xfff0
 
-typedef enum {
+enum llog_op_type {
LLOG_PAD_MAGIC  = LLOG_OP_MAGIC | 0x0,
OST_SZ_REC  = LLOG_OP_MAGIC | 0x00f00,
/* OST_RAID1_REC= LLOG_OP_MAGIC | 0x01000, never used */
@@ -2970,7 +2970,7 @@ typedef enum {
HSM_AGENT_REC   = LLOG_OP_MAGIC | 0x8,
LLOG_HDR_MAGIC  = LLOG_OP_MAGIC | 0x45539,
LLOG_LOGID_MAGIC= LLOG_OP_MAGIC | 0x4553b,
-} llog_op_type;
+};
 
 #define LLOG_REC_HDR_NEEDS_SWABBING(r) \
(((r)->lrh_type & __swab32(LLOG_OP_MASK)) == __swab32(LLOG_OP_MAGIC))
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 17/84] staging/lustre: Get rid of lustre_fid typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace it with struct lu_fid

Signed-off-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  |  2 +-
 .../lustre/lustre/include/lustre/lustre_user.h | 24 +++---
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index af70ebb..4188402 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -3550,7 +3550,7 @@ void lustre_swab_layout_intent(struct layout_intent *li);
  */
 struct hsm_progress_kernel {
/* Field taken from struct hsm_progress */
-   lustre_fid  hpk_fid;
+   struct lu_fid   hpk_fid;
__u64   hpk_cookie;
struct hsm_extent   hpk_extent;
__u16   hpk_flags;
diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
index 2b4dd65..a4765c2 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
@@ -136,7 +136,7 @@ struct filter_fid_old {
 /* Userspace should treat lu_fid as opaque, and only use the following methods
  * to print or parse them.  Other functions (e.g. compare, swab) could be moved
  * here from lustre_idl.h if needed. */
-typedef struct lu_fid lustre_fid;
+struct lu_fid;
 
 /**
  * Following struct for object attributes, that will be kept inode's EA.
@@ -761,10 +761,10 @@ struct changelog_rec {
__u64cr_prev;  /**< last index for this target fid */
__u64cr_time;
union {
-   lustre_fidcr_tfid;  /**< target fid */
+   struct lu_fidcr_tfid;   /**< target fid */
__u32cr_markerflags; /**< CL_MARK flags */
};
-   lustre_fid  cr_pfid;/**< parent fid */
+   struct lu_fid   cr_pfid;/**< parent fid */
char  cr_name[0]; /**< last element */
 } __packed;
 
@@ -781,12 +781,12 @@ struct changelog_ext_rec {
__u64   cr_prev;  /**< last index for this target fid */
__u64   cr_time;
union {
-   lustre_fid  cr_tfid;/**< target fid */
+   struct lu_fid   cr_tfid;/**< target fid */
__u32   cr_markerflags; /**< CL_MARK flags */
};
-   lustre_fid  cr_pfid;/**< target parent fid */
-   lustre_fid  cr_sfid;/**< source fid, or zero */
-   lustre_fid  cr_spfid;   /**< source parent fid, or zero 
*/
+   struct lu_fid   cr_pfid;/**< target parent fid */
+   struct lu_fid   cr_sfid;/**< source fid, or zero */
+   struct lu_fid   cr_spfid; /**< source parent fid, or zero */
charcr_name[0]; /**< last element */
 } __packed;
 
@@ -976,8 +976,8 @@ struct hsm_request {
 };
 
 struct hsm_user_item {
-   lustre_fid  hui_fid;
-   struct hsm_extent hui_extent;
+   struct lu_fid   hui_fid;
+   struct hsm_extent hui_extent;
 } __packed;
 
 struct hsm_user_request {
@@ -1046,8 +1046,8 @@ static inline char *hsm_copytool_action2name(enum 
hsm_copytool_action  a)
 struct hsm_action_item {
__u32  hai_len; /* valid size of this struct */
__u32  hai_action;  /* hsm_copytool_action, but use known size */
-   lustre_fid hai_fid; /* Lustre FID to operated on */
-   lustre_fid hai_dfid;/* fid used for data access */
+   struct lu_fid hai_fid; /* Lustre FID to operated on */
+   struct lu_fid hai_dfid;/* fid used for data access */
struct hsm_extent hai_extent;  /* byte range to operate on */
__u64  hai_cookie;  /* action cookie from coordinator */
__u64  hai_gid; /* grouplock id */
@@ -1157,7 +1157,7 @@ struct hsm_user_import {
 #define HP_FLAG_RETRY 0x02
 
 struct hsm_progress {
-   lustre_fid  hp_fid;
+   struct lu_fid   hp_fid;
__u64   hp_cookie;
struct hsm_extent   hp_extent;
__u16   hp_flags;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 15/84] staging/lustre: Get rid of sec_cmd_t typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace with enum sec_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index bb82a87..d68748b 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -3436,13 +3436,13 @@ union lu_page {
 };
 
 /* security opcodes */
-typedef enum {
+enum sec_cmd {
SEC_CTX_INIT= 801,
SEC_CTX_INIT_CONT   = 802,
SEC_CTX_FINI= 803,
SEC_LAST_OPC,
SEC_FIRST_OPC  = SEC_CTX_INIT
-} sec_cmd_t;
+};
 
 /*
  * capa related definitions
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 16/84] staging/lustre: Get rid of object update code

2016-02-24 Thread green
From: Oleg Drokin 

Object update was originally planned to be used for cross-server
updates, so nothign to do with the client. The idea was
later significantly reworked anyway so even wire structs should
not be retained.

This gets rid of update_cmd_t, UPDATE and UPDATE_REPLY rpc and
corresponding subcommands, swabbig logic and such.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lprocfs_status.h | 16 +---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 94 --
 .../lustre/lustre/include/lustre_req_layout.h  |  4 -
 drivers/staging/lustre/lustre/ptlrpc/layout.c  | 25 --
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c|  1 -
 .../staging/lustre/lustre/ptlrpc/pack_generic.c| 18 -
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c| 84 ---
 7 files changed, 1 insertion(+), 241 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h 
b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 88f754e..54e5aee 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -284,19 +284,6 @@ static inline int opcode_offset(__u32 opc)
OPC_RANGE(LDLM) +
OPC_RANGE(MDS) +
OPC_RANGE(OST));
-   } else if (opc < UPDATE_LAST_OPC) {
-   /* update opcode */
-   return (opc - UPDATE_FIRST_OPC +
-   OPC_RANGE(FLD) +
-   OPC_RANGE(SEC) +
-   OPC_RANGE(SEQ) +
-   OPC_RANGE(QUOTA) +
-   OPC_RANGE(LLOG) +
-   OPC_RANGE(OBD) +
-   OPC_RANGE(MGS) +
-   OPC_RANGE(LDLM) +
-   OPC_RANGE(MDS) +
-   OPC_RANGE(OST));
} else {
/* Unknown Opcode */
return -1;
@@ -312,8 +299,7 @@ static inline int opcode_offset(__u32 opc)
OPC_RANGE(SEC)  + \
OPC_RANGE(SEQ)  + \
OPC_RANGE(SEC)  + \
-   OPC_RANGE(FLD)  + \
-   OPC_RANGE(UPDATE))
+   OPC_RANGE(FLD))
 
 #define EXTRA_MAX_OPCODES ((PTLRPC_LAST_CNTR - PTLRPC_FIRST_CNTR)  + \
OPC_RANGE(EXTRA))
diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index d68748b..af70ebb 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2053,14 +2053,6 @@ enum mds_cmd {
 
 #define MDS_FIRST_OPCMDS_GETATTR
 
-/* opcodes for object update */
-typedef enum {
-   UPDATE_OBJ  = 1000,
-   UPDATE_LAST_OPC
-} update_cmd_t;
-
-#define UPDATE_FIRST_OPCUPDATE_OBJ
-
 /*
  * Do not exceed 63
  */
@@ -3576,92 +3568,6 @@ void lustre_swab_hsm_user_state(struct hsm_user_state 
*hus);
 void lustre_swab_hsm_user_item(struct hsm_user_item *hui);
 void lustre_swab_hsm_request(struct hsm_request *hr);
 
-/**
- * These are object update opcode under UPDATE_OBJ, which is currently
- * being used by cross-ref operations between MDT.
- *
- * During the cross-ref operation, the Master MDT, which the client send the
- * request to, will disassembly the operation into object updates, then OSP
- * will send these updates to the remote MDT to be executed.
- *
- *   Update request format
- *   magic:  UPDATE_BUFFER_MAGIC_V1
- *   Count:  How many updates in the req.
- *   bufs[0] : following are packets of object.
- *   update[0]:
- * type: object_update_op, the op code of update
- * fid: The object fid of the update.
- * lens/bufs: other parameters of the update.
- *   update[1]:
- * type: object_update_op, the op code of update
- * fid: The object fid of the update.
- * lens/bufs: other parameters of the update.
- *   ..
- *   update[7]:type: object_update_op, the op code of update
- * fid: The object fid of the update.
- * lens/bufs: other parameters of the update.
- *   Current 8 maxim updates per object update request.
- *
- ***
- *   update reply format:
- *
- *   ur_version: UPDATE_REPLY_V1
- *   ur_count:   The count of the reply, which is usually equal
- *  to the number of updates in the request.
- *   ur_lens:The reply lengths of each object update.
- *
- *   replies:1st update reply  [4bytes_ret: other body]
- *  2nd update reply  [4bytes_ret: other body]
- *  .
- *  nth update reply  [4bytes_ret: other body]
- *
- *   For each reply of the update, the format would be
- *  result(4 bytes):Other stuff
- */
-
-#define UPDA

[PATCH v2 09/84] staging/lustre: Get rid of mds_reint_t, mdt_reint_t typedefs

2016-02-24 Thread green
From: Oleg Drokin 

Replace with enum mdt_reint_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index a72fed0..bd8b622 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2065,7 +2065,7 @@ typedef enum {
  * Do not exceed 63
  */
 
-typedef enum {
+enum mdt_reint_cmd {
REINT_SETATTR  = 1,
REINT_CREATE   = 2,
REINT_LINK = 3,
@@ -2076,7 +2076,7 @@ typedef enum {
REINT_RMENTRY  = 8,
 //  REINT_WRITE= 9,
REINT_MAX
-} mds_reint_t, mdt_reint_t;
+};
 
 void lustre_swab_generic_32s(__u32 *val);
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 12/84] staging/lustre: Get rid of mgs_cmd_t typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace it with enum mgs_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index d3fb6f9..19a99c5 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2820,7 +2820,7 @@ void lustre_swab_ldlm_reply(struct ldlm_reply *r);
 /*
  * Opcodes for mountconf (mgs and mgc)
  */
-typedef enum {
+enum mgs_cmd {
MGS_CONNECT = 250,
MGS_DISCONNECT,
MGS_EXCEPTION,   /* node died, etc. */
@@ -2829,7 +2829,7 @@ typedef enum {
MGS_SET_INFO,
MGS_CONFIG_READ,
MGS_LAST_OPC
-} mgs_cmd_t;
+};
 #define MGS_FIRST_OPC MGS_CONNECT
 
 #define MGS_PARAM_MAXLEN 1024
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 03/84] staging/lustre: Get rid of client_obd_lock_t typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace it with struct client_obd_lock

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/linux/obd.h | 12 ++--
 drivers/staging/lustre/lustre/include/obd.h   |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/linux/obd.h 
b/drivers/staging/lustre/lustre/include/linux/obd.h
index 240947b..3907bf4 100644
--- a/drivers/staging/lustre/lustre/include/linux/obd.h
+++ b/drivers/staging/lustre/lustre/include/linux/obd.h
@@ -57,16 +57,16 @@ struct ll_iattr {
 
 #define CLIENT_OBD_LIST_LOCK_DEBUG 1
 
-typedef struct {
+struct client_obd_lock {
spinlock_t  lock;
 
unsigned long   time;
struct task_struct *task;
const char   *func;
int  line;
-} client_obd_lock_t;
+};
 
-static inline void __client_obd_list_lock(client_obd_lock_t *lock,
+static inline void __client_obd_list_lock(struct client_obd_lock *lock,
  const char *func, int line)
 {
unsigned long cur = jiffies;
@@ -106,7 +106,7 @@ static inline void __client_obd_list_lock(client_obd_lock_t 
*lock,
 #define client_obd_list_lock(lock) \
__client_obd_list_lock(lock, __func__, __LINE__)
 
-static inline void client_obd_list_unlock(client_obd_lock_t *lock)
+static inline void client_obd_list_unlock(struct client_obd_lock *lock)
 {
LASSERT(lock->task);
lock->task = NULL;
@@ -114,12 +114,12 @@ static inline void 
client_obd_list_unlock(client_obd_lock_t *lock)
spin_unlock(&lock->lock);
 }
 
-static inline void client_obd_list_lock_init(client_obd_lock_t *lock)
+static inline void client_obd_list_lock_init(struct client_obd_lock *lock)
 {
spin_lock_init(&lock->lock);
 }
 
-static inline void client_obd_list_lock_done(client_obd_lock_t *lock)
+static inline void client_obd_list_lock_done(struct client_obd_lock *lock)
 {}
 
 #endif /* __LINUX_OBD_H */
diff --git a/drivers/staging/lustre/lustre/include/obd.h 
b/drivers/staging/lustre/lustre/include/obd.h
index 2245359..d6e5a17 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -294,7 +294,7 @@ struct client_obd {
 * NB by Jinshan: though field names are still _loi_, but actually
 * osc_object{}s are in the list.
 */
-   client_obd_lock_t   cl_loi_list_lock;
+   struct client_obd_lock cl_loi_list_lock;
struct list_head   cl_loi_ready_list;
struct list_head   cl_loi_hp_ready_list;
struct list_head   cl_loi_write_list;
@@ -321,7 +321,7 @@ struct client_obd {
atomic_t cl_lru_shrinkers;
atomic_t cl_lru_in_list;
struct list_head cl_lru_list; /* lru page list */
-   client_obd_lock_tcl_lru_list_lock; /* page list protector */
+   struct client_obd_lock   cl_lru_list_lock; /* page list protector */
 
/* number of in flight destroy rpcs is limited to max_rpcs_in_flight */
atomic_t cl_destroy_in_flight;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 08/84] staging/lustre: Get rid of mds_cmd_t typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace it with enum mds_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index c0b05d4..a72fed0 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2018,7 +2018,7 @@ enum quota_cmd {
  */
 
 /* opcodes */
-typedef enum {
+enum mds_cmd {
MDS_GETATTR = 33,
MDS_GETATTR_NAME= 34,
MDS_CLOSE   = 35,
@@ -2049,7 +2049,7 @@ typedef enum {
MDS_HSM_CT_UNREGISTER   = 60,
MDS_SWAP_LAYOUTS= 61,
MDS_LAST_OPC
-} mds_cmd_t;
+};
 
 #define MDS_FIRST_OPCMDS_GETATTR
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 07/84] staging/lustre: Get rid of quota_cmd_t typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace it with enum quota_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 50e70fe..c0b05d4 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2006,11 +2006,11 @@ void lustre_swab_lquota_lvb(struct lquota_lvb *lvb);
 #define lvb_glb_ver  lvb_id_may_rel /* current version of the global index */
 
 /* op codes */
-typedef enum {
+enum quota_cmd {
QUOTA_DQACQ = 601,
QUOTA_DQREL = 602,
QUOTA_LAST_OPC
-} quota_cmd_t;
+};
 #define QUOTA_FIRST_OPCQUOTA_DQACQ
 
 /*
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 02/84] staging/lustre/fld: Remove useless typedefs

2016-02-24 Thread green
From: Oleg Drokin 

Typedefs fld_hash_func_t and fld_scan_func_t are used exectly once in
the following structure so don't really help anything at all.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/fld/fld_internal.h | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fld/fld_internal.h 
b/drivers/staging/lustre/lustre/fld/fld_internal.h
index 59eabda..ee36d6b 100644
--- a/drivers/staging/lustre/lustre/fld/fld_internal.h
+++ b/drivers/staging/lustre/lustre/fld/fld_internal.h
@@ -58,15 +58,10 @@ struct fld_stats {
__u64   fst_inflight;
 };
 
-typedef int (*fld_hash_func_t) (struct lu_client_fld *, __u64);
-
-typedef struct lu_fld_target *
-(*fld_scan_func_t) (struct lu_client_fld *, __u64);
-
 struct lu_fld_hash {
const char*fh_name;
-   fld_hash_func_t   fh_hash_func;
-   fld_scan_func_t   fh_scan_func;
+   int (*fh_hash_func)(struct lu_client_fld *, __u64);
+   struct lu_fld_target *(*fh_scan_func)(struct lu_client_fld *, __u64);
 };
 
 struct fld_cache_entry {
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 06/84] staging/lustre: Get rid of ost_cmd_t typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace it with enum ost_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 0f37b61..50e70fe 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -1419,7 +1419,7 @@ enum cksum_type {
  */
 
 /* opcodes */
-typedef enum {
+enum ost_cmd {
OST_REPLY  =  0,   /* reply ? */
OST_GETATTR=  1,
OST_SETATTR=  2,
@@ -1440,7 +1440,7 @@ typedef enum {
OST_QUOTACTL   = 19,
OST_QUOTA_ADJUST_QUNIT = 20, /* not used since 2.4 */
OST_LAST_OPC
-} ost_cmd_t;
+};
 #define OST_FIRST_OPC  OST_REPLY
 
 enum obdo_flags {
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 10/84] staging/lustre: Get rid of ldlm_cmd_t typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace it with enum ldlm_cmd

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index bd8b622..938f91b 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2659,7 +2659,7 @@ void lustre_swab_lov_desc(struct lov_desc *ld);
  *   LDLM requests:
  */
 /* opcodes -- MUST be distinct from OST/MDS opcodes */
-typedef enum {
+enum ldlm_cmd {
LDLM_ENQUEUE = 101,
LDLM_CONVERT = 102,
LDLM_CANCEL  = 103,
@@ -2668,7 +2668,7 @@ typedef enum {
LDLM_GL_CALLBACK = 106,
LDLM_SET_INFO= 107,
LDLM_LAST_OPC
-} ldlm_cmd_t;
+};
 #define LDLM_FIRST_OPC LDLM_ENQUEUE
 
 #define RES_NAME_SIZE 4
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 01/84] staging/lustre/ldlm: Remove unused lr_most_restr from struct ldlm_resource

2016-02-24 Thread green
From: Oleg Drokin 

This member comes from the dawn of time and is no longer needed

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 3 ---
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 3 ---
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 1 -
 3 files changed, 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 51f416d..4aeaac9 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -847,9 +847,6 @@ struct ldlm_resource {
struct list_headlr_waiting;
/** @} */
 
-   /* XXX No longer needed? Remove ASAP */
-   ldlm_mode_t lr_most_restr;
-
/** Type of locks this resource can hold. Only one type per resource. */
ldlm_type_t lr_type; /* LDLM_{PLAIN,EXTENT,FLOCK,IBITS} */
 
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index 4fd735f..8f75139 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -1033,9 +1033,6 @@ void ldlm_grant_lock(struct ldlm_lock *lock, struct 
list_head *work_list)
else
ldlm_resource_add_lock(res, &res->lr_granted, lock);
 
-   if (lock->l_granted_mode < res->lr_most_restr)
-   res->lr_most_restr = lock->l_granted_mode;
-
if (work_list && lock->l_completion_ast)
ldlm_add_ast_work_item(lock, NULL, work_list);
 
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index 6ae8c60..fede185 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -1110,7 +1110,6 @@ ldlm_resource_get(struct ldlm_namespace *ns, struct 
ldlm_resource *parent,
res->lr_ns_bucket  = cfs_hash_bd_extra_get(ns->ns_rs_hash, &bd);
res->lr_name   = *name;
res->lr_type   = type;
-   res->lr_most_restr = LCK_NL;
 
cfs_hash_bd_lock(ns->ns_rs_hash, &bd, 1);
hnode = (version == cfs_hash_bd_version_get(&bd)) ?  NULL :
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 04/84] staging/lustre: Get rid of loc_flags_t typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace it with direct reference of enum loc_flags

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lu_object.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lu_object.h 
b/drivers/staging/lustre/lustre/include/lu_object.h
index c1c7aa1..23e5567 100644
--- a/drivers/staging/lustre/lustre/include/lu_object.h
+++ b/drivers/staging/lustre/lustre/include/lu_object.h
@@ -164,11 +164,11 @@ struct lu_device_operations {
 /**
  * For lu_object_conf flags
  */
-typedef enum {
+enum loc_flags {
/* This is a new object to be allocated, or the file
 * corresponding to the object does not exists. */
LOC_F_NEW   = 0x0001,
-} loc_flags_t;
+};
 
 /**
  * Object configuration, describing particulars of object being created. On
@@ -179,7 +179,7 @@ struct lu_object_conf {
/**
 * Some hints for obj find and alloc.
 */
-   loc_flags_t loc_flags;
+   enum loc_flags loc_flags;
 };
 
 /**
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 05/84] staging/lustre: Get rid of cksum_type_t typedef

2016-02-24 Thread green
From: Oleg Drokin 

Replace it with enum cksum_type

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h |  4 ++--
 drivers/staging/lustre/lustre/include/obd.h   |  2 +-
 drivers/staging/lustre/lustre/include/obd_cksum.h | 12 ++--
 drivers/staging/lustre/lustre/osc/osc_request.c   | 10 +-
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 0e3bac6..0f37b61 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -1408,11 +1408,11 @@ void lustre_swab_connect(struct obd_connect_data *ocd);
  * Please update DECLARE_CKSUM_NAME/OBD_CKSUM_ALL in obd.h when adding a new
  * algorithm and also the OBD_FL_CKSUM* flags.
  */
-typedef enum {
+enum cksum_type {
OBD_CKSUM_CRC32  = 0x0001,
OBD_CKSUM_ADLER  = 0x0002,
OBD_CKSUM_CRC32C = 0x0004,
-} cksum_type_t;
+};
 
 /*
  *   OST requests: OBDO & OBD request records
diff --git a/drivers/staging/lustre/lustre/include/obd.h 
b/drivers/staging/lustre/lustre/include/obd.h
index d6e5a17..09f1a5b 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -339,7 +339,7 @@ struct client_obd {
/* supported checksum types that are worked out at connect time */
__u32   cl_supp_cksum_types;
/* checksum algorithm to be used */
-   cksum_type_t cl_cksum_type;
+   enum cksum_type  cl_cksum_type;
 
/* also protected by the poorly named _loi_list_lock lock above */
struct osc_async_rc  cl_ar;
diff --git a/drivers/staging/lustre/lustre/include/obd_cksum.h 
b/drivers/staging/lustre/lustre/include/obd_cksum.h
index 01db604..d61b4db 100644
--- a/drivers/staging/lustre/lustre/include/obd_cksum.h
+++ b/drivers/staging/lustre/lustre/include/obd_cksum.h
@@ -37,7 +37,7 @@
 #include "../../include/linux/libcfs/libcfs.h"
 #include "lustre/lustre_idl.h"
 
-static inline unsigned char cksum_obd2cfs(cksum_type_t cksum_type)
+static inline unsigned char cksum_obd2cfs(enum cksum_type cksum_type)
 {
switch (cksum_type) {
case OBD_CKSUM_CRC32:
@@ -64,7 +64,7 @@ static inline unsigned char cksum_obd2cfs(cksum_type_t 
cksum_type)
  * because that is supported by all clients since 1.8
  *
  * In case multiple algorithms are supported the best one is used. */
-static inline u32 cksum_type_pack(cksum_type_t cksum_type)
+static inline u32 cksum_type_pack(enum cksum_type cksum_type)
 {
unsigned intperformance = 0, tmp;
u32 flag = OBD_FL_CKSUM_ADLER;
@@ -98,7 +98,7 @@ static inline u32 cksum_type_pack(cksum_type_t cksum_type)
return flag;
 }
 
-static inline cksum_type_t cksum_type_unpack(u32 o_flags)
+static inline enum cksum_type cksum_type_unpack(u32 o_flags)
 {
switch (o_flags & OBD_FL_CKSUM_ALL) {
case OBD_FL_CKSUM_CRC32C:
@@ -116,9 +116,9 @@ static inline cksum_type_t cksum_type_unpack(u32 o_flags)
  * 1.8 supported ADLER it is base and not depend on hw
  * Client uses all available local algos
  */
-static inline cksum_type_t cksum_types_supported_client(void)
+static inline enum cksum_type cksum_types_supported_client(void)
 {
-   cksum_type_t ret = OBD_CKSUM_ADLER;
+   enum cksum_type ret = OBD_CKSUM_ADLER;
 
CDEBUG(D_INFO, "Crypto hash speed: crc %d, crc32c %d, adler %d\n",
   cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_CRC32)),
@@ -140,7 +140,7 @@ static inline cksum_type_t 
cksum_types_supported_client(void)
  * checksum type due to its benchmarking at libcfs module load.
  * Caution is advised, however, since what is fastest on a single client may
  * not be the fastest or most efficient algorithm on the server.  */
-static inline cksum_type_t cksum_type_select(cksum_type_t cksum_types)
+static inline enum cksum_type cksum_type_select(enum cksum_type cksum_types)
 {
return cksum_type_unpack(cksum_type_pack(cksum_types));
 }
diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c 
b/drivers/staging/lustre/lustre/osc/osc_request.c
index 43b11c6..cb9587f 100644
--- a/drivers/staging/lustre/lustre/osc/osc_request.c
+++ b/drivers/staging/lustre/lustre/osc/osc_request.c
@@ -1151,7 +1151,7 @@ static inline int can_merge_pages(struct brw_page *p1, 
struct brw_page *p2)
 
 static u32 osc_checksum_bulk(int nob, u32 pg_count,
 struct brw_page **pga, int opc,
-cksum_type_t cksum_type)
+enum cksum_type cksum_type)
 {
__u32 cksum;
int i = 0;
@@ -1355,7 +1355,7 @@ static int osc_brw_prep_request(int cmd, struct 
client_obd *cli,
!sptlrpc_flavor_has_bulk(&req->rq_flvr)) {
/* store cl_cksum_type in a loca

[PATCH v2 00/84] Lustre cleanups

2016-02-24 Thread green
From: Oleg Drokin 

Due to unfortunate reordering that broke the build in the middle,
I am resending the previous patchset with some extra added patches.

This contains various Lustre cleanups and coding style fixes,
also hunts out various ifdefs that we don't really need
and remove various unused code and other fixes I seem to
be noticing along the way while looking at all the checkpatch warnings.

Oleg Drokin (84):
  staging/lustre/ldlm: Remove unused lr_most_restr from struct
ldlm_resource
  staging/lustre/fld: Remove useless typedefs
  staging/lustre: Get rid of client_obd_lock_t typedef
  staging/lustre: Get rid of loc_flags_t typedef
  staging/lustre: Get rid of cksum_type_t typedef
  staging/lustre: Get rid of ost_cmd_t typedef
  staging/lustre: Get rid of quota_cmd_t typedef
  staging/lustre: Get rid of mds_cmd_t typedef
  staging/lustre: Get rid of mds_reint_t, mdt_reint_t typedefs
  staging/lustre: Get rid of ldlm_cmd_t typedef
  staging/lustre: Remove ldlm type/mode typedefs
  staging/lustre: Get rid of mgs_cmd_t typedef
  staging/lustre: Get rid of obd_cmd_t typedef
  staging/lustre: Get rid of llog_op_type typedef
  staging/lustre: Get rid of sec_cmd_t typedef
  staging/lustre: Get rid of object update code
  staging/lustre: Get rid of lustre_fid typedef
  staging/lustre: Get rid of lustre_quota_version typedef
  staging/lustre: Get rid of ldlm_error_t typedef
  staging/lustre: Remove ldlm_appetite_t typedef
  staging/lustre: Get rid of ldlm_ns_type_t typedef
  staging/lustre: Get rid of ldlm_cancel_flags_t typedef
  staging/lustre/llite: Get rid of se_stat_t typedef
  staging/lustre: Remove lustre_build_version.h
  staging/lustre: Get rid of C99 comments in lustre_idl.h
  staging/lustre: Remove server-side changelog defines
  staging/lustre: Remove FSF mailing address from GPL notices
  staging/lustre: Remove server-only values from enum lu_dirent_attrs
  staging/lustre: Remove *_CONNECT_SUPPORTED defines
  staging/lustre: Remove duplicated quota defines
  staging/lustre: Remove unused struct quota_body
  staging/lustre: Remove lquota_glb_rec, lquota_slv_rec and
lquota_acct_rec
  staging/lustre: S_DIRSYNC is always defined in kernel
  staging/lustre: FMODE_READ and FMODE_WRITE are always defined in the
kernel
  staging/lustre: Remove index file transfer structures
  staging/lustre: Remove server data from struct obd_export
  staging/lustre: Remove last_rcvd-file related data
  staging/lustre: Remove dead code in ldlm_lock_destroy_internal
  staging/lustre: MAY_NOT_BLOCK is always defined, don't check for it.
  staging/lustre: Remove unused lli_open_count from struct ll_inode_info
  staging/lustre: Reformat comments and structures in lustre_idl.h
  staging/lustre/include: Adjust comment style
  staging/lustre/fld: Adjust comments to better conform to coding style
  staging/lustre/fid: Adjust comments to better conform to coding style
  staging/lustre/lclient: Adjust comments to better conform to coding
style
  staging/lustre/ldlm: Adjust comments to better conform to coding style
  staging/lustre/llite: Adjust comments to better conform to coding
style
  staging/lustre/lmv: Adjust comments to better conform to coding style
  staging/lustre/lov: Adjust comments to better conform to coding style
  staging/lustre/mdc: Adjust comments to better conform to coding style
  staging/lustre/mgc: Adjust comments to better conform to coding style
  staging/lustre/obdclass: Adjust comments to better conform to coding
style
  staging/lustre/obdecho: Adjust comments to better conform to coding
style
  staging/lustre/osc: Adjust comments to better conform to coding style
  staging/lustre/ptlrpc: Adjust comments to better conform to coding
style
  staging/lustre: Fix indentation mistakes
  staging/lustre: Remove stray space before newline in messages
  staging/lustre: Remove commented out obd functions
  staging/lustre: Remove unused members of struct ll_sb_info
  staging/lustre/llite: Fix style vs open parenthesis alignment
  staging/lustre/include: Fix style of function declarations
  staging/lustre/fld: Fix style vs open parenthesis alignment
  staging/lustre: Remove unused liblustre_check_services prototype
  staging/lustre: Remove unused lustre_build_lock_params()
  staging/lustre: Convert ptlrpc_at_check_timed to void
  staging/lustre: Remove misleading liblustre comments.
  staging/lustre: Remove liblustre references from explanations
  staging/lustre/lmv: Remove commented out MDS selection policies
  staging/lustre: F_SETLKW64 F_SETLK64 F_GETLK64 are always defined
  staging/lustre: MS_POSIXACL is always defined, don't check for it
  staging/lustre: Remove RELEASEPAGE_ARG_TYPE compat macro
  staging/lustre: NEED_QUOTA_DEFS is never defined, drop it.
  staging/lustre/ptlrpc: Fix style vs open parenthesis alignment
  staging/lustre/osc: Fix style vs open parenthesis alignment
  staging/lustre/obdclass: Fix style vs open parenthesis alignment
  staging/lustre/lov: Fix style

[PATCH 4/9] staging: wilc1000: rename ReqIEsLen in struct connec_info

2016-02-24 Thread Chaehyun Lim
This patch renames ReqIEsLen to req_ies_len to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/coreconfigurator.h   | 2 +-
 drivers/staging/wilc1000/host_interface.c | 6 +++---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h 
b/drivers/staging/wilc1000/coreconfigurator.h
index 5ef4fd1..d26e597 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -108,7 +108,7 @@ struct connect_resp_info {
 struct connect_info {
u8 bssid[6];
u8 *req_ies;
-   size_t ReqIEsLen;
+   size_t req_ies_len;
u8 *pu8RespIEs;
u16 u16RespIEsLen;
u16 u16ConnectStatus;
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 55ed96e..dec3d08 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1158,7 +1158,7 @@ ERRORHANDLER:
memcpy(strConnectInfo.bssid, 
pstrHostIFconnectAttr->bssid, 6);
 
if (pstrHostIFconnectAttr->ies) {
-   strConnectInfo.ReqIEsLen = 
pstrHostIFconnectAttr->ies_len;
+   strConnectInfo.req_ies_len = 
pstrHostIFconnectAttr->ies_len;
strConnectInfo.req_ies = 
kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
memcpy(strConnectInfo.req_ies,
   pstrHostIFconnectAttr->ies,
@@ -1265,7 +1265,7 @@ static s32 Handle_ConnectTimeout(struct wilc_vif *vif)
}
 
if (hif_drv->usr_conn_req.ies) {
-   strConnectInfo.ReqIEsLen = 
hif_drv->usr_conn_req.ies_len;
+   strConnectInfo.req_ies_len = 
hif_drv->usr_conn_req.ies_len;
strConnectInfo.req_ies = 
kmalloc(hif_drv->usr_conn_req.ies_len, GFP_KERNEL);
memcpy(strConnectInfo.req_ies,
   hif_drv->usr_conn_req.ies,
@@ -1502,7 +1502,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
}
 
if (hif_drv->usr_conn_req.ies) {
-   strConnectInfo.ReqIEsLen = 
hif_drv->usr_conn_req.ies_len;
+   strConnectInfo.req_ies_len = 
hif_drv->usr_conn_req.ies_len;
strConnectInfo.req_ies = 
kmalloc(hif_drv->usr_conn_req.ies_len, GFP_KERNEL);
memcpy(strConnectInfo.req_ies,
   hif_drv->usr_conn_req.ies,
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 7260f1d..f8cd128 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -544,7 +544,7 @@ static void CfgConnectResult(enum conn_event 
enuConnDisconnEvent,
}
 
cfg80211_connect_result(dev, pstrConnectInfo->bssid,
-   pstrConnectInfo->req_ies, 
pstrConnectInfo->ReqIEsLen,
+   pstrConnectInfo->req_ies, 
pstrConnectInfo->req_ies_len,
pstrConnectInfo->pu8RespIEs, 
pstrConnectInfo->u16RespIEsLen,
u16ConnectStatus, GFP_KERNEL);
} else if (enuConnDisconnEvent == CONN_DISCONN_EVENT_DISCONN_NOTIF){
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 9/9] staging: wilc1000: rename u16reason in disconnect_info

2016-02-24 Thread Chaehyun Lim
This patch renames u16reason to reason to remove u16 prefix. There is no
need to use prefix to show data type.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/coreconfigurator.h   | 2 +-
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h 
b/drivers/staging/wilc1000/coreconfigurator.h
index 6256d71..63eca24 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -115,7 +115,7 @@ struct connect_info {
 };
 
 struct disconnect_info {
-   u16 u16reason;
+   u16 reason;
u8 *ie;
size_t ie_len;
 };
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 4cdd3403..a6b7a22 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1552,7 +1552,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
Handle_ScanDone(vif, SCAN_EVENT_ABORTED);
}
 
-   strDisconnectNotifInfo.u16reason = 0;
+   strDisconnectNotifInfo.reason = 0;
strDisconnectNotifInfo.ie = NULL;
strDisconnectNotifInfo.ie_len = 0;
 
@@ -1889,7 +1889,7 @@ static void Handle_Disconnect(struct wilc_vif *vif)
 
memset(&strDisconnectNotifInfo, 0, sizeof(struct 
disconnect_info));
 
-   strDisconnectNotifInfo.u16reason = 0;
+   strDisconnectNotifInfo.reason = 0;
strDisconnectNotifInfo.ie = NULL;
strDisconnectNotifInfo.ie_len = 0;
 
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index ed34727..d554df1 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -559,11 +559,11 @@ static void CfgConnectResult(enum conn_event 
enuConnDisconnEvent,
if (!pstrWFIDrv->p2p_connect)
wlan_channel = INVALID_CHANNEL;
if ((pstrWFIDrv->IFC_UP) && (dev == wl->vif[1]->ndev)) {
-   pstrDisconnectNotifInfo->u16reason = 3;
+   pstrDisconnectNotifInfo->reason = 3;
} else if ((!pstrWFIDrv->IFC_UP) && (dev == wl->vif[1]->ndev)) {
-   pstrDisconnectNotifInfo->u16reason = 1;
+   pstrDisconnectNotifInfo->reason = 1;
}
-   cfg80211_disconnected(dev, pstrDisconnectNotifInfo->u16reason, 
pstrDisconnectNotifInfo->ie,
+   cfg80211_disconnected(dev, pstrDisconnectNotifInfo->reason, 
pstrDisconnectNotifInfo->ie,
  pstrDisconnectNotifInfo->ie_len, false,
  GFP_KERNEL);
}
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/9] staging: wilc1000: rename pu8RespIEs in struct connect_info

2016-02-24 Thread Chaehyun Lim
This patch renames pu8RespIEs to resp_ies to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/coreconfigurator.h   | 2 +-
 drivers/staging/wilc1000/host_interface.c | 8 
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h 
b/drivers/staging/wilc1000/coreconfigurator.h
index d26e597..bb4c256 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -109,7 +109,7 @@ struct connect_info {
u8 bssid[6];
u8 *req_ies;
size_t req_ies_len;
-   u8 *pu8RespIEs;
+   u8 *resp_ies;
u16 u16RespIEsLen;
u16 u16ConnectStatus;
 };
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index dec3d08..c273935 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1468,8 +1468,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
if 
(strConnectInfo.u16ConnectStatus == SUCCESSFUL_STATUSCODE) {
if 
(pstrConnectRespInfo->ies) {

strConnectInfo.u16RespIEsLen = pstrConnectRespInfo->ies_len;
-   
strConnectInfo.pu8RespIEs = kmalloc(pstrConnectRespInfo->ies_len, GFP_KERNEL);
-   
memcpy(strConnectInfo.pu8RespIEs, pstrConnectRespInfo->ies,
+   
strConnectInfo.resp_ies = kmalloc(pstrConnectRespInfo->ies_len, GFP_KERNEL);
+   
memcpy(strConnectInfo.resp_ies, pstrConnectRespInfo->ies,
   
pstrConnectRespInfo->ies_len);
}
}
@@ -1530,8 +1530,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
scan_while_connected = false;
}
 
-   kfree(strConnectInfo.pu8RespIEs);
-   strConnectInfo.pu8RespIEs = NULL;
+   kfree(strConnectInfo.resp_ies);
+   strConnectInfo.resp_ies = NULL;
 
kfree(strConnectInfo.req_ies);
strConnectInfo.req_ies = NULL;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index f8cd128..7e10d34 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -545,7 +545,7 @@ static void CfgConnectResult(enum conn_event 
enuConnDisconnEvent,
 
cfg80211_connect_result(dev, pstrConnectInfo->bssid,
pstrConnectInfo->req_ies, 
pstrConnectInfo->req_ies_len,
-   pstrConnectInfo->pu8RespIEs, 
pstrConnectInfo->u16RespIEsLen,
+   pstrConnectInfo->resp_ies, 
pstrConnectInfo->u16RespIEsLen,
u16ConnectStatus, GFP_KERNEL);
} else if (enuConnDisconnEvent == CONN_DISCONN_EVENT_DISCONN_NOTIF){
wilc_optaining_ip = false;
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/9] staging: wilc1000: rename pu8ReqIEs in struct connect_info

2016-02-24 Thread Chaehyun Lim
This patch renames pu8ReqIEs to req_ies to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/coreconfigurator.h   |  2 +-
 drivers/staging/wilc1000/host_interface.c | 24 +++
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  2 +-
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h 
b/drivers/staging/wilc1000/coreconfigurator.h
index a32f466..5ef4fd1 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -107,7 +107,7 @@ struct connect_resp_info {
 
 struct connect_info {
u8 bssid[6];
-   u8 *pu8ReqIEs;
+   u8 *req_ies;
size_t ReqIEsLen;
u8 *pu8RespIEs;
u16 u16RespIEsLen;
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 4a1bad8..55ed96e 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1159,8 +1159,8 @@ ERRORHANDLER:
 
if (pstrHostIFconnectAttr->ies) {
strConnectInfo.ReqIEsLen = 
pstrHostIFconnectAttr->ies_len;
-   strConnectInfo.pu8ReqIEs = 
kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
-   memcpy(strConnectInfo.pu8ReqIEs,
+   strConnectInfo.req_ies = 
kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
+   memcpy(strConnectInfo.req_ies,
   pstrHostIFconnectAttr->ies,
   pstrHostIFconnectAttr->ies_len);
}
@@ -1171,8 +1171,8 @@ ERRORHANDLER:
   NULL,
   
pstrHostIFconnectAttr->arg);
hif_drv->hif_state = HOST_IF_IDLE;
-   kfree(strConnectInfo.pu8ReqIEs);
-   strConnectInfo.pu8ReqIEs = NULL;
+   kfree(strConnectInfo.req_ies);
+   strConnectInfo.req_ies = NULL;
 
} else {
netdev_err(vif->ndev, "Connect callback is NULL\n");
@@ -1266,8 +1266,8 @@ static s32 Handle_ConnectTimeout(struct wilc_vif *vif)
 
if (hif_drv->usr_conn_req.ies) {
strConnectInfo.ReqIEsLen = 
hif_drv->usr_conn_req.ies_len;
-   strConnectInfo.pu8ReqIEs = 
kmalloc(hif_drv->usr_conn_req.ies_len, GFP_KERNEL);
-   memcpy(strConnectInfo.pu8ReqIEs,
+   strConnectInfo.req_ies = 
kmalloc(hif_drv->usr_conn_req.ies_len, GFP_KERNEL);
+   memcpy(strConnectInfo.req_ies,
   hif_drv->usr_conn_req.ies,
   hif_drv->usr_conn_req.ies_len);
}
@@ -1278,8 +1278,8 @@ static s32 Handle_ConnectTimeout(struct wilc_vif *vif)
  NULL,
  hif_drv->usr_conn_req.arg);
 
-   kfree(strConnectInfo.pu8ReqIEs);
-   strConnectInfo.pu8ReqIEs = NULL;
+   kfree(strConnectInfo.req_ies);
+   strConnectInfo.req_ies = NULL;
} else {
netdev_err(vif->ndev, "Connect callback is NULL\n");
}
@@ -1503,8 +1503,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 
if (hif_drv->usr_conn_req.ies) {
strConnectInfo.ReqIEsLen = 
hif_drv->usr_conn_req.ies_len;
-   strConnectInfo.pu8ReqIEs = 
kmalloc(hif_drv->usr_conn_req.ies_len, GFP_KERNEL);
-   memcpy(strConnectInfo.pu8ReqIEs,
+   strConnectInfo.req_ies = 
kmalloc(hif_drv->usr_conn_req.ies_len, GFP_KERNEL);
+   memcpy(strConnectInfo.req_ies,
   hif_drv->usr_conn_req.ies,
   hif_drv->usr_conn_req.ies_len);
}
@@ -1533,8 +1533,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
kfree(strConnectInfo.pu8RespIEs);
strConnectInfo.pu8RespIEs = NULL;
 
-   kfree(strConnectInfo.pu8ReqIEs);
-   strConnectInfo.pu8ReqIEs = NULL;
+   kfree(strConnectInfo.req_ies);
+   strConnectInfo.req_ies = NULL;
hif_drv->usr_conn_req.ssid_len = 0;
kfree(hif_drv->usr_conn_req.ssid);
hif_drv->usr_conn_req.ssid = NULL;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 1605199..7260f1d 100644
--- a/drivers/staging/wilc1000/w

[PATCH 7/9] staging: wilc1000: rename u16ConnectStatus in struct connect_info

2016-02-24 Thread Chaehyun Lim
This patch renames u16ConnectStatus to status to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/coreconfigurator.h   |  2 +-
 drivers/staging/wilc1000/host_interface.c | 10 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h 
b/drivers/staging/wilc1000/coreconfigurator.h
index 408031f..9fbd52b 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -111,7 +111,7 @@ struct connect_info {
size_t req_ies_len;
u8 *resp_ies;
u16 resp_ies_len;
-   u16 u16ConnectStatus;
+   u16 status;
 };
 
 typedef struct {
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 58902bf..1ebe08a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1463,9 +1463,9 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
if (s32Err) {
netdev_err(vif->ndev, 
"wilc_parse_assoc_resp_info() returned error %d\n", s32Err);
} else {
-   strConnectInfo.u16ConnectStatus 
= pstrConnectRespInfo->status;
+   strConnectInfo.status = 
pstrConnectRespInfo->status;
 
-   if 
(strConnectInfo.u16ConnectStatus == SUCCESSFUL_STATUSCODE) {
+   if (strConnectInfo.status == 
SUCCESSFUL_STATUSCODE) {
if 
(pstrConnectRespInfo->ies) {

strConnectInfo.resp_ies_len = pstrConnectRespInfo->ies_len;

strConnectInfo.resp_ies = kmalloc(pstrConnectRespInfo->ies_len, GFP_KERNEL);
@@ -1483,7 +1483,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
}
 
if ((u8MacStatus == MAC_CONNECTED) &&
-   (strConnectInfo.u16ConnectStatus != 
SUCCESSFUL_STATUSCODE)) {
+   (strConnectInfo.status != SUCCESSFUL_STATUSCODE))   
{
netdev_err(vif->ndev, "Received MAC status is 
MAC_CONNECTED while the received status code in Asoc Resp is not 
SUCCESSFUL_STATUSCODE\n");
eth_zero_addr(wilc_connected_ssid);
} else if (u8MacStatus == MAC_DISCONNECTED){
@@ -1495,7 +1495,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
memcpy(strConnectInfo.bssid, 
hif_drv->usr_conn_req.bssid, 6);
 
if ((u8MacStatus == MAC_CONNECTED) &&
-   (strConnectInfo.u16ConnectStatus == 
SUCCESSFUL_STATUSCODE)) {
+   (strConnectInfo.status == 
SUCCESSFUL_STATUSCODE))   {
memcpy(hif_drv->assoc_bssid,
   hif_drv->usr_conn_req.bssid, 
ETH_ALEN);
}
@@ -1517,7 +1517,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
  
hif_drv->usr_conn_req.arg);
 
if ((u8MacStatus == MAC_CONNECTED) &&
-   (strConnectInfo.u16ConnectStatus == 
SUCCESSFUL_STATUSCODE)) {
+   (strConnectInfo.status == SUCCESSFUL_STATUSCODE))   
{
wilc_set_power_mgmt(vif, 0, 0);
 
hif_drv->hif_state = HOST_IF_CONNECTED;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 1dbeca5..c492423 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -502,10 +502,10 @@ static void CfgConnectResult(enum conn_event 
enuConnDisconnEvent,
if (enuConnDisconnEvent == CONN_DISCONN_EVENT_CONN_RESP) {
u16 u16ConnectStatus;
 
-   u16ConnectStatus = pstrConnectInfo->u16ConnectStatus;
+   u16ConnectStatus = pstrConnectInfo->status;
 
if ((u8MacStatus == MAC_DISCONNECTED) &&
-   (pstrConnectInfo->u16ConnectStatus == 
SUCCESSFUL_STATUSCODE)) {
+   (pstrConnectInfo->status == SUCCESSFUL_STATUSCODE)) {
u16ConnectStatus = WLAN_STATUS_UNSPECIFIED_FAILURE;
wilc_wlan_set_bssid(priv->dev, NullBssid,
STATION_MODE);
-- 
2.7.1

___
devel mailing li

[PATCH 8/9] staging: wilc1000: rename struct tstrDisconnectNotifInfo

2016-02-24 Thread Chaehyun Lim
This patch renames struct tstrDisconnectNotifInfo to disconnect_info to
avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/coreconfigurator.h   | 4 ++--
 drivers/staging/wilc1000/host_interface.c | 8 
 drivers/staging/wilc1000/host_interface.h | 2 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h 
b/drivers/staging/wilc1000/coreconfigurator.h
index 9fbd52b..6256d71 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -114,11 +114,11 @@ struct connect_info {
u16 status;
 };
 
-typedef struct {
+struct disconnect_info {
u16 u16reason;
u8 *ie;
size_t ie_len;
-} tstrDisconnectNotifInfo;
+};
 
 s32 wilc_parse_network_info(u8 *msg_buffer,
struct network_info **ret_network_info);
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 1ebe08a..4cdd3403 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1411,7 +1411,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
u8 u8MacStatusReasonCode;
u8 u8MacStatusAdditionalInfo;
struct connect_info strConnectInfo;
-   tstrDisconnectNotifInfo strDisconnectNotifInfo;
+   struct disconnect_info strDisconnectNotifInfo;
s32 s32Err = 0;
struct host_if_drv *hif_drv = vif->hif_drv;
 
@@ -1545,7 +1545,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
hif_drv->usr_conn_req.ies = NULL;
} else if ((u8MacStatus == MAC_DISCONNECTED) &&
   (hif_drv->hif_state == HOST_IF_CONNECTED)) {
-   memset(&strDisconnectNotifInfo, 0, 
sizeof(tstrDisconnectNotifInfo));
+   memset(&strDisconnectNotifInfo, 0, sizeof(struct 
disconnect_info));
 
if (hif_drv->usr_scan_req.scan_result) {
del_timer(&hif_drv->scan_timer);
@@ -1885,9 +1885,9 @@ static void Handle_Disconnect(struct wilc_vif *vif)
if (result) {
netdev_err(vif->ndev, "Failed to send dissconect\n");
} else {
-   tstrDisconnectNotifInfo strDisconnectNotifInfo;
+   struct disconnect_info strDisconnectNotifInfo;
 
-   memset(&strDisconnectNotifInfo, 0, 
sizeof(tstrDisconnectNotifInfo));
+   memset(&strDisconnectNotifInfo, 0, sizeof(struct 
disconnect_info));
 
strDisconnectNotifInfo.u16reason = 0;
strDisconnectNotifInfo.ie = NULL;
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index f4a3e4f..795c18c 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -174,7 +174,7 @@ typedef void (*wilc_scan_result)(enum scan_event, struct 
network_info *,
 typedef void (*wilc_connect_result)(enum conn_event,
 struct connect_info *,
 u8,
-tstrDisconnectNotifInfo *,
+struct disconnect_info *,
 void *);
 
 typedef void (*wilc_remain_on_chan_expired)(void *, u32);
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index c492423..ed34727 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -481,7 +481,7 @@ int wilc_connecting;
 static void CfgConnectResult(enum conn_event enuConnDisconnEvent,
 struct connect_info *pstrConnectInfo,
 u8 u8MacStatus,
-tstrDisconnectNotifInfo *pstrDisconnectNotifInfo,
+struct disconnect_info *pstrDisconnectNotifInfo,
 void *pUserVoid)
 {
struct wilc_priv *priv;
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/9] staging: wilc1000: rename u16RespIEsLen in struct connect_info

2016-02-24 Thread Chaehyun Lim
This patch renames u16RespIEsLen to resp_ies_len to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/coreconfigurator.h   | 2 +-
 drivers/staging/wilc1000/host_interface.c | 2 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h 
b/drivers/staging/wilc1000/coreconfigurator.h
index bb4c256..408031f 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -110,7 +110,7 @@ struct connect_info {
u8 *req_ies;
size_t req_ies_len;
u8 *resp_ies;
-   u16 u16RespIEsLen;
+   u16 resp_ies_len;
u16 u16ConnectStatus;
 };
 
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index c273935..58902bf 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1467,7 +1467,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 
if 
(strConnectInfo.u16ConnectStatus == SUCCESSFUL_STATUSCODE) {
if 
(pstrConnectRespInfo->ies) {
-   
strConnectInfo.u16RespIEsLen = pstrConnectRespInfo->ies_len;
+   
strConnectInfo.resp_ies_len = pstrConnectRespInfo->ies_len;

strConnectInfo.resp_ies = kmalloc(pstrConnectRespInfo->ies_len, GFP_KERNEL);

memcpy(strConnectInfo.resp_ies, pstrConnectRespInfo->ies,
   
pstrConnectRespInfo->ies_len);
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 7e10d34..1dbeca5 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -545,7 +545,7 @@ static void CfgConnectResult(enum conn_event 
enuConnDisconnEvent,
 
cfg80211_connect_result(dev, pstrConnectInfo->bssid,
pstrConnectInfo->req_ies, 
pstrConnectInfo->req_ies_len,
-   pstrConnectInfo->resp_ies, 
pstrConnectInfo->u16RespIEsLen,
+   pstrConnectInfo->resp_ies, 
pstrConnectInfo->resp_ies_len,
u16ConnectStatus, GFP_KERNEL);
} else if (enuConnDisconnEvent == CONN_DISCONN_EVENT_DISCONN_NOTIF){
wilc_optaining_ip = false;
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/9] staging: wilc1000: rename struct tstrConnectInfo

2016-02-24 Thread Chaehyun Lim
This patch renames struct tstrConnectInfo to connect_info to avoid
camelcase and removes typedef.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/coreconfigurator.h   |  4 ++--
 drivers/staging/wilc1000/host_interface.c | 12 ++--
 drivers/staging/wilc1000/host_interface.h |  2 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h 
b/drivers/staging/wilc1000/coreconfigurator.h
index 748199d..0f39bc8 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -105,14 +105,14 @@ struct connect_resp_info {
u16 ies_len;
 };
 
-typedef struct {
+struct connect_info {
u8 au8bssid[6];
u8 *pu8ReqIEs;
size_t ReqIEsLen;
u8 *pu8RespIEs;
u16 u16RespIEsLen;
u16 u16ConnectStatus;
-} tstrConnectInfo;
+};
 
 typedef struct {
u16 u16reason;
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 2ace069..b093304 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1147,11 +1147,11 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 
 ERRORHANDLER:
if (result) {
-   tstrConnectInfo strConnectInfo;
+   struct connect_info strConnectInfo;
 
del_timer(&hif_drv->connect_timer);
 
-   memset(&strConnectInfo, 0, sizeof(tstrConnectInfo));
+   memset(&strConnectInfo, 0, sizeof(struct connect_info));
 
if (pstrHostIFconnectAttr->result) {
if (pstrHostIFconnectAttr->bssid)
@@ -1242,7 +1242,7 @@ static s32 Handle_FlushConnect(struct wilc_vif *vif)
 static s32 Handle_ConnectTimeout(struct wilc_vif *vif)
 {
s32 result = 0;
-   tstrConnectInfo strConnectInfo;
+   struct connect_info strConnectInfo;
struct wid wid;
u16 u16DummyReasonCode = 0;
struct host_if_drv *hif_drv = vif->hif_drv;
@@ -1256,7 +1256,7 @@ static s32 Handle_ConnectTimeout(struct wilc_vif *vif)
 
scan_while_connected = false;
 
-   memset(&strConnectInfo, 0, sizeof(tstrConnectInfo));
+   memset(&strConnectInfo, 0, sizeof(struct connect_info));
 
if (hif_drv->usr_conn_req.conn_result) {
if (hif_drv->usr_conn_req.bssid) {
@@ -1410,7 +1410,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
u8 u8MacStatus;
u8 u8MacStatusReasonCode;
u8 u8MacStatusAdditionalInfo;
-   tstrConnectInfo strConnectInfo;
+   struct connect_info strConnectInfo;
tstrDisconnectNotifInfo strDisconnectNotifInfo;
s32 s32Err = 0;
struct host_if_drv *hif_drv = vif->hif_drv;
@@ -1447,7 +1447,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
u32 u32RcvdAssocRespInfoLen = 0;
struct connect_resp_info *pstrConnectRespInfo = NULL;
 
-   memset(&strConnectInfo, 0, sizeof(tstrConnectInfo));
+   memset(&strConnectInfo, 0, sizeof(struct connect_info));
 
if (u8MacStatus == MAC_CONNECTED) {
memset(rcv_assoc_resp, 0, 
MAX_ASSOC_RESP_FRAME_SIZE);
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index f70ad7a..f4a3e4f 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -172,7 +172,7 @@ typedef void (*wilc_scan_result)(enum scan_event, struct 
network_info *,
 void *, void *);
 
 typedef void (*wilc_connect_result)(enum conn_event,
-tstrConnectInfo *,
+struct connect_info *,
 u8,
 tstrDisconnectNotifInfo *,
 void *);
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 21f0f18..52553a5 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -479,7 +479,7 @@ static void CfgScanResult(enum scan_event scan_event,
 int wilc_connecting;
 
 static void CfgConnectResult(enum conn_event enuConnDisconnEvent,
-tstrConnectInfo *pstrConnectInfo,
+struct connect_info *pstrConnectInfo,
 u8 u8MacStatus,
 tstrDisconnectNotifInfo *pstrDisconnectNotifInfo,
 void *pUserVoid)
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/9] staging: wilc1000: rename au8bssid in struct connect_info

2016-02-24 Thread Chaehyun Lim
This patch renames au8bssid to bssid to remove au8 prefix in struct
connect_info. There is no need to use prefix to show data type of this
variable.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/coreconfigurator.h   | 2 +-
 drivers/staging/wilc1000/host_interface.c | 6 +++---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h 
b/drivers/staging/wilc1000/coreconfigurator.h
index 0f39bc8..a32f466 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -106,7 +106,7 @@ struct connect_resp_info {
 };
 
 struct connect_info {
-   u8 au8bssid[6];
+   u8 bssid[6];
u8 *pu8ReqIEs;
size_t ReqIEsLen;
u8 *pu8RespIEs;
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index b093304..4a1bad8 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1155,7 +1155,7 @@ ERRORHANDLER:
 
if (pstrHostIFconnectAttr->result) {
if (pstrHostIFconnectAttr->bssid)
-   memcpy(strConnectInfo.au8bssid, 
pstrHostIFconnectAttr->bssid, 6);
+   memcpy(strConnectInfo.bssid, 
pstrHostIFconnectAttr->bssid, 6);
 
if (pstrHostIFconnectAttr->ies) {
strConnectInfo.ReqIEsLen = 
pstrHostIFconnectAttr->ies_len;
@@ -1260,7 +1260,7 @@ static s32 Handle_ConnectTimeout(struct wilc_vif *vif)
 
if (hif_drv->usr_conn_req.conn_result) {
if (hif_drv->usr_conn_req.bssid) {
-   memcpy(strConnectInfo.au8bssid,
+   memcpy(strConnectInfo.bssid,
   hif_drv->usr_conn_req.bssid, 6);
}
 
@@ -1492,7 +1492,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
}
 
if (hif_drv->usr_conn_req.bssid) {
-   memcpy(strConnectInfo.au8bssid, 
hif_drv->usr_conn_req.bssid, 6);
+   memcpy(strConnectInfo.bssid, 
hif_drv->usr_conn_req.bssid, 6);
 
if ((u8MacStatus == MAC_CONNECTED) &&
(strConnectInfo.u16ConnectStatus == 
SUCCESSFUL_STATUSCODE)) {
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 52553a5..1605199 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -521,12 +521,12 @@ static void CfgConnectResult(enum conn_event 
enuConnDisconnEvent,
bool bNeedScanRefresh = false;
u32 i;
 
-   memcpy(priv->au8AssociatedBss, 
pstrConnectInfo->au8bssid, ETH_ALEN);
+   memcpy(priv->au8AssociatedBss, pstrConnectInfo->bssid, 
ETH_ALEN);
 
 
for (i = 0; i < last_scanned_cnt; i++) {
if (memcmp(last_scanned_shadow[i].bssid,
-  pstrConnectInfo->au8bssid,
+  pstrConnectInfo->bssid,
   ETH_ALEN) == 0) {
unsigned long now = jiffies;
 
@@ -543,7 +543,7 @@ static void CfgConnectResult(enum conn_event 
enuConnDisconnEvent,
refresh_scan(priv, 1, true);
}
 
-   cfg80211_connect_result(dev, pstrConnectInfo->au8bssid,
+   cfg80211_connect_result(dev, pstrConnectInfo->bssid,
pstrConnectInfo->pu8ReqIEs, 
pstrConnectInfo->ReqIEsLen,
pstrConnectInfo->pu8RespIEs, 
pstrConnectInfo->u16RespIEsLen,
u16ConnectStatus, GFP_KERNEL);
-- 
2.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH] Drivers: hv: util: fix a race with daemons startup

2016-02-24 Thread KY Srinivasan


> -Original Message-
> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> Sent: Thursday, February 18, 2016 5:35 AM
> To: de...@linuxdriverproject.org
> Cc: KY Srinivasan ; Haiyang Zhang
> ; Olaf Hering ; Cathy Avery
> 
> Subject: [PATCH] Drivers: hv: util: fix a race with daemons startup
> 
> Commit 3cace4a61610 ("Drivers: hv: utils: run polling callback always in
> interrupt context") removed direct *_transaction.state = HVUTIL_READY
> assignments from *_handle_handshake() functions introducing the following
> race: if a userspace daemon connects before we get first non-negotiation
> request from the server hv_poll_channel() won't set transaction state to
> HVUTIL_READY as (!channel) condition will fail, we set it to non-NULL on
> the first real request from the server. Solve the issue by transferring
> the transaction state to HVUTIL_READY directly from all handshake
> functions.
> 
> Fixes: 3cace4a61610 ("Drivers: hv: utils: run polling callback always in
> interrupt context")
> Signed-off-by: Vitaly Kuznetsov 
> ---
>  drivers/hv/hv_fcopy.c| 1 +
>  drivers/hv/hv_kvp.c  | 1 +
>  drivers/hv/hv_snapshot.c | 1 +
>  3 files changed, 3 insertions(+)
> 
> diff --git a/drivers/hv/hv_fcopy.c b/drivers/hv/hv_fcopy.c
> index c37a71e..e18b85b 100644
> --- a/drivers/hv/hv_fcopy.c
> +++ b/drivers/hv/hv_fcopy.c
> @@ -108,6 +108,7 @@ static int fcopy_handle_handshake(u32 version)
>   return -EINVAL;
>   }
>   pr_debug("FCP: userspace daemon ver. %d registered\n", version);
> + fcopy_transaction.state = HVUTIL_READY;
>   hv_poll_channel(fcopy_transaction.recv_channel,
> fcopy_poll_wrapper);
>   return 0;
>  }
> diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c
> index d4ab81b..1162afb 100644
> --- a/drivers/hv/hv_kvp.c
> +++ b/drivers/hv/hv_kvp.c
> @@ -154,6 +154,7 @@ static int kvp_handle_handshake(struct hv_kvp_msg
> *msg)
>   pr_debug("KVP: userspace daemon ver. %d registered\n",
>KVP_OP_REGISTER);
>   kvp_register(dm_reg_value);
> + kvp_transaction.state = HVUTIL_READY;
>   hv_poll_channel(kvp_transaction.recv_channel, kvp_poll_wrapper);
> 
>   return 0;
> diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv/hv_snapshot.c
> index 67def4a..489203b 100644
> --- a/drivers/hv/hv_snapshot.c
> +++ b/drivers/hv/hv_snapshot.c
> @@ -113,6 +113,7 @@ static int vss_handle_handshake(struct hv_vss_msg
> *vss_msg)
>   default:
>   return -EINVAL;
>   }
> + vss_transaction.state = HVUTIL_READY;
>   hv_poll_channel(vss_transaction.recv_channel, vss_poll_wrapper);
>   pr_debug("VSS: userspace daemon ver. %d registered\n",
> dm_reg_value);
>   return 0;

Vitaly, there is a simpler and a safer fix to this issue - stash away the 
channel pointer early on and so we don't
need to set it on each transaction. This would address the issue on hand here. 
This would also eliminate
setting the state only in the interrupt handler. I am putting together a batch 
of patches to send and if it is
ok with you, I will drop this patch and include a patch on the lines described 
above.

Regards,

K. Y
> --
> 2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/5] hv: Reverse order of resources in hyperv_mmio

2016-02-24 Thread jakeo
From: Jake Oshins 

A patch later in this series allocates child nodes
in this resource tree.  For that to work, this tree
needs to be sorted in ascending order.

Signed-off-by: Jake Oshins 
---
 drivers/hv/vmbus_drv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 1da18e1..b090548 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1090,7 +1090,6 @@ static acpi_status vmbus_walk_resources(struct 
acpi_resource *res, void *ctx)
new_res->end = end;
 
/*
-* Stick ranges from higher in address space at the front of the list.
 * If two ranges are adjacent, merge them.
 */
do {
@@ -,7 +1110,7 @@ static acpi_status vmbus_walk_resources(struct 
acpi_resource *res, void *ctx)
break;
}
 
-   if ((*old_res)->end < new_res->start) {
+   if ((*old_res)->start > new_res->end) {
new_res->sibling = *old_res;
if (prev_res)
(*prev_res)->sibling = new_res;
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/5] hv: Track allocations of children of hv_vmbus in private resource tree

2016-02-24 Thread jakeo
From: Jake Oshins 

This patch changes vmbus_allocate_mmio() and vmbus_free_mmio() so
that when child paravirtual devices allocate memory-mapped I/O
space, they allocate it privately from a resource tree pointed
at by hyperv_mmio and also by the public resource tree
iomem_resource.  This allows the region to be marked as "busy"
in the private tree, but a "bridge window" in the public tree,
guaranteeing that no two bridge windows will overlap each other
but while also allowing the PCI device children of the bridge
windows to overlap that window.

One might conclude that this belongs in the pnp layer, rather
than in this driver.  Rafael Wysocki, the maintainter of the
pnp layer, has previously asked that we not modify the pnp layer
as it is considered deprecated.  This patch is thus essentially
a workaround.

Signed-off-by: Jake Oshins 
---
 drivers/hv/vmbus_drv.c | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index b090548..2a7eb3f 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1169,7 +1169,7 @@ int vmbus_allocate_mmio(struct resource **new, struct 
hv_device *device_obj,
resource_size_t size, resource_size_t align,
bool fb_overlap_ok)
 {
-   struct resource *iter;
+   struct resource *iter, *shadow;
resource_size_t range_min, range_max, start, local_min, local_max;
const char *dev_n = dev_name(&device_obj->device);
u32 fb_end = screen_info.lfb_base + (screen_info.lfb_size << 1);
@@ -1211,12 +1211,22 @@ int vmbus_allocate_mmio(struct resource **new, struct 
hv_device *device_obj,
 
start = (local_min + align - 1) & ~(align - 1);
for (; start + size - 1 <= local_max; start += align) {
+   shadow = __request_region(iter, start,
+ size,
+ NULL,
+ IORESOURCE_BUSY);
+   if (!shadow)
+   continue;
+
*new = request_mem_region_exclusive(start, size,
dev_n);
if (*new) {
+   shadow->name = (char*)*new;
retval = 0;
goto exit;
}
+
+   __release_region(iter, start, size);
}
}
}
@@ -1237,7 +1247,17 @@ EXPORT_SYMBOL_GPL(vmbus_allocate_mmio);
  */
 void vmbus_free_mmio(resource_size_t start, resource_size_t size)
 {
+   struct resource *iter;
+
+   down(&hyperv_mmio_lock);
+   for (iter = hyperv_mmio; iter; iter = iter->sibling) {
+   if ((iter->start >= start + size) || (iter->end <= start))
+   continue;
+
+   __release_region(iter, start, size);
+   }
release_mem_region(start, size);
+   up(&hyperv_mmio_lock);
 
 }
 EXPORT_SYMBOL_GPL(vmbus_free_mmio);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/5] hv: Make a function to free mmio regions through vmbus

2016-02-24 Thread jakeo
From: Jake Oshins 

This patch introduces a function that reverses everything
done by vmbus_allocate_mmio().  Existing code just called
release_mem_region().  Future patches in this series
require a more complex sequence of actions, so this function
is introduced to wrap those actions.

Signed-off-by: Jake Oshins 
---
 drivers/hv/vmbus_drv.c | 15 +++
 include/linux/hyperv.h |  2 +-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 063e5f5..69393ff 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1221,6 +1221,21 @@ int vmbus_allocate_mmio(struct resource **new, struct 
hv_device *device_obj,
 EXPORT_SYMBOL_GPL(vmbus_allocate_mmio);
 
 /**
+ * vmbus_free_mmio() - Free a memory-mapped I/O range.
+ * @start: Base address of region to release.
+ * @size:  Size of the range to be allocated
+ *
+ * This function releases anything requested by
+ * vmbus_mmio_allocate().
+ */
+void vmbus_free_mmio(resource_size_t start, resource_size_t size)
+{
+   release_mem_region(start, size);
+
+}
+EXPORT_SYMBOL_GPL(vmbus_free_mmio);
+
+/**
  * vmbus_cpu_number_to_vp_number() - Map CPU to VP.
  * @cpu_number: CPU number in Linux terms
  *
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index a32704d..f3e0c71 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -1091,7 +1091,7 @@ int vmbus_allocate_mmio(struct resource **new, struct 
hv_device *device_obj,
resource_size_t min, resource_size_t max,
resource_size_t size, resource_size_t align,
bool fb_overlap_ok);
-
+void vmbus_free_mmio(resource_size_t start, resource_size_t size);
 int vmbus_cpu_number_to_vp_number(int cpu_number);
 u64 hv_do_hypercall(u64 control, void *input, void *output);
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/5] hv: Lock access to hyperv_mmio resource tree

2016-02-24 Thread jakeo
From: Jake Oshins 

In existing code, this tree of resources is created
in single-threaded code and never modified after it is
created, and thus needs no locking.  This patch introduces
a semaphore for tree access, as other patches in this
series introduce run-time modifications of this resource
tree which can happen on multiple threads.

Signed-off-by: Jake Oshins 
---
 drivers/hv/vmbus_drv.c | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 69393ff..1da18e1 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -103,6 +103,7 @@ static struct notifier_block hyperv_panic_block = {
 };
 
 struct resource *hyperv_mmio;
+DEFINE_SEMAPHORE(hyperv_mmio_lock);
 
 static int vmbus_exists(void)
 {
@@ -1173,7 +1174,10 @@ int vmbus_allocate_mmio(struct resource **new, struct 
hv_device *device_obj,
resource_size_t range_min, range_max, start, local_min, local_max;
const char *dev_n = dev_name(&device_obj->device);
u32 fb_end = screen_info.lfb_base + (screen_info.lfb_size << 1);
-   int i;
+   int i, retval;
+
+   retval = -ENXIO;
+   down(&hyperv_mmio_lock);
 
for (iter = hyperv_mmio; iter; iter = iter->sibling) {
if ((iter->start >= max) || (iter->end <= min))
@@ -1210,13 +1214,17 @@ int vmbus_allocate_mmio(struct resource **new, struct 
hv_device *device_obj,
for (; start + size - 1 <= local_max; start += align) {
*new = request_mem_region_exclusive(start, size,
dev_n);
-   if (*new)
-   return 0;
+   if (*new) {
+   retval = 0;
+   goto exit;
+   }
}
}
}
 
-   return -ENXIO;
+exit:
+   up(&hyperv_mmio_lock);
+   return retval;
 }
 EXPORT_SYMBOL_GPL(vmbus_allocate_mmio);
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/5] hv: drivers: Ensure that bridge windows don't overlap

2016-02-24 Thread jakeo
From: Jake Oshins 

Hyper-V VMs expose paravirtual drivers through a mechanism called
VMBus, which is managed by hv_vmbus.ko.  For each paravirtual service
instance, this driver exposes a new child device.  Some of these child
devices need memory address space, into which Hyper-V will map things
like the virtual video framebuffer.  This memory-mapped address space
is chosen by the guest OS, not the hypervisor.

This is difficult to map onto the Linux pnp layer, as the code in the
pnp layer to choose MMIO space keys off of bus type and it doesn't know
anything about VMBus.  The maintainers of the pnp layer have asked that
we not offer patches to it that make it understand VMBus, but that we
rather find ways of using the code in its current state.  So hv_vmbus.ko
exports a function, vmbus_allocate_mmio() for choosing the address space
for any child driver that needs this facility.

The recently introduced PCI front-end driver for Hyper-V VMs
(pci-hyperv.ko) uses vmbus_allocate_mmio() for choosing both the region
of memory into which PCI configuration space can be mapped and the
region of memory into which real PCI Express devices which are passed
through to the VM should occupy.  The regions allocated are made to look
like root PCI bus bridge windows to the PCI driver, reusing all the code
in the PCI driver for the rest of the PCI device management.

The problem is that these bridge windows are marked in such a way that
devices can still allocate from the memory space spanned by them, and
this means that if two different PCI buses are created in the VM, each
with devices under them, they may allocate the same memory space, leading
to PCI Base Address Registers which overlap.

This patch series fixes the problem by tracking allocations to child
devices in a separate resource tree, marking them such that the bridge
windows can't overlap.  The main memory resource tree, iomem_resource,
contains resources properly marked as bridge windows, allowing their
children to overlap with them.

Jake Oshins (5):
  hv: Make a function to free mmio regions through vmbus
  hv: Lock access to hyperv_mmio resource tree
  hv: Use new vmbus_mmio_free() from client drivers.
  hv: Reverse order of resources in hyperv_mmio
  hv: Track allocations of children of hv_vmbus in private resource tree

 drivers/hv/vmbus_drv.c  | 56 +++--
 drivers/pci/host/pci-hyperv.c   | 14 +--
 drivers/video/fbdev/hyperv_fb.c |  4 +--
 include/linux/hyperv.h  |  2 +-
 4 files changed, 59 insertions(+), 17 deletions(-)

--
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


  1   2   >