* [gentoo-commits] proj/sci:master commit in: sys-cluster/lustre/files/, sys-cluster/lustre/
@ 2014-11-13 0:15 Christoph Junghans
0 siblings, 0 replies; 5+ messages in thread
From: Christoph Junghans @ 2014-11-13 0:15 UTC (permalink / raw
To: gentoo-commits
commit: 8b2bccbccf68519e9ab8b1bb748a3da2ee657714
Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 12 11:42:50 2014 +0000
Commit: Christoph Junghans <ottxor <AT> gentoo <DOT> org>
CommitDate: Wed Nov 12 11:42:50 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=8b2bccbc
sys-cluster/lustre: Move large patch into patch dir
Package-Manager: portage-2.2.14
---
sys-cluster/lustre/ChangeLog | 4 +
...cfs-move-mdd-ofd-proc-handling-to-seq_fil.patch | 2082 --------------------
sys-cluster/lustre/lustre-9999.ebuild | 4 +-
3 files changed, 6 insertions(+), 2084 deletions(-)
diff --git a/sys-cluster/lustre/ChangeLog b/sys-cluster/lustre/ChangeLog
index 850f52b..185fd54 100644
--- a/sys-cluster/lustre/ChangeLog
+++ b/sys-cluster/lustre/ChangeLog
@@ -2,6 +2,10 @@
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 12 Nov 2014; Justin Lecher <jlec@gentoo.org> lustre-9999.ebuild,
+ -files/0002-LU-3319-procfs-move-mdd-ofd-proc-handling-to-seq_fil.patch:
+ Move large patch into patch dir
+
29 May 2014; Alexey Shvetsov <alexxy@gentoo.org>
files/0001-LU-3319-procfs-update-zfs-proc-handling-to-seq_files.patch,
files/0002-LU-3319-procfs-move-mdd-ofd-proc-handling-to-seq_fil.patch,
diff --git a/sys-cluster/lustre/files/0002-LU-3319-procfs-move-mdd-ofd-proc-handling-to-seq_fil.patch b/sys-cluster/lustre/files/0002-LU-3319-procfs-move-mdd-ofd-proc-handling-to-seq_fil.patch
deleted file mode 100644
index 813446c..0000000
--- a/sys-cluster/lustre/files/0002-LU-3319-procfs-move-mdd-ofd-proc-handling-to-seq_fil.patch
+++ /dev/null
@@ -1,2082 +0,0 @@
-From 9071634fd9db37a6121fdfbd817162f782661202 Mon Sep 17 00:00:00 2001
-From: James Simmons <uja.ornl@gmail.com>
-Date: Mon, 5 May 2014 10:02:21 -0400
-Subject: [PATCH 2/3] LU-3319 procfs: move mdd/ofd proc handling to seq_files
-
-With 3.10 linux kernel and above proc handling now only
-uses struct seq_files. This patch migrates the mdd/ofd
-layer proc entries over to using seq_files.
-
-Signed-off-by: James Simmons <uja.ornl@gmail.com>
-Change-Id: I61b7df6bfd5efd0f12e3ca1a1813b7b62d493168
----
- lustre/include/lustre_lfsck.h | 6 +-
- lustre/lfsck/lfsck_internal.h | 9 +-
- lustre/lfsck/lfsck_layout.c | 132 ++++-------
- lustre/lfsck/lfsck_lib.c | 88 +++-----
- lustre/lfsck/lfsck_namespace.c | 75 ++-----
- lustre/mdd/mdd_device.c | 25 +--
- lustre/mdd/mdd_internal.h | 1 -
- lustre/mdd/mdd_lproc.c | 302 ++++++++++++-------------
- lustre/ofd/lproc_ofd.c | 490 +++++++++++++++++++++--------------------
- lustre/ofd/ofd_dev.c | 90 ++++----
- lustre/ofd/ofd_internal.h | 6 +-
- 11 files changed, 543 insertions(+), 681 deletions(-)
-
-diff --git a/lustre/include/lustre_lfsck.h b/lustre/include/lustre_lfsck.h
-index 0d6f666..5adbffe 100644
---- a/lustre/include/lustre_lfsck.h
-+++ b/lustre/include/lustre_lfsck.h
-@@ -148,12 +148,12 @@ int lfsck_in_notify(const struct lu_env *env, struct dt_device *key,
- int lfsck_query(const struct lu_env *env, struct dt_device *key,
- struct lfsck_request *lr);
-
--int lfsck_get_speed(struct dt_device *key, void *buf, int len);
-+int lfsck_get_speed(struct seq_file *m, struct dt_device *key);
- int lfsck_set_speed(struct dt_device *key, int val);
--int lfsck_get_windows(struct dt_device *key, void *buf, int len);
-+int lfsck_get_windows(struct seq_file *m, struct dt_device *key);
- int lfsck_set_windows(struct dt_device *key, int val);
-
--int lfsck_dump(struct dt_device *key, void *buf, int len, enum lfsck_type type);
-+int lfsck_dump(struct seq_file *m, struct dt_device *key, enum lfsck_type type);
-
- static inline void lfsck_pack_rfa(struct lfsck_request *lr,
- const struct lu_fid *fid)
-diff --git a/lustre/lfsck/lfsck_internal.h b/lustre/lfsck/lfsck_internal.h
-index 24b84ae..203ad74 100644
---- a/lustre/lfsck/lfsck_internal.h
-+++ b/lustre/lfsck/lfsck_internal.h
-@@ -303,8 +303,7 @@ struct lfsck_operations {
-
- int (*lfsck_dump)(const struct lu_env *env,
- struct lfsck_component *com,
-- char *buf,
-- int len);
-+ struct seq_file *m);
-
- int (*lfsck_double_scan)(const struct lu_env *env,
- struct lfsck_component *com);
-@@ -590,10 +589,10 @@ void lfsck_component_cleanup(const struct lu_env *env,
- struct lfsck_component *com);
- void lfsck_instance_cleanup(const struct lu_env *env,
- struct lfsck_instance *lfsck);
--int lfsck_bits_dump(char **buf, int *len, int bits, const char *names[],
-+int lfsck_bits_dump(struct seq_file *m, int bits, const char *names[],
- const char *prefix);
--int lfsck_time_dump(char **buf, int *len, __u64 time, const char *prefix);
--int lfsck_pos_dump(char **buf, int *len, struct lfsck_position *pos,
-+int lfsck_time_dump(struct seq_file *m, __u64 time, const char *prefix);
-+int lfsck_pos_dump(struct seq_file *m, struct lfsck_position *pos,
- const char *prefix);
- void lfsck_pos_fill(const struct lu_env *env, struct lfsck_instance *lfsck,
- struct lfsck_position *pos, bool init);
-diff --git a/lustre/lfsck/lfsck_layout.c b/lustre/lfsck/lfsck_layout.c
-index ced2e4d..e2df62d 100644
---- a/lustre/lfsck/lfsck_layout.c
-+++ b/lustre/lfsck/lfsck_layout.c
-@@ -492,7 +492,7 @@ static struct lfsck_rbtree_node *lfsck_rbtree_new(const struct lu_env *env,
- return ERR_PTR(-ENOMEM);
- }
-
-- rb_init_node(&lrn->lrn_node);
-+ RB_CLEAR_NODE(&lrn->lrn_node);
- lrn->lrn_seq = fid_seq(fid);
- lrn->lrn_first_oid = fid_oid(fid) & ~LFSCK_RBTREE_BITMAP_MASK;
- atomic_set(&lrn->lrn_known_count, 0);
-@@ -4873,69 +4873,53 @@ static int lfsck_layout_slave_post(const struct lu_env *env,
- }
-
- static int lfsck_layout_dump(const struct lu_env *env,
-- struct lfsck_component *com, char *buf, int len)
-+ struct lfsck_component *com, struct seq_file *m)
- {
- struct lfsck_instance *lfsck = com->lc_lfsck;
- struct lfsck_bookmark *bk = &lfsck->li_bookmark_ram;
- struct lfsck_layout *lo = com->lc_file_ram;
-- int save = len;
-- int ret = -ENOSPC;
- int rc;
-
- down_read(&com->lc_sem);
-- rc = snprintf(buf, len,
-- "name: lfsck_layout\n"
-+ seq_printf(m, "name: lfsck_layout\n"
- "magic: %#x\n"
- "version: %d\n"
- "status: %s\n",
- lo->ll_magic,
- bk->lb_version,
- lfsck_status2names(lo->ll_status));
-- if (rc <= 0)
-- goto out;
-
-- buf += rc;
-- len -= rc;
-- rc = lfsck_bits_dump(&buf, &len, lo->ll_flags, lfsck_flags_names,
-- "flags");
-+ rc = lfsck_bits_dump(m, lo->ll_flags, lfsck_flags_names, "flags");
- if (rc < 0)
- goto out;
-
-- rc = lfsck_bits_dump(&buf, &len, bk->lb_param, lfsck_param_names,
-- "param");
-+ rc = lfsck_bits_dump(m, bk->lb_param, lfsck_param_names, "param");
- if (rc < 0)
- goto out;
-
-- rc = lfsck_time_dump(&buf, &len, lo->ll_time_last_complete,
-+ rc = lfsck_time_dump(m, lo->ll_time_last_complete,
- "time_since_last_completed");
- if (rc < 0)
- goto out;
-
-- rc = lfsck_time_dump(&buf, &len, lo->ll_time_latest_start,
-+ rc = lfsck_time_dump(m, lo->ll_time_latest_start,
- "time_since_latest_start");
- if (rc < 0)
- goto out;
-
-- rc = lfsck_time_dump(&buf, &len, lo->ll_time_last_checkpoint,
-+ rc = lfsck_time_dump(m, lo->ll_time_last_checkpoint,
- "time_since_last_checkpoint");
- if (rc < 0)
- goto out;
-
-- rc = snprintf(buf, len,
-- "latest_start_position: "LPU64"\n"
-+ seq_printf(m, "latest_start_position: "LPU64"\n"
- "last_checkpoint_position: "LPU64"\n"
- "first_failure_position: "LPU64"\n",
- lo->ll_pos_latest_start,
- lo->ll_pos_last_checkpoint,
- lo->ll_pos_first_inconsistent);
-- if (rc <= 0)
-- goto out;
-
-- buf += rc;
-- len -= rc;
--
-- rc = snprintf(buf, len,
-- "success_count: %u\n"
-+ seq_printf(m, "success_count: %u\n"
- "repaired_dangling: "LPU64"\n"
- "repaired_unmatched_pair: "LPU64"\n"
- "repaired_multiple_referenced: "LPU64"\n"
-@@ -4955,11 +4939,6 @@ static int lfsck_layout_dump(const struct lu_env *env,
- lo->ll_objs_skipped,
- lo->ll_objs_failed_phase1,
- lo->ll_objs_failed_phase2);
-- if (rc <= 0)
-- goto out;
--
-- buf += rc;
-- len -= rc;
-
- if (lo->ll_status == LS_SCANNING_PHASE1) {
- __u64 pos;
-@@ -4977,8 +4956,7 @@ static int lfsck_layout_dump(const struct lu_env *env,
- do_div(new_checked, duration);
- if (rtime != 0)
- do_div(speed, rtime);
-- rc = snprintf(buf, len,
-- "checked_phase1: "LPU64"\n"
-+ seq_printf(m, "checked_phase1: "LPU64"\n"
- "checked_phase2: "LPU64"\n"
- "run_time_phase1: %u seconds\n"
- "run_time_phase2: %u seconds\n"
-@@ -4992,11 +4970,6 @@ static int lfsck_layout_dump(const struct lu_env *env,
- lo->ll_run_time_phase2,
- speed,
- new_checked);
-- if (rc <= 0)
-- goto out;
--
-- buf += rc;
-- len -= rc;
-
- LASSERT(lfsck->li_di_oit != NULL);
-
-@@ -5009,12 +4982,8 @@ static int lfsck_layout_dump(const struct lu_env *env,
- pos = iops->store(env, lfsck->li_di_oit);
- if (!lfsck->li_current_oit_processed)
- pos--;
-- rc = snprintf(buf, len, "current_position: "LPU64"\n", pos);
-- if (rc <= 0)
-- goto out;
-+ seq_printf(m, "current_position: "LPU64"\n", pos);
-
-- buf += rc;
-- len -= rc;
- } else if (lo->ll_status == LS_SCANNING_PHASE2) {
- cfs_duration_t duration = cfs_time_current() -
- lfsck->li_time_last_checkpoint;
-@@ -5032,29 +5001,26 @@ static int lfsck_layout_dump(const struct lu_env *env,
- do_div(speed1, lo->ll_run_time_phase1);
- if (rtime != 0)
- do_div(speed2, rtime);
-- rc = snprintf(buf, len,
-- "checked_phase1: "LPU64"\n"
-- "checked_phase2: "LPU64"\n"
-- "run_time_phase1: %u seconds\n"
-- "run_time_phase2: %u seconds\n"
-- "average_speed_phase1: "LPU64" items/sec\n"
-- "average_speed_phase2: "LPU64" items/sec\n"
-- "real-time_speed_phase1: N/A\n"
-- "real-time_speed_phase2: "LPU64" items/sec\n"
-- "current_position: "DFID"\n",
-- lo->ll_objs_checked_phase1,
-- checked,
-- lo->ll_run_time_phase1,
-- rtime,
-- speed1,
-- speed2,
-- new_checked,
-- PFID(&com->lc_fid_latest_scanned_phase2));
-+ rc = seq_printf(m, "checked_phase1: "LPU64"\n"
-+ "checked_phase2: "LPU64"\n"
-+ "run_time_phase1: %u seconds\n"
-+ "run_time_phase2: %u seconds\n"
-+ "average_speed_phase1: "LPU64" items/sec\n"
-+ "average_speed_phase2: "LPU64" items/sec\n"
-+ "real-time_speed_phase1: N/A\n"
-+ "real-time_speed_phase2: "LPU64" items/sec\n"
-+ "current_position: "DFID"\n",
-+ lo->ll_objs_checked_phase1,
-+ checked,
-+ lo->ll_run_time_phase1,
-+ rtime,
-+ speed1,
-+ speed2,
-+ new_checked,
-+ PFID(&com->lc_fid_latest_scanned_phase2));
- if (rc <= 0)
- goto out;
-
-- buf += rc;
-- len -= rc;
- } else {
- __u64 speed1 = lo->ll_objs_checked_phase1;
- __u64 speed2 = lo->ll_objs_checked_phase2;
-@@ -5063,34 +5029,26 @@ static int lfsck_layout_dump(const struct lu_env *env,
- do_div(speed1, lo->ll_run_time_phase1);
- if (lo->ll_run_time_phase2 != 0)
- do_div(speed2, lo->ll_run_time_phase2);
-- rc = snprintf(buf, len,
-- "checked_phase1: "LPU64"\n"
-- "checked_phase2: "LPU64"\n"
-- "run_time_phase1: %u seconds\n"
-- "run_time_phase2: %u seconds\n"
-- "average_speed_phase1: "LPU64" items/sec\n"
-- "average_speed_phase2: "LPU64" objs/sec\n"
-- "real-time_speed_phase1: N/A\n"
-- "real-time_speed_phase2: N/A\n"
-- "current_position: N/A\n",
-- lo->ll_objs_checked_phase1,
-- lo->ll_objs_checked_phase2,
-- lo->ll_run_time_phase1,
-- lo->ll_run_time_phase2,
-- speed1,
-- speed2);
-- if (rc <= 0)
-- goto out;
--
-- buf += rc;
-- len -= rc;
-+ seq_printf(m, "checked_phase1: "LPU64"\n"
-+ "checked_phase2: "LPU64"\n"
-+ "run_time_phase1: %u seconds\n"
-+ "run_time_phase2: %u seconds\n"
-+ "average_speed_phase1: "LPU64" items/sec\n"
-+ "average_speed_phase2: "LPU64" objs/sec\n"
-+ "real-time_speed_phase1: N/A\n"
-+ "real-time_speed_phase2: N/A\n"
-+ "current_position: N/A\n",
-+ lo->ll_objs_checked_phase1,
-+ lo->ll_objs_checked_phase2,
-+ lo->ll_run_time_phase1,
-+ lo->ll_run_time_phase2,
-+ speed1,
-+ speed2);
- }
-- ret = save - len;
--
- out:
- up_read(&com->lc_sem);
-
-- return ret;
-+ return rc;
- }
-
- static int lfsck_layout_master_double_scan(const struct lu_env *env,
-diff --git a/lustre/lfsck/lfsck_lib.c b/lustre/lfsck/lfsck_lib.c
-index db73616..f6f1cce 100644
---- a/lustre/lfsck/lfsck_lib.c
-+++ b/lustre/lfsck/lfsck_lib.c
-@@ -900,21 +900,15 @@ static inline int lfsck_instance_add(struct lfsck_instance *lfsck)
- return 0;
- }
-
--int lfsck_bits_dump(char **buf, int *len, int bits, const char *names[],
-+int lfsck_bits_dump(struct seq_file *m, int bits, const char *names[],
- const char *prefix)
- {
-- int save = *len;
- int flag;
-- int rc;
- int i;
- bool newline = (bits != 0 ? false : true);
-
-- rc = snprintf(*buf, *len, "%s:%c", prefix, newline ? '\n' : ' ');
-- if (rc <= 0)
-- return -ENOSPC;
-+ seq_printf(m, "%s:%c", prefix, bits != 0 ? ' ' : '\n');
-
-- *buf += rc;
-- *len -= rc;
- for (i = 0, flag = 1; bits != 0; i++, flag = 1 << i) {
- if (flag & bits) {
- bits &= ~flag;
-@@ -922,69 +916,43 @@ int lfsck_bits_dump(char **buf, int *len, int bits, const char *names[],
- if (bits == 0)
- newline = true;
-
-- rc = snprintf(*buf, *len, "%s%c", names[i],
-- newline ? '\n' : ',');
-- if (rc <= 0)
-- return -ENOSPC;
--
-- *buf += rc;
-- *len -= rc;
-+ seq_printf(m, "%s%c", names[i],
-+ newline ? '\n' : ',');
- }
- }
- }
-
-- if (!newline) {
-- rc = snprintf(*buf, *len, "\n");
-- if (rc <= 0)
-- return -ENOSPC;
--
-- *buf += rc;
-- *len -= rc;
-- }
--
-- return save - *len;
-+ if (!newline)
-+ seq_printf(m, "\n");
-+ return 0;
- }
-
--int lfsck_time_dump(char **buf, int *len, __u64 time, const char *prefix)
-+int lfsck_time_dump(struct seq_file *m, __u64 time, const char *prefix)
- {
-- int rc;
--
- if (time != 0)
-- rc = snprintf(*buf, *len, "%s: "LPU64" seconds\n", prefix,
-- cfs_time_current_sec() - time);
-+ seq_printf(m, "%s: "LPU64" seconds\n", prefix,
-+ cfs_time_current_sec() - time);
- else
-- rc = snprintf(*buf, *len, "%s: N/A\n", prefix);
-- if (rc <= 0)
-- return -ENOSPC;
--
-- *buf += rc;
-- *len -= rc;
-- return rc;
-+ seq_printf(m, "%s: N/A\n", prefix);
-+ return 0;
- }
-
--int lfsck_pos_dump(char **buf, int *len, struct lfsck_position *pos,
-+int lfsck_pos_dump(struct seq_file *m, struct lfsck_position *pos,
- const char *prefix)
- {
-- int rc;
--
- if (fid_is_zero(&pos->lp_dir_parent)) {
- if (pos->lp_oit_cookie == 0)
-- rc = snprintf(*buf, *len, "%s: N/A, N/A, N/A\n",
-- prefix);
-+ seq_printf(m, "%s: N/A, N/A, N/A\n",
-+ prefix);
- else
-- rc = snprintf(*buf, *len, "%s: "LPU64", N/A, N/A\n",
-- prefix, pos->lp_oit_cookie);
-+ seq_printf(m, "%s: "LPU64", N/A, N/A\n",
-+ prefix, pos->lp_oit_cookie);
- } else {
-- rc = snprintf(*buf, *len, "%s: "LPU64", "DFID", "LPU64"\n",
-- prefix, pos->lp_oit_cookie,
-- PFID(&pos->lp_dir_parent), pos->lp_dir_cookie);
-+ seq_printf(m, "%s: "LPU64", "DFID", "LPU64"\n",
-+ prefix, pos->lp_oit_cookie,
-+ PFID(&pos->lp_dir_parent), pos->lp_dir_cookie);
- }
-- if (rc <= 0)
-- return -ENOSPC;
--
-- *buf += rc;
-- *len -= rc;
-- return rc;
-+ return 0;
- }
-
- void lfsck_pos_fill(const struct lu_env *env, struct lfsck_instance *lfsck,
-@@ -1670,7 +1638,7 @@ int lfsck_async_request(const struct lu_env *env, struct obd_export *exp,
-
- /* external interfaces */
-
--int lfsck_get_speed(struct dt_device *key, void *buf, int len)
-+int lfsck_get_speed(struct seq_file *m, struct dt_device *key)
- {
- struct lu_env env;
- struct lfsck_instance *lfsck;
-@@ -1683,8 +1651,7 @@ int lfsck_get_speed(struct dt_device *key, void *buf, int len)
-
- lfsck = lfsck_instance_find(key, true, false);
- if (likely(lfsck != NULL)) {
-- rc = snprintf(buf, len, "%u\n",
-- lfsck->li_bookmark_ram.lb_speed_limit);
-+ seq_printf(m, "%u\n", lfsck->li_bookmark_ram.lb_speed_limit);
- lfsck_instance_put(&env, lfsck);
- } else {
- rc = -ENXIO;
-@@ -1724,7 +1691,7 @@ int lfsck_set_speed(struct dt_device *key, int val)
- }
- EXPORT_SYMBOL(lfsck_set_speed);
-
--int lfsck_get_windows(struct dt_device *key, void *buf, int len)
-+int lfsck_get_windows(struct seq_file *m, struct dt_device *key)
- {
- struct lu_env env;
- struct lfsck_instance *lfsck;
-@@ -1737,8 +1704,7 @@ int lfsck_get_windows(struct dt_device *key, void *buf, int len)
-
- lfsck = lfsck_instance_find(key, true, false);
- if (likely(lfsck != NULL)) {
-- rc = snprintf(buf, len, "%u\n",
-- lfsck->li_bookmark_ram.lb_async_windows);
-+ seq_printf(m, "%u\n", lfsck->li_bookmark_ram.lb_async_windows);
- lfsck_instance_put(&env, lfsck);
- } else {
- rc = -ENXIO;
-@@ -1788,7 +1754,7 @@ int lfsck_set_windows(struct dt_device *key, int val)
- }
- EXPORT_SYMBOL(lfsck_set_windows);
-
--int lfsck_dump(struct dt_device *key, void *buf, int len, enum lfsck_type type)
-+int lfsck_dump(struct seq_file *m, struct dt_device *key, enum lfsck_type type)
- {
- struct lu_env env;
- struct lfsck_instance *lfsck;
-@@ -1804,7 +1770,7 @@ int lfsck_dump(struct dt_device *key, void *buf, int len, enum lfsck_type type)
- if (likely(lfsck != NULL)) {
- com = lfsck_component_find(lfsck, type);
- if (likely(com != NULL)) {
-- rc = com->lc_ops->lfsck_dump(&env, com, buf, len);
-+ rc = com->lc_ops->lfsck_dump(&env, com, m);
- lfsck_component_put(&env, com);
- } else {
- rc = -ENOTSUPP;
-diff --git a/lustre/lfsck/lfsck_namespace.c b/lustre/lfsck/lfsck_namespace.c
-index 4dccb70..fc9a0dc 100644
---- a/lustre/lfsck/lfsck_namespace.c
-+++ b/lustre/lfsck/lfsck_namespace.c
-@@ -1099,65 +1099,56 @@ static int lfsck_namespace_post(const struct lu_env *env,
-
- static int
- lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
-- char *buf, int len)
-+ struct seq_file *m)
- {
- struct lfsck_instance *lfsck = com->lc_lfsck;
- struct lfsck_bookmark *bk = &lfsck->li_bookmark_ram;
- struct lfsck_namespace *ns = com->lc_file_ram;
-- int save = len;
-- int ret = -ENOSPC;
- int rc;
-
- down_read(&com->lc_sem);
-- rc = snprintf(buf, len,
-- "name: lfsck_namespace\n"
-- "magic: %#x\n"
-- "version: %d\n"
-- "status: %s\n",
-- ns->ln_magic,
-- bk->lb_version,
-- lfsck_status2names(ns->ln_status));
-- if (rc <= 0)
-- goto out;
--
-- buf += rc;
-- len -= rc;
-- rc = lfsck_bits_dump(&buf, &len, ns->ln_flags, lfsck_flags_names,
-- "flags");
-+ seq_printf(m, "name: lfsck_namespace\n"
-+ "magic: %#x\n"
-+ "version: %d\n"
-+ "status: %s\n",
-+ ns->ln_magic,
-+ bk->lb_version,
-+ lfsck_status2names(ns->ln_status));
-+
-+ rc = lfsck_bits_dump(m, ns->ln_flags, lfsck_flags_names, "flags");
- if (rc < 0)
- goto out;
-
-- rc = lfsck_bits_dump(&buf, &len, bk->lb_param, lfsck_param_names,
-- "param");
-+ rc = lfsck_bits_dump(m, bk->lb_param, lfsck_param_names, "param");
- if (rc < 0)
- goto out;
-
-- rc = lfsck_time_dump(&buf, &len, ns->ln_time_last_complete,
-+ rc = lfsck_time_dump(m, ns->ln_time_last_complete,
- "time_since_last_completed");
- if (rc < 0)
- goto out;
-
-- rc = lfsck_time_dump(&buf, &len, ns->ln_time_latest_start,
-+ rc = lfsck_time_dump(m, ns->ln_time_latest_start,
- "time_since_latest_start");
- if (rc < 0)
- goto out;
-
-- rc = lfsck_time_dump(&buf, &len, ns->ln_time_last_checkpoint,
-+ rc = lfsck_time_dump(m, ns->ln_time_last_checkpoint,
- "time_since_last_checkpoint");
- if (rc < 0)
- goto out;
-
-- rc = lfsck_pos_dump(&buf, &len, &ns->ln_pos_latest_start,
-+ rc = lfsck_pos_dump(m, &ns->ln_pos_latest_start,
- "latest_start_position");
- if (rc < 0)
- goto out;
-
-- rc = lfsck_pos_dump(&buf, &len, &ns->ln_pos_last_checkpoint,
-+ rc = lfsck_pos_dump(m, &ns->ln_pos_last_checkpoint,
- "last_checkpoint_position");
- if (rc < 0)
- goto out;
-
-- rc = lfsck_pos_dump(&buf, &len, &ns->ln_pos_first_inconsistent,
-+ rc = lfsck_pos_dump(m, &ns->ln_pos_first_inconsistent,
- "first_failure_position");
- if (rc < 0)
- goto out;
-@@ -1177,8 +1168,7 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
- do_div(new_checked, duration);
- if (rtime != 0)
- do_div(speed, rtime);
-- rc = snprintf(buf, len,
-- "checked_phase1: "LPU64"\n"
-+ seq_printf(m, "checked_phase1: "LPU64"\n"
- "checked_phase2: "LPU64"\n"
- "updated_phase1: "LPU64"\n"
- "updated_phase2: "LPU64"\n"
-@@ -1214,11 +1204,6 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
- ns->ln_run_time_phase2,
- speed,
- new_checked);
-- if (rc <= 0)
-- goto out;
--
-- buf += rc;
-- len -= rc;
-
- LASSERT(lfsck->li_di_oit != NULL);
-
-@@ -1247,9 +1232,7 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
- pos.lp_dir_cookie = 0;
- }
- spin_unlock(&lfsck->li_lock);
-- rc = lfsck_pos_dump(&buf, &len, &pos, "current_position");
-- if (rc <= 0)
-- goto out;
-+ lfsck_pos_dump(m, &pos, "current_position");
- } else if (ns->ln_status == LS_SCANNING_PHASE2) {
- cfs_duration_t duration = cfs_time_current() -
- lfsck->li_time_last_checkpoint;
-@@ -1267,8 +1250,7 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
- do_div(speed1, ns->ln_run_time_phase1);
- if (rtime != 0)
- do_div(speed2, rtime);
-- rc = snprintf(buf, len,
-- "checked_phase1: "LPU64"\n"
-+ seq_printf(m, "checked_phase1: "LPU64"\n"
- "checked_phase2: "LPU64"\n"
- "updated_phase1: "LPU64"\n"
- "updated_phase2: "LPU64"\n"
-@@ -1307,11 +1289,6 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
- speed2,
- new_checked,
- PFID(&ns->ln_fid_latest_scanned_phase2));
-- if (rc <= 0)
-- goto out;
--
-- buf += rc;
-- len -= rc;
- } else {
- __u64 speed1 = ns->ln_items_checked;
- __u64 speed2 = ns->ln_objs_checked_phase2;
-@@ -1320,8 +1297,7 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
- do_div(speed1, ns->ln_run_time_phase1);
- if (ns->ln_run_time_phase2 != 0)
- do_div(speed2, ns->ln_run_time_phase2);
-- rc = snprintf(buf, len,
-- "checked_phase1: "LPU64"\n"
-+ seq_printf(m, "checked_phase1: "LPU64"\n"
- "checked_phase2: "LPU64"\n"
- "updated_phase1: "LPU64"\n"
- "updated_phase2: "LPU64"\n"
-@@ -1358,17 +1334,10 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
- ns->ln_run_time_phase2,
- speed1,
- speed2);
-- if (rc <= 0)
-- goto out;
--
-- buf += rc;
-- len -= rc;
- }
-- ret = save - len;
--
- out:
- up_read(&com->lc_sem);
-- return ret;
-+ return 0;
- }
-
- static int lfsck_namespace_double_scan_main(void *args)
-diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c
-index 4f0baa4..f6deaca 100644
---- a/lustre/mdd/mdd_device.c
-+++ b/lustre/mdd/mdd_device.c
-@@ -889,16 +889,16 @@ static int mdd_process_config(const struct lu_env *env,
- ENTRY;
-
- switch (cfg->lcfg_command) {
-- case LCFG_PARAM: {
-- struct lprocfs_static_vars lvars;
--
-- lprocfs_mdd_init_vars(&lvars);
-- rc = class_process_proc_param(PARAM_MDD, lvars.obd_vars, cfg,m);
-- if (rc > 0 || rc == -ENOSYS)
-- /* we don't understand; pass it on */
-- rc = next->ld_ops->ldo_process_config(env, next, cfg);
-- break;
-- }
-+ case LCFG_PARAM: {
-+ struct obd_device *obd = mdd2obd_dev(m);
-+
-+ rc = class_process_proc_seq_param(PARAM_MDD, obd->obd_vars,
-+ cfg, m);
-+ if (rc > 0 || rc == -ENOSYS)
-+ /* we don't understand; pass it on */
-+ rc = next->ld_ops->ldo_process_config(env, next, cfg);
-+ break;
-+ }
- case LCFG_SETUP:
- rc = next->ld_ops->ldo_process_config(env, next, cfg);
- if (rc)
-@@ -1566,11 +1566,8 @@ LU_CONTEXT_KEY_DEFINE(mdd, LCT_MD_THREAD);
-
- static int __init mdd_mod_init(void)
- {
-- struct lprocfs_static_vars lvars;
- int rc;
-
-- lprocfs_mdd_init_vars(&lvars);
--
- rc = lu_kmem_init(mdd_caches);
- if (rc)
- return rc;
-@@ -1586,7 +1583,7 @@ static int __init mdd_mod_init(void)
-
- rc = class_register_type(&mdd_obd_device_ops, NULL, true, NULL,
- #ifndef HAVE_ONLY_PROCFS_SEQ
-- lvars.module_vars,
-+ NULL,
- #endif
- LUSTRE_MDD_NAME, &mdd_device_type);
- if (rc)
-diff --git a/lustre/mdd/mdd_internal.h b/lustre/mdd/mdd_internal.h
-index 4411892..37698f8 100644
---- a/lustre/mdd/mdd_internal.h
-+++ b/lustre/mdd/mdd_internal.h
-@@ -248,7 +248,6 @@ int orph_declare_index_delete(const struct lu_env *, struct mdd_object *,
- struct thandle *);
-
- /* mdd_lproc.c */
--void lprocfs_mdd_init_vars(struct lprocfs_static_vars *lvars);
- int mdd_procfs_init(struct mdd_device *mdd, const char *name);
- int mdd_procfs_fini(struct mdd_device *mdd);
-
-diff --git a/lustre/mdd/mdd_lproc.c b/lustre/mdd/mdd_lproc.c
-index de379b3..7ac4afa 100644
---- a/lustre/mdd/mdd_lproc.c
-+++ b/lustre/mdd/mdd_lproc.c
-@@ -49,56 +49,14 @@
- #include <libcfs/libcfs_string.h>
- #include "mdd_internal.h"
-
--int mdd_procfs_init(struct mdd_device *mdd, const char *name)
--{
-- struct lprocfs_static_vars lvars;
-- struct obd_type *type;
-- int rc;
-- ENTRY;
--
-- /* at the moment there is no linkage between lu_type
-- * and obd_type, so we lookup obd_type this way */
-- type = class_search_type(LUSTRE_MDD_NAME);
--
-- LASSERT(name != NULL);
-- LASSERT(type != NULL);
--
-- /* Find the type procroot and add the proc entry for this device */
-- lprocfs_mdd_init_vars(&lvars);
-- mdd->mdd_proc_entry = lprocfs_register(name, type->typ_procroot,
-- lvars.obd_vars, mdd);
-- if (IS_ERR(mdd->mdd_proc_entry)) {
-- rc = PTR_ERR(mdd->mdd_proc_entry);
-- CERROR("Error %d setting up lprocfs for %s\n",
-- rc, name);
-- mdd->mdd_proc_entry = NULL;
-- GOTO(out, rc);
-- }
--
-- rc = 0;
--
-- EXIT;
--out:
-- if (rc)
-- mdd_procfs_fini(mdd);
-- return rc;
--}
--
--int mdd_procfs_fini(struct mdd_device *mdd)
--{
-- if (mdd->mdd_proc_entry) {
-- lprocfs_remove(&mdd->mdd_proc_entry);
-- mdd->mdd_proc_entry = NULL;
-- }
-- RETURN(0);
--}
--
--static int lprocfs_wr_atime_diff(struct file *file, const char *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+mdd_atime_diff_seq_write(struct file *file, const char *buffer,
-+ size_t count, loff_t *off)
- {
-- struct mdd_device *mdd = data;
-- char kernbuf[20], *end;
-- unsigned long diff = 0;
-+ struct seq_file *m = file->private_data;
-+ struct mdd_device *mdd = m->private;
-+ char kernbuf[20], *end;
-+ unsigned long diff = 0;
-
- if (count > (sizeof(kernbuf) - 1))
- return -EINVAL;
-@@ -116,37 +74,35 @@ static int lprocfs_wr_atime_diff(struct file *file, const char *buffer,
- return count;
- }
-
--static int lprocfs_rd_atime_diff(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int mdd_atime_diff_seq_show(struct seq_file *m, void *data)
- {
-- struct mdd_device *mdd = data;
-+ struct mdd_device *mdd = m->private;
-
-- *eof = 1;
-- return snprintf(page, count, "%lu\n", mdd->mdd_atime_diff);
-+ return seq_printf(m, "%lu\n", mdd->mdd_atime_diff);
- }
--
-+LPROC_SEQ_FOPS(mdd_atime_diff);
-
- /**** changelogs ****/
--static int lprocfs_rd_changelog_mask(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int mdd_changelog_mask_seq_show(struct seq_file *m, void *data)
- {
-- struct mdd_device *mdd = data;
-- int i = 0, rc = 0;
--
-- *eof = 1;
-- while (i < CL_LAST) {
-- if (mdd->mdd_cl.mc_mask & (1 << i))
-- rc += snprintf(page + rc, count - rc, "%s ",
-- changelog_type2str(i));
-- i++;
-- }
-- return rc;
-+ struct mdd_device *mdd = m->private;
-+ int i = 0;
-+
-+ while (i < CL_LAST) {
-+ if (mdd->mdd_cl.mc_mask & (1 << i))
-+ seq_printf(m, "%s ", changelog_type2str(i));
-+ i++;
-+ }
-+ seq_printf(m, "\n");
-+ return 0;
- }
-
--static int lprocfs_wr_changelog_mask(struct file *file, const char *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+mdd_changelog_mask_seq_write(struct file *file, const char *buffer,
-+ size_t count, loff_t *off)
- {
-- struct mdd_device *mdd = data;
-+ struct seq_file *m = file->private_data;
-+ struct mdd_device *mdd = m->private;
- char *kernbuf;
- int rc;
- ENTRY;
-@@ -168,45 +124,32 @@ out:
- OBD_FREE(kernbuf, PAGE_CACHE_SIZE);
- return rc;
- }
--
--struct cucb_data {
-- char *page;
-- int count;
-- int idx;
--};
-+LPROC_SEQ_FOPS(mdd_changelog_mask);
-
- static int lprocfs_changelog_users_cb(const struct lu_env *env,
- struct llog_handle *llh,
- struct llog_rec_hdr *hdr, void *data)
- {
-- struct llog_changelog_user_rec *rec;
-- struct cucb_data *cucb = (struct cucb_data *)data;
-+ struct llog_changelog_user_rec *rec;
-+ struct seq_file *m = data;
-
-- LASSERT(llh->lgh_hdr->llh_flags & LLOG_F_IS_PLAIN);
-+ LASSERT(llh->lgh_hdr->llh_flags & LLOG_F_IS_PLAIN);
-
-- rec = (struct llog_changelog_user_rec *)hdr;
-+ rec = (struct llog_changelog_user_rec *)hdr;
-
-- cucb->idx += snprintf(cucb->page + cucb->idx, cucb->count - cucb->idx,
-- CHANGELOG_USER_PREFIX"%-3d "LPU64"\n",
-- rec->cur_id, rec->cur_endrec);
-- if (cucb->idx >= cucb->count)
-- return -ENOSPC;
--
-- return 0;
-+ seq_printf(m, CHANGELOG_USER_PREFIX"%-3d "LPU64"\n",
-+ rec->cur_id, rec->cur_endrec);
-+ return 0;
- }
-
--static int lprocfs_rd_changelog_users(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int mdd_changelog_users_seq_show(struct seq_file *m, void *data)
- {
- struct lu_env env;
-- struct mdd_device *mdd = data;
-+ struct mdd_device *mdd = m->private;
- struct llog_ctxt *ctxt;
-- struct cucb_data cucb;
- __u64 cur;
- int rc;
-
-- *eof = 1;
--
- ctxt = llog_get_context(mdd2obd_dev(mdd),
- LLOG_CHANGELOG_USER_ORIG_CTXT);
- if (ctxt == NULL)
-@@ -223,37 +166,32 @@ static int lprocfs_rd_changelog_users(char *page, char **start, off_t off,
- cur = mdd->mdd_cl.mc_index;
- spin_unlock(&mdd->mdd_cl.mc_lock);
-
-- cucb.count = count;
-- cucb.page = page;
-- cucb.idx = 0;
--
-- cucb.idx += snprintf(cucb.page + cucb.idx, cucb.count - cucb.idx,
-- "current index: "LPU64"\n", cur);
--
-- cucb.idx += snprintf(cucb.page + cucb.idx, cucb.count - cucb.idx,
-- "%-5s %s\n", "ID", "index");
-+ seq_printf(m, "current index: "LPU64"\n", cur);
-+ seq_printf(m, "%-5s %s\n", "ID", "index");
-
- llog_cat_process(&env, ctxt->loc_handle, lprocfs_changelog_users_cb,
-- &cucb, 0, 0);
-+ m, 0, 0);
-
- lu_env_fini(&env);
- llog_ctxt_put(ctxt);
-- return cucb.idx;
-+ return 0;
- }
-+LPROC_SEQ_FOPS_RO(mdd_changelog_users);
-
--static int lprocfs_rd_sync_perm(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int mdd_sync_perm_seq_show(struct seq_file *m, void *data)
- {
-- struct mdd_device *mdd = data;
-+ struct mdd_device *mdd = m->private;
-
-- LASSERT(mdd != NULL);
-- return snprintf(page, count, "%d\n", mdd->mdd_sync_permission);
-+ LASSERT(mdd != NULL);
-+ return seq_printf(m, "%d\n", mdd->mdd_sync_permission);
- }
-
--static int lprocfs_wr_sync_perm(struct file *file, const char *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+mdd_sync_perm_seq_write(struct file *file, const char *buffer,
-+ size_t count, loff_t *off)
- {
-- struct mdd_device *mdd = data;
-+ struct seq_file *m = file->private_data;
-+ struct mdd_device *mdd = m->private;
- int val, rc;
-
- LASSERT(mdd != NULL);
-@@ -264,22 +202,22 @@ static int lprocfs_wr_sync_perm(struct file *file, const char *buffer,
- mdd->mdd_sync_permission = !!val;
- return count;
- }
-+LPROC_SEQ_FOPS(mdd_sync_perm);
-
--static int lprocfs_rd_lfsck_speed_limit(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int mdd_lfsck_speed_limit_seq_show(struct seq_file *m, void *data)
- {
-- struct mdd_device *mdd = data;
-+ struct mdd_device *mdd = m->private;
-
- LASSERT(mdd != NULL);
-- *eof = 1;
--
-- return lfsck_get_speed(mdd->mdd_bottom, page, count);
-+ return lfsck_get_speed(m, mdd->mdd_bottom);
- }
-
--static int lprocfs_wr_lfsck_speed_limit(struct file *file, const char *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+mdd_lfsck_speed_limit_seq_write(struct file *file, const char *buffer,
-+ size_t count, loff_t *off)
- {
-- struct mdd_device *mdd = data;
-+ struct seq_file *m = file->private_data;
-+ struct mdd_device *mdd = m->private;
- __u32 val;
- int rc;
-
-@@ -291,25 +229,22 @@ static int lprocfs_wr_lfsck_speed_limit(struct file *file, const char *buffer,
- rc = lfsck_set_speed(mdd->mdd_bottom, val);
- return rc != 0 ? rc : count;
- }
-+LPROC_SEQ_FOPS(mdd_lfsck_speed_limit);
-
--static int lprocfs_rd_lfsck_async_windows(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int mdd_lfsck_async_windows_seq_show(struct seq_file *m, void *data)
- {
-- struct mdd_device *mdd = data;
-- int rc;
-+ struct mdd_device *mdd = m->private;
-
- LASSERT(mdd != NULL);
-- *eof = 1;
--
-- rc = lfsck_get_windows(mdd->mdd_bottom, page, count);
--
-- return rc != 0 ? rc : count;
-+ return lfsck_get_windows(m, mdd->mdd_bottom);
- }
-
--static int lprocfs_wr_lfsck_async_windows(struct file *file, const char *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+mdd_lfsck_async_windows_seq_write(struct file *file, const char *buffer,
-+ size_t count, loff_t *off)
- {
-- struct mdd_device *mdd = data;
-+ struct seq_file *m = file->private_data;
-+ struct mdd_device *mdd = m->private;
- __u32 val;
- int rc;
-
-@@ -320,54 +255,87 @@ static int lprocfs_wr_lfsck_async_windows(struct file *file, const char *buffer,
-
- return rc != 0 ? rc : count;
- }
-+LPROC_SEQ_FOPS(mdd_lfsck_async_windows);
-
--static int lprocfs_rd_lfsck_namespace(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int mdd_lfsck_namespace_seq_show(struct seq_file *m, void *data)
- {
-- struct mdd_device *mdd = data;
-- int rc;
-+ struct mdd_device *mdd = m->private;
-
- LASSERT(mdd != NULL);
-- *eof = 1;
-
-- rc = lfsck_dump(mdd->mdd_bottom, page, count, LT_NAMESPACE);
-- return rc;
-+ return lfsck_dump(m, mdd->mdd_bottom, LT_NAMESPACE);
- }
-+LPROC_SEQ_FOPS_RO(mdd_lfsck_namespace);
-
--static int lprocfs_rd_lfsck_layout(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int mdd_lfsck_layout_seq_show(struct seq_file *m, void *data)
- {
-- struct mdd_device *mdd = data;
-+ struct mdd_device *mdd = m->private;
-
- LASSERT(mdd != NULL);
-- *eof = 1;
-
-- return lfsck_dump(mdd->mdd_bottom, page, count, LT_LAYOUT);
-+ return lfsck_dump(m, mdd->mdd_bottom, LT_LAYOUT);
- }
--
--static struct lprocfs_vars lprocfs_mdd_obd_vars[] = {
-- { "atime_diff", lprocfs_rd_atime_diff, lprocfs_wr_atime_diff, 0 },
-- { "changelog_mask", lprocfs_rd_changelog_mask,
-- lprocfs_wr_changelog_mask, 0 },
-- { "changelog_users", lprocfs_rd_changelog_users, 0, 0},
-- { "sync_permission", lprocfs_rd_sync_perm, lprocfs_wr_sync_perm, 0 },
-- { "lfsck_speed_limit", lprocfs_rd_lfsck_speed_limit,
-- lprocfs_wr_lfsck_speed_limit, 0 },
-- { "lfsck_async_windows", lprocfs_rd_lfsck_async_windows,
-- lprocfs_wr_lfsck_async_windows, 0 },
-- { "lfsck_namespace", lprocfs_rd_lfsck_namespace, 0, 0 },
-- { "lfsck_layout", lprocfs_rd_lfsck_layout, 0, 0 },
-+LPROC_SEQ_FOPS_RO(mdd_lfsck_layout);
-+
-+static struct lprocfs_seq_vars lprocfs_mdd_obd_vars[] = {
-+ { .name = "atime_diff",
-+ .fops = &mdd_atime_diff_fops },
-+ { .name = "changelog_mask",
-+ .fops = &mdd_changelog_mask_fops },
-+ { .name = "changelog_users",
-+ .fops = &mdd_changelog_users_fops },
-+ { .name = "sync_permission",
-+ .fops = &mdd_sync_perm_fops },
-+ { .name = "lfsck_speed_limit",
-+ .fops = &mdd_lfsck_speed_limit_fops },
-+ { .name = "lfsck_async_windows",
-+ .fops = &mdd_lfsck_async_windows_fops },
-+ { .name = "lfsck_namespace",
-+ .fops = &mdd_lfsck_namespace_fops },
-+ { .name = "lfsck_layout",
-+ .fops = &mdd_lfsck_layout_fops },
- { 0 }
- };
-
--static struct lprocfs_vars lprocfs_mdd_module_vars[] = {
-- { "num_refs", lprocfs_rd_numrefs, 0, 0 },
-- { 0 }
--};
--
--void lprocfs_mdd_init_vars(struct lprocfs_static_vars *lvars)
-+int mdd_procfs_init(struct mdd_device *mdd, const char *name)
- {
-- lvars->module_vars = lprocfs_mdd_module_vars;
-- lvars->obd_vars = lprocfs_mdd_obd_vars;
-+ struct obd_device *obd = class_name2obd(name);
-+ struct obd_type *type;
-+ int rc;
-+ ENTRY;
-+
-+ /* at the moment there is no linkage between lu_type
-+ * and obd_type, so we lookup obd_type this way */
-+ type = class_search_type(LUSTRE_MDD_NAME);
-+
-+ LASSERT(name != NULL);
-+ LASSERT(type != NULL);
-+ LASSERT(obd != NULL);
-+
-+ /* Find the type procroot and add the proc entry for this device */
-+ obd->obd_vars = lprocfs_mdd_obd_vars;
-+ mdd->mdd_proc_entry = lprocfs_seq_register(name, type->typ_procroot,
-+ obd->obd_vars, mdd);
-+ if (IS_ERR(mdd->mdd_proc_entry)) {
-+ rc = PTR_ERR(mdd->mdd_proc_entry);
-+ CERROR("Error %d setting up lprocfs for %s\n",
-+ rc, name);
-+ mdd->mdd_proc_entry = NULL;
-+ GOTO(out, rc);
-+ }
-+ rc = 0;
-+ EXIT;
-+out:
-+ if (rc)
-+ mdd_procfs_fini(mdd);
-+ return rc;
- }
-
-+int mdd_procfs_fini(struct mdd_device *mdd)
-+{
-+ if (mdd->mdd_proc_entry) {
-+ lprocfs_remove(&mdd->mdd_proc_entry);
-+ mdd->mdd_proc_entry = NULL;
-+ }
-+ RETURN(0);
-+}
-diff --git a/lustre/ofd/lproc_ofd.c b/lustre/ofd/lproc_ofd.c
-index 359b373..fcde82a 100644
---- a/lustre/ofd/lproc_ofd.c
-+++ b/lustre/ofd/lproc_ofd.c
-@@ -47,81 +47,75 @@
-
- #ifdef LPROCFS
-
--static int lprocfs_ofd_rd_seqs(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_seqs_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = (struct obd_device *)data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- *eof = 1;
-- return snprintf(page, count, "%u\n", ofd->ofd_seq_count);
-+ return seq_printf(m, "%u\n", ofd->ofd_seq_count);
- }
-+LPROC_SEQ_FOPS_RO(ofd_seqs);
-
--static int lprocfs_ofd_rd_tot_dirty(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_tot_dirty_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = (struct obd_device *)data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd;
-
- LASSERT(obd != NULL);
- ofd = ofd_dev(obd->obd_lu_dev);
-- *eof = 1;
-- return snprintf(page, count, LPU64"\n", ofd->ofd_tot_dirty);
-+ return seq_printf(m, LPU64"\n", ofd->ofd_tot_dirty);
- }
-+LPROC_SEQ_FOPS_RO(ofd_tot_dirty);
-
--static int lprocfs_ofd_rd_tot_granted(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_tot_granted_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = (struct obd_device *)data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd;
-
- LASSERT(obd != NULL);
- ofd = ofd_dev(obd->obd_lu_dev);
-- *eof = 1;
-- return snprintf(page, count, LPU64"\n", ofd->ofd_tot_granted);
-+ return seq_printf(m, LPU64"\n", ofd->ofd_tot_granted);
- }
-+LPROC_SEQ_FOPS_RO(ofd_tot_granted);
-
--static int lprocfs_ofd_rd_tot_pending(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_tot_pending_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = (struct obd_device *)data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd;
-
- LASSERT(obd != NULL);
- ofd = ofd_dev(obd->obd_lu_dev);
-- *eof = 1;
-- return snprintf(page, count, LPU64"\n", ofd->ofd_tot_pending);
-+ return seq_printf(m, LPU64"\n", ofd->ofd_tot_pending);
- }
-+LPROC_SEQ_FOPS_RO(ofd_tot_pending);
-
--static int lprocfs_ofd_rd_grant_precreate(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_grant_precreate_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = (struct obd_device *)data;
-+ struct obd_device *obd = m->private;
-
- LASSERT(obd != NULL);
-- *eof = 1;
-- return snprintf(page, count, "%ld\n",
-- obd->obd_self_export->exp_filter_data.fed_grant);
-+ return seq_printf(m, "%ld\n",
-+ obd->obd_self_export->exp_filter_data.fed_grant);
- }
-+LPROC_SEQ_FOPS_RO(ofd_grant_precreate);
-
--static int lprocfs_ofd_rd_grant_ratio(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_grant_ratio_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = (struct obd_device *)data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd;
-
- LASSERT(obd != NULL);
- ofd = ofd_dev(obd->obd_lu_dev);
-- *eof = 1;
-- return snprintf(page, count, "%d%%\n",
-- (int) ofd_grant_reserved(ofd, 100));
-+ return seq_printf(m, "%d%%\n",
-+ (int) ofd_grant_reserved(ofd, 100));
- }
-
--static int lprocfs_ofd_wr_grant_ratio(struct file *file,
-- const char __user *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+ofd_grant_ratio_seq_write(struct file *file, const char __user *buffer,
-+ size_t count, loff_t *off)
- {
-- struct obd_device *obd = (struct obd_device *)data;
-+ struct seq_file *m = file->private_data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
- int val;
- int rc;
-@@ -145,24 +139,24 @@ static int lprocfs_ofd_wr_grant_ratio(struct file *file,
- spin_unlock(&ofd->ofd_grant_lock);
- return count;
- }
-+LPROC_SEQ_FOPS(ofd_grant_ratio);
-
--static int lprocfs_ofd_rd_precreate_batch(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_precreate_batch_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = (struct obd_device *)data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd;
-
- LASSERT(obd != NULL);
- ofd = ofd_dev(obd->obd_lu_dev);
-- *eof = 1;
-- return snprintf(page, count, "%d\n", ofd->ofd_precreate_batch);
-+ return seq_printf(m, "%d\n", ofd->ofd_precreate_batch);
- }
-
--static int lprocfs_ofd_wr_precreate_batch(struct file *file,
-- const char __user *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+ofd_precreate_batch_seq_write(struct file *file, const char __user *buffer,
-+ size_t count, loff_t *off)
- {
-- struct obd_device *obd = (struct obd_device *)data;
-+ struct seq_file *m = file->private_data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
- int val;
- int rc;
-@@ -179,11 +173,11 @@ static int lprocfs_ofd_wr_precreate_batch(struct file *file,
- spin_unlock(&ofd->ofd_batch_lock);
- return count;
- }
-+LPROC_SEQ_FOPS(ofd_precreate_batch);
-
--static int lprocfs_ofd_rd_last_id(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_last_id_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd;
- struct ofd_seq *oseq = NULL;
- int retval = 0, rc;
-@@ -201,35 +195,32 @@ static int lprocfs_ofd_rd_last_id(char *page, char **start, off_t off,
- fid_idif_seq(ostid_id(&oseq->os_oi),
- ofd->ofd_lut.lut_lsd.lsd_osd_index) :
- ostid_seq(&oseq->os_oi);
-- rc = snprintf(page, count, DOSTID"\n", seq,
-- ostid_id(&oseq->os_oi));
-+ rc = seq_printf(m, DOSTID"\n", seq, ostid_id(&oseq->os_oi));
- if (rc < 0) {
- retval = rc;
- break;
- }
-- page += rc;
-- count -= rc;
- retval += rc;
- }
- read_unlock(&ofd->ofd_seq_list_lock);
- return retval;
- }
-+LPROC_SEQ_FOPS_RO(ofd_last_id);
-
--int lprocfs_ofd_rd_fmd_max_num(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_fmd_max_num_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = data;
-- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-- int rc;
-+ struct obd_device *obd = m->private;
-+ struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- rc = snprintf(page, count, "%u\n", ofd->ofd_fmd_max_num);
-- return rc;
-+ return seq_printf(m, "%u\n", ofd->ofd_fmd_max_num);
- }
-
--int lprocfs_ofd_wr_fmd_max_num(struct file *file, const char __user *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+ofd_fmd_max_num_seq_write(struct file *file, const char __user *buffer,
-+ size_t count, loff_t *off)
- {
-- struct obd_device *obd = data;
-+ struct seq_file *m = file->private_data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
- int val;
- int rc;
-@@ -244,22 +235,22 @@ int lprocfs_ofd_wr_fmd_max_num(struct file *file, const char __user *buffer,
- ofd->ofd_fmd_max_num = val;
- return count;
- }
-+LPROC_SEQ_FOPS(ofd_fmd_max_num);
-
--int lprocfs_ofd_rd_fmd_max_age(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_fmd_max_age_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = data;
-- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-- int rc;
-+ struct obd_device *obd = m->private;
-+ struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- rc = snprintf(page, count, "%ld\n", ofd->ofd_fmd_max_age / HZ);
-- return rc;
-+ return seq_printf(m, "%ld\n", ofd->ofd_fmd_max_age / HZ);
- }
-
--int lprocfs_ofd_wr_fmd_max_age(struct file *file, const char __user *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+ofd_fmd_max_age_seq_write(struct file *file, const char __user *buffer,
-+ size_t count, loff_t *off)
- {
-- struct obd_device *obd = data;
-+ struct seq_file *m = file->private_data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
- int val;
- int rc;
-@@ -274,22 +265,22 @@ int lprocfs_ofd_wr_fmd_max_age(struct file *file, const char __user *buffer,
- ofd->ofd_fmd_max_age = val * HZ;
- return count;
- }
-+LPROC_SEQ_FOPS(ofd_fmd_max_age);
-
--static int lprocfs_ofd_rd_capa(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_capa_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = data;
-- int rc;
-+ struct obd_device *obd = m->private;
-
-- rc = snprintf(page, count, "capability on: %s\n",
-- obd->u.filter.fo_fl_oss_capa ? "oss" : "");
-- return rc;
-+ return seq_printf(m, "capability on: %s\n",
-+ obd->u.filter.fo_fl_oss_capa ? "oss" : "");
- }
-
--static int lprocfs_ofd_wr_capa(struct file *file, const char __user *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+ofd_capa_seq_write(struct file *file, const char *__user buffer, size_t count,
-+ loff_t *off)
- {
-- struct obd_device *obd = data;
-+ struct seq_file *m = file->private_data;
-+ struct obd_device *obd = m->private;
- int val, rc;
-
- rc = lprocfs_write_helper(buffer, count, &val);
-@@ -308,28 +299,29 @@ static int lprocfs_ofd_wr_capa(struct file *file, const char __user *buffer,
- val ? "enabled" : "disabled");
- return count;
- }
-+LPROC_SEQ_FOPS(ofd_capa);
-
--static int lprocfs_ofd_rd_capa_count(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_capa_count_seq_show(struct seq_file *m, void *data)
- {
-- return snprintf(page, count, "%d %d\n",
-- capa_count[CAPA_SITE_CLIENT],
-- capa_count[CAPA_SITE_SERVER]);
-+ return seq_printf(m, "%d %d\n", capa_count[CAPA_SITE_CLIENT],
-+ capa_count[CAPA_SITE_SERVER]);
- }
-+LPROC_SEQ_FOPS_RO(ofd_capa_count);
-
--int lprocfs_ofd_rd_degraded(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_degraded_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- return snprintf(page, count, "%u\n", ofd->ofd_raid_degraded);
-+ return seq_printf(m, "%u\n", ofd->ofd_raid_degraded);
- }
-
--int lprocfs_ofd_wr_degraded(struct file *file, const char __user *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+ofd_degraded_seq_write(struct file *file, const char __user *buffer,
-+ size_t count, loff_t *off)
- {
-- struct obd_device *obd = data;
-+ struct seq_file *m = file->private_data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
- int val, rc;
-
-@@ -340,38 +332,37 @@ int lprocfs_ofd_wr_degraded(struct file *file, const char __user *buffer,
- spin_lock(&ofd->ofd_flags_lock);
- ofd->ofd_raid_degraded = !!val;
- spin_unlock(&ofd->ofd_flags_lock);
--
- return count;
- }
-+LPROC_SEQ_FOPS(ofd_degraded);
-
--int lprocfs_ofd_rd_fstype(char *page, char **start, off_t off, int count,
-- int *eof, void *data)
-+static int ofd_fstype_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
- struct lu_device *d;
-
- LASSERT(ofd->ofd_osd);
- d = &ofd->ofd_osd->dd_lu_dev;
- LASSERT(d->ld_type);
-- return snprintf(page, count, "%s\n", d->ld_type->ldt_name);
-+ return seq_printf(m, "%s\n", d->ld_type->ldt_name);
- }
-+LPROC_SEQ_FOPS_RO(ofd_fstype);
-
--int lprocfs_ofd_rd_syncjournal(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_syncjournal_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-- int rc;
-
-- rc = snprintf(page, count, "%u\n", ofd->ofd_syncjournal);
-- return rc;
-+ return seq_printf(m, "%u\n", ofd->ofd_syncjournal);
- }
-
--int lprocfs_ofd_wr_syncjournal(struct file *file, const char __user *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+ofd_syncjournal_seq_write(struct file *file, const char __user *buffer,
-+ size_t count, loff_t *off)
- {
-- struct obd_device *obd = data;
-+ struct seq_file *m = file->private_data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
- int val;
- int rc;
-@@ -390,6 +381,7 @@ int lprocfs_ofd_wr_syncjournal(struct file *file, const char __user *buffer,
-
- return count;
- }
-+LPROC_SEQ_FOPS(ofd_syncjournal);
-
- /* This must be longer than the longest string below */
- #define SYNC_STATES_MAXLEN 16
-@@ -397,23 +389,21 @@ static char *sync_on_cancel_states[] = {"never",
- "blocking",
- "always" };
-
--int lprocfs_ofd_rd_sync_lock_cancel(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_sync_lock_cancel_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = data;
-+ struct obd_device *obd = m->private;
- struct lu_target *tgt = obd->u.obt.obt_lut;
-- int rc;
-
-- rc = snprintf(page, count, "%s\n",
-- sync_on_cancel_states[tgt->lut_sync_lock_cancel]);
-- return rc;
-+ return seq_printf(m, "%s\n",
-+ sync_on_cancel_states[tgt->lut_sync_lock_cancel]);
- }
-
--int lprocfs_ofd_wr_sync_lock_cancel(struct file *file,
-- const char __user *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+ofd_sync_lock_cancel_seq_write(struct file *file, const char __user *buffer,
-+ size_t count, loff_t *off)
- {
-- struct obd_device *obd = data;
-+ struct seq_file *m = file->private_data;
-+ struct obd_device *obd = m->private;
- struct lu_target *tgt = obd->u.obt.obt_lut;
- char kernbuf[SYNC_STATES_MAXLEN];
- int val = -1;
-@@ -455,23 +445,23 @@ int lprocfs_ofd_wr_sync_lock_cancel(struct file *file,
- spin_unlock(&tgt->lut_flags_lock);
- return count;
- }
-+LPROC_SEQ_FOPS(ofd_sync_lock_cancel);
-
--int lprocfs_ofd_rd_grant_compat_disable(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_grant_compat_disable_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = data;
-- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-- int rc;
-+ struct obd_device *obd = m->private;
-+ struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- rc = snprintf(page, count, "%u\n", ofd->ofd_grant_compat_disable);
-- return rc;
-+ return seq_printf(m, "%u\n", ofd->ofd_grant_compat_disable);
- }
-
--int lprocfs_ofd_wr_grant_compat_disable(struct file *file,
-- const char __user *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+ofd_grant_compat_disable_seq_write(struct file *file,
-+ const char __user *buffer,
-+ size_t count, loff_t *off)
- {
-- struct obd_device *obd = data;
-+ struct seq_file *m = file->private_data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
- int val;
- int rc;
-@@ -489,42 +479,43 @@ int lprocfs_ofd_wr_grant_compat_disable(struct file *file,
-
- return count;
- }
-+LPROC_SEQ_FOPS(ofd_grant_compat_disable);
-
--int lprocfs_ofd_rd_soft_sync_limit(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_soft_sync_limit_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- return lprocfs_rd_uint(page, start, off, count, eof,
-- &ofd->ofd_soft_sync_limit);
-+ return lprocfs_uint_seq_show(m, &ofd->ofd_soft_sync_limit);
- }
-
--int lprocfs_ofd_wr_soft_sync_limit(struct file *file, const char __user *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+ofd_soft_sync_limit_seq_write(struct file *file, const char __user *buffer,
-+ size_t count, loff_t *off)
- {
-- struct obd_device *obd = data;
-- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-+ struct seq_file *m = file->private_data;
-+ struct obd_device *obd = m->private;
-+ struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- return lprocfs_wr_uint(file, buffer, count, &ofd->ofd_soft_sync_limit);
-+ return lprocfs_uint_seq_write(file, buffer, count,
-+ (loff_t *) &ofd->ofd_soft_sync_limit);
- }
-+LPROC_SEQ_FOPS(ofd_soft_sync_limit);
-
--static int lprocfs_rd_lfsck_speed_limit(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_lfsck_speed_limit_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- *eof = 1;
--
-- return lfsck_get_speed(ofd->ofd_osd, page, count);
-+ return lfsck_get_speed(m, ofd->ofd_osd);
- }
-
--static int lprocfs_wr_lfsck_speed_limit(struct file *file,
-- const char __user *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+ofd_lfsck_speed_limit_seq_write(struct file *file, const char __user *buffer,
-+ size_t count, loff_t *off)
- {
-- struct obd_device *obd = data;
-+ struct seq_file *m = file->private_data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
- __u32 val;
- int rc;
-@@ -537,38 +528,35 @@ static int lprocfs_wr_lfsck_speed_limit(struct file *file,
-
- return rc != 0 ? rc : count;
- }
-+LPROC_SEQ_FOPS(ofd_lfsck_speed_limit);
-
--static int lprocfs_rd_lfsck_layout(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_lfsck_layout_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = data;
-- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
--
-- *eof = 1;
-+ struct obd_device *obd = m->private;
-+ struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- return lfsck_dump(ofd->ofd_osd, page, count, LT_LAYOUT);
-+ return lfsck_dump(m, ofd->ofd_osd, LT_LAYOUT);
- }
-+LPROC_SEQ_FOPS_RO(ofd_lfsck_layout);
-
--static int lprocfs_rd_lfsck_verify_pfid(char *page, char **start, off_t off,
-- int count, int *eof, void *data)
-+static int ofd_lfsck_verify_pfid_seq_show(struct seq_file *m, void *data)
- {
-- struct obd_device *obd = data;
-- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
--
-- *eof = 1;
-+ struct obd_device *obd = m->private;
-+ struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- return snprintf(page, count,
-- "switch: %s\ndetected: "LPU64"\nrepaired: "LPU64"\n",
-- ofd->ofd_lfsck_verify_pfid ? "on" : "off",
-- ofd->ofd_inconsistency_self_detected,
-- ofd->ofd_inconsistency_self_repaired);
-+ return seq_printf(m,
-+ "switch: %s\ndetected: "LPU64"\nrepaired: "LPU64"\n",
-+ ofd->ofd_lfsck_verify_pfid ? "on" : "off",
-+ ofd->ofd_inconsistency_self_detected,
-+ ofd->ofd_inconsistency_self_repaired);
- }
-
--static int lprocfs_wr_lfsck_verify_pfid(struct file *file,
-- const char __user *buffer,
-- unsigned long count, void *data)
-+static ssize_t
-+ofd_lfsck_verify_pfid_seq_write(struct file *file, const char __user *buffer,
-+ size_t count, loff_t *off)
- {
-- struct obd_device *obd = data;
-+ struct seq_file *m = file->private_data;
-+ struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
- __u32 val;
- int rc;
-@@ -581,75 +569,101 @@ static int lprocfs_wr_lfsck_verify_pfid(struct file *file,
-
- return count;
- }
--
--static struct lprocfs_vars lprocfs_ofd_obd_vars[] = {
-- { "uuid", lprocfs_rd_uuid, 0, 0 },
-- { "blocksize", lprocfs_rd_blksize, 0, 0 },
-- { "kbytestotal", lprocfs_rd_kbytestotal, 0, 0 },
-- { "kbytesfree", lprocfs_rd_kbytesfree, 0, 0 },
-- { "kbytesavail", lprocfs_rd_kbytesavail, 0, 0 },
-- { "filestotal", lprocfs_rd_filestotal, 0, 0 },
-- { "filesfree", lprocfs_rd_filesfree, 0, 0 },
-- { "seqs_allocated", lprocfs_ofd_rd_seqs, 0, 0 },
-- { "fstype", lprocfs_ofd_rd_fstype, 0, 0 },
-- { "last_id", lprocfs_ofd_rd_last_id, 0, 0 },
-- { "tot_dirty", lprocfs_ofd_rd_tot_dirty, 0, 0 },
-- { "tot_pending", lprocfs_ofd_rd_tot_pending, 0, 0 },
-- { "tot_granted", lprocfs_ofd_rd_tot_granted, 0, 0 },
-- { "grant_precreate", lprocfs_ofd_rd_grant_precreate, 0, 0 },
-- { "grant_ratio", lprocfs_ofd_rd_grant_ratio,
-- lprocfs_ofd_wr_grant_ratio, 0, 0 },
-- { "precreate_batch", lprocfs_ofd_rd_precreate_batch,
-- lprocfs_ofd_wr_precreate_batch, 0 },
-- { "recovery_status", lprocfs_obd_rd_recovery_status, 0, 0 },
-- { "recovery_time_soft", lprocfs_obd_rd_recovery_time_soft,
-- lprocfs_obd_wr_recovery_time_soft, 0},
-- { "recovery_time_hard", lprocfs_obd_rd_recovery_time_hard,
-- lprocfs_obd_wr_recovery_time_hard, 0},
-- { "evict_client", 0, lprocfs_wr_evict_client, 0,
-- &lprocfs_evict_client_fops},
-- { "num_exports", lprocfs_rd_num_exports, 0, 0 },
-- { "degraded", lprocfs_ofd_rd_degraded,
-- lprocfs_ofd_wr_degraded, 0},
-- { "sync_journal", lprocfs_ofd_rd_syncjournal,
-- lprocfs_ofd_wr_syncjournal, 0 },
-- { "sync_on_lock_cancel", lprocfs_ofd_rd_sync_lock_cancel,
-- lprocfs_ofd_wr_sync_lock_cancel, 0 },
-- { "instance", lprocfs_target_rd_instance, 0 },
-- { "ir_factor", lprocfs_obd_rd_ir_factor,
-- lprocfs_obd_wr_ir_factor, 0},
-- { "grant_compat_disable", lprocfs_ofd_rd_grant_compat_disable,
-- lprocfs_ofd_wr_grant_compat_disable, 0 },
-- { "client_cache_count", lprocfs_ofd_rd_fmd_max_num,
-- lprocfs_ofd_wr_fmd_max_num, 0 },
-- { "client_cache_seconds", lprocfs_ofd_rd_fmd_max_age,
-- lprocfs_ofd_wr_fmd_max_age, 0 },
-- { "capa", lprocfs_ofd_rd_capa,
-- lprocfs_ofd_wr_capa, 0 },
-- { "capa_count", lprocfs_ofd_rd_capa_count, 0, 0 },
-- { "job_cleanup_interval", lprocfs_rd_job_interval,
-- lprocfs_wr_job_interval, 0},
-- { "soft_sync_limit", lprocfs_ofd_rd_soft_sync_limit,
-- lprocfs_ofd_wr_soft_sync_limit, 0},
-- { "lfsck_speed_limit", lprocfs_rd_lfsck_speed_limit,
-- lprocfs_wr_lfsck_speed_limit, 0 },
-- { "lfsck_layout", lprocfs_rd_lfsck_layout, 0, 0 },
-- { "lfsck_verify_pfid", lprocfs_rd_lfsck_verify_pfid,
-- lprocfs_wr_lfsck_verify_pfid, 0 },
-- { 0 }
--};
--
--static struct lprocfs_vars lprocfs_ofd_module_vars[] = {
-- { "num_refs", lprocfs_rd_numrefs, 0, 0 },
-+LPROC_SEQ_FOPS(ofd_lfsck_verify_pfid);
-+
-+LPROC_SEQ_FOPS_RO_TYPE(ofd, uuid);
-+LPROC_SEQ_FOPS_RO_TYPE(ofd, blksize);
-+LPROC_SEQ_FOPS_RO_TYPE(ofd, kbytestotal);
-+LPROC_SEQ_FOPS_RO_TYPE(ofd, kbytesfree);
-+LPROC_SEQ_FOPS_RO_TYPE(ofd, kbytesavail);
-+LPROC_SEQ_FOPS_RO_TYPE(ofd, filestotal);
-+LPROC_SEQ_FOPS_RO_TYPE(ofd, filesfree);
-+
-+LPROC_SEQ_FOPS_RO_TYPE(ofd, recovery_status);
-+LPROC_SEQ_FOPS_RW_TYPE(ofd, recovery_time_soft);
-+LPROC_SEQ_FOPS_RW_TYPE(ofd, recovery_time_hard);
-+LPROC_SEQ_FOPS_WO_TYPE(ofd, evict_client);
-+LPROC_SEQ_FOPS_RO_TYPE(ofd, num_exports);
-+LPROC_SEQ_FOPS_RO_TYPE(ofd, target_instance);
-+LPROC_SEQ_FOPS_RW_TYPE(ofd, ir_factor);
-+LPROC_SEQ_FOPS_RW_TYPE(ofd, job_interval);
-+
-+struct lprocfs_seq_vars lprocfs_ofd_obd_vars[] = {
-+ { .name = "uuid",
-+ .fops = &ofd_uuid_fops },
-+ { .name = "blocksize",
-+ .fops = &ofd_blksize_fops },
-+ { .name = "kbytestotal",
-+ .fops = &ofd_kbytestotal_fops },
-+ { .name = "kbytesfree",
-+ .fops = &ofd_kbytesfree_fops },
-+ { .name = "kbytesavail",
-+ .fops = &ofd_kbytesavail_fops },
-+ { .name = "filestotal",
-+ .fops = &ofd_filestotal_fops },
-+ { .name = "filesfree",
-+ .fops = &ofd_filesfree_fops },
-+ { .name = "seqs_allocated",
-+ .fops = &ofd_seqs_fops },
-+ { .name = "fstype",
-+ .fops = &ofd_fstype_fops },
-+ { .name = "last_id",
-+ .fops = &ofd_last_id_fops },
-+ { .name = "tot_dirty",
-+ .fops = &ofd_tot_dirty_fops },
-+ { .name = "tot_pending",
-+ .fops = &ofd_tot_pending_fops },
-+ { .name = "tot_granted",
-+ .fops = &ofd_tot_granted_fops },
-+ { .name = "grant_precreate",
-+ .fops = &ofd_grant_precreate_fops },
-+ { .name = "grant_ratio",
-+ .fops = &ofd_grant_ratio_fops },
-+ { .name = "precreate_batch",
-+ .fops = &ofd_precreate_batch_fops },
-+ { .name = "recovery_status",
-+ .fops = &ofd_recovery_status_fops },
-+ { .name = "recovery_time_soft",
-+ .fops = &ofd_recovery_time_soft_fops },
-+ { .name = "recovery_time_hard",
-+ .fops = &ofd_recovery_time_hard_fops },
-+ { .name = "evict_client",
-+ .fops = &ofd_evict_client_fops },
-+ { .name = "num_exports",
-+ .fops = &ofd_num_exports_fops },
-+ { .name = "degraded",
-+ .fops = &ofd_degraded_fops },
-+ { .name = "sync_journal",
-+ .fops = &ofd_syncjournal_fops },
-+ { .name = "sync_on_lock_cancel",
-+ .fops = &ofd_sync_lock_cancel_fops },
-+ { .name = "instance",
-+ .fops = &ofd_target_instance_fops },
-+ { .name = "ir_factor",
-+ .fops = &ofd_ir_factor_fops },
-+ { .name = "grant_compat_disable",
-+ .fops = &ofd_grant_compat_disable_fops },
-+ { .name = "client_cache_count",
-+ .fops = &ofd_fmd_max_num_fops },
-+ { .name = "client_cache_seconds",
-+ .fops = &ofd_fmd_max_age_fops },
-+ { .name = "capa",
-+ .fops = &ofd_capa_fops },
-+ { .name = "capa_count",
-+ .fops = &ofd_capa_count_fops },
-+ { .name = "job_cleanup_interval",
-+ .fops = &ofd_job_interval_fops },
-+ { .name = "soft_sync_limit",
-+ .fops = &ofd_soft_sync_limit_fops },
-+ { .name = "lfsck_speed_limit",
-+ .fops = &ofd_lfsck_speed_limit_fops },
-+ { .name = "lfsck_layout",
-+ .fops = &ofd_lfsck_layout_fops },
-+ { .name = "lfsck_verify_pfid",
-+ .fops = &ofd_lfsck_verify_pfid_fops },
- { 0 }
- };
-
--void lprocfs_ofd_init_vars(struct lprocfs_static_vars *lvars)
--{
-- lvars->module_vars = lprocfs_ofd_module_vars;
-- lvars->obd_vars = lprocfs_ofd_obd_vars;
--}
--
- void ofd_stats_counter_init(struct lprocfs_stats *stats)
- {
- LASSERT(stats && stats->ls_num >= LPROC_OFD_STATS_LAST);
-diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c
-index 0f0d51a..6172913 100644
---- a/lustre/ofd/ofd_dev.c
-+++ b/lustre/ofd/ofd_dev.c
-@@ -239,8 +239,7 @@ static int ofd_process_config(const struct lu_env *env, struct lu_device *d,
-
- switch (cfg->lcfg_command) {
- case LCFG_PARAM: {
-- struct lprocfs_static_vars lvars;
--
-+ struct obd_device *obd = ofd_obd(m);
- /* For interoperability */
- struct cfg_interop_param *ptr = NULL;
- struct lustre_cfg *old_cfg = NULL;
-@@ -278,8 +277,7 @@ static int ofd_process_config(const struct lu_env *env, struct lu_device *d,
- break;
- }
-
-- lprocfs_ofd_init_vars(&lvars);
-- rc = class_process_proc_param(PARAM_OST, lvars.obd_vars, cfg,
-+ rc = class_process_proc_seq_param(PARAM_OST, obd->obd_vars, cfg,
- d->ld_obd);
- if (rc > 0 || rc == -ENOSYS) {
- CDEBUG(D_CONFIG, "pass param %s down the stack.\n",
-@@ -485,9 +483,10 @@ static struct lu_device_operations ofd_lu_ops = {
- .ldo_prepare = ofd_prepare,
- };
-
-+LPROC_SEQ_FOPS(lprocfs_nid_stats_clear);
-+
- static int ofd_procfs_init(struct ofd_device *ofd)
- {
-- struct lprocfs_static_vars lvars;
- struct obd_device *obd = ofd_obd(ofd);
- cfs_proc_dir_entry_t *entry;
- int rc = 0;
-@@ -496,8 +495,8 @@ static int ofd_procfs_init(struct ofd_device *ofd)
-
- /* lprocfs must be setup before the ofd so state can be safely added
- * to /proc incrementally as the ofd is setup */
-- lprocfs_ofd_init_vars(&lvars);
-- rc = lprocfs_obd_setup(obd, lvars.obd_vars);
-+ obd->obd_vars = lprocfs_ofd_obd_vars;
-+ rc = lprocfs_seq_obd_setup(obd);
- if (rc) {
- CERROR("%s: lprocfs_obd_setup failed: %d.\n",
- obd->obd_name, rc);
-@@ -513,7 +512,8 @@ static int ofd_procfs_init(struct ofd_device *ofd)
-
- obd->obd_uses_nid_stats = 1;
-
-- entry = lprocfs_register("exports", obd->obd_proc_entry, NULL, NULL);
-+ entry = lprocfs_seq_register("exports", obd->obd_proc_entry, NULL,
-+ NULL);
- if (IS_ERR(entry)) {
- rc = PTR_ERR(entry);
- CERROR("%s: error %d setting up lprocfs for %s\n",
-@@ -523,8 +523,10 @@ static int ofd_procfs_init(struct ofd_device *ofd)
- obd->obd_proc_exports_entry = entry;
-
- entry = lprocfs_add_simple(obd->obd_proc_exports_entry, "clear",
-- lprocfs_nid_stats_clear_read,
-- lprocfs_nid_stats_clear_write, obd, NULL);
-+#ifndef HAVE_ONLY_PROCFS_SEQ
-+ NULL, NULL,
-+#endif
-+ obd, &lprocfs_nid_stats_clear_fops);
- if (IS_ERR(entry)) {
- rc = PTR_ERR(entry);
- CERROR("%s: add proc entry 'clear' failed: %d.\n",
-@@ -540,7 +542,7 @@ static int ofd_procfs_init(struct ofd_device *ofd)
- GOTO(remove_entry_clear, rc);
- RETURN(0);
- remove_entry_clear:
-- lprocfs_remove_proc_entry("clear", obd->obd_proc_exports_entry);
-+ lprocfs_remove(&obd->obd_proc_exports_entry);
- obd_cleanup:
- lprocfs_obd_cleanup(obd);
- lprocfs_free_obd_stats(obd);
-@@ -548,51 +550,48 @@ obd_cleanup:
- return rc;
- }
-
-+/**
-+ * ofd_procfs_add_brw_stats_symlink - expose osd stats to ofd layer
-+ *
-+ * The osd interfaces to the backend file system exposes useful data
-+ * such as brw_stats and read or write cache states. This same data
-+ * needs to be exposed into the obdfilter (ofd) layer to maintain
-+ * backwards compatibility. This function creates the symlinks in the
-+ * proc layer to enable this.
-+ */
- static void ofd_procfs_add_brw_stats_symlink(struct ofd_device *ofd)
- {
- struct obd_device *obd = ofd_obd(ofd);
- struct obd_device *osd_obd = ofd->ofd_osd_exp->exp_obd;
-- cfs_proc_dir_entry_t *osd_root = osd_obd->obd_type->typ_procroot;
-- cfs_proc_dir_entry_t *osd_dir;
-
-- osd_dir = lprocfs_srch(osd_root, obd->obd_name);
-- if (osd_dir == NULL)
-+ if (obd->obd_proc_entry == NULL)
- return;
-
-- if (lprocfs_srch(osd_dir, "brw_stats") != NULL)
-- lprocfs_add_symlink("brw_stats", obd->obd_proc_entry,
-- "../../%s/%s/brw_stats",
-- osd_root->name, osd_dir->name);
--
-- if (lprocfs_srch(osd_dir, "read_cache_enable") != NULL)
-- lprocfs_add_symlink("read_cache_enable", obd->obd_proc_entry,
-- "../../%s/%s/read_cache_enable",
-- osd_root->name, osd_dir->name);
--
-- if (lprocfs_srch(osd_dir, "readcache_max_filesize") != NULL)
-- lprocfs_add_symlink("readcache_max_filesize",
-- obd->obd_proc_entry,
-- "../../%s/%s/readcache_max_filesize",
-- osd_root->name, osd_dir->name);
--
-- if (lprocfs_srch(osd_dir, "writethrough_cache_enable") != NULL)
-- lprocfs_add_symlink("writethrough_cache_enable",
-- obd->obd_proc_entry,
-- "../../%s/%s/writethrough_cache_enable",
-- osd_root->name, osd_dir->name);
-+ lprocfs_add_symlink("brw_stats", obd->obd_proc_entry,
-+ "../../%s/%s/brw_stats",
-+ osd_obd->obd_type->typ_name, obd->obd_name);
-+
-+ lprocfs_add_symlink("read_cache_enable", obd->obd_proc_entry,
-+ "../../%s/%s/read_cache_enable",
-+ osd_obd->obd_type->typ_name, obd->obd_name);
-+
-+ lprocfs_add_symlink("readcache_max_filesize",
-+ obd->obd_proc_entry,
-+ "../../%s/%s/readcache_max_filesize",
-+ osd_obd->obd_type->typ_name, obd->obd_name);
-+
-+ lprocfs_add_symlink("writethrough_cache_enable",
-+ obd->obd_proc_entry,
-+ "../../%s/%s/writethrough_cache_enable",
-+ osd_obd->obd_type->typ_name, obd->obd_name);
- }
-
- static void ofd_procfs_fini(struct ofd_device *ofd)
- {
- struct obd_device *obd = ofd_obd(ofd);
-
-- lprocfs_remove_proc_entry("writethrough_cache_enable",
-- obd->obd_proc_entry);
-- lprocfs_remove_proc_entry("readcache_max_filesize",
-- obd->obd_proc_entry);
-- lprocfs_remove_proc_entry("read_cache_enable", obd->obd_proc_entry);
-- lprocfs_remove_proc_entry("brw_stats", obd->obd_proc_entry);
-- lprocfs_remove_proc_entry("clear", obd->obd_proc_exports_entry);
-+ lprocfs_remove(&obd->obd_proc_exports_entry);
-+ lprocfs_remove(&obd->obd_proc_entry);
- lprocfs_free_per_client_stats(obd);
- lprocfs_obd_cleanup(obd);
- lprocfs_free_obd_stats(obd);
-@@ -2377,7 +2376,6 @@ static struct lu_device_type ofd_device_type = {
-
- int __init ofd_init(void)
- {
-- struct lprocfs_static_vars lvars;
- int rc;
-
- rc = lu_kmem_init(ofd_caches);
-@@ -2390,11 +2388,9 @@ int __init ofd_init(void)
- return(rc);
- }
-
-- lprocfs_ofd_init_vars(&lvars);
--
- rc = class_register_type(&ofd_obd_ops, NULL, true, NULL,
- #ifndef HAVE_ONLY_PROCFS_SEQ
-- lvars.module_vars,
-+ NULL,
- #endif
- LUSTRE_OST_NAME, &ofd_device_type);
- return rc;
-diff --git a/lustre/ofd/ofd_internal.h b/lustre/ofd/ofd_internal.h
-index 4f12506..2e75de5 100644
---- a/lustre/ofd/ofd_internal.h
-+++ b/lustre/ofd/ofd_internal.h
-@@ -403,13 +403,9 @@ int ofd_txn_stop_cb(const struct lu_env *env, struct thandle *txn,
-
- /* lproc_ofd.c */
- #ifdef LPROCFS
--void lprocfs_ofd_init_vars(struct lprocfs_static_vars *lvars);
-+extern struct lprocfs_seq_vars lprocfs_ofd_obd_vars[];
- void ofd_stats_counter_init(struct lprocfs_stats *stats);
- #else
--static void lprocfs_ofd_init_vars(struct lprocfs_static_vars *lvars)
--{
-- memset(lvars, 0, sizeof(*lvars));
--}
- static inline void ofd_stats_counter_init(struct lprocfs_stats *stats) {}
- #endif
-
---
-1.9.3
-
diff --git a/sys-cluster/lustre/lustre-9999.ebuild b/sys-cluster/lustre/lustre-9999.ebuild
index 7d8eaef..75ab5e8 100644
--- a/sys-cluster/lustre/lustre-9999.ebuild
+++ b/sys-cluster/lustre/lustre-9999.ebuild
@@ -20,7 +20,7 @@ inherit git-r3 autotools linux-mod toolchain-funcs udev flag-o-matic
DESCRIPTION="Lustre is a parallel distributed file system"
HOMEPAGE="http://wiki.whamcloud.com/"
-SRC_URI=""
+SRC_URI="https://raw.githubusercontent.com/gentoo-science/sci/master/patches/0002-LU-3319-procfs-move-mdd-ofd-proc-handling-to-seq_fil.patch"
EGIT_REPO_URI="git://git.whamcloud.com/fs/lustre-release.git"
LICENSE="GPL-2"
@@ -42,7 +42,7 @@ DEPEND="${RDEPEND}
PATCHES=(
"${FILESDIR}/0001-LU-3319-procfs-update-zfs-proc-handling-to-seq_files.patch"
- "${FILESDIR}/0002-LU-3319-procfs-move-mdd-ofd-proc-handling-to-seq_fil.patch"
+ "${DISTDIR}/0002-LU-3319-procfs-move-mdd-ofd-proc-handling-to-seq_fil.patch"
"${FILESDIR}/0003-LU-4416-mm-Backport-shrinker-changes-from-upstream.patch"
"${FILESDIR}/lustre-readline6.3_fix.patch"
)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sys-cluster/lustre/files/, sys-cluster/lustre/
@ 2016-06-13 10:13 Alexey Shvetsov
0 siblings, 0 replies; 5+ messages in thread
From: Alexey Shvetsov @ 2016-06-13 10:13 UTC (permalink / raw
To: gentoo-commits
commit: d72cde5ebe5ae2a90e72d21653ff5f480a7a55ef
Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 13 10:12:44 2016 +0000
Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
CommitDate: Mon Jun 13 10:12:44 2016 +0000
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=d72cde5e
sys-cluster/lustre: add patches for 4.5 kernel
Package-Manager: portage-2.3.0_rc1
RepoMan-Options: --force
...6215-lprocfs-handle-seq_printf-api-change.patch | 4126 ++++++++++++++++++++
...-cache_head-is-now-on-a-hlist-in-4.3-kern.patch | 192 +
...te-handle-locks-API-change-in-4.4-kernels.patch | 90 +
...te-make_request_fn-returns-blk_qc_t-in-ke.patch | 95 +
...-key-payload.data-is-an-array-in-4.4-kern.patch | 229 ++
| 106 +
...0007-LU-6215-lnet-split-struct-ib_send_wr.patch | 451 +++
...iblnd-ib_alloc_fast_reg_mr-removed-in-4.3.patch | 199 +
...blnd-port-to-new-fast-reg-API-introduced-.patch | 332 ++
| 46 +
...15-llite-remove-obsolete-conditional-code.patch | 97 +
...0012-LU-6215-lnet-split-struct-ib_send_wr.patch | 169 +
...8056-libcfs-Support-for-linux-4.2-kernels.patch | 80 +
...56-o2iblnd-ib_query_device-removed-in-4.5.patch | 167 +
...klnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch | 49 +
...56-llite-use-inode_lock-to-access-i_mutex.patch | 363 ++
...te-inode_operations-interface-changed-in-.patch | 166 +
...te-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch | 53 +
...op-fix-bio_for_each_segment_all-for-newer.patch | 66 +
sys-cluster/lustre/lustre-2.8.0.ebuild | 25 +-
sys-cluster/lustre/lustre-9999.ebuild | 25 +-
21 files changed, 7122 insertions(+), 4 deletions(-)
diff --git a/sys-cluster/lustre/files/0001-LU-6215-lprocfs-handle-seq_printf-api-change.patch b/sys-cluster/lustre/files/0001-LU-6215-lprocfs-handle-seq_printf-api-change.patch
new file mode 100644
index 0000000..744b9d2
--- /dev/null
+++ b/sys-cluster/lustre/files/0001-LU-6215-lprocfs-handle-seq_printf-api-change.patch
@@ -0,0 +1,4126 @@
+From cd60eb450f58589c39568507215e6366b41aa154 Mon Sep 17 00:00:00 2001
+From: James Simmons <uja.ornl@yahoo.com>
+Date: Wed, 23 Mar 2016 18:37:27 -0400
+Subject: [PATCH 01/19] LU-6215 lprocfs: handle seq_printf api change
+
+Starting with the 4.3 linux kernel seq_printf is a void
+function not returning the character count. This work
+updates lustre to treat seq_printf as a void function.
+Fixed alignment issues and ran this patch against the
+Linux kernels checkpatch to make it compliant to
+upstream standards.
+
+Change-Id: I0cfd71252322038c1b54da624fce48b37a6f30b6
+Signed-off-by: James Simmons <uja.ornl@yahoo.com>
+Reviewed-on: http://review.whamcloud.com/16933
+Tested-by: Jenkins
+Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
+Tested-by: Maloo <hpdd-maloo@intel.com>
+Reviewed-by: Bob Glossman <bob.glossman@intel.com>
+Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+---
+ contrib/scripts/checkpatch.pl | 2 +
+ libcfs/include/libcfs/libcfs_hash.h | 4 +-
+ libcfs/libcfs/hash.c | 55 ++++----
+ lustre/fid/lproc_fid.c | 47 +++----
+ lustre/fld/lproc_fld.c | 2 +-
+ lustre/ldlm/ldlm_pool.c | 21 ++-
+ lustre/ldlm/ldlm_resource.c | 8 +-
+ lustre/lfsck/lfsck_internal.h | 14 +-
+ lustre/lfsck/lfsck_layout.c | 157 ++++++++++-----------
+ lustre/lfsck/lfsck_lib.c | 66 ++++-----
+ lustre/lfsck/lfsck_namespace.c | 234 +++++++++++++++-----------------
+ lustre/llite/lproc_llite.c | 147 ++++++++++----------
+ lustre/lmv/lproc_lmv.c | 17 ++-
+ lustre/lod/lproc_lod.c | 50 ++++---
+ lustre/lov/lproc_lov.c | 30 ++--
+ lustre/mdc/lproc_mdc.c | 15 +-
+ lustre/mdd/mdd_lproc.c | 6 +-
+ lustre/mdt/mdt_coordinator.c | 15 +-
+ lustre/mdt/mdt_hsm_cdt_actions.c | 54 ++++----
+ lustre/mdt/mdt_lproc.c | 45 +++---
+ lustre/mgc/mgc_request.c | 4 +-
+ lustre/obdclass/genops.c | 4 +-
+ lustre/obdclass/linux/linux-module.c | 29 ++--
+ lustre/obdclass/lprocfs_jobstats.c | 3 +-
+ lustre/obdclass/lprocfs_status.c | 176 ++++++++++++------------
+ lustre/obdclass/lprocfs_status_server.c | 36 ++---
+ lustre/obdclass/lu_object.c | 27 ++--
+ lustre/ofd/lproc_ofd.c | 65 +++++----
+ lustre/osc/lproc_osc.c | 95 +++++++------
+ lustre/osd-ldiskfs/osd_lproc.c | 35 +++--
+ lustre/osd-ldiskfs/osd_scrub.c | 160 +++++++++-------------
+ lustre/osd-zfs/osd_lproc.c | 9 +-
+ lustre/osp/lproc_osp.c | 60 +++++---
+ lustre/ptlrpc/gss/lproc_gss.c | 42 +++---
+ lustre/ptlrpc/lproc_ptlrpc.c | 47 ++++---
+ lustre/ptlrpc/nodemap_lproc.c | 36 +++--
+ lustre/ptlrpc/nrs_tbf.c | 6 +-
+ lustre/ptlrpc/sec_bulk.c | 84 ++++++------
+ lustre/quota/qsd_lib.c | 45 +++---
+ 39 files changed, 974 insertions(+), 978 deletions(-)
+
+diff --git a/contrib/scripts/checkpatch.pl b/contrib/scripts/checkpatch.pl
+index dc85c7c..372ed4c 100755
+--- a/contrib/scripts/checkpatch.pl
++++ b/contrib/scripts/checkpatch.pl
+@@ -472,6 +472,8 @@ my %dep_functions = (
+ 'strcat', 'strncat',
+ 'tempnam', 'mkstemp',
+ 'f_dentry', 'f_path.dentry',
++ '= seq_printf', 'seq_printf',
++ 'return seq_printf', 'seq_printf',
+ );
+
+ my @rawlines = ();
+diff --git a/libcfs/include/libcfs/libcfs_hash.h b/libcfs/include/libcfs/libcfs_hash.h
+index f076b37..6285c66 100644
+--- a/libcfs/include/libcfs/libcfs_hash.h
++++ b/libcfs/include/libcfs/libcfs_hash.h
+@@ -803,8 +803,8 @@ __cfs_hash_set_theta(struct cfs_hash *hs, int min, int max)
+
+ /* Generic debug formatting routines mainly for proc handler */
+ struct seq_file;
+-int cfs_hash_debug_header(struct seq_file *m);
+-int cfs_hash_debug_str(struct cfs_hash *hs, struct seq_file *m);
++void cfs_hash_debug_header(struct seq_file *m);
++void cfs_hash_debug_str(struct cfs_hash *hs, struct seq_file *m);
+
+ /*
+ * Generic djb2 hash algorithm for character arrays.
+diff --git a/libcfs/libcfs/hash.c b/libcfs/libcfs/hash.c
+index 02575fb..7afa6cc 100644
+--- a/libcfs/libcfs/hash.c
++++ b/libcfs/libcfs/hash.c
+@@ -2043,13 +2043,10 @@ void cfs_hash_rehash_key(struct cfs_hash *hs, const void *old_key,
+ }
+ EXPORT_SYMBOL(cfs_hash_rehash_key);
+
+-int cfs_hash_debug_header(struct seq_file *m)
++void cfs_hash_debug_header(struct seq_file *m)
+ {
+- return seq_printf(m, "%-*s%6s%6s%6s%6s%6s%6s%6s%7s%8s%8s%8s%s\n",
+- CFS_HASH_BIGNAME_LEN,
+- "name", "cur", "min", "max", "theta", "t-min", "t-max",
+- "flags", "rehash", "count", "maxdep", "maxdepb",
+- " distribution");
++ seq_printf(m, "%-*s cur min max theta t-min t-max flags rehash count maxdep maxdepb distribution\n",
++ CFS_HASH_BIGNAME_LEN, "name");
+ }
+ EXPORT_SYMBOL(cfs_hash_debug_header);
+
+@@ -2077,31 +2074,28 @@ cfs_hash_full_nbkt(struct cfs_hash *hs)
+ CFS_HASH_RH_NBKT(hs) : CFS_HASH_NBKT(hs);
+ }
+
+-int cfs_hash_debug_str(struct cfs_hash *hs, struct seq_file *m)
++void cfs_hash_debug_str(struct cfs_hash *hs, struct seq_file *m)
+ {
+- int dist[8] = { 0, };
+- int maxdep = -1;
+- int maxdepb = -1;
+- int total = 0;
+- int c = 0;
+- int theta;
+- int i;
++ int dist[8] = { 0, };
++ int maxdep = -1;
++ int maxdepb = -1;
++ int total = 0;
++ int theta;
++ int i;
+
+ cfs_hash_lock(hs, 0);
+ theta = __cfs_hash_theta(hs);
+
+- c += seq_printf(m, "%-*s ", CFS_HASH_BIGNAME_LEN, hs->hs_name);
+- c += seq_printf(m, "%5d ", 1 << hs->hs_cur_bits);
+- c += seq_printf(m, "%5d ", 1 << hs->hs_min_bits);
+- c += seq_printf(m, "%5d ", 1 << hs->hs_max_bits);
+- c += seq_printf(m, "%d.%03d ", __cfs_hash_theta_int(theta),
+- __cfs_hash_theta_frac(theta));
+- c += seq_printf(m, "%d.%03d ", __cfs_hash_theta_int(hs->hs_min_theta),
+- __cfs_hash_theta_frac(hs->hs_min_theta));
+- c += seq_printf(m, "%d.%03d ", __cfs_hash_theta_int(hs->hs_max_theta),
+- __cfs_hash_theta_frac(hs->hs_max_theta));
+- c += seq_printf(m, " 0x%02x ", hs->hs_flags);
+- c += seq_printf(m, "%6d ", hs->hs_rehash_count);
++ seq_printf(m, "%-*s %5d %5d %5d %d.%03d %d.%03d %d.%03d 0x%02x %6d ",
++ CFS_HASH_BIGNAME_LEN, hs->hs_name,
++ 1 << hs->hs_cur_bits, 1 << hs->hs_min_bits,
++ 1 << hs->hs_max_bits,
++ __cfs_hash_theta_int(theta), __cfs_hash_theta_frac(theta),
++ __cfs_hash_theta_int(hs->hs_min_theta),
++ __cfs_hash_theta_frac(hs->hs_min_theta),
++ __cfs_hash_theta_int(hs->hs_max_theta),
++ __cfs_hash_theta_frac(hs->hs_max_theta),
++ hs->hs_flags, hs->hs_rehash_count);
+
+ /*
+ * The distribution is a summary of the chained hash depth in
+@@ -2126,17 +2120,14 @@ int cfs_hash_debug_str(struct cfs_hash *hs, struct seq_file *m)
+ maxdepb = ffz(~maxdep);
+ }
+ total += bd.bd_bucket->hsb_count;
+- dist[min(fls(bd.bd_bucket->hsb_count/max(theta,1)),7)]++;
++ dist[min(fls(bd.bd_bucket->hsb_count / max(theta, 1)), 7)]++;
+ cfs_hash_bd_unlock(hs, &bd, 0);
+ }
+
+- c += seq_printf(m, "%7d ", total);
+- c += seq_printf(m, "%7d ", maxdep);
+- c += seq_printf(m, "%7d ", maxdepb);
++ seq_printf(m, "%7d %7d %7d ", total, maxdep, maxdepb);
+ for (i = 0; i < 8; i++)
+- c += seq_printf(m, "%d%c", dist[i], (i == 7) ? '\n' : '/');
++ seq_printf(m, "%d%c", dist[i], (i == 7) ? '\n' : '/');
+
+ cfs_hash_unlock(hs, 0);
+- return c;
+ }
+ EXPORT_SYMBOL(cfs_hash_debug_str);
+diff --git a/lustre/fid/lproc_fid.c b/lustre/fid/lproc_fid.c
+index 078df00..00b2c7b 100644
+--- a/lustre/fid/lproc_fid.c
++++ b/lustre/fid/lproc_fid.c
+@@ -127,17 +127,15 @@ static int
+ lprocfs_server_fid_space_seq_show(struct seq_file *m, void *unused)
+ {
+ struct lu_server_seq *seq = (struct lu_server_seq *)m->private;
+- int rc;
+ ENTRY;
+
+ LASSERT(seq != NULL);
+
+ mutex_lock(&seq->lss_mutex);
+- rc = seq_printf(m, "["LPX64" - "LPX64"]:%x:%s\n",
+- PRANGE(&seq->lss_space));
++ seq_printf(m, "["LPX64" - "LPX64"]:%x:%s\n", PRANGE(&seq->lss_space));
+ mutex_unlock(&seq->lss_mutex);
+
+- RETURN(rc);
++ RETURN(0);
+ }
+
+ static int
+@@ -145,7 +143,6 @@ lprocfs_server_fid_server_seq_show(struct seq_file *m, void *unused)
+ {
+ struct lu_server_seq *seq = (struct lu_server_seq *)m->private;
+ struct client_obd *cli;
+- int rc;
+ ENTRY;
+
+ LASSERT(seq != NULL);
+@@ -153,16 +150,15 @@ lprocfs_server_fid_server_seq_show(struct seq_file *m, void *unused)
+ if (seq->lss_cli) {
+ if (seq->lss_cli->lcs_exp != NULL) {
+ cli = &seq->lss_cli->lcs_exp->exp_obd->u.cli;
+- rc = seq_printf(m, "%s\n", cli->cl_target_uuid.uuid);
++ seq_printf(m, "%s\n", cli->cl_target_uuid.uuid);
+ } else {
+- rc = seq_printf(m, "%s\n",
+- seq->lss_cli->lcs_srv->lss_name);
++ seq_printf(m, "%s\n", seq->lss_cli->lcs_srv->lss_name);
+ }
+ } else {
+- rc = seq_printf(m, "<none>\n");
++ seq_puts(m, "<none>\n");
+ }
+
+- RETURN(rc);
++ RETURN(0);
+ }
+
+ static ssize_t
+@@ -197,16 +193,15 @@ static int
+ lprocfs_server_fid_width_seq_show(struct seq_file *m, void *unused)
+ {
+ struct lu_server_seq *seq = (struct lu_server_seq *)m->private;
+- int rc;
+ ENTRY;
+
+ LASSERT(seq != NULL);
+
+ mutex_lock(&seq->lss_mutex);
+- rc = seq_printf(m, LPU64"\n", seq->lss_width);
++ seq_printf(m, LPU64"\n", seq->lss_width);
+ mutex_unlock(&seq->lss_mutex);
+
+- RETURN(rc);
++ RETURN(0);
+ }
+
+ LPROC_SEQ_FOPS(lprocfs_server_fid_space);
+@@ -334,7 +329,7 @@ static int fldb_seq_show(struct seq_file *p, void *v)
+ fld->lsf_name, rc);
+ } else if (fld_rec.lsr_start != 0) {
+ range_be_to_cpu(&fld_rec, &fld_rec);
+- rc = seq_printf(p, DRANGE"\n", PRANGE(&fld_rec));
++ seq_printf(p, DRANGE"\n", PRANGE(&fld_rec));
+ }
+
+ return rc;
+@@ -533,17 +528,16 @@ static int
+ lprocfs_client_fid_space_seq_show(struct seq_file *m, void *unused)
+ {
+ struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
+- int rc;
+ ENTRY;
+
+ LASSERT(seq != NULL);
+
+ mutex_lock(&seq->lcs_mutex);
+- rc = seq_printf(m, "["LPX64" - "LPX64"]:%x:%s\n",
+- PRANGE(&seq->lcs_space));
++ seq_printf(m, "["LPX64" - "LPX64"]:%x:%s\n",
++ PRANGE(&seq->lcs_space));
+ mutex_unlock(&seq->lcs_mutex);
+
+- RETURN(rc);
++ RETURN(0);
+ }
+
+ static ssize_t
+@@ -585,32 +579,30 @@ static int
+ lprocfs_client_fid_width_seq_show(struct seq_file *m, void *unused)
+ {
+ struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
+- int rc;
+ ENTRY;
+
+ LASSERT(seq != NULL);
+
+ mutex_lock(&seq->lcs_mutex);
+- rc = seq_printf(m, LPU64"\n", seq->lcs_width);
++ seq_printf(m, LPU64"\n", seq->lcs_width);
+ mutex_unlock(&seq->lcs_mutex);
+
+- RETURN(rc);
++ RETURN(0);
+ }
+
+ static int
+ lprocfs_client_fid_fid_seq_show(struct seq_file *m, void *unused)
+ {
+ struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
+- int rc;
+ ENTRY;
+
+ LASSERT(seq != NULL);
+
+ mutex_lock(&seq->lcs_mutex);
+- rc = seq_printf(m, DFID"\n", PFID(&seq->lcs_fid));
++ seq_printf(m, DFID"\n", PFID(&seq->lcs_fid));
+ mutex_unlock(&seq->lcs_mutex);
+
+- RETURN(rc);
++ RETURN(0);
+ }
+
+ static int
+@@ -618,18 +610,17 @@ lprocfs_client_fid_server_seq_show(struct seq_file *m, void *unused)
+ {
+ struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
+ struct client_obd *cli;
+- int rc;
+ ENTRY;
+
+ LASSERT(seq != NULL);
+
+ if (seq->lcs_exp != NULL) {
+ cli = &seq->lcs_exp->exp_obd->u.cli;
+- rc = seq_printf(m, "%s\n", cli->cl_target_uuid.uuid);
++ seq_printf(m, "%s\n", cli->cl_target_uuid.uuid);
+ } else {
+- rc = seq_printf(m, "%s\n", seq->lcs_srv->lss_name);
++ seq_printf(m, "%s\n", seq->lcs_srv->lss_name);
+ }
+- RETURN(rc);
++ RETURN(0);
+ }
+
+ LPROC_SEQ_FOPS(lprocfs_client_fid_space);
+diff --git a/lustre/fld/lproc_fld.c b/lustre/fld/lproc_fld.c
+index 4ae4f26..24e336c 100644
+--- a/lustre/fld/lproc_fld.c
++++ b/lustre/fld/lproc_fld.c
+@@ -263,7 +263,7 @@ static int fldb_seq_show(struct seq_file *p, void *v)
+ fld->lsf_name, rc);
+ } else if (fld_rec->lsr_start != 0) {
+ range_be_to_cpu(fld_rec, fld_rec);
+- rc = seq_printf(p, DRANGE"\n", PRANGE(fld_rec));
++ seq_printf(p, DRANGE"\n", PRANGE(fld_rec));
+ }
+
+ return rc;
+diff --git a/lustre/ldlm/ldlm_pool.c b/lustre/ldlm/ldlm_pool.c
+index 5292266..5ed717c 100644
+--- a/lustre/ldlm/ldlm_pool.c
++++ b/lustre/ldlm/ldlm_pool.c
+@@ -685,20 +685,19 @@ static int lprocfs_pool_state_seq_show(struct seq_file *m, void *unused)
+ spin_unlock(&pl->pl_lock);
+
+ seq_printf(m, "LDLM pool state (%s):\n"
+- " SLV: "LPU64"\n"
+- " CLV: "LPU64"\n"
+- " LVF: %d\n",
+- pl->pl_name, slv, clv, lvf);
++ " SLV: "LPU64"\n"
++ " CLV: "LPU64"\n"
++ " LVF: %d\n",
++ pl->pl_name, slv, clv, lvf);
+
+ if (ns_is_server(ldlm_pl2ns(pl))) {
+- seq_printf(m, " GSP: %d%%\n"
+- " GP: %d\n",
+- grant_step, grant_plan);
++ seq_printf(m, " GSP: %d%%\n", grant_step);
++ seq_printf(m, " GP: %d\n", grant_plan);
+ }
+- seq_printf(m, " GR: %d\n" " CR: %d\n" " GS: %d\n"
+- " G: %d\n" " L: %d\n",
+- grant_rate, cancel_rate, grant_speed,
+- granted, limit);
++
++ seq_printf(m, " GR: %d\n CR: %d\n GS: %d\n G: %d\n L: %d\n",
++ grant_rate, cancel_rate, grant_speed,
++ granted, limit);
+ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(lprocfs_pool_state);
+diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c
+index 7ed21e3..7abcaaa 100644
+--- a/lustre/ldlm/ldlm_resource.c
++++ b/lustre/ldlm/ldlm_resource.c
+@@ -88,7 +88,8 @@ LPROC_SEQ_FOPS_RO_TYPE(ldlm, uint);
+
+ static int seq_watermark_show(struct seq_file *m, void *data)
+ {
+- return seq_printf(m, LPU64"\n", *(__u64 *)m->private);
++ seq_printf(m, LPU64"\n", *(__u64 *)m->private);
++ return 0;
+ }
+
+ static ssize_t seq_watermark_write(struct file *file,
+@@ -161,8 +162,9 @@ static const struct file_operations ldlm_watermark_fops = {
+
+ static int seq_granted_show(struct seq_file *m, void *data)
+ {
+- return seq_printf(m, LPU64"\n", percpu_counter_sum_positive(
+- (struct percpu_counter *)m->private));
++ seq_printf(m, LPU64"\n", percpu_counter_sum_positive(
++ (struct percpu_counter *)m->private));
++ return 0;
+ }
+
+ static int seq_granted_open(struct inode *inode, struct file *file)
+diff --git a/lustre/lfsck/lfsck_internal.h b/lustre/lfsck/lfsck_internal.h
+index 281643e..a75e948 100644
+--- a/lustre/lfsck/lfsck_internal.h
++++ b/lustre/lfsck/lfsck_internal.h
+@@ -411,9 +411,9 @@ struct lfsck_operations {
+ int result,
+ bool init);
+
+- int (*lfsck_dump)(const struct lu_env *env,
+- struct lfsck_component *com,
+- struct seq_file *m);
++ void (*lfsck_dump)(const struct lu_env *env,
++ struct lfsck_component *com,
++ struct seq_file *m);
+
+ int (*lfsck_double_scan)(const struct lu_env *env,
+ struct lfsck_component *com);
+@@ -917,11 +917,11 @@ void lfsck_component_cleanup(const struct lu_env *env,
+ struct lfsck_component *com);
+ void lfsck_instance_cleanup(const struct lu_env *env,
+ struct lfsck_instance *lfsck);
+-int lfsck_bits_dump(struct seq_file *m, int bits, const char *names[],
++void lfsck_bits_dump(struct seq_file *m, int bits, const char *names[],
++ const char *prefix);
++void lfsck_time_dump(struct seq_file *m, __u64 time, const char *name);
++void lfsck_pos_dump(struct seq_file *m, struct lfsck_position *pos,
+ const char *prefix);
+-int lfsck_time_dump(struct seq_file *m, __u64 time, const char *name);
+-int lfsck_pos_dump(struct seq_file *m, struct lfsck_position *pos,
+- const char *prefix);
+ void lfsck_pos_fill(const struct lu_env *env, struct lfsck_instance *lfsck,
+ struct lfsck_position *pos, bool init);
+ bool __lfsck_set_speed(struct lfsck_instance *lfsck, __u32 limit);
+diff --git a/lustre/lfsck/lfsck_layout.c b/lustre/lfsck/lfsck_layout.c
+index 66732d5..e40c311 100644
+--- a/lustre/lfsck/lfsck_layout.c
++++ b/lustre/lfsck/lfsck_layout.c
+@@ -4747,73 +4747,59 @@ static int lfsck_layout_slave_post(const struct lu_env *env,
+ return rc;
+ }
+
+-static int lfsck_layout_dump(const struct lu_env *env,
+- struct lfsck_component *com, struct seq_file *m)
++static void lfsck_layout_dump(const struct lu_env *env,
++ struct lfsck_component *com, struct seq_file *m)
+ {
+ struct lfsck_instance *lfsck = com->lc_lfsck;
+ struct lfsck_bookmark *bk = &lfsck->li_bookmark_ram;
+ struct lfsck_layout *lo = com->lc_file_ram;
+- int rc;
+
+ down_read(&com->lc_sem);
+ seq_printf(m, "name: lfsck_layout\n"
+- "magic: %#x\n"
+- "version: %d\n"
+- "status: %s\n",
+- lo->ll_magic,
+- bk->lb_version,
+- lfsck_status2names(lo->ll_status));
+-
+- rc = lfsck_bits_dump(m, lo->ll_flags, lfsck_flags_names, "flags");
+- if (rc < 0)
+- goto out;
++ "magic: %#x\n"
++ "version: %d\n"
++ "status: %s\n",
++ lo->ll_magic,
++ bk->lb_version,
++ lfsck_status2name(lo->ll_status));
+
+- rc = lfsck_bits_dump(m, bk->lb_param, lfsck_param_names, "param");
+- if (rc < 0)
+- goto out;
++ lfsck_bits_dump(m, lo->ll_flags, lfsck_flags_names, "flags");
+
+- rc = lfsck_time_dump(m, lo->ll_time_last_complete,
+- "last_completed");
+- if (rc < 0)
+- goto out;
++ lfsck_bits_dump(m, bk->lb_param, lfsck_param_names, "param");
+
+- rc = lfsck_time_dump(m, lo->ll_time_latest_start,
+- "latest_start");
+- if (rc < 0)
+- goto out;
++ lfsck_time_dump(m, lo->ll_time_last_complete, "last_completed");
+
+- rc = lfsck_time_dump(m, lo->ll_time_last_checkpoint,
+- "last_checkpoint");
+- if (rc < 0)
+- goto out;
++ lfsck_time_dump(m, lo->ll_time_latest_start, "latest_start");
++
++ lfsck_time_dump(m, lo->ll_time_last_checkpoint, "last_checkpoint");
+
+ seq_printf(m, "latest_start_position: "LPU64"\n"
+- "last_checkpoint_position: "LPU64"\n"
+- "first_failure_position: "LPU64"\n",
+- lo->ll_pos_latest_start,
+- lo->ll_pos_last_checkpoint,
+- lo->ll_pos_first_inconsistent);
++ "last_checkpoint_position: "LPU64"\n"
++ "first_failure_position: "LPU64"\n",
++ lo->ll_pos_latest_start,
++ lo->ll_pos_last_checkpoint,
++ lo->ll_pos_first_inconsistent);
+
+ seq_printf(m, "success_count: %u\n"
+- "repaired_dangling: "LPU64"\n"
+- "repaired_unmatched_pair: "LPU64"\n"
+- "repaired_multiple_referenced: "LPU64"\n"
+- "repaired_orphan: "LPU64"\n"
+- "repaired_inconsistent_owner: "LPU64"\n"
+- "repaired_others: "LPU64"\n"
+- "skipped: "LPU64"\n"
+- "failed_phase1: "LPU64"\n"
+- "failed_phase2: "LPU64"\n",
+- lo->ll_success_count,
+- lo->ll_objs_repaired[LLIT_DANGLING - 1],
+- lo->ll_objs_repaired[LLIT_UNMATCHED_PAIR - 1],
+- lo->ll_objs_repaired[LLIT_MULTIPLE_REFERENCED - 1],
+- lo->ll_objs_repaired[LLIT_ORPHAN - 1],
+- lo->ll_objs_repaired[LLIT_INCONSISTENT_OWNER - 1],
+- lo->ll_objs_repaired[LLIT_OTHERS - 1],
+- lo->ll_objs_skipped,
+- lo->ll_objs_failed_phase1,
+- lo->ll_objs_failed_phase2);
++ "repaired_dangling: "LPU64"\n"
++ "repaired_unmatched_pair: "LPU64"\n"
++ "repaired_multiple_referenced: "LPU64"\n"
++ "repaired_orphan: "LPU64"\n"
++ "repaired_inconsistent_owner: "LPU64"\n"
++ "repaired_others: "LPU64"\n"
++ "skipped: "LPU64"\n"
++ "failed_phase1: "LPU64"\n"
++ "failed_phase2: "LPU64"\n",
++ lo->ll_success_count,
++ lo->ll_objs_repaired[LLIT_DANGLING - 1],
++ lo->ll_objs_repaired[LLIT_UNMATCHED_PAIR - 1],
++ lo->ll_objs_repaired[LLIT_MULTIPLE_REFERENCED - 1],
++ lo->ll_objs_repaired[LLIT_ORPHAN - 1],
++ lo->ll_objs_repaired[LLIT_INCONSISTENT_OWNER - 1],
++ lo->ll_objs_repaired[LLIT_OTHERS - 1],
++ lo->ll_objs_skipped,
++ lo->ll_objs_failed_phase1,
++ lo->ll_objs_failed_phase2);
+
+ if (lo->ll_status == LS_SCANNING_PHASE1) {
+ __u64 pos;
+@@ -4833,19 +4819,19 @@ static int lfsck_layout_dump(const struct lu_env *env,
+ if (rtime != 0)
+ do_div(speed, rtime);
+ seq_printf(m, "checked_phase1: "LPU64"\n"
+- "checked_phase2: "LPU64"\n"
+- "run_time_phase1: %u seconds\n"
+- "run_time_phase2: %u seconds\n"
+- "average_speed_phase1: "LPU64" items/sec\n"
+- "average_speed_phase2: N/A\n"
+- "real-time_speed_phase1: "LPU64" items/sec\n"
+- "real-time_speed_phase2: N/A\n",
+- checked,
+- lo->ll_objs_checked_phase2,
+- rtime,
+- lo->ll_run_time_phase2,
+- speed,
+- new_checked);
++ "checked_phase2: "LPU64"\n"
++ "run_time_phase1: %u seconds\n"
++ "run_time_phase2: %u seconds\n"
++ "average_speed_phase1: "LPU64" items/sec\n"
++ "average_speed_phase2: N/A\n"
++ "real-time_speed_phase1: "LPU64" items/sec\n"
++ "real-time_speed_phase2: N/A\n",
++ checked,
++ lo->ll_objs_checked_phase2,
++ rtime,
++ lo->ll_run_time_phase2,
++ speed,
++ new_checked);
+
+ LASSERT(lfsck->li_di_oit != NULL);
+
+@@ -4878,26 +4864,23 @@ static int lfsck_layout_dump(const struct lu_env *env,
+ do_div(speed1, lo->ll_run_time_phase1);
+ if (rtime != 0)
+ do_div(speed2, rtime);
+- rc = seq_printf(m, "checked_phase1: "LPU64"\n"
+- "checked_phase2: "LPU64"\n"
+- "run_time_phase1: %u seconds\n"
+- "run_time_phase2: %u seconds\n"
+- "average_speed_phase1: "LPU64" items/sec\n"
+- "average_speed_phase2: "LPU64" items/sec\n"
+- "real-time_speed_phase1: N/A\n"
+- "real-time_speed_phase2: "LPU64" items/sec\n"
+- "current_position: "DFID"\n",
+- lo->ll_objs_checked_phase1,
+- checked,
+- lo->ll_run_time_phase1,
+- rtime,
+- speed1,
+- speed2,
+- new_checked,
+- PFID(&com->lc_fid_latest_scanned_phase2));
+- if (rc <= 0)
+- goto out;
+-
++ seq_printf(m, "checked_phase1: "LPU64"\n"
++ "checked_phase2: "LPU64"\n"
++ "run_time_phase1: %u seconds\n"
++ "run_time_phase2: %u seconds\n"
++ "average_speed_phase1: "LPU64" items/sec\n"
++ "average_speed_phase2: "LPU64" items/sec\n"
++ "real-time_speed_phase1: N/A\n"
++ "real-time_speed_phase2: "LPU64" items/sec\n"
++ "current_position: "DFID"\n",
++ lo->ll_objs_checked_phase1,
++ checked,
++ lo->ll_run_time_phase1,
++ rtime,
++ speed1,
++ speed2,
++ new_checked,
++ PFID(&com->lc_fid_latest_scanned_phase2));
+ } else {
+ __u64 speed1 = lo->ll_objs_checked_phase1;
+ __u64 speed2 = lo->ll_objs_checked_phase2;
+@@ -4922,10 +4905,8 @@ static int lfsck_layout_dump(const struct lu_env *env,
+ speed1,
+ speed2);
+ }
+-out:
+- up_read(&com->lc_sem);
+
+- return rc;
++ up_read(&com->lc_sem);
+ }
+
+ static int lfsck_layout_master_double_scan(const struct lu_env *env,
+diff --git a/lustre/lfsck/lfsck_lib.c b/lustre/lfsck/lfsck_lib.c
+index 139c95b..1064392 100644
+--- a/lustre/lfsck/lfsck_lib.c
++++ b/lustre/lfsck/lfsck_lib.c
+@@ -1749,17 +1749,14 @@ static inline int lfsck_instance_add(struct lfsck_instance *lfsck)
+ return 0;
+ }
+
+-int lfsck_bits_dump(struct seq_file *m, int bits, const char *names[],
+- const char *prefix)
++void lfsck_bits_dump(struct seq_file *m, int bits, const char *names[],
++ const char *prefix)
+ {
+ int flag;
+ int i;
+ bool newline = (bits != 0 ? false : true);
+- int rc;
+
+- rc = seq_printf(m, "%s:%c", prefix, bits != 0 ? ' ' : '\n');
+- if (rc < 0)
+- return rc;
++ seq_printf(m, "%s:%c", prefix, bits != 0 ? ' ' : '\n');
+
+ for (i = 0, flag = 1; bits != 0; i++, flag = 1 << i) {
+ if (flag & bits) {
+@@ -1768,54 +1765,43 @@ int lfsck_bits_dump(struct seq_file *m, int bits, const char *names[],
+ if (bits == 0)
+ newline = true;
+
+- rc = seq_printf(m, "%s%c", names[i],
+- newline ? '\n' : ',');
+- if (rc < 0)
+- return rc;
++ seq_printf(m, "%s%c", names[i],
++ newline ? '\n' : ',');
+ }
+ }
+ }
+
+ if (!newline)
+- rc = seq_printf(m, "\n");
+-
+- return rc;
++ seq_putc(m, '\n');
+ }
+
+-int lfsck_time_dump(struct seq_file *m, __u64 time, const char *name)
++void lfsck_time_dump(struct seq_file *m, __u64 time, const char *name)
+ {
+- int rc;
+-
+ if (time == 0) {
+- rc = seq_printf(m, "%s_time: N/A\n", name);
+- if (rc == 0)
+- rc = seq_printf(m, "time_since_%s: N/A\n", name);
+-
+- return rc;
++ seq_printf(m, "%s_time: N/A\n", name);
++ seq_printf(m, "time_since_%s: N/A\n", name);
++ } else {
++ seq_printf(m, "%s_time: "LPU64"\n", name, time);
++ seq_printf(m, "time_since_%s: "LPU64" seconds\n",
++ name, cfs_time_current_sec() - time);
+ }
+-
+- rc = seq_printf(m, "%s_time: "LPU64"\n", name, time);
+- if (rc == 0)
+- rc = seq_printf(m, "time_since_%s: "LPU64" seconds\n",
+- name, cfs_time_current_sec() - time);
+-
+- return rc;
+ }
+
+-int lfsck_pos_dump(struct seq_file *m, struct lfsck_position *pos,
+- const char *prefix)
++void lfsck_pos_dump(struct seq_file *m, struct lfsck_position *pos,
++ const char *prefix)
+ {
+ if (fid_is_zero(&pos->lp_dir_parent)) {
+- if (pos->lp_oit_cookie == 0)
+- return seq_printf(m, "%s: N/A, N/A, N/A\n", prefix);
+-
+- return seq_printf(m, "%s: "LPU64", N/A, N/A\n",
+- prefix, pos->lp_oit_cookie);
++ if (pos->lp_oit_cookie == 0) {
++ seq_printf(m, "%s: N/A, N/A, N/A\n", prefix);
++ return;
++ }
++ seq_printf(m, "%s: "LPU64", N/A, N/A\n",
++ prefix, pos->lp_oit_cookie);
++ } else {
++ seq_printf(m, "%s: "LPU64", "DFID", "LPX64"\n",
++ prefix, pos->lp_oit_cookie,
++ PFID(&pos->lp_dir_parent), pos->lp_dir_cookie);
+ }
+-
+- return seq_printf(m, "%s: "LPU64", "DFID", "LPX64"\n",
+- prefix, pos->lp_oit_cookie,
+- PFID(&pos->lp_dir_parent), pos->lp_dir_cookie);
+ }
+
+ void lfsck_pos_fill(const struct lu_env *env, struct lfsck_instance *lfsck,
+@@ -2696,7 +2682,7 @@ int lfsck_dump(struct seq_file *m, struct dt_device *key, enum lfsck_type type)
+ if (likely(lfsck != NULL)) {
+ com = lfsck_component_find(lfsck, type);
+ if (likely(com != NULL)) {
+- rc = com->lc_ops->lfsck_dump(&env, com, m);
++ com->lc_ops->lfsck_dump(&env, com, m);
+ lfsck_component_put(&env, com);
+ } else {
+ rc = -ENOTSUPP;
+diff --git a/lustre/lfsck/lfsck_namespace.c b/lustre/lfsck/lfsck_namespace.c
+index fa448bb..a97fa17 100644
+--- a/lustre/lfsck/lfsck_namespace.c
++++ b/lustre/lfsck/lfsck_namespace.c
+@@ -3611,75 +3611,75 @@ static void lfsck_namespace_dump_statistics(struct seq_file *m,
+ __u32 time_phase2)
+ {
+ seq_printf(m, "checked_phase1: "LPU64"\n"
+- "checked_phase2: "LPU64"\n"
+- "updated_phase1: "LPU64"\n"
+- "updated_phase2: "LPU64"\n"
+- "failed_phase1: "LPU64"\n"
+- "failed_phase2: "LPU64"\n"
+- "directories: "LPU64"\n"
+- "dirent_repaired: "LPU64"\n"
+- "linkea_repaired: "LPU64"\n"
+- "nlinks_repaired: "LPU64"\n"
+- "multiple_linked_checked: "LPU64"\n"
+- "multiple_linked_repaired: "LPU64"\n"
+- "unknown_inconsistency: "LPU64"\n"
+- "unmatched_pairs_repaired: "LPU64"\n"
+- "dangling_repaired: "LPU64"\n"
+- "multiple_referenced_repaired: "LPU64"\n"
+- "bad_file_type_repaired: "LPU64"\n"
+- "lost_dirent_repaired: "LPU64"\n"
+- "local_lost_found_scanned: "LPU64"\n"
+- "local_lost_found_moved: "LPU64"\n"
+- "local_lost_found_skipped: "LPU64"\n"
+- "local_lost_found_failed: "LPU64"\n"
+- "striped_dirs_scanned: "LPU64"\n"
+- "striped_dirs_repaired: "LPU64"\n"
+- "striped_dirs_failed: "LPU64"\n"
+- "striped_dirs_disabled: "LPU64"\n"
+- "striped_dirs_skipped: "LPU64"\n"
+- "striped_shards_scanned: "LPU64"\n"
+- "striped_shards_repaired: "LPU64"\n"
+- "striped_shards_failed: "LPU64"\n"
+- "striped_shards_skipped: "LPU64"\n"
+- "name_hash_repaired: "LPU64"\n"
+- "success_count: %u\n"
+- "run_time_phase1: %u seconds\n"
+- "run_time_phase2: %u seconds\n",
+- checked_phase1,
+- checked_phase2,
+- ns->ln_items_repaired,
+- ns->ln_objs_repaired_phase2,
+- ns->ln_items_failed,
+- ns->ln_objs_failed_phase2,
+- ns->ln_dirs_checked,
+- ns->ln_dirent_repaired,
+- ns->ln_linkea_repaired,
+- ns->ln_objs_nlink_repaired,
+- ns->ln_mul_linked_checked,
+- ns->ln_mul_linked_repaired,
+- ns->ln_unknown_inconsistency,
+- ns->ln_unmatched_pairs_repaired,
+- ns->ln_dangling_repaired,
+- ns->ln_mul_ref_repaired,
+- ns->ln_bad_type_repaired,
+- ns->ln_lost_dirent_repaired,
+- ns->ln_local_lpf_scanned,
+- ns->ln_local_lpf_moved,
+- ns->ln_local_lpf_skipped,
+- ns->ln_local_lpf_failed,
+- ns->ln_striped_dirs_scanned,
+- ns->ln_striped_dirs_repaired,
+- ns->ln_striped_dirs_failed,
+- ns->ln_striped_dirs_disabled,
+- ns->ln_striped_dirs_skipped,
+- ns->ln_striped_shards_scanned,
+- ns->ln_striped_shards_repaired,
+- ns->ln_striped_shards_failed,
+- ns->ln_striped_shards_skipped,
+- ns->ln_name_hash_repaired,
+- ns->ln_success_count,
+- time_phase1,
+- time_phase2);
++ "checked_phase2: "LPU64"\n"
++ "updated_phase1: "LPU64"\n"
++ "updated_phase2: "LPU64"\n"
++ "failed_phase1: "LPU64"\n"
++ "failed_phase2: "LPU64"\n"
++ "directories: "LPU64"\n"
++ "dirent_repaired: "LPU64"\n"
++ "linkea_repaired: "LPU64"\n"
++ "nlinks_repaired: "LPU64"\n"
++ "multiple_linked_checked: "LPU64"\n"
++ "multiple_linked_repaired: "LPU64"\n"
++ "unknown_inconsistency: "LPU64"\n"
++ "unmatched_pairs_repaired: "LPU64"\n"
++ "dangling_repaired: "LPU64"\n"
++ "multiple_referenced_repaired: "LPU64"\n"
++ "bad_file_type_repaired: "LPU64"\n"
++ "lost_dirent_repaired: "LPU64"\n"
++ "local_lost_found_scanned: "LPU64"\n"
++ "local_lost_found_moved: "LPU64"\n"
++ "local_lost_found_skipped: "LPU64"\n"
++ "local_lost_found_failed: "LPU64"\n"
++ "striped_dirs_scanned: "LPU64"\n"
++ "striped_dirs_repaired: "LPU64"\n"
++ "striped_dirs_failed: "LPU64"\n"
++ "striped_dirs_disabled: "LPU64"\n"
++ "striped_dirs_skipped: "LPU64"\n"
++ "striped_shards_scanned: "LPU64"\n"
++ "striped_shards_repaired: "LPU64"\n"
++ "striped_shards_failed: "LPU64"\n"
++ "striped_shards_skipped: "LPU64"\n"
++ "name_hash_repaired: "LPU64"\n"
++ "success_count: %u\n"
++ "run_time_phase1: %u seconds\n"
++ "run_time_phase2: %u seconds\n",
++ checked_phase1,
++ checked_phase2,
++ ns->ln_items_repaired,
++ ns->ln_objs_repaired_phase2,
++ ns->ln_items_failed,
++ ns->ln_objs_failed_phase2,
++ ns->ln_dirs_checked,
++ ns->ln_dirent_repaired,
++ ns->ln_linkea_repaired,
++ ns->ln_objs_nlink_repaired,
++ ns->ln_mul_linked_checked,
++ ns->ln_mul_linked_repaired,
++ ns->ln_unknown_inconsistency,
++ ns->ln_unmatched_pairs_repaired,
++ ns->ln_dangling_repaired,
++ ns->ln_mul_ref_repaired,
++ ns->ln_bad_type_repaired,
++ ns->ln_lost_dirent_repaired,
++ ns->ln_local_lpf_scanned,
++ ns->ln_local_lpf_moved,
++ ns->ln_local_lpf_skipped,
++ ns->ln_local_lpf_failed,
++ ns->ln_striped_dirs_scanned,
++ ns->ln_striped_dirs_repaired,
++ ns->ln_striped_dirs_failed,
++ ns->ln_striped_dirs_disabled,
++ ns->ln_striped_dirs_skipped,
++ ns->ln_striped_shards_scanned,
++ ns->ln_striped_shards_repaired,
++ ns->ln_striped_shards_failed,
++ ns->ln_striped_shards_skipped,
++ ns->ln_name_hash_repaired,
++ ns->ln_success_count,
++ time_phase1,
++ time_phase2);
+ }
+
+ static void lfsck_namespace_release_lmv(const struct lu_env *env,
+@@ -4243,14 +4243,13 @@ static int lfsck_namespace_post(const struct lu_env *env,
+ RETURN(rc);
+ }
+
+-static int
++static void
+ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
+ struct seq_file *m)
+ {
+ struct lfsck_instance *lfsck = com->lc_lfsck;
+ struct lfsck_bookmark *bk = &lfsck->li_bookmark_ram;
+ struct lfsck_namespace *ns = com->lc_file_ram;
+- int rc;
+
+ down_read(&com->lc_sem);
+ seq_printf(m, "name: lfsck_namespace\n"
+@@ -4261,43 +4260,23 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
+ bk->lb_version,
+ lfsck_status2names(ns->ln_status));
+
+- rc = lfsck_bits_dump(m, ns->ln_flags, lfsck_flags_names, "flags");
+- if (rc < 0)
+- goto out;
++ lfsck_bits_dump(m, ns->ln_flags, lfsck_flags_names, "flags");
+
+- rc = lfsck_bits_dump(m, bk->lb_param, lfsck_param_names, "param");
+- if (rc < 0)
+- goto out;
++ lfsck_bits_dump(m, bk->lb_param, lfsck_param_names, "param");
+
+- rc = lfsck_time_dump(m, ns->ln_time_last_complete,
+- "last_completed");
+- if (rc < 0)
+- goto out;
++ lfsck_time_dump(m, ns->ln_time_last_complete, "last_completed");
+
+- rc = lfsck_time_dump(m, ns->ln_time_latest_start,
+- "latest_start");
+- if (rc < 0)
+- goto out;
++ lfsck_time_dump(m, ns->ln_time_latest_start, "latest_start");
+
+- rc = lfsck_time_dump(m, ns->ln_time_last_checkpoint,
+- "last_checkpoint");
+- if (rc < 0)
+- goto out;
++ lfsck_time_dump(m, ns->ln_time_last_checkpoint, "last_checkpoint");
+
+- rc = lfsck_pos_dump(m, &ns->ln_pos_latest_start,
+- "latest_start_position");
+- if (rc < 0)
+- goto out;
++ lfsck_pos_dump(m, &ns->ln_pos_latest_start, "latest_start_position");
+
+- rc = lfsck_pos_dump(m, &ns->ln_pos_last_checkpoint,
+- "last_checkpoint_position");
+- if (rc < 0)
+- goto out;
++ lfsck_pos_dump(m, &ns->ln_pos_last_checkpoint,
++ "last_checkpoint_position");
+
+- rc = lfsck_pos_dump(m, &ns->ln_pos_first_inconsistent,
+- "first_failure_position");
+- if (rc < 0)
+- goto out;
++ lfsck_pos_dump(m, &ns->ln_pos_first_inconsistent,
++ "first_failure_position");
+
+ if (ns->ln_status == LS_SCANNING_PHASE1) {
+ struct lfsck_position pos;
+@@ -4319,13 +4298,13 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
+
+ lfsck_namespace_dump_statistics(m, ns, checked, 0, rtime, 0);
+ seq_printf(m, "average_speed_phase1: "LPU64" items/sec\n"
+- "average_speed_phase2: N/A\n"
+- "average_speed_total: "LPU64" items/sec\n"
+- "real_time_speed_phase1: "LPU64" items/sec\n"
+- "real_time_speed_phase2: N/A\n",
+- speed,
+- speed,
+- new_checked);
++ "average_speed_phase2: N/A\n"
++ "average_speed_total: "LPU64" items/sec\n"
++ "real_time_speed_phase1: "LPU64" items/sec\n"
++ "real_time_speed_phase2: N/A\n",
++ speed,
++ speed,
++ new_checked);
+
+ LASSERT(lfsck->li_di_oit != NULL);
+
+@@ -4389,16 +4368,16 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
+ checked,
+ ns->ln_run_time_phase1, rtime);
+ seq_printf(m, "average_speed_phase1: "LPU64" items/sec\n"
+- "average_speed_phase2: "LPU64" objs/sec\n"
+- "average_speed_total: "LPU64" items/sec\n"
+- "real_time_speed_phase1: N/A\n"
+- "real_time_speed_phase2: "LPU64" objs/sec\n"
+- "current_position: "DFID"\n",
+- speed1,
+- speed2,
+- speed0,
+- new_checked,
+- PFID(&ns->ln_fid_latest_scanned_phase2));
++ "average_speed_phase2: "LPU64" objs/sec\n"
++ "average_speed_total: "LPU64" items/sec\n"
++ "real_time_speed_phase1: N/A\n"
++ "real_time_speed_phase2: "LPU64" objs/sec\n"
++ "current_position: "DFID"\n",
++ speed1,
++ speed2,
++ speed0,
++ new_checked,
++ PFID(&ns->ln_fid_latest_scanned_phase2));
+ } else {
+ __u64 speed1 = ns->ln_items_checked;
+ __u64 speed2 = ns->ln_objs_checked_phase2;
+@@ -4423,18 +4402,17 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
+ ns->ln_run_time_phase1,
+ ns->ln_run_time_phase2);
+ seq_printf(m, "average_speed_phase1: "LPU64" items/sec\n"
+- "average_speed_phase2: "LPU64" objs/sec\n"
+- "average_speed_total: "LPU64" items/sec\n"
+- "real_time_speed_phase1: N/A\n"
+- "real_time_speed_phase2: N/A\n"
+- "current_position: N/A\n",
+- speed1,
+- speed2,
+- speed0);
++ "average_speed_phase2: "LPU64" objs/sec\n"
++ "average_speed_total: "LPU64" items/sec\n"
++ "real_time_speed_phase1: N/A\n"
++ "real_time_speed_phase2: N/A\n"
++ "current_position: N/A\n",
++ speed1,
++ speed2,
++ speed0);
+ }
+-out:
++
+ up_read(&com->lc_sem);
+- return 0;
+ }
+
+ static int lfsck_namespace_double_scan(const struct lu_env *env,
+diff --git a/lustre/llite/lproc_llite.c b/lustre/llite/lproc_llite.c
+index e631f50..1767a00 100644
+--- a/lustre/llite/lproc_llite.c
++++ b/lustre/llite/lproc_llite.c
+@@ -66,7 +66,7 @@ static int ll_blksize_seq_show(struct seq_file *m, void *v)
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
+ OBD_STATFS_NODELAY);
+ if (!rc)
+- rc = seq_printf(m, "%u\n", osfs.os_bsize);
++ seq_printf(m, "%u\n", osfs.os_bsize);
+ return rc;
+ }
+ LPROC_SEQ_FOPS_RO(ll_blksize);
+@@ -88,7 +88,7 @@ static int ll_kbytestotal_seq_show(struct seq_file *m, void *v)
+ while (blk_size >>= 1)
+ result <<= 1;
+
+- rc = seq_printf(m, LPU64"\n", result);
++ seq_printf(m, LPU64"\n", result);
+ }
+ return rc;
+ }
+@@ -111,7 +111,7 @@ static int ll_kbytesfree_seq_show(struct seq_file *m, void *v)
+ while (blk_size >>= 1)
+ result <<= 1;
+
+- rc = seq_printf(m, LPU64"\n", result);
++ seq_printf(m, LPU64"\n", result);
+ }
+ return rc;
+ }
+@@ -134,7 +134,7 @@ static int ll_kbytesavail_seq_show(struct seq_file *m, void *v)
+ while (blk_size >>= 1)
+ result <<= 1;
+
+- rc = seq_printf(m, LPU64"\n", result);
++ seq_printf(m, LPU64"\n", result);
+ }
+ return rc;
+ }
+@@ -151,7 +151,7 @@ static int ll_filestotal_seq_show(struct seq_file *m, void *v)
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
+ OBD_STATFS_NODELAY);
+ if (!rc)
+- rc = seq_printf(m, LPU64"\n", osfs.os_files);
++ seq_printf(m, LPU64"\n", osfs.os_files);
+ return rc;
+ }
+ LPROC_SEQ_FOPS_RO(ll_filestotal);
+@@ -167,7 +167,7 @@ static int ll_filesfree_seq_show(struct seq_file *m, void *v)
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
+ OBD_STATFS_NODELAY);
+ if (!rc)
+- rc = seq_printf(m, LPU64"\n", osfs.os_ffree);
++ seq_printf(m, LPU64"\n", osfs.os_ffree);
+ return rc;
+ }
+ LPROC_SEQ_FOPS_RO(ll_filesfree);
+@@ -175,15 +175,14 @@ LPROC_SEQ_FOPS_RO(ll_filesfree);
+ static int ll_client_type_seq_show(struct seq_file *m, void *v)
+ {
+ struct ll_sb_info *sbi = ll_s2sbi((struct super_block *)m->private);
+- int rc;
+
+ LASSERT(sbi != NULL);
+
+ if (sbi->ll_flags & LL_SBI_RMT_CLIENT)
+- rc = seq_printf(m, "remote client\n");
++ seq_puts(m, "remote client\n");
+ else
+- rc = seq_printf(m, "local client\n");
+- return rc;
++ seq_puts(m, "local client\n");
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ll_client_type);
+
+@@ -192,7 +191,8 @@ static int ll_fstype_seq_show(struct seq_file *m, void *v)
+ struct super_block *sb = m->private;
+
+ LASSERT(sb != NULL);
+- return seq_printf(m, "%s\n", sb->s_type->name);
++ seq_printf(m, "%s\n", sb->s_type->name);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ll_fstype);
+
+@@ -201,7 +201,8 @@ static int ll_sb_uuid_seq_show(struct seq_file *m, void *v)
+ struct super_block *sb = m->private;
+
+ LASSERT(sb != NULL);
+- return seq_printf(m, "%s\n", ll_s2sbi(sb)->ll_sb_uuid.uuid);
++ seq_printf(m, "%s\n", ll_s2sbi(sb)->ll_sb_uuid.uuid);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ll_sb_uuid);
+
+@@ -209,7 +210,8 @@ static int ll_xattr_cache_seq_show(struct seq_file *m, void *v)
+ {
+ struct ll_sb_info *sbi = ll_s2sbi((struct super_block *)m->private);
+
+- return seq_printf(m, "%u\n", sbi->ll_xattr_cache_enabled);
++ seq_printf(m, "%u\n", sbi->ll_xattr_cache_enabled);
++ return 0;
+ }
+
+ static ssize_t ll_xattr_cache_seq_write(struct file *file,
+@@ -407,17 +409,17 @@ static int ll_max_cached_mb_seq_show(struct seq_file *m, void *v)
+
+ max_cached_mb = cache->ccc_lru_max >> shift;
+ unused_mb = atomic_long_read(&cache->ccc_lru_left) >> shift;
+- return seq_printf(m,
+- "users: %d\n"
+- "max_cached_mb: %ld\n"
+- "used_mb: %ld\n"
+- "unused_mb: %ld\n"
+- "reclaim_count: %u\n",
+- atomic_read(&cache->ccc_users),
+- max_cached_mb,
+- max_cached_mb - unused_mb,
+- unused_mb,
+- cache->ccc_lru_shrinkers);
++ seq_printf(m, "users: %d\n"
++ "max_cached_mb: %ld\n"
++ "used_mb: %ld\n"
++ "unused_mb: %ld\n"
++ "reclaim_count: %u\n",
++ atomic_read(&cache->ccc_users),
++ max_cached_mb,
++ max_cached_mb - unused_mb,
++ unused_mb,
++ cache->ccc_lru_shrinkers);
++ return 0;
+ }
+
+ static ssize_t
+@@ -538,7 +540,8 @@ static int ll_checksum_seq_show(struct seq_file *m, void *v)
+ struct super_block *sb = m->private;
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
+
+- return seq_printf(m, "%u\n", (sbi->ll_flags & LL_SBI_CHECKSUM) ? 1 : 0);
++ seq_printf(m, "%u\n", (sbi->ll_flags & LL_SBI_CHECKSUM) ? 1 : 0);
++ return 0;
+ }
+
+ static ssize_t ll_checksum_seq_write(struct file *file,
+@@ -575,13 +578,14 @@ static int ll_rd_track_id(struct seq_file *m, enum stats_track_type type)
+ struct super_block *sb = m->private;
+
+ if (ll_s2sbi(sb)->ll_stats_track_type == type) {
+- return seq_printf(m, "%d\n",
+- ll_s2sbi(sb)->ll_stats_track_id);
++ seq_printf(m, "%d\n",
++ ll_s2sbi(sb)->ll_stats_track_id);
+ } else if (ll_s2sbi(sb)->ll_stats_track_type == STATS_TRACK_ALL) {
+- return seq_printf(m, "0 (all)\n");
++ seq_puts(m, "0 (all)\n");
+ } else {
+- return seq_printf(m, "untracked\n");
++ seq_puts(m, "untracked\n");
+ }
++ return 0;
+ }
+
+ static int ll_wr_track_id(const char __user *buffer, unsigned long count,
+@@ -649,7 +653,8 @@ static int ll_statahead_max_seq_show(struct seq_file *m, void *v)
+ struct super_block *sb = m->private;
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
+
+- return seq_printf(m, "%u\n", sbi->ll_sa_max);
++ seq_printf(m, "%u\n", sbi->ll_sa_max);
++ return 0;
+ }
+
+ static ssize_t ll_statahead_max_seq_write(struct file *file,
+@@ -679,8 +684,9 @@ static int ll_statahead_agl_seq_show(struct seq_file *m, void *v)
+ struct super_block *sb = m->private;
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
+
+- return seq_printf(m, "%u\n",
+- sbi->ll_flags & LL_SBI_AGL_ENABLED ? 1 : 0);
++ seq_printf(m, "%u\n",
++ sbi->ll_flags & LL_SBI_AGL_ENABLED ? 1 : 0);
++ return 0;
+ }
+
+ static ssize_t ll_statahead_agl_seq_write(struct file *file,
+@@ -709,13 +715,13 @@ static int ll_statahead_stats_seq_show(struct seq_file *m, void *v)
+ struct super_block *sb = m->private;
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
+
+- return seq_printf(m,
+- "statahead total: %u\n"
+- "statahead wrong: %u\n"
+- "agl total: %u\n",
+- atomic_read(&sbi->ll_sa_total),
+- atomic_read(&sbi->ll_sa_wrong),
+- atomic_read(&sbi->ll_agl_total));
++ seq_printf(m, "statahead total: %u\n"
++ "statahead wrong: %u\n"
++ "agl total: %u\n",
++ atomic_read(&sbi->ll_sa_total),
++ atomic_read(&sbi->ll_sa_wrong),
++ atomic_read(&sbi->ll_agl_total));
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ll_statahead_stats);
+
+@@ -724,8 +730,9 @@ static int ll_lazystatfs_seq_show(struct seq_file *m, void *v)
+ struct super_block *sb = m->private;
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
+
+- return seq_printf(m, "%u\n",
+- (sbi->ll_flags & LL_SBI_LAZYSTATFS) ? 1 : 0);
++ seq_printf(m, "%u\n",
++ (sbi->ll_flags & LL_SBI_LAZYSTATFS) ? 1 : 0);
++ return 0;
+ }
+
+ static ssize_t ll_lazystatfs_seq_write(struct file *file,
+@@ -760,7 +767,8 @@ static int ll_max_easize_seq_show(struct seq_file *m, void *v)
+ if (rc)
+ return rc;
+
+- return seq_printf(m, "%u\n", ealen);
++ seq_printf(m, "%u\n", ealen);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ll_max_easize);
+
+@@ -786,7 +794,8 @@ static int ll_default_easize_seq_show(struct seq_file *m, void *v)
+ if (rc)
+ return rc;
+
+- return seq_printf(m, "%u\n", ealen);
++ seq_printf(m, "%u\n", ealen);
++ return 0;
+ }
+
+ /**
+@@ -865,10 +874,11 @@ static int ll_unstable_stats_seq_show(struct seq_file *m, void *v)
+ pages = atomic_long_read(&cache->ccc_unstable_nr);
+ mb = (pages * PAGE_CACHE_SIZE) >> 20;
+
+- return seq_printf(m, "unstable_check: %8d\n"
+- "unstable_pages: %12ld\n"
+- "unstable_mb: %8d\n",
+- cache->ccc_unstable_check, pages, mb);
++ seq_printf(m, "unstable_check: %8d\n"
++ "unstable_pages: %12ld\n"
++ "unstable_mb: %8d\n",
++ cache->ccc_unstable_check, pages, mb);
++ return 0;
+ }
+
+ static ssize_t ll_unstable_stats_seq_write(struct file *file,
+@@ -910,7 +920,8 @@ static int ll_root_squash_seq_show(struct seq_file *m, void *v)
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
+ struct root_squash_info *squash = &sbi->ll_squash;
+
+- return seq_printf(m, "%u:%u\n", squash->rsi_uid, squash->rsi_gid);
++ seq_printf(m, "%u:%u\n", squash->rsi_uid, squash->rsi_gid);
++ return 0;
+ }
+
+ static ssize_t ll_root_squash_seq_write(struct file *file,
+@@ -932,20 +943,20 @@ static int ll_nosquash_nids_seq_show(struct seq_file *m, void *v)
+ struct super_block *sb = m->private;
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
+ struct root_squash_info *squash = &sbi->ll_squash;
+- int len, rc;
++ int len;
+
+ down_read(&squash->rsi_sem);
+ if (!list_empty(&squash->rsi_nosquash_nids)) {
+ len = cfs_print_nidlist(m->buf + m->count, m->size - m->count,
+ &squash->rsi_nosquash_nids);
+ m->count += len;
+- rc = seq_printf(m, "\n");
++ seq_putc(m, '\n');
+ } else {
+- rc = seq_printf(m, "NONE\n");
++ seq_puts(m, "NONE\n");
+ }
+ up_read(&squash->rsi_sem);
+
+- return rc;
++ return 0;
+ }
+
+ static ssize_t ll_nosquash_nids_seq_write(struct file *file,
+@@ -1333,9 +1344,7 @@ static int ll_rw_extents_stats_pp_seq_show(struct seq_file *seq, void *v)
+ do_gettimeofday(&now);
+
+ if (!sbi->ll_rw_stats_on) {
+- seq_printf(seq, "disabled\n"
+- "write anything in this file to activate, "
+- "then 0 or \"[D/d]isabled\" to deactivate\n");
++ seq_puts(seq, "disabled\n write anything in this file to activate, then 0 or \[D/d]isabled\" to deactivate\n");
+ return 0;
+ }
+ seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
+@@ -1412,18 +1421,16 @@ static int ll_rw_extents_stats_seq_show(struct seq_file *seq, void *v)
+ do_gettimeofday(&now);
+
+ if (!sbi->ll_rw_stats_on) {
+- seq_printf(seq, "disabled\n"
+- "write anything in this file to activate, "
+- "then 0 or \"[D/d]isabled\" to deactivate\n");
+- return 0;
+- }
+- seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
+- now.tv_sec, now.tv_usec);
++ seq_puts(seq, "disabled\n write anything in this file to activate, then 0 or \"[D/d]isabled\" to deactivate\n");
++ return 0;
++ }
++ seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
++ now.tv_sec, now.tv_usec);
+
+- seq_printf(seq, "%15s %19s | %20s\n", " ", "read", "write");
+- seq_printf(seq, "%13s %14s %4s %4s | %14s %4s %4s\n",
+- "extents", "calls", "%", "cum%",
+- "calls", "%", "cum%");
++ seq_printf(seq, "%15s %19s | %20s\n", " ", "read", "write");
++ seq_printf(seq, "%13s %14s %4s %4s | %14s %4s %4s\n",
++ "extents", "calls", "%", "cum%",
++ "calls", "%", "cum%");
+ spin_lock(&sbi->ll_lock);
+ ll_display_extents_info(io_extents, seq, LL_PROCESS_HIST_MAX);
+ spin_unlock(&sbi->ll_lock);
+@@ -1591,11 +1598,9 @@ static int ll_rw_offset_stats_seq_show(struct seq_file *seq, void *v)
+ do_gettimeofday(&now);
+
+ if (!sbi->ll_rw_stats_on) {
+- seq_printf(seq, "disabled\n"
+- "write anything in this file to activate, "
+- "then 0 or \"[D/d]isabled\" to deactivate\n");
+- return 0;
+- }
++ seq_puts(seq, "disabled\n write anything in this file to activate, then 0 or \"[D/d]isabled\" to deactivate\n");
++ return 0;
++ }
+ spin_lock(&sbi->ll_process_lock);
+
+ seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
+diff --git a/lustre/lmv/lproc_lmv.c b/lustre/lmv/lproc_lmv.c
+index 1f8b5a6..251dd93 100644
+--- a/lustre/lmv/lproc_lmv.c
++++ b/lustre/lmv/lproc_lmv.c
+@@ -55,7 +55,8 @@ static int lmv_numobd_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ desc = &dev->u.lmv.desc;
+- return seq_printf(m, "%u\n", desc->ld_tgt_count);
++ seq_printf(m, "%u\n", desc->ld_tgt_count);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(lmv_numobd);
+
+@@ -89,7 +90,8 @@ static int lmv_placement_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ lmv = &dev->u.lmv;
+- return seq_printf(m, "%s\n", placement_policy2name(lmv->lmv_placement));
++ seq_printf(m, "%s\n", placement_policy2name(lmv->lmv_placement));
++ return 0;
+ }
+
+ #define MAX_POLICY_STRING_SIZE 64
+@@ -137,7 +139,8 @@ static int lmv_activeobd_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ desc = &dev->u.lmv.desc;
+- return seq_printf(m, "%u\n", desc->ld_active_tgt_count);
++ seq_printf(m, "%u\n", desc->ld_active_tgt_count);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(lmv_activeobd);
+
+@@ -148,7 +151,8 @@ static int lmv_desc_uuid_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ lmv = &dev->u.lmv;
+- return seq_printf(m, "%s\n", lmv->desc.ld_uuid.uuid);
++ seq_printf(m, "%s\n", lmv->desc.ld_uuid.uuid);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(lmv_desc_uuid);
+
+@@ -178,8 +182,9 @@ static int lmv_tgt_seq_show(struct seq_file *p, void *v)
+
+ if (tgt == NULL)
+ return 0;
+- return seq_printf(p, "%u: %s %sACTIVE\n", tgt->ltd_idx,
+- tgt->ltd_uuid.uuid, tgt->ltd_active ? "" : "IN");
++ seq_printf(p, "%u: %s %sACTIVE\n", tgt->ltd_idx,
++ tgt->ltd_uuid.uuid, tgt->ltd_active ? "" : "IN");
++ return 0;
+ }
+
+ static const struct seq_operations lmv_tgt_sops = {
+diff --git a/lustre/lod/lproc_lod.c b/lustre/lod/lproc_lod.c
+index b02697f..06e2314 100644
+--- a/lustre/lod/lproc_lod.c
++++ b/lustre/lod/lproc_lod.c
+@@ -65,8 +65,9 @@ static int lod_stripesize_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ lod = lu2lod_dev(dev->obd_lu_dev);
+- return seq_printf(m, LPU64"\n",
+- lod->lod_desc.ld_default_stripe_size);
++ seq_printf(m, LPU64"\n",
++ lod->lod_desc.ld_default_stripe_size);
++ return 0;
+ }
+
+ /**
+@@ -120,8 +121,9 @@ static int lod_stripeoffset_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ lod = lu2lod_dev(dev->obd_lu_dev);
+- return seq_printf(m, LPU64"\n",
+- lod->lod_desc.ld_default_stripe_offset);
++ seq_printf(m, LPU64"\n",
++ lod->lod_desc.ld_default_stripe_offset);
++ return 0;
+ }
+
+ /**
+@@ -175,7 +177,8 @@ static int lod_stripetype_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ lod = lu2lod_dev(dev->obd_lu_dev);
+- return seq_printf(m, "%u\n", lod->lod_desc.ld_pattern);
++ seq_printf(m, "%u\n", lod->lod_desc.ld_pattern);
++ return 0;
+ }
+
+ /**
+@@ -227,8 +230,9 @@ static int lod_stripecount_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ lod = lu2lod_dev(dev->obd_lu_dev);
+- return seq_printf(m, "%d\n",
+- (__s16)(lod->lod_desc.ld_default_stripe_count + 1) - 1);
++ seq_printf(m, "%d\n",
++ (__s16)(lod->lod_desc.ld_default_stripe_count + 1) - 1);
++ return 0;
+ }
+
+ /**
+@@ -280,7 +284,8 @@ static int lod_numobd_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ lod = lu2lod_dev(dev->obd_lu_dev);
+- return seq_printf(m, "%u\n", lod->lod_desc.ld_tgt_count);
++ seq_printf(m, "%u\n", lod->lod_desc.ld_tgt_count);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(lod_numobd);
+
+@@ -300,7 +305,8 @@ static int lod_activeobd_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ lod = lu2lod_dev(dev->obd_lu_dev);
+- return seq_printf(m, "%u\n", lod->lod_desc.ld_active_tgt_count);
++ seq_printf(m, "%u\n", lod->lod_desc.ld_active_tgt_count);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(lod_activeobd);
+
+@@ -320,7 +326,8 @@ static int lod_desc_uuid_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ lod = lu2lod_dev(dev->obd_lu_dev);
+- return seq_printf(m, "%s\n", lod->lod_desc.ld_uuid.uuid);
++ seq_printf(m, "%s\n", lod->lod_desc.ld_uuid.uuid);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(lod_desc_uuid);
+
+@@ -344,8 +351,9 @@ static int lod_qos_priofree_seq_show(struct seq_file *m, void *v)
+ struct lod_device *lod = lu2lod_dev(dev->obd_lu_dev);
+
+ LASSERT(lod != NULL);
+- return seq_printf(m, "%d%%\n",
+- (lod->lod_qos.lq_prio_free * 100 + 255) >> 8);
++ seq_printf(m, "%d%%\n",
++ (lod->lod_qos.lq_prio_free * 100 + 255) >> 8);
++ return 0;
+ }
+
+ /**
+@@ -405,8 +413,9 @@ static int lod_qos_thresholdrr_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ lod = lu2lod_dev(dev->obd_lu_dev);
+- return seq_printf(m, "%d%%\n",
+- (lod->lod_qos.lq_threshold_rr * 100 + 255) >> 8);
++ seq_printf(m, "%d%%\n",
++ (lod->lod_qos.lq_threshold_rr * 100 + 255) >> 8);
++ return 0;
+ }
+
+ /**
+@@ -468,7 +477,8 @@ static int lod_qos_maxage_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ lod = lu2lod_dev(dev->obd_lu_dev);
+- return seq_printf(m, "%u Sec\n", lod->lod_desc.ld_qos_maxage);
++ seq_printf(m, "%u Sec\n", lod->lod_desc.ld_qos_maxage);
++ return 0;
+ }
+
+ /**
+@@ -612,9 +622,10 @@ static int lod_osts_seq_show(struct seq_file *p, void *v)
+ } else if (rc)
+ return rc;
+
+- return seq_printf(p, "%d: %s %sACTIVE\n", idx,
+- obd_uuid2str(&ost_desc->ltd_uuid),
+- active ? "" : "IN");
++ seq_printf(p, "%d: %s %sACTIVE\n", idx,
++ obd_uuid2str(&ost_desc->ltd_uuid),
++ active ? "" : "IN");
++ return 0;
+ }
+
+ static const struct seq_operations lod_osts_sops = {
+@@ -664,7 +675,8 @@ static int lod_lmv_failout_seq_show(struct seq_file *m, void *v)
+ LASSERT(dev != NULL);
+ lod = lu2lod_dev(dev->obd_lu_dev);
+
+- return seq_printf(m, "%d\n", lod->lod_lmv_failout ? 1 : 0);
++ seq_printf(m, "%d\n", lod->lod_lmv_failout ? 1 : 0);
++ return 0;
+ }
+
+ /**
+diff --git a/lustre/lov/lproc_lov.c b/lustre/lov/lproc_lov.c
+index 386ee62..4732a35 100644
+--- a/lustre/lov/lproc_lov.c
++++ b/lustre/lov/lproc_lov.c
+@@ -51,7 +51,8 @@ static int lov_stripesize_seq_show(struct seq_file *m, void *v)
+ LASSERT(dev != NULL);
+ desc = &dev->u.lov.desc;
+
+- return seq_printf(m, LPU64"\n", desc->ld_default_stripe_size);
++ seq_printf(m, LPU64"\n", desc->ld_default_stripe_size);
++ return 0;
+ }
+
+ static ssize_t lov_stripesize_seq_write(struct file *file,
+@@ -82,7 +83,8 @@ static int lov_stripeoffset_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ desc = &dev->u.lov.desc;
+- return seq_printf(m, LPU64"\n", desc->ld_default_stripe_offset);
++ seq_printf(m, LPU64"\n", desc->ld_default_stripe_offset);
++ return 0;
+ }
+
+ static ssize_t lov_stripeoffset_seq_write(struct file *file,
+@@ -112,7 +114,8 @@ static int lov_stripetype_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ desc = &dev->u.lov.desc;
+- return seq_printf(m, "%u\n", desc->ld_pattern);
++ seq_printf(m, "%u\n", desc->ld_pattern);
++ return 0;
+ }
+
+ static ssize_t lov_stripetype_seq_write(struct file *file,
+@@ -142,8 +145,9 @@ static int lov_stripecount_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ desc = &dev->u.lov.desc;
+- return seq_printf(m, "%d\n",
+- (__s16)(desc->ld_default_stripe_count + 1) - 1);
++ seq_printf(m, "%d\n",
++ (__s16)(desc->ld_default_stripe_count + 1) - 1);
++ return 0;
+ }
+
+ static ssize_t lov_stripecount_seq_write(struct file *file,
+@@ -173,7 +177,8 @@ static int lov_numobd_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ desc = &dev->u.lov.desc;
+- return seq_printf(m, "%u\n", desc->ld_tgt_count);
++ seq_printf(m, "%u\n", desc->ld_tgt_count);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(lov_numobd);
+
+@@ -184,7 +189,8 @@ static int lov_activeobd_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ desc = &dev->u.lov.desc;
+- return seq_printf(m, "%u\n", desc->ld_active_tgt_count);
++ seq_printf(m, "%u\n", desc->ld_active_tgt_count);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(lov_activeobd);
+
+@@ -195,7 +201,8 @@ static int lov_desc_uuid_seq_show(struct seq_file *m, void *v)
+
+ LASSERT(dev != NULL);
+ lov = &dev->u.lov;
+- return seq_printf(m, "%s\n", lov->desc.ld_uuid.uuid);
++ seq_printf(m, "%s\n", lov->desc.ld_uuid.uuid);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(lov_desc_uuid);
+
+@@ -231,9 +238,10 @@ static void *lov_tgt_seq_next(struct seq_file *p, void *v, loff_t *pos)
+ static int lov_tgt_seq_show(struct seq_file *p, void *v)
+ {
+ struct lov_tgt_desc *tgt = v;
+- return seq_printf(p, "%d: %s %sACTIVE\n", tgt->ltd_index,
+- obd_uuid2str(&tgt->ltd_uuid),
+- tgt->ltd_active ? "" : "IN");
++ seq_printf(p, "%d: %s %sACTIVE\n", tgt->ltd_index,
++ obd_uuid2str(&tgt->ltd_uuid),
++ tgt->ltd_active ? "" : "IN");
++ return 0;
+ }
+
+ static const struct seq_operations lov_tgt_sops = {
+diff --git a/lustre/mdc/lproc_mdc.c b/lustre/mdc/lproc_mdc.c
+index 023b779..c8b0cd6 100644
+--- a/lustre/mdc/lproc_mdc.c
++++ b/lustre/mdc/lproc_mdc.c
+@@ -46,12 +46,11 @@
+ static int mdc_active_seq_show(struct seq_file *m, void *v)
+ {
+ struct obd_device *dev = m->private;
+- int rc;
+
+ LPROCFS_CLIMP_CHECK(dev);
+- rc = seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
++ seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
+ LPROCFS_CLIMP_EXIT(dev);
+- return rc;
++ return 0;
+ }
+
+ static ssize_t mdc_active_seq_write(struct file *file,
+@@ -82,12 +81,11 @@ static int mdc_max_rpcs_in_flight_seq_show(struct seq_file *m, void *v)
+ {
+ struct obd_device *dev = m->private;
+ __u32 max;
+- int rc;
+
+ max = obd_get_max_rpcs_in_flight(&dev->u.cli);
+- rc = seq_printf(m, "%u\n", max);
++ seq_printf(m, "%u\n", max);
+
+- return rc;
++ return 0;
+ }
+
+ static ssize_t mdc_max_rpcs_in_flight_seq_write(struct file *file,
+@@ -115,12 +113,11 @@ static int mdc_max_mod_rpcs_in_flight_seq_show(struct seq_file *m, void *v)
+ {
+ struct obd_device *dev = m->private;
+ __u16 max;
+- int rc;
+
+ max = obd_get_max_mod_rpcs_in_flight(&dev->u.cli);
+- rc = seq_printf(m, "%hu\n", max);
++ seq_printf(m, "%hu\n", max);
+
+- return rc;
++ return 0;
+ }
+
+ static ssize_t mdc_max_mod_rpcs_in_flight_seq_write(struct file *file,
+diff --git a/lustre/mdd/mdd_lproc.c b/lustre/mdd/mdd_lproc.c
+index c09ee9c..1329852 100644
+--- a/lustre/mdd/mdd_lproc.c
++++ b/lustre/mdd/mdd_lproc.c
+@@ -78,7 +78,8 @@ static int mdd_atime_diff_seq_show(struct seq_file *m, void *data)
+ {
+ struct mdd_device *mdd = m->private;
+
+- return seq_printf(m, "%lu\n", mdd->mdd_atime_diff);
++ seq_printf(m, "%lu\n", mdd->mdd_atime_diff);
++ return 0;
+ }
+ LPROC_SEQ_FOPS(mdd_atime_diff);
+
+@@ -182,7 +183,8 @@ static int mdd_sync_perm_seq_show(struct seq_file *m, void *data)
+ struct mdd_device *mdd = m->private;
+
+ LASSERT(mdd != NULL);
+- return seq_printf(m, "%d\n", mdd->mdd_sync_permission);
++ seq_printf(m, "%d\n", mdd->mdd_sync_permission);
++ return 0;
+ }
+
+ static ssize_t
+diff --git a/lustre/mdt/mdt_coordinator.c b/lustre/mdt/mdt_coordinator.c
+index 27ff1e3..9f371bc 100644
+--- a/lustre/mdt/mdt_coordinator.c
++++ b/lustre/mdt/mdt_coordinator.c
+@@ -2067,17 +2067,20 @@ int mdt_hsm_cdt_control_seq_show(struct seq_file *m, void *data)
+ static int
+ mdt_hsm_request_mask_show(struct seq_file *m, __u64 mask)
+ {
+- int i, rc = 0;
++ bool first = true;
++ int i;
+ ENTRY;
+
+ for (i = 0; i < 8 * sizeof(mask); i++) {
+- if (mask & (1UL << i))
+- rc += seq_printf(m, "%s%s", rc == 0 ? "" : " ",
+- hsm_copytool_action2name(i));
++ if (mask & (1UL << i)) {
++ seq_printf(m, "%s%s", first ? "" : " ",
++ hsm_copytool_action2name(i));
++ first = false;
++ }
+ }
+- rc += seq_printf(m, "\n");
++ seq_putc(m, '\n');
+
+- RETURN(rc);
++ RETURN(0);
+ }
+
+ static int
+diff --git a/lustre/mdt/mdt_hsm_cdt_actions.c b/lustre/mdt/mdt_hsm_cdt_actions.c
+index 59cbfe2..342a919 100644
+--- a/lustre/mdt/mdt_hsm_cdt_actions.c
++++ b/lustre/mdt/mdt_hsm_cdt_actions.c
+@@ -398,7 +398,7 @@ static int hsm_actions_show_cb(const struct lu_env *env,
+ struct llog_agent_req_rec *larr = (struct llog_agent_req_rec *)hdr;
+ struct seq_file *s = data;
+ struct agent_action_iterator *aai;
+- int rc, sz;
++ int sz;
+ size_t count;
+ char buf[12];
+ ENTRY;
+@@ -417,35 +417,29 @@ static int hsm_actions_show_cb(const struct lu_env *env,
+
+ count = s->count;
+ sz = larr->arr_hai.hai_len - sizeof(larr->arr_hai);
+- rc = seq_printf(s, "lrh=[type=%X len=%d idx=%d/%d] fid="DFID
+- " dfid="DFID
+- " compound/cookie="LPX64"/"LPX64
+- " action=%s archive#=%d flags="LPX64
+- " extent="LPX64"-"LPX64
+- " gid="LPX64" datalen=%d status=%s"
+- " data=[%s]\n",
+- hdr->lrh_type, hdr->lrh_len,
+- llh->lgh_hdr->llh_cat_idx, hdr->lrh_index,
+- PFID(&larr->arr_hai.hai_fid),
+- PFID(&larr->arr_hai.hai_dfid),
+- larr->arr_compound_id, larr->arr_hai.hai_cookie,
+- hsm_copytool_action2name(larr->arr_hai.hai_action),
+- larr->arr_archive_id,
+- larr->arr_flags,
+- larr->arr_hai.hai_extent.offset,
+- larr->arr_hai.hai_extent.length,
+- larr->arr_hai.hai_gid, sz,
+- agent_req_status2name(larr->arr_status),
+- hai_dump_data_field(&larr->arr_hai, buf, sizeof(buf)));
+- if (rc == 0) {
+- aai->aai_cat_index = llh->lgh_hdr->llh_cat_idx;
+- aai->aai_index = hdr->lrh_index;
+- } else {
+- if (s->count == s->size && count > 0) /* rewind the buffer */
+- s->count = count;
+- rc = LLOG_PROC_BREAK;
+- }
+- RETURN(rc);
++ seq_printf(s, "lrh=[type=%X len=%d idx=%d/%d] fid="DFID
++ " dfid="DFID" compound/cookie="LPX64"/"LPX64
++ " action=%s archive#=%d flags="LPX64
++ " extent="LPX64"-"LPX64
++ " gid="LPX64" datalen=%d status=%s data=[%s]\n",
++ hdr->lrh_type, hdr->lrh_len,
++ llh->lgh_hdr->llh_cat_idx, hdr->lrh_index,
++ PFID(&larr->arr_hai.hai_fid),
++ PFID(&larr->arr_hai.hai_dfid),
++ larr->arr_compound_id, larr->arr_hai.hai_cookie,
++ hsm_copytool_action2name(larr->arr_hai.hai_action),
++ larr->arr_archive_id,
++ larr->arr_flags,
++ larr->arr_hai.hai_extent.offset,
++ larr->arr_hai.hai_extent.length,
++ larr->arr_hai.hai_gid, sz,
++ agent_req_status2name(larr->arr_status),
++ hai_dump_data_field(&larr->arr_hai, buf, sizeof(buf)));
++
++ aai->aai_cat_index = llh->lgh_hdr->llh_cat_idx;
++ aai->aai_index = hdr->lrh_index;
++
++ RETURN(0);
+ }
+
+ /**
+diff --git a/lustre/mdt/mdt_lproc.c b/lustre/mdt/mdt_lproc.c
+index 58728e8..612da16 100644
+--- a/lustre/mdt/mdt_lproc.c
++++ b/lustre/mdt/mdt_lproc.c
+@@ -217,7 +217,8 @@ static int mdt_identity_expire_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
+
+- return seq_printf(m, "%u\n", mdt->mdt_identity_cache->uc_entry_expire);
++ seq_printf(m, "%u\n", mdt->mdt_identity_cache->uc_entry_expire);
++ return 0;
+ }
+
+ static ssize_t
+@@ -243,7 +244,8 @@ static int mdt_identity_acquire_expire_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
+
+- return seq_printf(m, "%u\n", mdt->mdt_identity_cache->uc_acquire_expire);
++ seq_printf(m, "%u\n", mdt->mdt_identity_cache->uc_acquire_expire);
++ return 0;
+ }
+
+ static ssize_t
+@@ -479,7 +481,8 @@ static int mdt_evict_tgt_nids_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
+
+- return seq_printf(m, "%u\n", mdt->mdt_opts.mo_evict_tgt_nids);
++ seq_printf(m, "%u\n", mdt->mdt_opts.mo_evict_tgt_nids);
++ return 0;
+ }
+
+ static ssize_t
+@@ -505,7 +508,8 @@ static int mdt_sec_level_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
+
+- return seq_printf(m, "%d\n", mdt->mdt_lut.lut_sec_level);
++ seq_printf(m, "%d\n", mdt->mdt_lut.lut_sec_level);
++ return 0;
+ }
+
+ static ssize_t
+@@ -540,7 +544,8 @@ static int mdt_cos_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
+
+- return seq_printf(m, "%u\n", mdt_cos_is_enabled(mdt));
++ seq_printf(m, "%u\n", mdt_cos_is_enabled(mdt));
++ return 0;
+ }
+
+ static ssize_t
+@@ -566,8 +571,9 @@ static int mdt_root_squash_seq_show(struct seq_file *m, void *data)
+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
+ struct root_squash_info *squash = &mdt->mdt_squash;
+
+- return seq_printf(m, "%u:%u\n", squash->rsi_uid,
+- squash->rsi_gid);
++ seq_printf(m, "%u:%u\n", squash->rsi_uid,
++ squash->rsi_gid);
++ return 0;
+ }
+
+ static ssize_t
+@@ -589,19 +595,19 @@ static int mdt_nosquash_nids_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
+ struct root_squash_info *squash = &mdt->mdt_squash;
+- int len = 0, rc;
++ int len = 0;
+
+ down_read(&squash->rsi_sem);
+ if (!list_empty(&squash->rsi_nosquash_nids)) {
+ len = cfs_print_nidlist(m->buf + m->count, m->size - m->count,
+ &squash->rsi_nosquash_nids);
+ m->count += len;
+- rc = seq_printf(m, "\n");
++ seq_putc(m, '\n');
+ } else
+- rc = seq_printf(m, "NONE\n");
++ seq_puts(m, "NONE\n");
+ up_read(&squash->rsi_sem);
+
+- return rc;
++ return 0;
+ }
+
+ static ssize_t
+@@ -623,7 +629,8 @@ static int mdt_enable_remote_dir_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
+
+- return seq_printf(m, "%u\n", mdt->mdt_enable_remote_dir);
++ seq_printf(m, "%u\n", mdt->mdt_enable_remote_dir);
++ return 0;
+ }
+
+ static ssize_t
+@@ -653,8 +660,9 @@ static int mdt_enable_remote_dir_gid_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
+
+- return seq_printf(m, "%d\n",
+- (int)mdt->mdt_enable_remote_dir_gid);
++ seq_printf(m, "%d\n",
++ (int)mdt->mdt_enable_remote_dir_gid);
++ return 0;
+ }
+
+ static ssize_t
+@@ -692,7 +700,8 @@ static int mdt_slc_seq_show(struct seq_file *m, void *data)
+ struct lu_target *tgt = obd->u.obt.obt_lut;
+ char *slc_states[] = {"never", "blocking", "always" };
+
+- return seq_printf(m, "%s\n", slc_states[tgt->lut_sync_lock_cancel]);
++ seq_printf(m, "%s\n", slc_states[tgt->lut_sync_lock_cancel]);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(mdt_slc);
+
+@@ -710,7 +719,8 @@ static int mdt_async_commit_count_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
+
+- return seq_printf(m, "%d\n", atomic_read(&mdt->mdt_async_commit_count));
++ seq_printf(m, "%d\n", atomic_read(&mdt->mdt_async_commit_count));
++ return 0;
+ }
+
+ static ssize_t
+@@ -747,7 +757,8 @@ static int mdt_sync_count_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct lu_target *tgt = obd->u.obt.obt_lut;
+
+- return seq_printf(m, "%d\n", atomic_read(&tgt->lut_sync_count));
++ seq_printf(m, "%d\n", atomic_read(&tgt->lut_sync_count));
++ return 0;
+ }
+
+ static ssize_t
+diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c
+index 9dc2a3e..3c83dc0 100644
+--- a/lustre/mgc/mgc_request.c
++++ b/lustre/mgc/mgc_request.c
+@@ -490,8 +490,8 @@ int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data)
+ if (cld->cld_recover == NULL)
+ continue;
+ seq_printf(m, " - { client: %s, nidtbl_version: %u }\n",
+- cld->cld_logname,
+- cld->cld_recover->cld_cfg.cfg_last_idx);
++ cld->cld_logname,
++ cld->cld_recover->cld_cfg.cfg_last_idx);
+ }
+ spin_unlock(&config_list_lock);
+
+diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c
+index 7ca03f0..c13c9333 100644
+--- a/lustre/obdclass/genops.c
++++ b/lustre/obdclass/genops.c
+@@ -2184,8 +2184,8 @@ int obd_mod_rpc_stats_seq_show(struct client_obd *cli,
+ unsigned long mod = cli->cl_mod_rpcs_hist.oh_buckets[i];
+ mod_cum += mod;
+ seq_printf(seq, "%d:\t\t%10lu %3lu %3lu\n",
+- i, mod, pct(mod, mod_tot),
+- pct(mod_cum, mod_tot));
++ i, mod, pct(mod, mod_tot),
++ pct(mod_cum, mod_tot));
+ if (mod_cum == mod_tot)
+ break;
+ }
+diff --git a/lustre/obdclass/linux/linux-module.c b/lustre/obdclass/linux/linux-module.c
+index 200d19f..c019863 100644
+--- a/lustre/obdclass/linux/linux-module.c
++++ b/lustre/obdclass/linux/linux-module.c
+@@ -215,21 +215,23 @@ struct miscdevice obd_psdev = {
+ #ifdef CONFIG_PROC_FS
+ static int obd_proc_version_seq_show(struct seq_file *m, void *v)
+ {
+- return seq_printf(m, "lustre: %s\nkernel: %s\nbuild: %s\n",
+- LUSTRE_VERSION_STRING, "patchless_client",
+- BUILD_VERSION);
++ seq_printf(m, "lustre: %s\nkernel: %s\nbuild: %s\n",
++ LUSTRE_VERSION_STRING, "patchless_client",
++ BUILD_VERSION);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(obd_proc_version);
+
+ static int obd_proc_pinger_seq_show(struct seq_file *m, void *v)
+ {
+- return seq_printf(m, "%s\n",
++ seq_printf(m, "%s\n",
+ #ifdef ENABLE_PINGER
+- "on"
++ "on"
+ #else
+- "off"
++ "off"
+ #endif
+- );
++ );
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(obd_proc_pinger);
+
+@@ -266,7 +268,7 @@ static int obd_proc_health_seq_show(struct seq_file *m, void *data)
+
+ if (obd_health_check(NULL, obd)) {
+ seq_printf(m, "device %s reported unhealthy\n",
+- obd->obd_name);
++ obd->obd_name);
+ healthy = false;
+ }
+ class_decref(obd, __FUNCTION__, current);
+@@ -275,7 +277,7 @@ static int obd_proc_health_seq_show(struct seq_file *m, void *data)
+ read_unlock(&obd_dev_lock);
+
+ if (healthy)
+- return seq_printf(m, "healthy\n");
++ seq_puts(m, "healthy\n");
+
+ seq_printf(m, "NOT HEALTHY\n");
+ return 0;
+@@ -405,10 +407,11 @@ static int obd_device_list_seq_show(struct seq_file *p, void *v)
+ else
+ status = "--";
+
+- return seq_printf(p, "%3d %s %s %s %s %d\n",
+- (int)index, status, obd->obd_type->typ_name,
+- obd->obd_name, obd->obd_uuid.uuid,
+- atomic_read(&obd->obd_refcount));
++ seq_printf(p, "%3d %s %s %s %s %d\n",
++ (int)index, status, obd->obd_type->typ_name,
++ obd->obd_name, obd->obd_uuid.uuid,
++ atomic_read(&obd->obd_refcount));
++ return 0;
+ }
+
+ static const struct seq_operations obd_device_list_sops = {
+diff --git a/lustre/obdclass/lprocfs_jobstats.c b/lustre/obdclass/lprocfs_jobstats.c
+index c0ea8f3..af6cc5f 100644
+--- a/lustre/obdclass/lprocfs_jobstats.c
++++ b/lustre/obdclass/lprocfs_jobstats.c
+@@ -636,7 +636,8 @@ int lprocfs_job_interval_seq_show(struct seq_file *m, void *data)
+ return -ENODEV;
+
+ stats = &obd->u.obt.obt_jobstats;
+- return seq_printf(m, "%d\n", stats->ojs_cleanup_interval);
++ seq_printf(m, "%d\n", stats->ojs_cleanup_interval);
++ return 0;
+ }
+ EXPORT_SYMBOL(lprocfs_job_interval_seq_show);
+
+diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c
+index 917bd6b..0cae0eb 100644
+--- a/lustre/obdclass/lprocfs_status.c
++++ b/lustre/obdclass/lprocfs_status.c
+@@ -292,7 +292,8 @@ EXPORT_SYMBOL(lprocfs_register);
+ /* Generic callbacks */
+ int lprocfs_uint_seq_show(struct seq_file *m, void *data)
+ {
+- return seq_printf(m, "%u\n", *(unsigned int *)data);
++ seq_printf(m, "%u\n", *(unsigned int *)data);
++ return 0;
+ }
+ EXPORT_SYMBOL(lprocfs_uint_seq_show);
+
+@@ -333,7 +334,8 @@ EXPORT_SYMBOL(lprocfs_uint_seq_write);
+ int lprocfs_u64_seq_show(struct seq_file *m, void *data)
+ {
+ LASSERT(data != NULL);
+- return seq_printf(m, LPU64"\n", *(__u64 *)data);
++ seq_printf(m, LPU64"\n", *(__u64 *)data);
++ return 0;
+ }
+ EXPORT_SYMBOL(lprocfs_u64_seq_show);
+
+@@ -341,7 +343,8 @@ int lprocfs_atomic_seq_show(struct seq_file *m, void *data)
+ {
+ atomic_t *atom = data;
+ LASSERT(atom != NULL);
+- return seq_printf(m, "%d\n", atomic_read(atom));
++ seq_printf(m, "%d\n", atomic_read(atom));
++ return 0;
+ }
+ EXPORT_SYMBOL(lprocfs_atomic_seq_show);
+
+@@ -370,7 +373,8 @@ int lprocfs_uuid_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = data;
+
+ LASSERT(obd != NULL);
+- return seq_printf(m, "%s\n", obd->obd_uuid.uuid);
++ seq_printf(m, "%s\n", obd->obd_uuid.uuid);
++ return 0;
+ }
+ EXPORT_SYMBOL(lprocfs_uuid_seq_show);
+
+@@ -379,7 +383,8 @@ int lprocfs_name_seq_show(struct seq_file *m, void *data)
+ struct obd_device *dev = data;
+
+ LASSERT(dev != NULL);
+- return seq_printf(m, "%s\n", dev->obd_name);
++ seq_printf(m, "%s\n", dev->obd_name);
++ return 0;
+ }
+ EXPORT_SYMBOL(lprocfs_name_seq_show);
+
+@@ -391,7 +396,7 @@ int lprocfs_blksize_seq_show(struct seq_file *m, void *data)
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
+ OBD_STATFS_NODELAY);
+ if (!rc)
+- rc = seq_printf(m, "%u\n", osfs.os_bsize);
++ seq_printf(m, "%u\n", osfs.os_bsize);
+ return rc;
+ }
+ EXPORT_SYMBOL(lprocfs_blksize_seq_show);
+@@ -410,7 +415,7 @@ int lprocfs_kbytestotal_seq_show(struct seq_file *m, void *data)
+ while (blk_size >>= 1)
+ result <<= 1;
+
+- rc = seq_printf(m, LPU64"\n", result);
++ seq_printf(m, LPU64"\n", result);
+ }
+ return rc;
+ }
+@@ -430,7 +435,7 @@ int lprocfs_kbytesfree_seq_show(struct seq_file *m, void *data)
+ while (blk_size >>= 1)
+ result <<= 1;
+
+- rc = seq_printf(m, LPU64"\n", result);
++ seq_printf(m, LPU64"\n", result);
+ }
+ return rc;
+ }
+@@ -450,7 +455,7 @@ int lprocfs_kbytesavail_seq_show(struct seq_file *m, void *data)
+ while (blk_size >>= 1)
+ result <<= 1;
+
+- rc = seq_printf(m, LPU64"\n", result);
++ seq_printf(m, LPU64"\n", result);
+ }
+ return rc;
+ }
+@@ -464,7 +469,7 @@ int lprocfs_filestotal_seq_show(struct seq_file *m, void *data)
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
+ OBD_STATFS_NODELAY);
+ if (!rc)
+- rc = seq_printf(m, LPU64"\n", osfs.os_files);
++ seq_printf(m, LPU64"\n", osfs.os_files);
+ return rc;
+ }
+ EXPORT_SYMBOL(lprocfs_filestotal_seq_show);
+@@ -477,7 +482,7 @@ int lprocfs_filesfree_seq_show(struct seq_file *m, void *data)
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
+ OBD_STATFS_NODELAY);
+ if (!rc)
+- rc = seq_printf(m, LPU64"\n", osfs.os_ffree);
++ seq_printf(m, LPU64"\n", osfs.os_ffree);
+ return rc;
+ }
+ EXPORT_SYMBOL(lprocfs_filesfree_seq_show);
+@@ -493,8 +498,8 @@ int lprocfs_server_uuid_seq_show(struct seq_file *m, void *data)
+ LPROCFS_CLIMP_CHECK(obd);
+ imp = obd->u.cli.cl_import;
+ imp_state_name = ptlrpc_import_state_name(imp->imp_state);
+- rc = seq_printf(m, "%s\t%s%s\n", obd2cli_tgt(obd), imp_state_name,
+- imp->imp_deactive ? "\tDEACTIVATED" : "");
++ seq_printf(m, "%s\t%s%s\n", obd2cli_tgt(obd), imp_state_name,
++ imp->imp_deactive ? "\tDEACTIVATED" : "");
+
+ LPROCFS_CLIMP_EXIT(obd);
+ return rc;
+@@ -512,9 +517,9 @@ int lprocfs_conn_uuid_seq_show(struct seq_file *m, void *data)
+ LPROCFS_CLIMP_CHECK(obd);
+ conn = obd->u.cli.cl_import->imp_connection;
+ if (conn && obd->u.cli.cl_import)
+- rc = seq_printf(m, "%s\n", conn->c_remote_uuid.uuid);
++ seq_printf(m, "%s\n", conn->c_remote_uuid.uuid);
+ else
+- rc = seq_printf(m, "%s\n", "<none>");
++ seq_printf(m, "%s\n", "<none>");
+
+ LPROCFS_CLIMP_EXIT(obd);
+ return rc;
+@@ -705,16 +710,16 @@ static void obd_connect_data_seqprint(struct seq_file *m,
+ flags = ocd->ocd_connect_flags;
+
+ seq_printf(m, " connect_data:\n"
+- " flags: "LPX64"\n"
+- " instance: %u\n",
+- ocd->ocd_connect_flags,
+- ocd->ocd_instance);
++ " flags: "LPX64"\n"
++ " instance: %u\n",
++ ocd->ocd_connect_flags,
++ ocd->ocd_instance);
+ if (flags & OBD_CONNECT_VERSION)
+ seq_printf(m, " target_version: %u.%u.%u.%u\n",
+- OBD_OCD_VERSION_MAJOR(ocd->ocd_version),
+- OBD_OCD_VERSION_MINOR(ocd->ocd_version),
+- OBD_OCD_VERSION_PATCH(ocd->ocd_version),
+- OBD_OCD_VERSION_FIX(ocd->ocd_version));
++ OBD_OCD_VERSION_MAJOR(ocd->ocd_version),
++ OBD_OCD_VERSION_MINOR(ocd->ocd_version),
++ OBD_OCD_VERSION_PATCH(ocd->ocd_version),
++ OBD_OCD_VERSION_FIX(ocd->ocd_version));
+ if (flags & OBD_CONNECT_MDS)
+ seq_printf(m, " mdt_index: %d\n", ocd->ocd_group);
+ if (flags & OBD_CONNECT_GRANT)
+@@ -725,28 +730,30 @@ static void obd_connect_data_seqprint(struct seq_file *m,
+ seq_printf(m, " max_brw_size: %d\n", ocd->ocd_brw_size);
+ if (flags & OBD_CONNECT_IBITS)
+ seq_printf(m, " ibits_known: "LPX64"\n",
+- ocd->ocd_ibits_known);
++ ocd->ocd_ibits_known);
+ if (flags & OBD_CONNECT_GRANT_PARAM)
+ seq_printf(m, " grant_block_size: %d\n"
+- " grant_inode_size: %d\n"
+- " grant_extent_overhead: %d\n",
+- ocd->ocd_blocksize,
+- ocd->ocd_inodespace,
+- ocd->ocd_grant_extent);
++ " grant_inode_size: %d\n"
++ " grant_max_extent_size: %d\n"
++ " grant_extent_tax: %d\n",
++ 1 << ocd->ocd_grant_blkbits,
++ 1 << ocd->ocd_grant_inobits,
++ ocd->ocd_grant_max_blks << ocd->ocd_grant_blkbits,
++ ocd->ocd_grant_tax_kb << 10);
+ if (flags & OBD_CONNECT_TRANSNO)
+ seq_printf(m, " first_transno: "LPX64"\n",
+- ocd->ocd_transno);
++ ocd->ocd_transno);
+ if (flags & OBD_CONNECT_CKSUM)
+ seq_printf(m, " cksum_types: %#x\n",
+- ocd->ocd_cksum_types);
++ ocd->ocd_cksum_types);
+ if (flags & OBD_CONNECT_MAX_EASIZE)
+ seq_printf(m, " max_easize: %d\n", ocd->ocd_max_easize);
+ if (flags & OBD_CONNECT_MAXBYTES)
+ seq_printf(m, " max_object_bytes: "LPU64"\n",
+- ocd->ocd_maxbytes);
++ ocd->ocd_maxbytes);
+ if (flags & OBD_CONNECT_MULTIMODRPCS)
+ seq_printf(m, " max_mod_rpcs: %hu\n",
+- ocd->ocd_maxmodrpcs);
++ ocd->ocd_maxmodrpcs);
+ }
+
+ int lprocfs_import_seq_show(struct seq_file *m, void *data)
+@@ -768,23 +775,23 @@ int lprocfs_import_seq_show(struct seq_file *m, void *data)
+ ocd = &imp->imp_connect_data;
+
+ seq_printf(m, "import:\n"
+- " name: %s\n"
+- " target: %s\n"
+- " state: %s\n"
+- " connect_flags: [ ",
+- obd->obd_name,
+- obd2cli_tgt(obd),
+- ptlrpc_import_state_name(imp->imp_state));
++ " name: %s\n"
++ " target: %s\n"
++ " state: %s\n"
++ " connect_flags: [ ",
++ obd->obd_name,
++ obd2cli_tgt(obd),
++ ptlrpc_import_state_name(imp->imp_state));
+ obd_connect_seq_flags2str(m, imp->imp_connect_data.ocd_connect_flags,
+- ", ");
++ ", ");
+ seq_printf(m, " ]\n");
+ obd_connect_data_seqprint(m, ocd);
+ seq_printf(m, " import_flags: [ ");
+ obd_import_flags2str(imp, m);
+
+ seq_printf(m, " ]\n"
+- " connection:\n"
+- " failover_nids: [ ");
++ " connection:\n"
++ " failover_nids: [ ");
+ spin_lock(&imp->imp_lock);
+ j = 0;
+ list_for_each_entry(conn, &imp->imp_conn_list, oic_item) {
+@@ -799,14 +806,14 @@ int lprocfs_import_seq_show(struct seq_file *m, void *data)
+ else
+ strncpy(nidstr, "<none>", sizeof(nidstr));
+ seq_printf(m, " ]\n"
+- " current_connection: %s\n"
+- " connection_attempts: %u\n"
+- " generation: %u\n"
+- " in-progress_invalidations: %u\n",
+- nidstr,
+- imp->imp_conn_cnt,
+- imp->imp_generation,
+- atomic_read(&imp->imp_inval_count));
++ " current_connection: %s\n"
++ " connection_attempts: %u\n"
++ " generation: %u\n"
++ " in-progress_invalidations: %u\n",
++ nidstr,
++ imp->imp_conn_cnt,
++ imp->imp_generation,
++ atomic_read(&imp->imp_inval_count));
+ spin_unlock(&imp->imp_lock);
+
+ if (obd->obd_svc_stats == NULL)
+@@ -822,14 +829,14 @@ int lprocfs_import_seq_show(struct seq_file *m, void *data)
+ } else
+ ret.lc_sum = 0;
+ seq_printf(m, " rpcs:\n"
+- " inflight: %u\n"
+- " unregistering: %u\n"
+- " timeouts: %u\n"
+- " avg_waittime: "LPU64" %s\n",
+- atomic_read(&imp->imp_inflight),
+- atomic_read(&imp->imp_unregistering),
+- atomic_read(&imp->imp_timeouts),
+- ret.lc_sum, header->lc_units);
++ " inflight: %u\n"
++ " unregistering: %u\n"
++ " timeouts: %u\n"
++ " avg_waittime: "LPU64" %s\n",
++ atomic_read(&imp->imp_inflight),
++ atomic_read(&imp->imp_unregistering),
++ atomic_read(&imp->imp_timeouts),
++ ret.lc_sum, header->lc_units);
+
+ k = 0;
+ for(j = 0; j < IMP_AT_MAX_PORTALS; j++) {
+@@ -839,18 +846,18 @@ int lprocfs_import_seq_show(struct seq_file *m, void *data)
+ at_get(&imp->imp_at.iat_service_estimate[j]));
+ }
+ seq_printf(m, " service_estimates:\n"
+- " services: %u sec\n"
+- " network: %u sec\n",
+- k,
+- at_get(&imp->imp_at.iat_net_latency));
++ " services: %u sec\n"
++ " network: %u sec\n",
++ k,
++ at_get(&imp->imp_at.iat_net_latency));
+
+ seq_printf(m, " transactions:\n"
+- " last_replay: "LPU64"\n"
+- " peer_committed: "LPU64"\n"
+- " last_checked: "LPU64"\n",
+- imp->imp_last_replay_transno,
+- imp->imp_peer_committed_transno,
+- imp->imp_last_transno_checked);
++ " last_replay: "LPU64"\n"
++ " peer_committed: "LPU64"\n"
++ " last_checked: "LPU64"\n",
++ imp->imp_last_replay_transno,
++ imp->imp_peer_committed_transno,
++ imp->imp_last_transno_checked);
+
+ /* avg data rates */
+ for (rw = 0; rw <= 1; rw++) {
+@@ -863,9 +870,9 @@ int lprocfs_import_seq_show(struct seq_file *m, void *data)
+ do_div(sum, ret.lc_count);
+ ret.lc_sum = sum;
+ seq_printf(m, " %s_data_averages:\n"
+- " bytes_per_rpc: "LPU64"\n",
+- rw ? "write" : "read",
+- ret.lc_sum);
++ " bytes_per_rpc: "LPU64"\n",
++ rw ? "write" : "read",
++ ret.lc_sum);
+ }
+ k = (int)ret.lc_sum;
+ j = opcode_offset(OST_READ + rw) + EXTRA_MAX_OPCODES;
+@@ -877,11 +884,11 @@ int lprocfs_import_seq_show(struct seq_file *m, void *data)
+ do_div(sum, ret.lc_count);
+ ret.lc_sum = sum;
+ seq_printf(m, " %s_per_rpc: "LPU64"\n",
+- header->lc_units, ret.lc_sum);
++ header->lc_units, ret.lc_sum);
+ j = (int)ret.lc_sum;
+ if (j > 0)
+ seq_printf(m, " MB_per_sec: %u.%.02u\n",
+- k / j, (100 * k / j) % 100);
++ k / j, (100 * k / j) % 100);
+ }
+ }
+
+@@ -1223,8 +1230,8 @@ static int lprocfs_stats_seq_show(struct seq_file *p, void *v)
+ struct timeval now;
+
+ do_gettimeofday(&now);
+- rc = seq_printf(p, "%-25s %lu.%lu secs.usecs\n",
+- "snapshot_time", now.tv_sec, now.tv_usec);
++ seq_printf(p, "%-25s %lu.%lu secs.usecs\n",
++ "snapshot_time", now.tv_sec, now.tv_usec);
+ if (rc < 0)
+ return rc;
+ }
+@@ -1235,22 +1242,22 @@ static int lprocfs_stats_seq_show(struct seq_file *p, void *v)
+ if (ctr.lc_count == 0)
+ goto out;
+
+- rc = seq_printf(p, "%-25s "LPD64" samples [%s]", hdr->lc_name,
+- ctr.lc_count, hdr->lc_units);
++ seq_printf(p, "%-25s "LPD64" samples [%s]", hdr->lc_name,
++ ctr.lc_count, hdr->lc_units);
+ if (rc < 0)
+ goto out;
+
+ if ((hdr->lc_config & LPROCFS_CNTR_AVGMINMAX) && ctr.lc_count > 0) {
+- rc = seq_printf(p, " "LPD64" "LPD64" "LPD64,
+- ctr.lc_min, ctr.lc_max, ctr.lc_sum);
++ seq_printf(p, " "LPD64" "LPD64" "LPD64,
++ ctr.lc_min, ctr.lc_max, ctr.lc_sum);
+ if (rc < 0)
+ goto out;
+ if (hdr->lc_config & LPROCFS_CNTR_STDDEV)
+- rc = seq_printf(p, " "LPD64, ctr.lc_sumsquare);
++ seq_printf(p, " "LPD64, ctr.lc_sumsquare);
+ if (rc < 0)
+ goto out;
+ }
+- rc = seq_printf(p, "\n");
++ seq_putc(p, '\n');
+ out:
+ return (rc < 0) ? rc : 0;
+ }
+@@ -1849,12 +1856,11 @@ int lprocfs_obd_max_pages_per_rpc_seq_show(struct seq_file *m, void *data)
+ {
+ struct obd_device *dev = data;
+ struct client_obd *cli = &dev->u.cli;
+- int rc;
+
+ spin_lock(&cli->cl_loi_list_lock);
+- rc = seq_printf(m, "%d\n", cli->cl_max_pages_per_rpc);
++ seq_printf(m, "%d\n", cli->cl_max_pages_per_rpc);
+ spin_unlock(&cli->cl_loi_list_lock);
+- return rc;
++ return 0;
+ }
+ EXPORT_SYMBOL(lprocfs_obd_max_pages_per_rpc_seq_show);
+
+diff --git a/lustre/obdclass/lprocfs_status_server.c b/lustre/obdclass/lprocfs_status_server.c
+index 148f65a..6bb6c27 100644
+--- a/lustre/obdclass/lprocfs_status_server.c
++++ b/lustre/obdclass/lprocfs_status_server.c
+@@ -109,7 +109,8 @@ int lprocfs_num_exports_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = data;
+
+ LASSERT(obd != NULL);
+- return seq_printf(m, "%u\n", obd->obd_num_exports);
++ seq_printf(m, "%u\n", obd->obd_num_exports);
++ return 0;
+ }
+ EXPORT_SYMBOL(lprocfs_num_exports_seq_show);
+
+@@ -237,9 +238,9 @@ int lprocfs_exp_print_replydata_seq(struct cfs_hash *hs, struct cfs_hash_bd *bd,
+ struct tg_export_data *ted = &exp->exp_target_data;
+
+ seq_printf(m, "reply_cnt: %d\n"
+- "reply_max: %d\n"
+- "reply_released_by_xid: %d\n"
+- "reply_released_by_tag: %d\n\n",
++ "reply_max: %d\n"
++ "reply_released_by_xid: %d\n"
++ "reply_released_by_tag: %d\n\n",
+ ted->ted_reply_cnt,
+ ted->ted_reply_max,
+ ted->ted_release_xid,
+@@ -260,8 +261,8 @@ LPROC_SEQ_FOPS_RO(lprocfs_exp_replydata);
+
+ int lprocfs_nid_stats_clear_seq_show(struct seq_file *m, void *data)
+ {
+- return seq_printf(m, "%s\n", "Write into this file to clear all nid "
+- "stats and stale nid entries");
++ seq_puts(m, "Write into this file to clear all nid stats and stale nid entries\n");
++ return 0;
+ }
+ EXPORT_SYMBOL(lprocfs_nid_stats_clear_seq_show);
+
+@@ -548,16 +549,15 @@ EXPORT_SYMBOL(lprocfs_free_obd_stats);
+ int lprocfs_hash_seq_show(struct seq_file *m, void *data)
+ {
+ struct obd_device *obd = m->private;
+- int c = 0;
+
+ if (obd == NULL)
+ return 0;
+
+- c += cfs_hash_debug_header(m);
+- c += cfs_hash_debug_str(obd->obd_uuid_hash, m);
+- c += cfs_hash_debug_str(obd->obd_nid_hash, m);
+- c += cfs_hash_debug_str(obd->obd_nid_stats_hash, m);
+- return c;
++ cfs_hash_debug_header(m);
++ cfs_hash_debug_str(obd->obd_uuid_hash, m);
++ cfs_hash_debug_str(obd->obd_nid_hash, m);
++ cfs_hash_debug_str(obd->obd_nid_stats_hash, m);
++ return 0;
+ }
+ EXPORT_SYMBOL(lprocfs_hash_seq_show);
+
+@@ -631,7 +631,8 @@ int lprocfs_ir_factor_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+
+ LASSERT(obd != NULL);
+- return seq_printf(m, "%d\n", obd->obd_recovery_ir_factor);
++ seq_printf(m, "%d\n", obd->obd_recovery_ir_factor);
++ return 0;
+ }
+ EXPORT_SYMBOL(lprocfs_ir_factor_seq_show);
+
+@@ -661,7 +662,8 @@ int lprocfs_recovery_time_soft_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+
+ LASSERT(obd != NULL);
+- return seq_printf(m, "%d\n", obd->obd_recovery_timeout);
++ seq_printf(m, "%d\n", obd->obd_recovery_timeout);
++ return 0;
+ }
+ EXPORT_SYMBOL(lprocfs_recovery_time_soft_seq_show);
+
+@@ -689,7 +691,8 @@ int lprocfs_recovery_time_hard_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+
+ LASSERT(obd != NULL);
+- return seq_printf(m, "%u\n", obd->obd_recovery_time_hard);
++ seq_printf(m, "%u\n", obd->obd_recovery_time_hard);
++ return 0;
+ }
+ EXPORT_SYMBOL(lprocfs_recovery_time_hard_seq_show);
+
+@@ -719,7 +722,8 @@ int lprocfs_target_instance_seq_show(struct seq_file *m, void *data)
+
+ LASSERT(obd != NULL);
+ LASSERT(target->obt_magic == OBT_MAGIC);
+- return seq_printf(m, "%u\n", obd->u.obt.obt_instance);
++ seq_printf(m, "%u\n", obd->u.obt.obt_instance);
++ return 0;
+ }
+ EXPORT_SYMBOL(lprocfs_target_instance_seq_show);
+
+diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c
+index c478d51..7709a8d 100644
+--- a/lustre/obdclass/lu_object.c
++++ b/lustre/obdclass/lu_object.c
+@@ -2223,19 +2223,20 @@ int lu_site_stats_seq_print(const struct lu_site *s, struct seq_file *m)
+ memset(&stats, 0, sizeof(stats));
+ lu_site_stats_get(s->ls_obj_hash, &stats, 1);
+
+- return seq_printf(m, "%d/%d %d/%d %d %d %d %d %d %d %d %d\n",
+- stats.lss_busy,
+- stats.lss_total,
+- stats.lss_populated,
+- CFS_HASH_NHLIST(s->ls_obj_hash),
+- stats.lss_max_search,
+- ls_stats_read(s->ls_stats, LU_SS_CREATED),
+- ls_stats_read(s->ls_stats, LU_SS_CACHE_HIT),
+- ls_stats_read(s->ls_stats, LU_SS_CACHE_MISS),
+- ls_stats_read(s->ls_stats, LU_SS_CACHE_RACE),
+- ls_stats_read(s->ls_stats, LU_SS_CACHE_DEATH_RACE),
+- ls_stats_read(s->ls_stats, LU_SS_LRU_PURGED),
+- ls_stats_read(s->ls_stats, LU_SS_LRU_LEN));
++ seq_printf(m, "%d/%d %d/%d %d %d %d %d %d %d %d %d\n",
++ stats.lss_busy,
++ stats.lss_total,
++ stats.lss_populated,
++ CFS_HASH_NHLIST(s->ls_obj_hash),
++ stats.lss_max_search,
++ ls_stats_read(s->ls_stats, LU_SS_CREATED),
++ ls_stats_read(s->ls_stats, LU_SS_CACHE_HIT),
++ ls_stats_read(s->ls_stats, LU_SS_CACHE_MISS),
++ ls_stats_read(s->ls_stats, LU_SS_CACHE_RACE),
++ ls_stats_read(s->ls_stats, LU_SS_CACHE_DEATH_RACE),
++ ls_stats_read(s->ls_stats, LU_SS_LRU_PURGED),
++ ls_stats_read(s->ls_stats, LU_SS_LRU_LEN));
++ return 0;
+ }
+ EXPORT_SYMBOL(lu_site_stats_seq_print);
+
+diff --git a/lustre/ofd/lproc_ofd.c b/lustre/ofd/lproc_ofd.c
+index 65b57f3..29350da 100644
+--- a/lustre/ofd/lproc_ofd.c
++++ b/lustre/ofd/lproc_ofd.c
+@@ -64,7 +64,8 @@ static int ofd_seqs_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+
+- return seq_printf(m, "%u\n", ofd->ofd_seq_count);
++ seq_printf(m, "%u\n", ofd->ofd_seq_count);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ofd_seqs);
+
+@@ -84,7 +85,8 @@ static int ofd_tot_dirty_seq_show(struct seq_file *m, void *data)
+
+ LASSERT(obd != NULL);
+ ofd = ofd_dev(obd->obd_lu_dev);
+- return seq_printf(m, LPU64"\n", ofd->ofd_tot_dirty);
++ seq_printf(m, LPU64"\n", ofd->ofd_tot_dirty);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ofd_tot_dirty);
+
+@@ -104,7 +106,8 @@ static int ofd_tot_granted_seq_show(struct seq_file *m, void *data)
+
+ LASSERT(obd != NULL);
+ ofd = ofd_dev(obd->obd_lu_dev);
+- return seq_printf(m, LPU64"\n", ofd->ofd_tot_granted);
++ seq_printf(m, LPU64"\n", ofd->ofd_tot_granted);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ofd_tot_granted);
+
+@@ -124,7 +127,8 @@ static int ofd_tot_pending_seq_show(struct seq_file *m, void *data)
+
+ LASSERT(obd != NULL);
+ ofd = ofd_dev(obd->obd_lu_dev);
+- return seq_printf(m, LPU64"\n", ofd->ofd_tot_pending);
++ seq_printf(m, LPU64"\n", ofd->ofd_tot_pending);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ofd_tot_pending);
+
+@@ -142,8 +146,9 @@ static int ofd_grant_precreate_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+
+ LASSERT(obd != NULL);
+- return seq_printf(m, "%ld\n",
+- obd->obd_self_export->exp_filter_data.fed_grant);
++ seq_printf(m, "%ld\n",
++ obd->obd_self_export->exp_filter_data.fed_grant);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ofd_grant_precreate);
+
+@@ -225,7 +230,8 @@ static int ofd_precreate_batch_seq_show(struct seq_file *m, void *data)
+
+ LASSERT(obd != NULL);
+ ofd = ofd_dev(obd->obd_lu_dev);
+- return seq_printf(m, "%d\n", ofd->ofd_precreate_batch);
++ seq_printf(m, "%d\n", ofd->ofd_precreate_batch);
++ return 0;
+ }
+
+ /**
+@@ -277,7 +283,6 @@ static int ofd_last_id_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct ofd_device *ofd;
+ struct ofd_seq *oseq = NULL;
+- int retval = 0, rc;
+
+ if (obd == NULL)
+ return 0;
+@@ -292,15 +297,10 @@ static int ofd_last_id_seq_show(struct seq_file *m, void *data)
+ fid_idif_seq(ostid_id(&oseq->os_oi),
+ ofd->ofd_lut.lut_lsd.lsd_osd_index) :
+ ostid_seq(&oseq->os_oi);
+- rc = seq_printf(m, DOSTID"\n", seq, ostid_id(&oseq->os_oi));
+- if (rc < 0) {
+- retval = rc;
+- break;
+- }
+- retval += rc;
++ seq_printf(m, DOSTID"\n", seq, ostid_id(&oseq->os_oi));
+ }
+ read_unlock(&ofd->ofd_seq_list_lock);
+- return retval;
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ofd_last_id);
+
+@@ -318,7 +318,8 @@ static int ofd_fmd_max_num_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+
+- return seq_printf(m, "%u\n", ofd->ofd_fmd_max_num);
++ seq_printf(m, "%u\n", ofd->ofd_fmd_max_num);
++ return 0;
+ }
+
+ /**
+@@ -373,8 +374,9 @@ static int ofd_fmd_max_age_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+
+- return seq_printf(m, "%ld\n", jiffies_to_msecs(ofd->ofd_fmd_max_age) /
+- MSEC_PER_SEC);
++ seq_printf(m, "%ld\n", jiffies_to_msecs(ofd->ofd_fmd_max_age) /
++ MSEC_PER_SEC);
++ return 0;
+ }
+
+ /**
+@@ -433,7 +435,8 @@ static int ofd_degraded_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+
+- return seq_printf(m, "%u\n", ofd->ofd_raid_degraded);
++ seq_printf(m, "%u\n", ofd->ofd_raid_degraded);
++ return 0;
+ }
+
+ /**
+@@ -491,7 +494,8 @@ static int ofd_fstype_seq_show(struct seq_file *m, void *data)
+ LASSERT(ofd->ofd_osd);
+ d = &ofd->ofd_osd->dd_lu_dev;
+ LASSERT(d->ld_type);
+- return seq_printf(m, "%s\n", d->ld_type->ldt_name);
++ seq_printf(m, "%s\n", d->ld_type->ldt_name);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ofd_fstype);
+
+@@ -517,7 +521,8 @@ static int ofd_syncjournal_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+
+- return seq_printf(m, "%u\n", ofd->ofd_syncjournal);
++ seq_printf(m, "%u\n", ofd->ofd_syncjournal);
++ return 0;
+ }
+
+ /**
+@@ -579,8 +584,9 @@ static int ofd_sync_lock_cancel_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct lu_target *tgt = obd->u.obt.obt_lut;
+
+- return seq_printf(m, "%s\n",
+- sync_on_cancel_states[tgt->lut_sync_lock_cancel]);
++ seq_printf(m, "%s\n",
++ sync_on_cancel_states[tgt->lut_sync_lock_cancel]);
++ return 0;
+ }
+
+ /**
+@@ -673,7 +679,8 @@ static int ofd_grant_compat_disable_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+
+- return seq_printf(m, "%u\n", ofd->ofd_grant_compat_disable);
++ seq_printf(m, "%u\n", ofd->ofd_grant_compat_disable);
++ return 0;
+ }
+
+ /**
+@@ -851,11 +858,11 @@ static int ofd_lfsck_verify_pfid_seq_show(struct seq_file *m, void *data)
+ struct obd_device *obd = m->private;
+ struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+
+- return seq_printf(m,
+- "switch: %s\ndetected: "LPU64"\nrepaired: "LPU64"\n",
+- ofd->ofd_lfsck_verify_pfid ? "on" : "off",
+- ofd->ofd_inconsistency_self_detected,
+- ofd->ofd_inconsistency_self_repaired);
++ seq_printf(m, "switch: %s\ndetected: "LPU64"\nrepaired: "LPU64"\n",
++ ofd->ofd_lfsck_verify_pfid ? "on" : "off",
++ ofd->ofd_inconsistency_self_detected,
++ ofd->ofd_inconsistency_self_repaired);
++ return 0;
+ }
+
+ /**
+diff --git a/lustre/osc/lproc_osc.c b/lustre/osc/lproc_osc.c
+index 983442f..3bd44a6 100644
+--- a/lustre/osc/lproc_osc.c
++++ b/lustre/osc/lproc_osc.c
+@@ -47,12 +47,11 @@
+ static int osc_active_seq_show(struct seq_file *m, void *v)
+ {
+ struct obd_device *dev = m->private;
+- int rc;
+
+ LPROCFS_CLIMP_CHECK(dev);
+- rc = seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
++ seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
+ LPROCFS_CLIMP_EXIT(dev);
+- return rc;
++ return 0;
+ }
+
+ static ssize_t osc_active_seq_write(struct file *file,
+@@ -82,12 +81,11 @@ static int osc_max_rpcs_in_flight_seq_show(struct seq_file *m, void *v)
+ {
+ struct obd_device *dev = m->private;
+ struct client_obd *cli = &dev->u.cli;
+- int rc;
+
+ spin_lock(&cli->cl_loi_list_lock);
+- rc = seq_printf(m, "%u\n", cli->cl_max_rpcs_in_flight);
++ seq_printf(m, "%u\n", cli->cl_max_rpcs_in_flight);
+ spin_unlock(&cli->cl_loi_list_lock);
+- return rc;
++ return 0;
+ }
+
+ static ssize_t osc_max_rpcs_in_flight_seq_write(struct file *file,
+@@ -179,18 +177,16 @@ static int osc_cached_mb_seq_show(struct seq_file *m, void *v)
+ struct obd_device *dev = m->private;
+ struct client_obd *cli = &dev->u.cli;
+ int shift = 20 - PAGE_CACHE_SHIFT;
+- int rc;
+
+- rc = seq_printf(m,
+- "used_mb: %ld\n"
+- "busy_cnt: %ld\n"
+- "reclaim: "LPU64"\n",
+- (atomic_long_read(&cli->cl_lru_in_list) +
+- atomic_long_read(&cli->cl_lru_busy)) >> shift,
+- atomic_long_read(&cli->cl_lru_busy),
+- cli->cl_lru_reclaim);
++ seq_printf(m, "used_mb: %ld\n"
++ "busy_cnt: %ld\n"
++ "reclaim: "LPU64"\n",
++ (atomic_long_read(&cli->cl_lru_in_list) +
++ atomic_long_read(&cli->cl_lru_busy)) >> shift,
++ atomic_long_read(&cli->cl_lru_busy),
++ cli->cl_lru_reclaim);
+
+- return rc;
++ return 0;
+ }
+
+ /* shrink the number of caching pages to a specific number */
+@@ -248,12 +244,11 @@ static int osc_cur_dirty_bytes_seq_show(struct seq_file *m, void *v)
+ {
+ struct obd_device *dev = m->private;
+ struct client_obd *cli = &dev->u.cli;
+- int rc;
+
+ spin_lock(&cli->cl_loi_list_lock);
+- rc = seq_printf(m, "%lu\n", cli->cl_dirty_pages << PAGE_CACHE_SHIFT);
++ seq_printf(m, "%lu\n", cli->cl_dirty_pages << PAGE_CACHE_SHIFT);
+ spin_unlock(&cli->cl_loi_list_lock);
+- return rc;
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(osc_cur_dirty_bytes);
+
+@@ -261,12 +256,11 @@ static int osc_cur_grant_bytes_seq_show(struct seq_file *m, void *v)
+ {
+ struct obd_device *dev = m->private;
+ struct client_obd *cli = &dev->u.cli;
+- int rc;
+
+ spin_lock(&cli->cl_loi_list_lock);
+- rc = seq_printf(m, "%lu\n", cli->cl_avail_grant);
++ seq_printf(m, "%lu\n", cli->cl_avail_grant);
+ spin_unlock(&cli->cl_loi_list_lock);
+- return rc;
++ return 0;
+ }
+
+ static ssize_t osc_cur_grant_bytes_seq_write(struct file *file,
+@@ -308,23 +302,35 @@ static int osc_cur_lost_grant_bytes_seq_show(struct seq_file *m, void *v)
+ {
+ struct obd_device *dev = m->private;
+ struct client_obd *cli = &dev->u.cli;
+- int rc;
+
+ spin_lock(&cli->cl_loi_list_lock);
+- rc = seq_printf(m, "%lu\n", cli->cl_lost_grant);
++ seq_printf(m, "%lu\n", cli->cl_lost_grant);
+ spin_unlock(&cli->cl_loi_list_lock);
+- return rc;
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(osc_cur_lost_grant_bytes);
+
++static int osc_cur_dirty_grant_bytes_seq_show(struct seq_file *m, void *v)
++{
++ struct obd_device *dev = m->private;
++ struct client_obd *cli = &dev->u.cli;
++
++ spin_lock(&cli->cl_loi_list_lock);
++ seq_printf(m, "%lu\n", cli->cl_dirty_grant);
++ spin_unlock(&cli->cl_loi_list_lock);
++ return 0;
++}
++LPROC_SEQ_FOPS_RO(osc_cur_dirty_grant_bytes);
++
+ static int osc_grant_shrink_interval_seq_show(struct seq_file *m, void *v)
+ {
+ struct obd_device *obd = m->private;
+
+ if (obd == NULL)
+ return 0;
+- return seq_printf(m, "%d\n",
+- obd->u.cli.cl_grant_shrink_interval);
++ seq_printf(m, "%d\n",
++ obd->u.cli.cl_grant_shrink_interval);
++ return 0;
+ }
+
+ static ssize_t osc_grant_shrink_interval_seq_write(struct file *file,
+@@ -357,8 +363,8 @@ static int osc_checksum_seq_show(struct seq_file *m, void *v)
+ if (obd == NULL)
+ return 0;
+
+- return seq_printf(m, "%d\n",
+- obd->u.cli.cl_checksum ? 1 : 0);
++ seq_printf(m, "%d\n", obd->u.cli.cl_checksum ? 1 : 0);
++ return 0;
+ }
+
+ static ssize_t osc_checksum_seq_write(struct file *file,
+@@ -439,7 +445,8 @@ static int osc_resend_count_seq_show(struct seq_file *m, void *v)
+ {
+ struct obd_device *obd = m->private;
+
+- return seq_printf(m, "%u\n", atomic_read(&obd->u.cli.cl_resends));
++ seq_printf(m, "%u\n", atomic_read(&obd->u.cli.cl_resends));
++ return 0;
+ }
+
+ static ssize_t osc_resend_count_seq_write(struct file *file,
+@@ -467,7 +474,8 @@ static int osc_contention_seconds_seq_show(struct seq_file *m, void *v)
+ struct obd_device *obd = m->private;
+ struct osc_device *od = obd2osc_dev(obd);
+
+- return seq_printf(m, "%u\n", od->od_contention_time);
++ seq_printf(m, "%u\n", od->od_contention_time);
++ return 0;
+ }
+
+ static ssize_t osc_contention_seconds_seq_write(struct file *file,
+@@ -486,7 +494,8 @@ static int osc_lockless_truncate_seq_show(struct seq_file *m, void *v)
+ struct obd_device *obd = m->private;
+ struct osc_device *od = obd2osc_dev(obd);
+
+- return seq_printf(m, "%u\n", od->od_lockless_truncate);
++ seq_printf(m, "%u\n", od->od_lockless_truncate);
++ return 0;
+ }
+
+ static ssize_t osc_lockless_truncate_seq_write(struct file *file,
+@@ -504,8 +513,9 @@ LPROC_SEQ_FOPS(osc_lockless_truncate);
+ static int osc_destroys_in_flight_seq_show(struct seq_file *m, void *v)
+ {
+ struct obd_device *obd = m->private;
+- return seq_printf(m, "%u\n",
+- atomic_read(&obd->u.cli.cl_destroy_in_flight));
++ seq_printf(m, "%u\n",
++ atomic_read(&obd->u.cli.cl_destroy_in_flight));
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(osc_destroys_in_flight);
+
+@@ -562,9 +572,10 @@ static int osc_unstable_stats_seq_show(struct seq_file *m, void *v)
+ pages = atomic_long_read(&cli->cl_unstable_count);
+ mb = (pages * PAGE_CACHE_SIZE) >> 20;
+
+- return seq_printf(m, "unstable_pages: %20ld\n"
+- "unstable_mb: %10d\n",
+- pages, mb);
++ seq_printf(m, "unstable_pages: %20ld\n"
++ "unstable_mb: %10d\n",
++ pages, mb);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(osc_unstable_stats);
+
+@@ -716,11 +727,11 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v)
+ unsigned long w = cli->cl_write_rpc_hist.oh_buckets[i];
+ 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));
++ 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));
+ if (read_cum == read_tot && write_cum == write_tot)
+ break;
+ }
+diff --git a/lustre/osd-ldiskfs/osd_lproc.c b/lustre/osd-ldiskfs/osd_lproc.c
+index d15b3bf..4812342 100644
+--- a/lustre/osd-ldiskfs/osd_lproc.c
++++ b/lustre/osd-ldiskfs/osd_lproc.c
+@@ -243,7 +243,8 @@ static int ldiskfs_osd_fstype_seq_show(struct seq_file *m, void *data)
+ struct osd_device *osd = osd_dt_dev((struct dt_device *)m->private);
+
+ LASSERT(osd != NULL);
+- return seq_printf(m, "ldiskfs\n");
++ seq_puts(m, "ldiskfs\n");
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ldiskfs_osd_fstype);
+
+@@ -255,7 +256,8 @@ static int ldiskfs_osd_mntdev_seq_show(struct seq_file *m, void *data)
+ if (unlikely(osd->od_mnt == NULL))
+ return -EINPROGRESS;
+
+- return seq_printf(m, "%s\n", osd->od_mntdev);
++ seq_printf(m, "%s\n", osd->od_mntdev);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ldiskfs_osd_mntdev);
+
+@@ -267,7 +269,8 @@ static int ldiskfs_osd_cache_seq_show(struct seq_file *m, void *data)
+ if (unlikely(osd->od_mnt == NULL))
+ return -EINPROGRESS;
+
+- return seq_printf(m, "%u\n", osd->od_read_cache);
++ seq_printf(m, "%u\n", osd->od_read_cache);
++ return 0;
+ }
+
+ static ssize_t
+@@ -300,7 +303,8 @@ static int ldiskfs_osd_wcache_seq_show(struct seq_file *m, void *data)
+ if (unlikely(osd->od_mnt == NULL))
+ return -EINPROGRESS;
+
+- return seq_printf(m, "%u\n", osd->od_writethrough_cache);
++ seq_printf(m, "%u\n", osd->od_writethrough_cache);
++ return 0;
+ }
+
+ static ssize_t
+@@ -351,7 +355,8 @@ LPROC_SEQ_FOPS_WO_TYPE(ldiskfs, osd_force_sync);
+
+ static int ldiskfs_osd_pdo_seq_show(struct seq_file *m, void *data)
+ {
+- return seq_printf(m, "%s\n", ldiskfs_pdo ? "ON" : "OFF");
++ seq_printf(m, "%s\n", ldiskfs_pdo ? "ON" : "OFF");
++ return 0;
+ }
+
+ static ssize_t
+@@ -378,7 +383,8 @@ static int ldiskfs_osd_auto_scrub_seq_show(struct seq_file *m, void *data)
+ if (unlikely(dev->od_mnt == NULL))
+ return -EINPROGRESS;
+
+- return seq_printf(m, "%d\n", !dev->od_noscrub);
++ seq_printf(m, "%d\n", !dev->od_noscrub);
++ return 0;
+ }
+
+ static ssize_t
+@@ -411,7 +417,8 @@ static int ldiskfs_osd_full_scrub_ratio_seq_show(struct seq_file *m, void *data)
+ if (unlikely(dev->od_mnt == NULL))
+ return -EINPROGRESS;
+
+- return seq_printf(m, LPU64"\n", dev->od_full_scrub_ratio);
++ seq_printf(m, LPU64"\n", dev->od_full_scrub_ratio);
++ return 0;
+ }
+
+ static ssize_t
+@@ -448,8 +455,9 @@ static int ldiskfs_osd_full_scrub_threshold_rate_seq_show(struct seq_file *m,
+ if (unlikely(dev->od_mnt == NULL))
+ return -EINPROGRESS;
+
+- return seq_printf(m, LPU64" (bad OI mappings/minute)\n",
+- dev->od_full_scrub_threshold_rate);
++ seq_printf(m, LPU64" (bad OI mappings/minute)\n",
++ dev->od_full_scrub_threshold_rate);
++ return 0;
+ }
+
+ static ssize_t
+@@ -481,7 +489,8 @@ LPROC_SEQ_FOPS(ldiskfs_osd_full_scrub_threshold_rate);
+ static int
+ ldiskfs_osd_track_declares_assert_seq_show(struct seq_file *m, void *data)
+ {
+- return seq_printf(m, "%d\n", ldiskfs_track_declares_assert);
++ seq_printf(m, "%d\n", ldiskfs_track_declares_assert);
++ return 0;
+ }
+
+ static ssize_t
+@@ -522,7 +531,8 @@ static int ldiskfs_osd_readcache_seq_show(struct seq_file *m, void *data)
+ if (unlikely(osd->od_mnt == NULL))
+ return -EINPROGRESS;
+
+- return seq_printf(m, LPU64"\n", osd->od_readcache_max_filesize);
++ seq_printf(m, LPU64"\n", osd->od_readcache_max_filesize);
++ return 0;
+ }
+
+ static ssize_t
+@@ -558,7 +568,8 @@ static int ldiskfs_osd_index_in_idif_seq_show(struct seq_file *m, void *data)
+ if (unlikely(dev->od_mnt == NULL))
+ return -EINPROGRESS;
+
+- return seq_printf(m, "%d\n", (int)(dev->od_index_in_idif));
++ seq_printf(m, "%d\n", (int)(dev->od_index_in_idif));
++ return 0;
+ }
+
+ static ssize_t
+diff --git a/lustre/osd-ldiskfs/osd_scrub.c b/lustre/osd-ldiskfs/osd_scrub.c
+index 80f2794..5d12724 100644
+--- a/lustre/osd-ldiskfs/osd_scrub.c
++++ b/lustre/osd-ldiskfs/osd_scrub.c
+@@ -2989,50 +2989,38 @@ static const char *scrub_param_names[] = {
+ NULL
+ };
+
+-static int scrub_bits_dump(struct seq_file *m, int bits, const char *names[],
+- const char *prefix)
++static void scrub_bits_dump(struct seq_file *m, int bits, const char *names[],
++ const char *prefix)
+ {
+ int flag;
+- int rc;
+ int i;
+
+- rc = seq_printf(m, "%s:%c", prefix, bits != 0 ? ' ' : '\n');
+- if (rc < 0)
+- return rc;
++ seq_printf(m, "%s:%c", prefix, bits != 0 ? ' ' : '\n');
+
+ for (i = 0, flag = 1; bits != 0; i++, flag = 1 << i) {
+ if (flag & bits) {
+ bits &= ~flag;
+- rc = seq_printf(m, "%s%c", names[i],
+- bits != 0 ? ',' : '\n');
+- if (rc < 0)
+- return rc;
++ seq_printf(m, "%s%c", names[i],
++ bits != 0 ? ',' : '\n');
+ }
+ }
+- return 0;
+ }
+
+-static int scrub_time_dump(struct seq_file *m, __u64 time, const char *prefix)
++static void scrub_time_dump(struct seq_file *m, __u64 time, const char *prefix)
+ {
+- int rc;
+-
+ if (time != 0)
+- rc = seq_printf(m, "%s: "LPU64" seconds\n", prefix,
+- cfs_time_current_sec() - time);
++ seq_printf(m, "%s: "LPU64" seconds\n", prefix,
++ cfs_time_current_sec() - time);
+ else
+- rc = seq_printf(m, "%s: N/A\n", prefix);
+- return rc;
++ seq_printf(m, "%s: N/A\n", prefix);
+ }
+
+-static int scrub_pos_dump(struct seq_file *m, __u64 pos, const char *prefix)
++static void scrub_pos_dump(struct seq_file *m, __u64 pos, const char *prefix)
+ {
+- int rc;
+-
+ if (pos != 0)
+- rc = seq_printf(m, "%s: "LPU64"\n", prefix, pos);
++ seq_printf(m, "%s: "LPU64"\n", prefix, pos);
+ else
+- rc = seq_printf(m, "%s: N/A\n", prefix);
+- return rc;
++ seq_printf(m, "%s: N/A\n", prefix);
+ }
+
+ int osd_scrub_dump(struct seq_file *m, struct osd_device *dev)
+@@ -3041,71 +3029,48 @@ int osd_scrub_dump(struct seq_file *m, struct osd_device *dev)
+ struct scrub_file *sf = &scrub->os_file;
+ __u64 checked;
+ __u64 speed;
+- int rc;
+
+ down_read(&scrub->os_rwsem);
+- rc = seq_printf(m, "name: OI_scrub\n"
+- "magic: 0x%x\n"
+- "oi_files: %d\n"
+- "status: %s\n",
+- sf->sf_magic, (int)sf->sf_oi_count,
+- scrub_status_names[sf->sf_status]);
+- if (rc < 0)
+- goto out;
++ seq_printf(m, "name: OI_scrub\n"
++ "magic: 0x%x\n"
++ "oi_files: %d\n"
++ "status: %s\n",
++ sf->sf_magic, (int)sf->sf_oi_count,
++ scrub_status_names[sf->sf_status]);
+
+- rc = scrub_bits_dump(m, sf->sf_flags, scrub_flags_names,
+- "flags");
+- if (rc < 0)
+- goto out;
++ scrub_bits_dump(m, sf->sf_flags, scrub_flags_names, "flags");
+
+- rc = scrub_bits_dump(m, sf->sf_param, scrub_param_names,
+- "param");
+- if (rc < 0)
+- goto out;
++ scrub_bits_dump(m, sf->sf_param, scrub_param_names, "param");
+
+- rc = scrub_time_dump(m, sf->sf_time_last_complete,
+- "time_since_last_completed");
+- if (rc < 0)
+- goto out;
++ scrub_time_dump(m, sf->sf_time_last_complete,
++ "time_since_last_completed");
+
+- rc = scrub_time_dump(m, sf->sf_time_latest_start,
+- "time_since_latest_start");
+- if (rc < 0)
+- goto out;
++ scrub_time_dump(m, sf->sf_time_latest_start,
++ "time_since_latest_start");
+
+- rc = scrub_time_dump(m, sf->sf_time_last_checkpoint,
+- "time_since_last_checkpoint");
+- if (rc < 0)
+- goto out;
++ scrub_time_dump(m, sf->sf_time_last_checkpoint,
++ "time_since_last_checkpoint");
+
+- rc = scrub_pos_dump(m, sf->sf_pos_latest_start,
+- "latest_start_position");
+- if (rc < 0)
+- goto out;
++ scrub_pos_dump(m, sf->sf_pos_latest_start,
++ "latest_start_position");
+
+- rc = scrub_pos_dump(m, sf->sf_pos_last_checkpoint,
+- "last_checkpoint_position");
+- if (rc < 0)
+- goto out;
++ scrub_pos_dump(m, sf->sf_pos_last_checkpoint,
++ "last_checkpoint_position");
+
+- rc = scrub_pos_dump(m, sf->sf_pos_first_inconsistent,
+- "first_failure_position");
+- if (rc < 0)
+- goto out;
++ scrub_pos_dump(m, sf->sf_pos_first_inconsistent,
++ "first_failure_position");
+
+ checked = sf->sf_items_checked + scrub->os_new_checked;
+- rc = seq_printf(m, "checked: "LPU64"\n"
+- "updated: "LPU64"\n"
+- "failed: "LPU64"\n"
+- "prior_updated: "LPU64"\n"
+- "noscrub: "LPU64"\n"
+- "igif: "LPU64"\n"
+- "success_count: %u\n",
+- checked, sf->sf_items_updated, sf->sf_items_failed,
+- sf->sf_items_updated_prior, sf->sf_items_noscrub,
+- sf->sf_items_igif, sf->sf_success_count);
+- if (rc < 0)
+- goto out;
++ seq_printf(m, "checked: "LPU64"\n"
++ "updated: "LPU64"\n"
++ "failed: "LPU64"\n"
++ "prior_updated: "LPU64"\n"
++ "noscrub: "LPU64"\n"
++ "igif: "LPU64"\n"
++ "success_count: %u\n",
++ checked, sf->sf_items_updated, sf->sf_items_failed,
++ sf->sf_items_updated_prior, sf->sf_items_noscrub,
++ sf->sf_items_igif, sf->sf_success_count);
+
+ speed = checked;
+ if (thread_is_running(&scrub->os_thread)) {
+@@ -3120,31 +3085,30 @@ int osd_scrub_dump(struct seq_file *m, struct osd_device *dev)
+ do_div(new_checked, duration);
+ if (rtime != 0)
+ do_div(speed, rtime);
+- rc = seq_printf(m, "run_time: %u seconds\n"
+- "average_speed: "LPU64" objects/sec\n"
+- "real-time_speed: "LPU64" objects/sec\n"
+- "current_position: %u\n"
+- "lf_scanned: "LPU64"\n"
+- "lf_repaired: "LPU64"\n"
+- "lf_failed: "LPU64"\n",
+- rtime, speed, new_checked, scrub->os_pos_current,
+- scrub->os_lf_scanned, scrub->os_lf_repaired,
+- scrub->os_lf_failed);
++ seq_printf(m, "run_time: %u seconds\n"
++ "average_speed: "LPU64" objects/sec\n"
++ "real-time_speed: "LPU64" objects/sec\n"
++ "current_position: %u\n"
++ "lf_scanned: "LPU64"\n"
++ "lf_repaired: "LPU64"\n"
++ "lf_failed: "LPU64"\n",
++ rtime, speed, new_checked, scrub->os_pos_current,
++ scrub->os_lf_scanned, scrub->os_lf_repaired,
++ scrub->os_lf_failed);
+ } else {
+ if (sf->sf_run_time != 0)
+ do_div(speed, sf->sf_run_time);
+- rc = seq_printf(m, "run_time: %u seconds\n"
+- "average_speed: "LPU64" objects/sec\n"
+- "real-time_speed: N/A\n"
+- "current_position: N/A\n"
+- "lf_scanned: "LPU64"\n"
+- "lf_repaired: "LPU64"\n"
+- "lf_failed: "LPU64"\n",
+- sf->sf_run_time, speed, scrub->os_lf_scanned,
+- scrub->os_lf_repaired, scrub->os_lf_failed);
++ seq_printf(m, "run_time: %u seconds\n"
++ "average_speed: "LPU64" objects/sec\n"
++ "real-time_speed: N/A\n"
++ "current_position: N/A\n"
++ "lf_scanned: "LPU64"\n"
++ "lf_repaired: "LPU64"\n"
++ "lf_failed: "LPU64"\n",
++ sf->sf_run_time, speed, scrub->os_lf_scanned,
++ scrub->os_lf_repaired, scrub->os_lf_failed);
+ }
+
+-out:
+ up_read(&scrub->os_rwsem);
+- return (rc < 0 ? -ENOSPC : 0);
++ return 0;
+ }
+diff --git a/lustre/osd-zfs/osd_lproc.c b/lustre/osd-zfs/osd_lproc.c
+index c43aff8..d648298 100644
+--- a/lustre/osd-zfs/osd_lproc.c
++++ b/lustre/osd-zfs/osd_lproc.c
+@@ -217,7 +217,8 @@ out:
+
+ static int zfs_osd_fstype_seq_show(struct seq_file *m, void *data)
+ {
+- return seq_printf(m, "zfs\n");
++ seq_puts(m, "zfs\n");
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(zfs_osd_fstype);
+
+@@ -226,7 +227,8 @@ static int zfs_osd_mntdev_seq_show(struct seq_file *m, void *data)
+ struct osd_device *osd = osd_dt_dev((struct dt_device *)m->private);
+
+ LASSERT(osd != NULL);
+- return seq_printf(m, "%s\n", osd->od_mntdev);
++ seq_printf(m, "%s\n", osd->od_mntdev);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(zfs_osd_mntdev);
+
+@@ -254,7 +256,8 @@ static int zfs_osd_iused_est_seq_show(struct seq_file *m, void *data)
+ struct osd_device *osd = osd_dt_dev((struct dt_device *)m->private);
+ LASSERT(osd != NULL);
+
+- return seq_printf(m, "%d\n", osd->od_quota_iused_est);
++ seq_printf(m, "%d\n", osd->od_quota_iused_est);
++ return 0;
+ }
+
+ static ssize_t
+diff --git a/lustre/osp/lproc_osp.c b/lustre/osp/lproc_osp.c
+index 422b388..cf0ee83 100644
+--- a/lustre/osp/lproc_osp.c
++++ b/lustre/osp/lproc_osp.c
+@@ -52,12 +52,11 @@
+ static int osp_active_seq_show(struct seq_file *m, void *data)
+ {
+ struct obd_device *dev = m->private;
+- int rc;
+
+ LPROCFS_CLIMP_CHECK(dev);
+- rc = seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
++ seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
+ LPROCFS_CLIMP_EXIT(dev);
+- return rc;
++ return 0;
+ }
+
+ /**
+@@ -113,7 +112,8 @@ static int osp_syn_in_flight_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL)
+ return -EINVAL;
+
+- return seq_printf(m, "%u\n", osp->opd_syn_rpc_in_flight);
++ seq_printf(m, "%u\n", osp->opd_syn_rpc_in_flight);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(osp_syn_in_flight);
+
+@@ -133,7 +133,8 @@ static int osp_syn_in_prog_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL)
+ return -EINVAL;
+
+- return seq_printf(m, "%u\n", osp->opd_syn_rpc_in_progress);
++ seq_printf(m, "%u\n", osp->opd_syn_rpc_in_progress);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(osp_syn_in_prog);
+
+@@ -153,7 +154,8 @@ static int osp_syn_changes_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL)
+ return -EINVAL;
+
+- return seq_printf(m, "%lu\n", osp->opd_syn_changes);
++ seq_printf(m, "%lu\n", osp->opd_syn_changes);
++ return 0;
+ }
+
+ /**
+@@ -203,7 +205,8 @@ static int osp_max_rpcs_in_flight_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL)
+ return -EINVAL;
+
+- return seq_printf(m, "%u\n", osp->opd_syn_max_rpc_in_flight);
++ seq_printf(m, "%u\n", osp->opd_syn_max_rpc_in_flight);
++ return 0;
+ }
+
+ /**
+@@ -256,7 +259,8 @@ static int osp_max_rpcs_in_prog_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL)
+ return -EINVAL;
+
+- return seq_printf(m, "%u\n", osp->opd_syn_max_rpc_in_progress);
++ seq_printf(m, "%u\n", osp->opd_syn_max_rpc_in_progress);
++ return 0;
+ }
+
+ /**
+@@ -310,7 +314,8 @@ static int osp_create_count_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL || osp->opd_pre == NULL)
+ return 0;
+
+- return seq_printf(m, "%d\n", osp->opd_pre_create_count);
++ seq_printf(m, "%d\n", osp->opd_pre_create_count);
++ return 0;
+ }
+
+ /**
+@@ -378,7 +383,8 @@ static int osp_max_create_count_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL || osp->opd_pre == NULL)
+ return 0;
+
+- return seq_printf(m, "%d\n", osp->opd_pre_max_create_count);
++ seq_printf(m, "%d\n", osp->opd_pre_max_create_count);
++ return 0;
+ }
+
+ /**
+@@ -437,7 +443,8 @@ static int osp_prealloc_next_id_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL || osp->opd_pre == NULL)
+ return 0;
+
+- return seq_printf(m, "%u\n", fid_oid(&osp->opd_pre_used_fid) + 1);
++ seq_printf(m, "%u\n", fid_oid(&osp->opd_pre_used_fid) + 1);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(osp_prealloc_next_id);
+
+@@ -457,7 +464,8 @@ static int osp_prealloc_last_id_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL || osp->opd_pre == NULL)
+ return 0;
+
+- return seq_printf(m, "%u\n", fid_oid(&osp->opd_pre_last_created_fid));
++ seq_printf(m, "%u\n", fid_oid(&osp->opd_pre_last_created_fid));
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(osp_prealloc_last_id);
+
+@@ -477,7 +485,8 @@ static int osp_prealloc_next_seq_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL || osp->opd_pre == NULL)
+ return 0;
+
+- return seq_printf(m, LPX64"\n", fid_seq(&osp->opd_pre_used_fid));
++ seq_printf(m, LPX64"\n", fid_seq(&osp->opd_pre_used_fid));
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(osp_prealloc_next_seq);
+
+@@ -497,8 +506,9 @@ static int osp_prealloc_last_seq_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL || osp->opd_pre == NULL)
+ return 0;
+
+- return seq_printf(m, LPX64"\n",
+- fid_seq(&osp->opd_pre_last_created_fid));
++ seq_printf(m, LPX64"\n",
++ fid_seq(&osp->opd_pre_last_created_fid));
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(osp_prealloc_last_seq);
+
+@@ -518,7 +528,8 @@ static int osp_prealloc_reserved_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL || osp->opd_pre == NULL)
+ return 0;
+
+- return seq_printf(m, LPU64"\n", osp->opd_pre_reserved);
++ seq_printf(m, LPU64"\n", osp->opd_pre_reserved);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(osp_prealloc_reserved);
+
+@@ -538,7 +549,8 @@ static int osp_maxage_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL)
+ return -EINVAL;
+
+- return seq_printf(m, "%u\n", osp->opd_statfs_maxage);
++ seq_printf(m, "%u\n", osp->opd_statfs_maxage);
++ return 0;
+ }
+
+ /**
+@@ -593,7 +605,8 @@ static int osp_pre_status_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL || osp->opd_pre == NULL)
+ return -EINVAL;
+
+- return seq_printf(m, "%d\n", osp->opd_pre_status);
++ seq_printf(m, "%d\n", osp->opd_pre_status);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(osp_pre_status);
+
+@@ -620,8 +633,9 @@ static int osp_destroys_in_flight_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL)
+ return -EINVAL;
+
+- return seq_printf(m, "%lu\n",
+- osp->opd_syn_rpc_in_progress + osp->opd_syn_changes);
++ seq_printf(m, "%lu\n",
++ osp->opd_syn_rpc_in_progress + osp->opd_syn_changes);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(osp_destroys_in_flight);
+
+@@ -641,7 +655,8 @@ static int osp_old_sync_processed_seq_show(struct seq_file *m, void *data)
+ if (osp == NULL)
+ return -EINVAL;
+
+- return seq_printf(m, "%d\n", osp->opd_syn_prev_done);
++ seq_printf(m, "%d\n", osp->opd_syn_prev_done);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(osp_old_sync_processed);
+
+@@ -660,7 +675,8 @@ osp_lfsck_max_rpcs_in_flight_seq_show(struct seq_file *m, void *data)
+ __u32 max;
+
+ max = obd_get_max_rpcs_in_flight(&dev->u.cli);
+- return seq_printf(m, "%u\n", max);
++ seq_printf(m, "%u\n", max);
++ return 0;
+ }
+
+ /**
+diff --git a/lustre/ptlrpc/gss/lproc_gss.c b/lustre/ptlrpc/gss/lproc_gss.c
+index 13427fc..4648695 100644
+--- a/lustre/ptlrpc/gss/lproc_gss.c
++++ b/lustre/ptlrpc/gss/lproc_gss.c
+@@ -96,25 +96,26 @@ void gss_stat_oos_record_svc(int phase, int replay)
+
+ static int gss_proc_oos_seq_show(struct seq_file *m, void *v)
+ {
+- return seq_printf(m, "seqwin: %u\n"
+- "backwin: %u\n"
+- "client fall behind seqwin\n"
+- " occurrence: %d\n"
+- " max seq behind: %d\n"
+- "server replay detected:\n"
+- " phase 0: %d\n"
+- " phase 1: %d\n"
+- " phase 2: %d\n"
+- "server verify ok:\n"
+- " phase 2: %d\n",
+- GSS_SEQ_WIN_MAIN,
+- GSS_SEQ_WIN_BACK,
+- atomic_read(&gss_stat_oos.oos_cli_count),
+- gss_stat_oos.oos_cli_behind,
+- atomic_read(&gss_stat_oos.oos_svc_replay[0]),
+- atomic_read(&gss_stat_oos.oos_svc_replay[1]),
+- atomic_read(&gss_stat_oos.oos_svc_replay[2]),
+- atomic_read(&gss_stat_oos.oos_svc_pass[2]));
++ seq_printf(m, "seqwin: %u\n"
++ "backwin: %u\n"
++ "client fall behind seqwin\n"
++ " occurrence: %d\n"
++ " max seq behind: %d\n"
++ "server replay detected:\n"
++ " phase 0: %d\n"
++ " phase 1: %d\n"
++ " phase 2: %d\n"
++ "server verify ok:\n"
++ " phase 2: %d\n",
++ GSS_SEQ_WIN_MAIN,
++ GSS_SEQ_WIN_BACK,
++ atomic_read(&gss_stat_oos.oos_cli_count),
++ gss_stat_oos.oos_cli_behind,
++ atomic_read(&gss_stat_oos.oos_svc_replay[0]),
++ atomic_read(&gss_stat_oos.oos_svc_replay[1]),
++ atomic_read(&gss_stat_oos.oos_svc_replay[2]),
++ atomic_read(&gss_stat_oos.oos_svc_pass[2]));
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(gss_proc_oos);
+
+@@ -154,7 +155,8 @@ static int gss_lk_debug_level = 1;
+
+ static int gss_lk_proc_dl_seq_show(struct seq_file *m, void *v)
+ {
+- return seq_printf(m, "%u\n", gss_lk_debug_level);
++ seq_printf(m, "%u\n", gss_lk_debug_level);
++ return 0;
+ }
+
+ static ssize_t
+diff --git a/lustre/ptlrpc/lproc_ptlrpc.c b/lustre/ptlrpc/lproc_ptlrpc.c
+index 4c55fe1..3cb05f5 100644
+--- a/lustre/ptlrpc/lproc_ptlrpc.c
++++ b/lustre/ptlrpc/lproc_ptlrpc.c
+@@ -268,7 +268,8 @@ ptlrpc_lprocfs_req_history_len_seq_show(struct seq_file *m, void *v)
+ ptlrpc_service_for_each_part(svcpt, i, svc)
+ total += svcpt->scp_hist_nrqbds;
+
+- return seq_printf(m, "%d\n", total);
++ seq_printf(m, "%d\n", total);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ptlrpc_lprocfs_req_history_len);
+
+@@ -283,7 +284,8 @@ ptlrpc_lprocfs_req_history_max_seq_show(struct seq_file *m, void *n)
+ ptlrpc_service_for_each_part(svcpt, i, svc)
+ total += svc->srv_hist_nrqbds_cpt_max;
+
+- return seq_printf(m, "%d\n", total);
++ seq_printf(m, "%d\n", total);
++ return 0;
+ }
+
+ static ssize_t
+@@ -330,8 +332,9 @@ ptlrpc_lprocfs_threads_min_seq_show(struct seq_file *m, void *n)
+ {
+ struct ptlrpc_service *svc = m->private;
+
+- return seq_printf(m, "%d\n",
+- svc->srv_nthrs_cpt_init * svc->srv_ncpts);
++ seq_printf(m, "%d\n",
++ svc->srv_nthrs_cpt_init * svc->srv_ncpts);
++ return 0;
+ }
+
+ static ssize_t
+@@ -375,7 +378,8 @@ ptlrpc_lprocfs_threads_started_seq_show(struct seq_file *m, void *n)
+ ptlrpc_service_for_each_part(svcpt, i, svc)
+ total += svcpt->scp_nthrs_running;
+
+- return seq_printf(m, "%d\n", total);
++ seq_printf(m, "%d\n", total);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(ptlrpc_lprocfs_threads_started);
+
+@@ -384,8 +388,9 @@ ptlrpc_lprocfs_threads_max_seq_show(struct seq_file *m, void *n)
+ {
+ struct ptlrpc_service *svc = m->private;
+
+- return seq_printf(m, "%d\n",
+- svc->srv_nthrs_cpt_limit * svc->srv_ncpts);
++ seq_printf(m, "%d\n",
++ svc->srv_nthrs_cpt_limit * svc->srv_ncpts);
++ return 0;
+ }
+
+ static ssize_t
+@@ -599,21 +604,21 @@ again:
+ for (pol_idx = 0; pol_idx < num_pols; pol_idx++) {
+ if (strlen(infos[pol_idx].pi_arg) > 0)
+ seq_printf(m, " - name: %s %s\n",
+- infos[pol_idx].pi_name,
+- infos[pol_idx].pi_arg);
++ infos[pol_idx].pi_name,
++ infos[pol_idx].pi_arg);
+ else
+ seq_printf(m, " - name: %s\n",
+- infos[pol_idx].pi_name);
++ infos[pol_idx].pi_name);
+
+
+ seq_printf(m, " state: %s\n"
+- " fallback: %s\n"
+- " queued: %-20d\n"
+- " active: %-20d\n\n",
+- nrs_state2str(infos[pol_idx].pi_state),
+- infos[pol_idx].pi_fallback ? "yes" : "no",
+- (int)infos[pol_idx].pi_req_queued,
+- (int)infos[pol_idx].pi_req_started);
++ " fallback: %s\n"
++ " queued: %-20d\n"
++ " active: %-20d\n\n",
++ nrs_state2str(infos[pol_idx].pi_state),
++ infos[pol_idx].pi_fallback ? "yes" : "no",
++ (int)infos[pol_idx].pi_req_queued,
++ (int)infos[pol_idx].pi_req_started);
+ }
+
+ if (!hp && nrs_svc_has_hp(svc)) {
+@@ -1047,7 +1052,8 @@ LPROC_SEQ_FOPS_RO(ptlrpc_lprocfs_timeouts);
+ static int ptlrpc_lprocfs_hp_ratio_seq_show(struct seq_file *m, void *v)
+ {
+ struct ptlrpc_service *svc = m->private;
+- return seq_printf(m, "%d\n", svc->srv_hpreq_ratio);
++ seq_printf(m, "%d\n", svc->srv_hpreq_ratio);
++ return 0;
+ }
+
+ static ssize_t
+@@ -1296,12 +1302,11 @@ int lprocfs_pinger_recov_seq_show(struct seq_file *m, void *n)
+ {
+ struct obd_device *obd = m->private;
+ struct obd_import *imp = obd->u.cli.cl_import;
+- int rc;
+
+ LPROCFS_CLIMP_CHECK(obd);
+- rc = seq_printf(m, "%d\n", !imp->imp_no_pinger_recover);
++ seq_printf(m, "%d\n", !imp->imp_no_pinger_recover);
+ LPROCFS_CLIMP_EXIT(obd);
+- return rc;
++ return 0;
+ }
+ EXPORT_SYMBOL(lprocfs_pinger_recov_seq_show);
+
+diff --git a/lustre/ptlrpc/nodemap_lproc.c b/lustre/ptlrpc/nodemap_lproc.c
+index e5c4b0c..a77c478 100644
+--- a/lustre/ptlrpc/nodemap_lproc.c
++++ b/lustre/ptlrpc/nodemap_lproc.c
+@@ -239,7 +239,8 @@ static int nodemap_exports_open(struct inode *inode, struct file *file)
+ */
+ static int nodemap_active_seq_show(struct seq_file *m, void *data)
+ {
+- return seq_printf(m, "%u\n", (unsigned int)nodemap_active);
++ seq_printf(m, "%u\n", (unsigned int)nodemap_active);
++ return 0;
+ }
+
+ /**
+@@ -290,21 +291,20 @@ LPROC_SEQ_FOPS(nodemap_active);
+ static int nodemap_id_seq_show(struct seq_file *m, void *data)
+ {
+ struct lu_nodemap *nodemap;
+- int rc;
+
+ mutex_lock(&active_config_lock);
+ nodemap = nodemap_lookup(m->private);
+ mutex_unlock(&active_config_lock);
+ if (IS_ERR(nodemap)) {
+- rc = PTR_ERR(nodemap);
++ int rc = PTR_ERR(nodemap);
+ CERROR("cannot find nodemap '%s': rc = %d\n",
+ (char *)m->private, rc);
+ return rc;
+ }
+
+- rc = seq_printf(m, "%u\n", nodemap->nm_id);
++ seq_printf(m, "%u\n", nodemap->nm_id);
+ nodemap_putref(nodemap);
+- return rc;
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(nodemap_id);
+
+@@ -318,21 +318,20 @@ LPROC_SEQ_FOPS_RO(nodemap_id);
+ static int nodemap_squash_uid_seq_show(struct seq_file *m, void *data)
+ {
+ struct lu_nodemap *nodemap;
+- int rc;
+
+ mutex_lock(&active_config_lock);
+ nodemap = nodemap_lookup(m->private);
+ mutex_unlock(&active_config_lock);
+ if (IS_ERR(nodemap)) {
+- rc = PTR_ERR(nodemap);
++ int rc = PTR_ERR(nodemap);
+ CERROR("cannot find nodemap '%s': rc = %d\n",
+ (char *)m->private, rc);
+ return rc;
+ }
+
+- rc = seq_printf(m, "%u\n", nodemap->nm_squash_uid);
++ seq_printf(m, "%u\n", nodemap->nm_squash_uid);
+ nodemap_putref(nodemap);
+- return rc;
++ return 0;
+ }
+
+ /**
+@@ -345,21 +344,20 @@ static int nodemap_squash_uid_seq_show(struct seq_file *m, void *data)
+ static int nodemap_squash_gid_seq_show(struct seq_file *m, void *data)
+ {
+ struct lu_nodemap *nodemap;
+- int rc;
+
+ mutex_lock(&active_config_lock);
+ nodemap = nodemap_lookup(m->private);
+ mutex_unlock(&active_config_lock);
+ if (IS_ERR(nodemap)) {
+- rc = PTR_ERR(nodemap);
++ int rc = PTR_ERR(nodemap);
+ CERROR("cannot find nodemap '%s': rc = %d\n",
+ (char *)m->private, rc);
+ return rc;
+ }
+
+- rc = seq_printf(m, "%u\n", nodemap->nm_squash_gid);
++ seq_printf(m, "%u\n", nodemap->nm_squash_gid);
+ nodemap_putref(nodemap);
+- return rc;
++ return 0;
+ }
+
+ /**
+@@ -372,21 +370,21 @@ static int nodemap_squash_gid_seq_show(struct seq_file *m, void *data)
+ static int nodemap_trusted_seq_show(struct seq_file *m, void *data)
+ {
+ struct lu_nodemap *nodemap;
+- int rc;
+
+ mutex_lock(&active_config_lock);
+ nodemap = nodemap_lookup(m->private);
+ mutex_unlock(&active_config_lock);
+ if (IS_ERR(nodemap)) {
+- rc = PTR_ERR(nodemap);
++ int rc = PTR_ERR(nodemap);
++
+ CERROR("cannot find nodemap '%s': rc = %d\n",
+ (char *)m->private, rc);
+ return rc;
+ }
+
+- rc = seq_printf(m, "%d\n", (int)nodemap->nmf_trust_client_ids);
++ seq_printf(m, "%d\n", (int)nodemap->nmf_trust_client_ids);
+ nodemap_putref(nodemap);
+- return rc;
++ return 0;
+ }
+
+ /**
+@@ -411,9 +409,9 @@ static int nodemap_admin_seq_show(struct seq_file *m, void *data)
+ return rc;
+ }
+
+- rc = seq_printf(m, "%d\n", (int)nodemap->nmf_allow_root_access);
++ seq_printf(m, "%d\n", (int)nodemap->nmf_allow_root_access);
+ nodemap_putref(nodemap);
+- return rc;
++ return 0;
+ }
+
+ #ifdef NODEMAP_PROC_DEBUG
+diff --git a/lustre/ptlrpc/nrs_tbf.c b/lustre/ptlrpc/nrs_tbf.c
+index 7f92e10..6c94ff5 100644
+--- a/lustre/ptlrpc/nrs_tbf.c
++++ b/lustre/ptlrpc/nrs_tbf.c
+@@ -832,9 +832,10 @@ static int nrs_tbf_jobid_rule_init(struct ptlrpc_nrs_policy *policy,
+ static int
+ nrs_tbf_jobid_rule_dump(struct nrs_tbf_rule *rule, struct seq_file *m)
+ {
+- return seq_printf(m, "%s {%s} %llu, ref %d\n", rule->tr_name,
++ seq_printf(m, "%s {%s} %llu, ref %d\n", rule->tr_name,
+ rule->tr_jobids_str, rule->tr_rpc_rate,
+ atomic_read(&rule->tr_ref) - 1);
++ return 0;
+ }
+
+ static int
+@@ -1037,9 +1038,10 @@ static int nrs_tbf_nid_rule_init(struct ptlrpc_nrs_policy *policy,
+ static int
+ nrs_tbf_nid_rule_dump(struct nrs_tbf_rule *rule, struct seq_file *m)
+ {
+- return seq_printf(m, "%s {%s} %llu, ref %d\n", rule->tr_name,
++ seq_printf(m, "%s {%s} %llu, ref %d\n", rule->tr_name,
+ rule->tr_nids_str, rule->tr_rpc_rate,
+ atomic_read(&rule->tr_ref) - 1);
++ return 0;
+ }
+
+ static int
+diff --git a/lustre/ptlrpc/sec_bulk.c b/lustre/ptlrpc/sec_bulk.c
+index c091dd6..87b570e 100644
+--- a/lustre/ptlrpc/sec_bulk.c
++++ b/lustre/ptlrpc/sec_bulk.c
+@@ -138,55 +138,49 @@ static struct shrinker *pools_shrinker;
+ */
+ int sptlrpc_proc_enc_pool_seq_show(struct seq_file *m, void *v)
+ {
+- int rc;
+-
+ spin_lock(&page_pools.epp_lock);
+
+- rc = seq_printf(m,
+- "physical pages: %lu\n"
+- "pages per pool: %lu\n"
+- "max pages: %lu\n"
+- "max pools: %u\n"
+- "total pages: %lu\n"
+- "total free: %lu\n"
+- "idle index: %lu/100\n"
+- "last shrink: %lds\n"
+- "last access: %lds\n"
+- "max pages reached: %lu\n"
+- "grows: %u\n"
+- "grows failure: %u\n"
+- "shrinks: %u\n"
+- "cache access: %lu\n"
+- "cache missing: %lu\n"
+- "low free mark: %lu\n"
+- "max waitqueue depth: %u\n"
+- "max wait time: "CFS_TIME_T"/%lu\n"
+- "out of mem: %lu\n"
+- ,
+- totalram_pages,
+- PAGES_PER_POOL,
+- page_pools.epp_max_pages,
+- page_pools.epp_max_pools,
+- page_pools.epp_total_pages,
+- page_pools.epp_free_pages,
+- page_pools.epp_idle_idx,
+- cfs_time_current_sec() - page_pools.epp_last_shrink,
+- cfs_time_current_sec() - page_pools.epp_last_access,
+- page_pools.epp_st_max_pages,
+- page_pools.epp_st_grows,
+- page_pools.epp_st_grow_fails,
+- page_pools.epp_st_shrinks,
+- page_pools.epp_st_access,
+- page_pools.epp_st_missings,
+- page_pools.epp_st_lowfree,
+- page_pools.epp_st_max_wqlen,
+- page_pools.epp_st_max_wait,
+- msecs_to_jiffies(MSEC_PER_SEC),
+- page_pools.epp_st_outofmem
+- );
++ seq_printf(m, "physical pages: %lu\n"
++ "pages per pool: %lu\n"
++ "max pages: %lu\n"
++ "max pools: %u\n"
++ "total pages: %lu\n"
++ "total free: %lu\n"
++ "idle index: %lu/100\n"
++ "last shrink: %lds\n"
++ "last access: %lds\n"
++ "max pages reached: %lu\n"
++ "grows: %u\n"
++ "grows failure: %u\n"
++ "shrinks: %u\n"
++ "cache access: %lu\n"
++ "cache missing: %lu\n"
++ "low free mark: %lu\n"
++ "max waitqueue depth: %u\n"
++ "max wait time: "CFS_TIME_T"/%lu\n"
++ "out of mem: %lu\n",
++ totalram_pages, PAGES_PER_POOL,
++ page_pools.epp_max_pages,
++ page_pools.epp_max_pools,
++ page_pools.epp_total_pages,
++ page_pools.epp_free_pages,
++ page_pools.epp_idle_idx,
++ cfs_time_current_sec() - page_pools.epp_last_shrink,
++ cfs_time_current_sec() - page_pools.epp_last_access,
++ page_pools.epp_st_max_pages,
++ page_pools.epp_st_grows,
++ page_pools.epp_st_grow_fails,
++ page_pools.epp_st_shrinks,
++ page_pools.epp_st_access,
++ page_pools.epp_st_missings,
++ page_pools.epp_st_lowfree,
++ page_pools.epp_st_max_wqlen,
++ page_pools.epp_st_max_wait,
++ msecs_to_jiffies(MSEC_PER_SEC),
++ page_pools.epp_st_outofmem);
+
+ spin_unlock(&page_pools.epp_lock);
+- return rc;
++ return 0;
+ }
+
+ static void enc_pools_release_free_pages(long npages)
+diff --git a/lustre/quota/qsd_lib.c b/lustre/quota/qsd_lib.c
+index 9f89cac..efd7840 100644
+--- a/lustre/quota/qsd_lib.c
++++ b/lustre/quota/qsd_lib.c
+@@ -77,7 +77,6 @@ static int qsd_state_seq_show(struct seq_file *m, void *data)
+ {
+ struct qsd_instance *qsd = m->private;
+ char enabled[5];
+- int rc;
+
+ LASSERT(qsd != NULL);
+
+@@ -89,14 +88,14 @@ static int qsd_state_seq_show(struct seq_file *m, void *data)
+ if (strlen(enabled) == 0)
+ strcat(enabled, "none");
+
+- rc = seq_printf(m, "target name: %s\n"
+- "pool ID: %d\n"
+- "type: %s\n"
+- "quota enabled: %s\n"
+- "conn to master: %s\n",
+- qsd->qsd_svname, qsd->qsd_pool_id,
+- qsd->qsd_is_md ? "md" : "dt", enabled,
+- qsd->qsd_exp_valid ? "setup" : "not setup yet");
++ seq_printf(m, "target name: %s\n"
++ "pool ID: %d\n"
++ "type: %s\n"
++ "quota enabled: %s\n"
++ "conn to master: %s\n",
++ qsd->qsd_svname, qsd->qsd_pool_id,
++ qsd->qsd_is_md ? "md" : "dt", enabled,
++ qsd->qsd_exp_valid ? "setup" : "not setup yet");
+
+ if (qsd->qsd_prepared) {
+ memset(enabled, 0, sizeof(enabled));
+@@ -106,18 +105,18 @@ static int qsd_state_seq_show(struct seq_file *m, void *data)
+ strcat(enabled, "g");
+ if (strlen(enabled) == 0)
+ strcat(enabled, "none");
+- rc += seq_printf(m, "space acct: %s\n"
+- "user uptodate: glb[%d],slv[%d],reint[%d]\n"
+- "group uptodate: glb[%d],slv[%d],reint[%d]\n",
+- enabled,
+- qsd->qsd_type_array[USRQUOTA]->qqi_glb_uptodate,
+- qsd->qsd_type_array[USRQUOTA]->qqi_slv_uptodate,
+- qsd->qsd_type_array[USRQUOTA]->qqi_reint,
+- qsd->qsd_type_array[GRPQUOTA]->qqi_glb_uptodate,
+- qsd->qsd_type_array[GRPQUOTA]->qqi_slv_uptodate,
+- qsd->qsd_type_array[GRPQUOTA]->qqi_reint);
++ seq_printf(m, "space acct: %s\n"
++ "user uptodate: glb[%d],slv[%d],reint[%d]\n"
++ "group uptodate: glb[%d],slv[%d],reint[%d]\n",
++ enabled,
++ qsd->qsd_type_array[USRQUOTA]->qqi_glb_uptodate,
++ qsd->qsd_type_array[USRQUOTA]->qqi_slv_uptodate,
++ qsd->qsd_type_array[USRQUOTA]->qqi_reint,
++ qsd->qsd_type_array[GRPQUOTA]->qqi_glb_uptodate,
++ qsd->qsd_type_array[GRPQUOTA]->qqi_slv_uptodate,
++ qsd->qsd_type_array[GRPQUOTA]->qqi_reint);
+ }
+- return rc;
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(qsd_state);
+
+@@ -136,7 +135,8 @@ static int qsd_enabled_seq_show(struct seq_file *m, void *data)
+ if (strlen(enabled) == 0)
+ strcat(enabled, "none");
+
+- return seq_printf(m, "%s\n", enabled);
++ seq_printf(m, "%s\n", enabled);
++ return 0;
+ }
+ LPROC_SEQ_FOPS_RO(qsd_enabled);
+
+@@ -185,7 +185,8 @@ static int qsd_timeout_seq_show(struct seq_file *m, void *data)
+ struct qsd_instance *qsd = m->private;
+ LASSERT(qsd != NULL);
+
+- return seq_printf(m, "%d\n", qsd_wait_timeout(qsd));
++ seq_printf(m, "%d\n", qsd_wait_timeout(qsd));
++ return 0;
+ }
+
+ static ssize_t
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0002-LU-6215-gss-cache_head-is-now-on-a-hlist-in-4.3-kern.patch b/sys-cluster/lustre/files/0002-LU-6215-gss-cache_head-is-now-on-a-hlist-in-4.3-kern.patch
new file mode 100644
index 0000000..ba4c2f1
--- /dev/null
+++ b/sys-cluster/lustre/files/0002-LU-6215-gss-cache_head-is-now-on-a-hlist-in-4.3-kern.patch
@@ -0,0 +1,192 @@
+From 449e99feba4cfd3e417cdfc87e0eb33e163c2cb6 Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyang.li@anu.edu.au>
+Date: Tue, 1 Mar 2016 16:10:48 +1100
+Subject: [PATCH 02/19] LU-6215 gss: cache_head is now on a hlist in 4.3+
+ kernels
+
+Since kernel 4.3 struct cache_head switched from a single
+list to a hlist. This patch handles the change.
+
+Linux-commit: 129e5824cd96d9289679973f0ff7c48e88d569bb
+
+Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
+Change-Id: Iec4c7d0acf106a8f7b60d72eb2038b6d9e12f422
+Reviewed-on: http://review.whamcloud.com/18728
+Tested-by: Jenkins
+Tested-by: Maloo <hpdd-maloo@intel.com>
+Reviewed-by: James Simmons <uja.ornl@yahoo.com>
+Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
+Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+---
+ lustre/autoconf/lustre-core.m4 | 46 +++++++++++++++++++++++++++++++++++++
+ lustre/ptlrpc/gss/gss_svc_upcall.c | 47 ++++++++++++++++++++++++++++++++------
+ 2 files changed, 86 insertions(+), 7 deletions(-)
+
+diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
+index b8285d0..8ed3500 100644
+--- a/lustre/autoconf/lustre-core.m4
++++ b/lustre/autoconf/lustre-core.m4
+@@ -1948,6 +1948,49 @@ bio_endio, [
+ ]) # LC_BIO_ENDIO_USES_ONE_ARG
+
+ #
++# LC_HAVE_LOOP_CTL_GET_FREE
++#
++# 4.x kernel have moved userspace APIs to
++# the separate directory and all of them
++# support LOOP_CTL_GET_FREE
++#
++AC_DEFUN([LC_HAVE_LOOP_CTL_GET_FREE], [
++LB_CHECK_FILE([$LINUX/include/linux/loop.h], [
++ LB_CHECK_COMPILE([if have 'HAVE_LOOP_CTL_GET_FREE'],
++ LOOP_CTL_GET_FREE, [
++ #include <linux/loop.h>
++ ],[
++ int i;
++
++ i = LOOP_CTL_GET_FREE;
++ ],[
++ AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
++ [LOOP_CTL_GET_FREE exist])
++ ])
++],[
++ AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
++ [kernel has LOOP_CTL_GET_FREE])
++])
++]) # LC_HAVE_LOOP_CTL_GET_FREE
++
++#
++# LC_HAVE_CACHE_HEAD_HLIST
++#
++# 4.3 kernel swiched to hlist for cache_head
++#
++AC_DEFUN([LC_HAVE_CACHE_HEAD_HLIST], [
++LB_CHECK_COMPILE([if 'struct cache_head' has 'cache_list' field],
++cache_head_has_hlist, [
++ #include <linux/sunrpc/cache.h>
++],[
++ do {} while(sizeof(((struct cache_head *)0)->cache_list));
++],[
++ AC_DEFINE(HAVE_CACHE_HEAD_HLIST, 1,
++ [cache_head has hlist cache_list])
++])
++]) # LC_HAVE_CACHE_HEAD_HLIST
++
++#
+ # LC_PROG_LINUX
+ #
+ # Lustre linux kernel checks
+@@ -2108,6 +2151,9 @@ AC_DEFUN([LC_PROG_LINUX], [
+ LC_BIO_ENDIO_USES_ONE_ARG
+ LC_SYMLINK_OPS_USE_NAMEIDATA
+
++ # 4.3
++ LC_HAVE_CACHE_HEAD_HLIST
++
+ #
+ AS_IF([test "x$enable_server" != xno], [
+ LC_FUNC_DEV_SET_RDONLY
+diff --git a/lustre/ptlrpc/gss/gss_svc_upcall.c b/lustre/ptlrpc/gss/gss_svc_upcall.c
+index 429b1eb..2786d69 100644
+--- a/lustre/ptlrpc/gss/gss_svc_upcall.c
++++ b/lustre/ptlrpc/gss/gss_svc_upcall.c
+@@ -149,7 +149,11 @@ struct rsi {
+ int major_status, minor_status;
+ };
+
++#ifdef HAVE_CACHE_HEAD_HLIST
++static struct hlist_head rsi_table[RSI_HASHMAX];
++#else
+ static struct cache_head *rsi_table[RSI_HASHMAX];
++#endif
+ static struct cache_detail rsi_cache;
+ static struct rsi *rsi_update(struct rsi *new, struct rsi *old);
+ static struct rsi *rsi_lookup(struct rsi *item);
+@@ -242,7 +246,11 @@ static void rsi_put(struct kref *ref)
+ {
+ struct rsi *rsi = container_of(ref, struct rsi, h.ref);
+
+- LASSERT(rsi->h.next == NULL);
++#ifdef HAVE_CACHE_HEAD_HLIST
++ LASSERT(rsi->h.cache_list.next == NULL);
++#else
++ LASSERT(rsi->h.next == NULL);
++#endif
+ rsi_free(rsi);
+ OBD_FREE_PTR(rsi);
+ }
+@@ -430,7 +438,11 @@ struct rsc {
+ struct gss_svc_ctx ctx;
+ };
+
++#ifdef HAVE_CACHE_HEAD_HLIST
++static struct hlist_head rsc_table[RSC_HASHMAX];
++#else
+ static struct cache_head *rsc_table[RSC_HASHMAX];
++#endif
+ static struct cache_detail rsc_cache;
+ static struct rsc *rsc_update(struct rsc *new, struct rsc *old);
+ static struct rsc *rsc_lookup(struct rsc *item);
+@@ -477,7 +489,11 @@ static void rsc_put(struct kref *ref)
+ {
+ struct rsc *rsci = container_of(ref, struct rsc, h.ref);
+
++#ifdef HAVE_CACHE_HEAD_HLIST
++ LASSERT(rsci->h.cache_list.next == NULL);
++#else
+ LASSERT(rsci->h.next == NULL);
++#endif
+ rsc_free(rsci);
+ OBD_FREE_PTR(rsci);
+ }
+@@ -693,24 +709,41 @@ typedef int rsc_entry_match(struct rsc *rscp, long data);
+
+ static void rsc_flush(rsc_entry_match *match, long data)
+ {
+- struct cache_head **ch;
++#ifdef HAVE_CACHE_HEAD_HLIST
++ struct cache_head *ch = NULL;
++ struct hlist_head *head;
++#else
++ struct cache_head **ch;
++#endif
+ struct rsc *rscp;
+ int n;
+ ENTRY;
+
+ write_lock(&rsc_cache.hash_lock);
+ for (n = 0; n < RSC_HASHMAX; n++) {
+- for (ch = &rsc_cache.hash_table[n]; *ch;) {
+- rscp = container_of(*ch, struct rsc, h);
++#ifdef HAVE_CACHE_HEAD_HLIST
++ head = &rsc_cache.hash_table[n];
++ hlist_for_each_entry(ch, head, cache_list) {
++ rscp = container_of(ch, struct rsc, h);
++#else
++ for (ch = &rsc_cache.hash_table[n]; *ch;) {
++ rscp = container_of(*ch, struct rsc, h);
++#endif
+
+ if (!match(rscp, data)) {
+- ch = &((*ch)->next);
++#ifndef HAVE_CACHE_HEAD_HLIST
++ ch = &((*ch)->next);
++#endif
+ continue;
+ }
+
+ /* it seems simply set NEGATIVE doesn't work */
+- *ch = (*ch)->next;
+- rscp->h.next = NULL;
++#ifdef HAVE_CACHE_HEAD_HLIST
++ hlist_del_init(&ch->cache_list);
++#else
++ *ch = (*ch)->next;
++ rscp->h.next = NULL;
++#endif
+ cache_get(&rscp->h);
+ set_bit(CACHE_NEGATIVE, &rscp->h.flags);
+ COMPAT_RSC_PUT(&rscp->h, &rsc_cache);
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0003-LU-6215-llite-handle-locks-API-change-in-4.4-kernels.patch b/sys-cluster/lustre/files/0003-LU-6215-llite-handle-locks-API-change-in-4.4-kernels.patch
new file mode 100644
index 0000000..4c1c668
--- /dev/null
+++ b/sys-cluster/lustre/files/0003-LU-6215-llite-handle-locks-API-change-in-4.4-kernels.patch
@@ -0,0 +1,90 @@
+From ffcc66dc3a0e7249ac6d5f7506c595cc69209e54 Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyang.li@anu.edu.au>
+Date: Tue, 1 Mar 2016 16:36:49 +1100
+Subject: [PATCH 03/19] LU-6215 llite: handle locks API change in 4.4+ kernels
+
+Since 4.4 linux kernel replaced both posix_lock_file_wait() and
+flock_lock_file_wait() by introducing locks_lock_file_wait().
+This patch handles the API change.
+
+Linux-commit: 4f6563677ae833baad8003e14353241bc25da4fc
+
+Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
+Change-Id: I1b9c98c2afcad9da3fb377c3e788b12f20261e9e
+Reviewed-on: http://review.whamcloud.com/18729
+Tested-by: Jenkins
+Tested-by: Maloo <hpdd-maloo@intel.com>
+Reviewed-by: James Simmons <uja.ornl@yahoo.com>
+Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
+Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+---
+ lustre/autoconf/lustre-core.m4 | 21 +++++++++++++++++++++
+ lustre/llite/file.c | 6 ++++++
+ 2 files changed, 27 insertions(+)
+
+diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
+index 8ed3500..b2a4af0 100644
+--- a/lustre/autoconf/lustre-core.m4
++++ b/lustre/autoconf/lustre-core.m4
+@@ -1991,6 +1991,24 @@ cache_head_has_hlist, [
+ ]) # LC_HAVE_CACHE_HEAD_HLIST
+
+ #
++# LC_HAVE_LOCKS_LOCK_FILE_WAIT
++#
++# 4.4 kernel have moved locks API users to
++# locks_lock_inode_wait()
++#
++AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT], [
++LB_CHECK_COMPILE([if 'locks_lock_file_wait' exists],
++locks_lock_file_wait, [
++ #include <linux/fs.h>
++],[
++ locks_lock_file_wait(NULL, NULL);
++],[
++ AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
++ [kernel has locks_lock_file_wait])
++])
++]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
++
++#
+ # LC_PROG_LINUX
+ #
+ # Lustre linux kernel checks
+@@ -2154,6 +2172,9 @@ AC_DEFUN([LC_PROG_LINUX], [
+ # 4.3
+ LC_HAVE_CACHE_HEAD_HLIST
+
++ # 4.4
++ LC_HAVE_LOCKS_LOCK_FILE_WAIT
++
+ #
+ AS_IF([test "x$enable_server" != xno], [
+ LC_FUNC_DEV_SET_RDONLY
+diff --git a/lustre/llite/file.c b/lustre/llite/file.c
+index 8e6afbd..d1819c6 100644
+--- a/lustre/llite/file.c
++++ b/lustre/llite/file.c
+@@ -2918,6 +2918,11 @@ ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
+ if (!(flags & LDLM_FL_TEST_LOCK))
+ file_lock->fl_type = fl_type;
+
++#ifdef HAVE_LOCKS_LOCK_FILE_WAIT
++ if ((rc == 0 || file_lock->fl_type == F_UNLCK) &&
++ !(flags & LDLM_FL_TEST_LOCK))
++ rc2 = locks_lock_file_wait(file, file_lock);
++#else
+ if ((file_lock->fl_flags & FL_FLOCK) &&
+ (rc == 0 || file_lock->fl_type == F_UNLCK))
+ rc2 = flock_lock_file_wait(file, file_lock);
+@@ -2925,6 +2930,7 @@ ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
+ (rc == 0 || file_lock->fl_type == F_UNLCK) &&
+ !(flags & LDLM_FL_TEST_LOCK))
+ rc2 = posix_lock_file_wait(file, file_lock);
++#endif /* HAVE_LOCKS_LOCK_FILE_WAIT */
+
+ if (rc2 && file_lock->fl_type != F_UNLCK) {
+ einfo.ei_mode = LCK_NL;
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0004-LU-6215-llite-make_request_fn-returns-blk_qc_t-in-ke.patch b/sys-cluster/lustre/files/0004-LU-6215-llite-make_request_fn-returns-blk_qc_t-in-ke.patch
new file mode 100644
index 0000000..3be9aef
--- /dev/null
+++ b/sys-cluster/lustre/files/0004-LU-6215-llite-make_request_fn-returns-blk_qc_t-in-ke.patch
@@ -0,0 +1,95 @@
+From 7d62fb54e3faec60e86135d75cc6349cf626a46b Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyang.li@anu.edu.au>
+Date: Tue, 1 Mar 2016 16:53:49 +1100
+Subject: [PATCH 04/19] LU-6215 llite: make_request_fn returns blk_qc_t in
+ kernel 4.4
+
+For the 4.4 kernel request_queue.make_request_fn is defined as
+a function returns blk_qc_t. loop_make_request() should return
+BLK_QC_T_NONE in this case.
+
+Linux-commit: dece16353ef47d8d33f5302bc158072a9d65e26f
+
+Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
+Change-Id: I20a796caf6d8e6411f084db2392683c12307a0bf
+Reviewed-on: http://review.whamcloud.com/18730
+Tested-by: Jenkins
+Tested-by: Maloo <hpdd-maloo@intel.com>
+Reviewed-by: James Simmons <uja.ornl@yahoo.com>
+Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
+Reviewed-by: Lai Siyao <lai.siyao@intel.com>
+Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+---
+ lustre/autoconf/lustre-core.m4 | 21 +++++++++++++++++++++
+ lustre/include/lustre_compat.h | 15 ++++++++++-----
+ 2 files changed, 31 insertions(+), 5 deletions(-)
+
+diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
+index b2a4af0..0201a28 100644
+--- a/lustre/autoconf/lustre-core.m4
++++ b/lustre/autoconf/lustre-core.m4
+@@ -2009,6 +2009,26 @@ locks_lock_file_wait, [
+ ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
+
+ #
++# LC_HAVE_QC_MAKE_REQUEST_FN
++#
++# 4.4 request_queue.make_request_fn defined as function returns with blk_qc_t
++# see kernel commit dece16353ef47d8d33f5302bc158072a9d65e26f
++#
++AC_DEFUN([LC_HAVE_QC_MAKE_REQUEST_FN], [
++LB_CHECK_COMPILE([if 'request_queue.make_request_fn' returns blk_qc_t],
++make_request_fn_blk_qc_t, [
++ #include <linux/blkdev.h>
++],[
++ blk_qc_t ret;
++ make_request_fn *mrf;
++ ret = mrf(NULL, NULL);
++],[
++ AC_DEFINE(HAVE_QC_MAKE_REQUEST_FN, 1,
++ [request_queue.make_request_fn returns blk_qc_t])
++])
++]) # LC_HAVE_QC_MAKE_REQUEST_FN
++
++#
+ # LC_PROG_LINUX
+ #
+ # Lustre linux kernel checks
+@@ -2174,6 +2194,7 @@ AC_DEFUN([LC_PROG_LINUX], [
+
+ # 4.4
+ LC_HAVE_LOCKS_LOCK_FILE_WAIT
++ LC_HAVE_QC_MAKE_REQUEST_FN
+
+ #
+ AS_IF([test "x$enable_server" != xno], [
+diff --git a/lustre/include/lustre_compat.h b/lustre/include/lustre_compat.h
+index c038aa1..4e9f3ac 100644
+--- a/lustre/include/lustre_compat.h
++++ b/lustre/include/lustre_compat.h
+@@ -298,12 +298,17 @@ static inline int ll_namei_to_lookup_intent_flag(int flag)
+ return flag;
+ }
+
+-#ifdef HAVE_VOID_MAKE_REQUEST_FN
+-# define ll_mrf_ret void
+-# define LL_MRF_RETURN(rc)
++#ifdef HAVE_QC_MAKE_REQUEST_FN
++# define ll_mrf_ret blk_qc_t
++# define LL_MRF_RETURN(rc) RETURN(BLK_QC_T_NONE)
+ #else
+-# define ll_mrf_ret int
+-# define LL_MRF_RETURN(rc) RETURN(rc)
++# ifdef HAVE_VOID_MAKE_REQUEST_FN
++# define ll_mrf_ret void
++# define LL_MRF_RETURN(rc)
++# else
++# define ll_mrf_ret int
++# define LL_MRF_RETURN(rc) RETURN(rc)
++# endif
+ #endif
+
+ #include <linux/fs.h>
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0005-LU-6215-gss-key-payload.data-is-an-array-in-4.4-kern.patch b/sys-cluster/lustre/files/0005-LU-6215-gss-key-payload.data-is-an-array-in-4.4-kern.patch
new file mode 100644
index 0000000..a21f41b
--- /dev/null
+++ b/sys-cluster/lustre/files/0005-LU-6215-gss-key-payload.data-is-an-array-in-4.4-kern.patch
@@ -0,0 +1,229 @@
+From fba216ef655a9c13f5bac27d5911da2e6745ea3d Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyang.li@anu.edu.au>
+Date: Thu, 21 Apr 2016 10:25:28 -0400
+Subject: [PATCH 05/19] LU-6215 gss: key->payload.data is an array in 4.4+
+ kernels
+
+Kernel 4.4 merged the type-specific data with the payload data
+for keys, as a result, payload.data is now an array.
+This patch handles the code change.
+
+Linux-commit: 146aa8b1453bd8f1ff2304ffb71b4ee0eb9acdcc
+
+Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
+Signed-off-by: James Simmons <uja.ornl@yahoo.com>
+Change-Id: I1036ab927514f0efa073d9f0136e299be8950461
+Reviewed-on: http://review.whamcloud.com/18731
+Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
+Tested-by: Jenkins
+Tested-by: Maloo <hpdd-maloo@intel.com>
+Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
+Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+---
+ lustre/autoconf/lustre-core.m4 | 17 +++++++++++
+ lustre/ptlrpc/gss/gss_keyring.c | 67 ++++++++++++++++++++++++++++++++---------
+ 2 files changed, 69 insertions(+), 15 deletions(-)
+
+diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
+index 0201a28..9497cdd 100644
+--- a/lustre/autoconf/lustre-core.m4
++++ b/lustre/autoconf/lustre-core.m4
+@@ -2029,6 +2029,22 @@ make_request_fn_blk_qc_t, [
+ ]) # LC_HAVE_QC_MAKE_REQUEST_FN
+
+ #
++# LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
++#
++# 4.4 kernel merged type-specific data with the payload data for keys
++#
++AC_DEFUN([LC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
++LB_CHECK_COMPILE([if 'struct key' has 'payload.data' as an array],
++key_payload_data_array, [
++ #include <linux/key.h>
++],[
++ ((struct key *)0)->payload.data[0] = NULL;
++],[
++ AC_DEFINE(HAVE_KEY_PAYLOAD_DATA_ARRAY, 1, [payload.data is an array])
++])
++]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
++
++#
+ # LC_PROG_LINUX
+ #
+ # Lustre linux kernel checks
+@@ -2195,6 +2211,7 @@ AC_DEFUN([LC_PROG_LINUX], [
+ # 4.4
+ LC_HAVE_LOCKS_LOCK_FILE_WAIT
+ LC_HAVE_QC_MAKE_REQUEST_FN
++ LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
+
+ #
+ AS_IF([test "x$enable_server" != xno], [
+diff --git a/lustre/ptlrpc/gss/gss_keyring.c b/lustre/ptlrpc/gss/gss_keyring.c
+index 67188f5..e8fbe50 100644
+--- a/lustre/ptlrpc/gss/gss_keyring.c
++++ b/lustre/ptlrpc/gss/gss_keyring.c
+@@ -348,6 +348,43 @@ static int ctx_unlist_kr(struct ptlrpc_cli_ctx *ctx, int locked)
+ }
+
+ /*
++ * Get specific payload. Newer kernels support 4 slots.
++ */
++static void *
++key_get_payload(struct key *key, unsigned int index)
++{
++ void *key_ptr = NULL;
++
++#ifdef HAVE_KEY_PAYLOAD_DATA_ARRAY
++ key_ptr = key->payload.data[index];
++#else
++ if (!index)
++ key_ptr = key->payload.data;
++#endif
++ return key_ptr;
++}
++
++/*
++ * Set specific payload. Newer kernels support 4 slots.
++ */
++static int key_set_payload(struct key *key, unsigned int index,
++ struct ptlrpc_cli_ctx *ctx)
++{
++ int rc = -EINVAL;
++
++#ifdef HAVE_KEY_PAYLOAD_DATA_ARRAY
++ if (index < 4) {
++ key->payload.data[index] = ctx;
++#else
++ if (!index) {
++ key->payload.data = ctx;
++#endif
++ rc = 0;
++ }
++ return rc;
++}
++
++/*
+ * bind a key with a ctx together.
+ * caller must hold write lock of the key, as well as ref on key & ctx.
+ */
+@@ -356,13 +393,13 @@ static void bind_key_ctx(struct key *key, struct ptlrpc_cli_ctx *ctx)
+ LASSERT(atomic_read(&ctx->cc_refcount) > 0);
+ LASSERT(atomic_read(&key->usage) > 0);
+ LASSERT(ctx2gctx_keyring(ctx)->gck_key == NULL);
+- LASSERT(key->payload.data == NULL);
++ LASSERT(!key_get_payload(key, 0));
+
+ /* at this time context may or may not in list. */
+ key_get(key);
+ atomic_inc(&ctx->cc_refcount);
+ ctx2gctx_keyring(ctx)->gck_key = key;
+- key->payload.data = ctx;
++ LASSERT(!key_set_payload(key, 0, ctx));
+ }
+
+ /*
+@@ -371,13 +408,13 @@ static void bind_key_ctx(struct key *key, struct ptlrpc_cli_ctx *ctx)
+ */
+ static void unbind_key_ctx(struct key *key, struct ptlrpc_cli_ctx *ctx)
+ {
+- LASSERT(key->payload.data == ctx);
++ LASSERT(key_get_payload(key, 0) == ctx);
+ LASSERT(test_bit(PTLRPC_CTX_CACHED_BIT, &ctx->cc_flags) == 0);
+
+ /* must revoke the key, or others may treat it as newly created */
+ key_revoke_locked(key);
+
+- key->payload.data = NULL;
++ key_set_payload(key, 0, NULL);
+ ctx2gctx_keyring(ctx)->gck_key = NULL;
+
+ /* once ctx get split from key, the timer is meaningless */
+@@ -397,7 +434,7 @@ static void unbind_ctx_kr(struct ptlrpc_cli_ctx *ctx)
+ struct key *key = ctx2gctx_keyring(ctx)->gck_key;
+
+ if (key) {
+- LASSERT(key->payload.data == ctx);
++ LASSERT(key_get_payload(key, 0) == ctx);
+
+ key_get(key);
+ down_write(&key->sem);
+@@ -413,7 +450,7 @@ static void unbind_ctx_kr(struct ptlrpc_cli_ctx *ctx)
+ */
+ static void unbind_key_locked(struct key *key)
+ {
+- struct ptlrpc_cli_ctx *ctx = key->payload.data;
++ struct ptlrpc_cli_ctx *ctx = key_get_payload(key, 0);
+
+ if (ctx)
+ unbind_key_ctx(key, ctx);
+@@ -434,7 +471,7 @@ static void kill_ctx_kr(struct ptlrpc_cli_ctx *ctx)
+ */
+ static void kill_key_locked(struct key *key)
+ {
+- struct ptlrpc_cli_ctx *ctx = key->payload.data;
++ struct ptlrpc_cli_ctx *ctx = key_get_payload(key, 0);
+
+ if (ctx && ctx_unlist_kr(ctx, 0))
+ unbind_key_locked(key);
+@@ -799,9 +836,8 @@ struct ptlrpc_cli_ctx * gss_sec_lookup_ctx_kr(struct ptlrpc_sec *sec,
+ * need wirtelock of key->sem to serialize them. */
+ down_write(&key->sem);
+
+- if (likely(key->payload.data != NULL)) {
+- ctx = key->payload.data;
+-
++ ctx = key_get_payload(key, 0);
++ if (likely(ctx)) {
+ LASSERT(atomic_read(&ctx->cc_refcount) >= 1);
+ LASSERT(ctx2gctx_keyring(ctx)->gck_key == key);
+ LASSERT(atomic_read(&key->usage) >= 2);
+@@ -1167,7 +1203,7 @@ int sec_install_rctx_kr(struct ptlrpc_sec *sec,
+
+ down_write(&key->sem);
+
+- LASSERT(key->payload.data == NULL);
++ LASSERT(!key_get_payload(key, 0));
+
+ cli_ctx = ctx_create_kr(sec, &vcred);
+ if (cli_ctx == NULL) {
+@@ -1251,7 +1287,7 @@ int gss_kt_instantiate(struct key *key, const void *data, size_t datalen)
+ RETURN(-EINVAL);
+ }
+
+- if (key->payload.data != NULL) {
++ if (key_get_payload(key, 0)) {
+ CERROR("key already have payload\n");
+ RETURN(-EINVAL);
+ }
+@@ -1278,7 +1314,8 @@ int gss_kt_instantiate(struct key *key, const void *data, size_t datalen)
+ RETURN(rc);
+ }
+
+- CDEBUG(D_SEC, "key %p instantiated, ctx %p\n", key, key->payload.data);
++ CDEBUG(D_SEC, "key %p instantiated, ctx %p\n", key,
++ key_get_payload(key, 0));
+ RETURN(0);
+ }
+
+@@ -1297,7 +1334,7 @@ int gss_kt_update(struct key *key, const void *data, size_t datalen)
+ {
+ __u32 datalen32 = (__u32) datalen;
+ #endif
+- struct ptlrpc_cli_ctx *ctx = key->payload.data;
++ struct ptlrpc_cli_ctx *ctx = key_get_payload(key, 0);
+ struct gss_cli_ctx *gctx;
+ rawobj_t tmpobj = RAWOBJ_EMPTY;
+ int rc;
+@@ -1442,7 +1479,7 @@ static
+ void gss_kt_destroy(struct key *key)
+ {
+ ENTRY;
+- LASSERT(key->payload.data == NULL);
++ LASSERT(!key_get_payload(key, 0));
+ CDEBUG(D_SEC, "destroy key %p\n", key);
+ EXIT;
+ }
+--
+2.8.2
+
--git a/sys-cluster/lustre/files/0006-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch b/sys-cluster/lustre/files/0006-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch
new file mode 100644
index 0000000..3c725cc
--- /dev/null
+++ b/sys-cluster/lustre/files/0006-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch
@@ -0,0 +1,106 @@
+From 2d1eb63fe95584ae964e854479cabbe3f21783be Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyang.li@anu.edu.au>
+Date: Fri, 1 Apr 2016 20:26:46 -0400
+Subject: [PATCH 06/19] LU-6215 o2iblnd: rdma_create_id() takes extra parameter
+
+4.4 kernel added network namespace parameter to rdma_create_id().
+This patch handles the API change.
+
+Linux-commit: fa20105e09e97e81aadf02f722c31195e4a75c84
+
+Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
+Change-Id: I3f3792e70e91ac3b3d9fefdd58cc9e7e4d1c25c6
+Reviewed-on: http://review.whamcloud.com/18759
+Reviewed-by: James Simmons <uja.ornl@yahoo.com>
+Tested-by: Jenkins
+Tested-by: Maloo <hpdd-maloo@intel.com>
+Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
+Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+---
+ lnet/autoconf/lustre-lnet.m4 | 44 ++++++++++++++++++++++++++++++++++++++++++++
+ lnet/klnds/o2iblnd/o2iblnd.h | 13 ++++++++++---
+ 2 files changed, 54 insertions(+), 3 deletions(-)
+
+diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4
+index 842873d..f7eb217 100644
+--- a/lnet/autoconf/lustre-lnet.m4
++++ b/lnet/autoconf/lustre-lnet.m4
+@@ -379,6 +379,50 @@ AS_IF([test $ENABLEO2IB != "no"], [
+ [struct ib_cq_init_attr is used by ib_create_cq])
+ ])
+ ])
++
++# 4.3 removed ib_alloc_fast_reg_mr()
++AS_IF([test $ENABLEO2IB != "no"], [
++ LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
++ ib_alloc_fast_reg_mr, [
++ #ifdef HAVE_COMPAT_RDMA
++ #undef PACKAGE_NAME
++ #undef PACKAGE_TARNAME
++ #undef PACKAGE_VERSION
++ #undef PACKAGE_STRING
++ #undef PACKAGE_BUGREPORT
++ #undef PACKAGE_URL
++ #include <linux/compat-2.6.h>
++ #endif
++ #include <rdma/ib_verbs.h>
++ ],[
++ ib_alloc_fast_reg_mr(NULL, 0);
++ ],[
++ AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
++ [ib_alloc_fast_reg_mr is defined])
++ ])
++])
++
++# 4.4 added network namespace parameter for rdma_create_id()
++AS_IF([test $ENABLEO2IB != "no"], [
++ LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
++ rdma_create_id_5args, [
++ #ifdef HAVE_COMPAT_RDMA
++ #undef PACKAGE_NAME
++ #undef PACKAGE_TARNAME
++ #undef PACKAGE_VERSION
++ #undef PACKAGE_STRING
++ #undef PACKAGE_BUGREPORT
++ #undef PACKAGE_URL
++ #include <linux/compat-2.6.h>
++ #endif
++ #include <rdma/rdma_cm.h>
++ ],[
++ rdma_create_id(NULL, NULL, NULL, 0, 0);
++ ],[
++ AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
++ [rdma_create_id wants 5 args])
++ ])
++])
+ ]) # LN_CONFIG_O2IB
+
+ #
+diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h
+index b3d9332..e69cd9f 100644
+--- a/lnet/klnds/o2iblnd/o2iblnd.h
++++ b/lnet/klnds/o2iblnd/o2iblnd.h
+@@ -138,10 +138,17 @@ extern kib_tunables_t kiblnd_tunables;
+ IBLND_CREDIT_HIGHWATER_V1 : \
+ *kiblnd_tunables.kib_peercredits_hiw) /* when eagerly to return credits */
+
+-#ifdef HAVE_RDMA_CREATE_ID_4ARG
+-#define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps, qpt)
++#ifdef HAVE_RDMA_CREATE_ID_5ARG
++# define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(current->nsproxy->net_ns, \
++ cb, dev, \
++ ps, qpt)
+ #else
+-#define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps)
++# ifdef HAVE_RDMA_CREATE_ID_4ARG
++# define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, \
++ ps, qpt)
++# else
++# define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps)
++# endif
+ #endif
+
+ static inline int
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0007-LU-6215-lnet-split-struct-ib_send_wr.patch b/sys-cluster/lustre/files/0007-LU-6215-lnet-split-struct-ib_send_wr.patch
new file mode 100644
index 0000000..1520983
--- /dev/null
+++ b/sys-cluster/lustre/files/0007-LU-6215-lnet-split-struct-ib_send_wr.patch
@@ -0,0 +1,451 @@
+From 6c4eae3aaac92d6d9ef35806fc7badb272702136 Mon Sep 17 00:00:00 2001
+From: Dmitry Eremin <dmitry.eremin@intel.com>
+Date: Tue, 17 May 2016 09:22:15 -0400
+Subject: [PATCH 07/19] LU-6215 lnet: split struct ib_send_wr
+
+In v4.4 Linux kernel split up struct ib_send_wr so that all non-trivial
+verbs use their own structure which embeds struct ib_send_wr.
+
+Linux-commit: e622f2f4ad2142d2a613a57fb85f8cf737935ef5
+Change-Id: Iea2599ea57a576a4c061841be47a989aba097cc6
+Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
+Reviewed-on: http://review.whamcloud.com/19168
+Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
+Reviewed-by: James Simmons <uja.ornl@yahoo.com>
+Reviewed-by: Li Dongyang <dongyang.li@anu.edu.au>
+Tested-by: Jenkins
+Tested-by: Maloo <hpdd-maloo@intel.com>
+Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+---
+ lnet/autoconf/lustre-lnet.m4 | 84 ++++++++++++++++++--------
+ lnet/klnds/o2iblnd/o2iblnd.c | 127 +++++++++++++++++++++++++++++++++++++---
+ lnet/klnds/o2iblnd/o2iblnd.h | 21 ++++++-
+ lnet/klnds/o2iblnd/o2iblnd_cb.c | 71 ++++++++++++++--------
+ 4 files changed, 246 insertions(+), 57 deletions(-)
+
+diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4
+index f7eb217..2e2adb2 100644
+--- a/lnet/autoconf/lustre-lnet.m4
++++ b/lnet/autoconf/lustre-lnet.m4
+@@ -329,8 +329,8 @@ AC_SUBST(O2IBLND)
+ AC_SUBST(O2IBPATH)
+ AC_SUBST(ENABLEO2IB)
+
+-# In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
+ AS_IF([test $ENABLEO2IB != "no"], [
++ # In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
+ LB_CHECK_COMPILE([if 'rdma_create_id' wants four args],
+ rdma_create_id_4args, [
+ #ifdef HAVE_COMPAT_RDMA
+@@ -349,15 +349,32 @@ AS_IF([test $ENABLEO2IB != "no"], [
+ AC_DEFINE(HAVE_RDMA_CREATE_ID_4ARG, 1,
+ [rdma_create_id wants 4 args])
+ ])
+-])
+-#
+-# 4.2 introduced struct ib_cq_init_attr which is used
+-# by ib_create_cq(). Note some OFED stacks only keep
+-# their headers in sync with latest kernels but not
+-# the functionality which means for infiniband testing
+-# we need to always test functionality testings.
+-#
+-AS_IF([test $ENABLEO2IB != "no"], [
++
++ # 4.4 added network namespace parameter for rdma_create_id()
++ LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
++ rdma_create_id_5args, [
++ #ifdef HAVE_COMPAT_RDMA
++ #undef PACKAGE_NAME
++ #undef PACKAGE_TARNAME
++ #undef PACKAGE_VERSION
++ #undef PACKAGE_STRING
++ #undef PACKAGE_BUGREPORT
++ #undef PACKAGE_URL
++ #include <linux/compat-2.6.h>
++ #endif
++ #include <rdma/rdma_cm.h>
++ ],[
++ rdma_create_id(NULL, NULL, NULL, 0, 0);
++ ],[
++ AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
++ [rdma_create_id wants 5 args])
++ ])
++
++ # 4.2 introduced struct ib_cq_init_attr which is used
++ # by ib_create_cq(). Note some OFED stacks only keep
++ # their headers in sync with latest kernels but not
++ # the functionality which means for infiniband testing
++ # we need to always test functionality testings.
+ LB_CHECK_COMPILE([if 'struct ib_cq_init_attr' is used],
+ ib_cq_init_attr, [
+ #ifdef HAVE_COMPAT_RDMA
+@@ -378,10 +395,8 @@ AS_IF([test $ENABLEO2IB != "no"], [
+ AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
+ [struct ib_cq_init_attr is used by ib_create_cq])
+ ])
+-])
+
+-# 4.3 removed ib_alloc_fast_reg_mr()
+-AS_IF([test $ENABLEO2IB != "no"], [
++ # 4.3 removed ib_alloc_fast_reg_mr()
+ LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
+ ib_alloc_fast_reg_mr, [
+ #ifdef HAVE_COMPAT_RDMA
+@@ -400,12 +415,13 @@ AS_IF([test $ENABLEO2IB != "no"], [
+ AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
+ [ib_alloc_fast_reg_mr is defined])
+ ])
+-])
+
+-# 4.4 added network namespace parameter for rdma_create_id()
+-AS_IF([test $ENABLEO2IB != "no"], [
+- LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
+- rdma_create_id_5args, [
++ # In v4.4 Linux kernel,
++ # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
++ # split up struct ib_send_wr so that all non-trivial verbs
++ # use their own structure which embedds struct ib_send_wr.
++ LB_CHECK_COMPILE([if 'struct ib_rdma_wr' is defined],
++ ib_rdma_wr, [
+ #ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+@@ -415,14 +431,36 @@ AS_IF([test $ENABLEO2IB != "no"], [
+ #undef PACKAGE_URL
+ #include <linux/compat-2.6.h>
+ #endif
+- #include <rdma/rdma_cm.h>
++ #include <rdma/ib_verbs.h>
+ ],[
+- rdma_create_id(NULL, NULL, NULL, 0, 0);
++ struct ib_rdma_wr *wr __attribute__ ((unused));
++
++ wr = rdma_wr(NULL);
+ ],[
+- AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
+- [rdma_create_id wants 5 args])
++ AC_DEFINE(HAVE_IB_RDMA_WR, 1,
++ [struct ib_rdma_wr is defined])
+ ])
+-])
++
++ # new fast registration API introduced in 4.4
++ LB_CHECK_COMPILE([if 'ib_map_mr_sg' exists],
++ ib_map_mr_sg, [
++ #ifdef HAVE_COMPAT_RDMA
++ #undef PACKAGE_NAME
++ #undef PACKAGE_TARNAME
++ #undef PACKAGE_VERSION
++ #undef PACKAGE_STRING
++ #undef PACKAGE_BUGREPORT
++ #undef PACKAGE_URL
++ #include <linux/compat-2.6.h>
++ #endif
++ #include <rdma/ib_verbs.h>
++ ],[
++ ib_map_mr_sg(NULL, NULL, 0, 0);
++ ],[
++ AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
++ [ib_map_mr_sg exists])
++ ])
++]) # ENABLEO2IB != "no"
+ ]) # LN_CONFIG_O2IB
+
+ #
+diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c
+index d9761ee..00c4ce2 100644
+--- a/lnet/klnds/o2iblnd/o2iblnd.c
++++ b/lnet/klnds/o2iblnd/o2iblnd.c
+@@ -1592,13 +1592,126 @@ again:
+ fpo->fpo_map_count++;
+ spin_unlock(&fps->fps_lock);
+
+- pfmr = ib_fmr_pool_map_phys(fpo->fpo_fmr_pool,
+- pages, npages, iov);
+- if (likely(!IS_ERR(pfmr))) {
+- fmr->fmr_pool = fpo;
+- fmr->fmr_pfmr = pfmr;
+- return 0;
+- }
++ if (fpo->fpo_is_fmr) {
++ struct ib_pool_fmr *pfmr;
++
++ spin_unlock(&fps->fps_lock);
++
++ if (!tx_pages_mapped) {
++ npages = kiblnd_map_tx_pages(tx, rd);
++ tx_pages_mapped = 1;
++ }
++
++ pfmr = ib_fmr_pool_map_phys(fpo->fmr.fpo_fmr_pool,
++ pages, npages, iov);
++ if (likely(!IS_ERR(pfmr))) {
++ fmr->fmr_key = is_rx ? pfmr->fmr->rkey
++ : pfmr->fmr->lkey;
++ fmr->fmr_frd = NULL;
++ fmr->fmr_pfmr = pfmr;
++ fmr->fmr_pool = fpo;
++ return 0;
++ }
++ rc = PTR_ERR(pfmr);
++ } else {
++ if (!list_empty(&fpo->fast_reg.fpo_pool_list)) {
++ struct kib_fast_reg_descriptor *frd;
++#ifdef HAVE_IB_MAP_MR_SG
++ struct ib_reg_wr *wr;
++ int n;
++#else
++ struct ib_rdma_wr *wr;
++ struct ib_fast_reg_page_list *frpl;
++#endif
++ struct ib_mr *mr;
++
++ frd = list_first_entry(&fpo->fast_reg.fpo_pool_list,
++ struct kib_fast_reg_descriptor,
++ frd_list);
++ list_del(&frd->frd_list);
++ spin_unlock(&fps->fps_lock);
++
++#ifndef HAVE_IB_MAP_MR_SG
++ frpl = frd->frd_frpl;
++#endif
++ mr = frd->frd_mr;
++
++ if (!frd->frd_valid) {
++ struct ib_rdma_wr *inv_wr;
++ __u32 key = is_rx ? mr->rkey : mr->lkey;
++
++ inv_wr = &frd->frd_inv_wr;
++ memset(inv_wr, 0, sizeof(*inv_wr));
++
++ inv_wr->wr.opcode = IB_WR_LOCAL_INV;
++ inv_wr->wr.wr_id = IBLND_WID_MR;
++ inv_wr->wr.ex.invalidate_rkey = key;
++
++ /* Bump the key */
++ key = ib_inc_rkey(key);
++ ib_update_fast_reg_key(mr, key);
++ }
++
++#ifdef HAVE_IB_MAP_MR_SG
++ n = ib_map_mr_sg(mr, tx->tx_frags,
++ tx->tx_nfrags, PAGE_SIZE);
++ if (unlikely(n != tx->tx_nfrags)) {
++ CERROR("Failed to map mr %d/%d "
++ "elements\n", n, tx->tx_nfrags);
++ return n < 0 ? n : -EINVAL;
++ }
++
++ mr->iova = iov;
++
++ wr = &frd->frd_fastreg_wr;
++ memset(wr, 0, sizeof(*wr));
++
++ wr->wr.opcode = IB_WR_REG_MR;
++ wr->wr.wr_id = IBLND_WID_MR;
++ wr->wr.num_sge = 0;
++ wr->wr.send_flags = 0;
++ wr->mr = mr;
++ wr->key = is_rx ? mr->rkey : mr->lkey;
++ wr->access = (IB_ACCESS_LOCAL_WRITE |
++ IB_ACCESS_REMOTE_WRITE);
++#else
++ if (!tx_pages_mapped) {
++ npages = kiblnd_map_tx_pages(tx, rd);
++ tx_pages_mapped = 1;
++ }
++
++ LASSERT(npages <= frpl->max_page_list_len);
++ memcpy(frpl->page_list, pages,
++ sizeof(*pages) * npages);
++
++ /* Prepare FastReg WR */
++ wr = &frd->frd_fastreg_wr;
++ memset(wr, 0, sizeof(*wr));
++
++ wr->wr.opcode = IB_WR_FAST_REG_MR;
++ wr->wr.wr_id = IBLND_WID_MR;
++
++ wr->wr.wr.fast_reg.iova_start = iov;
++ wr->wr.wr.fast_reg.page_list = frpl;
++ wr->wr.wr.fast_reg.page_list_len = npages;
++ wr->wr.wr.fast_reg.page_shift = PAGE_SHIFT;
++ wr->wr.wr.fast_reg.length = nob;
++ wr->wr.wr.fast_reg.rkey =
++ is_rx ? mr->rkey : mr->lkey;
++ wr->wr.wr.fast_reg.access_flags =
++ (IB_ACCESS_LOCAL_WRITE |
++ IB_ACCESS_REMOTE_WRITE);
++#endif
++
++ fmr->fmr_key = is_rx ? mr->rkey : mr->lkey;
++ fmr->fmr_frd = frd;
++ fmr->fmr_pfmr = NULL;
++ fmr->fmr_pool = fpo;
++ return 0;
++ }
++ spin_unlock(&fps->fps_lock);
++ rc = -EBUSY;
++ }
+
+ spin_lock(&fps->fps_lock);
+ fpo->fpo_map_count--;
+diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h
+index e69cd9f..3baa255 100644
+--- a/lnet/klnds/o2iblnd/o2iblnd.h
++++ b/lnet/klnds/o2iblnd/o2iblnd.h
+@@ -344,6 +344,25 @@ typedef struct
+ cfs_time_t fps_next_retry;
+ } kib_fmr_poolset_t;
+
++#ifndef HAVE_IB_RDMA_WR
++struct ib_rdma_wr {
++ struct ib_send_wr wr;
++};
++#endif
++
++struct kib_fast_reg_descriptor { /* For fast registration */
++ struct list_head frd_list;
++ struct ib_rdma_wr frd_inv_wr;
++#ifdef HAVE_IB_MAP_MR_SG
++ struct ib_reg_wr frd_fastreg_wr;
++#else
++ struct ib_rdma_wr frd_fastreg_wr;
++ struct ib_fast_reg_page_list *frd_frpl;
++#endif
++ struct ib_mr *frd_mr;
++ bool frd_valid;
++};
++
+ typedef struct
+ {
+ struct list_head fpo_list; /* chain on pool list */
+@@ -620,7 +639,7 @@ typedef struct kib_tx /* transmit message */
+ /* # send work items */
+ int tx_nwrq;
+ /* send work items... */
+- struct ib_send_wr *tx_wrq;
++ struct ib_rdma_wr *tx_wrq;
+ /* ...and their memory */
+ struct ib_sge *tx_sge;
+ /* rdma descriptor */
+diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c
+index 6887c07..d25e45a 100644
+--- a/lnet/klnds/o2iblnd/o2iblnd_cb.c
++++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c
+@@ -847,14 +847,27 @@ __must_hold(&conn->ibc_lock)
+ /* close_conn will launch failover */
+ rc = -ENETDOWN;
+ } else {
+- struct ib_send_wr *wrq = &tx->tx_wrq[tx->tx_nwrq - 1];
++ struct kib_fast_reg_descriptor *frd = tx->fmr.fmr_frd;
++ struct ib_send_wr *bad = &tx->tx_wrq[tx->tx_nwrq - 1].wr;
++ struct ib_send_wr *wr = &tx->tx_wrq[0].wr;
++
++ if (frd != NULL) {
++ if (!frd->frd_valid) {
++ wr = &frd->frd_inv_wr.wr;
++ wr->next = &frd->frd_fastreg_wr.wr;
++ } else {
++ wr = &frd->frd_fastreg_wr.wr;
++ }
++ frd->frd_fastreg_wr.wr.next = &tx->tx_wrq[0].wr;
++ }
+
+ LASSERTF(wrq->wr_id == kiblnd_ptr2wreqid(tx, IBLND_WID_TX),
+ "bad wr_id "LPX64", opc %d, flags %d, peer: %s\n",
+ wrq->wr_id, wrq->opcode, wrq->send_flags,
+ libcfs_nid2str(conn->ibc_peer->ibp_nid));
+- wrq = NULL;
+- rc = ib_post_send(conn->ibc_cmid->qp, tx->tx_wrq, &wrq);
++
++ bad = NULL;
++ rc = ib_post_send(conn->ibc_cmid->qp, wr, &bad);
+ }
+
+ conn->ibc_last_send = jiffies;
+@@ -1023,11 +1036,11 @@ kiblnd_tx_complete (kib_tx_t *tx, int status)
+ static void
+ kiblnd_init_tx_msg (lnet_ni_t *ni, kib_tx_t *tx, int type, int body_nob)
+ {
+- kib_hca_dev_t *hdev = tx->tx_pool->tpo_hdev;
+- struct ib_sge *sge = &tx->tx_sge[tx->tx_nwrq];
+- struct ib_send_wr *wrq = &tx->tx_wrq[tx->tx_nwrq];
+- int nob = offsetof (kib_msg_t, ibm_u) + body_nob;
+- struct ib_mr *mr = hdev->ibh_mrs;
++ kib_hca_dev_t *hdev = tx->tx_pool->tpo_hdev;
++ struct ib_sge *sge = &tx->tx_sge[tx->tx_nwrq];
++ struct ib_rdma_wr *wrq;
++ int nob = offsetof(kib_msg_t, ibm_u) + body_nob;
++ struct ib_mr *mr = hdev->ibh_mrs;
+
+ LASSERT(tx->tx_nwrq >= 0);
+ LASSERT(tx->tx_nwrq < IBLND_MAX_RDMA_FRAGS + 1);
+@@ -1040,16 +1053,17 @@ kiblnd_init_tx_msg (lnet_ni_t *ni, kib_tx_t *tx, int type, int body_nob)
+ sge->addr = tx->tx_msgaddr;
+ sge->length = nob;
+
+- memset(wrq, 0, sizeof(*wrq));
++ wrq = &tx->tx_wrq[tx->tx_nwrq];
++ memset(wrq, 0, sizeof(*wrq));
+
+- wrq->next = NULL;
+- wrq->wr_id = kiblnd_ptr2wreqid(tx, IBLND_WID_TX);
+- wrq->sg_list = sge;
+- wrq->num_sge = 1;
+- wrq->opcode = IB_WR_SEND;
+- wrq->send_flags = IB_SEND_SIGNALED;
++ wrq->wr.next = NULL;
++ wrq->wr.wr_id = kiblnd_ptr2wreqid(tx, IBLND_WID_TX);
++ wrq->wr.sg_list = sge;
++ wrq->wr.num_sge = 1;
++ wrq->wr.opcode = IB_WR_SEND;
++ wrq->wr.send_flags = IB_SEND_SIGNALED;
+
+- tx->tx_nwrq++;
++ tx->tx_nwrq++;
+ }
+
+ static int
+@@ -1059,7 +1073,7 @@ kiblnd_init_rdma(kib_conn_t *conn, kib_tx_t *tx, int type,
+ kib_msg_t *ibmsg = tx->tx_msg;
+ kib_rdma_desc_t *srcrd = tx->tx_rd;
+ struct ib_sge *sge = &tx->tx_sge[0];
+- struct ib_send_wr *wrq = &tx->tx_wrq[0];
++ struct ib_rdma_wr *wrq;
+ int rc = resid;
+ int srcidx;
+ int dstidx;
+@@ -1106,15 +1120,20 @@ kiblnd_init_rdma(kib_conn_t *conn, kib_tx_t *tx, int type,
+
+ wrq = &tx->tx_wrq[tx->tx_nwrq];
+
+- wrq->next = wrq + 1;
+- wrq->wr_id = kiblnd_ptr2wreqid(tx, IBLND_WID_RDMA);
+- wrq->sg_list = sge;
+- wrq->num_sge = 1;
+- wrq->opcode = IB_WR_RDMA_WRITE;
+- wrq->send_flags = 0;
+-
+- wrq->wr.rdma.remote_addr = kiblnd_rd_frag_addr(dstrd, dstidx);
+- wrq->wr.rdma.rkey = kiblnd_rd_frag_key(dstrd, dstidx);
++ wrq->wr.next = &(wrq + 1)->wr;
++ wrq->wr.wr_id = kiblnd_ptr2wreqid(tx, IBLND_WID_RDMA);
++ wrq->wr.sg_list = sge;
++ wrq->wr.num_sge = 1;
++ wrq->wr.opcode = IB_WR_RDMA_WRITE;
++ wrq->wr.send_flags = 0;
++
++#ifdef HAVE_IB_RDMA_WR
++ wrq->remote_addr = kiblnd_rd_frag_addr(dstrd, dstidx);
++ wrq->rkey = kiblnd_rd_frag_key(dstrd, dstidx);
++#else
++ wrq->wr.wr.rdma.remote_addr = kiblnd_rd_frag_addr(dstrd, dstidx);
++ wrq->wr.wr.rdma.rkey = kiblnd_rd_frag_key(dstrd, dstidx);
++#endif
+
+ srcidx = kiblnd_rd_consume_frag(srcrd, srcidx, wrknob);
+ dstidx = kiblnd_rd_consume_frag(dstrd, dstidx, wrknob);
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0008-LU-6215-o2iblnd-ib_alloc_fast_reg_mr-removed-in-4.3.patch b/sys-cluster/lustre/files/0008-LU-6215-o2iblnd-ib_alloc_fast_reg_mr-removed-in-4.3.patch
new file mode 100644
index 0000000..993f3b9
--- /dev/null
+++ b/sys-cluster/lustre/files/0008-LU-6215-o2iblnd-ib_alloc_fast_reg_mr-removed-in-4.3.patch
@@ -0,0 +1,199 @@
+From 12fe2bd8fb80b71bcbc6526f916e6225c12610ee Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyang.li@anu.edu.au>
+Date: Tue, 29 Mar 2016 14:57:57 +1100
+Subject: [PATCH 08/19] LU-6215 o2iblnd: ib_alloc_fast_reg_mr() removed in 4.3
+
+ib_alloc_fast_reg_mr() is replaced by a more generic
+ib_alloc_mr() since kernel 4.3
+
+Linux-commit: d9f272c523db47a56a64942eb6f25361c400de66
+
+Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
+Change-Id: I53f4e7c395c83d731aaa342f308f878b07b54d61
+Reviewed-on: http://review.whamcloud.com/19185
+Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
+Tested-by: Jenkins
+Tested-by: Maloo <hpdd-maloo@intel.com>
+Reviewed-by: James Simmons <uja.ornl@yahoo.com>
+Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+---
+ lnet/autoconf/lustre-lnet.m4 | 51 ++----------------------
+ lnet/klnds/o2iblnd/o2iblnd.c | 92 +++++++++++++++++++++++++++++++++++++++++++-
+ 2 files changed, 95 insertions(+), 48 deletions(-)
+
+diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4
+index 2e2adb2..a1498aa 100644
+--- a/lnet/autoconf/lustre-lnet.m4
++++ b/lnet/autoconf/lustre-lnet.m4
+@@ -395,8 +395,10 @@ AS_IF([test $ENABLEO2IB != "no"], [
+ AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
+ [struct ib_cq_init_attr is used by ib_create_cq])
+ ])
++])
+
+- # 4.3 removed ib_alloc_fast_reg_mr()
++# 4.3 removed ib_alloc_fast_reg_mr()
++AS_IF([test $ENABLEO2IB != "no"], [
+ LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
+ ib_alloc_fast_reg_mr, [
+ #ifdef HAVE_COMPAT_RDMA
+@@ -415,52 +417,7 @@ AS_IF([test $ENABLEO2IB != "no"], [
+ AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
+ [ib_alloc_fast_reg_mr is defined])
+ ])
+-
+- # In v4.4 Linux kernel,
+- # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
+- # split up struct ib_send_wr so that all non-trivial verbs
+- # use their own structure which embedds struct ib_send_wr.
+- LB_CHECK_COMPILE([if 'struct ib_rdma_wr' is defined],
+- ib_rdma_wr, [
+- #ifdef HAVE_COMPAT_RDMA
+- #undef PACKAGE_NAME
+- #undef PACKAGE_TARNAME
+- #undef PACKAGE_VERSION
+- #undef PACKAGE_STRING
+- #undef PACKAGE_BUGREPORT
+- #undef PACKAGE_URL
+- #include <linux/compat-2.6.h>
+- #endif
+- #include <rdma/ib_verbs.h>
+- ],[
+- struct ib_rdma_wr *wr __attribute__ ((unused));
+-
+- wr = rdma_wr(NULL);
+- ],[
+- AC_DEFINE(HAVE_IB_RDMA_WR, 1,
+- [struct ib_rdma_wr is defined])
+- ])
+-
+- # new fast registration API introduced in 4.4
+- LB_CHECK_COMPILE([if 'ib_map_mr_sg' exists],
+- ib_map_mr_sg, [
+- #ifdef HAVE_COMPAT_RDMA
+- #undef PACKAGE_NAME
+- #undef PACKAGE_TARNAME
+- #undef PACKAGE_VERSION
+- #undef PACKAGE_STRING
+- #undef PACKAGE_BUGREPORT
+- #undef PACKAGE_URL
+- #include <linux/compat-2.6.h>
+- #endif
+- #include <rdma/ib_verbs.h>
+- ],[
+- ib_map_mr_sg(NULL, NULL, 0, 0);
+- ],[
+- AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
+- [ib_map_mr_sg exists])
+- ])
+-]) # ENABLEO2IB != "no"
++])
+ ]) # LN_CONFIG_O2IB
+
+ #
+diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c
+index 00c4ce2..57f51ca 100644
+--- a/lnet/klnds/o2iblnd/o2iblnd.c
++++ b/lnet/klnds/o2iblnd/o2iblnd.c
+@@ -1444,7 +1444,97 @@ kiblnd_create_fmr_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t **pp_fpo)
+ .dirty_watermark = fps->fps_flush_trigger,
+ .flush_function = NULL,
+ .flush_arg = NULL,
+- .cache = !!*kiblnd_tunables.kib_fmr_cache};
++ .cache = !!fps->fps_cache };
++ int rc = 0;
++
++ fpo->fmr.fpo_fmr_pool = ib_create_fmr_pool(fpo->fpo_hdev->ibh_pd,
++ ¶m);
++ if (IS_ERR(fpo->fmr.fpo_fmr_pool)) {
++ rc = PTR_ERR(fpo->fmr.fpo_fmr_pool);
++ if (rc != -ENOSYS)
++ CERROR("Failed to create FMR pool: %d\n", rc);
++ else
++ CERROR("FMRs are not supported\n");
++ }
++
++ return rc;
++}
++
++static int kiblnd_alloc_freg_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t *fpo)
++{
++ struct kib_fast_reg_descriptor *frd, *tmp;
++ int i, rc;
++
++ INIT_LIST_HEAD(&fpo->fast_reg.fpo_pool_list);
++ fpo->fast_reg.fpo_pool_size = 0;
++ for (i = 0; i < fps->fps_pool_size; i++) {
++ LIBCFS_CPT_ALLOC(frd, lnet_cpt_table(), fps->fps_cpt,
++ sizeof(*frd));
++ if (!frd) {
++ CERROR("Failed to allocate a new fast_reg descriptor\n");
++ rc = -ENOMEM;
++ goto out;
++ }
++ frd->frd_mr = NULL;
++
++ frd->frd_frpl = ib_alloc_fast_reg_page_list(fpo->fpo_hdev->ibh_ibdev,
++ LNET_MAX_PAYLOAD/PAGE_SIZE);
++ if (IS_ERR(frd->frd_frpl)) {
++ rc = PTR_ERR(frd->frd_frpl);
++ CERROR("Failed to allocate ib_fast_reg_page_list: %d\n",
++ rc);
++ frd->frd_frpl = NULL;
++ goto out_middle;
++ }
++
++#ifdef HAVE_IB_ALLOC_FAST_REG_MR
++ frd->frd_mr = ib_alloc_fast_reg_mr(fpo->fpo_hdev->ibh_pd,
++ LNET_MAX_PAYLOAD/PAGE_SIZE);
++#else
++ frd->frd_mr = ib_alloc_mr(fpo->fpo_hdev->ibh_pd,
++ IB_MR_TYPE_MEM_REG,
++ LNET_MAX_PAYLOAD/PAGE_SIZE);
++#endif
++ if (IS_ERR(frd->frd_mr)) {
++ rc = PTR_ERR(frd->frd_mr);
++ CERROR("Failed to allocate ib_fast_reg_mr: %d\n", rc);
++ frd->frd_mr = NULL;
++ goto out_middle;
++ }
++
++ frd->frd_valid = true;
++
++ list_add_tail(&frd->frd_list, &fpo->fast_reg.fpo_pool_list);
++ fpo->fast_reg.fpo_pool_size++;
++ }
++
++ return 0;
++
++out_middle:
++ if (frd->frd_mr)
++ ib_dereg_mr(frd->frd_mr);
++ if (frd->frd_frpl)
++ ib_free_fast_reg_page_list(frd->frd_frpl);
++ LIBCFS_FREE(frd, sizeof(*frd));
++
++out:
++ list_for_each_entry_safe(frd, tmp, &fpo->fast_reg.fpo_pool_list,
++ frd_list) {
++ list_del(&frd->frd_list);
++ ib_free_fast_reg_page_list(frd->frd_frpl);
++ ib_dereg_mr(frd->frd_mr);
++ LIBCFS_FREE(frd, sizeof(*frd));
++ }
++
++ return rc;
++}
++
++static int
++kiblnd_create_fmr_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t **pp_fpo)
++{
++ struct ib_device_attr *dev_attr;
++ kib_dev_t *dev = fps->fps_net->ibn_dev;
++ kib_fmr_pool_t *fpo;
+ int rc;
+
+ LIBCFS_CPT_ALLOC(fpo, lnet_cpt_table(), fps->fps_cpt, sizeof(*fpo));
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0009-LU-6215-o2iblnd-port-to-new-fast-reg-API-introduced-.patch b/sys-cluster/lustre/files/0009-LU-6215-o2iblnd-port-to-new-fast-reg-API-introduced-.patch
new file mode 100644
index 0000000..b2df9e8
--- /dev/null
+++ b/sys-cluster/lustre/files/0009-LU-6215-o2iblnd-port-to-new-fast-reg-API-introduced-.patch
@@ -0,0 +1,332 @@
+From f1b1ef4f8af7751e1fc73b8f4ad2363b48159fa9 Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyang.li@anu.edu.au>
+Date: Wed, 4 May 2016 13:11:15 -0400
+Subject: [PATCH 09/19] LU-6215 o2iblnd: port to new fast reg API introduced in
+ 4.4
+
+Remove the allocation of fastreg page list, as the page
+vector is now private to the provider. Just pass tx_frags
+to ib_map_mr_sg() and construct ib_reg_wr.
+Defer the conversion of tx_frags to tx_pages and only do
+it when the new API is not available.
+
+Linux-commit: 4c67e2bfc8b7121d51434362fa7c2d012f8bcf1b
+Linux-commit: 39bfc271bd687be2c8e396e976c0fb9a97963400
+
+Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
+Change-Id: I5c62b0370ad6ddcc93102a29343491968e4446d0
+Reviewed-on: http://review.whamcloud.com/19186
+Tested-by: Jenkins
+Reviewed-by: James Simmons <uja.ornl@yahoo.com>
+Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
+Tested-by: Maloo <hpdd-maloo@intel.com>
+Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+---
+ lnet/autoconf/lustre-lnet.m4 | 44 +++++++++++++++++++++++++
+ lnet/klnds/o2iblnd/o2iblnd.c | 71 ++++++++++++++++++++++++++++++++++-------
+ lnet/klnds/o2iblnd/o2iblnd.h | 11 ++++---
+ lnet/klnds/o2iblnd/o2iblnd_cb.c | 39 ++++++++++------------
+ 4 files changed, 127 insertions(+), 38 deletions(-)
+
+diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4
+index a1498aa..5f90bca 100644
+--- a/lnet/autoconf/lustre-lnet.m4
++++ b/lnet/autoconf/lustre-lnet.m4
+@@ -418,6 +418,50 @@ AS_IF([test $ENABLEO2IB != "no"], [
+ [ib_alloc_fast_reg_mr is defined])
+ ])
+ ])
++
++# 4.4 added network namespace parameter for rdma_create_id()
++AS_IF([test $ENABLEO2IB != "no"], [
++ LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
++ rdma_create_id_5args, [
++ #ifdef HAVE_COMPAT_RDMA
++ #undef PACKAGE_NAME
++ #undef PACKAGE_TARNAME
++ #undef PACKAGE_VERSION
++ #undef PACKAGE_STRING
++ #undef PACKAGE_BUGREPORT
++ #undef PACKAGE_URL
++ #include <linux/compat-2.6.h>
++ #endif
++ #include <rdma/rdma_cm.h>
++ ],[
++ rdma_create_id(NULL, NULL, NULL, 0, 0);
++ ],[
++ AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
++ [rdma_create_id wants 5 args])
++ ])
++])
++
++# new fast registration API introduced in 4.4
++AS_IF([test $ENABLEO2IB != "no"], [
++ LB_CHECK_COMPILE([if 'ib_map_mr_sg' exists],
++ ib_map_mr_sg, [
++ #ifdef HAVE_COMPAT_RDMA
++ #undef PACKAGE_NAME
++ #undef PACKAGE_TARNAME
++ #undef PACKAGE_VERSION
++ #undef PACKAGE_STRING
++ #undef PACKAGE_BUGREPORT
++ #undef PACKAGE_URL
++ #include <linux/compat-2.6.h>
++ #endif
++ #include <rdma/ib_verbs.h>
++ ],[
++ ib_map_mr_sg(NULL, NULL, 0, 0);
++ ],[
++ AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
++ [ib_map_mr_sg exists])
++ ])
++])
+ ]) # LN_CONFIG_O2IB
+
+ #
+diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c
+index 57f51ca..1262268 100644
+--- a/lnet/klnds/o2iblnd/o2iblnd.c
++++ b/lnet/klnds/o2iblnd/o2iblnd.c
+@@ -1394,8 +1394,27 @@ kiblnd_destroy_fmr_pool(kib_fmr_pool_t *pool)
+ {
+ LASSERT (pool->fpo_map_count == 0);
+
+- if (pool->fpo_fmr_pool != NULL)
+- ib_destroy_fmr_pool(pool->fpo_fmr_pool);
++ if (fpo->fpo_is_fmr) {
++ if (fpo->fmr.fpo_fmr_pool)
++ ib_destroy_fmr_pool(fpo->fmr.fpo_fmr_pool);
++ } else {
++ struct kib_fast_reg_descriptor *frd, *tmp;
++ int i = 0;
++
++ list_for_each_entry_safe(frd, tmp, &fpo->fast_reg.fpo_pool_list,
++ frd_list) {
++ list_del(&frd->frd_list);
++#ifndef HAVE_IB_MAP_MR_SG
++ ib_free_fast_reg_page_list(frd->frd_frpl);
++#endif
++ ib_dereg_mr(frd->frd_mr);
++ LIBCFS_FREE(frd, sizeof(*frd));
++ i++;
++ }
++ if (i < fpo->fast_reg.fpo_pool_size)
++ CERROR("FastReg pool still has %d regions registered\n",
++ fpo->fast_reg.fpo_pool_size - i);
++ }
+
+ if (pool->fpo_hdev != NULL)
+ kiblnd_hdev_decref(pool->fpo_hdev);
+@@ -1477,6 +1496,7 @@ static int kiblnd_alloc_freg_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t *fpo)
+ }
+ frd->frd_mr = NULL;
+
++#ifndef HAVE_IB_MAP_MR_SG
+ frd->frd_frpl = ib_alloc_fast_reg_page_list(fpo->fpo_hdev->ibh_ibdev,
+ LNET_MAX_PAYLOAD/PAGE_SIZE);
+ if (IS_ERR(frd->frd_frpl)) {
+@@ -1486,6 +1506,7 @@ static int kiblnd_alloc_freg_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t *fpo)
+ frd->frd_frpl = NULL;
+ goto out_middle;
+ }
++#endif
+
+ #ifdef HAVE_IB_ALLOC_FAST_REG_MR
+ frd->frd_mr = ib_alloc_fast_reg_mr(fpo->fpo_hdev->ibh_pd,
+@@ -1513,15 +1534,19 @@ static int kiblnd_alloc_freg_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t *fpo)
+ out_middle:
+ if (frd->frd_mr)
+ ib_dereg_mr(frd->frd_mr);
++#ifndef HAVE_IB_MAP_MR_SG
+ if (frd->frd_frpl)
+ ib_free_fast_reg_page_list(frd->frd_frpl);
++#endif
+ LIBCFS_FREE(frd, sizeof(*frd));
+
+ out:
+ list_for_each_entry_safe(frd, tmp, &fpo->fast_reg.fpo_pool_list,
+ frd_list) {
+ list_del(&frd->frd_list);
++#ifndef HAVE_IB_MAP_MR_SG
+ ib_free_fast_reg_page_list(frd->frd_frpl);
++#endif
+ ib_dereg_mr(frd->frd_mr);
+ LIBCFS_FREE(frd, sizeof(*frd));
+ }
+@@ -1625,6 +1650,28 @@ kiblnd_fmr_pool_is_idle(kib_fmr_pool_t *fpo, cfs_time_t now)
+ return cfs_time_aftereq(now, fpo->fpo_deadline);
+ }
+
++static int
++kiblnd_map_tx_pages(kib_tx_t *tx, kib_rdma_desc_t *rd)
++{
++ kib_hca_dev_t *hdev;
++ __u64 *pages = tx->tx_pages;
++ int npages;
++ int size;
++ int i;
++
++ hdev = tx->tx_pool->tpo_hdev;
++
++ for (i = 0, npages = 0; i < rd->rd_nfrags; i++) {
++ for (size = 0; size < rd->rd_frags[i].rf_nob;
++ size += hdev->ibh_page_size) {
++ pages[npages++] = (rd->rd_frags[i].rf_addr &
++ hdev->ibh_page_mask) + size;
++ }
++ }
++
++ return npages;
++}
++
+ void
+ kiblnd_fmr_pool_unmap(kib_fmr_t *fmr, int status)
+ {
+@@ -1666,13 +1713,16 @@ kiblnd_fmr_pool_unmap(kib_fmr_t *fmr, int status)
+ }
+
+ int
+-kiblnd_fmr_pool_map(kib_fmr_poolset_t *fps, __u64 *pages, int npages,
+- __u64 iov, kib_fmr_t *fmr)
++kiblnd_fmr_pool_map(kib_fmr_poolset_t *fps, kib_tx_t *tx, kib_rdma_desc_t *rd,
++ __u32 nob, __u64 iov, kib_fmr_t *fmr)
+ {
+- struct ib_pool_fmr *pfmr;
+- kib_fmr_pool_t *fpo;
+- __u64 version;
+- int rc;
++ kib_fmr_pool_t *fpo;
++ __u64 *pages = tx->tx_pages;
++ __u64 version;
++ bool is_rx = (rd != tx->tx_rd);
++ bool tx_pages_mapped = 0;
++ int npages = 0;
++ int rc;
+
+ again:
+ spin_lock(&fps->fps_lock);
+@@ -1710,7 +1760,7 @@ again:
+ struct ib_reg_wr *wr;
+ int n;
+ #else
+- struct ib_rdma_wr *wr;
++ struct ib_send_wr *wr;
+ struct ib_fast_reg_page_list *frpl;
+ #endif
+ struct ib_mr *mr;
+@@ -1755,9 +1805,8 @@ again:
+
+ wr = &frd->frd_fastreg_wr;
+ memset(wr, 0, sizeof(*wr));
+-
+ wr->wr.opcode = IB_WR_REG_MR;
+- wr->wr.wr_id = IBLND_WID_MR;
++ wr->wr.wr_id = IBLND_WID_MR;
+ wr->wr.num_sge = 0;
+ wr->wr.send_flags = 0;
+ wr->mr = mr;
+diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h
+index 3baa255..60334b7 100644
+--- a/lnet/klnds/o2iblnd/o2iblnd.h
++++ b/lnet/klnds/o2iblnd/o2iblnd.h
+@@ -352,12 +352,12 @@ struct ib_rdma_wr {
+
+ struct kib_fast_reg_descriptor { /* For fast registration */
+ struct list_head frd_list;
+- struct ib_rdma_wr frd_inv_wr;
++ struct ib_send_wr frd_inv_wr;
+ #ifdef HAVE_IB_MAP_MR_SG
+ struct ib_reg_wr frd_fastreg_wr;
+ #else
+- struct ib_rdma_wr frd_fastreg_wr;
+- struct ib_fast_reg_page_list *frd_frpl;
++ struct ib_send_wr frd_fastreg_wr;
++ struct ib_fast_reg_page_list *frd_frpl;
+ #endif
+ struct ib_mr *frd_mr;
+ bool frd_valid;
+@@ -1125,8 +1125,9 @@ void kiblnd_unmap_rx_descs(kib_conn_t *conn);
+ void kiblnd_pool_free_node(kib_pool_t *pool, struct list_head *node);
+ struct list_head *kiblnd_pool_alloc_node(kib_poolset_t *ps);
+
+-int kiblnd_fmr_pool_map(kib_fmr_poolset_t *fps, __u64 *pages,
+- int npages, __u64 iov, kib_fmr_t *fmr);
++int kiblnd_fmr_pool_map(kib_fmr_poolset_t *fps, kib_tx_t *tx,
++ kib_rdma_desc_t *rd, __u32 nob, __u64 iov,
++ kib_fmr_t *fmr);
+ void kiblnd_fmr_pool_unmap(kib_fmr_t *fmr, int status);
+
+ int kiblnd_tunables_init(void);
+diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c
+index d25e45a..e400eb2 100644
+--- a/lnet/klnds/o2iblnd/o2iblnd_cb.c
++++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c
+@@ -565,35 +565,22 @@ static int
+ kiblnd_fmr_map_tx(kib_net_t *net, kib_tx_t *tx, kib_rdma_desc_t *rd, int nob)
+ {
+ kib_hca_dev_t *hdev;
+- __u64 *pages = tx->tx_pages;
+ kib_fmr_poolset_t *fps;
+- int npages;
+- int size;
+ int cpt;
+ int rc;
+- int i;
+
+ LASSERT(tx->tx_pool != NULL);
+ LASSERT(tx->tx_pool->tpo_pool.po_owner != NULL);
+
+- hdev = tx->tx_pool->tpo_hdev;
+-
+- for (i = 0, npages = 0; i < rd->rd_nfrags; i++) {
+- for (size = 0; size < rd->rd_frags[i].rf_nob;
+- size += hdev->ibh_page_size) {
+- pages[npages ++] = (rd->rd_frags[i].rf_addr &
+- hdev->ibh_page_mask) + size;
+- }
+- }
+-
++ hdev = tx->tx_pool->tpo_hdev;
+ cpt = tx->tx_pool->tpo_pool.po_owner->ps_cpt;
+
+ fps = net->ibn_fmr_ps[cpt];
+- rc = kiblnd_fmr_pool_map(fps, pages, npages, 0, &tx->fmr);
+- if (rc != 0) {
+- CERROR ("Can't map %d pages: %d\n", npages, rc);
+- return rc;
+- }
++ rc = kiblnd_fmr_pool_map(fps, tx, rd, nob, 0, &tx->fmr);
++ if (rc != 0) {
++ CERROR("Can't map %u pages: %d\n", nob, rc);
++ return rc;
++ }
+
+ /* If rd is not tx_rd, it's going to get sent to a peer, who will need
+ * the rkey */
+@@ -853,12 +840,20 @@ __must_hold(&conn->ibc_lock)
+
+ if (frd != NULL) {
+ if (!frd->frd_valid) {
+- wr = &frd->frd_inv_wr.wr;
+- wr->next = &frd->frd_fastreg_wr.wr;
++ wrq = &frd->frd_inv_wr;
++#ifdef HAVE_IB_MAP_MR_SG
++ wrq->next = &frd->frd_fastreg_wr.wr;
++ } else {
++ wrq = &frd->frd_fastreg_wr.wr;
++ }
++ frd->frd_fastreg_wr.wr.next = tx->tx_wrq;
++#else
++ wrq->next = &frd->frd_fastreg_wr;
+ } else {
+ wr = &frd->frd_fastreg_wr.wr;
+ }
+- frd->frd_fastreg_wr.wr.next = &tx->tx_wrq[0].wr;
++ frd->frd_fastreg_wr.next = tx->tx_wrq;
++#endif
+ }
+
+ LASSERTF(wrq->wr_id == kiblnd_ptr2wreqid(tx, IBLND_WID_TX),
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0010-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch b/sys-cluster/lustre/files/0010-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch
new file mode 100644
index 0000000..5a195bc
--- /dev/null
+++ b/sys-cluster/lustre/files/0010-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch
@@ -0,0 +1,46 @@
+From 2c6365b12588a44c95695bfef2b14f7fa449a8d5 Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyang.li@anu.edu.au>
+Date: Fri, 1 Apr 2016 20:26:46 -0400
+Subject: [PATCH 10/19] LU-6215 o2iblnd: rdma_create_id() takes extra parameter
+
+4.4 kernel added network namespace parameter to rdma_create_id().
+This patch handles the API change.
+
+Linux-commit: fa20105e09e97e81aadf02f722c31195e4a75c84
+
+Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
+Change-Id: I3f3792e70e91ac3b3d9fefdd58cc9e7e4d1c25c6
+Reviewed-on: http://review.whamcloud.com/18759
+Reviewed-by: James Simmons <uja.ornl@yahoo.com>
+Tested-by: Jenkins
+Tested-by: Maloo <hpdd-maloo@intel.com>
+Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
+Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+---
+ lnet/klnds/o2iblnd/o2iblnd.h | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h
+index 60334b7..e784adf 100644
+--- a/lnet/klnds/o2iblnd/o2iblnd.h
++++ b/lnet/klnds/o2iblnd/o2iblnd.h
+@@ -131,12 +131,10 @@ extern kib_tunables_t kiblnd_tunables;
+ #define IBLND_CREDITS_DEFAULT 8 /* default # of peer credits */
+ #define IBLND_CREDITS_MAX ((typeof(((kib_msg_t*) 0)->ibm_credits)) - 1) /* Max # of peer credits */
+
+-#define IBLND_MSG_QUEUE_SIZE(v) ((v) == IBLND_MSG_VERSION_1 ? \
+- IBLND_MSG_QUEUE_SIZE_V1 : \
+- *kiblnd_tunables.kib_peertxcredits) /* # messages/RDMAs in-flight */
+-#define IBLND_CREDITS_HIGHWATER(v) ((v) == IBLND_MSG_VERSION_1 ? \
+- IBLND_CREDIT_HIGHWATER_V1 : \
+- *kiblnd_tunables.kib_peercredits_hiw) /* when eagerly to return credits */
++/* when eagerly to return credits */
++#define IBLND_CREDITS_HIGHWATER(t, v) ((v) == IBLND_MSG_VERSION_1 ? \
++ IBLND_CREDIT_HIGHWATER_V1 : \
++ t->lnd_peercredits_hiw)
+
+ #ifdef HAVE_RDMA_CREATE_ID_5ARG
+ # define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(current->nsproxy->net_ns, \
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0011-LU-6215-llite-remove-obsolete-conditional-code.patch b/sys-cluster/lustre/files/0011-LU-6215-llite-remove-obsolete-conditional-code.patch
new file mode 100644
index 0000000..1b9f266
--- /dev/null
+++ b/sys-cluster/lustre/files/0011-LU-6215-llite-remove-obsolete-conditional-code.patch
@@ -0,0 +1,97 @@
+From b63795fa3bfd8002351c002c316c53b9f0660636 Mon Sep 17 00:00:00 2001
+From: Andreas Dilger <andreas.dilger@intel.com>
+Date: Fri, 29 Apr 2016 14:48:52 -0600
+Subject: [PATCH 11/19] LU-6215 llite: remove obsolete conditional code
+
+Remove conditional flock/aops code that was only for out-of-tree
+vendor kernels but is not relevant anymore.
+
+Linux-commit: 3746e6f93bbf28a25d2d69350ab6bfba02e14654
+
+Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Change-Id: If119a2da2bbc30a48d872029bd048ea90a3ebbe5
+Reviewed-on: http://review.whamcloud.com/19890
+Tested-by: Jenkins
+Reviewed-by: James Simmons <uja.ornl@yahoo.com>
+Reviewed-by: Frank Zago <fzago@cray.com>
+Reviewed-by: John L. Hammond <john.hammond@intel.com>
+Tested-by: Maloo <hpdd-maloo@intel.com>
+Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
+Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+---
+ lustre/llite/llite_internal.h | 4 ----
+ lustre/llite/llite_lib.c | 8 --------
+ lustre/llite/rw26.c | 17 -----------------
+ 3 files changed, 29 deletions(-)
+
+diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h
+index 15530dc..adbf9d3 100644
+--- a/lustre/llite/llite_internal.h
++++ b/lustre/llite/llite_internal.h
+@@ -813,11 +813,7 @@ struct ll_cl_context *ll_cl_find(struct file *file);
+ void ll_cl_add(struct file *file, const struct lu_env *env, struct cl_io *io);
+ void ll_cl_remove(struct file *file, const struct lu_env *env);
+
+-#ifndef MS_HAS_NEW_AOPS
+ extern const struct address_space_operations ll_aops;
+-#else
+-extern const struct address_space_operations_ext ll_aops;
+-#endif
+
+ /* llite/file.c */
+ extern struct file_operations ll_file_operations;
+diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c
+index cf17367..d1050d4 100644
+--- a/lustre/llite/llite_lib.c
++++ b/lustre/llite/llite_lib.c
+@@ -232,14 +232,6 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
+ if (sbi->ll_flags & LL_SBI_USER_XATTR)
+ data->ocd_connect_flags |= OBD_CONNECT_XATTR;
+
+-#ifdef HAVE_MS_FLOCK_LOCK
+- /* force vfs to use lustre handler for flock() calls - bug 10743 */
+- sb->s_flags |= MS_FLOCK_LOCK;
+-#endif
+-#ifdef MS_HAS_NEW_AOPS
+- sb->s_flags |= MS_HAS_NEW_AOPS;
+-#endif
+-
+ if (sbi->ll_flags & LL_SBI_FLOCK)
+ sbi->ll_fop = &ll_file_operations_flock;
+ else if (sbi->ll_flags & LL_SBI_LOCALFLOCK)
+diff --git a/lustre/llite/rw26.c b/lustre/llite/rw26.c
+index ee17a73..b362532 100644
+--- a/lustre/llite/rw26.c
++++ b/lustre/llite/rw26.c
+@@ -806,7 +806,6 @@ static int ll_migratepage(struct address_space *mapping,
+ }
+ #endif
+
+-#ifndef MS_HAS_NEW_AOPS
+ const struct address_space_operations ll_aops = {
+ .readpage = ll_readpage,
+ .direct_IO = ll_direct_IO,
+@@ -821,19 +820,3 @@ const struct address_space_operations ll_aops = {
+ .migratepage = ll_migratepage,
+ #endif
+ };
+-#else
+-const struct address_space_operations_ext ll_aops = {
+- .orig_aops.readpage = ll_readpage,
+- .orig_aops.direct_IO = ll_direct_IO,
+- .orig_aops.writepage = ll_writepage,
+- .orig_aops.writepages = ll_writepages,
+- .orig_aops.set_page_dirty = __set_page_dirty_nobuffers,
+- .orig_aops.invalidatepage = ll_invalidatepage,
+- .orig_aops.releasepage = ll_releasepage,
+-#ifdef CONFIG_MIGRATION
+- .orig_aops.migratepage = ll_migratepage,
+-#endif
+- .write_begin = ll_write_begin,
+- .write_end = ll_write_end
+-};
+-#endif
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0012-LU-6215-lnet-split-struct-ib_send_wr.patch b/sys-cluster/lustre/files/0012-LU-6215-lnet-split-struct-ib_send_wr.patch
new file mode 100644
index 0000000..ff28978
--- /dev/null
+++ b/sys-cluster/lustre/files/0012-LU-6215-lnet-split-struct-ib_send_wr.patch
@@ -0,0 +1,169 @@
+From d514117bc52fee3e392aa48dc44b3552c01a0981 Mon Sep 17 00:00:00 2001
+From: Dmitry Eremin <dmitry.eremin@intel.com>
+Date: Tue, 17 May 2016 09:22:15 -0400
+Subject: [PATCH 12/19] LU-6215 lnet: split struct ib_send_wr
+
+In v4.4 Linux kernel split up struct ib_send_wr so that all non-trivial
+verbs use their own structure which embeds struct ib_send_wr.
+
+Linux-commit: e622f2f4ad2142d2a613a57fb85f8cf737935ef5
+Change-Id: Iea2599ea57a576a4c061841be47a989aba097cc6
+Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
+Reviewed-on: http://review.whamcloud.com/19168
+Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
+Reviewed-by: James Simmons <uja.ornl@yahoo.com>
+Reviewed-by: Li Dongyang <dongyang.li@anu.edu.au>
+Tested-by: Jenkins
+Tested-by: Maloo <hpdd-maloo@intel.com>
+Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+---
+ lnet/autoconf/lustre-lnet.m4 | 31 +++++++++++++++----------------
+ lnet/klnds/o2iblnd/o2iblnd.c | 5 +++--
+ lnet/klnds/o2iblnd/o2iblnd.h | 6 +++---
+ lnet/klnds/o2iblnd/o2iblnd_cb.c | 14 +++-----------
+ 4 files changed, 24 insertions(+), 32 deletions(-)
+
+diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4
+index 5f90bca..2e2adb2 100644
+--- a/lnet/autoconf/lustre-lnet.m4
++++ b/lnet/autoconf/lustre-lnet.m4
+@@ -395,10 +395,8 @@ AS_IF([test $ENABLEO2IB != "no"], [
+ AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
+ [struct ib_cq_init_attr is used by ib_create_cq])
+ ])
+-])
+
+-# 4.3 removed ib_alloc_fast_reg_mr()
+-AS_IF([test $ENABLEO2IB != "no"], [
++ # 4.3 removed ib_alloc_fast_reg_mr()
+ LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
+ ib_alloc_fast_reg_mr, [
+ #ifdef HAVE_COMPAT_RDMA
+@@ -417,12 +415,13 @@ AS_IF([test $ENABLEO2IB != "no"], [
+ AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
+ [ib_alloc_fast_reg_mr is defined])
+ ])
+-])
+
+-# 4.4 added network namespace parameter for rdma_create_id()
+-AS_IF([test $ENABLEO2IB != "no"], [
+- LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
+- rdma_create_id_5args, [
++ # In v4.4 Linux kernel,
++ # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
++ # split up struct ib_send_wr so that all non-trivial verbs
++ # use their own structure which embedds struct ib_send_wr.
++ LB_CHECK_COMPILE([if 'struct ib_rdma_wr' is defined],
++ ib_rdma_wr, [
+ #ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+@@ -432,17 +431,17 @@ AS_IF([test $ENABLEO2IB != "no"], [
+ #undef PACKAGE_URL
+ #include <linux/compat-2.6.h>
+ #endif
+- #include <rdma/rdma_cm.h>
++ #include <rdma/ib_verbs.h>
+ ],[
+- rdma_create_id(NULL, NULL, NULL, 0, 0);
++ struct ib_rdma_wr *wr __attribute__ ((unused));
++
++ wr = rdma_wr(NULL);
+ ],[
+- AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
+- [rdma_create_id wants 5 args])
++ AC_DEFINE(HAVE_IB_RDMA_WR, 1,
++ [struct ib_rdma_wr is defined])
+ ])
+-])
+
+-# new fast registration API introduced in 4.4
+-AS_IF([test $ENABLEO2IB != "no"], [
++ # new fast registration API introduced in 4.4
+ LB_CHECK_COMPILE([if 'ib_map_mr_sg' exists],
+ ib_map_mr_sg, [
+ #ifdef HAVE_COMPAT_RDMA
+@@ -461,7 +460,7 @@ AS_IF([test $ENABLEO2IB != "no"], [
+ AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
+ [ib_map_mr_sg exists])
+ ])
+-])
++]) # ENABLEO2IB != "no"
+ ]) # LN_CONFIG_O2IB
+
+ #
+diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c
+index 1262268..ada1322 100644
+--- a/lnet/klnds/o2iblnd/o2iblnd.c
++++ b/lnet/klnds/o2iblnd/o2iblnd.c
+@@ -1760,7 +1760,7 @@ again:
+ struct ib_reg_wr *wr;
+ int n;
+ #else
+- struct ib_send_wr *wr;
++ struct ib_rdma_wr *wr;
+ struct ib_fast_reg_page_list *frpl;
+ #endif
+ struct ib_mr *mr;
+@@ -1805,8 +1805,9 @@ again:
+
+ wr = &frd->frd_fastreg_wr;
+ memset(wr, 0, sizeof(*wr));
++
+ wr->wr.opcode = IB_WR_REG_MR;
+- wr->wr.wr_id = IBLND_WID_MR;
++ wr->wr.wr_id = IBLND_WID_MR;
+ wr->wr.num_sge = 0;
+ wr->wr.send_flags = 0;
+ wr->mr = mr;
+diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h
+index e784adf..38e5f14 100644
+--- a/lnet/klnds/o2iblnd/o2iblnd.h
++++ b/lnet/klnds/o2iblnd/o2iblnd.h
+@@ -350,12 +350,12 @@ struct ib_rdma_wr {
+
+ struct kib_fast_reg_descriptor { /* For fast registration */
+ struct list_head frd_list;
+- struct ib_send_wr frd_inv_wr;
++ struct ib_rdma_wr frd_inv_wr;
+ #ifdef HAVE_IB_MAP_MR_SG
+ struct ib_reg_wr frd_fastreg_wr;
+ #else
+- struct ib_send_wr frd_fastreg_wr;
+- struct ib_fast_reg_page_list *frd_frpl;
++ struct ib_rdma_wr frd_fastreg_wr;
++ struct ib_fast_reg_page_list *frd_frpl;
+ #endif
+ struct ib_mr *frd_mr;
+ bool frd_valid;
+diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c
+index e400eb2..6541d94 100644
+--- a/lnet/klnds/o2iblnd/o2iblnd_cb.c
++++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c
+@@ -840,20 +840,12 @@ __must_hold(&conn->ibc_lock)
+
+ if (frd != NULL) {
+ if (!frd->frd_valid) {
+- wrq = &frd->frd_inv_wr;
+-#ifdef HAVE_IB_MAP_MR_SG
+- wrq->next = &frd->frd_fastreg_wr.wr;
+- } else {
+- wrq = &frd->frd_fastreg_wr.wr;
+- }
+- frd->frd_fastreg_wr.wr.next = tx->tx_wrq;
+-#else
+- wrq->next = &frd->frd_fastreg_wr;
++ wr = &frd->frd_inv_wr.wr;
++ wr->next = &frd->frd_fastreg_wr.wr;
+ } else {
+ wr = &frd->frd_fastreg_wr.wr;
+ }
+- frd->frd_fastreg_wr.next = tx->tx_wrq;
+-#endif
++ frd->frd_fastreg_wr.wr.next = &tx->tx_wrq[0].wr;
+ }
+
+ LASSERTF(wrq->wr_id == kiblnd_ptr2wreqid(tx, IBLND_WID_TX),
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0013-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch b/sys-cluster/lustre/files/0013-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch
new file mode 100644
index 0000000..b894476
--- /dev/null
+++ b/sys-cluster/lustre/files/0013-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch
@@ -0,0 +1,80 @@
+From f6253abe465ac9ffea7664da948e0f40b46ca24f Mon Sep 17 00:00:00 2001
+From: Dmitry Eremin <dmitry.eremin@intel.com>
+Date: Thu, 5 May 2016 22:08:05 +0300
+Subject: [PATCH 13/19] LU-8056 libcfs: Support for linux 4.2 kernels
+
+In kernel version 4.2 commit df6b35f409af0a8ff1ef62f552b8402f3fef8665
+header file i387.h was renamed to fpu/api.h
+
+Change-Id: Id4f5f6e73f3c2aeac67b5c87b9c1d310a0a50a50
+Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
+---
+ libcfs/autoconf/lustre-libcfs.m4 | 11 +++++++++++
+ libcfs/libcfs/linux/linux-crypto-crc32c-pclmul.c | 4 ++++
+ libcfs/libcfs/linux/linux-crypto-crc32pclmul.c | 4 ++++
+ 3 files changed, 19 insertions(+)
+
+diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4
+index c787203..9ae2698 100644
+--- a/libcfs/autoconf/lustre-libcfs.m4
++++ b/libcfs/autoconf/lustre-libcfs.m4
+@@ -318,6 +318,16 @@ topology_sibling_cpumask, [
+ ]) # LIBCFS_HAVE_TOPOLOGY_SIBLING_CPUMASK
+
+ #
++# Kernel version 4.2 commit df6b35f409af0a8ff1ef62f552b8402f3fef8665
++# header file i387.h was renamed to fpu/api.h
++#
++AC_DEFUN([LIBCFS_FPU_API], [
++LB_CHECK_LINUX_HEADER([asm/fpu/api.h], [
++ AC_DEFINE(HAVE_FPU_API_HEADER, 1,
++ [fpu/api.h is present])])
++]) # LIBCFS_FPU_API
++
++#
+ # LIBCFS_PROG_LINUX
+ #
+ # LibCFS linux kernel checks
+@@ -356,6 +366,7 @@ LIBCFS_SHRINKER_COUNT
+ LIBCFS_HLIST_ADD_AFTER
+ # 4.2
+ LIBCFS_HAVE_TOPOLOGY_SIBLING_CPUMASK
++LIBCFS_FPU_API
+ ]) # LIBCFS_PROG_LINUX
+
+ #
+diff --git a/libcfs/libcfs/linux/linux-crypto-crc32c-pclmul.c b/libcfs/libcfs/linux/linux-crypto-crc32c-pclmul.c
+index 9858db4..fc55ad7 100644
+--- a/libcfs/libcfs/linux/linux-crypto-crc32c-pclmul.c
++++ b/libcfs/libcfs/linux/linux-crypto-crc32c-pclmul.c
+@@ -30,7 +30,11 @@
+ #include <crypto/internal/hash.h>
+ #include <linux/crc32.h>
+ #include <asm/cpufeature.h>
++#ifdef HAVE_FPU_API_HEADER
++#include <asm/fpu/api.h>
++#else
+ #include <asm/i387.h>
++#endif
+ #include <libcfs/libcfs.h>
+
+ #define CHKSUM_BLOCK_SIZE 1
+diff --git a/libcfs/libcfs/linux/linux-crypto-crc32pclmul.c b/libcfs/libcfs/linux/linux-crypto-crc32pclmul.c
+index 1a609bf..0b3abaf 100644
+--- a/libcfs/libcfs/linux/linux-crypto-crc32pclmul.c
++++ b/libcfs/libcfs/linux/linux-crypto-crc32pclmul.c
+@@ -32,7 +32,11 @@
+ #include <crypto/internal/hash.h>
+ #include <linux/crc32.h>
+ #include <asm/cpufeature.h>
++#ifdef HAVE_FPU_API_HEADER
++#include <asm/fpu/api.h>
++#else
+ #include <asm/i387.h>
++#endif
+ #include <libcfs/libcfs.h>
+
+ #define CHKSUM_BLOCK_SIZE 1
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0014-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch b/sys-cluster/lustre/files/0014-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch
new file mode 100644
index 0000000..4647eed
--- /dev/null
+++ b/sys-cluster/lustre/files/0014-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch
@@ -0,0 +1,167 @@
+From 53b7041eed99418ec8b2a6c3fb29eaa331accfe2 Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyang.li@anu.edu.au>
+Date: Mon, 16 May 2016 17:18:39 +1000
+Subject: [PATCH 14/19] LU-8056 o2iblnd: ib_query_device removed in 4.5
+
+We should use the cached attributes in ib_device instead of
+calling ib_query_device since kernel 4.5
+
+Linux-commit:182a2da0c768a9ec64abb0d6009667057f1c06af
+Linux-commit:cebfe5ca038e2a0f677b41e9682501708ffa2ff3
+
+Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
+Change-Id: Ie2ab681a3b508f0a1f89d3ff86bf2713b7257e62
+---
+ lnet/autoconf/lustre-lnet.m4 | 22 ++++++++++++++
+ lnet/klnds/o2iblnd/o2iblnd.c | 69 ++++++++++++++++++++++++++++++++++++++------
+ 2 files changed, 82 insertions(+), 9 deletions(-)
+
+diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4
+index 2e2adb2..2aefe70 100644
+--- a/lnet/autoconf/lustre-lnet.m4
++++ b/lnet/autoconf/lustre-lnet.m4
+@@ -460,6 +460,28 @@ AS_IF([test $ENABLEO2IB != "no"], [
+ AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
+ [ib_map_mr_sg exists])
+ ])
++
++ # ib_query_device() removed in 4.5
++ LB_CHECK_COMPILE([if 'struct ib_device' has member 'attrs'],
++ ib_device.attrs, [
++ #ifdef HAVE_COMPAT_RDMA
++ #undef PACKAGE_NAME
++ #undef PACKAGE_TARNAME
++ #undef PACKAGE_VERSION
++ #undef PACKAGE_STRING
++ #undef PACKAGE_BUGREPORT
++ #undef PACKAGE_URL
++ #include <linux/compat-2.6.h>
++ #endif
++ #include <rdma/ib_verbs.h>
++ ],[
++ struct ib_device dev;
++ struct ib_device_attr dev_attr = {};
++ dev.attrs = dev_attr;
++ ],[
++ AC_DEFINE(HAVE_IB_DEVICE_ATTRS, 1,
++ [struct ib_device.attrs is defined])
++ ])
+ ]) # ENABLEO2IB != "no"
+ ]) # LN_CONFIG_O2IB
+
+diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c
+index ada1322..5bae966 100644
+--- a/lnet/klnds/o2iblnd/o2iblnd.c
++++ b/lnet/klnds/o2iblnd/o2iblnd.c
+@@ -1562,25 +1562,70 @@ kiblnd_create_fmr_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t **pp_fpo)
+ kib_fmr_pool_t *fpo;
+ int rc;
+
++#ifndef HAVE_IB_DEVICE_ATTRS
++ dev_attr = kmalloc(sizeof(*dev_attr), GFP_KERNEL);
++ if (!dev_attr)
++ return -ENOMEM;
++#endif
++
+ LIBCFS_CPT_ALLOC(fpo, lnet_cpt_table(), fps->fps_cpt, sizeof(*fpo));
+ if (fpo == NULL)
+ return -ENOMEM;
+
+ fpo->fpo_hdev = kiblnd_current_hdev(dev);
+
+- fpo->fpo_fmr_pool = ib_create_fmr_pool(fpo->fpo_hdev->ibh_pd, ¶m);
+- if (IS_ERR(fpo->fpo_fmr_pool)) {
+- rc = PTR_ERR(fpo->fpo_fmr_pool);
+- CERROR("Failed to create FMR pool: %d\n", rc);
++#ifdef HAVE_IB_DEVICE_ATTRS
++ dev_attr = &fpo->fpo_hdev->ibh_ibdev->attrs;
++#else
++ rc = ib_query_device(fpo->fpo_hdev->ibh_ibdev, dev_attr);
++ if (rc) {
++ CERROR("Query device failed for %s: %d\n",
++ fpo->fpo_hdev->ibh_ibdev->name, rc);
++ goto out_dev_attr;
++ }
++#endif
++
++ /* Check for FMR or FastReg support */
++ fpo->fpo_is_fmr = 0;
++ if (fpo->fpo_hdev->ibh_ibdev->alloc_fmr &&
++ fpo->fpo_hdev->ibh_ibdev->dealloc_fmr &&
++ fpo->fpo_hdev->ibh_ibdev->map_phys_fmr &&
++ fpo->fpo_hdev->ibh_ibdev->unmap_fmr) {
++ LCONSOLE_INFO("Using FMR for registration\n");
++ fpo->fpo_is_fmr = 1;
++ } else if (dev_attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) {
++ LCONSOLE_INFO("Using FastReg for registration\n");
++ } else {
++ rc = -ENOSYS;
++ LCONSOLE_ERROR_MSG(rc, "IB device does not support FMRs nor FastRegs, can't register memory\n");
++ goto out_dev_attr;
++ }
++
++ if (fpo->fpo_is_fmr)
++ rc = kiblnd_alloc_fmr_pool(fps, fpo);
++ else
++ rc = kiblnd_alloc_freg_pool(fps, fpo);
++ if (rc)
++ goto out_fpo;
++
++#ifndef HAVE_IB_DEVICE_ATTRS
++ kfree(dev_attr);
++#endif
++ fpo->fpo_deadline = cfs_time_shift(IBLND_POOL_DEADLINE);
++ fpo->fpo_owner = fps;
++ *pp_fpo = fpo;
++
++ return 0;
+
+ kiblnd_hdev_decref(fpo->fpo_hdev);
+ LIBCFS_FREE(fpo, sizeof(kib_fmr_pool_t));
+ return rc;
+ }
+
+- fpo->fpo_deadline = cfs_time_shift(IBLND_POOL_DEADLINE);
+- fpo->fpo_owner = fps;
+- *pp_fpo = fpo;
++out_dev_attr:
++#ifndef HAVE_IB_DEVICE_ATTRS
++ kfree(dev_attr);
++#endif
+
+ return 0;
+ }
+@@ -2388,8 +2433,10 @@ kiblnd_net_init_pools(kib_net_t *net, __u32 *cpts, int ncpts)
+ static int
+ kiblnd_hdev_get_attr(kib_hca_dev_t *hdev)
+ {
+- struct ib_device_attr *attr;
+- int rc;
++#ifndef HAVE_IB_DEVICE_ATTRS
++ struct ib_device_attr *attr;
++ int rc;
++#endif
+
+ /* It's safe to assume a HCA can handle a page size
+ * matching that of the native system */
+@@ -2397,6 +2444,9 @@ kiblnd_hdev_get_attr(kib_hca_dev_t *hdev)
+ hdev->ibh_page_size = 1 << PAGE_SHIFT;
+ hdev->ibh_page_mask = ~((__u64)hdev->ibh_page_size - 1);
+
++#ifdef HAVE_IB_DEVICE_ATTRS
++ hdev->ibh_mr_size = hdev->ibh_ibdev->attrs.max_mr_size;
++#else
+ LIBCFS_ALLOC(attr, sizeof(*attr));
+ if (attr == NULL) {
+ CERROR("Out of memory\n");
+@@ -2413,6 +2463,7 @@ kiblnd_hdev_get_attr(kib_hca_dev_t *hdev)
+ CERROR("Failed to query IB device: %d\n", rc);
+ return rc;
+ }
++#endif
+
+ if (hdev->ibh_mr_size == ~0ULL) {
+ hdev->ibh_mr_shift = 64;
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0015-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch b/sys-cluster/lustre/files/0015-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch
new file mode 100644
index 0000000..f39059c
--- /dev/null
+++ b/sys-cluster/lustre/files/0015-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch
@@ -0,0 +1,49 @@
+From ed100a806582374d95a7ef5d714d28276bffe9dc Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyang.li@anu.edu.au>
+Date: Mon, 16 May 2016 17:27:23 +1000
+Subject: [PATCH 15/19] LU-8056 socklnd: NETIF_F_ALL_CSUM renamed to
+ NETIF_F_CSUM_MASK
+
+In kernel 4.5 NETIF_F_CSUM_MASK got renamed to NETIF_F_CSUM_MASK.
+This patch handles the name change.
+
+Linux-commit:a188222b6ed29404ac2d4232d35d1fe0e77af370
+
+Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
+Change-Id: Id57505eeca613303c584d3cf74284920a837bb43
+---
+ lnet/klnds/socklnd/socklnd.h | 4 ++++
+ lnet/klnds/socklnd/socklnd_lib.c | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/lnet/klnds/socklnd/socklnd.h b/lnet/klnds/socklnd/socklnd.h
+index 4065ef3..ad04fb5 100644
+--- a/lnet/klnds/socklnd/socklnd.h
++++ b/lnet/klnds/socklnd/socklnd.h
+@@ -66,6 +66,10 @@
+ tcp_sendpage(sk, page, offset, size, flags)
+ #endif /* HAVE_TCP_SENDPAGE_USE_SOCKET */
+
++#ifndef NETIF_F_CSUM_MASK
++# define NETIF_F_CSUM_MASK NETIF_F_ALL_CSUM
++#endif
++
+ /* assume one thread for each connection type */
+ #define SOCKNAL_NSCHEDS 3
+ #define SOCKNAL_NSCHEDS_HIGH (SOCKNAL_NSCHEDS << 1)
+diff --git a/lnet/klnds/socklnd/socklnd_lib.c b/lnet/klnds/socklnd/socklnd_lib.c
+index f270fa7..a672791 100644
+--- a/lnet/klnds/socklnd/socklnd_lib.c
++++ b/lnet/klnds/socklnd/socklnd_lib.c
+@@ -377,7 +377,7 @@ ksocknal_lib_zc_capable(ksock_conn_t *conn)
+
+ /* ZC if the socket supports scatter/gather and doesn't need software
+ * checksums */
+- return ((caps & NETIF_F_SG) != 0 && (caps & NETIF_F_ALL_CSUM) != 0);
++ return ((caps & NETIF_F_SG) != 0 && (caps & NETIF_F_CSUM_MASK) != 0);
+ }
+
+ int
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0016-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch b/sys-cluster/lustre/files/0016-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch
new file mode 100644
index 0000000..7ed56fe
--- /dev/null
+++ b/sys-cluster/lustre/files/0016-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch
@@ -0,0 +1,363 @@
+From 917e3d42d9fe0584c740584db5c5f59cf6875c9f Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyang.li@anu.edu.au>
+Date: Mon, 16 May 2016 17:40:55 +1000
+Subject: [PATCH 16/19] LU-8056 llite: use inode_lock to access i_mutex
+
+Linux kernel 4.5 introduced wrappers for i_mutex as the type
+of i_mutex will be changed in the future.
+This patch prepares us for the upcoming type change. It also
+includes a patch from linux kernel removing unused declaration
+to make the room for the wrappers mentioned above.
+
+Note that this patch only touches the llite part. osd-ldiskfs still
+calls mutex_{lock,unlock} on i_mutex.
+
+Linux-commit:57b8f112cfe6622ddddb8c2641206bb5fa8a112d
+Linux-commit:5955102c9984fa081b2d570cfac75c97eecf8f3b
+
+Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
+Change-Id: Ia4c30443cddfaa5232e1dc1519c33c97dba2a271
+---
+ lustre/autoconf/lustre-core.m4 | 20 ++++++++++++++++++++
+ lustre/include/lustre_compat.h | 6 ++++++
+ lustre/include/lvfs.h | 4 ++--
+ lustre/llite/dir.c | 4 ++--
+ lustre/llite/file.c | 29 +++++++++++++++++++----------
+ lustre/llite/llite_internal.h | 2 --
+ lustre/llite/llite_lib.c | 8 ++++----
+ lustre/llite/llite_nfs.c | 4 ++--
+ lustre/llite/lloop.c | 4 ++--
+ lustre/llite/rw26.c | 4 ++--
+ lustre/llite/vvp_io.c | 4 ++--
+ lustre/llite/vvp_page.c | 4 ++--
+ 12 files changed, 63 insertions(+), 30 deletions(-)
+
+diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
+index 9497cdd..622345f 100644
+--- a/lustre/autoconf/lustre-core.m4
++++ b/lustre/autoconf/lustre-core.m4
+@@ -2045,6 +2045,23 @@ key_payload_data_array, [
+ ]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
+
+ #
++# LC_HAVE_INODE_LOCK
++#
++# 4.5 introduced inode_lock
++#
++AC_DEFUN([LC_HAVE_INODE_LOCK], [
++LB_CHECK_COMPILE([if 'inode_lock' is defined],
++inode_lock, [
++ #include <linux/fs.h>
++],[
++ inode_lock(NULL);
++], [
++ AC_DEFINE(HAVE_INODE_LOCK, 1,
++ [inode_lock is defined])
++])
++]) # LC_HAVE_INODE_LOCK
++
++#
+ # LC_PROG_LINUX
+ #
+ # Lustre linux kernel checks
+@@ -2213,6 +2230,9 @@ AC_DEFUN([LC_PROG_LINUX], [
+ LC_HAVE_QC_MAKE_REQUEST_FN
+ LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
+
++ # 4.5
++ LC_HAVE_INODE_LOCK
++
+ #
+ AS_IF([test "x$enable_server" != xno], [
+ LC_FUNC_DEV_SET_RDONLY
+diff --git a/lustre/include/lustre_compat.h b/lustre/include/lustre_compat.h
+index 4e9f3ac..2a5a2fd 100644
+--- a/lustre/include/lustre_compat.h
++++ b/lustre/include/lustre_compat.h
+@@ -370,6 +370,12 @@ static inline struct dentry *d_make_root(struct inode *root)
+ #define ll_vfs_unlink(a, b) vfs_unlink(a, b)
+ #endif
+
++#ifndef HAVE_INODE_LOCK
++# define inode_lock(inode) mutex_lock(&(inode)->i_mutex)
++# define inode_unlock(inode) mutex_unlock(&(inode)->i_mutex)
++# define inode_trylock(inode) mutex_trylock(&(inode)->i_mutex)
++#endif
++
+ #ifndef HAVE_RADIX_EXCEPTION_ENTRY
+ static inline int radix_tree_exceptional_entry(void *arg)
+ {
+diff --git a/lustre/include/lvfs.h b/lustre/include/lvfs.h
+index be4187f..2bdee77 100644
+--- a/lustre/include/lvfs.h
++++ b/lustre/include/lvfs.h
+@@ -86,9 +86,9 @@ ll_lookup_one_len(const char *fid_name, struct dentry *dparent,
+ {
+ struct dentry *dchild;
+
+- mutex_lock(&dparent->d_inode->i_mutex);
++ inode_lock(dparent->d_inode);
+ dchild = lookup_one_len(fid_name, dparent, fid_namelen);
+- mutex_unlock(&dparent->d_inode->i_mutex);
++ inode_unlock(dparent->d_inode);
+
+ if (IS_ERR(dchild) || dchild->d_inode == NULL)
+ return dchild;
+diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c
+index 4f28145..f657725 100644
+--- a/lustre/llite/dir.c
++++ b/lustre/llite/dir.c
+@@ -1736,7 +1736,7 @@ static loff_t ll_dir_seek(struct file *file, loff_t offset, int origin)
+ loff_t ret = -EINVAL;
+ ENTRY;
+
+- mutex_lock(&inode->i_mutex);
++ inode_lock(inode);
+ switch (origin) {
+ case SEEK_SET:
+ break;
+@@ -1774,7 +1774,7 @@ static loff_t ll_dir_seek(struct file *file, loff_t offset, int origin)
+ GOTO(out, ret);
+
+ out:
+- mutex_unlock(&inode->i_mutex);
++ inode_unlock(inode);
+ return ret;
+ }
+
+diff --git a/lustre/llite/file.c b/lustre/llite/file.c
+index d1819c6..b8670c7 100644
+--- a/lustre/llite/file.c
++++ b/lustre/llite/file.c
+@@ -2144,13 +2144,13 @@ static int ll_hsm_import(struct inode *inode, struct file *file,
+ ATTR_MTIME | ATTR_MTIME_SET |
+ ATTR_ATIME | ATTR_ATIME_SET;
+
+- mutex_lock(&inode->i_mutex);
++ inode_lock(inode);
+
+ rc = ll_setattr_raw(file->f_path.dentry, attr, true);
+ if (rc == -ENODATA)
+ rc = 0;
+
+- mutex_unlock(&inode->i_mutex);
++ inode_unlock(inode);
+
+ out:
+ if (hss != NULL)
+@@ -2197,9 +2197,9 @@ static int ll_file_futimes_3(struct file *file, const struct ll_futimes_3 *lfu)
+ if (!S_ISREG(inode->i_mode))
+ RETURN(-EINVAL);
+
+- mutex_lock(&inode->i_mutex);
++ inode_lock(inode);
+ rc = ll_setattr_raw(file->f_path.dentry, &ia, false);
+- mutex_unlock(&inode->i_mutex);
++ inode_unlock(inode);
+
+ RETURN(rc);
+ }
+@@ -2598,9 +2598,9 @@ generic_file_llseek_size(struct file *file, loff_t offset, int origin,
+ * SEEK_CURs. Note that parallel writes and reads behave
+ * like SEEK_SET.
+ */
+- mutex_lock(&inode->i_mutex);
++ inode_lock(inode);
+ offset = llseek_execute(file, file->f_pos + offset, maxsize);
+- mutex_unlock(&inode->i_mutex);
++ inode_unlock(inode);
+ return offset;
+ case SEEK_DATA:
+ /*
+@@ -2758,7 +2758,7 @@ int ll_fsync(struct file *file, struct dentry *dentry, int datasync)
+
+ #ifdef HAVE_FILE_FSYNC_4ARGS
+ rc = filemap_write_and_wait_range(inode->i_mapping, start, end);
+- mutex_lock(&inode->i_mutex);
++ inode_lock(inode);
+ #else
+ /* fsync's caller has already called _fdata{sync,write}, we want
+ * that IO to finish before calling the osc and mdc sync methods */
+@@ -2796,7 +2796,7 @@ int ll_fsync(struct file *file, struct dentry *dentry, int datasync)
+ }
+
+ #ifdef HAVE_FILE_FSYNC_4ARGS
+- mutex_unlock(&inode->i_mutex);
++ inode_unlock(inode);
+ #endif
+ RETURN(rc);
+ }
+@@ -3021,7 +3021,15 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx,
+ if (child_inode == NULL)
+ GOTO(out_free, rc = -EINVAL);
+
+- mutex_lock(&child_inode->i_mutex);
++ /*
++ * lfs migrate command needs to be blocked on the client
++ * by checking the migrate FID against the FID of the
++ * filesystem root.
++ */
++ if (child_inode == parent->i_sb->s_root->d_inode)
++ GOTO(out_iput, rc = -EINVAL);
++
++ inode_lock(child_inode);
+ op_data->op_fid3 = *ll_inode2fid(child_inode);
+ if (!fid_is_sane(&op_data->op_fid3)) {
+ CERROR("%s: migrate %s, but FID "DFID" is insane\n",
+@@ -3099,7 +3107,8 @@ out_close:
+ if (rc == 0)
+ clear_nlink(child_inode);
+ out_unlock:
+- mutex_unlock(&child_inode->i_mutex);
++ inode_unlock(child_inode);
++out_iput:
+ iput(child_inode);
+ out_free:
+ ll_finish_md_op_data(op_data);
+diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h
+index adbf9d3..94c8045 100644
+--- a/lustre/llite/llite_internal.h
++++ b/lustre/llite/llite_internal.h
+@@ -681,8 +681,6 @@ struct ll_file_data {
+ struct list_head fd_lccs; /* list of ll_cl_context */
+ };
+
+-extern spinlock_t inode_lock;
+-
+ extern struct proc_dir_entry *proc_lustre_fs_root;
+
+ static inline struct inode *ll_info2i(struct ll_inode_info *lli)
+diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c
+index d1050d4..bf80506 100644
+--- a/lustre/llite/llite_lib.c
++++ b/lustre/llite/llite_lib.c
+@@ -1521,10 +1521,10 @@ static int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data)
+ * cache is not cleared yet. */
+ op_data->op_attr.ia_valid &= ~(TIMES_SET_FLAGS | ATTR_SIZE);
+ if (S_ISREG(inode->i_mode))
+- mutex_lock(&inode->i_mutex);
++ inode_lock(inode);
+ rc = simple_setattr(dentry, &op_data->op_attr);
+ if (S_ISREG(inode->i_mode))
+- mutex_unlock(&inode->i_mutex);
++ inode_unlock(inode);
+ op_data->op_attr.ia_valid = ia_valid;
+
+ rc = ll_update_inode(inode, &md);
+@@ -1613,7 +1613,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import)
+ if (S_ISREG(inode->i_mode)) {
+ if (attr->ia_valid & ATTR_SIZE)
+ inode_dio_write_done(inode);
+- mutex_unlock(&inode->i_mutex);
++ inode_unlock(inode);
+ }
+
+ /* We always do an MDS RPC, even if we're only changing the size;
+@@ -1690,7 +1690,7 @@ out:
+ ll_finish_md_op_data(op_data);
+
+ if (S_ISREG(inode->i_mode)) {
+- mutex_lock(&inode->i_mutex);
++ inode_lock(inode);
+ if ((attr->ia_valid & ATTR_SIZE) && !hsm_import)
+ inode_dio_wait(inode);
+ }
+diff --git a/lustre/llite/llite_nfs.c b/lustre/llite/llite_nfs.c
+index 9e19e78..bc238f5 100644
+--- a/lustre/llite/llite_nfs.c
++++ b/lustre/llite/llite_nfs.c
+@@ -247,13 +247,13 @@ static int ll_get_name(struct dentry *dentry, char *name,
+ GOTO(out, rc = PTR_ERR(op_data));
+
+ op_data->op_max_pages = ll_i2sbi(dir)->ll_md_brw_pages;
+- mutex_lock(&dir->i_mutex);
++ inode_lock(dir);
+ #ifdef HAVE_DIR_CONTEXT
+ rc = ll_dir_read(dir, &pos, op_data, &lgd.ctx);
+ #else
+ rc = ll_dir_read(dir, &pos, op_data, &lgd, ll_nfs_get_name_filldir);
+ #endif
+- mutex_unlock(&dir->i_mutex);
++ inode_unlock(dir);
+ ll_finish_md_op_data(op_data);
+ if (!rc && !lgd.lgd_found)
+ rc = -ENOENT;
+diff --git a/lustre/llite/lloop.c b/lustre/llite/lloop.c
+index f3b9288..c20df96 100644
+--- a/lustre/llite/lloop.c
++++ b/lustre/llite/lloop.c
+@@ -277,9 +277,9 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head)
+ * be asked to write less pages once, this purely depends on
+ * implementation. Anyway, we should be careful to avoid deadlocking.
+ */
+- mutex_lock(&inode->i_mutex);
++ inode_lock(inode);
+ bytes = ll_direct_rw_pages(env, io, rw, inode, pvec);
+- mutex_unlock(&inode->i_mutex);
++ inode_unlock(inode);
+ cl_io_fini(env, io);
+ return (bytes == pvec->ldp_size) ? 0 : (int)bytes;
+ }
+diff --git a/lustre/llite/rw26.c b/lustre/llite/rw26.c
+index b362532..ad692db 100644
+--- a/lustre/llite/rw26.c
++++ b/lustre/llite/rw26.c
+@@ -388,7 +388,7 @@ ll_direct_IO(
+ * 1. Need inode mutex to operate transient pages.
+ */
+ if (iov_iter_rw(iter) == READ)
+- mutex_lock(&inode->i_mutex);
++ inode_lock(inode);
+
+ while (iov_iter_count(iter)) {
+ struct page **pages;
+@@ -439,7 +439,7 @@ ll_direct_IO(
+ }
+ out:
+ if (iov_iter_rw(iter) == READ)
+- mutex_unlock(&inode->i_mutex);
++ inode_unlock(inode);
+
+ if (tot_bytes > 0) {
+ struct vvp_io *vio = vvp_env_io(env);
+diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c
+index cbc4997..8dc657b 100644
+--- a/lustre/llite/vvp_io.c
++++ b/lustre/llite/vvp_io.c
+@@ -736,7 +736,7 @@ static int vvp_io_setattr_start(const struct lu_env *env,
+ struct inode *inode = vvp_object_inode(io->ci_obj);
+ struct ll_inode_info *lli = ll_i2info(inode);
+
+- mutex_lock(&inode->i_mutex);
++ inode_lock(inode);
+ if (cl_io_is_trunc(io)) {
+ down_write(&lli->lli_trunc_sem);
+ inode_dio_wait(inode);
+@@ -762,7 +762,7 @@ static void vvp_io_setattr_end(const struct lu_env *env,
+ inode_dio_write_done(inode);
+ up_write(&lli->lli_trunc_sem);
+ }
+- mutex_unlock(&inode->i_mutex);
++ inode_unlock(inode);
+ }
+
+ static void vvp_io_setattr_fini(const struct lu_env *env,
+diff --git a/lustre/llite/vvp_page.c b/lustre/llite/vvp_page.c
+index 39f093b..e2afea4 100644
+--- a/lustre/llite/vvp_page.c
++++ b/lustre/llite/vvp_page.c
+@@ -468,9 +468,9 @@ static int vvp_transient_page_is_vmlocked(const struct lu_env *env,
+ struct inode *inode = vvp_object_inode(slice->cpl_obj);
+ int locked;
+
+- locked = !mutex_trylock(&inode->i_mutex);
++ locked = !inode_trylock(inode);
+ if (!locked)
+- mutex_unlock(&inode->i_mutex);
++ inode_unlock(inode);
+ return locked ? -EBUSY : -ENODATA;
+ }
+
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0017-LU-8056-llite-inode_operations-interface-changed-in-.patch b/sys-cluster/lustre/files/0017-LU-8056-llite-inode_operations-interface-changed-in-.patch
new file mode 100644
index 0000000..1c574f6
--- /dev/null
+++ b/sys-cluster/lustre/files/0017-LU-8056-llite-inode_operations-interface-changed-in-.patch
@@ -0,0 +1,166 @@
+From 4780e65730a868432c4be7c6ea635496c725fc3a Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyang.li@anu.edu.au>
+Date: Mon, 16 May 2016 21:57:31 +1000
+Subject: [PATCH 17/19] LU-8056 llite: inode_operations interface changed in
+ 4.5
+
+Linux kernel 4.5 replaced follow_link() with get_link()
+while put_link() is removed.
+This patch handles the API change.
+
+Linux-commit:6b2553918d8b4e6de9853fd6315bec7271a2e592
+Linux-commit:fceef393a538134f03b778c5d2519e670269342f
+
+Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
+Change-Id: Ia9b8c9b855ed5ab7a428a370074b8801e34d3f99
+---
+ lustre/autoconf/lustre-core.m4 | 20 +++++++++++++++
+ lustre/llite/dcache.c | 4 +++
+ lustre/llite/symlink.c | 56 +++++++++++++++++++++++++++++++++++-------
+ 3 files changed, 71 insertions(+), 9 deletions(-)
+
+diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
+index 622345f..867fa51 100644
+--- a/lustre/autoconf/lustre-core.m4
++++ b/lustre/autoconf/lustre-core.m4
+@@ -2062,6 +2062,25 @@ inode_lock, [
+ ]) # LC_HAVE_INODE_LOCK
+
+ #
++# LC_HAVE_IOP_GET_LINK
++#
++# 4.5 vfs replaced iop->follow_link with
++# iop->get_link
++#
++AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
++LB_CHECK_COMPILE([if 'iop' has 'get_link'],
++inode_ops_get_link, [
++ #include <linux/fs.h>
++],[
++ struct inode_operations iop;
++ iop.get_link = NULL;
++],[
++ AC_DEFINE(HAVE_IOP_GET_LINK, 1,
++ [have iop get_link])
++])
++]) # LC_HAVE_IOP_GET_LINK
++
++#
+ # LC_PROG_LINUX
+ #
+ # Lustre linux kernel checks
+@@ -2232,6 +2251,7 @@ AC_DEFUN([LC_PROG_LINUX], [
+
+ # 4.5
+ LC_HAVE_INODE_LOCK
++ LC_HAVE_IOP_GET_LINK
+
+ #
+ AS_IF([test "x$enable_server" != xno], [
+diff --git a/lustre/llite/dcache.c b/lustre/llite/dcache.c
+index 4ec4421..d579ba0 100644
+--- a/lustre/llite/dcache.c
++++ b/lustre/llite/dcache.c
+@@ -368,7 +368,11 @@ static int ll_revalidate_dentry(struct dentry *dentry,
+ return 1;
+
+ /* Symlink - always valid as long as the dentry was found */
++#ifdef HAVE_IOP_GET_LINK
++ if (dentry->d_inode && dentry->d_inode->i_op->get_link)
++#else
+ if (dentry->d_inode && dentry->d_inode->i_op->follow_link)
++#endif
+ return 1;
+
+ /* Last path component lookup for open or create - we always
+diff --git a/lustre/llite/symlink.c b/lustre/llite/symlink.c
+index e635037..70577ce 100644
+--- a/lustre/llite/symlink.c
++++ b/lustre/llite/symlink.c
+@@ -122,6 +122,20 @@ failed:
+ }
+
+ #ifdef HAVE_SYMLINK_OPS_USE_NAMEIDATA
++static void ll_put_link(struct dentry *dentry,
++ struct nameidata *nd, void *cookie)
++#else
++# ifdef HAVE_IOP_GET_LINK
++static void ll_put_link(void *cookie)
++# else
++static void ll_put_link(struct inode *unused, void *cookie)
++# endif
++#endif
++{
++ ptlrpc_req_finished(cookie);
++}
++
++#ifdef HAVE_SYMLINK_OPS_USE_NAMEIDATA
+ static void *ll_follow_link(struct dentry *dentry, struct nameidata *nd)
+ {
+ struct inode *inode = dentry->d_inode;
+@@ -156,6 +170,34 @@ static void *ll_follow_link(struct dentry *dentry, struct nameidata *nd)
+ RETURN(request);
+ }
+ #else
++# ifdef HAVE_IOP_GET_LINK
++static const char *ll_get_link(struct dentry *dentry,
++ struct inode *inode,
++ struct delayed_call *done)
++{
++ struct ptlrpc_request *request;
++ char *symname = NULL;
++ int rc;
++
++ ENTRY;
++ CDEBUG(D_VFSTRACE, "VFS Op\n");
++ if (!dentry)
++ RETURN(ERR_PTR(-ECHILD));
++ ll_inode_size_lock(inode);
++ rc = ll_readlink_internal(inode, &request, &symname);
++ ll_inode_size_unlock(inode);
++ if (rc < 0) {
++ ptlrpc_req_finished(request);
++ return ERR_PTR(rc);
++ }
++
++ /* symname may contain a pointer to the request message buffer,
++ * we delay request releasing then.
++ */
++ set_delayed_call(done, ll_put_link, request);
++ RETURN(symname);
++}
++# else
+ static const char *ll_follow_link(struct dentry *dentry, void **cookie)
+ {
+ struct inode *inode = d_inode(dentry);
+@@ -179,22 +221,18 @@ static const char *ll_follow_link(struct dentry *dentry, void **cookie)
+ *cookie = request;
+ RETURN(symname);
+ }
++# endif /* HAVE_IOP_GET_LINK */
+ #endif /* HAVE_SYMLINK_OPS_USE_NAMEIDATA */
+
+-#ifdef HAVE_SYMLINK_OPS_USE_NAMEIDATA
+-static void ll_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
+-#else
+-static void ll_put_link(struct inode *unused, void *cookie)
+-#endif
+-{
+- ptlrpc_req_finished(cookie);
+-}
+-
+ struct inode_operations ll_fast_symlink_inode_operations = {
+ .readlink = generic_readlink,
+ .setattr = ll_setattr,
++#ifdef HAVE_IOP_GET_LINK
++ .get_link = ll_get_link,
++#else
+ .follow_link = ll_follow_link,
+ .put_link = ll_put_link,
++#endif
+ .getattr = ll_getattr,
+ .permission = ll_inode_permission,
+ .setxattr = ll_setxattr,
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0018-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch b/sys-cluster/lustre/files/0018-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch
new file mode 100644
index 0000000..9da787c
--- /dev/null
+++ b/sys-cluster/lustre/files/0018-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch
@@ -0,0 +1,53 @@
+From 9f0940464d87e1111ab665684f9e9a45db6c3787 Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyang.li@anu.edu.au>
+Date: Mon, 16 May 2016 22:07:54 +1000
+Subject: [PATCH 18/19] LU-8056 llite: POSIX_ACL_XATTR_{ACCESS,DEFAULT} removed
+ in 4.5
+
+POSIX_ACL_XATTR_{ACCESS,DEFAULT} are duplicate
+xattr name definitions and they are replaced by
+XATTR_NAME_POSIX_ACL_{ACCESS,DEFAULT} since Linux kernel 4.5
+
+Linux-commit:97d79299223baab330b194437e676d301f12d5f6
+
+Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
+Change-Id: I9e031d3ac77a4bf1832d932c1cab7032e4572445
+---
+ lustre/llite/xattr.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/lustre/llite/xattr.c b/lustre/llite/xattr.c
+index 6e282af..d30cede 100644
+--- a/lustre/llite/xattr.c
++++ b/lustre/llite/xattr.c
+@@ -57,6 +57,14 @@
+ #define XATTR_NAME_EVM "security.evm"
+ #endif
+
++#ifndef XATTR_NAME_POSIX_ACL_ACCESS
++# define XATTR_NAME_POSIX_ACL_ACCESS POSIX_ACL_XATTR_ACCESS
++#endif
++
++#ifndef XATTR_NAME_POSIX_ACL_DEFAULT
++# define XATTR_NAME_POSIX_ACL_DEFAULT POSIX_ACL_XATTR_DEFAULT
++#endif
++
+ #define XATTR_USER_T (1)
+ #define XATTR_TRUSTED_T (2)
+ #define XATTR_SECURITY_T (3)
+@@ -68,10 +76,10 @@
+ static
+ int get_xattr_type(const char *name)
+ {
+- if (!strcmp(name, POSIX_ACL_XATTR_ACCESS))
++ if (!strcmp(name, XATTR_NAME_POSIX_ACL_ACCESS))
+ return XATTR_ACL_ACCESS_T;
+
+- if (!strcmp(name, POSIX_ACL_XATTR_DEFAULT))
++ if (!strcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT))
+ return XATTR_ACL_DEFAULT_T;
+
+ if (!strncmp(name, XATTR_USER_PREFIX,
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/0019-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch b/sys-cluster/lustre/files/0019-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch
new file mode 100644
index 0000000..a613540
--- /dev/null
+++ b/sys-cluster/lustre/files/0019-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch
@@ -0,0 +1,66 @@
+From 6f44b5a0d02e5a805c5be265d5b92ab69ef9a421 Mon Sep 17 00:00:00 2001
+From: James Simmons <uja.ornl@yahoo.com>
+Date: Fri, 3 Jun 2016 14:09:54 -0400
+Subject: [PATCH 19/19] LU-8056 lloop: fix bio_for_each_segment_all for newer
+ kernels
+
+Lustre patch http://review.whamcloud.com/20478 back ported
+bio_for_each_segment_all from newer kernels but support
+for newer kernels was done incorrectly. Update the code to
+work with newer kernels.
+
+Change-Id: I6a926320f80113169a13d2319190721c83d58b1d
+Signed-off-by: James Simmons <uja.ornl@yahoo.com>
+---
+ lustre/llite/lloop.c | 17 ++---------------
+ 1 file changed, 2 insertions(+), 15 deletions(-)
+
+diff --git a/lustre/llite/lloop.c b/lustre/llite/lloop.c
+index c20df96..834d068 100644
+--- a/lustre/llite/lloop.c
++++ b/lustre/llite/lloop.c
+@@ -193,13 +193,8 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head)
+ struct cl_object *obj = ll_i2info(inode)->lli_clob;
+ pgoff_t offset;
+ int ret;
+-#ifdef HAVE_BVEC_ITER
+- struct bvec_iter iter;
+- struct bio_vec bvec;
+-#else
+ int iter;
+ struct bio_vec *bvec;
+-#endif
+ int rw;
+ size_t page_count = 0;
+ struct bio *bio;
+@@ -226,17 +221,10 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head)
+
+ #ifdef HAVE_BVEC_ITER
+ offset = (pgoff_t)(bio->bi_iter.bi_sector << 9) + lo->lo_offset;
+- bio_for_each_segment(bvec, bio, iter) {
+- BUG_ON(bvec.bv_offset != 0);
+- BUG_ON(bvec.bv_len != PAGE_CACHE_SIZE);
+-
+- pages[page_count] = bvec.bv_page;
+- offsets[page_count] = offset;
+- page_count++;
+- offset += bvec.bv_len;
+ #else
+ offset = (pgoff_t)(bio->bi_sector << 9) + lo->lo_offset;
+- bio_for_each_segment(bvec, bio, iter) {
++#endif
++ bio_for_each_segment_all(bvec, bio, iter) {
+ BUG_ON(bvec->bv_offset != 0);
+ BUG_ON(bvec->bv_len != PAGE_CACHE_SIZE);
+
+@@ -244,7 +232,6 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head)
+ offsets[page_count] = offset;
+ page_count++;
+ offset += bvec->bv_len;
+-#endif
+ }
+ LASSERT(page_count <= LLOOP_MAX_SEGMENTS);
+ }
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/lustre-2.8.0.ebuild b/sys-cluster/lustre/lustre-2.8.0.ebuild
index 4fab54d..c56b6b1 100644
--- a/sys-cluster/lustre/lustre-2.8.0.ebuild
+++ b/sys-cluster/lustre/lustre-2.8.0.ebuild
@@ -25,7 +25,7 @@ EGIT_REPO_URI="git://git.whamcloud.com/fs/lustre-release.git"
LICENSE="GPL-2"
SLOT="0"
-IUSE="client +utils modules server readline tests"
+IUSE="+client +utils +modules server readline tests"
RDEPEND="
virtual/awk
@@ -43,7 +43,28 @@ REQUIRED_USE="
modules? ( client )
modules? ( server )"
-PATCHES=( "${FILESDIR}/lustre-do-not-include-udef.h.patch" )
+PATCHES=(
+ "${FILESDIR}/0001-LU-6215-lprocfs-handle-seq_printf-api-change.patch"
+ "${FILESDIR}/0002-LU-6215-gss-cache_head-is-now-on-a-hlist-in-4.3-kern.patch"
+ "${FILESDIR}/0003-LU-6215-llite-handle-locks-API-change-in-4.4-kernels.patch"
+ "${FILESDIR}/0004-LU-6215-llite-make_request_fn-returns-blk_qc_t-in-ke.patch"
+ "${FILESDIR}/0005-LU-6215-gss-key-payload.data-is-an-array-in-4.4-kern.patch"
+ "${FILESDIR}/0006-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch"
+ "${FILESDIR}/0007-LU-6215-lnet-split-struct-ib_send_wr.patch"
+ "${FILESDIR}/0008-LU-6215-o2iblnd-ib_alloc_fast_reg_mr-removed-in-4.3.patch"
+ "${FILESDIR}/0009-LU-6215-o2iblnd-port-to-new-fast-reg-API-introduced-.patch"
+ "${FILESDIR}/0010-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch"
+ "${FILESDIR}/0011-LU-6215-llite-remove-obsolete-conditional-code.patch"
+ "${FILESDIR}/0012-LU-6215-lnet-split-struct-ib_send_wr.patch"
+ "${FILESDIR}/0013-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch"
+ "${FILESDIR}/0014-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch"
+ "${FILESDIR}/0015-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch"
+ "${FILESDIR}/0016-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch"
+ "${FILESDIR}/0017-LU-8056-llite-inode_operations-interface-changed-in-.patch"
+ "${FILESDIR}/0018-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch"
+ "${FILESDIR}/0019-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch"
+ "${FILESDIR}/lustre-do-not-include-udef.h.patch"
+ )
pkg_setup() {
filter-mfpmath sse
diff --git a/sys-cluster/lustre/lustre-9999.ebuild b/sys-cluster/lustre/lustre-9999.ebuild
index 4fab54d..c56b6b1 100644
--- a/sys-cluster/lustre/lustre-9999.ebuild
+++ b/sys-cluster/lustre/lustre-9999.ebuild
@@ -25,7 +25,7 @@ EGIT_REPO_URI="git://git.whamcloud.com/fs/lustre-release.git"
LICENSE="GPL-2"
SLOT="0"
-IUSE="client +utils modules server readline tests"
+IUSE="+client +utils +modules server readline tests"
RDEPEND="
virtual/awk
@@ -43,7 +43,28 @@ REQUIRED_USE="
modules? ( client )
modules? ( server )"
-PATCHES=( "${FILESDIR}/lustre-do-not-include-udef.h.patch" )
+PATCHES=(
+ "${FILESDIR}/0001-LU-6215-lprocfs-handle-seq_printf-api-change.patch"
+ "${FILESDIR}/0002-LU-6215-gss-cache_head-is-now-on-a-hlist-in-4.3-kern.patch"
+ "${FILESDIR}/0003-LU-6215-llite-handle-locks-API-change-in-4.4-kernels.patch"
+ "${FILESDIR}/0004-LU-6215-llite-make_request_fn-returns-blk_qc_t-in-ke.patch"
+ "${FILESDIR}/0005-LU-6215-gss-key-payload.data-is-an-array-in-4.4-kern.patch"
+ "${FILESDIR}/0006-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch"
+ "${FILESDIR}/0007-LU-6215-lnet-split-struct-ib_send_wr.patch"
+ "${FILESDIR}/0008-LU-6215-o2iblnd-ib_alloc_fast_reg_mr-removed-in-4.3.patch"
+ "${FILESDIR}/0009-LU-6215-o2iblnd-port-to-new-fast-reg-API-introduced-.patch"
+ "${FILESDIR}/0010-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch"
+ "${FILESDIR}/0011-LU-6215-llite-remove-obsolete-conditional-code.patch"
+ "${FILESDIR}/0012-LU-6215-lnet-split-struct-ib_send_wr.patch"
+ "${FILESDIR}/0013-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch"
+ "${FILESDIR}/0014-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch"
+ "${FILESDIR}/0015-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch"
+ "${FILESDIR}/0016-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch"
+ "${FILESDIR}/0017-LU-8056-llite-inode_operations-interface-changed-in-.patch"
+ "${FILESDIR}/0018-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch"
+ "${FILESDIR}/0019-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch"
+ "${FILESDIR}/lustre-do-not-include-udef.h.patch"
+ )
pkg_setup() {
filter-mfpmath sse
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sys-cluster/lustre/files/, sys-cluster/lustre/
@ 2016-06-13 10:38 Alexey Shvetsov
0 siblings, 0 replies; 5+ messages in thread
From: Alexey Shvetsov @ 2016-06-13 10:38 UTC (permalink / raw
To: gentoo-commits
commit: 91cef20bb91beb8672770f6337f5f37b94045b39
Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 13 10:38:26 2016 +0000
Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
CommitDate: Mon Jun 13 10:38:26 2016 +0000
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=91cef20b
sys-cluster/lustre: Move to 2.8.54
Package-Manager: portage-2.3.0_rc1
...6215-lprocfs-handle-seq_printf-api-change.patch | 4126 --------------------
...056-libcfs-Support-for-linux-4.2-kernels.patch} | 10 +-
...-cache_head-is-now-on-a-hlist-in-4.3-kern.patch | 192 -
...6-o2iblnd-ib_query_device-removed-in-4.5.patch} | 107 +-
...te-handle-locks-API-change-in-4.4-kernels.patch | 90 -
...lnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch} | 10 +-
...te-make_request_fn-returns-blk_qc_t-in-ke.patch | 95 -
...6-llite-use-inode_lock-to-access-i_mutex.patch} | 81 +-
...-key-payload.data-is-an-array-in-4.4-kern.patch | 229 --
...e-inode_operations-interface-changed-in-.patch} | 15 +-
| 106 -
...e-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch} | 4 +-
...0007-LU-6215-lnet-split-struct-ib_send_wr.patch | 451 ---
...p-fix-bio_for_each_segment_all-for-newer.patch} | 18 +-
...iblnd-ib_alloc_fast_reg_mr-removed-in-4.3.patch | 199 -
...blnd-port-to-new-fast-reg-API-introduced-.patch | 332 --
| 46 -
...15-llite-remove-obsolete-conditional-code.patch | 97 -
...0012-LU-6215-lnet-split-struct-ib_send_wr.patch | 169 -
.../{lustre-2.8.0.ebuild => lustre-2.8.54.ebuild} | 30 +-
sys-cluster/lustre/lustre-9999.ebuild | 23 +-
21 files changed, 113 insertions(+), 6317 deletions(-)
diff --git a/sys-cluster/lustre/files/0001-LU-6215-lprocfs-handle-seq_printf-api-change.patch b/sys-cluster/lustre/files/0001-LU-6215-lprocfs-handle-seq_printf-api-change.patch
deleted file mode 100644
index 744b9d2..0000000
--- a/sys-cluster/lustre/files/0001-LU-6215-lprocfs-handle-seq_printf-api-change.patch
+++ /dev/null
@@ -1,4126 +0,0 @@
-From cd60eb450f58589c39568507215e6366b41aa154 Mon Sep 17 00:00:00 2001
-From: James Simmons <uja.ornl@yahoo.com>
-Date: Wed, 23 Mar 2016 18:37:27 -0400
-Subject: [PATCH 01/19] LU-6215 lprocfs: handle seq_printf api change
-
-Starting with the 4.3 linux kernel seq_printf is a void
-function not returning the character count. This work
-updates lustre to treat seq_printf as a void function.
-Fixed alignment issues and ran this patch against the
-Linux kernels checkpatch to make it compliant to
-upstream standards.
-
-Change-Id: I0cfd71252322038c1b54da624fce48b37a6f30b6
-Signed-off-by: James Simmons <uja.ornl@yahoo.com>
-Reviewed-on: http://review.whamcloud.com/16933
-Tested-by: Jenkins
-Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
-Tested-by: Maloo <hpdd-maloo@intel.com>
-Reviewed-by: Bob Glossman <bob.glossman@intel.com>
-Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
----
- contrib/scripts/checkpatch.pl | 2 +
- libcfs/include/libcfs/libcfs_hash.h | 4 +-
- libcfs/libcfs/hash.c | 55 ++++----
- lustre/fid/lproc_fid.c | 47 +++----
- lustre/fld/lproc_fld.c | 2 +-
- lustre/ldlm/ldlm_pool.c | 21 ++-
- lustre/ldlm/ldlm_resource.c | 8 +-
- lustre/lfsck/lfsck_internal.h | 14 +-
- lustre/lfsck/lfsck_layout.c | 157 ++++++++++-----------
- lustre/lfsck/lfsck_lib.c | 66 ++++-----
- lustre/lfsck/lfsck_namespace.c | 234 +++++++++++++++-----------------
- lustre/llite/lproc_llite.c | 147 ++++++++++----------
- lustre/lmv/lproc_lmv.c | 17 ++-
- lustre/lod/lproc_lod.c | 50 ++++---
- lustre/lov/lproc_lov.c | 30 ++--
- lustre/mdc/lproc_mdc.c | 15 +-
- lustre/mdd/mdd_lproc.c | 6 +-
- lustre/mdt/mdt_coordinator.c | 15 +-
- lustre/mdt/mdt_hsm_cdt_actions.c | 54 ++++----
- lustre/mdt/mdt_lproc.c | 45 +++---
- lustre/mgc/mgc_request.c | 4 +-
- lustre/obdclass/genops.c | 4 +-
- lustre/obdclass/linux/linux-module.c | 29 ++--
- lustre/obdclass/lprocfs_jobstats.c | 3 +-
- lustre/obdclass/lprocfs_status.c | 176 ++++++++++++------------
- lustre/obdclass/lprocfs_status_server.c | 36 ++---
- lustre/obdclass/lu_object.c | 27 ++--
- lustre/ofd/lproc_ofd.c | 65 +++++----
- lustre/osc/lproc_osc.c | 95 +++++++------
- lustre/osd-ldiskfs/osd_lproc.c | 35 +++--
- lustre/osd-ldiskfs/osd_scrub.c | 160 +++++++++-------------
- lustre/osd-zfs/osd_lproc.c | 9 +-
- lustre/osp/lproc_osp.c | 60 +++++---
- lustre/ptlrpc/gss/lproc_gss.c | 42 +++---
- lustre/ptlrpc/lproc_ptlrpc.c | 47 ++++---
- lustre/ptlrpc/nodemap_lproc.c | 36 +++--
- lustre/ptlrpc/nrs_tbf.c | 6 +-
- lustre/ptlrpc/sec_bulk.c | 84 ++++++------
- lustre/quota/qsd_lib.c | 45 +++---
- 39 files changed, 974 insertions(+), 978 deletions(-)
-
-diff --git a/contrib/scripts/checkpatch.pl b/contrib/scripts/checkpatch.pl
-index dc85c7c..372ed4c 100755
---- a/contrib/scripts/checkpatch.pl
-+++ b/contrib/scripts/checkpatch.pl
-@@ -472,6 +472,8 @@ my %dep_functions = (
- 'strcat', 'strncat',
- 'tempnam', 'mkstemp',
- 'f_dentry', 'f_path.dentry',
-+ '= seq_printf', 'seq_printf',
-+ 'return seq_printf', 'seq_printf',
- );
-
- my @rawlines = ();
-diff --git a/libcfs/include/libcfs/libcfs_hash.h b/libcfs/include/libcfs/libcfs_hash.h
-index f076b37..6285c66 100644
---- a/libcfs/include/libcfs/libcfs_hash.h
-+++ b/libcfs/include/libcfs/libcfs_hash.h
-@@ -803,8 +803,8 @@ __cfs_hash_set_theta(struct cfs_hash *hs, int min, int max)
-
- /* Generic debug formatting routines mainly for proc handler */
- struct seq_file;
--int cfs_hash_debug_header(struct seq_file *m);
--int cfs_hash_debug_str(struct cfs_hash *hs, struct seq_file *m);
-+void cfs_hash_debug_header(struct seq_file *m);
-+void cfs_hash_debug_str(struct cfs_hash *hs, struct seq_file *m);
-
- /*
- * Generic djb2 hash algorithm for character arrays.
-diff --git a/libcfs/libcfs/hash.c b/libcfs/libcfs/hash.c
-index 02575fb..7afa6cc 100644
---- a/libcfs/libcfs/hash.c
-+++ b/libcfs/libcfs/hash.c
-@@ -2043,13 +2043,10 @@ void cfs_hash_rehash_key(struct cfs_hash *hs, const void *old_key,
- }
- EXPORT_SYMBOL(cfs_hash_rehash_key);
-
--int cfs_hash_debug_header(struct seq_file *m)
-+void cfs_hash_debug_header(struct seq_file *m)
- {
-- return seq_printf(m, "%-*s%6s%6s%6s%6s%6s%6s%6s%7s%8s%8s%8s%s\n",
-- CFS_HASH_BIGNAME_LEN,
-- "name", "cur", "min", "max", "theta", "t-min", "t-max",
-- "flags", "rehash", "count", "maxdep", "maxdepb",
-- " distribution");
-+ seq_printf(m, "%-*s cur min max theta t-min t-max flags rehash count maxdep maxdepb distribution\n",
-+ CFS_HASH_BIGNAME_LEN, "name");
- }
- EXPORT_SYMBOL(cfs_hash_debug_header);
-
-@@ -2077,31 +2074,28 @@ cfs_hash_full_nbkt(struct cfs_hash *hs)
- CFS_HASH_RH_NBKT(hs) : CFS_HASH_NBKT(hs);
- }
-
--int cfs_hash_debug_str(struct cfs_hash *hs, struct seq_file *m)
-+void cfs_hash_debug_str(struct cfs_hash *hs, struct seq_file *m)
- {
-- int dist[8] = { 0, };
-- int maxdep = -1;
-- int maxdepb = -1;
-- int total = 0;
-- int c = 0;
-- int theta;
-- int i;
-+ int dist[8] = { 0, };
-+ int maxdep = -1;
-+ int maxdepb = -1;
-+ int total = 0;
-+ int theta;
-+ int i;
-
- cfs_hash_lock(hs, 0);
- theta = __cfs_hash_theta(hs);
-
-- c += seq_printf(m, "%-*s ", CFS_HASH_BIGNAME_LEN, hs->hs_name);
-- c += seq_printf(m, "%5d ", 1 << hs->hs_cur_bits);
-- c += seq_printf(m, "%5d ", 1 << hs->hs_min_bits);
-- c += seq_printf(m, "%5d ", 1 << hs->hs_max_bits);
-- c += seq_printf(m, "%d.%03d ", __cfs_hash_theta_int(theta),
-- __cfs_hash_theta_frac(theta));
-- c += seq_printf(m, "%d.%03d ", __cfs_hash_theta_int(hs->hs_min_theta),
-- __cfs_hash_theta_frac(hs->hs_min_theta));
-- c += seq_printf(m, "%d.%03d ", __cfs_hash_theta_int(hs->hs_max_theta),
-- __cfs_hash_theta_frac(hs->hs_max_theta));
-- c += seq_printf(m, " 0x%02x ", hs->hs_flags);
-- c += seq_printf(m, "%6d ", hs->hs_rehash_count);
-+ seq_printf(m, "%-*s %5d %5d %5d %d.%03d %d.%03d %d.%03d 0x%02x %6d ",
-+ CFS_HASH_BIGNAME_LEN, hs->hs_name,
-+ 1 << hs->hs_cur_bits, 1 << hs->hs_min_bits,
-+ 1 << hs->hs_max_bits,
-+ __cfs_hash_theta_int(theta), __cfs_hash_theta_frac(theta),
-+ __cfs_hash_theta_int(hs->hs_min_theta),
-+ __cfs_hash_theta_frac(hs->hs_min_theta),
-+ __cfs_hash_theta_int(hs->hs_max_theta),
-+ __cfs_hash_theta_frac(hs->hs_max_theta),
-+ hs->hs_flags, hs->hs_rehash_count);
-
- /*
- * The distribution is a summary of the chained hash depth in
-@@ -2126,17 +2120,14 @@ int cfs_hash_debug_str(struct cfs_hash *hs, struct seq_file *m)
- maxdepb = ffz(~maxdep);
- }
- total += bd.bd_bucket->hsb_count;
-- dist[min(fls(bd.bd_bucket->hsb_count/max(theta,1)),7)]++;
-+ dist[min(fls(bd.bd_bucket->hsb_count / max(theta, 1)), 7)]++;
- cfs_hash_bd_unlock(hs, &bd, 0);
- }
-
-- c += seq_printf(m, "%7d ", total);
-- c += seq_printf(m, "%7d ", maxdep);
-- c += seq_printf(m, "%7d ", maxdepb);
-+ seq_printf(m, "%7d %7d %7d ", total, maxdep, maxdepb);
- for (i = 0; i < 8; i++)
-- c += seq_printf(m, "%d%c", dist[i], (i == 7) ? '\n' : '/');
-+ seq_printf(m, "%d%c", dist[i], (i == 7) ? '\n' : '/');
-
- cfs_hash_unlock(hs, 0);
-- return c;
- }
- EXPORT_SYMBOL(cfs_hash_debug_str);
-diff --git a/lustre/fid/lproc_fid.c b/lustre/fid/lproc_fid.c
-index 078df00..00b2c7b 100644
---- a/lustre/fid/lproc_fid.c
-+++ b/lustre/fid/lproc_fid.c
-@@ -127,17 +127,15 @@ static int
- lprocfs_server_fid_space_seq_show(struct seq_file *m, void *unused)
- {
- struct lu_server_seq *seq = (struct lu_server_seq *)m->private;
-- int rc;
- ENTRY;
-
- LASSERT(seq != NULL);
-
- mutex_lock(&seq->lss_mutex);
-- rc = seq_printf(m, "["LPX64" - "LPX64"]:%x:%s\n",
-- PRANGE(&seq->lss_space));
-+ seq_printf(m, "["LPX64" - "LPX64"]:%x:%s\n", PRANGE(&seq->lss_space));
- mutex_unlock(&seq->lss_mutex);
-
-- RETURN(rc);
-+ RETURN(0);
- }
-
- static int
-@@ -145,7 +143,6 @@ lprocfs_server_fid_server_seq_show(struct seq_file *m, void *unused)
- {
- struct lu_server_seq *seq = (struct lu_server_seq *)m->private;
- struct client_obd *cli;
-- int rc;
- ENTRY;
-
- LASSERT(seq != NULL);
-@@ -153,16 +150,15 @@ lprocfs_server_fid_server_seq_show(struct seq_file *m, void *unused)
- if (seq->lss_cli) {
- if (seq->lss_cli->lcs_exp != NULL) {
- cli = &seq->lss_cli->lcs_exp->exp_obd->u.cli;
-- rc = seq_printf(m, "%s\n", cli->cl_target_uuid.uuid);
-+ seq_printf(m, "%s\n", cli->cl_target_uuid.uuid);
- } else {
-- rc = seq_printf(m, "%s\n",
-- seq->lss_cli->lcs_srv->lss_name);
-+ seq_printf(m, "%s\n", seq->lss_cli->lcs_srv->lss_name);
- }
- } else {
-- rc = seq_printf(m, "<none>\n");
-+ seq_puts(m, "<none>\n");
- }
-
-- RETURN(rc);
-+ RETURN(0);
- }
-
- static ssize_t
-@@ -197,16 +193,15 @@ static int
- lprocfs_server_fid_width_seq_show(struct seq_file *m, void *unused)
- {
- struct lu_server_seq *seq = (struct lu_server_seq *)m->private;
-- int rc;
- ENTRY;
-
- LASSERT(seq != NULL);
-
- mutex_lock(&seq->lss_mutex);
-- rc = seq_printf(m, LPU64"\n", seq->lss_width);
-+ seq_printf(m, LPU64"\n", seq->lss_width);
- mutex_unlock(&seq->lss_mutex);
-
-- RETURN(rc);
-+ RETURN(0);
- }
-
- LPROC_SEQ_FOPS(lprocfs_server_fid_space);
-@@ -334,7 +329,7 @@ static int fldb_seq_show(struct seq_file *p, void *v)
- fld->lsf_name, rc);
- } else if (fld_rec.lsr_start != 0) {
- range_be_to_cpu(&fld_rec, &fld_rec);
-- rc = seq_printf(p, DRANGE"\n", PRANGE(&fld_rec));
-+ seq_printf(p, DRANGE"\n", PRANGE(&fld_rec));
- }
-
- return rc;
-@@ -533,17 +528,16 @@ static int
- lprocfs_client_fid_space_seq_show(struct seq_file *m, void *unused)
- {
- struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
-- int rc;
- ENTRY;
-
- LASSERT(seq != NULL);
-
- mutex_lock(&seq->lcs_mutex);
-- rc = seq_printf(m, "["LPX64" - "LPX64"]:%x:%s\n",
-- PRANGE(&seq->lcs_space));
-+ seq_printf(m, "["LPX64" - "LPX64"]:%x:%s\n",
-+ PRANGE(&seq->lcs_space));
- mutex_unlock(&seq->lcs_mutex);
-
-- RETURN(rc);
-+ RETURN(0);
- }
-
- static ssize_t
-@@ -585,32 +579,30 @@ static int
- lprocfs_client_fid_width_seq_show(struct seq_file *m, void *unused)
- {
- struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
-- int rc;
- ENTRY;
-
- LASSERT(seq != NULL);
-
- mutex_lock(&seq->lcs_mutex);
-- rc = seq_printf(m, LPU64"\n", seq->lcs_width);
-+ seq_printf(m, LPU64"\n", seq->lcs_width);
- mutex_unlock(&seq->lcs_mutex);
-
-- RETURN(rc);
-+ RETURN(0);
- }
-
- static int
- lprocfs_client_fid_fid_seq_show(struct seq_file *m, void *unused)
- {
- struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
-- int rc;
- ENTRY;
-
- LASSERT(seq != NULL);
-
- mutex_lock(&seq->lcs_mutex);
-- rc = seq_printf(m, DFID"\n", PFID(&seq->lcs_fid));
-+ seq_printf(m, DFID"\n", PFID(&seq->lcs_fid));
- mutex_unlock(&seq->lcs_mutex);
-
-- RETURN(rc);
-+ RETURN(0);
- }
-
- static int
-@@ -618,18 +610,17 @@ lprocfs_client_fid_server_seq_show(struct seq_file *m, void *unused)
- {
- struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
- struct client_obd *cli;
-- int rc;
- ENTRY;
-
- LASSERT(seq != NULL);
-
- if (seq->lcs_exp != NULL) {
- cli = &seq->lcs_exp->exp_obd->u.cli;
-- rc = seq_printf(m, "%s\n", cli->cl_target_uuid.uuid);
-+ seq_printf(m, "%s\n", cli->cl_target_uuid.uuid);
- } else {
-- rc = seq_printf(m, "%s\n", seq->lcs_srv->lss_name);
-+ seq_printf(m, "%s\n", seq->lcs_srv->lss_name);
- }
-- RETURN(rc);
-+ RETURN(0);
- }
-
- LPROC_SEQ_FOPS(lprocfs_client_fid_space);
-diff --git a/lustre/fld/lproc_fld.c b/lustre/fld/lproc_fld.c
-index 4ae4f26..24e336c 100644
---- a/lustre/fld/lproc_fld.c
-+++ b/lustre/fld/lproc_fld.c
-@@ -263,7 +263,7 @@ static int fldb_seq_show(struct seq_file *p, void *v)
- fld->lsf_name, rc);
- } else if (fld_rec->lsr_start != 0) {
- range_be_to_cpu(fld_rec, fld_rec);
-- rc = seq_printf(p, DRANGE"\n", PRANGE(fld_rec));
-+ seq_printf(p, DRANGE"\n", PRANGE(fld_rec));
- }
-
- return rc;
-diff --git a/lustre/ldlm/ldlm_pool.c b/lustre/ldlm/ldlm_pool.c
-index 5292266..5ed717c 100644
---- a/lustre/ldlm/ldlm_pool.c
-+++ b/lustre/ldlm/ldlm_pool.c
-@@ -685,20 +685,19 @@ static int lprocfs_pool_state_seq_show(struct seq_file *m, void *unused)
- spin_unlock(&pl->pl_lock);
-
- seq_printf(m, "LDLM pool state (%s):\n"
-- " SLV: "LPU64"\n"
-- " CLV: "LPU64"\n"
-- " LVF: %d\n",
-- pl->pl_name, slv, clv, lvf);
-+ " SLV: "LPU64"\n"
-+ " CLV: "LPU64"\n"
-+ " LVF: %d\n",
-+ pl->pl_name, slv, clv, lvf);
-
- if (ns_is_server(ldlm_pl2ns(pl))) {
-- seq_printf(m, " GSP: %d%%\n"
-- " GP: %d\n",
-- grant_step, grant_plan);
-+ seq_printf(m, " GSP: %d%%\n", grant_step);
-+ seq_printf(m, " GP: %d\n", grant_plan);
- }
-- seq_printf(m, " GR: %d\n" " CR: %d\n" " GS: %d\n"
-- " G: %d\n" " L: %d\n",
-- grant_rate, cancel_rate, grant_speed,
-- granted, limit);
-+
-+ seq_printf(m, " GR: %d\n CR: %d\n GS: %d\n G: %d\n L: %d\n",
-+ grant_rate, cancel_rate, grant_speed,
-+ granted, limit);
- return 0;
- }
- LPROC_SEQ_FOPS_RO(lprocfs_pool_state);
-diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c
-index 7ed21e3..7abcaaa 100644
---- a/lustre/ldlm/ldlm_resource.c
-+++ b/lustre/ldlm/ldlm_resource.c
-@@ -88,7 +88,8 @@ LPROC_SEQ_FOPS_RO_TYPE(ldlm, uint);
-
- static int seq_watermark_show(struct seq_file *m, void *data)
- {
-- return seq_printf(m, LPU64"\n", *(__u64 *)m->private);
-+ seq_printf(m, LPU64"\n", *(__u64 *)m->private);
-+ return 0;
- }
-
- static ssize_t seq_watermark_write(struct file *file,
-@@ -161,8 +162,9 @@ static const struct file_operations ldlm_watermark_fops = {
-
- static int seq_granted_show(struct seq_file *m, void *data)
- {
-- return seq_printf(m, LPU64"\n", percpu_counter_sum_positive(
-- (struct percpu_counter *)m->private));
-+ seq_printf(m, LPU64"\n", percpu_counter_sum_positive(
-+ (struct percpu_counter *)m->private));
-+ return 0;
- }
-
- static int seq_granted_open(struct inode *inode, struct file *file)
-diff --git a/lustre/lfsck/lfsck_internal.h b/lustre/lfsck/lfsck_internal.h
-index 281643e..a75e948 100644
---- a/lustre/lfsck/lfsck_internal.h
-+++ b/lustre/lfsck/lfsck_internal.h
-@@ -411,9 +411,9 @@ struct lfsck_operations {
- int result,
- bool init);
-
-- int (*lfsck_dump)(const struct lu_env *env,
-- struct lfsck_component *com,
-- struct seq_file *m);
-+ void (*lfsck_dump)(const struct lu_env *env,
-+ struct lfsck_component *com,
-+ struct seq_file *m);
-
- int (*lfsck_double_scan)(const struct lu_env *env,
- struct lfsck_component *com);
-@@ -917,11 +917,11 @@ void lfsck_component_cleanup(const struct lu_env *env,
- struct lfsck_component *com);
- void lfsck_instance_cleanup(const struct lu_env *env,
- struct lfsck_instance *lfsck);
--int lfsck_bits_dump(struct seq_file *m, int bits, const char *names[],
-+void lfsck_bits_dump(struct seq_file *m, int bits, const char *names[],
-+ const char *prefix);
-+void lfsck_time_dump(struct seq_file *m, __u64 time, const char *name);
-+void lfsck_pos_dump(struct seq_file *m, struct lfsck_position *pos,
- const char *prefix);
--int lfsck_time_dump(struct seq_file *m, __u64 time, const char *name);
--int lfsck_pos_dump(struct seq_file *m, struct lfsck_position *pos,
-- const char *prefix);
- void lfsck_pos_fill(const struct lu_env *env, struct lfsck_instance *lfsck,
- struct lfsck_position *pos, bool init);
- bool __lfsck_set_speed(struct lfsck_instance *lfsck, __u32 limit);
-diff --git a/lustre/lfsck/lfsck_layout.c b/lustre/lfsck/lfsck_layout.c
-index 66732d5..e40c311 100644
---- a/lustre/lfsck/lfsck_layout.c
-+++ b/lustre/lfsck/lfsck_layout.c
-@@ -4747,73 +4747,59 @@ static int lfsck_layout_slave_post(const struct lu_env *env,
- return rc;
- }
-
--static int lfsck_layout_dump(const struct lu_env *env,
-- struct lfsck_component *com, struct seq_file *m)
-+static void lfsck_layout_dump(const struct lu_env *env,
-+ struct lfsck_component *com, struct seq_file *m)
- {
- struct lfsck_instance *lfsck = com->lc_lfsck;
- struct lfsck_bookmark *bk = &lfsck->li_bookmark_ram;
- struct lfsck_layout *lo = com->lc_file_ram;
-- int rc;
-
- down_read(&com->lc_sem);
- seq_printf(m, "name: lfsck_layout\n"
-- "magic: %#x\n"
-- "version: %d\n"
-- "status: %s\n",
-- lo->ll_magic,
-- bk->lb_version,
-- lfsck_status2names(lo->ll_status));
--
-- rc = lfsck_bits_dump(m, lo->ll_flags, lfsck_flags_names, "flags");
-- if (rc < 0)
-- goto out;
-+ "magic: %#x\n"
-+ "version: %d\n"
-+ "status: %s\n",
-+ lo->ll_magic,
-+ bk->lb_version,
-+ lfsck_status2name(lo->ll_status));
-
-- rc = lfsck_bits_dump(m, bk->lb_param, lfsck_param_names, "param");
-- if (rc < 0)
-- goto out;
-+ lfsck_bits_dump(m, lo->ll_flags, lfsck_flags_names, "flags");
-
-- rc = lfsck_time_dump(m, lo->ll_time_last_complete,
-- "last_completed");
-- if (rc < 0)
-- goto out;
-+ lfsck_bits_dump(m, bk->lb_param, lfsck_param_names, "param");
-
-- rc = lfsck_time_dump(m, lo->ll_time_latest_start,
-- "latest_start");
-- if (rc < 0)
-- goto out;
-+ lfsck_time_dump(m, lo->ll_time_last_complete, "last_completed");
-
-- rc = lfsck_time_dump(m, lo->ll_time_last_checkpoint,
-- "last_checkpoint");
-- if (rc < 0)
-- goto out;
-+ lfsck_time_dump(m, lo->ll_time_latest_start, "latest_start");
-+
-+ lfsck_time_dump(m, lo->ll_time_last_checkpoint, "last_checkpoint");
-
- seq_printf(m, "latest_start_position: "LPU64"\n"
-- "last_checkpoint_position: "LPU64"\n"
-- "first_failure_position: "LPU64"\n",
-- lo->ll_pos_latest_start,
-- lo->ll_pos_last_checkpoint,
-- lo->ll_pos_first_inconsistent);
-+ "last_checkpoint_position: "LPU64"\n"
-+ "first_failure_position: "LPU64"\n",
-+ lo->ll_pos_latest_start,
-+ lo->ll_pos_last_checkpoint,
-+ lo->ll_pos_first_inconsistent);
-
- seq_printf(m, "success_count: %u\n"
-- "repaired_dangling: "LPU64"\n"
-- "repaired_unmatched_pair: "LPU64"\n"
-- "repaired_multiple_referenced: "LPU64"\n"
-- "repaired_orphan: "LPU64"\n"
-- "repaired_inconsistent_owner: "LPU64"\n"
-- "repaired_others: "LPU64"\n"
-- "skipped: "LPU64"\n"
-- "failed_phase1: "LPU64"\n"
-- "failed_phase2: "LPU64"\n",
-- lo->ll_success_count,
-- lo->ll_objs_repaired[LLIT_DANGLING - 1],
-- lo->ll_objs_repaired[LLIT_UNMATCHED_PAIR - 1],
-- lo->ll_objs_repaired[LLIT_MULTIPLE_REFERENCED - 1],
-- lo->ll_objs_repaired[LLIT_ORPHAN - 1],
-- lo->ll_objs_repaired[LLIT_INCONSISTENT_OWNER - 1],
-- lo->ll_objs_repaired[LLIT_OTHERS - 1],
-- lo->ll_objs_skipped,
-- lo->ll_objs_failed_phase1,
-- lo->ll_objs_failed_phase2);
-+ "repaired_dangling: "LPU64"\n"
-+ "repaired_unmatched_pair: "LPU64"\n"
-+ "repaired_multiple_referenced: "LPU64"\n"
-+ "repaired_orphan: "LPU64"\n"
-+ "repaired_inconsistent_owner: "LPU64"\n"
-+ "repaired_others: "LPU64"\n"
-+ "skipped: "LPU64"\n"
-+ "failed_phase1: "LPU64"\n"
-+ "failed_phase2: "LPU64"\n",
-+ lo->ll_success_count,
-+ lo->ll_objs_repaired[LLIT_DANGLING - 1],
-+ lo->ll_objs_repaired[LLIT_UNMATCHED_PAIR - 1],
-+ lo->ll_objs_repaired[LLIT_MULTIPLE_REFERENCED - 1],
-+ lo->ll_objs_repaired[LLIT_ORPHAN - 1],
-+ lo->ll_objs_repaired[LLIT_INCONSISTENT_OWNER - 1],
-+ lo->ll_objs_repaired[LLIT_OTHERS - 1],
-+ lo->ll_objs_skipped,
-+ lo->ll_objs_failed_phase1,
-+ lo->ll_objs_failed_phase2);
-
- if (lo->ll_status == LS_SCANNING_PHASE1) {
- __u64 pos;
-@@ -4833,19 +4819,19 @@ static int lfsck_layout_dump(const struct lu_env *env,
- if (rtime != 0)
- do_div(speed, rtime);
- seq_printf(m, "checked_phase1: "LPU64"\n"
-- "checked_phase2: "LPU64"\n"
-- "run_time_phase1: %u seconds\n"
-- "run_time_phase2: %u seconds\n"
-- "average_speed_phase1: "LPU64" items/sec\n"
-- "average_speed_phase2: N/A\n"
-- "real-time_speed_phase1: "LPU64" items/sec\n"
-- "real-time_speed_phase2: N/A\n",
-- checked,
-- lo->ll_objs_checked_phase2,
-- rtime,
-- lo->ll_run_time_phase2,
-- speed,
-- new_checked);
-+ "checked_phase2: "LPU64"\n"
-+ "run_time_phase1: %u seconds\n"
-+ "run_time_phase2: %u seconds\n"
-+ "average_speed_phase1: "LPU64" items/sec\n"
-+ "average_speed_phase2: N/A\n"
-+ "real-time_speed_phase1: "LPU64" items/sec\n"
-+ "real-time_speed_phase2: N/A\n",
-+ checked,
-+ lo->ll_objs_checked_phase2,
-+ rtime,
-+ lo->ll_run_time_phase2,
-+ speed,
-+ new_checked);
-
- LASSERT(lfsck->li_di_oit != NULL);
-
-@@ -4878,26 +4864,23 @@ static int lfsck_layout_dump(const struct lu_env *env,
- do_div(speed1, lo->ll_run_time_phase1);
- if (rtime != 0)
- do_div(speed2, rtime);
-- rc = seq_printf(m, "checked_phase1: "LPU64"\n"
-- "checked_phase2: "LPU64"\n"
-- "run_time_phase1: %u seconds\n"
-- "run_time_phase2: %u seconds\n"
-- "average_speed_phase1: "LPU64" items/sec\n"
-- "average_speed_phase2: "LPU64" items/sec\n"
-- "real-time_speed_phase1: N/A\n"
-- "real-time_speed_phase2: "LPU64" items/sec\n"
-- "current_position: "DFID"\n",
-- lo->ll_objs_checked_phase1,
-- checked,
-- lo->ll_run_time_phase1,
-- rtime,
-- speed1,
-- speed2,
-- new_checked,
-- PFID(&com->lc_fid_latest_scanned_phase2));
-- if (rc <= 0)
-- goto out;
--
-+ seq_printf(m, "checked_phase1: "LPU64"\n"
-+ "checked_phase2: "LPU64"\n"
-+ "run_time_phase1: %u seconds\n"
-+ "run_time_phase2: %u seconds\n"
-+ "average_speed_phase1: "LPU64" items/sec\n"
-+ "average_speed_phase2: "LPU64" items/sec\n"
-+ "real-time_speed_phase1: N/A\n"
-+ "real-time_speed_phase2: "LPU64" items/sec\n"
-+ "current_position: "DFID"\n",
-+ lo->ll_objs_checked_phase1,
-+ checked,
-+ lo->ll_run_time_phase1,
-+ rtime,
-+ speed1,
-+ speed2,
-+ new_checked,
-+ PFID(&com->lc_fid_latest_scanned_phase2));
- } else {
- __u64 speed1 = lo->ll_objs_checked_phase1;
- __u64 speed2 = lo->ll_objs_checked_phase2;
-@@ -4922,10 +4905,8 @@ static int lfsck_layout_dump(const struct lu_env *env,
- speed1,
- speed2);
- }
--out:
-- up_read(&com->lc_sem);
-
-- return rc;
-+ up_read(&com->lc_sem);
- }
-
- static int lfsck_layout_master_double_scan(const struct lu_env *env,
-diff --git a/lustre/lfsck/lfsck_lib.c b/lustre/lfsck/lfsck_lib.c
-index 139c95b..1064392 100644
---- a/lustre/lfsck/lfsck_lib.c
-+++ b/lustre/lfsck/lfsck_lib.c
-@@ -1749,17 +1749,14 @@ static inline int lfsck_instance_add(struct lfsck_instance *lfsck)
- return 0;
- }
-
--int lfsck_bits_dump(struct seq_file *m, int bits, const char *names[],
-- const char *prefix)
-+void lfsck_bits_dump(struct seq_file *m, int bits, const char *names[],
-+ const char *prefix)
- {
- int flag;
- int i;
- bool newline = (bits != 0 ? false : true);
-- int rc;
-
-- rc = seq_printf(m, "%s:%c", prefix, bits != 0 ? ' ' : '\n');
-- if (rc < 0)
-- return rc;
-+ seq_printf(m, "%s:%c", prefix, bits != 0 ? ' ' : '\n');
-
- for (i = 0, flag = 1; bits != 0; i++, flag = 1 << i) {
- if (flag & bits) {
-@@ -1768,54 +1765,43 @@ int lfsck_bits_dump(struct seq_file *m, int bits, const char *names[],
- if (bits == 0)
- newline = true;
-
-- rc = seq_printf(m, "%s%c", names[i],
-- newline ? '\n' : ',');
-- if (rc < 0)
-- return rc;
-+ seq_printf(m, "%s%c", names[i],
-+ newline ? '\n' : ',');
- }
- }
- }
-
- if (!newline)
-- rc = seq_printf(m, "\n");
--
-- return rc;
-+ seq_putc(m, '\n');
- }
-
--int lfsck_time_dump(struct seq_file *m, __u64 time, const char *name)
-+void lfsck_time_dump(struct seq_file *m, __u64 time, const char *name)
- {
-- int rc;
--
- if (time == 0) {
-- rc = seq_printf(m, "%s_time: N/A\n", name);
-- if (rc == 0)
-- rc = seq_printf(m, "time_since_%s: N/A\n", name);
--
-- return rc;
-+ seq_printf(m, "%s_time: N/A\n", name);
-+ seq_printf(m, "time_since_%s: N/A\n", name);
-+ } else {
-+ seq_printf(m, "%s_time: "LPU64"\n", name, time);
-+ seq_printf(m, "time_since_%s: "LPU64" seconds\n",
-+ name, cfs_time_current_sec() - time);
- }
--
-- rc = seq_printf(m, "%s_time: "LPU64"\n", name, time);
-- if (rc == 0)
-- rc = seq_printf(m, "time_since_%s: "LPU64" seconds\n",
-- name, cfs_time_current_sec() - time);
--
-- return rc;
- }
-
--int lfsck_pos_dump(struct seq_file *m, struct lfsck_position *pos,
-- const char *prefix)
-+void lfsck_pos_dump(struct seq_file *m, struct lfsck_position *pos,
-+ const char *prefix)
- {
- if (fid_is_zero(&pos->lp_dir_parent)) {
-- if (pos->lp_oit_cookie == 0)
-- return seq_printf(m, "%s: N/A, N/A, N/A\n", prefix);
--
-- return seq_printf(m, "%s: "LPU64", N/A, N/A\n",
-- prefix, pos->lp_oit_cookie);
-+ if (pos->lp_oit_cookie == 0) {
-+ seq_printf(m, "%s: N/A, N/A, N/A\n", prefix);
-+ return;
-+ }
-+ seq_printf(m, "%s: "LPU64", N/A, N/A\n",
-+ prefix, pos->lp_oit_cookie);
-+ } else {
-+ seq_printf(m, "%s: "LPU64", "DFID", "LPX64"\n",
-+ prefix, pos->lp_oit_cookie,
-+ PFID(&pos->lp_dir_parent), pos->lp_dir_cookie);
- }
--
-- return seq_printf(m, "%s: "LPU64", "DFID", "LPX64"\n",
-- prefix, pos->lp_oit_cookie,
-- PFID(&pos->lp_dir_parent), pos->lp_dir_cookie);
- }
-
- void lfsck_pos_fill(const struct lu_env *env, struct lfsck_instance *lfsck,
-@@ -2696,7 +2682,7 @@ int lfsck_dump(struct seq_file *m, struct dt_device *key, enum lfsck_type type)
- if (likely(lfsck != NULL)) {
- com = lfsck_component_find(lfsck, type);
- if (likely(com != NULL)) {
-- rc = com->lc_ops->lfsck_dump(&env, com, m);
-+ com->lc_ops->lfsck_dump(&env, com, m);
- lfsck_component_put(&env, com);
- } else {
- rc = -ENOTSUPP;
-diff --git a/lustre/lfsck/lfsck_namespace.c b/lustre/lfsck/lfsck_namespace.c
-index fa448bb..a97fa17 100644
---- a/lustre/lfsck/lfsck_namespace.c
-+++ b/lustre/lfsck/lfsck_namespace.c
-@@ -3611,75 +3611,75 @@ static void lfsck_namespace_dump_statistics(struct seq_file *m,
- __u32 time_phase2)
- {
- seq_printf(m, "checked_phase1: "LPU64"\n"
-- "checked_phase2: "LPU64"\n"
-- "updated_phase1: "LPU64"\n"
-- "updated_phase2: "LPU64"\n"
-- "failed_phase1: "LPU64"\n"
-- "failed_phase2: "LPU64"\n"
-- "directories: "LPU64"\n"
-- "dirent_repaired: "LPU64"\n"
-- "linkea_repaired: "LPU64"\n"
-- "nlinks_repaired: "LPU64"\n"
-- "multiple_linked_checked: "LPU64"\n"
-- "multiple_linked_repaired: "LPU64"\n"
-- "unknown_inconsistency: "LPU64"\n"
-- "unmatched_pairs_repaired: "LPU64"\n"
-- "dangling_repaired: "LPU64"\n"
-- "multiple_referenced_repaired: "LPU64"\n"
-- "bad_file_type_repaired: "LPU64"\n"
-- "lost_dirent_repaired: "LPU64"\n"
-- "local_lost_found_scanned: "LPU64"\n"
-- "local_lost_found_moved: "LPU64"\n"
-- "local_lost_found_skipped: "LPU64"\n"
-- "local_lost_found_failed: "LPU64"\n"
-- "striped_dirs_scanned: "LPU64"\n"
-- "striped_dirs_repaired: "LPU64"\n"
-- "striped_dirs_failed: "LPU64"\n"
-- "striped_dirs_disabled: "LPU64"\n"
-- "striped_dirs_skipped: "LPU64"\n"
-- "striped_shards_scanned: "LPU64"\n"
-- "striped_shards_repaired: "LPU64"\n"
-- "striped_shards_failed: "LPU64"\n"
-- "striped_shards_skipped: "LPU64"\n"
-- "name_hash_repaired: "LPU64"\n"
-- "success_count: %u\n"
-- "run_time_phase1: %u seconds\n"
-- "run_time_phase2: %u seconds\n",
-- checked_phase1,
-- checked_phase2,
-- ns->ln_items_repaired,
-- ns->ln_objs_repaired_phase2,
-- ns->ln_items_failed,
-- ns->ln_objs_failed_phase2,
-- ns->ln_dirs_checked,
-- ns->ln_dirent_repaired,
-- ns->ln_linkea_repaired,
-- ns->ln_objs_nlink_repaired,
-- ns->ln_mul_linked_checked,
-- ns->ln_mul_linked_repaired,
-- ns->ln_unknown_inconsistency,
-- ns->ln_unmatched_pairs_repaired,
-- ns->ln_dangling_repaired,
-- ns->ln_mul_ref_repaired,
-- ns->ln_bad_type_repaired,
-- ns->ln_lost_dirent_repaired,
-- ns->ln_local_lpf_scanned,
-- ns->ln_local_lpf_moved,
-- ns->ln_local_lpf_skipped,
-- ns->ln_local_lpf_failed,
-- ns->ln_striped_dirs_scanned,
-- ns->ln_striped_dirs_repaired,
-- ns->ln_striped_dirs_failed,
-- ns->ln_striped_dirs_disabled,
-- ns->ln_striped_dirs_skipped,
-- ns->ln_striped_shards_scanned,
-- ns->ln_striped_shards_repaired,
-- ns->ln_striped_shards_failed,
-- ns->ln_striped_shards_skipped,
-- ns->ln_name_hash_repaired,
-- ns->ln_success_count,
-- time_phase1,
-- time_phase2);
-+ "checked_phase2: "LPU64"\n"
-+ "updated_phase1: "LPU64"\n"
-+ "updated_phase2: "LPU64"\n"
-+ "failed_phase1: "LPU64"\n"
-+ "failed_phase2: "LPU64"\n"
-+ "directories: "LPU64"\n"
-+ "dirent_repaired: "LPU64"\n"
-+ "linkea_repaired: "LPU64"\n"
-+ "nlinks_repaired: "LPU64"\n"
-+ "multiple_linked_checked: "LPU64"\n"
-+ "multiple_linked_repaired: "LPU64"\n"
-+ "unknown_inconsistency: "LPU64"\n"
-+ "unmatched_pairs_repaired: "LPU64"\n"
-+ "dangling_repaired: "LPU64"\n"
-+ "multiple_referenced_repaired: "LPU64"\n"
-+ "bad_file_type_repaired: "LPU64"\n"
-+ "lost_dirent_repaired: "LPU64"\n"
-+ "local_lost_found_scanned: "LPU64"\n"
-+ "local_lost_found_moved: "LPU64"\n"
-+ "local_lost_found_skipped: "LPU64"\n"
-+ "local_lost_found_failed: "LPU64"\n"
-+ "striped_dirs_scanned: "LPU64"\n"
-+ "striped_dirs_repaired: "LPU64"\n"
-+ "striped_dirs_failed: "LPU64"\n"
-+ "striped_dirs_disabled: "LPU64"\n"
-+ "striped_dirs_skipped: "LPU64"\n"
-+ "striped_shards_scanned: "LPU64"\n"
-+ "striped_shards_repaired: "LPU64"\n"
-+ "striped_shards_failed: "LPU64"\n"
-+ "striped_shards_skipped: "LPU64"\n"
-+ "name_hash_repaired: "LPU64"\n"
-+ "success_count: %u\n"
-+ "run_time_phase1: %u seconds\n"
-+ "run_time_phase2: %u seconds\n",
-+ checked_phase1,
-+ checked_phase2,
-+ ns->ln_items_repaired,
-+ ns->ln_objs_repaired_phase2,
-+ ns->ln_items_failed,
-+ ns->ln_objs_failed_phase2,
-+ ns->ln_dirs_checked,
-+ ns->ln_dirent_repaired,
-+ ns->ln_linkea_repaired,
-+ ns->ln_objs_nlink_repaired,
-+ ns->ln_mul_linked_checked,
-+ ns->ln_mul_linked_repaired,
-+ ns->ln_unknown_inconsistency,
-+ ns->ln_unmatched_pairs_repaired,
-+ ns->ln_dangling_repaired,
-+ ns->ln_mul_ref_repaired,
-+ ns->ln_bad_type_repaired,
-+ ns->ln_lost_dirent_repaired,
-+ ns->ln_local_lpf_scanned,
-+ ns->ln_local_lpf_moved,
-+ ns->ln_local_lpf_skipped,
-+ ns->ln_local_lpf_failed,
-+ ns->ln_striped_dirs_scanned,
-+ ns->ln_striped_dirs_repaired,
-+ ns->ln_striped_dirs_failed,
-+ ns->ln_striped_dirs_disabled,
-+ ns->ln_striped_dirs_skipped,
-+ ns->ln_striped_shards_scanned,
-+ ns->ln_striped_shards_repaired,
-+ ns->ln_striped_shards_failed,
-+ ns->ln_striped_shards_skipped,
-+ ns->ln_name_hash_repaired,
-+ ns->ln_success_count,
-+ time_phase1,
-+ time_phase2);
- }
-
- static void lfsck_namespace_release_lmv(const struct lu_env *env,
-@@ -4243,14 +4243,13 @@ static int lfsck_namespace_post(const struct lu_env *env,
- RETURN(rc);
- }
-
--static int
-+static void
- lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
- struct seq_file *m)
- {
- struct lfsck_instance *lfsck = com->lc_lfsck;
- struct lfsck_bookmark *bk = &lfsck->li_bookmark_ram;
- struct lfsck_namespace *ns = com->lc_file_ram;
-- int rc;
-
- down_read(&com->lc_sem);
- seq_printf(m, "name: lfsck_namespace\n"
-@@ -4261,43 +4260,23 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
- bk->lb_version,
- lfsck_status2names(ns->ln_status));
-
-- rc = lfsck_bits_dump(m, ns->ln_flags, lfsck_flags_names, "flags");
-- if (rc < 0)
-- goto out;
-+ lfsck_bits_dump(m, ns->ln_flags, lfsck_flags_names, "flags");
-
-- rc = lfsck_bits_dump(m, bk->lb_param, lfsck_param_names, "param");
-- if (rc < 0)
-- goto out;
-+ lfsck_bits_dump(m, bk->lb_param, lfsck_param_names, "param");
-
-- rc = lfsck_time_dump(m, ns->ln_time_last_complete,
-- "last_completed");
-- if (rc < 0)
-- goto out;
-+ lfsck_time_dump(m, ns->ln_time_last_complete, "last_completed");
-
-- rc = lfsck_time_dump(m, ns->ln_time_latest_start,
-- "latest_start");
-- if (rc < 0)
-- goto out;
-+ lfsck_time_dump(m, ns->ln_time_latest_start, "latest_start");
-
-- rc = lfsck_time_dump(m, ns->ln_time_last_checkpoint,
-- "last_checkpoint");
-- if (rc < 0)
-- goto out;
-+ lfsck_time_dump(m, ns->ln_time_last_checkpoint, "last_checkpoint");
-
-- rc = lfsck_pos_dump(m, &ns->ln_pos_latest_start,
-- "latest_start_position");
-- if (rc < 0)
-- goto out;
-+ lfsck_pos_dump(m, &ns->ln_pos_latest_start, "latest_start_position");
-
-- rc = lfsck_pos_dump(m, &ns->ln_pos_last_checkpoint,
-- "last_checkpoint_position");
-- if (rc < 0)
-- goto out;
-+ lfsck_pos_dump(m, &ns->ln_pos_last_checkpoint,
-+ "last_checkpoint_position");
-
-- rc = lfsck_pos_dump(m, &ns->ln_pos_first_inconsistent,
-- "first_failure_position");
-- if (rc < 0)
-- goto out;
-+ lfsck_pos_dump(m, &ns->ln_pos_first_inconsistent,
-+ "first_failure_position");
-
- if (ns->ln_status == LS_SCANNING_PHASE1) {
- struct lfsck_position pos;
-@@ -4319,13 +4298,13 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
-
- lfsck_namespace_dump_statistics(m, ns, checked, 0, rtime, 0);
- seq_printf(m, "average_speed_phase1: "LPU64" items/sec\n"
-- "average_speed_phase2: N/A\n"
-- "average_speed_total: "LPU64" items/sec\n"
-- "real_time_speed_phase1: "LPU64" items/sec\n"
-- "real_time_speed_phase2: N/A\n",
-- speed,
-- speed,
-- new_checked);
-+ "average_speed_phase2: N/A\n"
-+ "average_speed_total: "LPU64" items/sec\n"
-+ "real_time_speed_phase1: "LPU64" items/sec\n"
-+ "real_time_speed_phase2: N/A\n",
-+ speed,
-+ speed,
-+ new_checked);
-
- LASSERT(lfsck->li_di_oit != NULL);
-
-@@ -4389,16 +4368,16 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
- checked,
- ns->ln_run_time_phase1, rtime);
- seq_printf(m, "average_speed_phase1: "LPU64" items/sec\n"
-- "average_speed_phase2: "LPU64" objs/sec\n"
-- "average_speed_total: "LPU64" items/sec\n"
-- "real_time_speed_phase1: N/A\n"
-- "real_time_speed_phase2: "LPU64" objs/sec\n"
-- "current_position: "DFID"\n",
-- speed1,
-- speed2,
-- speed0,
-- new_checked,
-- PFID(&ns->ln_fid_latest_scanned_phase2));
-+ "average_speed_phase2: "LPU64" objs/sec\n"
-+ "average_speed_total: "LPU64" items/sec\n"
-+ "real_time_speed_phase1: N/A\n"
-+ "real_time_speed_phase2: "LPU64" objs/sec\n"
-+ "current_position: "DFID"\n",
-+ speed1,
-+ speed2,
-+ speed0,
-+ new_checked,
-+ PFID(&ns->ln_fid_latest_scanned_phase2));
- } else {
- __u64 speed1 = ns->ln_items_checked;
- __u64 speed2 = ns->ln_objs_checked_phase2;
-@@ -4423,18 +4402,17 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
- ns->ln_run_time_phase1,
- ns->ln_run_time_phase2);
- seq_printf(m, "average_speed_phase1: "LPU64" items/sec\n"
-- "average_speed_phase2: "LPU64" objs/sec\n"
-- "average_speed_total: "LPU64" items/sec\n"
-- "real_time_speed_phase1: N/A\n"
-- "real_time_speed_phase2: N/A\n"
-- "current_position: N/A\n",
-- speed1,
-- speed2,
-- speed0);
-+ "average_speed_phase2: "LPU64" objs/sec\n"
-+ "average_speed_total: "LPU64" items/sec\n"
-+ "real_time_speed_phase1: N/A\n"
-+ "real_time_speed_phase2: N/A\n"
-+ "current_position: N/A\n",
-+ speed1,
-+ speed2,
-+ speed0);
- }
--out:
-+
- up_read(&com->lc_sem);
-- return 0;
- }
-
- static int lfsck_namespace_double_scan(const struct lu_env *env,
-diff --git a/lustre/llite/lproc_llite.c b/lustre/llite/lproc_llite.c
-index e631f50..1767a00 100644
---- a/lustre/llite/lproc_llite.c
-+++ b/lustre/llite/lproc_llite.c
-@@ -66,7 +66,7 @@ static int ll_blksize_seq_show(struct seq_file *m, void *v)
- cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
- OBD_STATFS_NODELAY);
- if (!rc)
-- rc = seq_printf(m, "%u\n", osfs.os_bsize);
-+ seq_printf(m, "%u\n", osfs.os_bsize);
- return rc;
- }
- LPROC_SEQ_FOPS_RO(ll_blksize);
-@@ -88,7 +88,7 @@ static int ll_kbytestotal_seq_show(struct seq_file *m, void *v)
- while (blk_size >>= 1)
- result <<= 1;
-
-- rc = seq_printf(m, LPU64"\n", result);
-+ seq_printf(m, LPU64"\n", result);
- }
- return rc;
- }
-@@ -111,7 +111,7 @@ static int ll_kbytesfree_seq_show(struct seq_file *m, void *v)
- while (blk_size >>= 1)
- result <<= 1;
-
-- rc = seq_printf(m, LPU64"\n", result);
-+ seq_printf(m, LPU64"\n", result);
- }
- return rc;
- }
-@@ -134,7 +134,7 @@ static int ll_kbytesavail_seq_show(struct seq_file *m, void *v)
- while (blk_size >>= 1)
- result <<= 1;
-
-- rc = seq_printf(m, LPU64"\n", result);
-+ seq_printf(m, LPU64"\n", result);
- }
- return rc;
- }
-@@ -151,7 +151,7 @@ static int ll_filestotal_seq_show(struct seq_file *m, void *v)
- cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
- OBD_STATFS_NODELAY);
- if (!rc)
-- rc = seq_printf(m, LPU64"\n", osfs.os_files);
-+ seq_printf(m, LPU64"\n", osfs.os_files);
- return rc;
- }
- LPROC_SEQ_FOPS_RO(ll_filestotal);
-@@ -167,7 +167,7 @@ static int ll_filesfree_seq_show(struct seq_file *m, void *v)
- cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
- OBD_STATFS_NODELAY);
- if (!rc)
-- rc = seq_printf(m, LPU64"\n", osfs.os_ffree);
-+ seq_printf(m, LPU64"\n", osfs.os_ffree);
- return rc;
- }
- LPROC_SEQ_FOPS_RO(ll_filesfree);
-@@ -175,15 +175,14 @@ LPROC_SEQ_FOPS_RO(ll_filesfree);
- static int ll_client_type_seq_show(struct seq_file *m, void *v)
- {
- struct ll_sb_info *sbi = ll_s2sbi((struct super_block *)m->private);
-- int rc;
-
- LASSERT(sbi != NULL);
-
- if (sbi->ll_flags & LL_SBI_RMT_CLIENT)
-- rc = seq_printf(m, "remote client\n");
-+ seq_puts(m, "remote client\n");
- else
-- rc = seq_printf(m, "local client\n");
-- return rc;
-+ seq_puts(m, "local client\n");
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ll_client_type);
-
-@@ -192,7 +191,8 @@ static int ll_fstype_seq_show(struct seq_file *m, void *v)
- struct super_block *sb = m->private;
-
- LASSERT(sb != NULL);
-- return seq_printf(m, "%s\n", sb->s_type->name);
-+ seq_printf(m, "%s\n", sb->s_type->name);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ll_fstype);
-
-@@ -201,7 +201,8 @@ static int ll_sb_uuid_seq_show(struct seq_file *m, void *v)
- struct super_block *sb = m->private;
-
- LASSERT(sb != NULL);
-- return seq_printf(m, "%s\n", ll_s2sbi(sb)->ll_sb_uuid.uuid);
-+ seq_printf(m, "%s\n", ll_s2sbi(sb)->ll_sb_uuid.uuid);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ll_sb_uuid);
-
-@@ -209,7 +210,8 @@ static int ll_xattr_cache_seq_show(struct seq_file *m, void *v)
- {
- struct ll_sb_info *sbi = ll_s2sbi((struct super_block *)m->private);
-
-- return seq_printf(m, "%u\n", sbi->ll_xattr_cache_enabled);
-+ seq_printf(m, "%u\n", sbi->ll_xattr_cache_enabled);
-+ return 0;
- }
-
- static ssize_t ll_xattr_cache_seq_write(struct file *file,
-@@ -407,17 +409,17 @@ static int ll_max_cached_mb_seq_show(struct seq_file *m, void *v)
-
- max_cached_mb = cache->ccc_lru_max >> shift;
- unused_mb = atomic_long_read(&cache->ccc_lru_left) >> shift;
-- return seq_printf(m,
-- "users: %d\n"
-- "max_cached_mb: %ld\n"
-- "used_mb: %ld\n"
-- "unused_mb: %ld\n"
-- "reclaim_count: %u\n",
-- atomic_read(&cache->ccc_users),
-- max_cached_mb,
-- max_cached_mb - unused_mb,
-- unused_mb,
-- cache->ccc_lru_shrinkers);
-+ seq_printf(m, "users: %d\n"
-+ "max_cached_mb: %ld\n"
-+ "used_mb: %ld\n"
-+ "unused_mb: %ld\n"
-+ "reclaim_count: %u\n",
-+ atomic_read(&cache->ccc_users),
-+ max_cached_mb,
-+ max_cached_mb - unused_mb,
-+ unused_mb,
-+ cache->ccc_lru_shrinkers);
-+ return 0;
- }
-
- static ssize_t
-@@ -538,7 +540,8 @@ static int ll_checksum_seq_show(struct seq_file *m, void *v)
- struct super_block *sb = m->private;
- struct ll_sb_info *sbi = ll_s2sbi(sb);
-
-- return seq_printf(m, "%u\n", (sbi->ll_flags & LL_SBI_CHECKSUM) ? 1 : 0);
-+ seq_printf(m, "%u\n", (sbi->ll_flags & LL_SBI_CHECKSUM) ? 1 : 0);
-+ return 0;
- }
-
- static ssize_t ll_checksum_seq_write(struct file *file,
-@@ -575,13 +578,14 @@ static int ll_rd_track_id(struct seq_file *m, enum stats_track_type type)
- struct super_block *sb = m->private;
-
- if (ll_s2sbi(sb)->ll_stats_track_type == type) {
-- return seq_printf(m, "%d\n",
-- ll_s2sbi(sb)->ll_stats_track_id);
-+ seq_printf(m, "%d\n",
-+ ll_s2sbi(sb)->ll_stats_track_id);
- } else if (ll_s2sbi(sb)->ll_stats_track_type == STATS_TRACK_ALL) {
-- return seq_printf(m, "0 (all)\n");
-+ seq_puts(m, "0 (all)\n");
- } else {
-- return seq_printf(m, "untracked\n");
-+ seq_puts(m, "untracked\n");
- }
-+ return 0;
- }
-
- static int ll_wr_track_id(const char __user *buffer, unsigned long count,
-@@ -649,7 +653,8 @@ static int ll_statahead_max_seq_show(struct seq_file *m, void *v)
- struct super_block *sb = m->private;
- struct ll_sb_info *sbi = ll_s2sbi(sb);
-
-- return seq_printf(m, "%u\n", sbi->ll_sa_max);
-+ seq_printf(m, "%u\n", sbi->ll_sa_max);
-+ return 0;
- }
-
- static ssize_t ll_statahead_max_seq_write(struct file *file,
-@@ -679,8 +684,9 @@ static int ll_statahead_agl_seq_show(struct seq_file *m, void *v)
- struct super_block *sb = m->private;
- struct ll_sb_info *sbi = ll_s2sbi(sb);
-
-- return seq_printf(m, "%u\n",
-- sbi->ll_flags & LL_SBI_AGL_ENABLED ? 1 : 0);
-+ seq_printf(m, "%u\n",
-+ sbi->ll_flags & LL_SBI_AGL_ENABLED ? 1 : 0);
-+ return 0;
- }
-
- static ssize_t ll_statahead_agl_seq_write(struct file *file,
-@@ -709,13 +715,13 @@ static int ll_statahead_stats_seq_show(struct seq_file *m, void *v)
- struct super_block *sb = m->private;
- struct ll_sb_info *sbi = ll_s2sbi(sb);
-
-- return seq_printf(m,
-- "statahead total: %u\n"
-- "statahead wrong: %u\n"
-- "agl total: %u\n",
-- atomic_read(&sbi->ll_sa_total),
-- atomic_read(&sbi->ll_sa_wrong),
-- atomic_read(&sbi->ll_agl_total));
-+ seq_printf(m, "statahead total: %u\n"
-+ "statahead wrong: %u\n"
-+ "agl total: %u\n",
-+ atomic_read(&sbi->ll_sa_total),
-+ atomic_read(&sbi->ll_sa_wrong),
-+ atomic_read(&sbi->ll_agl_total));
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ll_statahead_stats);
-
-@@ -724,8 +730,9 @@ static int ll_lazystatfs_seq_show(struct seq_file *m, void *v)
- struct super_block *sb = m->private;
- struct ll_sb_info *sbi = ll_s2sbi(sb);
-
-- return seq_printf(m, "%u\n",
-- (sbi->ll_flags & LL_SBI_LAZYSTATFS) ? 1 : 0);
-+ seq_printf(m, "%u\n",
-+ (sbi->ll_flags & LL_SBI_LAZYSTATFS) ? 1 : 0);
-+ return 0;
- }
-
- static ssize_t ll_lazystatfs_seq_write(struct file *file,
-@@ -760,7 +767,8 @@ static int ll_max_easize_seq_show(struct seq_file *m, void *v)
- if (rc)
- return rc;
-
-- return seq_printf(m, "%u\n", ealen);
-+ seq_printf(m, "%u\n", ealen);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ll_max_easize);
-
-@@ -786,7 +794,8 @@ static int ll_default_easize_seq_show(struct seq_file *m, void *v)
- if (rc)
- return rc;
-
-- return seq_printf(m, "%u\n", ealen);
-+ seq_printf(m, "%u\n", ealen);
-+ return 0;
- }
-
- /**
-@@ -865,10 +874,11 @@ static int ll_unstable_stats_seq_show(struct seq_file *m, void *v)
- pages = atomic_long_read(&cache->ccc_unstable_nr);
- mb = (pages * PAGE_CACHE_SIZE) >> 20;
-
-- return seq_printf(m, "unstable_check: %8d\n"
-- "unstable_pages: %12ld\n"
-- "unstable_mb: %8d\n",
-- cache->ccc_unstable_check, pages, mb);
-+ seq_printf(m, "unstable_check: %8d\n"
-+ "unstable_pages: %12ld\n"
-+ "unstable_mb: %8d\n",
-+ cache->ccc_unstable_check, pages, mb);
-+ return 0;
- }
-
- static ssize_t ll_unstable_stats_seq_write(struct file *file,
-@@ -910,7 +920,8 @@ static int ll_root_squash_seq_show(struct seq_file *m, void *v)
- struct ll_sb_info *sbi = ll_s2sbi(sb);
- struct root_squash_info *squash = &sbi->ll_squash;
-
-- return seq_printf(m, "%u:%u\n", squash->rsi_uid, squash->rsi_gid);
-+ seq_printf(m, "%u:%u\n", squash->rsi_uid, squash->rsi_gid);
-+ return 0;
- }
-
- static ssize_t ll_root_squash_seq_write(struct file *file,
-@@ -932,20 +943,20 @@ static int ll_nosquash_nids_seq_show(struct seq_file *m, void *v)
- struct super_block *sb = m->private;
- struct ll_sb_info *sbi = ll_s2sbi(sb);
- struct root_squash_info *squash = &sbi->ll_squash;
-- int len, rc;
-+ int len;
-
- down_read(&squash->rsi_sem);
- if (!list_empty(&squash->rsi_nosquash_nids)) {
- len = cfs_print_nidlist(m->buf + m->count, m->size - m->count,
- &squash->rsi_nosquash_nids);
- m->count += len;
-- rc = seq_printf(m, "\n");
-+ seq_putc(m, '\n');
- } else {
-- rc = seq_printf(m, "NONE\n");
-+ seq_puts(m, "NONE\n");
- }
- up_read(&squash->rsi_sem);
-
-- return rc;
-+ return 0;
- }
-
- static ssize_t ll_nosquash_nids_seq_write(struct file *file,
-@@ -1333,9 +1344,7 @@ static int ll_rw_extents_stats_pp_seq_show(struct seq_file *seq, void *v)
- do_gettimeofday(&now);
-
- if (!sbi->ll_rw_stats_on) {
-- seq_printf(seq, "disabled\n"
-- "write anything in this file to activate, "
-- "then 0 or \"[D/d]isabled\" to deactivate\n");
-+ seq_puts(seq, "disabled\n write anything in this file to activate, then 0 or \[D/d]isabled\" to deactivate\n");
- return 0;
- }
- seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
-@@ -1412,18 +1421,16 @@ static int ll_rw_extents_stats_seq_show(struct seq_file *seq, void *v)
- do_gettimeofday(&now);
-
- if (!sbi->ll_rw_stats_on) {
-- seq_printf(seq, "disabled\n"
-- "write anything in this file to activate, "
-- "then 0 or \"[D/d]isabled\" to deactivate\n");
-- return 0;
-- }
-- seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
-- now.tv_sec, now.tv_usec);
-+ seq_puts(seq, "disabled\n write anything in this file to activate, then 0 or \"[D/d]isabled\" to deactivate\n");
-+ return 0;
-+ }
-+ seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
-+ now.tv_sec, now.tv_usec);
-
-- seq_printf(seq, "%15s %19s | %20s\n", " ", "read", "write");
-- seq_printf(seq, "%13s %14s %4s %4s | %14s %4s %4s\n",
-- "extents", "calls", "%", "cum%",
-- "calls", "%", "cum%");
-+ seq_printf(seq, "%15s %19s | %20s\n", " ", "read", "write");
-+ seq_printf(seq, "%13s %14s %4s %4s | %14s %4s %4s\n",
-+ "extents", "calls", "%", "cum%",
-+ "calls", "%", "cum%");
- spin_lock(&sbi->ll_lock);
- ll_display_extents_info(io_extents, seq, LL_PROCESS_HIST_MAX);
- spin_unlock(&sbi->ll_lock);
-@@ -1591,11 +1598,9 @@ static int ll_rw_offset_stats_seq_show(struct seq_file *seq, void *v)
- do_gettimeofday(&now);
-
- if (!sbi->ll_rw_stats_on) {
-- seq_printf(seq, "disabled\n"
-- "write anything in this file to activate, "
-- "then 0 or \"[D/d]isabled\" to deactivate\n");
-- return 0;
-- }
-+ seq_puts(seq, "disabled\n write anything in this file to activate, then 0 or \"[D/d]isabled\" to deactivate\n");
-+ return 0;
-+ }
- spin_lock(&sbi->ll_process_lock);
-
- seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
-diff --git a/lustre/lmv/lproc_lmv.c b/lustre/lmv/lproc_lmv.c
-index 1f8b5a6..251dd93 100644
---- a/lustre/lmv/lproc_lmv.c
-+++ b/lustre/lmv/lproc_lmv.c
-@@ -55,7 +55,8 @@ static int lmv_numobd_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- desc = &dev->u.lmv.desc;
-- return seq_printf(m, "%u\n", desc->ld_tgt_count);
-+ seq_printf(m, "%u\n", desc->ld_tgt_count);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(lmv_numobd);
-
-@@ -89,7 +90,8 @@ static int lmv_placement_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- lmv = &dev->u.lmv;
-- return seq_printf(m, "%s\n", placement_policy2name(lmv->lmv_placement));
-+ seq_printf(m, "%s\n", placement_policy2name(lmv->lmv_placement));
-+ return 0;
- }
-
- #define MAX_POLICY_STRING_SIZE 64
-@@ -137,7 +139,8 @@ static int lmv_activeobd_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- desc = &dev->u.lmv.desc;
-- return seq_printf(m, "%u\n", desc->ld_active_tgt_count);
-+ seq_printf(m, "%u\n", desc->ld_active_tgt_count);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(lmv_activeobd);
-
-@@ -148,7 +151,8 @@ static int lmv_desc_uuid_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- lmv = &dev->u.lmv;
-- return seq_printf(m, "%s\n", lmv->desc.ld_uuid.uuid);
-+ seq_printf(m, "%s\n", lmv->desc.ld_uuid.uuid);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(lmv_desc_uuid);
-
-@@ -178,8 +182,9 @@ static int lmv_tgt_seq_show(struct seq_file *p, void *v)
-
- if (tgt == NULL)
- return 0;
-- return seq_printf(p, "%u: %s %sACTIVE\n", tgt->ltd_idx,
-- tgt->ltd_uuid.uuid, tgt->ltd_active ? "" : "IN");
-+ seq_printf(p, "%u: %s %sACTIVE\n", tgt->ltd_idx,
-+ tgt->ltd_uuid.uuid, tgt->ltd_active ? "" : "IN");
-+ return 0;
- }
-
- static const struct seq_operations lmv_tgt_sops = {
-diff --git a/lustre/lod/lproc_lod.c b/lustre/lod/lproc_lod.c
-index b02697f..06e2314 100644
---- a/lustre/lod/lproc_lod.c
-+++ b/lustre/lod/lproc_lod.c
-@@ -65,8 +65,9 @@ static int lod_stripesize_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- lod = lu2lod_dev(dev->obd_lu_dev);
-- return seq_printf(m, LPU64"\n",
-- lod->lod_desc.ld_default_stripe_size);
-+ seq_printf(m, LPU64"\n",
-+ lod->lod_desc.ld_default_stripe_size);
-+ return 0;
- }
-
- /**
-@@ -120,8 +121,9 @@ static int lod_stripeoffset_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- lod = lu2lod_dev(dev->obd_lu_dev);
-- return seq_printf(m, LPU64"\n",
-- lod->lod_desc.ld_default_stripe_offset);
-+ seq_printf(m, LPU64"\n",
-+ lod->lod_desc.ld_default_stripe_offset);
-+ return 0;
- }
-
- /**
-@@ -175,7 +177,8 @@ static int lod_stripetype_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- lod = lu2lod_dev(dev->obd_lu_dev);
-- return seq_printf(m, "%u\n", lod->lod_desc.ld_pattern);
-+ seq_printf(m, "%u\n", lod->lod_desc.ld_pattern);
-+ return 0;
- }
-
- /**
-@@ -227,8 +230,9 @@ static int lod_stripecount_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- lod = lu2lod_dev(dev->obd_lu_dev);
-- return seq_printf(m, "%d\n",
-- (__s16)(lod->lod_desc.ld_default_stripe_count + 1) - 1);
-+ seq_printf(m, "%d\n",
-+ (__s16)(lod->lod_desc.ld_default_stripe_count + 1) - 1);
-+ return 0;
- }
-
- /**
-@@ -280,7 +284,8 @@ static int lod_numobd_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- lod = lu2lod_dev(dev->obd_lu_dev);
-- return seq_printf(m, "%u\n", lod->lod_desc.ld_tgt_count);
-+ seq_printf(m, "%u\n", lod->lod_desc.ld_tgt_count);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(lod_numobd);
-
-@@ -300,7 +305,8 @@ static int lod_activeobd_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- lod = lu2lod_dev(dev->obd_lu_dev);
-- return seq_printf(m, "%u\n", lod->lod_desc.ld_active_tgt_count);
-+ seq_printf(m, "%u\n", lod->lod_desc.ld_active_tgt_count);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(lod_activeobd);
-
-@@ -320,7 +326,8 @@ static int lod_desc_uuid_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- lod = lu2lod_dev(dev->obd_lu_dev);
-- return seq_printf(m, "%s\n", lod->lod_desc.ld_uuid.uuid);
-+ seq_printf(m, "%s\n", lod->lod_desc.ld_uuid.uuid);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(lod_desc_uuid);
-
-@@ -344,8 +351,9 @@ static int lod_qos_priofree_seq_show(struct seq_file *m, void *v)
- struct lod_device *lod = lu2lod_dev(dev->obd_lu_dev);
-
- LASSERT(lod != NULL);
-- return seq_printf(m, "%d%%\n",
-- (lod->lod_qos.lq_prio_free * 100 + 255) >> 8);
-+ seq_printf(m, "%d%%\n",
-+ (lod->lod_qos.lq_prio_free * 100 + 255) >> 8);
-+ return 0;
- }
-
- /**
-@@ -405,8 +413,9 @@ static int lod_qos_thresholdrr_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- lod = lu2lod_dev(dev->obd_lu_dev);
-- return seq_printf(m, "%d%%\n",
-- (lod->lod_qos.lq_threshold_rr * 100 + 255) >> 8);
-+ seq_printf(m, "%d%%\n",
-+ (lod->lod_qos.lq_threshold_rr * 100 + 255) >> 8);
-+ return 0;
- }
-
- /**
-@@ -468,7 +477,8 @@ static int lod_qos_maxage_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- lod = lu2lod_dev(dev->obd_lu_dev);
-- return seq_printf(m, "%u Sec\n", lod->lod_desc.ld_qos_maxage);
-+ seq_printf(m, "%u Sec\n", lod->lod_desc.ld_qos_maxage);
-+ return 0;
- }
-
- /**
-@@ -612,9 +622,10 @@ static int lod_osts_seq_show(struct seq_file *p, void *v)
- } else if (rc)
- return rc;
-
-- return seq_printf(p, "%d: %s %sACTIVE\n", idx,
-- obd_uuid2str(&ost_desc->ltd_uuid),
-- active ? "" : "IN");
-+ seq_printf(p, "%d: %s %sACTIVE\n", idx,
-+ obd_uuid2str(&ost_desc->ltd_uuid),
-+ active ? "" : "IN");
-+ return 0;
- }
-
- static const struct seq_operations lod_osts_sops = {
-@@ -664,7 +675,8 @@ static int lod_lmv_failout_seq_show(struct seq_file *m, void *v)
- LASSERT(dev != NULL);
- lod = lu2lod_dev(dev->obd_lu_dev);
-
-- return seq_printf(m, "%d\n", lod->lod_lmv_failout ? 1 : 0);
-+ seq_printf(m, "%d\n", lod->lod_lmv_failout ? 1 : 0);
-+ return 0;
- }
-
- /**
-diff --git a/lustre/lov/lproc_lov.c b/lustre/lov/lproc_lov.c
-index 386ee62..4732a35 100644
---- a/lustre/lov/lproc_lov.c
-+++ b/lustre/lov/lproc_lov.c
-@@ -51,7 +51,8 @@ static int lov_stripesize_seq_show(struct seq_file *m, void *v)
- LASSERT(dev != NULL);
- desc = &dev->u.lov.desc;
-
-- return seq_printf(m, LPU64"\n", desc->ld_default_stripe_size);
-+ seq_printf(m, LPU64"\n", desc->ld_default_stripe_size);
-+ return 0;
- }
-
- static ssize_t lov_stripesize_seq_write(struct file *file,
-@@ -82,7 +83,8 @@ static int lov_stripeoffset_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- desc = &dev->u.lov.desc;
-- return seq_printf(m, LPU64"\n", desc->ld_default_stripe_offset);
-+ seq_printf(m, LPU64"\n", desc->ld_default_stripe_offset);
-+ return 0;
- }
-
- static ssize_t lov_stripeoffset_seq_write(struct file *file,
-@@ -112,7 +114,8 @@ static int lov_stripetype_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- desc = &dev->u.lov.desc;
-- return seq_printf(m, "%u\n", desc->ld_pattern);
-+ seq_printf(m, "%u\n", desc->ld_pattern);
-+ return 0;
- }
-
- static ssize_t lov_stripetype_seq_write(struct file *file,
-@@ -142,8 +145,9 @@ static int lov_stripecount_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- desc = &dev->u.lov.desc;
-- return seq_printf(m, "%d\n",
-- (__s16)(desc->ld_default_stripe_count + 1) - 1);
-+ seq_printf(m, "%d\n",
-+ (__s16)(desc->ld_default_stripe_count + 1) - 1);
-+ return 0;
- }
-
- static ssize_t lov_stripecount_seq_write(struct file *file,
-@@ -173,7 +177,8 @@ static int lov_numobd_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- desc = &dev->u.lov.desc;
-- return seq_printf(m, "%u\n", desc->ld_tgt_count);
-+ seq_printf(m, "%u\n", desc->ld_tgt_count);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(lov_numobd);
-
-@@ -184,7 +189,8 @@ static int lov_activeobd_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- desc = &dev->u.lov.desc;
-- return seq_printf(m, "%u\n", desc->ld_active_tgt_count);
-+ seq_printf(m, "%u\n", desc->ld_active_tgt_count);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(lov_activeobd);
-
-@@ -195,7 +201,8 @@ static int lov_desc_uuid_seq_show(struct seq_file *m, void *v)
-
- LASSERT(dev != NULL);
- lov = &dev->u.lov;
-- return seq_printf(m, "%s\n", lov->desc.ld_uuid.uuid);
-+ seq_printf(m, "%s\n", lov->desc.ld_uuid.uuid);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(lov_desc_uuid);
-
-@@ -231,9 +238,10 @@ static void *lov_tgt_seq_next(struct seq_file *p, void *v, loff_t *pos)
- static int lov_tgt_seq_show(struct seq_file *p, void *v)
- {
- struct lov_tgt_desc *tgt = v;
-- return seq_printf(p, "%d: %s %sACTIVE\n", tgt->ltd_index,
-- obd_uuid2str(&tgt->ltd_uuid),
-- tgt->ltd_active ? "" : "IN");
-+ seq_printf(p, "%d: %s %sACTIVE\n", tgt->ltd_index,
-+ obd_uuid2str(&tgt->ltd_uuid),
-+ tgt->ltd_active ? "" : "IN");
-+ return 0;
- }
-
- static const struct seq_operations lov_tgt_sops = {
-diff --git a/lustre/mdc/lproc_mdc.c b/lustre/mdc/lproc_mdc.c
-index 023b779..c8b0cd6 100644
---- a/lustre/mdc/lproc_mdc.c
-+++ b/lustre/mdc/lproc_mdc.c
-@@ -46,12 +46,11 @@
- static int mdc_active_seq_show(struct seq_file *m, void *v)
- {
- struct obd_device *dev = m->private;
-- int rc;
-
- LPROCFS_CLIMP_CHECK(dev);
-- rc = seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
-+ seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
- LPROCFS_CLIMP_EXIT(dev);
-- return rc;
-+ return 0;
- }
-
- static ssize_t mdc_active_seq_write(struct file *file,
-@@ -82,12 +81,11 @@ static int mdc_max_rpcs_in_flight_seq_show(struct seq_file *m, void *v)
- {
- struct obd_device *dev = m->private;
- __u32 max;
-- int rc;
-
- max = obd_get_max_rpcs_in_flight(&dev->u.cli);
-- rc = seq_printf(m, "%u\n", max);
-+ seq_printf(m, "%u\n", max);
-
-- return rc;
-+ return 0;
- }
-
- static ssize_t mdc_max_rpcs_in_flight_seq_write(struct file *file,
-@@ -115,12 +113,11 @@ static int mdc_max_mod_rpcs_in_flight_seq_show(struct seq_file *m, void *v)
- {
- struct obd_device *dev = m->private;
- __u16 max;
-- int rc;
-
- max = obd_get_max_mod_rpcs_in_flight(&dev->u.cli);
-- rc = seq_printf(m, "%hu\n", max);
-+ seq_printf(m, "%hu\n", max);
-
-- return rc;
-+ return 0;
- }
-
- static ssize_t mdc_max_mod_rpcs_in_flight_seq_write(struct file *file,
-diff --git a/lustre/mdd/mdd_lproc.c b/lustre/mdd/mdd_lproc.c
-index c09ee9c..1329852 100644
---- a/lustre/mdd/mdd_lproc.c
-+++ b/lustre/mdd/mdd_lproc.c
-@@ -78,7 +78,8 @@ static int mdd_atime_diff_seq_show(struct seq_file *m, void *data)
- {
- struct mdd_device *mdd = m->private;
-
-- return seq_printf(m, "%lu\n", mdd->mdd_atime_diff);
-+ seq_printf(m, "%lu\n", mdd->mdd_atime_diff);
-+ return 0;
- }
- LPROC_SEQ_FOPS(mdd_atime_diff);
-
-@@ -182,7 +183,8 @@ static int mdd_sync_perm_seq_show(struct seq_file *m, void *data)
- struct mdd_device *mdd = m->private;
-
- LASSERT(mdd != NULL);
-- return seq_printf(m, "%d\n", mdd->mdd_sync_permission);
-+ seq_printf(m, "%d\n", mdd->mdd_sync_permission);
-+ return 0;
- }
-
- static ssize_t
-diff --git a/lustre/mdt/mdt_coordinator.c b/lustre/mdt/mdt_coordinator.c
-index 27ff1e3..9f371bc 100644
---- a/lustre/mdt/mdt_coordinator.c
-+++ b/lustre/mdt/mdt_coordinator.c
-@@ -2067,17 +2067,20 @@ int mdt_hsm_cdt_control_seq_show(struct seq_file *m, void *data)
- static int
- mdt_hsm_request_mask_show(struct seq_file *m, __u64 mask)
- {
-- int i, rc = 0;
-+ bool first = true;
-+ int i;
- ENTRY;
-
- for (i = 0; i < 8 * sizeof(mask); i++) {
-- if (mask & (1UL << i))
-- rc += seq_printf(m, "%s%s", rc == 0 ? "" : " ",
-- hsm_copytool_action2name(i));
-+ if (mask & (1UL << i)) {
-+ seq_printf(m, "%s%s", first ? "" : " ",
-+ hsm_copytool_action2name(i));
-+ first = false;
-+ }
- }
-- rc += seq_printf(m, "\n");
-+ seq_putc(m, '\n');
-
-- RETURN(rc);
-+ RETURN(0);
- }
-
- static int
-diff --git a/lustre/mdt/mdt_hsm_cdt_actions.c b/lustre/mdt/mdt_hsm_cdt_actions.c
-index 59cbfe2..342a919 100644
---- a/lustre/mdt/mdt_hsm_cdt_actions.c
-+++ b/lustre/mdt/mdt_hsm_cdt_actions.c
-@@ -398,7 +398,7 @@ static int hsm_actions_show_cb(const struct lu_env *env,
- struct llog_agent_req_rec *larr = (struct llog_agent_req_rec *)hdr;
- struct seq_file *s = data;
- struct agent_action_iterator *aai;
-- int rc, sz;
-+ int sz;
- size_t count;
- char buf[12];
- ENTRY;
-@@ -417,35 +417,29 @@ static int hsm_actions_show_cb(const struct lu_env *env,
-
- count = s->count;
- sz = larr->arr_hai.hai_len - sizeof(larr->arr_hai);
-- rc = seq_printf(s, "lrh=[type=%X len=%d idx=%d/%d] fid="DFID
-- " dfid="DFID
-- " compound/cookie="LPX64"/"LPX64
-- " action=%s archive#=%d flags="LPX64
-- " extent="LPX64"-"LPX64
-- " gid="LPX64" datalen=%d status=%s"
-- " data=[%s]\n",
-- hdr->lrh_type, hdr->lrh_len,
-- llh->lgh_hdr->llh_cat_idx, hdr->lrh_index,
-- PFID(&larr->arr_hai.hai_fid),
-- PFID(&larr->arr_hai.hai_dfid),
-- larr->arr_compound_id, larr->arr_hai.hai_cookie,
-- hsm_copytool_action2name(larr->arr_hai.hai_action),
-- larr->arr_archive_id,
-- larr->arr_flags,
-- larr->arr_hai.hai_extent.offset,
-- larr->arr_hai.hai_extent.length,
-- larr->arr_hai.hai_gid, sz,
-- agent_req_status2name(larr->arr_status),
-- hai_dump_data_field(&larr->arr_hai, buf, sizeof(buf)));
-- if (rc == 0) {
-- aai->aai_cat_index = llh->lgh_hdr->llh_cat_idx;
-- aai->aai_index = hdr->lrh_index;
-- } else {
-- if (s->count == s->size && count > 0) /* rewind the buffer */
-- s->count = count;
-- rc = LLOG_PROC_BREAK;
-- }
-- RETURN(rc);
-+ seq_printf(s, "lrh=[type=%X len=%d idx=%d/%d] fid="DFID
-+ " dfid="DFID" compound/cookie="LPX64"/"LPX64
-+ " action=%s archive#=%d flags="LPX64
-+ " extent="LPX64"-"LPX64
-+ " gid="LPX64" datalen=%d status=%s data=[%s]\n",
-+ hdr->lrh_type, hdr->lrh_len,
-+ llh->lgh_hdr->llh_cat_idx, hdr->lrh_index,
-+ PFID(&larr->arr_hai.hai_fid),
-+ PFID(&larr->arr_hai.hai_dfid),
-+ larr->arr_compound_id, larr->arr_hai.hai_cookie,
-+ hsm_copytool_action2name(larr->arr_hai.hai_action),
-+ larr->arr_archive_id,
-+ larr->arr_flags,
-+ larr->arr_hai.hai_extent.offset,
-+ larr->arr_hai.hai_extent.length,
-+ larr->arr_hai.hai_gid, sz,
-+ agent_req_status2name(larr->arr_status),
-+ hai_dump_data_field(&larr->arr_hai, buf, sizeof(buf)));
-+
-+ aai->aai_cat_index = llh->lgh_hdr->llh_cat_idx;
-+ aai->aai_index = hdr->lrh_index;
-+
-+ RETURN(0);
- }
-
- /**
-diff --git a/lustre/mdt/mdt_lproc.c b/lustre/mdt/mdt_lproc.c
-index 58728e8..612da16 100644
---- a/lustre/mdt/mdt_lproc.c
-+++ b/lustre/mdt/mdt_lproc.c
-@@ -217,7 +217,8 @@ static int mdt_identity_expire_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-
-- return seq_printf(m, "%u\n", mdt->mdt_identity_cache->uc_entry_expire);
-+ seq_printf(m, "%u\n", mdt->mdt_identity_cache->uc_entry_expire);
-+ return 0;
- }
-
- static ssize_t
-@@ -243,7 +244,8 @@ static int mdt_identity_acquire_expire_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-
-- return seq_printf(m, "%u\n", mdt->mdt_identity_cache->uc_acquire_expire);
-+ seq_printf(m, "%u\n", mdt->mdt_identity_cache->uc_acquire_expire);
-+ return 0;
- }
-
- static ssize_t
-@@ -479,7 +481,8 @@ static int mdt_evict_tgt_nids_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-
-- return seq_printf(m, "%u\n", mdt->mdt_opts.mo_evict_tgt_nids);
-+ seq_printf(m, "%u\n", mdt->mdt_opts.mo_evict_tgt_nids);
-+ return 0;
- }
-
- static ssize_t
-@@ -505,7 +508,8 @@ static int mdt_sec_level_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-
-- return seq_printf(m, "%d\n", mdt->mdt_lut.lut_sec_level);
-+ seq_printf(m, "%d\n", mdt->mdt_lut.lut_sec_level);
-+ return 0;
- }
-
- static ssize_t
-@@ -540,7 +544,8 @@ static int mdt_cos_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-
-- return seq_printf(m, "%u\n", mdt_cos_is_enabled(mdt));
-+ seq_printf(m, "%u\n", mdt_cos_is_enabled(mdt));
-+ return 0;
- }
-
- static ssize_t
-@@ -566,8 +571,9 @@ static int mdt_root_squash_seq_show(struct seq_file *m, void *data)
- struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
- struct root_squash_info *squash = &mdt->mdt_squash;
-
-- return seq_printf(m, "%u:%u\n", squash->rsi_uid,
-- squash->rsi_gid);
-+ seq_printf(m, "%u:%u\n", squash->rsi_uid,
-+ squash->rsi_gid);
-+ return 0;
- }
-
- static ssize_t
-@@ -589,19 +595,19 @@ static int mdt_nosquash_nids_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
- struct root_squash_info *squash = &mdt->mdt_squash;
-- int len = 0, rc;
-+ int len = 0;
-
- down_read(&squash->rsi_sem);
- if (!list_empty(&squash->rsi_nosquash_nids)) {
- len = cfs_print_nidlist(m->buf + m->count, m->size - m->count,
- &squash->rsi_nosquash_nids);
- m->count += len;
-- rc = seq_printf(m, "\n");
-+ seq_putc(m, '\n');
- } else
-- rc = seq_printf(m, "NONE\n");
-+ seq_puts(m, "NONE\n");
- up_read(&squash->rsi_sem);
-
-- return rc;
-+ return 0;
- }
-
- static ssize_t
-@@ -623,7 +629,8 @@ static int mdt_enable_remote_dir_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-
-- return seq_printf(m, "%u\n", mdt->mdt_enable_remote_dir);
-+ seq_printf(m, "%u\n", mdt->mdt_enable_remote_dir);
-+ return 0;
- }
-
- static ssize_t
-@@ -653,8 +660,9 @@ static int mdt_enable_remote_dir_gid_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-
-- return seq_printf(m, "%d\n",
-- (int)mdt->mdt_enable_remote_dir_gid);
-+ seq_printf(m, "%d\n",
-+ (int)mdt->mdt_enable_remote_dir_gid);
-+ return 0;
- }
-
- static ssize_t
-@@ -692,7 +700,8 @@ static int mdt_slc_seq_show(struct seq_file *m, void *data)
- struct lu_target *tgt = obd->u.obt.obt_lut;
- char *slc_states[] = {"never", "blocking", "always" };
-
-- return seq_printf(m, "%s\n", slc_states[tgt->lut_sync_lock_cancel]);
-+ seq_printf(m, "%s\n", slc_states[tgt->lut_sync_lock_cancel]);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(mdt_slc);
-
-@@ -710,7 +719,8 @@ static int mdt_async_commit_count_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-
-- return seq_printf(m, "%d\n", atomic_read(&mdt->mdt_async_commit_count));
-+ seq_printf(m, "%d\n", atomic_read(&mdt->mdt_async_commit_count));
-+ return 0;
- }
-
- static ssize_t
-@@ -747,7 +757,8 @@ static int mdt_sync_count_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct lu_target *tgt = obd->u.obt.obt_lut;
-
-- return seq_printf(m, "%d\n", atomic_read(&tgt->lut_sync_count));
-+ seq_printf(m, "%d\n", atomic_read(&tgt->lut_sync_count));
-+ return 0;
- }
-
- static ssize_t
-diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c
-index 9dc2a3e..3c83dc0 100644
---- a/lustre/mgc/mgc_request.c
-+++ b/lustre/mgc/mgc_request.c
-@@ -490,8 +490,8 @@ int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data)
- if (cld->cld_recover == NULL)
- continue;
- seq_printf(m, " - { client: %s, nidtbl_version: %u }\n",
-- cld->cld_logname,
-- cld->cld_recover->cld_cfg.cfg_last_idx);
-+ cld->cld_logname,
-+ cld->cld_recover->cld_cfg.cfg_last_idx);
- }
- spin_unlock(&config_list_lock);
-
-diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c
-index 7ca03f0..c13c9333 100644
---- a/lustre/obdclass/genops.c
-+++ b/lustre/obdclass/genops.c
-@@ -2184,8 +2184,8 @@ int obd_mod_rpc_stats_seq_show(struct client_obd *cli,
- unsigned long mod = cli->cl_mod_rpcs_hist.oh_buckets[i];
- mod_cum += mod;
- seq_printf(seq, "%d:\t\t%10lu %3lu %3lu\n",
-- i, mod, pct(mod, mod_tot),
-- pct(mod_cum, mod_tot));
-+ i, mod, pct(mod, mod_tot),
-+ pct(mod_cum, mod_tot));
- if (mod_cum == mod_tot)
- break;
- }
-diff --git a/lustre/obdclass/linux/linux-module.c b/lustre/obdclass/linux/linux-module.c
-index 200d19f..c019863 100644
---- a/lustre/obdclass/linux/linux-module.c
-+++ b/lustre/obdclass/linux/linux-module.c
-@@ -215,21 +215,23 @@ struct miscdevice obd_psdev = {
- #ifdef CONFIG_PROC_FS
- static int obd_proc_version_seq_show(struct seq_file *m, void *v)
- {
-- return seq_printf(m, "lustre: %s\nkernel: %s\nbuild: %s\n",
-- LUSTRE_VERSION_STRING, "patchless_client",
-- BUILD_VERSION);
-+ seq_printf(m, "lustre: %s\nkernel: %s\nbuild: %s\n",
-+ LUSTRE_VERSION_STRING, "patchless_client",
-+ BUILD_VERSION);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(obd_proc_version);
-
- static int obd_proc_pinger_seq_show(struct seq_file *m, void *v)
- {
-- return seq_printf(m, "%s\n",
-+ seq_printf(m, "%s\n",
- #ifdef ENABLE_PINGER
-- "on"
-+ "on"
- #else
-- "off"
-+ "off"
- #endif
-- );
-+ );
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(obd_proc_pinger);
-
-@@ -266,7 +268,7 @@ static int obd_proc_health_seq_show(struct seq_file *m, void *data)
-
- if (obd_health_check(NULL, obd)) {
- seq_printf(m, "device %s reported unhealthy\n",
-- obd->obd_name);
-+ obd->obd_name);
- healthy = false;
- }
- class_decref(obd, __FUNCTION__, current);
-@@ -275,7 +277,7 @@ static int obd_proc_health_seq_show(struct seq_file *m, void *data)
- read_unlock(&obd_dev_lock);
-
- if (healthy)
-- return seq_printf(m, "healthy\n");
-+ seq_puts(m, "healthy\n");
-
- seq_printf(m, "NOT HEALTHY\n");
- return 0;
-@@ -405,10 +407,11 @@ static int obd_device_list_seq_show(struct seq_file *p, void *v)
- else
- status = "--";
-
-- return seq_printf(p, "%3d %s %s %s %s %d\n",
-- (int)index, status, obd->obd_type->typ_name,
-- obd->obd_name, obd->obd_uuid.uuid,
-- atomic_read(&obd->obd_refcount));
-+ seq_printf(p, "%3d %s %s %s %s %d\n",
-+ (int)index, status, obd->obd_type->typ_name,
-+ obd->obd_name, obd->obd_uuid.uuid,
-+ atomic_read(&obd->obd_refcount));
-+ return 0;
- }
-
- static const struct seq_operations obd_device_list_sops = {
-diff --git a/lustre/obdclass/lprocfs_jobstats.c b/lustre/obdclass/lprocfs_jobstats.c
-index c0ea8f3..af6cc5f 100644
---- a/lustre/obdclass/lprocfs_jobstats.c
-+++ b/lustre/obdclass/lprocfs_jobstats.c
-@@ -636,7 +636,8 @@ int lprocfs_job_interval_seq_show(struct seq_file *m, void *data)
- return -ENODEV;
-
- stats = &obd->u.obt.obt_jobstats;
-- return seq_printf(m, "%d\n", stats->ojs_cleanup_interval);
-+ seq_printf(m, "%d\n", stats->ojs_cleanup_interval);
-+ return 0;
- }
- EXPORT_SYMBOL(lprocfs_job_interval_seq_show);
-
-diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c
-index 917bd6b..0cae0eb 100644
---- a/lustre/obdclass/lprocfs_status.c
-+++ b/lustre/obdclass/lprocfs_status.c
-@@ -292,7 +292,8 @@ EXPORT_SYMBOL(lprocfs_register);
- /* Generic callbacks */
- int lprocfs_uint_seq_show(struct seq_file *m, void *data)
- {
-- return seq_printf(m, "%u\n", *(unsigned int *)data);
-+ seq_printf(m, "%u\n", *(unsigned int *)data);
-+ return 0;
- }
- EXPORT_SYMBOL(lprocfs_uint_seq_show);
-
-@@ -333,7 +334,8 @@ EXPORT_SYMBOL(lprocfs_uint_seq_write);
- int lprocfs_u64_seq_show(struct seq_file *m, void *data)
- {
- LASSERT(data != NULL);
-- return seq_printf(m, LPU64"\n", *(__u64 *)data);
-+ seq_printf(m, LPU64"\n", *(__u64 *)data);
-+ return 0;
- }
- EXPORT_SYMBOL(lprocfs_u64_seq_show);
-
-@@ -341,7 +343,8 @@ int lprocfs_atomic_seq_show(struct seq_file *m, void *data)
- {
- atomic_t *atom = data;
- LASSERT(atom != NULL);
-- return seq_printf(m, "%d\n", atomic_read(atom));
-+ seq_printf(m, "%d\n", atomic_read(atom));
-+ return 0;
- }
- EXPORT_SYMBOL(lprocfs_atomic_seq_show);
-
-@@ -370,7 +373,8 @@ int lprocfs_uuid_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = data;
-
- LASSERT(obd != NULL);
-- return seq_printf(m, "%s\n", obd->obd_uuid.uuid);
-+ seq_printf(m, "%s\n", obd->obd_uuid.uuid);
-+ return 0;
- }
- EXPORT_SYMBOL(lprocfs_uuid_seq_show);
-
-@@ -379,7 +383,8 @@ int lprocfs_name_seq_show(struct seq_file *m, void *data)
- struct obd_device *dev = data;
-
- LASSERT(dev != NULL);
-- return seq_printf(m, "%s\n", dev->obd_name);
-+ seq_printf(m, "%s\n", dev->obd_name);
-+ return 0;
- }
- EXPORT_SYMBOL(lprocfs_name_seq_show);
-
-@@ -391,7 +396,7 @@ int lprocfs_blksize_seq_show(struct seq_file *m, void *data)
- cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
- OBD_STATFS_NODELAY);
- if (!rc)
-- rc = seq_printf(m, "%u\n", osfs.os_bsize);
-+ seq_printf(m, "%u\n", osfs.os_bsize);
- return rc;
- }
- EXPORT_SYMBOL(lprocfs_blksize_seq_show);
-@@ -410,7 +415,7 @@ int lprocfs_kbytestotal_seq_show(struct seq_file *m, void *data)
- while (blk_size >>= 1)
- result <<= 1;
-
-- rc = seq_printf(m, LPU64"\n", result);
-+ seq_printf(m, LPU64"\n", result);
- }
- return rc;
- }
-@@ -430,7 +435,7 @@ int lprocfs_kbytesfree_seq_show(struct seq_file *m, void *data)
- while (blk_size >>= 1)
- result <<= 1;
-
-- rc = seq_printf(m, LPU64"\n", result);
-+ seq_printf(m, LPU64"\n", result);
- }
- return rc;
- }
-@@ -450,7 +455,7 @@ int lprocfs_kbytesavail_seq_show(struct seq_file *m, void *data)
- while (blk_size >>= 1)
- result <<= 1;
-
-- rc = seq_printf(m, LPU64"\n", result);
-+ seq_printf(m, LPU64"\n", result);
- }
- return rc;
- }
-@@ -464,7 +469,7 @@ int lprocfs_filestotal_seq_show(struct seq_file *m, void *data)
- cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
- OBD_STATFS_NODELAY);
- if (!rc)
-- rc = seq_printf(m, LPU64"\n", osfs.os_files);
-+ seq_printf(m, LPU64"\n", osfs.os_files);
- return rc;
- }
- EXPORT_SYMBOL(lprocfs_filestotal_seq_show);
-@@ -477,7 +482,7 @@ int lprocfs_filesfree_seq_show(struct seq_file *m, void *data)
- cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
- OBD_STATFS_NODELAY);
- if (!rc)
-- rc = seq_printf(m, LPU64"\n", osfs.os_ffree);
-+ seq_printf(m, LPU64"\n", osfs.os_ffree);
- return rc;
- }
- EXPORT_SYMBOL(lprocfs_filesfree_seq_show);
-@@ -493,8 +498,8 @@ int lprocfs_server_uuid_seq_show(struct seq_file *m, void *data)
- LPROCFS_CLIMP_CHECK(obd);
- imp = obd->u.cli.cl_import;
- imp_state_name = ptlrpc_import_state_name(imp->imp_state);
-- rc = seq_printf(m, "%s\t%s%s\n", obd2cli_tgt(obd), imp_state_name,
-- imp->imp_deactive ? "\tDEACTIVATED" : "");
-+ seq_printf(m, "%s\t%s%s\n", obd2cli_tgt(obd), imp_state_name,
-+ imp->imp_deactive ? "\tDEACTIVATED" : "");
-
- LPROCFS_CLIMP_EXIT(obd);
- return rc;
-@@ -512,9 +517,9 @@ int lprocfs_conn_uuid_seq_show(struct seq_file *m, void *data)
- LPROCFS_CLIMP_CHECK(obd);
- conn = obd->u.cli.cl_import->imp_connection;
- if (conn && obd->u.cli.cl_import)
-- rc = seq_printf(m, "%s\n", conn->c_remote_uuid.uuid);
-+ seq_printf(m, "%s\n", conn->c_remote_uuid.uuid);
- else
-- rc = seq_printf(m, "%s\n", "<none>");
-+ seq_printf(m, "%s\n", "<none>");
-
- LPROCFS_CLIMP_EXIT(obd);
- return rc;
-@@ -705,16 +710,16 @@ static void obd_connect_data_seqprint(struct seq_file *m,
- flags = ocd->ocd_connect_flags;
-
- seq_printf(m, " connect_data:\n"
-- " flags: "LPX64"\n"
-- " instance: %u\n",
-- ocd->ocd_connect_flags,
-- ocd->ocd_instance);
-+ " flags: "LPX64"\n"
-+ " instance: %u\n",
-+ ocd->ocd_connect_flags,
-+ ocd->ocd_instance);
- if (flags & OBD_CONNECT_VERSION)
- seq_printf(m, " target_version: %u.%u.%u.%u\n",
-- OBD_OCD_VERSION_MAJOR(ocd->ocd_version),
-- OBD_OCD_VERSION_MINOR(ocd->ocd_version),
-- OBD_OCD_VERSION_PATCH(ocd->ocd_version),
-- OBD_OCD_VERSION_FIX(ocd->ocd_version));
-+ OBD_OCD_VERSION_MAJOR(ocd->ocd_version),
-+ OBD_OCD_VERSION_MINOR(ocd->ocd_version),
-+ OBD_OCD_VERSION_PATCH(ocd->ocd_version),
-+ OBD_OCD_VERSION_FIX(ocd->ocd_version));
- if (flags & OBD_CONNECT_MDS)
- seq_printf(m, " mdt_index: %d\n", ocd->ocd_group);
- if (flags & OBD_CONNECT_GRANT)
-@@ -725,28 +730,30 @@ static void obd_connect_data_seqprint(struct seq_file *m,
- seq_printf(m, " max_brw_size: %d\n", ocd->ocd_brw_size);
- if (flags & OBD_CONNECT_IBITS)
- seq_printf(m, " ibits_known: "LPX64"\n",
-- ocd->ocd_ibits_known);
-+ ocd->ocd_ibits_known);
- if (flags & OBD_CONNECT_GRANT_PARAM)
- seq_printf(m, " grant_block_size: %d\n"
-- " grant_inode_size: %d\n"
-- " grant_extent_overhead: %d\n",
-- ocd->ocd_blocksize,
-- ocd->ocd_inodespace,
-- ocd->ocd_grant_extent);
-+ " grant_inode_size: %d\n"
-+ " grant_max_extent_size: %d\n"
-+ " grant_extent_tax: %d\n",
-+ 1 << ocd->ocd_grant_blkbits,
-+ 1 << ocd->ocd_grant_inobits,
-+ ocd->ocd_grant_max_blks << ocd->ocd_grant_blkbits,
-+ ocd->ocd_grant_tax_kb << 10);
- if (flags & OBD_CONNECT_TRANSNO)
- seq_printf(m, " first_transno: "LPX64"\n",
-- ocd->ocd_transno);
-+ ocd->ocd_transno);
- if (flags & OBD_CONNECT_CKSUM)
- seq_printf(m, " cksum_types: %#x\n",
-- ocd->ocd_cksum_types);
-+ ocd->ocd_cksum_types);
- if (flags & OBD_CONNECT_MAX_EASIZE)
- seq_printf(m, " max_easize: %d\n", ocd->ocd_max_easize);
- if (flags & OBD_CONNECT_MAXBYTES)
- seq_printf(m, " max_object_bytes: "LPU64"\n",
-- ocd->ocd_maxbytes);
-+ ocd->ocd_maxbytes);
- if (flags & OBD_CONNECT_MULTIMODRPCS)
- seq_printf(m, " max_mod_rpcs: %hu\n",
-- ocd->ocd_maxmodrpcs);
-+ ocd->ocd_maxmodrpcs);
- }
-
- int lprocfs_import_seq_show(struct seq_file *m, void *data)
-@@ -768,23 +775,23 @@ int lprocfs_import_seq_show(struct seq_file *m, void *data)
- ocd = &imp->imp_connect_data;
-
- seq_printf(m, "import:\n"
-- " name: %s\n"
-- " target: %s\n"
-- " state: %s\n"
-- " connect_flags: [ ",
-- obd->obd_name,
-- obd2cli_tgt(obd),
-- ptlrpc_import_state_name(imp->imp_state));
-+ " name: %s\n"
-+ " target: %s\n"
-+ " state: %s\n"
-+ " connect_flags: [ ",
-+ obd->obd_name,
-+ obd2cli_tgt(obd),
-+ ptlrpc_import_state_name(imp->imp_state));
- obd_connect_seq_flags2str(m, imp->imp_connect_data.ocd_connect_flags,
-- ", ");
-+ ", ");
- seq_printf(m, " ]\n");
- obd_connect_data_seqprint(m, ocd);
- seq_printf(m, " import_flags: [ ");
- obd_import_flags2str(imp, m);
-
- seq_printf(m, " ]\n"
-- " connection:\n"
-- " failover_nids: [ ");
-+ " connection:\n"
-+ " failover_nids: [ ");
- spin_lock(&imp->imp_lock);
- j = 0;
- list_for_each_entry(conn, &imp->imp_conn_list, oic_item) {
-@@ -799,14 +806,14 @@ int lprocfs_import_seq_show(struct seq_file *m, void *data)
- else
- strncpy(nidstr, "<none>", sizeof(nidstr));
- seq_printf(m, " ]\n"
-- " current_connection: %s\n"
-- " connection_attempts: %u\n"
-- " generation: %u\n"
-- " in-progress_invalidations: %u\n",
-- nidstr,
-- imp->imp_conn_cnt,
-- imp->imp_generation,
-- atomic_read(&imp->imp_inval_count));
-+ " current_connection: %s\n"
-+ " connection_attempts: %u\n"
-+ " generation: %u\n"
-+ " in-progress_invalidations: %u\n",
-+ nidstr,
-+ imp->imp_conn_cnt,
-+ imp->imp_generation,
-+ atomic_read(&imp->imp_inval_count));
- spin_unlock(&imp->imp_lock);
-
- if (obd->obd_svc_stats == NULL)
-@@ -822,14 +829,14 @@ int lprocfs_import_seq_show(struct seq_file *m, void *data)
- } else
- ret.lc_sum = 0;
- seq_printf(m, " rpcs:\n"
-- " inflight: %u\n"
-- " unregistering: %u\n"
-- " timeouts: %u\n"
-- " avg_waittime: "LPU64" %s\n",
-- atomic_read(&imp->imp_inflight),
-- atomic_read(&imp->imp_unregistering),
-- atomic_read(&imp->imp_timeouts),
-- ret.lc_sum, header->lc_units);
-+ " inflight: %u\n"
-+ " unregistering: %u\n"
-+ " timeouts: %u\n"
-+ " avg_waittime: "LPU64" %s\n",
-+ atomic_read(&imp->imp_inflight),
-+ atomic_read(&imp->imp_unregistering),
-+ atomic_read(&imp->imp_timeouts),
-+ ret.lc_sum, header->lc_units);
-
- k = 0;
- for(j = 0; j < IMP_AT_MAX_PORTALS; j++) {
-@@ -839,18 +846,18 @@ int lprocfs_import_seq_show(struct seq_file *m, void *data)
- at_get(&imp->imp_at.iat_service_estimate[j]));
- }
- seq_printf(m, " service_estimates:\n"
-- " services: %u sec\n"
-- " network: %u sec\n",
-- k,
-- at_get(&imp->imp_at.iat_net_latency));
-+ " services: %u sec\n"
-+ " network: %u sec\n",
-+ k,
-+ at_get(&imp->imp_at.iat_net_latency));
-
- seq_printf(m, " transactions:\n"
-- " last_replay: "LPU64"\n"
-- " peer_committed: "LPU64"\n"
-- " last_checked: "LPU64"\n",
-- imp->imp_last_replay_transno,
-- imp->imp_peer_committed_transno,
-- imp->imp_last_transno_checked);
-+ " last_replay: "LPU64"\n"
-+ " peer_committed: "LPU64"\n"
-+ " last_checked: "LPU64"\n",
-+ imp->imp_last_replay_transno,
-+ imp->imp_peer_committed_transno,
-+ imp->imp_last_transno_checked);
-
- /* avg data rates */
- for (rw = 0; rw <= 1; rw++) {
-@@ -863,9 +870,9 @@ int lprocfs_import_seq_show(struct seq_file *m, void *data)
- do_div(sum, ret.lc_count);
- ret.lc_sum = sum;
- seq_printf(m, " %s_data_averages:\n"
-- " bytes_per_rpc: "LPU64"\n",
-- rw ? "write" : "read",
-- ret.lc_sum);
-+ " bytes_per_rpc: "LPU64"\n",
-+ rw ? "write" : "read",
-+ ret.lc_sum);
- }
- k = (int)ret.lc_sum;
- j = opcode_offset(OST_READ + rw) + EXTRA_MAX_OPCODES;
-@@ -877,11 +884,11 @@ int lprocfs_import_seq_show(struct seq_file *m, void *data)
- do_div(sum, ret.lc_count);
- ret.lc_sum = sum;
- seq_printf(m, " %s_per_rpc: "LPU64"\n",
-- header->lc_units, ret.lc_sum);
-+ header->lc_units, ret.lc_sum);
- j = (int)ret.lc_sum;
- if (j > 0)
- seq_printf(m, " MB_per_sec: %u.%.02u\n",
-- k / j, (100 * k / j) % 100);
-+ k / j, (100 * k / j) % 100);
- }
- }
-
-@@ -1223,8 +1230,8 @@ static int lprocfs_stats_seq_show(struct seq_file *p, void *v)
- struct timeval now;
-
- do_gettimeofday(&now);
-- rc = seq_printf(p, "%-25s %lu.%lu secs.usecs\n",
-- "snapshot_time", now.tv_sec, now.tv_usec);
-+ seq_printf(p, "%-25s %lu.%lu secs.usecs\n",
-+ "snapshot_time", now.tv_sec, now.tv_usec);
- if (rc < 0)
- return rc;
- }
-@@ -1235,22 +1242,22 @@ static int lprocfs_stats_seq_show(struct seq_file *p, void *v)
- if (ctr.lc_count == 0)
- goto out;
-
-- rc = seq_printf(p, "%-25s "LPD64" samples [%s]", hdr->lc_name,
-- ctr.lc_count, hdr->lc_units);
-+ seq_printf(p, "%-25s "LPD64" samples [%s]", hdr->lc_name,
-+ ctr.lc_count, hdr->lc_units);
- if (rc < 0)
- goto out;
-
- if ((hdr->lc_config & LPROCFS_CNTR_AVGMINMAX) && ctr.lc_count > 0) {
-- rc = seq_printf(p, " "LPD64" "LPD64" "LPD64,
-- ctr.lc_min, ctr.lc_max, ctr.lc_sum);
-+ seq_printf(p, " "LPD64" "LPD64" "LPD64,
-+ ctr.lc_min, ctr.lc_max, ctr.lc_sum);
- if (rc < 0)
- goto out;
- if (hdr->lc_config & LPROCFS_CNTR_STDDEV)
-- rc = seq_printf(p, " "LPD64, ctr.lc_sumsquare);
-+ seq_printf(p, " "LPD64, ctr.lc_sumsquare);
- if (rc < 0)
- goto out;
- }
-- rc = seq_printf(p, "\n");
-+ seq_putc(p, '\n');
- out:
- return (rc < 0) ? rc : 0;
- }
-@@ -1849,12 +1856,11 @@ int lprocfs_obd_max_pages_per_rpc_seq_show(struct seq_file *m, void *data)
- {
- struct obd_device *dev = data;
- struct client_obd *cli = &dev->u.cli;
-- int rc;
-
- spin_lock(&cli->cl_loi_list_lock);
-- rc = seq_printf(m, "%d\n", cli->cl_max_pages_per_rpc);
-+ seq_printf(m, "%d\n", cli->cl_max_pages_per_rpc);
- spin_unlock(&cli->cl_loi_list_lock);
-- return rc;
-+ return 0;
- }
- EXPORT_SYMBOL(lprocfs_obd_max_pages_per_rpc_seq_show);
-
-diff --git a/lustre/obdclass/lprocfs_status_server.c b/lustre/obdclass/lprocfs_status_server.c
-index 148f65a..6bb6c27 100644
---- a/lustre/obdclass/lprocfs_status_server.c
-+++ b/lustre/obdclass/lprocfs_status_server.c
-@@ -109,7 +109,8 @@ int lprocfs_num_exports_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = data;
-
- LASSERT(obd != NULL);
-- return seq_printf(m, "%u\n", obd->obd_num_exports);
-+ seq_printf(m, "%u\n", obd->obd_num_exports);
-+ return 0;
- }
- EXPORT_SYMBOL(lprocfs_num_exports_seq_show);
-
-@@ -237,9 +238,9 @@ int lprocfs_exp_print_replydata_seq(struct cfs_hash *hs, struct cfs_hash_bd *bd,
- struct tg_export_data *ted = &exp->exp_target_data;
-
- seq_printf(m, "reply_cnt: %d\n"
-- "reply_max: %d\n"
-- "reply_released_by_xid: %d\n"
-- "reply_released_by_tag: %d\n\n",
-+ "reply_max: %d\n"
-+ "reply_released_by_xid: %d\n"
-+ "reply_released_by_tag: %d\n\n",
- ted->ted_reply_cnt,
- ted->ted_reply_max,
- ted->ted_release_xid,
-@@ -260,8 +261,8 @@ LPROC_SEQ_FOPS_RO(lprocfs_exp_replydata);
-
- int lprocfs_nid_stats_clear_seq_show(struct seq_file *m, void *data)
- {
-- return seq_printf(m, "%s\n", "Write into this file to clear all nid "
-- "stats and stale nid entries");
-+ seq_puts(m, "Write into this file to clear all nid stats and stale nid entries\n");
-+ return 0;
- }
- EXPORT_SYMBOL(lprocfs_nid_stats_clear_seq_show);
-
-@@ -548,16 +549,15 @@ EXPORT_SYMBOL(lprocfs_free_obd_stats);
- int lprocfs_hash_seq_show(struct seq_file *m, void *data)
- {
- struct obd_device *obd = m->private;
-- int c = 0;
-
- if (obd == NULL)
- return 0;
-
-- c += cfs_hash_debug_header(m);
-- c += cfs_hash_debug_str(obd->obd_uuid_hash, m);
-- c += cfs_hash_debug_str(obd->obd_nid_hash, m);
-- c += cfs_hash_debug_str(obd->obd_nid_stats_hash, m);
-- return c;
-+ cfs_hash_debug_header(m);
-+ cfs_hash_debug_str(obd->obd_uuid_hash, m);
-+ cfs_hash_debug_str(obd->obd_nid_hash, m);
-+ cfs_hash_debug_str(obd->obd_nid_stats_hash, m);
-+ return 0;
- }
- EXPORT_SYMBOL(lprocfs_hash_seq_show);
-
-@@ -631,7 +631,8 @@ int lprocfs_ir_factor_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
-
- LASSERT(obd != NULL);
-- return seq_printf(m, "%d\n", obd->obd_recovery_ir_factor);
-+ seq_printf(m, "%d\n", obd->obd_recovery_ir_factor);
-+ return 0;
- }
- EXPORT_SYMBOL(lprocfs_ir_factor_seq_show);
-
-@@ -661,7 +662,8 @@ int lprocfs_recovery_time_soft_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
-
- LASSERT(obd != NULL);
-- return seq_printf(m, "%d\n", obd->obd_recovery_timeout);
-+ seq_printf(m, "%d\n", obd->obd_recovery_timeout);
-+ return 0;
- }
- EXPORT_SYMBOL(lprocfs_recovery_time_soft_seq_show);
-
-@@ -689,7 +691,8 @@ int lprocfs_recovery_time_hard_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
-
- LASSERT(obd != NULL);
-- return seq_printf(m, "%u\n", obd->obd_recovery_time_hard);
-+ seq_printf(m, "%u\n", obd->obd_recovery_time_hard);
-+ return 0;
- }
- EXPORT_SYMBOL(lprocfs_recovery_time_hard_seq_show);
-
-@@ -719,7 +722,8 @@ int lprocfs_target_instance_seq_show(struct seq_file *m, void *data)
-
- LASSERT(obd != NULL);
- LASSERT(target->obt_magic == OBT_MAGIC);
-- return seq_printf(m, "%u\n", obd->u.obt.obt_instance);
-+ seq_printf(m, "%u\n", obd->u.obt.obt_instance);
-+ return 0;
- }
- EXPORT_SYMBOL(lprocfs_target_instance_seq_show);
-
-diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c
-index c478d51..7709a8d 100644
---- a/lustre/obdclass/lu_object.c
-+++ b/lustre/obdclass/lu_object.c
-@@ -2223,19 +2223,20 @@ int lu_site_stats_seq_print(const struct lu_site *s, struct seq_file *m)
- memset(&stats, 0, sizeof(stats));
- lu_site_stats_get(s->ls_obj_hash, &stats, 1);
-
-- return seq_printf(m, "%d/%d %d/%d %d %d %d %d %d %d %d %d\n",
-- stats.lss_busy,
-- stats.lss_total,
-- stats.lss_populated,
-- CFS_HASH_NHLIST(s->ls_obj_hash),
-- stats.lss_max_search,
-- ls_stats_read(s->ls_stats, LU_SS_CREATED),
-- ls_stats_read(s->ls_stats, LU_SS_CACHE_HIT),
-- ls_stats_read(s->ls_stats, LU_SS_CACHE_MISS),
-- ls_stats_read(s->ls_stats, LU_SS_CACHE_RACE),
-- ls_stats_read(s->ls_stats, LU_SS_CACHE_DEATH_RACE),
-- ls_stats_read(s->ls_stats, LU_SS_LRU_PURGED),
-- ls_stats_read(s->ls_stats, LU_SS_LRU_LEN));
-+ seq_printf(m, "%d/%d %d/%d %d %d %d %d %d %d %d %d\n",
-+ stats.lss_busy,
-+ stats.lss_total,
-+ stats.lss_populated,
-+ CFS_HASH_NHLIST(s->ls_obj_hash),
-+ stats.lss_max_search,
-+ ls_stats_read(s->ls_stats, LU_SS_CREATED),
-+ ls_stats_read(s->ls_stats, LU_SS_CACHE_HIT),
-+ ls_stats_read(s->ls_stats, LU_SS_CACHE_MISS),
-+ ls_stats_read(s->ls_stats, LU_SS_CACHE_RACE),
-+ ls_stats_read(s->ls_stats, LU_SS_CACHE_DEATH_RACE),
-+ ls_stats_read(s->ls_stats, LU_SS_LRU_PURGED),
-+ ls_stats_read(s->ls_stats, LU_SS_LRU_LEN));
-+ return 0;
- }
- EXPORT_SYMBOL(lu_site_stats_seq_print);
-
-diff --git a/lustre/ofd/lproc_ofd.c b/lustre/ofd/lproc_ofd.c
-index 65b57f3..29350da 100644
---- a/lustre/ofd/lproc_ofd.c
-+++ b/lustre/ofd/lproc_ofd.c
-@@ -64,7 +64,8 @@ static int ofd_seqs_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- return seq_printf(m, "%u\n", ofd->ofd_seq_count);
-+ seq_printf(m, "%u\n", ofd->ofd_seq_count);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ofd_seqs);
-
-@@ -84,7 +85,8 @@ static int ofd_tot_dirty_seq_show(struct seq_file *m, void *data)
-
- LASSERT(obd != NULL);
- ofd = ofd_dev(obd->obd_lu_dev);
-- return seq_printf(m, LPU64"\n", ofd->ofd_tot_dirty);
-+ seq_printf(m, LPU64"\n", ofd->ofd_tot_dirty);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ofd_tot_dirty);
-
-@@ -104,7 +106,8 @@ static int ofd_tot_granted_seq_show(struct seq_file *m, void *data)
-
- LASSERT(obd != NULL);
- ofd = ofd_dev(obd->obd_lu_dev);
-- return seq_printf(m, LPU64"\n", ofd->ofd_tot_granted);
-+ seq_printf(m, LPU64"\n", ofd->ofd_tot_granted);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ofd_tot_granted);
-
-@@ -124,7 +127,8 @@ static int ofd_tot_pending_seq_show(struct seq_file *m, void *data)
-
- LASSERT(obd != NULL);
- ofd = ofd_dev(obd->obd_lu_dev);
-- return seq_printf(m, LPU64"\n", ofd->ofd_tot_pending);
-+ seq_printf(m, LPU64"\n", ofd->ofd_tot_pending);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ofd_tot_pending);
-
-@@ -142,8 +146,9 @@ static int ofd_grant_precreate_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
-
- LASSERT(obd != NULL);
-- return seq_printf(m, "%ld\n",
-- obd->obd_self_export->exp_filter_data.fed_grant);
-+ seq_printf(m, "%ld\n",
-+ obd->obd_self_export->exp_filter_data.fed_grant);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ofd_grant_precreate);
-
-@@ -225,7 +230,8 @@ static int ofd_precreate_batch_seq_show(struct seq_file *m, void *data)
-
- LASSERT(obd != NULL);
- ofd = ofd_dev(obd->obd_lu_dev);
-- return seq_printf(m, "%d\n", ofd->ofd_precreate_batch);
-+ seq_printf(m, "%d\n", ofd->ofd_precreate_batch);
-+ return 0;
- }
-
- /**
-@@ -277,7 +283,6 @@ static int ofd_last_id_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct ofd_device *ofd;
- struct ofd_seq *oseq = NULL;
-- int retval = 0, rc;
-
- if (obd == NULL)
- return 0;
-@@ -292,15 +297,10 @@ static int ofd_last_id_seq_show(struct seq_file *m, void *data)
- fid_idif_seq(ostid_id(&oseq->os_oi),
- ofd->ofd_lut.lut_lsd.lsd_osd_index) :
- ostid_seq(&oseq->os_oi);
-- rc = seq_printf(m, DOSTID"\n", seq, ostid_id(&oseq->os_oi));
-- if (rc < 0) {
-- retval = rc;
-- break;
-- }
-- retval += rc;
-+ seq_printf(m, DOSTID"\n", seq, ostid_id(&oseq->os_oi));
- }
- read_unlock(&ofd->ofd_seq_list_lock);
-- return retval;
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ofd_last_id);
-
-@@ -318,7 +318,8 @@ static int ofd_fmd_max_num_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- return seq_printf(m, "%u\n", ofd->ofd_fmd_max_num);
-+ seq_printf(m, "%u\n", ofd->ofd_fmd_max_num);
-+ return 0;
- }
-
- /**
-@@ -373,8 +374,9 @@ static int ofd_fmd_max_age_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- return seq_printf(m, "%ld\n", jiffies_to_msecs(ofd->ofd_fmd_max_age) /
-- MSEC_PER_SEC);
-+ seq_printf(m, "%ld\n", jiffies_to_msecs(ofd->ofd_fmd_max_age) /
-+ MSEC_PER_SEC);
-+ return 0;
- }
-
- /**
-@@ -433,7 +435,8 @@ static int ofd_degraded_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- return seq_printf(m, "%u\n", ofd->ofd_raid_degraded);
-+ seq_printf(m, "%u\n", ofd->ofd_raid_degraded);
-+ return 0;
- }
-
- /**
-@@ -491,7 +494,8 @@ static int ofd_fstype_seq_show(struct seq_file *m, void *data)
- LASSERT(ofd->ofd_osd);
- d = &ofd->ofd_osd->dd_lu_dev;
- LASSERT(d->ld_type);
-- return seq_printf(m, "%s\n", d->ld_type->ldt_name);
-+ seq_printf(m, "%s\n", d->ld_type->ldt_name);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ofd_fstype);
-
-@@ -517,7 +521,8 @@ static int ofd_syncjournal_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- return seq_printf(m, "%u\n", ofd->ofd_syncjournal);
-+ seq_printf(m, "%u\n", ofd->ofd_syncjournal);
-+ return 0;
- }
-
- /**
-@@ -579,8 +584,9 @@ static int ofd_sync_lock_cancel_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct lu_target *tgt = obd->u.obt.obt_lut;
-
-- return seq_printf(m, "%s\n",
-- sync_on_cancel_states[tgt->lut_sync_lock_cancel]);
-+ seq_printf(m, "%s\n",
-+ sync_on_cancel_states[tgt->lut_sync_lock_cancel]);
-+ return 0;
- }
-
- /**
-@@ -673,7 +679,8 @@ static int ofd_grant_compat_disable_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- return seq_printf(m, "%u\n", ofd->ofd_grant_compat_disable);
-+ seq_printf(m, "%u\n", ofd->ofd_grant_compat_disable);
-+ return 0;
- }
-
- /**
-@@ -851,11 +858,11 @@ static int ofd_lfsck_verify_pfid_seq_show(struct seq_file *m, void *data)
- struct obd_device *obd = m->private;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
-
-- return seq_printf(m,
-- "switch: %s\ndetected: "LPU64"\nrepaired: "LPU64"\n",
-- ofd->ofd_lfsck_verify_pfid ? "on" : "off",
-- ofd->ofd_inconsistency_self_detected,
-- ofd->ofd_inconsistency_self_repaired);
-+ seq_printf(m, "switch: %s\ndetected: "LPU64"\nrepaired: "LPU64"\n",
-+ ofd->ofd_lfsck_verify_pfid ? "on" : "off",
-+ ofd->ofd_inconsistency_self_detected,
-+ ofd->ofd_inconsistency_self_repaired);
-+ return 0;
- }
-
- /**
-diff --git a/lustre/osc/lproc_osc.c b/lustre/osc/lproc_osc.c
-index 983442f..3bd44a6 100644
---- a/lustre/osc/lproc_osc.c
-+++ b/lustre/osc/lproc_osc.c
-@@ -47,12 +47,11 @@
- static int osc_active_seq_show(struct seq_file *m, void *v)
- {
- struct obd_device *dev = m->private;
-- int rc;
-
- LPROCFS_CLIMP_CHECK(dev);
-- rc = seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
-+ seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
- LPROCFS_CLIMP_EXIT(dev);
-- return rc;
-+ return 0;
- }
-
- static ssize_t osc_active_seq_write(struct file *file,
-@@ -82,12 +81,11 @@ static int osc_max_rpcs_in_flight_seq_show(struct seq_file *m, void *v)
- {
- struct obd_device *dev = m->private;
- struct client_obd *cli = &dev->u.cli;
-- int rc;
-
- spin_lock(&cli->cl_loi_list_lock);
-- rc = seq_printf(m, "%u\n", cli->cl_max_rpcs_in_flight);
-+ seq_printf(m, "%u\n", cli->cl_max_rpcs_in_flight);
- spin_unlock(&cli->cl_loi_list_lock);
-- return rc;
-+ return 0;
- }
-
- static ssize_t osc_max_rpcs_in_flight_seq_write(struct file *file,
-@@ -179,18 +177,16 @@ static int osc_cached_mb_seq_show(struct seq_file *m, void *v)
- struct obd_device *dev = m->private;
- struct client_obd *cli = &dev->u.cli;
- int shift = 20 - PAGE_CACHE_SHIFT;
-- int rc;
-
-- rc = seq_printf(m,
-- "used_mb: %ld\n"
-- "busy_cnt: %ld\n"
-- "reclaim: "LPU64"\n",
-- (atomic_long_read(&cli->cl_lru_in_list) +
-- atomic_long_read(&cli->cl_lru_busy)) >> shift,
-- atomic_long_read(&cli->cl_lru_busy),
-- cli->cl_lru_reclaim);
-+ seq_printf(m, "used_mb: %ld\n"
-+ "busy_cnt: %ld\n"
-+ "reclaim: "LPU64"\n",
-+ (atomic_long_read(&cli->cl_lru_in_list) +
-+ atomic_long_read(&cli->cl_lru_busy)) >> shift,
-+ atomic_long_read(&cli->cl_lru_busy),
-+ cli->cl_lru_reclaim);
-
-- return rc;
-+ return 0;
- }
-
- /* shrink the number of caching pages to a specific number */
-@@ -248,12 +244,11 @@ static int osc_cur_dirty_bytes_seq_show(struct seq_file *m, void *v)
- {
- struct obd_device *dev = m->private;
- struct client_obd *cli = &dev->u.cli;
-- int rc;
-
- spin_lock(&cli->cl_loi_list_lock);
-- rc = seq_printf(m, "%lu\n", cli->cl_dirty_pages << PAGE_CACHE_SHIFT);
-+ seq_printf(m, "%lu\n", cli->cl_dirty_pages << PAGE_CACHE_SHIFT);
- spin_unlock(&cli->cl_loi_list_lock);
-- return rc;
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(osc_cur_dirty_bytes);
-
-@@ -261,12 +256,11 @@ static int osc_cur_grant_bytes_seq_show(struct seq_file *m, void *v)
- {
- struct obd_device *dev = m->private;
- struct client_obd *cli = &dev->u.cli;
-- int rc;
-
- spin_lock(&cli->cl_loi_list_lock);
-- rc = seq_printf(m, "%lu\n", cli->cl_avail_grant);
-+ seq_printf(m, "%lu\n", cli->cl_avail_grant);
- spin_unlock(&cli->cl_loi_list_lock);
-- return rc;
-+ return 0;
- }
-
- static ssize_t osc_cur_grant_bytes_seq_write(struct file *file,
-@@ -308,23 +302,35 @@ static int osc_cur_lost_grant_bytes_seq_show(struct seq_file *m, void *v)
- {
- struct obd_device *dev = m->private;
- struct client_obd *cli = &dev->u.cli;
-- int rc;
-
- spin_lock(&cli->cl_loi_list_lock);
-- rc = seq_printf(m, "%lu\n", cli->cl_lost_grant);
-+ seq_printf(m, "%lu\n", cli->cl_lost_grant);
- spin_unlock(&cli->cl_loi_list_lock);
-- return rc;
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(osc_cur_lost_grant_bytes);
-
-+static int osc_cur_dirty_grant_bytes_seq_show(struct seq_file *m, void *v)
-+{
-+ struct obd_device *dev = m->private;
-+ struct client_obd *cli = &dev->u.cli;
-+
-+ spin_lock(&cli->cl_loi_list_lock);
-+ seq_printf(m, "%lu\n", cli->cl_dirty_grant);
-+ spin_unlock(&cli->cl_loi_list_lock);
-+ return 0;
-+}
-+LPROC_SEQ_FOPS_RO(osc_cur_dirty_grant_bytes);
-+
- static int osc_grant_shrink_interval_seq_show(struct seq_file *m, void *v)
- {
- struct obd_device *obd = m->private;
-
- if (obd == NULL)
- return 0;
-- return seq_printf(m, "%d\n",
-- obd->u.cli.cl_grant_shrink_interval);
-+ seq_printf(m, "%d\n",
-+ obd->u.cli.cl_grant_shrink_interval);
-+ return 0;
- }
-
- static ssize_t osc_grant_shrink_interval_seq_write(struct file *file,
-@@ -357,8 +363,8 @@ static int osc_checksum_seq_show(struct seq_file *m, void *v)
- if (obd == NULL)
- return 0;
-
-- return seq_printf(m, "%d\n",
-- obd->u.cli.cl_checksum ? 1 : 0);
-+ seq_printf(m, "%d\n", obd->u.cli.cl_checksum ? 1 : 0);
-+ return 0;
- }
-
- static ssize_t osc_checksum_seq_write(struct file *file,
-@@ -439,7 +445,8 @@ static int osc_resend_count_seq_show(struct seq_file *m, void *v)
- {
- struct obd_device *obd = m->private;
-
-- return seq_printf(m, "%u\n", atomic_read(&obd->u.cli.cl_resends));
-+ seq_printf(m, "%u\n", atomic_read(&obd->u.cli.cl_resends));
-+ return 0;
- }
-
- static ssize_t osc_resend_count_seq_write(struct file *file,
-@@ -467,7 +474,8 @@ static int osc_contention_seconds_seq_show(struct seq_file *m, void *v)
- struct obd_device *obd = m->private;
- struct osc_device *od = obd2osc_dev(obd);
-
-- return seq_printf(m, "%u\n", od->od_contention_time);
-+ seq_printf(m, "%u\n", od->od_contention_time);
-+ return 0;
- }
-
- static ssize_t osc_contention_seconds_seq_write(struct file *file,
-@@ -486,7 +494,8 @@ static int osc_lockless_truncate_seq_show(struct seq_file *m, void *v)
- struct obd_device *obd = m->private;
- struct osc_device *od = obd2osc_dev(obd);
-
-- return seq_printf(m, "%u\n", od->od_lockless_truncate);
-+ seq_printf(m, "%u\n", od->od_lockless_truncate);
-+ return 0;
- }
-
- static ssize_t osc_lockless_truncate_seq_write(struct file *file,
-@@ -504,8 +513,9 @@ LPROC_SEQ_FOPS(osc_lockless_truncate);
- static int osc_destroys_in_flight_seq_show(struct seq_file *m, void *v)
- {
- struct obd_device *obd = m->private;
-- return seq_printf(m, "%u\n",
-- atomic_read(&obd->u.cli.cl_destroy_in_flight));
-+ seq_printf(m, "%u\n",
-+ atomic_read(&obd->u.cli.cl_destroy_in_flight));
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(osc_destroys_in_flight);
-
-@@ -562,9 +572,10 @@ static int osc_unstable_stats_seq_show(struct seq_file *m, void *v)
- pages = atomic_long_read(&cli->cl_unstable_count);
- mb = (pages * PAGE_CACHE_SIZE) >> 20;
-
-- return seq_printf(m, "unstable_pages: %20ld\n"
-- "unstable_mb: %10d\n",
-- pages, mb);
-+ seq_printf(m, "unstable_pages: %20ld\n"
-+ "unstable_mb: %10d\n",
-+ pages, mb);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(osc_unstable_stats);
-
-@@ -716,11 +727,11 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v)
- unsigned long w = cli->cl_write_rpc_hist.oh_buckets[i];
- 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));
-+ 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));
- if (read_cum == read_tot && write_cum == write_tot)
- break;
- }
-diff --git a/lustre/osd-ldiskfs/osd_lproc.c b/lustre/osd-ldiskfs/osd_lproc.c
-index d15b3bf..4812342 100644
---- a/lustre/osd-ldiskfs/osd_lproc.c
-+++ b/lustre/osd-ldiskfs/osd_lproc.c
-@@ -243,7 +243,8 @@ static int ldiskfs_osd_fstype_seq_show(struct seq_file *m, void *data)
- struct osd_device *osd = osd_dt_dev((struct dt_device *)m->private);
-
- LASSERT(osd != NULL);
-- return seq_printf(m, "ldiskfs\n");
-+ seq_puts(m, "ldiskfs\n");
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ldiskfs_osd_fstype);
-
-@@ -255,7 +256,8 @@ static int ldiskfs_osd_mntdev_seq_show(struct seq_file *m, void *data)
- if (unlikely(osd->od_mnt == NULL))
- return -EINPROGRESS;
-
-- return seq_printf(m, "%s\n", osd->od_mntdev);
-+ seq_printf(m, "%s\n", osd->od_mntdev);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ldiskfs_osd_mntdev);
-
-@@ -267,7 +269,8 @@ static int ldiskfs_osd_cache_seq_show(struct seq_file *m, void *data)
- if (unlikely(osd->od_mnt == NULL))
- return -EINPROGRESS;
-
-- return seq_printf(m, "%u\n", osd->od_read_cache);
-+ seq_printf(m, "%u\n", osd->od_read_cache);
-+ return 0;
- }
-
- static ssize_t
-@@ -300,7 +303,8 @@ static int ldiskfs_osd_wcache_seq_show(struct seq_file *m, void *data)
- if (unlikely(osd->od_mnt == NULL))
- return -EINPROGRESS;
-
-- return seq_printf(m, "%u\n", osd->od_writethrough_cache);
-+ seq_printf(m, "%u\n", osd->od_writethrough_cache);
-+ return 0;
- }
-
- static ssize_t
-@@ -351,7 +355,8 @@ LPROC_SEQ_FOPS_WO_TYPE(ldiskfs, osd_force_sync);
-
- static int ldiskfs_osd_pdo_seq_show(struct seq_file *m, void *data)
- {
-- return seq_printf(m, "%s\n", ldiskfs_pdo ? "ON" : "OFF");
-+ seq_printf(m, "%s\n", ldiskfs_pdo ? "ON" : "OFF");
-+ return 0;
- }
-
- static ssize_t
-@@ -378,7 +383,8 @@ static int ldiskfs_osd_auto_scrub_seq_show(struct seq_file *m, void *data)
- if (unlikely(dev->od_mnt == NULL))
- return -EINPROGRESS;
-
-- return seq_printf(m, "%d\n", !dev->od_noscrub);
-+ seq_printf(m, "%d\n", !dev->od_noscrub);
-+ return 0;
- }
-
- static ssize_t
-@@ -411,7 +417,8 @@ static int ldiskfs_osd_full_scrub_ratio_seq_show(struct seq_file *m, void *data)
- if (unlikely(dev->od_mnt == NULL))
- return -EINPROGRESS;
-
-- return seq_printf(m, LPU64"\n", dev->od_full_scrub_ratio);
-+ seq_printf(m, LPU64"\n", dev->od_full_scrub_ratio);
-+ return 0;
- }
-
- static ssize_t
-@@ -448,8 +455,9 @@ static int ldiskfs_osd_full_scrub_threshold_rate_seq_show(struct seq_file *m,
- if (unlikely(dev->od_mnt == NULL))
- return -EINPROGRESS;
-
-- return seq_printf(m, LPU64" (bad OI mappings/minute)\n",
-- dev->od_full_scrub_threshold_rate);
-+ seq_printf(m, LPU64" (bad OI mappings/minute)\n",
-+ dev->od_full_scrub_threshold_rate);
-+ return 0;
- }
-
- static ssize_t
-@@ -481,7 +489,8 @@ LPROC_SEQ_FOPS(ldiskfs_osd_full_scrub_threshold_rate);
- static int
- ldiskfs_osd_track_declares_assert_seq_show(struct seq_file *m, void *data)
- {
-- return seq_printf(m, "%d\n", ldiskfs_track_declares_assert);
-+ seq_printf(m, "%d\n", ldiskfs_track_declares_assert);
-+ return 0;
- }
-
- static ssize_t
-@@ -522,7 +531,8 @@ static int ldiskfs_osd_readcache_seq_show(struct seq_file *m, void *data)
- if (unlikely(osd->od_mnt == NULL))
- return -EINPROGRESS;
-
-- return seq_printf(m, LPU64"\n", osd->od_readcache_max_filesize);
-+ seq_printf(m, LPU64"\n", osd->od_readcache_max_filesize);
-+ return 0;
- }
-
- static ssize_t
-@@ -558,7 +568,8 @@ static int ldiskfs_osd_index_in_idif_seq_show(struct seq_file *m, void *data)
- if (unlikely(dev->od_mnt == NULL))
- return -EINPROGRESS;
-
-- return seq_printf(m, "%d\n", (int)(dev->od_index_in_idif));
-+ seq_printf(m, "%d\n", (int)(dev->od_index_in_idif));
-+ return 0;
- }
-
- static ssize_t
-diff --git a/lustre/osd-ldiskfs/osd_scrub.c b/lustre/osd-ldiskfs/osd_scrub.c
-index 80f2794..5d12724 100644
---- a/lustre/osd-ldiskfs/osd_scrub.c
-+++ b/lustre/osd-ldiskfs/osd_scrub.c
-@@ -2989,50 +2989,38 @@ static const char *scrub_param_names[] = {
- NULL
- };
-
--static int scrub_bits_dump(struct seq_file *m, int bits, const char *names[],
-- const char *prefix)
-+static void scrub_bits_dump(struct seq_file *m, int bits, const char *names[],
-+ const char *prefix)
- {
- int flag;
-- int rc;
- int i;
-
-- rc = seq_printf(m, "%s:%c", prefix, bits != 0 ? ' ' : '\n');
-- if (rc < 0)
-- return rc;
-+ seq_printf(m, "%s:%c", prefix, bits != 0 ? ' ' : '\n');
-
- for (i = 0, flag = 1; bits != 0; i++, flag = 1 << i) {
- if (flag & bits) {
- bits &= ~flag;
-- rc = seq_printf(m, "%s%c", names[i],
-- bits != 0 ? ',' : '\n');
-- if (rc < 0)
-- return rc;
-+ seq_printf(m, "%s%c", names[i],
-+ bits != 0 ? ',' : '\n');
- }
- }
-- return 0;
- }
-
--static int scrub_time_dump(struct seq_file *m, __u64 time, const char *prefix)
-+static void scrub_time_dump(struct seq_file *m, __u64 time, const char *prefix)
- {
-- int rc;
--
- if (time != 0)
-- rc = seq_printf(m, "%s: "LPU64" seconds\n", prefix,
-- cfs_time_current_sec() - time);
-+ seq_printf(m, "%s: "LPU64" seconds\n", prefix,
-+ cfs_time_current_sec() - time);
- else
-- rc = seq_printf(m, "%s: N/A\n", prefix);
-- return rc;
-+ seq_printf(m, "%s: N/A\n", prefix);
- }
-
--static int scrub_pos_dump(struct seq_file *m, __u64 pos, const char *prefix)
-+static void scrub_pos_dump(struct seq_file *m, __u64 pos, const char *prefix)
- {
-- int rc;
--
- if (pos != 0)
-- rc = seq_printf(m, "%s: "LPU64"\n", prefix, pos);
-+ seq_printf(m, "%s: "LPU64"\n", prefix, pos);
- else
-- rc = seq_printf(m, "%s: N/A\n", prefix);
-- return rc;
-+ seq_printf(m, "%s: N/A\n", prefix);
- }
-
- int osd_scrub_dump(struct seq_file *m, struct osd_device *dev)
-@@ -3041,71 +3029,48 @@ int osd_scrub_dump(struct seq_file *m, struct osd_device *dev)
- struct scrub_file *sf = &scrub->os_file;
- __u64 checked;
- __u64 speed;
-- int rc;
-
- down_read(&scrub->os_rwsem);
-- rc = seq_printf(m, "name: OI_scrub\n"
-- "magic: 0x%x\n"
-- "oi_files: %d\n"
-- "status: %s\n",
-- sf->sf_magic, (int)sf->sf_oi_count,
-- scrub_status_names[sf->sf_status]);
-- if (rc < 0)
-- goto out;
-+ seq_printf(m, "name: OI_scrub\n"
-+ "magic: 0x%x\n"
-+ "oi_files: %d\n"
-+ "status: %s\n",
-+ sf->sf_magic, (int)sf->sf_oi_count,
-+ scrub_status_names[sf->sf_status]);
-
-- rc = scrub_bits_dump(m, sf->sf_flags, scrub_flags_names,
-- "flags");
-- if (rc < 0)
-- goto out;
-+ scrub_bits_dump(m, sf->sf_flags, scrub_flags_names, "flags");
-
-- rc = scrub_bits_dump(m, sf->sf_param, scrub_param_names,
-- "param");
-- if (rc < 0)
-- goto out;
-+ scrub_bits_dump(m, sf->sf_param, scrub_param_names, "param");
-
-- rc = scrub_time_dump(m, sf->sf_time_last_complete,
-- "time_since_last_completed");
-- if (rc < 0)
-- goto out;
-+ scrub_time_dump(m, sf->sf_time_last_complete,
-+ "time_since_last_completed");
-
-- rc = scrub_time_dump(m, sf->sf_time_latest_start,
-- "time_since_latest_start");
-- if (rc < 0)
-- goto out;
-+ scrub_time_dump(m, sf->sf_time_latest_start,
-+ "time_since_latest_start");
-
-- rc = scrub_time_dump(m, sf->sf_time_last_checkpoint,
-- "time_since_last_checkpoint");
-- if (rc < 0)
-- goto out;
-+ scrub_time_dump(m, sf->sf_time_last_checkpoint,
-+ "time_since_last_checkpoint");
-
-- rc = scrub_pos_dump(m, sf->sf_pos_latest_start,
-- "latest_start_position");
-- if (rc < 0)
-- goto out;
-+ scrub_pos_dump(m, sf->sf_pos_latest_start,
-+ "latest_start_position");
-
-- rc = scrub_pos_dump(m, sf->sf_pos_last_checkpoint,
-- "last_checkpoint_position");
-- if (rc < 0)
-- goto out;
-+ scrub_pos_dump(m, sf->sf_pos_last_checkpoint,
-+ "last_checkpoint_position");
-
-- rc = scrub_pos_dump(m, sf->sf_pos_first_inconsistent,
-- "first_failure_position");
-- if (rc < 0)
-- goto out;
-+ scrub_pos_dump(m, sf->sf_pos_first_inconsistent,
-+ "first_failure_position");
-
- checked = sf->sf_items_checked + scrub->os_new_checked;
-- rc = seq_printf(m, "checked: "LPU64"\n"
-- "updated: "LPU64"\n"
-- "failed: "LPU64"\n"
-- "prior_updated: "LPU64"\n"
-- "noscrub: "LPU64"\n"
-- "igif: "LPU64"\n"
-- "success_count: %u\n",
-- checked, sf->sf_items_updated, sf->sf_items_failed,
-- sf->sf_items_updated_prior, sf->sf_items_noscrub,
-- sf->sf_items_igif, sf->sf_success_count);
-- if (rc < 0)
-- goto out;
-+ seq_printf(m, "checked: "LPU64"\n"
-+ "updated: "LPU64"\n"
-+ "failed: "LPU64"\n"
-+ "prior_updated: "LPU64"\n"
-+ "noscrub: "LPU64"\n"
-+ "igif: "LPU64"\n"
-+ "success_count: %u\n",
-+ checked, sf->sf_items_updated, sf->sf_items_failed,
-+ sf->sf_items_updated_prior, sf->sf_items_noscrub,
-+ sf->sf_items_igif, sf->sf_success_count);
-
- speed = checked;
- if (thread_is_running(&scrub->os_thread)) {
-@@ -3120,31 +3085,30 @@ int osd_scrub_dump(struct seq_file *m, struct osd_device *dev)
- do_div(new_checked, duration);
- if (rtime != 0)
- do_div(speed, rtime);
-- rc = seq_printf(m, "run_time: %u seconds\n"
-- "average_speed: "LPU64" objects/sec\n"
-- "real-time_speed: "LPU64" objects/sec\n"
-- "current_position: %u\n"
-- "lf_scanned: "LPU64"\n"
-- "lf_repaired: "LPU64"\n"
-- "lf_failed: "LPU64"\n",
-- rtime, speed, new_checked, scrub->os_pos_current,
-- scrub->os_lf_scanned, scrub->os_lf_repaired,
-- scrub->os_lf_failed);
-+ seq_printf(m, "run_time: %u seconds\n"
-+ "average_speed: "LPU64" objects/sec\n"
-+ "real-time_speed: "LPU64" objects/sec\n"
-+ "current_position: %u\n"
-+ "lf_scanned: "LPU64"\n"
-+ "lf_repaired: "LPU64"\n"
-+ "lf_failed: "LPU64"\n",
-+ rtime, speed, new_checked, scrub->os_pos_current,
-+ scrub->os_lf_scanned, scrub->os_lf_repaired,
-+ scrub->os_lf_failed);
- } else {
- if (sf->sf_run_time != 0)
- do_div(speed, sf->sf_run_time);
-- rc = seq_printf(m, "run_time: %u seconds\n"
-- "average_speed: "LPU64" objects/sec\n"
-- "real-time_speed: N/A\n"
-- "current_position: N/A\n"
-- "lf_scanned: "LPU64"\n"
-- "lf_repaired: "LPU64"\n"
-- "lf_failed: "LPU64"\n",
-- sf->sf_run_time, speed, scrub->os_lf_scanned,
-- scrub->os_lf_repaired, scrub->os_lf_failed);
-+ seq_printf(m, "run_time: %u seconds\n"
-+ "average_speed: "LPU64" objects/sec\n"
-+ "real-time_speed: N/A\n"
-+ "current_position: N/A\n"
-+ "lf_scanned: "LPU64"\n"
-+ "lf_repaired: "LPU64"\n"
-+ "lf_failed: "LPU64"\n",
-+ sf->sf_run_time, speed, scrub->os_lf_scanned,
-+ scrub->os_lf_repaired, scrub->os_lf_failed);
- }
-
--out:
- up_read(&scrub->os_rwsem);
-- return (rc < 0 ? -ENOSPC : 0);
-+ return 0;
- }
-diff --git a/lustre/osd-zfs/osd_lproc.c b/lustre/osd-zfs/osd_lproc.c
-index c43aff8..d648298 100644
---- a/lustre/osd-zfs/osd_lproc.c
-+++ b/lustre/osd-zfs/osd_lproc.c
-@@ -217,7 +217,8 @@ out:
-
- static int zfs_osd_fstype_seq_show(struct seq_file *m, void *data)
- {
-- return seq_printf(m, "zfs\n");
-+ seq_puts(m, "zfs\n");
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(zfs_osd_fstype);
-
-@@ -226,7 +227,8 @@ static int zfs_osd_mntdev_seq_show(struct seq_file *m, void *data)
- struct osd_device *osd = osd_dt_dev((struct dt_device *)m->private);
-
- LASSERT(osd != NULL);
-- return seq_printf(m, "%s\n", osd->od_mntdev);
-+ seq_printf(m, "%s\n", osd->od_mntdev);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(zfs_osd_mntdev);
-
-@@ -254,7 +256,8 @@ static int zfs_osd_iused_est_seq_show(struct seq_file *m, void *data)
- struct osd_device *osd = osd_dt_dev((struct dt_device *)m->private);
- LASSERT(osd != NULL);
-
-- return seq_printf(m, "%d\n", osd->od_quota_iused_est);
-+ seq_printf(m, "%d\n", osd->od_quota_iused_est);
-+ return 0;
- }
-
- static ssize_t
-diff --git a/lustre/osp/lproc_osp.c b/lustre/osp/lproc_osp.c
-index 422b388..cf0ee83 100644
---- a/lustre/osp/lproc_osp.c
-+++ b/lustre/osp/lproc_osp.c
-@@ -52,12 +52,11 @@
- static int osp_active_seq_show(struct seq_file *m, void *data)
- {
- struct obd_device *dev = m->private;
-- int rc;
-
- LPROCFS_CLIMP_CHECK(dev);
-- rc = seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
-+ seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive);
- LPROCFS_CLIMP_EXIT(dev);
-- return rc;
-+ return 0;
- }
-
- /**
-@@ -113,7 +112,8 @@ static int osp_syn_in_flight_seq_show(struct seq_file *m, void *data)
- if (osp == NULL)
- return -EINVAL;
-
-- return seq_printf(m, "%u\n", osp->opd_syn_rpc_in_flight);
-+ seq_printf(m, "%u\n", osp->opd_syn_rpc_in_flight);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(osp_syn_in_flight);
-
-@@ -133,7 +133,8 @@ static int osp_syn_in_prog_seq_show(struct seq_file *m, void *data)
- if (osp == NULL)
- return -EINVAL;
-
-- return seq_printf(m, "%u\n", osp->opd_syn_rpc_in_progress);
-+ seq_printf(m, "%u\n", osp->opd_syn_rpc_in_progress);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(osp_syn_in_prog);
-
-@@ -153,7 +154,8 @@ static int osp_syn_changes_seq_show(struct seq_file *m, void *data)
- if (osp == NULL)
- return -EINVAL;
-
-- return seq_printf(m, "%lu\n", osp->opd_syn_changes);
-+ seq_printf(m, "%lu\n", osp->opd_syn_changes);
-+ return 0;
- }
-
- /**
-@@ -203,7 +205,8 @@ static int osp_max_rpcs_in_flight_seq_show(struct seq_file *m, void *data)
- if (osp == NULL)
- return -EINVAL;
-
-- return seq_printf(m, "%u\n", osp->opd_syn_max_rpc_in_flight);
-+ seq_printf(m, "%u\n", osp->opd_syn_max_rpc_in_flight);
-+ return 0;
- }
-
- /**
-@@ -256,7 +259,8 @@ static int osp_max_rpcs_in_prog_seq_show(struct seq_file *m, void *data)
- if (osp == NULL)
- return -EINVAL;
-
-- return seq_printf(m, "%u\n", osp->opd_syn_max_rpc_in_progress);
-+ seq_printf(m, "%u\n", osp->opd_syn_max_rpc_in_progress);
-+ return 0;
- }
-
- /**
-@@ -310,7 +314,8 @@ static int osp_create_count_seq_show(struct seq_file *m, void *data)
- if (osp == NULL || osp->opd_pre == NULL)
- return 0;
-
-- return seq_printf(m, "%d\n", osp->opd_pre_create_count);
-+ seq_printf(m, "%d\n", osp->opd_pre_create_count);
-+ return 0;
- }
-
- /**
-@@ -378,7 +383,8 @@ static int osp_max_create_count_seq_show(struct seq_file *m, void *data)
- if (osp == NULL || osp->opd_pre == NULL)
- return 0;
-
-- return seq_printf(m, "%d\n", osp->opd_pre_max_create_count);
-+ seq_printf(m, "%d\n", osp->opd_pre_max_create_count);
-+ return 0;
- }
-
- /**
-@@ -437,7 +443,8 @@ static int osp_prealloc_next_id_seq_show(struct seq_file *m, void *data)
- if (osp == NULL || osp->opd_pre == NULL)
- return 0;
-
-- return seq_printf(m, "%u\n", fid_oid(&osp->opd_pre_used_fid) + 1);
-+ seq_printf(m, "%u\n", fid_oid(&osp->opd_pre_used_fid) + 1);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(osp_prealloc_next_id);
-
-@@ -457,7 +464,8 @@ static int osp_prealloc_last_id_seq_show(struct seq_file *m, void *data)
- if (osp == NULL || osp->opd_pre == NULL)
- return 0;
-
-- return seq_printf(m, "%u\n", fid_oid(&osp->opd_pre_last_created_fid));
-+ seq_printf(m, "%u\n", fid_oid(&osp->opd_pre_last_created_fid));
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(osp_prealloc_last_id);
-
-@@ -477,7 +485,8 @@ static int osp_prealloc_next_seq_seq_show(struct seq_file *m, void *data)
- if (osp == NULL || osp->opd_pre == NULL)
- return 0;
-
-- return seq_printf(m, LPX64"\n", fid_seq(&osp->opd_pre_used_fid));
-+ seq_printf(m, LPX64"\n", fid_seq(&osp->opd_pre_used_fid));
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(osp_prealloc_next_seq);
-
-@@ -497,8 +506,9 @@ static int osp_prealloc_last_seq_seq_show(struct seq_file *m, void *data)
- if (osp == NULL || osp->opd_pre == NULL)
- return 0;
-
-- return seq_printf(m, LPX64"\n",
-- fid_seq(&osp->opd_pre_last_created_fid));
-+ seq_printf(m, LPX64"\n",
-+ fid_seq(&osp->opd_pre_last_created_fid));
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(osp_prealloc_last_seq);
-
-@@ -518,7 +528,8 @@ static int osp_prealloc_reserved_seq_show(struct seq_file *m, void *data)
- if (osp == NULL || osp->opd_pre == NULL)
- return 0;
-
-- return seq_printf(m, LPU64"\n", osp->opd_pre_reserved);
-+ seq_printf(m, LPU64"\n", osp->opd_pre_reserved);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(osp_prealloc_reserved);
-
-@@ -538,7 +549,8 @@ static int osp_maxage_seq_show(struct seq_file *m, void *data)
- if (osp == NULL)
- return -EINVAL;
-
-- return seq_printf(m, "%u\n", osp->opd_statfs_maxage);
-+ seq_printf(m, "%u\n", osp->opd_statfs_maxage);
-+ return 0;
- }
-
- /**
-@@ -593,7 +605,8 @@ static int osp_pre_status_seq_show(struct seq_file *m, void *data)
- if (osp == NULL || osp->opd_pre == NULL)
- return -EINVAL;
-
-- return seq_printf(m, "%d\n", osp->opd_pre_status);
-+ seq_printf(m, "%d\n", osp->opd_pre_status);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(osp_pre_status);
-
-@@ -620,8 +633,9 @@ static int osp_destroys_in_flight_seq_show(struct seq_file *m, void *data)
- if (osp == NULL)
- return -EINVAL;
-
-- return seq_printf(m, "%lu\n",
-- osp->opd_syn_rpc_in_progress + osp->opd_syn_changes);
-+ seq_printf(m, "%lu\n",
-+ osp->opd_syn_rpc_in_progress + osp->opd_syn_changes);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(osp_destroys_in_flight);
-
-@@ -641,7 +655,8 @@ static int osp_old_sync_processed_seq_show(struct seq_file *m, void *data)
- if (osp == NULL)
- return -EINVAL;
-
-- return seq_printf(m, "%d\n", osp->opd_syn_prev_done);
-+ seq_printf(m, "%d\n", osp->opd_syn_prev_done);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(osp_old_sync_processed);
-
-@@ -660,7 +675,8 @@ osp_lfsck_max_rpcs_in_flight_seq_show(struct seq_file *m, void *data)
- __u32 max;
-
- max = obd_get_max_rpcs_in_flight(&dev->u.cli);
-- return seq_printf(m, "%u\n", max);
-+ seq_printf(m, "%u\n", max);
-+ return 0;
- }
-
- /**
-diff --git a/lustre/ptlrpc/gss/lproc_gss.c b/lustre/ptlrpc/gss/lproc_gss.c
-index 13427fc..4648695 100644
---- a/lustre/ptlrpc/gss/lproc_gss.c
-+++ b/lustre/ptlrpc/gss/lproc_gss.c
-@@ -96,25 +96,26 @@ void gss_stat_oos_record_svc(int phase, int replay)
-
- static int gss_proc_oos_seq_show(struct seq_file *m, void *v)
- {
-- return seq_printf(m, "seqwin: %u\n"
-- "backwin: %u\n"
-- "client fall behind seqwin\n"
-- " occurrence: %d\n"
-- " max seq behind: %d\n"
-- "server replay detected:\n"
-- " phase 0: %d\n"
-- " phase 1: %d\n"
-- " phase 2: %d\n"
-- "server verify ok:\n"
-- " phase 2: %d\n",
-- GSS_SEQ_WIN_MAIN,
-- GSS_SEQ_WIN_BACK,
-- atomic_read(&gss_stat_oos.oos_cli_count),
-- gss_stat_oos.oos_cli_behind,
-- atomic_read(&gss_stat_oos.oos_svc_replay[0]),
-- atomic_read(&gss_stat_oos.oos_svc_replay[1]),
-- atomic_read(&gss_stat_oos.oos_svc_replay[2]),
-- atomic_read(&gss_stat_oos.oos_svc_pass[2]));
-+ seq_printf(m, "seqwin: %u\n"
-+ "backwin: %u\n"
-+ "client fall behind seqwin\n"
-+ " occurrence: %d\n"
-+ " max seq behind: %d\n"
-+ "server replay detected:\n"
-+ " phase 0: %d\n"
-+ " phase 1: %d\n"
-+ " phase 2: %d\n"
-+ "server verify ok:\n"
-+ " phase 2: %d\n",
-+ GSS_SEQ_WIN_MAIN,
-+ GSS_SEQ_WIN_BACK,
-+ atomic_read(&gss_stat_oos.oos_cli_count),
-+ gss_stat_oos.oos_cli_behind,
-+ atomic_read(&gss_stat_oos.oos_svc_replay[0]),
-+ atomic_read(&gss_stat_oos.oos_svc_replay[1]),
-+ atomic_read(&gss_stat_oos.oos_svc_replay[2]),
-+ atomic_read(&gss_stat_oos.oos_svc_pass[2]));
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(gss_proc_oos);
-
-@@ -154,7 +155,8 @@ static int gss_lk_debug_level = 1;
-
- static int gss_lk_proc_dl_seq_show(struct seq_file *m, void *v)
- {
-- return seq_printf(m, "%u\n", gss_lk_debug_level);
-+ seq_printf(m, "%u\n", gss_lk_debug_level);
-+ return 0;
- }
-
- static ssize_t
-diff --git a/lustre/ptlrpc/lproc_ptlrpc.c b/lustre/ptlrpc/lproc_ptlrpc.c
-index 4c55fe1..3cb05f5 100644
---- a/lustre/ptlrpc/lproc_ptlrpc.c
-+++ b/lustre/ptlrpc/lproc_ptlrpc.c
-@@ -268,7 +268,8 @@ ptlrpc_lprocfs_req_history_len_seq_show(struct seq_file *m, void *v)
- ptlrpc_service_for_each_part(svcpt, i, svc)
- total += svcpt->scp_hist_nrqbds;
-
-- return seq_printf(m, "%d\n", total);
-+ seq_printf(m, "%d\n", total);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ptlrpc_lprocfs_req_history_len);
-
-@@ -283,7 +284,8 @@ ptlrpc_lprocfs_req_history_max_seq_show(struct seq_file *m, void *n)
- ptlrpc_service_for_each_part(svcpt, i, svc)
- total += svc->srv_hist_nrqbds_cpt_max;
-
-- return seq_printf(m, "%d\n", total);
-+ seq_printf(m, "%d\n", total);
-+ return 0;
- }
-
- static ssize_t
-@@ -330,8 +332,9 @@ ptlrpc_lprocfs_threads_min_seq_show(struct seq_file *m, void *n)
- {
- struct ptlrpc_service *svc = m->private;
-
-- return seq_printf(m, "%d\n",
-- svc->srv_nthrs_cpt_init * svc->srv_ncpts);
-+ seq_printf(m, "%d\n",
-+ svc->srv_nthrs_cpt_init * svc->srv_ncpts);
-+ return 0;
- }
-
- static ssize_t
-@@ -375,7 +378,8 @@ ptlrpc_lprocfs_threads_started_seq_show(struct seq_file *m, void *n)
- ptlrpc_service_for_each_part(svcpt, i, svc)
- total += svcpt->scp_nthrs_running;
-
-- return seq_printf(m, "%d\n", total);
-+ seq_printf(m, "%d\n", total);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(ptlrpc_lprocfs_threads_started);
-
-@@ -384,8 +388,9 @@ ptlrpc_lprocfs_threads_max_seq_show(struct seq_file *m, void *n)
- {
- struct ptlrpc_service *svc = m->private;
-
-- return seq_printf(m, "%d\n",
-- svc->srv_nthrs_cpt_limit * svc->srv_ncpts);
-+ seq_printf(m, "%d\n",
-+ svc->srv_nthrs_cpt_limit * svc->srv_ncpts);
-+ return 0;
- }
-
- static ssize_t
-@@ -599,21 +604,21 @@ again:
- for (pol_idx = 0; pol_idx < num_pols; pol_idx++) {
- if (strlen(infos[pol_idx].pi_arg) > 0)
- seq_printf(m, " - name: %s %s\n",
-- infos[pol_idx].pi_name,
-- infos[pol_idx].pi_arg);
-+ infos[pol_idx].pi_name,
-+ infos[pol_idx].pi_arg);
- else
- seq_printf(m, " - name: %s\n",
-- infos[pol_idx].pi_name);
-+ infos[pol_idx].pi_name);
-
-
- seq_printf(m, " state: %s\n"
-- " fallback: %s\n"
-- " queued: %-20d\n"
-- " active: %-20d\n\n",
-- nrs_state2str(infos[pol_idx].pi_state),
-- infos[pol_idx].pi_fallback ? "yes" : "no",
-- (int)infos[pol_idx].pi_req_queued,
-- (int)infos[pol_idx].pi_req_started);
-+ " fallback: %s\n"
-+ " queued: %-20d\n"
-+ " active: %-20d\n\n",
-+ nrs_state2str(infos[pol_idx].pi_state),
-+ infos[pol_idx].pi_fallback ? "yes" : "no",
-+ (int)infos[pol_idx].pi_req_queued,
-+ (int)infos[pol_idx].pi_req_started);
- }
-
- if (!hp && nrs_svc_has_hp(svc)) {
-@@ -1047,7 +1052,8 @@ LPROC_SEQ_FOPS_RO(ptlrpc_lprocfs_timeouts);
- static int ptlrpc_lprocfs_hp_ratio_seq_show(struct seq_file *m, void *v)
- {
- struct ptlrpc_service *svc = m->private;
-- return seq_printf(m, "%d\n", svc->srv_hpreq_ratio);
-+ seq_printf(m, "%d\n", svc->srv_hpreq_ratio);
-+ return 0;
- }
-
- static ssize_t
-@@ -1296,12 +1302,11 @@ int lprocfs_pinger_recov_seq_show(struct seq_file *m, void *n)
- {
- struct obd_device *obd = m->private;
- struct obd_import *imp = obd->u.cli.cl_import;
-- int rc;
-
- LPROCFS_CLIMP_CHECK(obd);
-- rc = seq_printf(m, "%d\n", !imp->imp_no_pinger_recover);
-+ seq_printf(m, "%d\n", !imp->imp_no_pinger_recover);
- LPROCFS_CLIMP_EXIT(obd);
-- return rc;
-+ return 0;
- }
- EXPORT_SYMBOL(lprocfs_pinger_recov_seq_show);
-
-diff --git a/lustre/ptlrpc/nodemap_lproc.c b/lustre/ptlrpc/nodemap_lproc.c
-index e5c4b0c..a77c478 100644
---- a/lustre/ptlrpc/nodemap_lproc.c
-+++ b/lustre/ptlrpc/nodemap_lproc.c
-@@ -239,7 +239,8 @@ static int nodemap_exports_open(struct inode *inode, struct file *file)
- */
- static int nodemap_active_seq_show(struct seq_file *m, void *data)
- {
-- return seq_printf(m, "%u\n", (unsigned int)nodemap_active);
-+ seq_printf(m, "%u\n", (unsigned int)nodemap_active);
-+ return 0;
- }
-
- /**
-@@ -290,21 +291,20 @@ LPROC_SEQ_FOPS(nodemap_active);
- static int nodemap_id_seq_show(struct seq_file *m, void *data)
- {
- struct lu_nodemap *nodemap;
-- int rc;
-
- mutex_lock(&active_config_lock);
- nodemap = nodemap_lookup(m->private);
- mutex_unlock(&active_config_lock);
- if (IS_ERR(nodemap)) {
-- rc = PTR_ERR(nodemap);
-+ int rc = PTR_ERR(nodemap);
- CERROR("cannot find nodemap '%s': rc = %d\n",
- (char *)m->private, rc);
- return rc;
- }
-
-- rc = seq_printf(m, "%u\n", nodemap->nm_id);
-+ seq_printf(m, "%u\n", nodemap->nm_id);
- nodemap_putref(nodemap);
-- return rc;
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(nodemap_id);
-
-@@ -318,21 +318,20 @@ LPROC_SEQ_FOPS_RO(nodemap_id);
- static int nodemap_squash_uid_seq_show(struct seq_file *m, void *data)
- {
- struct lu_nodemap *nodemap;
-- int rc;
-
- mutex_lock(&active_config_lock);
- nodemap = nodemap_lookup(m->private);
- mutex_unlock(&active_config_lock);
- if (IS_ERR(nodemap)) {
-- rc = PTR_ERR(nodemap);
-+ int rc = PTR_ERR(nodemap);
- CERROR("cannot find nodemap '%s': rc = %d\n",
- (char *)m->private, rc);
- return rc;
- }
-
-- rc = seq_printf(m, "%u\n", nodemap->nm_squash_uid);
-+ seq_printf(m, "%u\n", nodemap->nm_squash_uid);
- nodemap_putref(nodemap);
-- return rc;
-+ return 0;
- }
-
- /**
-@@ -345,21 +344,20 @@ static int nodemap_squash_uid_seq_show(struct seq_file *m, void *data)
- static int nodemap_squash_gid_seq_show(struct seq_file *m, void *data)
- {
- struct lu_nodemap *nodemap;
-- int rc;
-
- mutex_lock(&active_config_lock);
- nodemap = nodemap_lookup(m->private);
- mutex_unlock(&active_config_lock);
- if (IS_ERR(nodemap)) {
-- rc = PTR_ERR(nodemap);
-+ int rc = PTR_ERR(nodemap);
- CERROR("cannot find nodemap '%s': rc = %d\n",
- (char *)m->private, rc);
- return rc;
- }
-
-- rc = seq_printf(m, "%u\n", nodemap->nm_squash_gid);
-+ seq_printf(m, "%u\n", nodemap->nm_squash_gid);
- nodemap_putref(nodemap);
-- return rc;
-+ return 0;
- }
-
- /**
-@@ -372,21 +370,21 @@ static int nodemap_squash_gid_seq_show(struct seq_file *m, void *data)
- static int nodemap_trusted_seq_show(struct seq_file *m, void *data)
- {
- struct lu_nodemap *nodemap;
-- int rc;
-
- mutex_lock(&active_config_lock);
- nodemap = nodemap_lookup(m->private);
- mutex_unlock(&active_config_lock);
- if (IS_ERR(nodemap)) {
-- rc = PTR_ERR(nodemap);
-+ int rc = PTR_ERR(nodemap);
-+
- CERROR("cannot find nodemap '%s': rc = %d\n",
- (char *)m->private, rc);
- return rc;
- }
-
-- rc = seq_printf(m, "%d\n", (int)nodemap->nmf_trust_client_ids);
-+ seq_printf(m, "%d\n", (int)nodemap->nmf_trust_client_ids);
- nodemap_putref(nodemap);
-- return rc;
-+ return 0;
- }
-
- /**
-@@ -411,9 +409,9 @@ static int nodemap_admin_seq_show(struct seq_file *m, void *data)
- return rc;
- }
-
-- rc = seq_printf(m, "%d\n", (int)nodemap->nmf_allow_root_access);
-+ seq_printf(m, "%d\n", (int)nodemap->nmf_allow_root_access);
- nodemap_putref(nodemap);
-- return rc;
-+ return 0;
- }
-
- #ifdef NODEMAP_PROC_DEBUG
-diff --git a/lustre/ptlrpc/nrs_tbf.c b/lustre/ptlrpc/nrs_tbf.c
-index 7f92e10..6c94ff5 100644
---- a/lustre/ptlrpc/nrs_tbf.c
-+++ b/lustre/ptlrpc/nrs_tbf.c
-@@ -832,9 +832,10 @@ static int nrs_tbf_jobid_rule_init(struct ptlrpc_nrs_policy *policy,
- static int
- nrs_tbf_jobid_rule_dump(struct nrs_tbf_rule *rule, struct seq_file *m)
- {
-- return seq_printf(m, "%s {%s} %llu, ref %d\n", rule->tr_name,
-+ seq_printf(m, "%s {%s} %llu, ref %d\n", rule->tr_name,
- rule->tr_jobids_str, rule->tr_rpc_rate,
- atomic_read(&rule->tr_ref) - 1);
-+ return 0;
- }
-
- static int
-@@ -1037,9 +1038,10 @@ static int nrs_tbf_nid_rule_init(struct ptlrpc_nrs_policy *policy,
- static int
- nrs_tbf_nid_rule_dump(struct nrs_tbf_rule *rule, struct seq_file *m)
- {
-- return seq_printf(m, "%s {%s} %llu, ref %d\n", rule->tr_name,
-+ seq_printf(m, "%s {%s} %llu, ref %d\n", rule->tr_name,
- rule->tr_nids_str, rule->tr_rpc_rate,
- atomic_read(&rule->tr_ref) - 1);
-+ return 0;
- }
-
- static int
-diff --git a/lustre/ptlrpc/sec_bulk.c b/lustre/ptlrpc/sec_bulk.c
-index c091dd6..87b570e 100644
---- a/lustre/ptlrpc/sec_bulk.c
-+++ b/lustre/ptlrpc/sec_bulk.c
-@@ -138,55 +138,49 @@ static struct shrinker *pools_shrinker;
- */
- int sptlrpc_proc_enc_pool_seq_show(struct seq_file *m, void *v)
- {
-- int rc;
--
- spin_lock(&page_pools.epp_lock);
-
-- rc = seq_printf(m,
-- "physical pages: %lu\n"
-- "pages per pool: %lu\n"
-- "max pages: %lu\n"
-- "max pools: %u\n"
-- "total pages: %lu\n"
-- "total free: %lu\n"
-- "idle index: %lu/100\n"
-- "last shrink: %lds\n"
-- "last access: %lds\n"
-- "max pages reached: %lu\n"
-- "grows: %u\n"
-- "grows failure: %u\n"
-- "shrinks: %u\n"
-- "cache access: %lu\n"
-- "cache missing: %lu\n"
-- "low free mark: %lu\n"
-- "max waitqueue depth: %u\n"
-- "max wait time: "CFS_TIME_T"/%lu\n"
-- "out of mem: %lu\n"
-- ,
-- totalram_pages,
-- PAGES_PER_POOL,
-- page_pools.epp_max_pages,
-- page_pools.epp_max_pools,
-- page_pools.epp_total_pages,
-- page_pools.epp_free_pages,
-- page_pools.epp_idle_idx,
-- cfs_time_current_sec() - page_pools.epp_last_shrink,
-- cfs_time_current_sec() - page_pools.epp_last_access,
-- page_pools.epp_st_max_pages,
-- page_pools.epp_st_grows,
-- page_pools.epp_st_grow_fails,
-- page_pools.epp_st_shrinks,
-- page_pools.epp_st_access,
-- page_pools.epp_st_missings,
-- page_pools.epp_st_lowfree,
-- page_pools.epp_st_max_wqlen,
-- page_pools.epp_st_max_wait,
-- msecs_to_jiffies(MSEC_PER_SEC),
-- page_pools.epp_st_outofmem
-- );
-+ seq_printf(m, "physical pages: %lu\n"
-+ "pages per pool: %lu\n"
-+ "max pages: %lu\n"
-+ "max pools: %u\n"
-+ "total pages: %lu\n"
-+ "total free: %lu\n"
-+ "idle index: %lu/100\n"
-+ "last shrink: %lds\n"
-+ "last access: %lds\n"
-+ "max pages reached: %lu\n"
-+ "grows: %u\n"
-+ "grows failure: %u\n"
-+ "shrinks: %u\n"
-+ "cache access: %lu\n"
-+ "cache missing: %lu\n"
-+ "low free mark: %lu\n"
-+ "max waitqueue depth: %u\n"
-+ "max wait time: "CFS_TIME_T"/%lu\n"
-+ "out of mem: %lu\n",
-+ totalram_pages, PAGES_PER_POOL,
-+ page_pools.epp_max_pages,
-+ page_pools.epp_max_pools,
-+ page_pools.epp_total_pages,
-+ page_pools.epp_free_pages,
-+ page_pools.epp_idle_idx,
-+ cfs_time_current_sec() - page_pools.epp_last_shrink,
-+ cfs_time_current_sec() - page_pools.epp_last_access,
-+ page_pools.epp_st_max_pages,
-+ page_pools.epp_st_grows,
-+ page_pools.epp_st_grow_fails,
-+ page_pools.epp_st_shrinks,
-+ page_pools.epp_st_access,
-+ page_pools.epp_st_missings,
-+ page_pools.epp_st_lowfree,
-+ page_pools.epp_st_max_wqlen,
-+ page_pools.epp_st_max_wait,
-+ msecs_to_jiffies(MSEC_PER_SEC),
-+ page_pools.epp_st_outofmem);
-
- spin_unlock(&page_pools.epp_lock);
-- return rc;
-+ return 0;
- }
-
- static void enc_pools_release_free_pages(long npages)
-diff --git a/lustre/quota/qsd_lib.c b/lustre/quota/qsd_lib.c
-index 9f89cac..efd7840 100644
---- a/lustre/quota/qsd_lib.c
-+++ b/lustre/quota/qsd_lib.c
-@@ -77,7 +77,6 @@ static int qsd_state_seq_show(struct seq_file *m, void *data)
- {
- struct qsd_instance *qsd = m->private;
- char enabled[5];
-- int rc;
-
- LASSERT(qsd != NULL);
-
-@@ -89,14 +88,14 @@ static int qsd_state_seq_show(struct seq_file *m, void *data)
- if (strlen(enabled) == 0)
- strcat(enabled, "none");
-
-- rc = seq_printf(m, "target name: %s\n"
-- "pool ID: %d\n"
-- "type: %s\n"
-- "quota enabled: %s\n"
-- "conn to master: %s\n",
-- qsd->qsd_svname, qsd->qsd_pool_id,
-- qsd->qsd_is_md ? "md" : "dt", enabled,
-- qsd->qsd_exp_valid ? "setup" : "not setup yet");
-+ seq_printf(m, "target name: %s\n"
-+ "pool ID: %d\n"
-+ "type: %s\n"
-+ "quota enabled: %s\n"
-+ "conn to master: %s\n",
-+ qsd->qsd_svname, qsd->qsd_pool_id,
-+ qsd->qsd_is_md ? "md" : "dt", enabled,
-+ qsd->qsd_exp_valid ? "setup" : "not setup yet");
-
- if (qsd->qsd_prepared) {
- memset(enabled, 0, sizeof(enabled));
-@@ -106,18 +105,18 @@ static int qsd_state_seq_show(struct seq_file *m, void *data)
- strcat(enabled, "g");
- if (strlen(enabled) == 0)
- strcat(enabled, "none");
-- rc += seq_printf(m, "space acct: %s\n"
-- "user uptodate: glb[%d],slv[%d],reint[%d]\n"
-- "group uptodate: glb[%d],slv[%d],reint[%d]\n",
-- enabled,
-- qsd->qsd_type_array[USRQUOTA]->qqi_glb_uptodate,
-- qsd->qsd_type_array[USRQUOTA]->qqi_slv_uptodate,
-- qsd->qsd_type_array[USRQUOTA]->qqi_reint,
-- qsd->qsd_type_array[GRPQUOTA]->qqi_glb_uptodate,
-- qsd->qsd_type_array[GRPQUOTA]->qqi_slv_uptodate,
-- qsd->qsd_type_array[GRPQUOTA]->qqi_reint);
-+ seq_printf(m, "space acct: %s\n"
-+ "user uptodate: glb[%d],slv[%d],reint[%d]\n"
-+ "group uptodate: glb[%d],slv[%d],reint[%d]\n",
-+ enabled,
-+ qsd->qsd_type_array[USRQUOTA]->qqi_glb_uptodate,
-+ qsd->qsd_type_array[USRQUOTA]->qqi_slv_uptodate,
-+ qsd->qsd_type_array[USRQUOTA]->qqi_reint,
-+ qsd->qsd_type_array[GRPQUOTA]->qqi_glb_uptodate,
-+ qsd->qsd_type_array[GRPQUOTA]->qqi_slv_uptodate,
-+ qsd->qsd_type_array[GRPQUOTA]->qqi_reint);
- }
-- return rc;
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(qsd_state);
-
-@@ -136,7 +135,8 @@ static int qsd_enabled_seq_show(struct seq_file *m, void *data)
- if (strlen(enabled) == 0)
- strcat(enabled, "none");
-
-- return seq_printf(m, "%s\n", enabled);
-+ seq_printf(m, "%s\n", enabled);
-+ return 0;
- }
- LPROC_SEQ_FOPS_RO(qsd_enabled);
-
-@@ -185,7 +185,8 @@ static int qsd_timeout_seq_show(struct seq_file *m, void *data)
- struct qsd_instance *qsd = m->private;
- LASSERT(qsd != NULL);
-
-- return seq_printf(m, "%d\n", qsd_wait_timeout(qsd));
-+ seq_printf(m, "%d\n", qsd_wait_timeout(qsd));
-+ return 0;
- }
-
- static ssize_t
---
-2.8.2
-
diff --git a/sys-cluster/lustre/files/0013-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch b/sys-cluster/lustre/files/0001-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch
similarity index 89%
rename from sys-cluster/lustre/files/0013-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch
rename to sys-cluster/lustre/files/0001-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch
index b894476..e16ec2e 100644
--- a/sys-cluster/lustre/files/0013-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch
+++ b/sys-cluster/lustre/files/0001-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch
@@ -1,7 +1,7 @@
-From f6253abe465ac9ffea7664da948e0f40b46ca24f Mon Sep 17 00:00:00 2001
+From 9b478d607922c9683663f8e317d93b840e528884 Mon Sep 17 00:00:00 2001
From: Dmitry Eremin <dmitry.eremin@intel.com>
Date: Thu, 5 May 2016 22:08:05 +0300
-Subject: [PATCH 13/19] LU-8056 libcfs: Support for linux 4.2 kernels
+Subject: [PATCH 1/7] LU-8056 libcfs: Support for linux 4.2 kernels
In kernel version 4.2 commit df6b35f409af0a8ff1ef62f552b8402f3fef8665
header file i387.h was renamed to fpu/api.h
@@ -15,10 +15,10 @@ Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
3 files changed, 19 insertions(+)
diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4
-index c787203..9ae2698 100644
+index 636d0ed..cc0e184 100644
--- a/libcfs/autoconf/lustre-libcfs.m4
+++ b/libcfs/autoconf/lustre-libcfs.m4
-@@ -318,6 +318,16 @@ topology_sibling_cpumask, [
+@@ -312,6 +312,16 @@ topology_sibling_cpumask, [
]) # LIBCFS_HAVE_TOPOLOGY_SIBLING_CPUMASK
#
@@ -35,7 +35,7 @@ index c787203..9ae2698 100644
# LIBCFS_PROG_LINUX
#
# LibCFS linux kernel checks
-@@ -356,6 +366,7 @@ LIBCFS_SHRINKER_COUNT
+@@ -350,6 +360,7 @@ LIBCFS_SHRINKER_COUNT
LIBCFS_HLIST_ADD_AFTER
# 4.2
LIBCFS_HAVE_TOPOLOGY_SIBLING_CPUMASK
diff --git a/sys-cluster/lustre/files/0002-LU-6215-gss-cache_head-is-now-on-a-hlist-in-4.3-kern.patch b/sys-cluster/lustre/files/0002-LU-6215-gss-cache_head-is-now-on-a-hlist-in-4.3-kern.patch
deleted file mode 100644
index ba4c2f1..0000000
--- a/sys-cluster/lustre/files/0002-LU-6215-gss-cache_head-is-now-on-a-hlist-in-4.3-kern.patch
+++ /dev/null
@@ -1,192 +0,0 @@
-From 449e99feba4cfd3e417cdfc87e0eb33e163c2cb6 Mon Sep 17 00:00:00 2001
-From: Li Dongyang <dongyang.li@anu.edu.au>
-Date: Tue, 1 Mar 2016 16:10:48 +1100
-Subject: [PATCH 02/19] LU-6215 gss: cache_head is now on a hlist in 4.3+
- kernels
-
-Since kernel 4.3 struct cache_head switched from a single
-list to a hlist. This patch handles the change.
-
-Linux-commit: 129e5824cd96d9289679973f0ff7c48e88d569bb
-
-Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
-Change-Id: Iec4c7d0acf106a8f7b60d72eb2038b6d9e12f422
-Reviewed-on: http://review.whamcloud.com/18728
-Tested-by: Jenkins
-Tested-by: Maloo <hpdd-maloo@intel.com>
-Reviewed-by: James Simmons <uja.ornl@yahoo.com>
-Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
-Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
----
- lustre/autoconf/lustre-core.m4 | 46 +++++++++++++++++++++++++++++++++++++
- lustre/ptlrpc/gss/gss_svc_upcall.c | 47 ++++++++++++++++++++++++++++++++------
- 2 files changed, 86 insertions(+), 7 deletions(-)
-
-diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
-index b8285d0..8ed3500 100644
---- a/lustre/autoconf/lustre-core.m4
-+++ b/lustre/autoconf/lustre-core.m4
-@@ -1948,6 +1948,49 @@ bio_endio, [
- ]) # LC_BIO_ENDIO_USES_ONE_ARG
-
- #
-+# LC_HAVE_LOOP_CTL_GET_FREE
-+#
-+# 4.x kernel have moved userspace APIs to
-+# the separate directory and all of them
-+# support LOOP_CTL_GET_FREE
-+#
-+AC_DEFUN([LC_HAVE_LOOP_CTL_GET_FREE], [
-+LB_CHECK_FILE([$LINUX/include/linux/loop.h], [
-+ LB_CHECK_COMPILE([if have 'HAVE_LOOP_CTL_GET_FREE'],
-+ LOOP_CTL_GET_FREE, [
-+ #include <linux/loop.h>
-+ ],[
-+ int i;
-+
-+ i = LOOP_CTL_GET_FREE;
-+ ],[
-+ AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
-+ [LOOP_CTL_GET_FREE exist])
-+ ])
-+],[
-+ AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
-+ [kernel has LOOP_CTL_GET_FREE])
-+])
-+]) # LC_HAVE_LOOP_CTL_GET_FREE
-+
-+#
-+# LC_HAVE_CACHE_HEAD_HLIST
-+#
-+# 4.3 kernel swiched to hlist for cache_head
-+#
-+AC_DEFUN([LC_HAVE_CACHE_HEAD_HLIST], [
-+LB_CHECK_COMPILE([if 'struct cache_head' has 'cache_list' field],
-+cache_head_has_hlist, [
-+ #include <linux/sunrpc/cache.h>
-+],[
-+ do {} while(sizeof(((struct cache_head *)0)->cache_list));
-+],[
-+ AC_DEFINE(HAVE_CACHE_HEAD_HLIST, 1,
-+ [cache_head has hlist cache_list])
-+])
-+]) # LC_HAVE_CACHE_HEAD_HLIST
-+
-+#
- # LC_PROG_LINUX
- #
- # Lustre linux kernel checks
-@@ -2108,6 +2151,9 @@ AC_DEFUN([LC_PROG_LINUX], [
- LC_BIO_ENDIO_USES_ONE_ARG
- LC_SYMLINK_OPS_USE_NAMEIDATA
-
-+ # 4.3
-+ LC_HAVE_CACHE_HEAD_HLIST
-+
- #
- AS_IF([test "x$enable_server" != xno], [
- LC_FUNC_DEV_SET_RDONLY
-diff --git a/lustre/ptlrpc/gss/gss_svc_upcall.c b/lustre/ptlrpc/gss/gss_svc_upcall.c
-index 429b1eb..2786d69 100644
---- a/lustre/ptlrpc/gss/gss_svc_upcall.c
-+++ b/lustre/ptlrpc/gss/gss_svc_upcall.c
-@@ -149,7 +149,11 @@ struct rsi {
- int major_status, minor_status;
- };
-
-+#ifdef HAVE_CACHE_HEAD_HLIST
-+static struct hlist_head rsi_table[RSI_HASHMAX];
-+#else
- static struct cache_head *rsi_table[RSI_HASHMAX];
-+#endif
- static struct cache_detail rsi_cache;
- static struct rsi *rsi_update(struct rsi *new, struct rsi *old);
- static struct rsi *rsi_lookup(struct rsi *item);
-@@ -242,7 +246,11 @@ static void rsi_put(struct kref *ref)
- {
- struct rsi *rsi = container_of(ref, struct rsi, h.ref);
-
-- LASSERT(rsi->h.next == NULL);
-+#ifdef HAVE_CACHE_HEAD_HLIST
-+ LASSERT(rsi->h.cache_list.next == NULL);
-+#else
-+ LASSERT(rsi->h.next == NULL);
-+#endif
- rsi_free(rsi);
- OBD_FREE_PTR(rsi);
- }
-@@ -430,7 +438,11 @@ struct rsc {
- struct gss_svc_ctx ctx;
- };
-
-+#ifdef HAVE_CACHE_HEAD_HLIST
-+static struct hlist_head rsc_table[RSC_HASHMAX];
-+#else
- static struct cache_head *rsc_table[RSC_HASHMAX];
-+#endif
- static struct cache_detail rsc_cache;
- static struct rsc *rsc_update(struct rsc *new, struct rsc *old);
- static struct rsc *rsc_lookup(struct rsc *item);
-@@ -477,7 +489,11 @@ static void rsc_put(struct kref *ref)
- {
- struct rsc *rsci = container_of(ref, struct rsc, h.ref);
-
-+#ifdef HAVE_CACHE_HEAD_HLIST
-+ LASSERT(rsci->h.cache_list.next == NULL);
-+#else
- LASSERT(rsci->h.next == NULL);
-+#endif
- rsc_free(rsci);
- OBD_FREE_PTR(rsci);
- }
-@@ -693,24 +709,41 @@ typedef int rsc_entry_match(struct rsc *rscp, long data);
-
- static void rsc_flush(rsc_entry_match *match, long data)
- {
-- struct cache_head **ch;
-+#ifdef HAVE_CACHE_HEAD_HLIST
-+ struct cache_head *ch = NULL;
-+ struct hlist_head *head;
-+#else
-+ struct cache_head **ch;
-+#endif
- struct rsc *rscp;
- int n;
- ENTRY;
-
- write_lock(&rsc_cache.hash_lock);
- for (n = 0; n < RSC_HASHMAX; n++) {
-- for (ch = &rsc_cache.hash_table[n]; *ch;) {
-- rscp = container_of(*ch, struct rsc, h);
-+#ifdef HAVE_CACHE_HEAD_HLIST
-+ head = &rsc_cache.hash_table[n];
-+ hlist_for_each_entry(ch, head, cache_list) {
-+ rscp = container_of(ch, struct rsc, h);
-+#else
-+ for (ch = &rsc_cache.hash_table[n]; *ch;) {
-+ rscp = container_of(*ch, struct rsc, h);
-+#endif
-
- if (!match(rscp, data)) {
-- ch = &((*ch)->next);
-+#ifndef HAVE_CACHE_HEAD_HLIST
-+ ch = &((*ch)->next);
-+#endif
- continue;
- }
-
- /* it seems simply set NEGATIVE doesn't work */
-- *ch = (*ch)->next;
-- rscp->h.next = NULL;
-+#ifdef HAVE_CACHE_HEAD_HLIST
-+ hlist_del_init(&ch->cache_list);
-+#else
-+ *ch = (*ch)->next;
-+ rscp->h.next = NULL;
-+#endif
- cache_get(&rscp->h);
- set_bit(CACHE_NEGATIVE, &rscp->h.flags);
- COMPAT_RSC_PUT(&rscp->h, &rsc_cache);
---
-2.8.2
-
diff --git a/sys-cluster/lustre/files/0014-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch b/sys-cluster/lustre/files/0002-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch
similarity index 53%
rename from sys-cluster/lustre/files/0014-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch
rename to sys-cluster/lustre/files/0002-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch
index 4647eed..6ce8433 100644
--- a/sys-cluster/lustre/files/0014-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch
+++ b/sys-cluster/lustre/files/0002-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch
@@ -1,7 +1,7 @@
-From 53b7041eed99418ec8b2a6c3fb29eaa331accfe2 Mon Sep 17 00:00:00 2001
+From 0242d060692573dcb6f09750a62db1fa0f6d36df Mon Sep 17 00:00:00 2001
From: Li Dongyang <dongyang.li@anu.edu.au>
Date: Mon, 16 May 2016 17:18:39 +1000
-Subject: [PATCH 14/19] LU-8056 o2iblnd: ib_query_device removed in 4.5
+Subject: [PATCH 2/7] LU-8056 o2iblnd: ib_query_device removed in 4.5
We should use the cached attributes in ib_device instead of
calling ib_query_device since kernel 4.5
@@ -12,12 +12,12 @@ Linux-commit:cebfe5ca038e2a0f677b41e9682501708ffa2ff3
Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
Change-Id: Ie2ab681a3b508f0a1f89d3ff86bf2713b7257e62
---
- lnet/autoconf/lustre-lnet.m4 | 22 ++++++++++++++
- lnet/klnds/o2iblnd/o2iblnd.c | 69 ++++++++++++++++++++++++++++++++++++++------
- 2 files changed, 82 insertions(+), 9 deletions(-)
+ lnet/autoconf/lustre-lnet.m4 | 22 ++++++++++++++++++++++
+ lnet/klnds/o2iblnd/o2iblnd.c | 20 ++++++++++++++++++--
+ 2 files changed, 40 insertions(+), 2 deletions(-)
diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4
-index 2e2adb2..2aefe70 100644
+index 05b47db..30ad208 100644
--- a/lnet/autoconf/lustre-lnet.m4
+++ b/lnet/autoconf/lustre-lnet.m4
@@ -460,6 +460,28 @@ AS_IF([test $ENABLEO2IB != "no"], [
@@ -50,88 +50,59 @@ index 2e2adb2..2aefe70 100644
]) # LN_CONFIG_O2IB
diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c
-index ada1322..5bae966 100644
+index 92254b8..b174799 100644
--- a/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/lnet/klnds/o2iblnd/o2iblnd.c
-@@ -1562,25 +1562,70 @@ kiblnd_create_fmr_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t **pp_fpo)
+@@ -1579,9 +1579,11 @@ kiblnd_create_fmr_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t **pp_fpo)
kib_fmr_pool_t *fpo;
int rc;
+#ifndef HAVE_IB_DEVICE_ATTRS
-+ dev_attr = kmalloc(sizeof(*dev_attr), GFP_KERNEL);
-+ if (!dev_attr)
-+ return -ENOMEM;
+ dev_attr = kmalloc(sizeof(*dev_attr), GFP_KERNEL);
+ if (!dev_attr)
+ return -ENOMEM;
+#endif
-+
+
LIBCFS_CPT_ALLOC(fpo, lnet_cpt_table(), fps->fps_cpt, sizeof(*fpo));
- if (fpo == NULL)
- return -ENOMEM;
+ if (!fpo) {
+@@ -1591,12 +1593,16 @@ kiblnd_create_fmr_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t **pp_fpo)
fpo->fpo_hdev = kiblnd_current_hdev(dev);
-- fpo->fpo_fmr_pool = ib_create_fmr_pool(fpo->fpo_hdev->ibh_pd, ¶m);
-- if (IS_ERR(fpo->fpo_fmr_pool)) {
-- rc = PTR_ERR(fpo->fpo_fmr_pool);
-- CERROR("Failed to create FMR pool: %d\n", rc);
+#ifdef HAVE_IB_DEVICE_ATTRS
+ dev_attr = &fpo->fpo_hdev->ibh_ibdev->attrs;
+#else
-+ rc = ib_query_device(fpo->fpo_hdev->ibh_ibdev, dev_attr);
-+ if (rc) {
-+ CERROR("Query device failed for %s: %d\n",
-+ fpo->fpo_hdev->ibh_ibdev->name, rc);
-+ goto out_dev_attr;
-+ }
+ rc = ib_query_device(fpo->fpo_hdev->ibh_ibdev, dev_attr);
+ if (rc) {
+ CERROR("Query device failed for %s: %d\n",
+ fpo->fpo_hdev->ibh_ibdev->name, rc);
+ goto out_dev_attr;
+ }
+#endif
-+
-+ /* Check for FMR or FastReg support */
-+ fpo->fpo_is_fmr = 0;
-+ if (fpo->fpo_hdev->ibh_ibdev->alloc_fmr &&
-+ fpo->fpo_hdev->ibh_ibdev->dealloc_fmr &&
-+ fpo->fpo_hdev->ibh_ibdev->map_phys_fmr &&
-+ fpo->fpo_hdev->ibh_ibdev->unmap_fmr) {
-+ LCONSOLE_INFO("Using FMR for registration\n");
-+ fpo->fpo_is_fmr = 1;
-+ } else if (dev_attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) {
-+ LCONSOLE_INFO("Using FastReg for registration\n");
-+ } else {
-+ rc = -ENOSYS;
-+ LCONSOLE_ERROR_MSG(rc, "IB device does not support FMRs nor FastRegs, can't register memory\n");
-+ goto out_dev_attr;
-+ }
-+
-+ if (fpo->fpo_is_fmr)
-+ rc = kiblnd_alloc_fmr_pool(fps, fpo);
-+ else
-+ rc = kiblnd_alloc_freg_pool(fps, fpo);
-+ if (rc)
-+ goto out_fpo;
-+
+
+ /* Check for FMR or FastReg support */
+ fpo->fpo_is_fmr = 0;
+@@ -1621,7 +1627,9 @@ kiblnd_create_fmr_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t **pp_fpo)
+ if (rc)
+ goto out_fpo;
+
+#ifndef HAVE_IB_DEVICE_ATTRS
-+ kfree(dev_attr);
+ kfree(dev_attr);
+#endif
-+ fpo->fpo_deadline = cfs_time_shift(IBLND_POOL_DEADLINE);
-+ fpo->fpo_owner = fps;
-+ *pp_fpo = fpo;
-+
-+ return 0;
-
- kiblnd_hdev_decref(fpo->fpo_hdev);
- LIBCFS_FREE(fpo, sizeof(kib_fmr_pool_t));
- return rc;
- }
+ fpo->fpo_deadline = cfs_time_shift(IBLND_POOL_DEADLINE);
+ fpo->fpo_owner = fps;
+ *pp_fpo = fpo;
+@@ -1633,7 +1641,9 @@ out_fpo:
+ LIBCFS_FREE(fpo, sizeof(*fpo));
-- fpo->fpo_deadline = cfs_time_shift(IBLND_POOL_DEADLINE);
-- fpo->fpo_owner = fps;
-- *pp_fpo = fpo;
-+out_dev_attr:
+ out_dev_attr:
+#ifndef HAVE_IB_DEVICE_ATTRS
-+ kfree(dev_attr);
+ kfree(dev_attr);
+#endif
- return 0;
+ return rc;
}
-@@ -2388,8 +2433,10 @@ kiblnd_net_init_pools(kib_net_t *net, __u32 *cpts, int ncpts)
+@@ -2462,8 +2472,10 @@ kiblnd_net_init_pools(kib_net_t *net, lnet_ni_t *ni, __u32 *cpts, int ncpts)
static int
kiblnd_hdev_get_attr(kib_hca_dev_t *hdev)
{
@@ -144,7 +115,7 @@ index ada1322..5bae966 100644
/* It's safe to assume a HCA can handle a page size
* matching that of the native system */
-@@ -2397,6 +2444,9 @@ kiblnd_hdev_get_attr(kib_hca_dev_t *hdev)
+@@ -2471,6 +2483,9 @@ kiblnd_hdev_get_attr(kib_hca_dev_t *hdev)
hdev->ibh_page_size = 1 << PAGE_SHIFT;
hdev->ibh_page_mask = ~((__u64)hdev->ibh_page_size - 1);
@@ -154,7 +125,7 @@ index ada1322..5bae966 100644
LIBCFS_ALLOC(attr, sizeof(*attr));
if (attr == NULL) {
CERROR("Out of memory\n");
-@@ -2413,6 +2463,7 @@ kiblnd_hdev_get_attr(kib_hca_dev_t *hdev)
+@@ -2487,6 +2502,7 @@ kiblnd_hdev_get_attr(kib_hca_dev_t *hdev)
CERROR("Failed to query IB device: %d\n", rc);
return rc;
}
diff --git a/sys-cluster/lustre/files/0003-LU-6215-llite-handle-locks-API-change-in-4.4-kernels.patch b/sys-cluster/lustre/files/0003-LU-6215-llite-handle-locks-API-change-in-4.4-kernels.patch
deleted file mode 100644
index 4c1c668..0000000
--- a/sys-cluster/lustre/files/0003-LU-6215-llite-handle-locks-API-change-in-4.4-kernels.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From ffcc66dc3a0e7249ac6d5f7506c595cc69209e54 Mon Sep 17 00:00:00 2001
-From: Li Dongyang <dongyang.li@anu.edu.au>
-Date: Tue, 1 Mar 2016 16:36:49 +1100
-Subject: [PATCH 03/19] LU-6215 llite: handle locks API change in 4.4+ kernels
-
-Since 4.4 linux kernel replaced both posix_lock_file_wait() and
-flock_lock_file_wait() by introducing locks_lock_file_wait().
-This patch handles the API change.
-
-Linux-commit: 4f6563677ae833baad8003e14353241bc25da4fc
-
-Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
-Change-Id: I1b9c98c2afcad9da3fb377c3e788b12f20261e9e
-Reviewed-on: http://review.whamcloud.com/18729
-Tested-by: Jenkins
-Tested-by: Maloo <hpdd-maloo@intel.com>
-Reviewed-by: James Simmons <uja.ornl@yahoo.com>
-Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
-Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
----
- lustre/autoconf/lustre-core.m4 | 21 +++++++++++++++++++++
- lustre/llite/file.c | 6 ++++++
- 2 files changed, 27 insertions(+)
-
-diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
-index 8ed3500..b2a4af0 100644
---- a/lustre/autoconf/lustre-core.m4
-+++ b/lustre/autoconf/lustre-core.m4
-@@ -1991,6 +1991,24 @@ cache_head_has_hlist, [
- ]) # LC_HAVE_CACHE_HEAD_HLIST
-
- #
-+# LC_HAVE_LOCKS_LOCK_FILE_WAIT
-+#
-+# 4.4 kernel have moved locks API users to
-+# locks_lock_inode_wait()
-+#
-+AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT], [
-+LB_CHECK_COMPILE([if 'locks_lock_file_wait' exists],
-+locks_lock_file_wait, [
-+ #include <linux/fs.h>
-+],[
-+ locks_lock_file_wait(NULL, NULL);
-+],[
-+ AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
-+ [kernel has locks_lock_file_wait])
-+])
-+]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
-+
-+#
- # LC_PROG_LINUX
- #
- # Lustre linux kernel checks
-@@ -2154,6 +2172,9 @@ AC_DEFUN([LC_PROG_LINUX], [
- # 4.3
- LC_HAVE_CACHE_HEAD_HLIST
-
-+ # 4.4
-+ LC_HAVE_LOCKS_LOCK_FILE_WAIT
-+
- #
- AS_IF([test "x$enable_server" != xno], [
- LC_FUNC_DEV_SET_RDONLY
-diff --git a/lustre/llite/file.c b/lustre/llite/file.c
-index 8e6afbd..d1819c6 100644
---- a/lustre/llite/file.c
-+++ b/lustre/llite/file.c
-@@ -2918,6 +2918,11 @@ ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
- if (!(flags & LDLM_FL_TEST_LOCK))
- file_lock->fl_type = fl_type;
-
-+#ifdef HAVE_LOCKS_LOCK_FILE_WAIT
-+ if ((rc == 0 || file_lock->fl_type == F_UNLCK) &&
-+ !(flags & LDLM_FL_TEST_LOCK))
-+ rc2 = locks_lock_file_wait(file, file_lock);
-+#else
- if ((file_lock->fl_flags & FL_FLOCK) &&
- (rc == 0 || file_lock->fl_type == F_UNLCK))
- rc2 = flock_lock_file_wait(file, file_lock);
-@@ -2925,6 +2930,7 @@ ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
- (rc == 0 || file_lock->fl_type == F_UNLCK) &&
- !(flags & LDLM_FL_TEST_LOCK))
- rc2 = posix_lock_file_wait(file, file_lock);
-+#endif /* HAVE_LOCKS_LOCK_FILE_WAIT */
-
- if (rc2 && file_lock->fl_type != F_UNLCK) {
- einfo.ei_mode = LCK_NL;
---
-2.8.2
-
diff --git a/sys-cluster/lustre/files/0015-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch b/sys-cluster/lustre/files/0003-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch
similarity index 84%
rename from sys-cluster/lustre/files/0015-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch
rename to sys-cluster/lustre/files/0003-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch
index f39059c..756c911 100644
--- a/sys-cluster/lustre/files/0015-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch
+++ b/sys-cluster/lustre/files/0003-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch
@@ -1,7 +1,7 @@
-From ed100a806582374d95a7ef5d714d28276bffe9dc Mon Sep 17 00:00:00 2001
+From 6c3f19ba5b6db287980241e4d20be9ac5d0c1293 Mon Sep 17 00:00:00 2001
From: Li Dongyang <dongyang.li@anu.edu.au>
Date: Mon, 16 May 2016 17:27:23 +1000
-Subject: [PATCH 15/19] LU-8056 socklnd: NETIF_F_ALL_CSUM renamed to
+Subject: [PATCH 3/7] LU-8056 socklnd: NETIF_F_ALL_CSUM renamed to
NETIF_F_CSUM_MASK
In kernel 4.5 NETIF_F_CSUM_MASK got renamed to NETIF_F_CSUM_MASK.
@@ -17,7 +17,7 @@ Change-Id: Id57505eeca613303c584d3cf74284920a837bb43
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/lnet/klnds/socklnd/socklnd.h b/lnet/klnds/socklnd/socklnd.h
-index 4065ef3..ad04fb5 100644
+index f02003a..54794c0 100644
--- a/lnet/klnds/socklnd/socklnd.h
+++ b/lnet/klnds/socklnd/socklnd.h
@@ -66,6 +66,10 @@
@@ -32,10 +32,10 @@ index 4065ef3..ad04fb5 100644
#define SOCKNAL_NSCHEDS 3
#define SOCKNAL_NSCHEDS_HIGH (SOCKNAL_NSCHEDS << 1)
diff --git a/lnet/klnds/socklnd/socklnd_lib.c b/lnet/klnds/socklnd/socklnd_lib.c
-index f270fa7..a672791 100644
+index 9dca0e4..e26db71 100644
--- a/lnet/klnds/socklnd/socklnd_lib.c
+++ b/lnet/klnds/socklnd/socklnd_lib.c
-@@ -377,7 +377,7 @@ ksocknal_lib_zc_capable(ksock_conn_t *conn)
+@@ -71,7 +71,7 @@ ksocknal_lib_zc_capable(ksock_conn_t *conn)
/* ZC if the socket supports scatter/gather and doesn't need software
* checksums */
diff --git a/sys-cluster/lustre/files/0004-LU-6215-llite-make_request_fn-returns-blk_qc_t-in-ke.patch b/sys-cluster/lustre/files/0004-LU-6215-llite-make_request_fn-returns-blk_qc_t-in-ke.patch
deleted file mode 100644
index 3be9aef..0000000
--- a/sys-cluster/lustre/files/0004-LU-6215-llite-make_request_fn-returns-blk_qc_t-in-ke.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From 7d62fb54e3faec60e86135d75cc6349cf626a46b Mon Sep 17 00:00:00 2001
-From: Li Dongyang <dongyang.li@anu.edu.au>
-Date: Tue, 1 Mar 2016 16:53:49 +1100
-Subject: [PATCH 04/19] LU-6215 llite: make_request_fn returns blk_qc_t in
- kernel 4.4
-
-For the 4.4 kernel request_queue.make_request_fn is defined as
-a function returns blk_qc_t. loop_make_request() should return
-BLK_QC_T_NONE in this case.
-
-Linux-commit: dece16353ef47d8d33f5302bc158072a9d65e26f
-
-Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
-Change-Id: I20a796caf6d8e6411f084db2392683c12307a0bf
-Reviewed-on: http://review.whamcloud.com/18730
-Tested-by: Jenkins
-Tested-by: Maloo <hpdd-maloo@intel.com>
-Reviewed-by: James Simmons <uja.ornl@yahoo.com>
-Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
-Reviewed-by: Lai Siyao <lai.siyao@intel.com>
-Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
----
- lustre/autoconf/lustre-core.m4 | 21 +++++++++++++++++++++
- lustre/include/lustre_compat.h | 15 ++++++++++-----
- 2 files changed, 31 insertions(+), 5 deletions(-)
-
-diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
-index b2a4af0..0201a28 100644
---- a/lustre/autoconf/lustre-core.m4
-+++ b/lustre/autoconf/lustre-core.m4
-@@ -2009,6 +2009,26 @@ locks_lock_file_wait, [
- ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
-
- #
-+# LC_HAVE_QC_MAKE_REQUEST_FN
-+#
-+# 4.4 request_queue.make_request_fn defined as function returns with blk_qc_t
-+# see kernel commit dece16353ef47d8d33f5302bc158072a9d65e26f
-+#
-+AC_DEFUN([LC_HAVE_QC_MAKE_REQUEST_FN], [
-+LB_CHECK_COMPILE([if 'request_queue.make_request_fn' returns blk_qc_t],
-+make_request_fn_blk_qc_t, [
-+ #include <linux/blkdev.h>
-+],[
-+ blk_qc_t ret;
-+ make_request_fn *mrf;
-+ ret = mrf(NULL, NULL);
-+],[
-+ AC_DEFINE(HAVE_QC_MAKE_REQUEST_FN, 1,
-+ [request_queue.make_request_fn returns blk_qc_t])
-+])
-+]) # LC_HAVE_QC_MAKE_REQUEST_FN
-+
-+#
- # LC_PROG_LINUX
- #
- # Lustre linux kernel checks
-@@ -2174,6 +2194,7 @@ AC_DEFUN([LC_PROG_LINUX], [
-
- # 4.4
- LC_HAVE_LOCKS_LOCK_FILE_WAIT
-+ LC_HAVE_QC_MAKE_REQUEST_FN
-
- #
- AS_IF([test "x$enable_server" != xno], [
-diff --git a/lustre/include/lustre_compat.h b/lustre/include/lustre_compat.h
-index c038aa1..4e9f3ac 100644
---- a/lustre/include/lustre_compat.h
-+++ b/lustre/include/lustre_compat.h
-@@ -298,12 +298,17 @@ static inline int ll_namei_to_lookup_intent_flag(int flag)
- return flag;
- }
-
--#ifdef HAVE_VOID_MAKE_REQUEST_FN
--# define ll_mrf_ret void
--# define LL_MRF_RETURN(rc)
-+#ifdef HAVE_QC_MAKE_REQUEST_FN
-+# define ll_mrf_ret blk_qc_t
-+# define LL_MRF_RETURN(rc) RETURN(BLK_QC_T_NONE)
- #else
--# define ll_mrf_ret int
--# define LL_MRF_RETURN(rc) RETURN(rc)
-+# ifdef HAVE_VOID_MAKE_REQUEST_FN
-+# define ll_mrf_ret void
-+# define LL_MRF_RETURN(rc)
-+# else
-+# define ll_mrf_ret int
-+# define LL_MRF_RETURN(rc) RETURN(rc)
-+# endif
- #endif
-
- #include <linux/fs.h>
---
-2.8.2
-
diff --git a/sys-cluster/lustre/files/0016-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch b/sys-cluster/lustre/files/0004-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch
similarity index 82%
rename from sys-cluster/lustre/files/0016-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch
rename to sys-cluster/lustre/files/0004-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch
index 7ed56fe..e0aab10 100644
--- a/sys-cluster/lustre/files/0016-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch
+++ b/sys-cluster/lustre/files/0004-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch
@@ -1,7 +1,7 @@
-From 917e3d42d9fe0584c740584db5c5f59cf6875c9f Mon Sep 17 00:00:00 2001
+From ab0006e3a3bf5b0ff63f0914a9e7246dfa1729f8 Mon Sep 17 00:00:00 2001
From: Li Dongyang <dongyang.li@anu.edu.au>
Date: Mon, 16 May 2016 17:40:55 +1000
-Subject: [PATCH 16/19] LU-8056 llite: use inode_lock to access i_mutex
+Subject: [PATCH 4/7] LU-8056 llite: use inode_lock to access i_mutex
Linux kernel 4.5 introduced wrappers for i_mutex as the type
of i_mutex will be changed in the future.
@@ -22,7 +22,7 @@ Change-Id: Ia4c30443cddfaa5232e1dc1519c33c97dba2a271
lustre/include/lustre_compat.h | 6 ++++++
lustre/include/lvfs.h | 4 ++--
lustre/llite/dir.c | 4 ++--
- lustre/llite/file.c | 29 +++++++++++++++++++----------
+ lustre/llite/file.c | 20 ++++++++++----------
lustre/llite/llite_internal.h | 2 --
lustre/llite/llite_lib.c | 8 ++++----
lustre/llite/llite_nfs.c | 4 ++--
@@ -30,13 +30,13 @@ Change-Id: Ia4c30443cddfaa5232e1dc1519c33c97dba2a271
lustre/llite/rw26.c | 4 ++--
lustre/llite/vvp_io.c | 4 ++--
lustre/llite/vvp_page.c | 4 ++--
- 12 files changed, 63 insertions(+), 30 deletions(-)
+ 12 files changed, 54 insertions(+), 30 deletions(-)
diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
-index 9497cdd..622345f 100644
+index 0d5c599..5554490 100644
--- a/lustre/autoconf/lustre-core.m4
+++ b/lustre/autoconf/lustre-core.m4
-@@ -2045,6 +2045,23 @@ key_payload_data_array, [
+@@ -2087,6 +2087,23 @@ key_payload_data_array, [
]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
#
@@ -60,7 +60,7 @@ index 9497cdd..622345f 100644
# LC_PROG_LINUX
#
# Lustre linux kernel checks
-@@ -2213,6 +2230,9 @@ AC_DEFUN([LC_PROG_LINUX], [
+@@ -2259,6 +2276,9 @@ AC_DEFUN([LC_PROG_LINUX], [
LC_HAVE_QC_MAKE_REQUEST_FN
LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
@@ -71,10 +71,10 @@ index 9497cdd..622345f 100644
AS_IF([test "x$enable_server" != xno], [
LC_FUNC_DEV_SET_RDONLY
diff --git a/lustre/include/lustre_compat.h b/lustre/include/lustre_compat.h
-index 4e9f3ac..2a5a2fd 100644
+index d777993..0d303f2 100644
--- a/lustre/include/lustre_compat.h
+++ b/lustre/include/lustre_compat.h
-@@ -370,6 +370,12 @@ static inline struct dentry *d_make_root(struct inode *root)
+@@ -371,6 +371,12 @@ static inline struct dentry *d_make_root(struct inode *root)
#define ll_vfs_unlink(a, b) vfs_unlink(a, b)
#endif
@@ -104,10 +104,10 @@ index be4187f..2bdee77 100644
if (IS_ERR(dchild) || dchild->d_inode == NULL)
return dchild;
diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c
-index 4f28145..f657725 100644
+index ec71a19..1f6e02c 100644
--- a/lustre/llite/dir.c
+++ b/lustre/llite/dir.c
-@@ -1736,7 +1736,7 @@ static loff_t ll_dir_seek(struct file *file, loff_t offset, int origin)
+@@ -1733,7 +1733,7 @@ static loff_t ll_dir_seek(struct file *file, loff_t offset, int origin)
loff_t ret = -EINVAL;
ENTRY;
@@ -116,7 +116,7 @@ index 4f28145..f657725 100644
switch (origin) {
case SEEK_SET:
break;
-@@ -1774,7 +1774,7 @@ static loff_t ll_dir_seek(struct file *file, loff_t offset, int origin)
+@@ -1771,7 +1771,7 @@ static loff_t ll_dir_seek(struct file *file, loff_t offset, int origin)
GOTO(out, ret);
out:
@@ -126,10 +126,10 @@ index 4f28145..f657725 100644
}
diff --git a/lustre/llite/file.c b/lustre/llite/file.c
-index d1819c6..b8670c7 100644
+index cfc01f4..f381d26 100644
--- a/lustre/llite/file.c
+++ b/lustre/llite/file.c
-@@ -2144,13 +2144,13 @@ static int ll_hsm_import(struct inode *inode, struct file *file,
+@@ -2162,13 +2162,13 @@ static int ll_hsm_import(struct inode *inode, struct file *file,
ATTR_MTIME | ATTR_MTIME_SET |
ATTR_ATIME | ATTR_ATIME_SET;
@@ -145,7 +145,7 @@ index d1819c6..b8670c7 100644
out:
if (hss != NULL)
-@@ -2197,9 +2197,9 @@ static int ll_file_futimes_3(struct file *file, const struct ll_futimes_3 *lfu)
+@@ -2215,9 +2215,9 @@ static int ll_file_futimes_3(struct file *file, const struct ll_futimes_3 *lfu)
if (!S_ISREG(inode->i_mode))
RETURN(-EINVAL);
@@ -157,7 +157,7 @@ index d1819c6..b8670c7 100644
RETURN(rc);
}
-@@ -2598,9 +2598,9 @@ generic_file_llseek_size(struct file *file, loff_t offset, int origin,
+@@ -2715,9 +2715,9 @@ generic_file_llseek_size(struct file *file, loff_t offset, int origin,
* SEEK_CURs. Note that parallel writes and reads behave
* like SEEK_SET.
*/
@@ -169,7 +169,7 @@ index d1819c6..b8670c7 100644
return offset;
case SEEK_DATA:
/*
-@@ -2758,7 +2758,7 @@ int ll_fsync(struct file *file, struct dentry *dentry, int datasync)
+@@ -2875,7 +2875,7 @@ int ll_fsync(struct file *file, struct dentry *dentry, int datasync)
#ifdef HAVE_FILE_FSYNC_4ARGS
rc = filemap_write_and_wait_range(inode->i_mapping, start, end);
@@ -178,7 +178,7 @@ index d1819c6..b8670c7 100644
#else
/* fsync's caller has already called _fdata{sync,write}, we want
* that IO to finish before calling the osc and mdc sync methods */
-@@ -2796,7 +2796,7 @@ int ll_fsync(struct file *file, struct dentry *dentry, int datasync)
+@@ -2913,7 +2913,7 @@ int ll_fsync(struct file *file, struct dentry *dentry, int datasync)
}
#ifdef HAVE_FILE_FSYNC_4ARGS
@@ -187,38 +187,29 @@ index d1819c6..b8670c7 100644
#endif
RETURN(rc);
}
-@@ -3021,7 +3021,15 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx,
- if (child_inode == NULL)
- GOTO(out_free, rc = -EINVAL);
+@@ -3146,7 +3146,7 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx,
+ if (child_inode == parent->i_sb->s_root->d_inode)
+ GOTO(out_iput, rc = -EINVAL);
- mutex_lock(&child_inode->i_mutex);
-+ /*
-+ * lfs migrate command needs to be blocked on the client
-+ * by checking the migrate FID against the FID of the
-+ * filesystem root.
-+ */
-+ if (child_inode == parent->i_sb->s_root->d_inode)
-+ GOTO(out_iput, rc = -EINVAL);
-+
+ inode_lock(child_inode);
op_data->op_fid3 = *ll_inode2fid(child_inode);
if (!fid_is_sane(&op_data->op_fid3)) {
CERROR("%s: migrate %s, but FID "DFID" is insane\n",
-@@ -3099,7 +3107,8 @@ out_close:
+@@ -3224,7 +3224,7 @@ out_close:
if (rc == 0)
clear_nlink(child_inode);
out_unlock:
- mutex_unlock(&child_inode->i_mutex);
+ inode_unlock(child_inode);
-+out_iput:
+ out_iput:
iput(child_inode);
out_free:
- ll_finish_md_op_data(op_data);
diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h
-index adbf9d3..94c8045 100644
+index 20956f4..9c9979e 100644
--- a/lustre/llite/llite_internal.h
+++ b/lustre/llite/llite_internal.h
-@@ -681,8 +681,6 @@ struct ll_file_data {
+@@ -693,8 +693,6 @@ struct ll_file_data {
struct list_head fd_lccs; /* list of ll_cl_context */
};
@@ -228,10 +219,10 @@ index adbf9d3..94c8045 100644
static inline struct inode *ll_info2i(struct ll_inode_info *lli)
diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c
-index d1050d4..bf80506 100644
+index c488fc2..9a8c69b 100644
--- a/lustre/llite/llite_lib.c
+++ b/lustre/llite/llite_lib.c
-@@ -1521,10 +1521,10 @@ static int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data)
+@@ -1545,10 +1545,10 @@ static int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data)
* cache is not cleared yet. */
op_data->op_attr.ia_valid &= ~(TIMES_SET_FLAGS | ATTR_SIZE);
if (S_ISREG(inode->i_mode))
@@ -244,7 +235,7 @@ index d1050d4..bf80506 100644
op_data->op_attr.ia_valid = ia_valid;
rc = ll_update_inode(inode, &md);
-@@ -1613,7 +1613,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import)
+@@ -1637,7 +1637,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import)
if (S_ISREG(inode->i_mode)) {
if (attr->ia_valid & ATTR_SIZE)
inode_dio_write_done(inode);
@@ -253,7 +244,7 @@ index d1050d4..bf80506 100644
}
/* We always do an MDS RPC, even if we're only changing the size;
-@@ -1690,7 +1690,7 @@ out:
+@@ -1714,7 +1714,7 @@ out:
ll_finish_md_op_data(op_data);
if (S_ISREG(inode->i_mode)) {
@@ -283,7 +274,7 @@ index 9e19e78..bc238f5 100644
if (!rc && !lgd.lgd_found)
rc = -ENOENT;
diff --git a/lustre/llite/lloop.c b/lustre/llite/lloop.c
-index f3b9288..c20df96 100644
+index b8ae0b5..64318ca 100644
--- a/lustre/llite/lloop.c
+++ b/lustre/llite/lloop.c
@@ -277,9 +277,9 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head)
@@ -299,10 +290,10 @@ index f3b9288..c20df96 100644
return (bytes == pvec->ldp_size) ? 0 : (int)bytes;
}
diff --git a/lustre/llite/rw26.c b/lustre/llite/rw26.c
-index b362532..ad692db 100644
+index d9482b2..3f02754 100644
--- a/lustre/llite/rw26.c
+++ b/lustre/llite/rw26.c
-@@ -388,7 +388,7 @@ ll_direct_IO(
+@@ -389,7 +389,7 @@ ll_direct_IO(
* 1. Need inode mutex to operate transient pages.
*/
if (iov_iter_rw(iter) == READ)
@@ -311,7 +302,7 @@ index b362532..ad692db 100644
while (iov_iter_count(iter)) {
struct page **pages;
-@@ -439,7 +439,7 @@ ll_direct_IO(
+@@ -440,7 +440,7 @@ ll_direct_IO(
}
out:
if (iov_iter_rw(iter) == READ)
@@ -321,10 +312,10 @@ index b362532..ad692db 100644
if (tot_bytes > 0) {
struct vvp_io *vio = vvp_env_io(env);
diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c
-index cbc4997..8dc657b 100644
+index 8a81b83..a48a0b0 100644
--- a/lustre/llite/vvp_io.c
+++ b/lustre/llite/vvp_io.c
-@@ -736,7 +736,7 @@ static int vvp_io_setattr_start(const struct lu_env *env,
+@@ -661,7 +661,7 @@ static int vvp_io_setattr_start(const struct lu_env *env,
struct inode *inode = vvp_object_inode(io->ci_obj);
struct ll_inode_info *lli = ll_i2info(inode);
@@ -333,7 +324,7 @@ index cbc4997..8dc657b 100644
if (cl_io_is_trunc(io)) {
down_write(&lli->lli_trunc_sem);
inode_dio_wait(inode);
-@@ -762,7 +762,7 @@ static void vvp_io_setattr_end(const struct lu_env *env,
+@@ -687,7 +687,7 @@ static void vvp_io_setattr_end(const struct lu_env *env,
inode_dio_write_done(inode);
up_write(&lli->lli_trunc_sem);
}
diff --git a/sys-cluster/lustre/files/0005-LU-6215-gss-key-payload.data-is-an-array-in-4.4-kern.patch b/sys-cluster/lustre/files/0005-LU-6215-gss-key-payload.data-is-an-array-in-4.4-kern.patch
deleted file mode 100644
index a21f41b..0000000
--- a/sys-cluster/lustre/files/0005-LU-6215-gss-key-payload.data-is-an-array-in-4.4-kern.patch
+++ /dev/null
@@ -1,229 +0,0 @@
-From fba216ef655a9c13f5bac27d5911da2e6745ea3d Mon Sep 17 00:00:00 2001
-From: Li Dongyang <dongyang.li@anu.edu.au>
-Date: Thu, 21 Apr 2016 10:25:28 -0400
-Subject: [PATCH 05/19] LU-6215 gss: key->payload.data is an array in 4.4+
- kernels
-
-Kernel 4.4 merged the type-specific data with the payload data
-for keys, as a result, payload.data is now an array.
-This patch handles the code change.
-
-Linux-commit: 146aa8b1453bd8f1ff2304ffb71b4ee0eb9acdcc
-
-Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
-Signed-off-by: James Simmons <uja.ornl@yahoo.com>
-Change-Id: I1036ab927514f0efa073d9f0136e299be8950461
-Reviewed-on: http://review.whamcloud.com/18731
-Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
-Tested-by: Jenkins
-Tested-by: Maloo <hpdd-maloo@intel.com>
-Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
-Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
----
- lustre/autoconf/lustre-core.m4 | 17 +++++++++++
- lustre/ptlrpc/gss/gss_keyring.c | 67 ++++++++++++++++++++++++++++++++---------
- 2 files changed, 69 insertions(+), 15 deletions(-)
-
-diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
-index 0201a28..9497cdd 100644
---- a/lustre/autoconf/lustre-core.m4
-+++ b/lustre/autoconf/lustre-core.m4
-@@ -2029,6 +2029,22 @@ make_request_fn_blk_qc_t, [
- ]) # LC_HAVE_QC_MAKE_REQUEST_FN
-
- #
-+# LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
-+#
-+# 4.4 kernel merged type-specific data with the payload data for keys
-+#
-+AC_DEFUN([LC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
-+LB_CHECK_COMPILE([if 'struct key' has 'payload.data' as an array],
-+key_payload_data_array, [
-+ #include <linux/key.h>
-+],[
-+ ((struct key *)0)->payload.data[0] = NULL;
-+],[
-+ AC_DEFINE(HAVE_KEY_PAYLOAD_DATA_ARRAY, 1, [payload.data is an array])
-+])
-+]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
-+
-+#
- # LC_PROG_LINUX
- #
- # Lustre linux kernel checks
-@@ -2195,6 +2211,7 @@ AC_DEFUN([LC_PROG_LINUX], [
- # 4.4
- LC_HAVE_LOCKS_LOCK_FILE_WAIT
- LC_HAVE_QC_MAKE_REQUEST_FN
-+ LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
-
- #
- AS_IF([test "x$enable_server" != xno], [
-diff --git a/lustre/ptlrpc/gss/gss_keyring.c b/lustre/ptlrpc/gss/gss_keyring.c
-index 67188f5..e8fbe50 100644
---- a/lustre/ptlrpc/gss/gss_keyring.c
-+++ b/lustre/ptlrpc/gss/gss_keyring.c
-@@ -348,6 +348,43 @@ static int ctx_unlist_kr(struct ptlrpc_cli_ctx *ctx, int locked)
- }
-
- /*
-+ * Get specific payload. Newer kernels support 4 slots.
-+ */
-+static void *
-+key_get_payload(struct key *key, unsigned int index)
-+{
-+ void *key_ptr = NULL;
-+
-+#ifdef HAVE_KEY_PAYLOAD_DATA_ARRAY
-+ key_ptr = key->payload.data[index];
-+#else
-+ if (!index)
-+ key_ptr = key->payload.data;
-+#endif
-+ return key_ptr;
-+}
-+
-+/*
-+ * Set specific payload. Newer kernels support 4 slots.
-+ */
-+static int key_set_payload(struct key *key, unsigned int index,
-+ struct ptlrpc_cli_ctx *ctx)
-+{
-+ int rc = -EINVAL;
-+
-+#ifdef HAVE_KEY_PAYLOAD_DATA_ARRAY
-+ if (index < 4) {
-+ key->payload.data[index] = ctx;
-+#else
-+ if (!index) {
-+ key->payload.data = ctx;
-+#endif
-+ rc = 0;
-+ }
-+ return rc;
-+}
-+
-+/*
- * bind a key with a ctx together.
- * caller must hold write lock of the key, as well as ref on key & ctx.
- */
-@@ -356,13 +393,13 @@ static void bind_key_ctx(struct key *key, struct ptlrpc_cli_ctx *ctx)
- LASSERT(atomic_read(&ctx->cc_refcount) > 0);
- LASSERT(atomic_read(&key->usage) > 0);
- LASSERT(ctx2gctx_keyring(ctx)->gck_key == NULL);
-- LASSERT(key->payload.data == NULL);
-+ LASSERT(!key_get_payload(key, 0));
-
- /* at this time context may or may not in list. */
- key_get(key);
- atomic_inc(&ctx->cc_refcount);
- ctx2gctx_keyring(ctx)->gck_key = key;
-- key->payload.data = ctx;
-+ LASSERT(!key_set_payload(key, 0, ctx));
- }
-
- /*
-@@ -371,13 +408,13 @@ static void bind_key_ctx(struct key *key, struct ptlrpc_cli_ctx *ctx)
- */
- static void unbind_key_ctx(struct key *key, struct ptlrpc_cli_ctx *ctx)
- {
-- LASSERT(key->payload.data == ctx);
-+ LASSERT(key_get_payload(key, 0) == ctx);
- LASSERT(test_bit(PTLRPC_CTX_CACHED_BIT, &ctx->cc_flags) == 0);
-
- /* must revoke the key, or others may treat it as newly created */
- key_revoke_locked(key);
-
-- key->payload.data = NULL;
-+ key_set_payload(key, 0, NULL);
- ctx2gctx_keyring(ctx)->gck_key = NULL;
-
- /* once ctx get split from key, the timer is meaningless */
-@@ -397,7 +434,7 @@ static void unbind_ctx_kr(struct ptlrpc_cli_ctx *ctx)
- struct key *key = ctx2gctx_keyring(ctx)->gck_key;
-
- if (key) {
-- LASSERT(key->payload.data == ctx);
-+ LASSERT(key_get_payload(key, 0) == ctx);
-
- key_get(key);
- down_write(&key->sem);
-@@ -413,7 +450,7 @@ static void unbind_ctx_kr(struct ptlrpc_cli_ctx *ctx)
- */
- static void unbind_key_locked(struct key *key)
- {
-- struct ptlrpc_cli_ctx *ctx = key->payload.data;
-+ struct ptlrpc_cli_ctx *ctx = key_get_payload(key, 0);
-
- if (ctx)
- unbind_key_ctx(key, ctx);
-@@ -434,7 +471,7 @@ static void kill_ctx_kr(struct ptlrpc_cli_ctx *ctx)
- */
- static void kill_key_locked(struct key *key)
- {
-- struct ptlrpc_cli_ctx *ctx = key->payload.data;
-+ struct ptlrpc_cli_ctx *ctx = key_get_payload(key, 0);
-
- if (ctx && ctx_unlist_kr(ctx, 0))
- unbind_key_locked(key);
-@@ -799,9 +836,8 @@ struct ptlrpc_cli_ctx * gss_sec_lookup_ctx_kr(struct ptlrpc_sec *sec,
- * need wirtelock of key->sem to serialize them. */
- down_write(&key->sem);
-
-- if (likely(key->payload.data != NULL)) {
-- ctx = key->payload.data;
--
-+ ctx = key_get_payload(key, 0);
-+ if (likely(ctx)) {
- LASSERT(atomic_read(&ctx->cc_refcount) >= 1);
- LASSERT(ctx2gctx_keyring(ctx)->gck_key == key);
- LASSERT(atomic_read(&key->usage) >= 2);
-@@ -1167,7 +1203,7 @@ int sec_install_rctx_kr(struct ptlrpc_sec *sec,
-
- down_write(&key->sem);
-
-- LASSERT(key->payload.data == NULL);
-+ LASSERT(!key_get_payload(key, 0));
-
- cli_ctx = ctx_create_kr(sec, &vcred);
- if (cli_ctx == NULL) {
-@@ -1251,7 +1287,7 @@ int gss_kt_instantiate(struct key *key, const void *data, size_t datalen)
- RETURN(-EINVAL);
- }
-
-- if (key->payload.data != NULL) {
-+ if (key_get_payload(key, 0)) {
- CERROR("key already have payload\n");
- RETURN(-EINVAL);
- }
-@@ -1278,7 +1314,8 @@ int gss_kt_instantiate(struct key *key, const void *data, size_t datalen)
- RETURN(rc);
- }
-
-- CDEBUG(D_SEC, "key %p instantiated, ctx %p\n", key, key->payload.data);
-+ CDEBUG(D_SEC, "key %p instantiated, ctx %p\n", key,
-+ key_get_payload(key, 0));
- RETURN(0);
- }
-
-@@ -1297,7 +1334,7 @@ int gss_kt_update(struct key *key, const void *data, size_t datalen)
- {
- __u32 datalen32 = (__u32) datalen;
- #endif
-- struct ptlrpc_cli_ctx *ctx = key->payload.data;
-+ struct ptlrpc_cli_ctx *ctx = key_get_payload(key, 0);
- struct gss_cli_ctx *gctx;
- rawobj_t tmpobj = RAWOBJ_EMPTY;
- int rc;
-@@ -1442,7 +1479,7 @@ static
- void gss_kt_destroy(struct key *key)
- {
- ENTRY;
-- LASSERT(key->payload.data == NULL);
-+ LASSERT(!key_get_payload(key, 0));
- CDEBUG(D_SEC, "destroy key %p\n", key);
- EXIT;
- }
---
-2.8.2
-
diff --git a/sys-cluster/lustre/files/0017-LU-8056-llite-inode_operations-interface-changed-in-.patch b/sys-cluster/lustre/files/0005-LU-8056-llite-inode_operations-interface-changed-in-.patch
similarity index 92%
rename from sys-cluster/lustre/files/0017-LU-8056-llite-inode_operations-interface-changed-in-.patch
rename to sys-cluster/lustre/files/0005-LU-8056-llite-inode_operations-interface-changed-in-.patch
index 1c574f6..11f2de4 100644
--- a/sys-cluster/lustre/files/0017-LU-8056-llite-inode_operations-interface-changed-in-.patch
+++ b/sys-cluster/lustre/files/0005-LU-8056-llite-inode_operations-interface-changed-in-.patch
@@ -1,8 +1,7 @@
-From 4780e65730a868432c4be7c6ea635496c725fc3a Mon Sep 17 00:00:00 2001
+From 0ec0c36d7a0ec5636e19eece4d5df7615f656c23 Mon Sep 17 00:00:00 2001
From: Li Dongyang <dongyang.li@anu.edu.au>
Date: Mon, 16 May 2016 21:57:31 +1000
-Subject: [PATCH 17/19] LU-8056 llite: inode_operations interface changed in
- 4.5
+Subject: [PATCH 5/7] LU-8056 llite: inode_operations interface changed in 4.5
Linux kernel 4.5 replaced follow_link() with get_link()
while put_link() is removed.
@@ -20,10 +19,10 @@ Change-Id: Ia9b8c9b855ed5ab7a428a370074b8801e34d3f99
3 files changed, 71 insertions(+), 9 deletions(-)
diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
-index 622345f..867fa51 100644
+index 5554490..ec18055 100644
--- a/lustre/autoconf/lustre-core.m4
+++ b/lustre/autoconf/lustre-core.m4
-@@ -2062,6 +2062,25 @@ inode_lock, [
+@@ -2104,6 +2104,25 @@ inode_lock, [
]) # LC_HAVE_INODE_LOCK
#
@@ -49,7 +48,7 @@ index 622345f..867fa51 100644
# LC_PROG_LINUX
#
# Lustre linux kernel checks
-@@ -2232,6 +2251,7 @@ AC_DEFUN([LC_PROG_LINUX], [
+@@ -2278,6 +2297,7 @@ AC_DEFUN([LC_PROG_LINUX], [
# 4.5
LC_HAVE_INODE_LOCK
@@ -58,10 +57,10 @@ index 622345f..867fa51 100644
#
AS_IF([test "x$enable_server" != xno], [
diff --git a/lustre/llite/dcache.c b/lustre/llite/dcache.c
-index 4ec4421..d579ba0 100644
+index 8c3db0a..3168ca8 100644
--- a/lustre/llite/dcache.c
+++ b/lustre/llite/dcache.c
-@@ -368,7 +368,11 @@ static int ll_revalidate_dentry(struct dentry *dentry,
+@@ -331,7 +331,11 @@ static int ll_revalidate_dentry(struct dentry *dentry,
return 1;
/* Symlink - always valid as long as the dentry was found */
diff --git a/sys-cluster/lustre/files/0006-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch b/sys-cluster/lustre/files/0006-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch
deleted file mode 100644
index 3c725cc..0000000
--- a/sys-cluster/lustre/files/0006-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-From 2d1eb63fe95584ae964e854479cabbe3f21783be Mon Sep 17 00:00:00 2001
-From: Li Dongyang <dongyang.li@anu.edu.au>
-Date: Fri, 1 Apr 2016 20:26:46 -0400
-Subject: [PATCH 06/19] LU-6215 o2iblnd: rdma_create_id() takes extra parameter
-
-4.4 kernel added network namespace parameter to rdma_create_id().
-This patch handles the API change.
-
-Linux-commit: fa20105e09e97e81aadf02f722c31195e4a75c84
-
-Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
-Change-Id: I3f3792e70e91ac3b3d9fefdd58cc9e7e4d1c25c6
-Reviewed-on: http://review.whamcloud.com/18759
-Reviewed-by: James Simmons <uja.ornl@yahoo.com>
-Tested-by: Jenkins
-Tested-by: Maloo <hpdd-maloo@intel.com>
-Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
-Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
----
- lnet/autoconf/lustre-lnet.m4 | 44 ++++++++++++++++++++++++++++++++++++++++++++
- lnet/klnds/o2iblnd/o2iblnd.h | 13 ++++++++++---
- 2 files changed, 54 insertions(+), 3 deletions(-)
-
-diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4
-index 842873d..f7eb217 100644
---- a/lnet/autoconf/lustre-lnet.m4
-+++ b/lnet/autoconf/lustre-lnet.m4
-@@ -379,6 +379,50 @@ AS_IF([test $ENABLEO2IB != "no"], [
- [struct ib_cq_init_attr is used by ib_create_cq])
- ])
- ])
-+
-+# 4.3 removed ib_alloc_fast_reg_mr()
-+AS_IF([test $ENABLEO2IB != "no"], [
-+ LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
-+ ib_alloc_fast_reg_mr, [
-+ #ifdef HAVE_COMPAT_RDMA
-+ #undef PACKAGE_NAME
-+ #undef PACKAGE_TARNAME
-+ #undef PACKAGE_VERSION
-+ #undef PACKAGE_STRING
-+ #undef PACKAGE_BUGREPORT
-+ #undef PACKAGE_URL
-+ #include <linux/compat-2.6.h>
-+ #endif
-+ #include <rdma/ib_verbs.h>
-+ ],[
-+ ib_alloc_fast_reg_mr(NULL, 0);
-+ ],[
-+ AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
-+ [ib_alloc_fast_reg_mr is defined])
-+ ])
-+])
-+
-+# 4.4 added network namespace parameter for rdma_create_id()
-+AS_IF([test $ENABLEO2IB != "no"], [
-+ LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
-+ rdma_create_id_5args, [
-+ #ifdef HAVE_COMPAT_RDMA
-+ #undef PACKAGE_NAME
-+ #undef PACKAGE_TARNAME
-+ #undef PACKAGE_VERSION
-+ #undef PACKAGE_STRING
-+ #undef PACKAGE_BUGREPORT
-+ #undef PACKAGE_URL
-+ #include <linux/compat-2.6.h>
-+ #endif
-+ #include <rdma/rdma_cm.h>
-+ ],[
-+ rdma_create_id(NULL, NULL, NULL, 0, 0);
-+ ],[
-+ AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
-+ [rdma_create_id wants 5 args])
-+ ])
-+])
- ]) # LN_CONFIG_O2IB
-
- #
-diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h
-index b3d9332..e69cd9f 100644
---- a/lnet/klnds/o2iblnd/o2iblnd.h
-+++ b/lnet/klnds/o2iblnd/o2iblnd.h
-@@ -138,10 +138,17 @@ extern kib_tunables_t kiblnd_tunables;
- IBLND_CREDIT_HIGHWATER_V1 : \
- *kiblnd_tunables.kib_peercredits_hiw) /* when eagerly to return credits */
-
--#ifdef HAVE_RDMA_CREATE_ID_4ARG
--#define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps, qpt)
-+#ifdef HAVE_RDMA_CREATE_ID_5ARG
-+# define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(current->nsproxy->net_ns, \
-+ cb, dev, \
-+ ps, qpt)
- #else
--#define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps)
-+# ifdef HAVE_RDMA_CREATE_ID_4ARG
-+# define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, \
-+ ps, qpt)
-+# else
-+# define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps)
-+# endif
- #endif
-
- static inline int
---
-2.8.2
-
diff --git a/sys-cluster/lustre/files/0018-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch b/sys-cluster/lustre/files/0006-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch
similarity index 91%
rename from sys-cluster/lustre/files/0018-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch
rename to sys-cluster/lustre/files/0006-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch
index 9da787c..a564203 100644
--- a/sys-cluster/lustre/files/0018-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch
+++ b/sys-cluster/lustre/files/0006-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch
@@ -1,7 +1,7 @@
-From 9f0940464d87e1111ab665684f9e9a45db6c3787 Mon Sep 17 00:00:00 2001
+From 103a363fa53f691d2bdbb38280e44d1c830c7322 Mon Sep 17 00:00:00 2001
From: Li Dongyang <dongyang.li@anu.edu.au>
Date: Mon, 16 May 2016 22:07:54 +1000
-Subject: [PATCH 18/19] LU-8056 llite: POSIX_ACL_XATTR_{ACCESS,DEFAULT} removed
+Subject: [PATCH 6/7] LU-8056 llite: POSIX_ACL_XATTR_{ACCESS,DEFAULT} removed
in 4.5
POSIX_ACL_XATTR_{ACCESS,DEFAULT} are duplicate
diff --git a/sys-cluster/lustre/files/0007-LU-6215-lnet-split-struct-ib_send_wr.patch b/sys-cluster/lustre/files/0007-LU-6215-lnet-split-struct-ib_send_wr.patch
deleted file mode 100644
index 1520983..0000000
--- a/sys-cluster/lustre/files/0007-LU-6215-lnet-split-struct-ib_send_wr.patch
+++ /dev/null
@@ -1,451 +0,0 @@
-From 6c4eae3aaac92d6d9ef35806fc7badb272702136 Mon Sep 17 00:00:00 2001
-From: Dmitry Eremin <dmitry.eremin@intel.com>
-Date: Tue, 17 May 2016 09:22:15 -0400
-Subject: [PATCH 07/19] LU-6215 lnet: split struct ib_send_wr
-
-In v4.4 Linux kernel split up struct ib_send_wr so that all non-trivial
-verbs use their own structure which embeds struct ib_send_wr.
-
-Linux-commit: e622f2f4ad2142d2a613a57fb85f8cf737935ef5
-Change-Id: Iea2599ea57a576a4c061841be47a989aba097cc6
-Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
-Reviewed-on: http://review.whamcloud.com/19168
-Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
-Reviewed-by: James Simmons <uja.ornl@yahoo.com>
-Reviewed-by: Li Dongyang <dongyang.li@anu.edu.au>
-Tested-by: Jenkins
-Tested-by: Maloo <hpdd-maloo@intel.com>
-Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
----
- lnet/autoconf/lustre-lnet.m4 | 84 ++++++++++++++++++--------
- lnet/klnds/o2iblnd/o2iblnd.c | 127 +++++++++++++++++++++++++++++++++++++---
- lnet/klnds/o2iblnd/o2iblnd.h | 21 ++++++-
- lnet/klnds/o2iblnd/o2iblnd_cb.c | 71 ++++++++++++++--------
- 4 files changed, 246 insertions(+), 57 deletions(-)
-
-diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4
-index f7eb217..2e2adb2 100644
---- a/lnet/autoconf/lustre-lnet.m4
-+++ b/lnet/autoconf/lustre-lnet.m4
-@@ -329,8 +329,8 @@ AC_SUBST(O2IBLND)
- AC_SUBST(O2IBPATH)
- AC_SUBST(ENABLEO2IB)
-
--# In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
- AS_IF([test $ENABLEO2IB != "no"], [
-+ # In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
- LB_CHECK_COMPILE([if 'rdma_create_id' wants four args],
- rdma_create_id_4args, [
- #ifdef HAVE_COMPAT_RDMA
-@@ -349,15 +349,32 @@ AS_IF([test $ENABLEO2IB != "no"], [
- AC_DEFINE(HAVE_RDMA_CREATE_ID_4ARG, 1,
- [rdma_create_id wants 4 args])
- ])
--])
--#
--# 4.2 introduced struct ib_cq_init_attr which is used
--# by ib_create_cq(). Note some OFED stacks only keep
--# their headers in sync with latest kernels but not
--# the functionality which means for infiniband testing
--# we need to always test functionality testings.
--#
--AS_IF([test $ENABLEO2IB != "no"], [
-+
-+ # 4.4 added network namespace parameter for rdma_create_id()
-+ LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
-+ rdma_create_id_5args, [
-+ #ifdef HAVE_COMPAT_RDMA
-+ #undef PACKAGE_NAME
-+ #undef PACKAGE_TARNAME
-+ #undef PACKAGE_VERSION
-+ #undef PACKAGE_STRING
-+ #undef PACKAGE_BUGREPORT
-+ #undef PACKAGE_URL
-+ #include <linux/compat-2.6.h>
-+ #endif
-+ #include <rdma/rdma_cm.h>
-+ ],[
-+ rdma_create_id(NULL, NULL, NULL, 0, 0);
-+ ],[
-+ AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
-+ [rdma_create_id wants 5 args])
-+ ])
-+
-+ # 4.2 introduced struct ib_cq_init_attr which is used
-+ # by ib_create_cq(). Note some OFED stacks only keep
-+ # their headers in sync with latest kernels but not
-+ # the functionality which means for infiniband testing
-+ # we need to always test functionality testings.
- LB_CHECK_COMPILE([if 'struct ib_cq_init_attr' is used],
- ib_cq_init_attr, [
- #ifdef HAVE_COMPAT_RDMA
-@@ -378,10 +395,8 @@ AS_IF([test $ENABLEO2IB != "no"], [
- AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
- [struct ib_cq_init_attr is used by ib_create_cq])
- ])
--])
-
--# 4.3 removed ib_alloc_fast_reg_mr()
--AS_IF([test $ENABLEO2IB != "no"], [
-+ # 4.3 removed ib_alloc_fast_reg_mr()
- LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
- ib_alloc_fast_reg_mr, [
- #ifdef HAVE_COMPAT_RDMA
-@@ -400,12 +415,13 @@ AS_IF([test $ENABLEO2IB != "no"], [
- AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
- [ib_alloc_fast_reg_mr is defined])
- ])
--])
-
--# 4.4 added network namespace parameter for rdma_create_id()
--AS_IF([test $ENABLEO2IB != "no"], [
-- LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
-- rdma_create_id_5args, [
-+ # In v4.4 Linux kernel,
-+ # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
-+ # split up struct ib_send_wr so that all non-trivial verbs
-+ # use their own structure which embedds struct ib_send_wr.
-+ LB_CHECK_COMPILE([if 'struct ib_rdma_wr' is defined],
-+ ib_rdma_wr, [
- #ifdef HAVE_COMPAT_RDMA
- #undef PACKAGE_NAME
- #undef PACKAGE_TARNAME
-@@ -415,14 +431,36 @@ AS_IF([test $ENABLEO2IB != "no"], [
- #undef PACKAGE_URL
- #include <linux/compat-2.6.h>
- #endif
-- #include <rdma/rdma_cm.h>
-+ #include <rdma/ib_verbs.h>
- ],[
-- rdma_create_id(NULL, NULL, NULL, 0, 0);
-+ struct ib_rdma_wr *wr __attribute__ ((unused));
-+
-+ wr = rdma_wr(NULL);
- ],[
-- AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
-- [rdma_create_id wants 5 args])
-+ AC_DEFINE(HAVE_IB_RDMA_WR, 1,
-+ [struct ib_rdma_wr is defined])
- ])
--])
-+
-+ # new fast registration API introduced in 4.4
-+ LB_CHECK_COMPILE([if 'ib_map_mr_sg' exists],
-+ ib_map_mr_sg, [
-+ #ifdef HAVE_COMPAT_RDMA
-+ #undef PACKAGE_NAME
-+ #undef PACKAGE_TARNAME
-+ #undef PACKAGE_VERSION
-+ #undef PACKAGE_STRING
-+ #undef PACKAGE_BUGREPORT
-+ #undef PACKAGE_URL
-+ #include <linux/compat-2.6.h>
-+ #endif
-+ #include <rdma/ib_verbs.h>
-+ ],[
-+ ib_map_mr_sg(NULL, NULL, 0, 0);
-+ ],[
-+ AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
-+ [ib_map_mr_sg exists])
-+ ])
-+]) # ENABLEO2IB != "no"
- ]) # LN_CONFIG_O2IB
-
- #
-diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c
-index d9761ee..00c4ce2 100644
---- a/lnet/klnds/o2iblnd/o2iblnd.c
-+++ b/lnet/klnds/o2iblnd/o2iblnd.c
-@@ -1592,13 +1592,126 @@ again:
- fpo->fpo_map_count++;
- spin_unlock(&fps->fps_lock);
-
-- pfmr = ib_fmr_pool_map_phys(fpo->fpo_fmr_pool,
-- pages, npages, iov);
-- if (likely(!IS_ERR(pfmr))) {
-- fmr->fmr_pool = fpo;
-- fmr->fmr_pfmr = pfmr;
-- return 0;
-- }
-+ if (fpo->fpo_is_fmr) {
-+ struct ib_pool_fmr *pfmr;
-+
-+ spin_unlock(&fps->fps_lock);
-+
-+ if (!tx_pages_mapped) {
-+ npages = kiblnd_map_tx_pages(tx, rd);
-+ tx_pages_mapped = 1;
-+ }
-+
-+ pfmr = ib_fmr_pool_map_phys(fpo->fmr.fpo_fmr_pool,
-+ pages, npages, iov);
-+ if (likely(!IS_ERR(pfmr))) {
-+ fmr->fmr_key = is_rx ? pfmr->fmr->rkey
-+ : pfmr->fmr->lkey;
-+ fmr->fmr_frd = NULL;
-+ fmr->fmr_pfmr = pfmr;
-+ fmr->fmr_pool = fpo;
-+ return 0;
-+ }
-+ rc = PTR_ERR(pfmr);
-+ } else {
-+ if (!list_empty(&fpo->fast_reg.fpo_pool_list)) {
-+ struct kib_fast_reg_descriptor *frd;
-+#ifdef HAVE_IB_MAP_MR_SG
-+ struct ib_reg_wr *wr;
-+ int n;
-+#else
-+ struct ib_rdma_wr *wr;
-+ struct ib_fast_reg_page_list *frpl;
-+#endif
-+ struct ib_mr *mr;
-+
-+ frd = list_first_entry(&fpo->fast_reg.fpo_pool_list,
-+ struct kib_fast_reg_descriptor,
-+ frd_list);
-+ list_del(&frd->frd_list);
-+ spin_unlock(&fps->fps_lock);
-+
-+#ifndef HAVE_IB_MAP_MR_SG
-+ frpl = frd->frd_frpl;
-+#endif
-+ mr = frd->frd_mr;
-+
-+ if (!frd->frd_valid) {
-+ struct ib_rdma_wr *inv_wr;
-+ __u32 key = is_rx ? mr->rkey : mr->lkey;
-+
-+ inv_wr = &frd->frd_inv_wr;
-+ memset(inv_wr, 0, sizeof(*inv_wr));
-+
-+ inv_wr->wr.opcode = IB_WR_LOCAL_INV;
-+ inv_wr->wr.wr_id = IBLND_WID_MR;
-+ inv_wr->wr.ex.invalidate_rkey = key;
-+
-+ /* Bump the key */
-+ key = ib_inc_rkey(key);
-+ ib_update_fast_reg_key(mr, key);
-+ }
-+
-+#ifdef HAVE_IB_MAP_MR_SG
-+ n = ib_map_mr_sg(mr, tx->tx_frags,
-+ tx->tx_nfrags, PAGE_SIZE);
-+ if (unlikely(n != tx->tx_nfrags)) {
-+ CERROR("Failed to map mr %d/%d "
-+ "elements\n", n, tx->tx_nfrags);
-+ return n < 0 ? n : -EINVAL;
-+ }
-+
-+ mr->iova = iov;
-+
-+ wr = &frd->frd_fastreg_wr;
-+ memset(wr, 0, sizeof(*wr));
-+
-+ wr->wr.opcode = IB_WR_REG_MR;
-+ wr->wr.wr_id = IBLND_WID_MR;
-+ wr->wr.num_sge = 0;
-+ wr->wr.send_flags = 0;
-+ wr->mr = mr;
-+ wr->key = is_rx ? mr->rkey : mr->lkey;
-+ wr->access = (IB_ACCESS_LOCAL_WRITE |
-+ IB_ACCESS_REMOTE_WRITE);
-+#else
-+ if (!tx_pages_mapped) {
-+ npages = kiblnd_map_tx_pages(tx, rd);
-+ tx_pages_mapped = 1;
-+ }
-+
-+ LASSERT(npages <= frpl->max_page_list_len);
-+ memcpy(frpl->page_list, pages,
-+ sizeof(*pages) * npages);
-+
-+ /* Prepare FastReg WR */
-+ wr = &frd->frd_fastreg_wr;
-+ memset(wr, 0, sizeof(*wr));
-+
-+ wr->wr.opcode = IB_WR_FAST_REG_MR;
-+ wr->wr.wr_id = IBLND_WID_MR;
-+
-+ wr->wr.wr.fast_reg.iova_start = iov;
-+ wr->wr.wr.fast_reg.page_list = frpl;
-+ wr->wr.wr.fast_reg.page_list_len = npages;
-+ wr->wr.wr.fast_reg.page_shift = PAGE_SHIFT;
-+ wr->wr.wr.fast_reg.length = nob;
-+ wr->wr.wr.fast_reg.rkey =
-+ is_rx ? mr->rkey : mr->lkey;
-+ wr->wr.wr.fast_reg.access_flags =
-+ (IB_ACCESS_LOCAL_WRITE |
-+ IB_ACCESS_REMOTE_WRITE);
-+#endif
-+
-+ fmr->fmr_key = is_rx ? mr->rkey : mr->lkey;
-+ fmr->fmr_frd = frd;
-+ fmr->fmr_pfmr = NULL;
-+ fmr->fmr_pool = fpo;
-+ return 0;
-+ }
-+ spin_unlock(&fps->fps_lock);
-+ rc = -EBUSY;
-+ }
-
- spin_lock(&fps->fps_lock);
- fpo->fpo_map_count--;
-diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h
-index e69cd9f..3baa255 100644
---- a/lnet/klnds/o2iblnd/o2iblnd.h
-+++ b/lnet/klnds/o2iblnd/o2iblnd.h
-@@ -344,6 +344,25 @@ typedef struct
- cfs_time_t fps_next_retry;
- } kib_fmr_poolset_t;
-
-+#ifndef HAVE_IB_RDMA_WR
-+struct ib_rdma_wr {
-+ struct ib_send_wr wr;
-+};
-+#endif
-+
-+struct kib_fast_reg_descriptor { /* For fast registration */
-+ struct list_head frd_list;
-+ struct ib_rdma_wr frd_inv_wr;
-+#ifdef HAVE_IB_MAP_MR_SG
-+ struct ib_reg_wr frd_fastreg_wr;
-+#else
-+ struct ib_rdma_wr frd_fastreg_wr;
-+ struct ib_fast_reg_page_list *frd_frpl;
-+#endif
-+ struct ib_mr *frd_mr;
-+ bool frd_valid;
-+};
-+
- typedef struct
- {
- struct list_head fpo_list; /* chain on pool list */
-@@ -620,7 +639,7 @@ typedef struct kib_tx /* transmit message */
- /* # send work items */
- int tx_nwrq;
- /* send work items... */
-- struct ib_send_wr *tx_wrq;
-+ struct ib_rdma_wr *tx_wrq;
- /* ...and their memory */
- struct ib_sge *tx_sge;
- /* rdma descriptor */
-diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c
-index 6887c07..d25e45a 100644
---- a/lnet/klnds/o2iblnd/o2iblnd_cb.c
-+++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c
-@@ -847,14 +847,27 @@ __must_hold(&conn->ibc_lock)
- /* close_conn will launch failover */
- rc = -ENETDOWN;
- } else {
-- struct ib_send_wr *wrq = &tx->tx_wrq[tx->tx_nwrq - 1];
-+ struct kib_fast_reg_descriptor *frd = tx->fmr.fmr_frd;
-+ struct ib_send_wr *bad = &tx->tx_wrq[tx->tx_nwrq - 1].wr;
-+ struct ib_send_wr *wr = &tx->tx_wrq[0].wr;
-+
-+ if (frd != NULL) {
-+ if (!frd->frd_valid) {
-+ wr = &frd->frd_inv_wr.wr;
-+ wr->next = &frd->frd_fastreg_wr.wr;
-+ } else {
-+ wr = &frd->frd_fastreg_wr.wr;
-+ }
-+ frd->frd_fastreg_wr.wr.next = &tx->tx_wrq[0].wr;
-+ }
-
- LASSERTF(wrq->wr_id == kiblnd_ptr2wreqid(tx, IBLND_WID_TX),
- "bad wr_id "LPX64", opc %d, flags %d, peer: %s\n",
- wrq->wr_id, wrq->opcode, wrq->send_flags,
- libcfs_nid2str(conn->ibc_peer->ibp_nid));
-- wrq = NULL;
-- rc = ib_post_send(conn->ibc_cmid->qp, tx->tx_wrq, &wrq);
-+
-+ bad = NULL;
-+ rc = ib_post_send(conn->ibc_cmid->qp, wr, &bad);
- }
-
- conn->ibc_last_send = jiffies;
-@@ -1023,11 +1036,11 @@ kiblnd_tx_complete (kib_tx_t *tx, int status)
- static void
- kiblnd_init_tx_msg (lnet_ni_t *ni, kib_tx_t *tx, int type, int body_nob)
- {
-- kib_hca_dev_t *hdev = tx->tx_pool->tpo_hdev;
-- struct ib_sge *sge = &tx->tx_sge[tx->tx_nwrq];
-- struct ib_send_wr *wrq = &tx->tx_wrq[tx->tx_nwrq];
-- int nob = offsetof (kib_msg_t, ibm_u) + body_nob;
-- struct ib_mr *mr = hdev->ibh_mrs;
-+ kib_hca_dev_t *hdev = tx->tx_pool->tpo_hdev;
-+ struct ib_sge *sge = &tx->tx_sge[tx->tx_nwrq];
-+ struct ib_rdma_wr *wrq;
-+ int nob = offsetof(kib_msg_t, ibm_u) + body_nob;
-+ struct ib_mr *mr = hdev->ibh_mrs;
-
- LASSERT(tx->tx_nwrq >= 0);
- LASSERT(tx->tx_nwrq < IBLND_MAX_RDMA_FRAGS + 1);
-@@ -1040,16 +1053,17 @@ kiblnd_init_tx_msg (lnet_ni_t *ni, kib_tx_t *tx, int type, int body_nob)
- sge->addr = tx->tx_msgaddr;
- sge->length = nob;
-
-- memset(wrq, 0, sizeof(*wrq));
-+ wrq = &tx->tx_wrq[tx->tx_nwrq];
-+ memset(wrq, 0, sizeof(*wrq));
-
-- wrq->next = NULL;
-- wrq->wr_id = kiblnd_ptr2wreqid(tx, IBLND_WID_TX);
-- wrq->sg_list = sge;
-- wrq->num_sge = 1;
-- wrq->opcode = IB_WR_SEND;
-- wrq->send_flags = IB_SEND_SIGNALED;
-+ wrq->wr.next = NULL;
-+ wrq->wr.wr_id = kiblnd_ptr2wreqid(tx, IBLND_WID_TX);
-+ wrq->wr.sg_list = sge;
-+ wrq->wr.num_sge = 1;
-+ wrq->wr.opcode = IB_WR_SEND;
-+ wrq->wr.send_flags = IB_SEND_SIGNALED;
-
-- tx->tx_nwrq++;
-+ tx->tx_nwrq++;
- }
-
- static int
-@@ -1059,7 +1073,7 @@ kiblnd_init_rdma(kib_conn_t *conn, kib_tx_t *tx, int type,
- kib_msg_t *ibmsg = tx->tx_msg;
- kib_rdma_desc_t *srcrd = tx->tx_rd;
- struct ib_sge *sge = &tx->tx_sge[0];
-- struct ib_send_wr *wrq = &tx->tx_wrq[0];
-+ struct ib_rdma_wr *wrq;
- int rc = resid;
- int srcidx;
- int dstidx;
-@@ -1106,15 +1120,20 @@ kiblnd_init_rdma(kib_conn_t *conn, kib_tx_t *tx, int type,
-
- wrq = &tx->tx_wrq[tx->tx_nwrq];
-
-- wrq->next = wrq + 1;
-- wrq->wr_id = kiblnd_ptr2wreqid(tx, IBLND_WID_RDMA);
-- wrq->sg_list = sge;
-- wrq->num_sge = 1;
-- wrq->opcode = IB_WR_RDMA_WRITE;
-- wrq->send_flags = 0;
--
-- wrq->wr.rdma.remote_addr = kiblnd_rd_frag_addr(dstrd, dstidx);
-- wrq->wr.rdma.rkey = kiblnd_rd_frag_key(dstrd, dstidx);
-+ wrq->wr.next = &(wrq + 1)->wr;
-+ wrq->wr.wr_id = kiblnd_ptr2wreqid(tx, IBLND_WID_RDMA);
-+ wrq->wr.sg_list = sge;
-+ wrq->wr.num_sge = 1;
-+ wrq->wr.opcode = IB_WR_RDMA_WRITE;
-+ wrq->wr.send_flags = 0;
-+
-+#ifdef HAVE_IB_RDMA_WR
-+ wrq->remote_addr = kiblnd_rd_frag_addr(dstrd, dstidx);
-+ wrq->rkey = kiblnd_rd_frag_key(dstrd, dstidx);
-+#else
-+ wrq->wr.wr.rdma.remote_addr = kiblnd_rd_frag_addr(dstrd, dstidx);
-+ wrq->wr.wr.rdma.rkey = kiblnd_rd_frag_key(dstrd, dstidx);
-+#endif
-
- srcidx = kiblnd_rd_consume_frag(srcrd, srcidx, wrknob);
- dstidx = kiblnd_rd_consume_frag(dstrd, dstidx, wrknob);
---
-2.8.2
-
diff --git a/sys-cluster/lustre/files/0019-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch b/sys-cluster/lustre/files/0007-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch
similarity index 77%
rename from sys-cluster/lustre/files/0019-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch
rename to sys-cluster/lustre/files/0007-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch
index a613540..656f7f6 100644
--- a/sys-cluster/lustre/files/0019-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch
+++ b/sys-cluster/lustre/files/0007-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch
@@ -1,7 +1,7 @@
-From 6f44b5a0d02e5a805c5be265d5b92ab69ef9a421 Mon Sep 17 00:00:00 2001
+From 028c4416216af21dcae53f7daa4f549d0c2bad4f Mon Sep 17 00:00:00 2001
From: James Simmons <uja.ornl@yahoo.com>
Date: Fri, 3 Jun 2016 14:09:54 -0400
-Subject: [PATCH 19/19] LU-8056 lloop: fix bio_for_each_segment_all for newer
+Subject: [PATCH 7/7] LU-8056 lloop: fix bio_for_each_segment_all for newer
kernels
Lustre patch http://review.whamcloud.com/20478 back ported
@@ -12,11 +12,11 @@ work with newer kernels.
Change-Id: I6a926320f80113169a13d2319190721c83d58b1d
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
---
- lustre/llite/lloop.c | 17 ++---------------
- 1 file changed, 2 insertions(+), 15 deletions(-)
+ lustre/llite/lloop.c | 15 +--------------
+ 1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/lustre/llite/lloop.c b/lustre/llite/lloop.c
-index c20df96..834d068 100644
+index 64318ca..64da8c2 100644
--- a/lustre/llite/lloop.c
+++ b/lustre/llite/lloop.c
@@ -193,13 +193,8 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head)
@@ -33,11 +33,11 @@ index c20df96..834d068 100644
int rw;
size_t page_count = 0;
struct bio *bio;
-@@ -226,17 +221,10 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head)
+@@ -226,16 +221,9 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head)
#ifdef HAVE_BVEC_ITER
offset = (pgoff_t)(bio->bi_iter.bi_sector << 9) + lo->lo_offset;
-- bio_for_each_segment(bvec, bio, iter) {
+- bio_for_each_segment_all(bvec, bio, iter) {
- BUG_ON(bvec.bv_offset != 0);
- BUG_ON(bvec.bv_len != PAGE_CACHE_SIZE);
-
@@ -47,12 +47,10 @@ index c20df96..834d068 100644
- offset += bvec.bv_len;
#else
offset = (pgoff_t)(bio->bi_sector << 9) + lo->lo_offset;
-- bio_for_each_segment(bvec, bio, iter) {
+#endif
-+ bio_for_each_segment_all(bvec, bio, iter) {
+ bio_for_each_segment_all(bvec, bio, iter) {
BUG_ON(bvec->bv_offset != 0);
BUG_ON(bvec->bv_len != PAGE_CACHE_SIZE);
-
@@ -244,7 +232,6 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head)
offsets[page_count] = offset;
page_count++;
diff --git a/sys-cluster/lustre/files/0008-LU-6215-o2iblnd-ib_alloc_fast_reg_mr-removed-in-4.3.patch b/sys-cluster/lustre/files/0008-LU-6215-o2iblnd-ib_alloc_fast_reg_mr-removed-in-4.3.patch
deleted file mode 100644
index 993f3b9..0000000
--- a/sys-cluster/lustre/files/0008-LU-6215-o2iblnd-ib_alloc_fast_reg_mr-removed-in-4.3.patch
+++ /dev/null
@@ -1,199 +0,0 @@
-From 12fe2bd8fb80b71bcbc6526f916e6225c12610ee Mon Sep 17 00:00:00 2001
-From: Li Dongyang <dongyang.li@anu.edu.au>
-Date: Tue, 29 Mar 2016 14:57:57 +1100
-Subject: [PATCH 08/19] LU-6215 o2iblnd: ib_alloc_fast_reg_mr() removed in 4.3
-
-ib_alloc_fast_reg_mr() is replaced by a more generic
-ib_alloc_mr() since kernel 4.3
-
-Linux-commit: d9f272c523db47a56a64942eb6f25361c400de66
-
-Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
-Change-Id: I53f4e7c395c83d731aaa342f308f878b07b54d61
-Reviewed-on: http://review.whamcloud.com/19185
-Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
-Tested-by: Jenkins
-Tested-by: Maloo <hpdd-maloo@intel.com>
-Reviewed-by: James Simmons <uja.ornl@yahoo.com>
-Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
----
- lnet/autoconf/lustre-lnet.m4 | 51 ++----------------------
- lnet/klnds/o2iblnd/o2iblnd.c | 92 +++++++++++++++++++++++++++++++++++++++++++-
- 2 files changed, 95 insertions(+), 48 deletions(-)
-
-diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4
-index 2e2adb2..a1498aa 100644
---- a/lnet/autoconf/lustre-lnet.m4
-+++ b/lnet/autoconf/lustre-lnet.m4
-@@ -395,8 +395,10 @@ AS_IF([test $ENABLEO2IB != "no"], [
- AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
- [struct ib_cq_init_attr is used by ib_create_cq])
- ])
-+])
-
-- # 4.3 removed ib_alloc_fast_reg_mr()
-+# 4.3 removed ib_alloc_fast_reg_mr()
-+AS_IF([test $ENABLEO2IB != "no"], [
- LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
- ib_alloc_fast_reg_mr, [
- #ifdef HAVE_COMPAT_RDMA
-@@ -415,52 +417,7 @@ AS_IF([test $ENABLEO2IB != "no"], [
- AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
- [ib_alloc_fast_reg_mr is defined])
- ])
--
-- # In v4.4 Linux kernel,
-- # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
-- # split up struct ib_send_wr so that all non-trivial verbs
-- # use their own structure which embedds struct ib_send_wr.
-- LB_CHECK_COMPILE([if 'struct ib_rdma_wr' is defined],
-- ib_rdma_wr, [
-- #ifdef HAVE_COMPAT_RDMA
-- #undef PACKAGE_NAME
-- #undef PACKAGE_TARNAME
-- #undef PACKAGE_VERSION
-- #undef PACKAGE_STRING
-- #undef PACKAGE_BUGREPORT
-- #undef PACKAGE_URL
-- #include <linux/compat-2.6.h>
-- #endif
-- #include <rdma/ib_verbs.h>
-- ],[
-- struct ib_rdma_wr *wr __attribute__ ((unused));
--
-- wr = rdma_wr(NULL);
-- ],[
-- AC_DEFINE(HAVE_IB_RDMA_WR, 1,
-- [struct ib_rdma_wr is defined])
-- ])
--
-- # new fast registration API introduced in 4.4
-- LB_CHECK_COMPILE([if 'ib_map_mr_sg' exists],
-- ib_map_mr_sg, [
-- #ifdef HAVE_COMPAT_RDMA
-- #undef PACKAGE_NAME
-- #undef PACKAGE_TARNAME
-- #undef PACKAGE_VERSION
-- #undef PACKAGE_STRING
-- #undef PACKAGE_BUGREPORT
-- #undef PACKAGE_URL
-- #include <linux/compat-2.6.h>
-- #endif
-- #include <rdma/ib_verbs.h>
-- ],[
-- ib_map_mr_sg(NULL, NULL, 0, 0);
-- ],[
-- AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
-- [ib_map_mr_sg exists])
-- ])
--]) # ENABLEO2IB != "no"
-+])
- ]) # LN_CONFIG_O2IB
-
- #
-diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c
-index 00c4ce2..57f51ca 100644
---- a/lnet/klnds/o2iblnd/o2iblnd.c
-+++ b/lnet/klnds/o2iblnd/o2iblnd.c
-@@ -1444,7 +1444,97 @@ kiblnd_create_fmr_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t **pp_fpo)
- .dirty_watermark = fps->fps_flush_trigger,
- .flush_function = NULL,
- .flush_arg = NULL,
-- .cache = !!*kiblnd_tunables.kib_fmr_cache};
-+ .cache = !!fps->fps_cache };
-+ int rc = 0;
-+
-+ fpo->fmr.fpo_fmr_pool = ib_create_fmr_pool(fpo->fpo_hdev->ibh_pd,
-+ ¶m);
-+ if (IS_ERR(fpo->fmr.fpo_fmr_pool)) {
-+ rc = PTR_ERR(fpo->fmr.fpo_fmr_pool);
-+ if (rc != -ENOSYS)
-+ CERROR("Failed to create FMR pool: %d\n", rc);
-+ else
-+ CERROR("FMRs are not supported\n");
-+ }
-+
-+ return rc;
-+}
-+
-+static int kiblnd_alloc_freg_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t *fpo)
-+{
-+ struct kib_fast_reg_descriptor *frd, *tmp;
-+ int i, rc;
-+
-+ INIT_LIST_HEAD(&fpo->fast_reg.fpo_pool_list);
-+ fpo->fast_reg.fpo_pool_size = 0;
-+ for (i = 0; i < fps->fps_pool_size; i++) {
-+ LIBCFS_CPT_ALLOC(frd, lnet_cpt_table(), fps->fps_cpt,
-+ sizeof(*frd));
-+ if (!frd) {
-+ CERROR("Failed to allocate a new fast_reg descriptor\n");
-+ rc = -ENOMEM;
-+ goto out;
-+ }
-+ frd->frd_mr = NULL;
-+
-+ frd->frd_frpl = ib_alloc_fast_reg_page_list(fpo->fpo_hdev->ibh_ibdev,
-+ LNET_MAX_PAYLOAD/PAGE_SIZE);
-+ if (IS_ERR(frd->frd_frpl)) {
-+ rc = PTR_ERR(frd->frd_frpl);
-+ CERROR("Failed to allocate ib_fast_reg_page_list: %d\n",
-+ rc);
-+ frd->frd_frpl = NULL;
-+ goto out_middle;
-+ }
-+
-+#ifdef HAVE_IB_ALLOC_FAST_REG_MR
-+ frd->frd_mr = ib_alloc_fast_reg_mr(fpo->fpo_hdev->ibh_pd,
-+ LNET_MAX_PAYLOAD/PAGE_SIZE);
-+#else
-+ frd->frd_mr = ib_alloc_mr(fpo->fpo_hdev->ibh_pd,
-+ IB_MR_TYPE_MEM_REG,
-+ LNET_MAX_PAYLOAD/PAGE_SIZE);
-+#endif
-+ if (IS_ERR(frd->frd_mr)) {
-+ rc = PTR_ERR(frd->frd_mr);
-+ CERROR("Failed to allocate ib_fast_reg_mr: %d\n", rc);
-+ frd->frd_mr = NULL;
-+ goto out_middle;
-+ }
-+
-+ frd->frd_valid = true;
-+
-+ list_add_tail(&frd->frd_list, &fpo->fast_reg.fpo_pool_list);
-+ fpo->fast_reg.fpo_pool_size++;
-+ }
-+
-+ return 0;
-+
-+out_middle:
-+ if (frd->frd_mr)
-+ ib_dereg_mr(frd->frd_mr);
-+ if (frd->frd_frpl)
-+ ib_free_fast_reg_page_list(frd->frd_frpl);
-+ LIBCFS_FREE(frd, sizeof(*frd));
-+
-+out:
-+ list_for_each_entry_safe(frd, tmp, &fpo->fast_reg.fpo_pool_list,
-+ frd_list) {
-+ list_del(&frd->frd_list);
-+ ib_free_fast_reg_page_list(frd->frd_frpl);
-+ ib_dereg_mr(frd->frd_mr);
-+ LIBCFS_FREE(frd, sizeof(*frd));
-+ }
-+
-+ return rc;
-+}
-+
-+static int
-+kiblnd_create_fmr_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t **pp_fpo)
-+{
-+ struct ib_device_attr *dev_attr;
-+ kib_dev_t *dev = fps->fps_net->ibn_dev;
-+ kib_fmr_pool_t *fpo;
- int rc;
-
- LIBCFS_CPT_ALLOC(fpo, lnet_cpt_table(), fps->fps_cpt, sizeof(*fpo));
---
-2.8.2
-
diff --git a/sys-cluster/lustre/files/0009-LU-6215-o2iblnd-port-to-new-fast-reg-API-introduced-.patch b/sys-cluster/lustre/files/0009-LU-6215-o2iblnd-port-to-new-fast-reg-API-introduced-.patch
deleted file mode 100644
index b2df9e8..0000000
--- a/sys-cluster/lustre/files/0009-LU-6215-o2iblnd-port-to-new-fast-reg-API-introduced-.patch
+++ /dev/null
@@ -1,332 +0,0 @@
-From f1b1ef4f8af7751e1fc73b8f4ad2363b48159fa9 Mon Sep 17 00:00:00 2001
-From: Li Dongyang <dongyang.li@anu.edu.au>
-Date: Wed, 4 May 2016 13:11:15 -0400
-Subject: [PATCH 09/19] LU-6215 o2iblnd: port to new fast reg API introduced in
- 4.4
-
-Remove the allocation of fastreg page list, as the page
-vector is now private to the provider. Just pass tx_frags
-to ib_map_mr_sg() and construct ib_reg_wr.
-Defer the conversion of tx_frags to tx_pages and only do
-it when the new API is not available.
-
-Linux-commit: 4c67e2bfc8b7121d51434362fa7c2d012f8bcf1b
-Linux-commit: 39bfc271bd687be2c8e396e976c0fb9a97963400
-
-Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
-Change-Id: I5c62b0370ad6ddcc93102a29343491968e4446d0
-Reviewed-on: http://review.whamcloud.com/19186
-Tested-by: Jenkins
-Reviewed-by: James Simmons <uja.ornl@yahoo.com>
-Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
-Tested-by: Maloo <hpdd-maloo@intel.com>
-Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
----
- lnet/autoconf/lustre-lnet.m4 | 44 +++++++++++++++++++++++++
- lnet/klnds/o2iblnd/o2iblnd.c | 71 ++++++++++++++++++++++++++++++++++-------
- lnet/klnds/o2iblnd/o2iblnd.h | 11 ++++---
- lnet/klnds/o2iblnd/o2iblnd_cb.c | 39 ++++++++++------------
- 4 files changed, 127 insertions(+), 38 deletions(-)
-
-diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4
-index a1498aa..5f90bca 100644
---- a/lnet/autoconf/lustre-lnet.m4
-+++ b/lnet/autoconf/lustre-lnet.m4
-@@ -418,6 +418,50 @@ AS_IF([test $ENABLEO2IB != "no"], [
- [ib_alloc_fast_reg_mr is defined])
- ])
- ])
-+
-+# 4.4 added network namespace parameter for rdma_create_id()
-+AS_IF([test $ENABLEO2IB != "no"], [
-+ LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
-+ rdma_create_id_5args, [
-+ #ifdef HAVE_COMPAT_RDMA
-+ #undef PACKAGE_NAME
-+ #undef PACKAGE_TARNAME
-+ #undef PACKAGE_VERSION
-+ #undef PACKAGE_STRING
-+ #undef PACKAGE_BUGREPORT
-+ #undef PACKAGE_URL
-+ #include <linux/compat-2.6.h>
-+ #endif
-+ #include <rdma/rdma_cm.h>
-+ ],[
-+ rdma_create_id(NULL, NULL, NULL, 0, 0);
-+ ],[
-+ AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
-+ [rdma_create_id wants 5 args])
-+ ])
-+])
-+
-+# new fast registration API introduced in 4.4
-+AS_IF([test $ENABLEO2IB != "no"], [
-+ LB_CHECK_COMPILE([if 'ib_map_mr_sg' exists],
-+ ib_map_mr_sg, [
-+ #ifdef HAVE_COMPAT_RDMA
-+ #undef PACKAGE_NAME
-+ #undef PACKAGE_TARNAME
-+ #undef PACKAGE_VERSION
-+ #undef PACKAGE_STRING
-+ #undef PACKAGE_BUGREPORT
-+ #undef PACKAGE_URL
-+ #include <linux/compat-2.6.h>
-+ #endif
-+ #include <rdma/ib_verbs.h>
-+ ],[
-+ ib_map_mr_sg(NULL, NULL, 0, 0);
-+ ],[
-+ AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
-+ [ib_map_mr_sg exists])
-+ ])
-+])
- ]) # LN_CONFIG_O2IB
-
- #
-diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c
-index 57f51ca..1262268 100644
---- a/lnet/klnds/o2iblnd/o2iblnd.c
-+++ b/lnet/klnds/o2iblnd/o2iblnd.c
-@@ -1394,8 +1394,27 @@ kiblnd_destroy_fmr_pool(kib_fmr_pool_t *pool)
- {
- LASSERT (pool->fpo_map_count == 0);
-
-- if (pool->fpo_fmr_pool != NULL)
-- ib_destroy_fmr_pool(pool->fpo_fmr_pool);
-+ if (fpo->fpo_is_fmr) {
-+ if (fpo->fmr.fpo_fmr_pool)
-+ ib_destroy_fmr_pool(fpo->fmr.fpo_fmr_pool);
-+ } else {
-+ struct kib_fast_reg_descriptor *frd, *tmp;
-+ int i = 0;
-+
-+ list_for_each_entry_safe(frd, tmp, &fpo->fast_reg.fpo_pool_list,
-+ frd_list) {
-+ list_del(&frd->frd_list);
-+#ifndef HAVE_IB_MAP_MR_SG
-+ ib_free_fast_reg_page_list(frd->frd_frpl);
-+#endif
-+ ib_dereg_mr(frd->frd_mr);
-+ LIBCFS_FREE(frd, sizeof(*frd));
-+ i++;
-+ }
-+ if (i < fpo->fast_reg.fpo_pool_size)
-+ CERROR("FastReg pool still has %d regions registered\n",
-+ fpo->fast_reg.fpo_pool_size - i);
-+ }
-
- if (pool->fpo_hdev != NULL)
- kiblnd_hdev_decref(pool->fpo_hdev);
-@@ -1477,6 +1496,7 @@ static int kiblnd_alloc_freg_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t *fpo)
- }
- frd->frd_mr = NULL;
-
-+#ifndef HAVE_IB_MAP_MR_SG
- frd->frd_frpl = ib_alloc_fast_reg_page_list(fpo->fpo_hdev->ibh_ibdev,
- LNET_MAX_PAYLOAD/PAGE_SIZE);
- if (IS_ERR(frd->frd_frpl)) {
-@@ -1486,6 +1506,7 @@ static int kiblnd_alloc_freg_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t *fpo)
- frd->frd_frpl = NULL;
- goto out_middle;
- }
-+#endif
-
- #ifdef HAVE_IB_ALLOC_FAST_REG_MR
- frd->frd_mr = ib_alloc_fast_reg_mr(fpo->fpo_hdev->ibh_pd,
-@@ -1513,15 +1534,19 @@ static int kiblnd_alloc_freg_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t *fpo)
- out_middle:
- if (frd->frd_mr)
- ib_dereg_mr(frd->frd_mr);
-+#ifndef HAVE_IB_MAP_MR_SG
- if (frd->frd_frpl)
- ib_free_fast_reg_page_list(frd->frd_frpl);
-+#endif
- LIBCFS_FREE(frd, sizeof(*frd));
-
- out:
- list_for_each_entry_safe(frd, tmp, &fpo->fast_reg.fpo_pool_list,
- frd_list) {
- list_del(&frd->frd_list);
-+#ifndef HAVE_IB_MAP_MR_SG
- ib_free_fast_reg_page_list(frd->frd_frpl);
-+#endif
- ib_dereg_mr(frd->frd_mr);
- LIBCFS_FREE(frd, sizeof(*frd));
- }
-@@ -1625,6 +1650,28 @@ kiblnd_fmr_pool_is_idle(kib_fmr_pool_t *fpo, cfs_time_t now)
- return cfs_time_aftereq(now, fpo->fpo_deadline);
- }
-
-+static int
-+kiblnd_map_tx_pages(kib_tx_t *tx, kib_rdma_desc_t *rd)
-+{
-+ kib_hca_dev_t *hdev;
-+ __u64 *pages = tx->tx_pages;
-+ int npages;
-+ int size;
-+ int i;
-+
-+ hdev = tx->tx_pool->tpo_hdev;
-+
-+ for (i = 0, npages = 0; i < rd->rd_nfrags; i++) {
-+ for (size = 0; size < rd->rd_frags[i].rf_nob;
-+ size += hdev->ibh_page_size) {
-+ pages[npages++] = (rd->rd_frags[i].rf_addr &
-+ hdev->ibh_page_mask) + size;
-+ }
-+ }
-+
-+ return npages;
-+}
-+
- void
- kiblnd_fmr_pool_unmap(kib_fmr_t *fmr, int status)
- {
-@@ -1666,13 +1713,16 @@ kiblnd_fmr_pool_unmap(kib_fmr_t *fmr, int status)
- }
-
- int
--kiblnd_fmr_pool_map(kib_fmr_poolset_t *fps, __u64 *pages, int npages,
-- __u64 iov, kib_fmr_t *fmr)
-+kiblnd_fmr_pool_map(kib_fmr_poolset_t *fps, kib_tx_t *tx, kib_rdma_desc_t *rd,
-+ __u32 nob, __u64 iov, kib_fmr_t *fmr)
- {
-- struct ib_pool_fmr *pfmr;
-- kib_fmr_pool_t *fpo;
-- __u64 version;
-- int rc;
-+ kib_fmr_pool_t *fpo;
-+ __u64 *pages = tx->tx_pages;
-+ __u64 version;
-+ bool is_rx = (rd != tx->tx_rd);
-+ bool tx_pages_mapped = 0;
-+ int npages = 0;
-+ int rc;
-
- again:
- spin_lock(&fps->fps_lock);
-@@ -1710,7 +1760,7 @@ again:
- struct ib_reg_wr *wr;
- int n;
- #else
-- struct ib_rdma_wr *wr;
-+ struct ib_send_wr *wr;
- struct ib_fast_reg_page_list *frpl;
- #endif
- struct ib_mr *mr;
-@@ -1755,9 +1805,8 @@ again:
-
- wr = &frd->frd_fastreg_wr;
- memset(wr, 0, sizeof(*wr));
--
- wr->wr.opcode = IB_WR_REG_MR;
-- wr->wr.wr_id = IBLND_WID_MR;
-+ wr->wr.wr_id = IBLND_WID_MR;
- wr->wr.num_sge = 0;
- wr->wr.send_flags = 0;
- wr->mr = mr;
-diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h
-index 3baa255..60334b7 100644
---- a/lnet/klnds/o2iblnd/o2iblnd.h
-+++ b/lnet/klnds/o2iblnd/o2iblnd.h
-@@ -352,12 +352,12 @@ struct ib_rdma_wr {
-
- struct kib_fast_reg_descriptor { /* For fast registration */
- struct list_head frd_list;
-- struct ib_rdma_wr frd_inv_wr;
-+ struct ib_send_wr frd_inv_wr;
- #ifdef HAVE_IB_MAP_MR_SG
- struct ib_reg_wr frd_fastreg_wr;
- #else
-- struct ib_rdma_wr frd_fastreg_wr;
-- struct ib_fast_reg_page_list *frd_frpl;
-+ struct ib_send_wr frd_fastreg_wr;
-+ struct ib_fast_reg_page_list *frd_frpl;
- #endif
- struct ib_mr *frd_mr;
- bool frd_valid;
-@@ -1125,8 +1125,9 @@ void kiblnd_unmap_rx_descs(kib_conn_t *conn);
- void kiblnd_pool_free_node(kib_pool_t *pool, struct list_head *node);
- struct list_head *kiblnd_pool_alloc_node(kib_poolset_t *ps);
-
--int kiblnd_fmr_pool_map(kib_fmr_poolset_t *fps, __u64 *pages,
-- int npages, __u64 iov, kib_fmr_t *fmr);
-+int kiblnd_fmr_pool_map(kib_fmr_poolset_t *fps, kib_tx_t *tx,
-+ kib_rdma_desc_t *rd, __u32 nob, __u64 iov,
-+ kib_fmr_t *fmr);
- void kiblnd_fmr_pool_unmap(kib_fmr_t *fmr, int status);
-
- int kiblnd_tunables_init(void);
-diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c
-index d25e45a..e400eb2 100644
---- a/lnet/klnds/o2iblnd/o2iblnd_cb.c
-+++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c
-@@ -565,35 +565,22 @@ static int
- kiblnd_fmr_map_tx(kib_net_t *net, kib_tx_t *tx, kib_rdma_desc_t *rd, int nob)
- {
- kib_hca_dev_t *hdev;
-- __u64 *pages = tx->tx_pages;
- kib_fmr_poolset_t *fps;
-- int npages;
-- int size;
- int cpt;
- int rc;
-- int i;
-
- LASSERT(tx->tx_pool != NULL);
- LASSERT(tx->tx_pool->tpo_pool.po_owner != NULL);
-
-- hdev = tx->tx_pool->tpo_hdev;
--
-- for (i = 0, npages = 0; i < rd->rd_nfrags; i++) {
-- for (size = 0; size < rd->rd_frags[i].rf_nob;
-- size += hdev->ibh_page_size) {
-- pages[npages ++] = (rd->rd_frags[i].rf_addr &
-- hdev->ibh_page_mask) + size;
-- }
-- }
--
-+ hdev = tx->tx_pool->tpo_hdev;
- cpt = tx->tx_pool->tpo_pool.po_owner->ps_cpt;
-
- fps = net->ibn_fmr_ps[cpt];
-- rc = kiblnd_fmr_pool_map(fps, pages, npages, 0, &tx->fmr);
-- if (rc != 0) {
-- CERROR ("Can't map %d pages: %d\n", npages, rc);
-- return rc;
-- }
-+ rc = kiblnd_fmr_pool_map(fps, tx, rd, nob, 0, &tx->fmr);
-+ if (rc != 0) {
-+ CERROR("Can't map %u pages: %d\n", nob, rc);
-+ return rc;
-+ }
-
- /* If rd is not tx_rd, it's going to get sent to a peer, who will need
- * the rkey */
-@@ -853,12 +840,20 @@ __must_hold(&conn->ibc_lock)
-
- if (frd != NULL) {
- if (!frd->frd_valid) {
-- wr = &frd->frd_inv_wr.wr;
-- wr->next = &frd->frd_fastreg_wr.wr;
-+ wrq = &frd->frd_inv_wr;
-+#ifdef HAVE_IB_MAP_MR_SG
-+ wrq->next = &frd->frd_fastreg_wr.wr;
-+ } else {
-+ wrq = &frd->frd_fastreg_wr.wr;
-+ }
-+ frd->frd_fastreg_wr.wr.next = tx->tx_wrq;
-+#else
-+ wrq->next = &frd->frd_fastreg_wr;
- } else {
- wr = &frd->frd_fastreg_wr.wr;
- }
-- frd->frd_fastreg_wr.wr.next = &tx->tx_wrq[0].wr;
-+ frd->frd_fastreg_wr.next = tx->tx_wrq;
-+#endif
- }
-
- LASSERTF(wrq->wr_id == kiblnd_ptr2wreqid(tx, IBLND_WID_TX),
---
-2.8.2
-
diff --git a/sys-cluster/lustre/files/0010-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch b/sys-cluster/lustre/files/0010-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch
deleted file mode 100644
index 5a195bc..0000000
--- a/sys-cluster/lustre/files/0010-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 2c6365b12588a44c95695bfef2b14f7fa449a8d5 Mon Sep 17 00:00:00 2001
-From: Li Dongyang <dongyang.li@anu.edu.au>
-Date: Fri, 1 Apr 2016 20:26:46 -0400
-Subject: [PATCH 10/19] LU-6215 o2iblnd: rdma_create_id() takes extra parameter
-
-4.4 kernel added network namespace parameter to rdma_create_id().
-This patch handles the API change.
-
-Linux-commit: fa20105e09e97e81aadf02f722c31195e4a75c84
-
-Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
-Change-Id: I3f3792e70e91ac3b3d9fefdd58cc9e7e4d1c25c6
-Reviewed-on: http://review.whamcloud.com/18759
-Reviewed-by: James Simmons <uja.ornl@yahoo.com>
-Tested-by: Jenkins
-Tested-by: Maloo <hpdd-maloo@intel.com>
-Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
-Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
----
- lnet/klnds/o2iblnd/o2iblnd.h | 10 ++++------
- 1 file changed, 4 insertions(+), 6 deletions(-)
-
-diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h
-index 60334b7..e784adf 100644
---- a/lnet/klnds/o2iblnd/o2iblnd.h
-+++ b/lnet/klnds/o2iblnd/o2iblnd.h
-@@ -131,12 +131,10 @@ extern kib_tunables_t kiblnd_tunables;
- #define IBLND_CREDITS_DEFAULT 8 /* default # of peer credits */
- #define IBLND_CREDITS_MAX ((typeof(((kib_msg_t*) 0)->ibm_credits)) - 1) /* Max # of peer credits */
-
--#define IBLND_MSG_QUEUE_SIZE(v) ((v) == IBLND_MSG_VERSION_1 ? \
-- IBLND_MSG_QUEUE_SIZE_V1 : \
-- *kiblnd_tunables.kib_peertxcredits) /* # messages/RDMAs in-flight */
--#define IBLND_CREDITS_HIGHWATER(v) ((v) == IBLND_MSG_VERSION_1 ? \
-- IBLND_CREDIT_HIGHWATER_V1 : \
-- *kiblnd_tunables.kib_peercredits_hiw) /* when eagerly to return credits */
-+/* when eagerly to return credits */
-+#define IBLND_CREDITS_HIGHWATER(t, v) ((v) == IBLND_MSG_VERSION_1 ? \
-+ IBLND_CREDIT_HIGHWATER_V1 : \
-+ t->lnd_peercredits_hiw)
-
- #ifdef HAVE_RDMA_CREATE_ID_5ARG
- # define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(current->nsproxy->net_ns, \
---
-2.8.2
-
diff --git a/sys-cluster/lustre/files/0011-LU-6215-llite-remove-obsolete-conditional-code.patch b/sys-cluster/lustre/files/0011-LU-6215-llite-remove-obsolete-conditional-code.patch
deleted file mode 100644
index 1b9f266..0000000
--- a/sys-cluster/lustre/files/0011-LU-6215-llite-remove-obsolete-conditional-code.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From b63795fa3bfd8002351c002c316c53b9f0660636 Mon Sep 17 00:00:00 2001
-From: Andreas Dilger <andreas.dilger@intel.com>
-Date: Fri, 29 Apr 2016 14:48:52 -0600
-Subject: [PATCH 11/19] LU-6215 llite: remove obsolete conditional code
-
-Remove conditional flock/aops code that was only for out-of-tree
-vendor kernels but is not relevant anymore.
-
-Linux-commit: 3746e6f93bbf28a25d2d69350ab6bfba02e14654
-
-Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Change-Id: If119a2da2bbc30a48d872029bd048ea90a3ebbe5
-Reviewed-on: http://review.whamcloud.com/19890
-Tested-by: Jenkins
-Reviewed-by: James Simmons <uja.ornl@yahoo.com>
-Reviewed-by: Frank Zago <fzago@cray.com>
-Reviewed-by: John L. Hammond <john.hammond@intel.com>
-Tested-by: Maloo <hpdd-maloo@intel.com>
-Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
-Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
----
- lustre/llite/llite_internal.h | 4 ----
- lustre/llite/llite_lib.c | 8 --------
- lustre/llite/rw26.c | 17 -----------------
- 3 files changed, 29 deletions(-)
-
-diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h
-index 15530dc..adbf9d3 100644
---- a/lustre/llite/llite_internal.h
-+++ b/lustre/llite/llite_internal.h
-@@ -813,11 +813,7 @@ struct ll_cl_context *ll_cl_find(struct file *file);
- void ll_cl_add(struct file *file, const struct lu_env *env, struct cl_io *io);
- void ll_cl_remove(struct file *file, const struct lu_env *env);
-
--#ifndef MS_HAS_NEW_AOPS
- extern const struct address_space_operations ll_aops;
--#else
--extern const struct address_space_operations_ext ll_aops;
--#endif
-
- /* llite/file.c */
- extern struct file_operations ll_file_operations;
-diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c
-index cf17367..d1050d4 100644
---- a/lustre/llite/llite_lib.c
-+++ b/lustre/llite/llite_lib.c
-@@ -232,14 +232,6 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
- if (sbi->ll_flags & LL_SBI_USER_XATTR)
- data->ocd_connect_flags |= OBD_CONNECT_XATTR;
-
--#ifdef HAVE_MS_FLOCK_LOCK
-- /* force vfs to use lustre handler for flock() calls - bug 10743 */
-- sb->s_flags |= MS_FLOCK_LOCK;
--#endif
--#ifdef MS_HAS_NEW_AOPS
-- sb->s_flags |= MS_HAS_NEW_AOPS;
--#endif
--
- if (sbi->ll_flags & LL_SBI_FLOCK)
- sbi->ll_fop = &ll_file_operations_flock;
- else if (sbi->ll_flags & LL_SBI_LOCALFLOCK)
-diff --git a/lustre/llite/rw26.c b/lustre/llite/rw26.c
-index ee17a73..b362532 100644
---- a/lustre/llite/rw26.c
-+++ b/lustre/llite/rw26.c
-@@ -806,7 +806,6 @@ static int ll_migratepage(struct address_space *mapping,
- }
- #endif
-
--#ifndef MS_HAS_NEW_AOPS
- const struct address_space_operations ll_aops = {
- .readpage = ll_readpage,
- .direct_IO = ll_direct_IO,
-@@ -821,19 +820,3 @@ const struct address_space_operations ll_aops = {
- .migratepage = ll_migratepage,
- #endif
- };
--#else
--const struct address_space_operations_ext ll_aops = {
-- .orig_aops.readpage = ll_readpage,
-- .orig_aops.direct_IO = ll_direct_IO,
-- .orig_aops.writepage = ll_writepage,
-- .orig_aops.writepages = ll_writepages,
-- .orig_aops.set_page_dirty = __set_page_dirty_nobuffers,
-- .orig_aops.invalidatepage = ll_invalidatepage,
-- .orig_aops.releasepage = ll_releasepage,
--#ifdef CONFIG_MIGRATION
-- .orig_aops.migratepage = ll_migratepage,
--#endif
-- .write_begin = ll_write_begin,
-- .write_end = ll_write_end
--};
--#endif
---
-2.8.2
-
diff --git a/sys-cluster/lustre/files/0012-LU-6215-lnet-split-struct-ib_send_wr.patch b/sys-cluster/lustre/files/0012-LU-6215-lnet-split-struct-ib_send_wr.patch
deleted file mode 100644
index ff28978..0000000
--- a/sys-cluster/lustre/files/0012-LU-6215-lnet-split-struct-ib_send_wr.patch
+++ /dev/null
@@ -1,169 +0,0 @@
-From d514117bc52fee3e392aa48dc44b3552c01a0981 Mon Sep 17 00:00:00 2001
-From: Dmitry Eremin <dmitry.eremin@intel.com>
-Date: Tue, 17 May 2016 09:22:15 -0400
-Subject: [PATCH 12/19] LU-6215 lnet: split struct ib_send_wr
-
-In v4.4 Linux kernel split up struct ib_send_wr so that all non-trivial
-verbs use their own structure which embeds struct ib_send_wr.
-
-Linux-commit: e622f2f4ad2142d2a613a57fb85f8cf737935ef5
-Change-Id: Iea2599ea57a576a4c061841be47a989aba097cc6
-Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
-Reviewed-on: http://review.whamcloud.com/19168
-Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
-Reviewed-by: James Simmons <uja.ornl@yahoo.com>
-Reviewed-by: Li Dongyang <dongyang.li@anu.edu.au>
-Tested-by: Jenkins
-Tested-by: Maloo <hpdd-maloo@intel.com>
-Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
----
- lnet/autoconf/lustre-lnet.m4 | 31 +++++++++++++++----------------
- lnet/klnds/o2iblnd/o2iblnd.c | 5 +++--
- lnet/klnds/o2iblnd/o2iblnd.h | 6 +++---
- lnet/klnds/o2iblnd/o2iblnd_cb.c | 14 +++-----------
- 4 files changed, 24 insertions(+), 32 deletions(-)
-
-diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4
-index 5f90bca..2e2adb2 100644
---- a/lnet/autoconf/lustre-lnet.m4
-+++ b/lnet/autoconf/lustre-lnet.m4
-@@ -395,10 +395,8 @@ AS_IF([test $ENABLEO2IB != "no"], [
- AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
- [struct ib_cq_init_attr is used by ib_create_cq])
- ])
--])
-
--# 4.3 removed ib_alloc_fast_reg_mr()
--AS_IF([test $ENABLEO2IB != "no"], [
-+ # 4.3 removed ib_alloc_fast_reg_mr()
- LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
- ib_alloc_fast_reg_mr, [
- #ifdef HAVE_COMPAT_RDMA
-@@ -417,12 +415,13 @@ AS_IF([test $ENABLEO2IB != "no"], [
- AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
- [ib_alloc_fast_reg_mr is defined])
- ])
--])
-
--# 4.4 added network namespace parameter for rdma_create_id()
--AS_IF([test $ENABLEO2IB != "no"], [
-- LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
-- rdma_create_id_5args, [
-+ # In v4.4 Linux kernel,
-+ # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
-+ # split up struct ib_send_wr so that all non-trivial verbs
-+ # use their own structure which embedds struct ib_send_wr.
-+ LB_CHECK_COMPILE([if 'struct ib_rdma_wr' is defined],
-+ ib_rdma_wr, [
- #ifdef HAVE_COMPAT_RDMA
- #undef PACKAGE_NAME
- #undef PACKAGE_TARNAME
-@@ -432,17 +431,17 @@ AS_IF([test $ENABLEO2IB != "no"], [
- #undef PACKAGE_URL
- #include <linux/compat-2.6.h>
- #endif
-- #include <rdma/rdma_cm.h>
-+ #include <rdma/ib_verbs.h>
- ],[
-- rdma_create_id(NULL, NULL, NULL, 0, 0);
-+ struct ib_rdma_wr *wr __attribute__ ((unused));
-+
-+ wr = rdma_wr(NULL);
- ],[
-- AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
-- [rdma_create_id wants 5 args])
-+ AC_DEFINE(HAVE_IB_RDMA_WR, 1,
-+ [struct ib_rdma_wr is defined])
- ])
--])
-
--# new fast registration API introduced in 4.4
--AS_IF([test $ENABLEO2IB != "no"], [
-+ # new fast registration API introduced in 4.4
- LB_CHECK_COMPILE([if 'ib_map_mr_sg' exists],
- ib_map_mr_sg, [
- #ifdef HAVE_COMPAT_RDMA
-@@ -461,7 +460,7 @@ AS_IF([test $ENABLEO2IB != "no"], [
- AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
- [ib_map_mr_sg exists])
- ])
--])
-+]) # ENABLEO2IB != "no"
- ]) # LN_CONFIG_O2IB
-
- #
-diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c
-index 1262268..ada1322 100644
---- a/lnet/klnds/o2iblnd/o2iblnd.c
-+++ b/lnet/klnds/o2iblnd/o2iblnd.c
-@@ -1760,7 +1760,7 @@ again:
- struct ib_reg_wr *wr;
- int n;
- #else
-- struct ib_send_wr *wr;
-+ struct ib_rdma_wr *wr;
- struct ib_fast_reg_page_list *frpl;
- #endif
- struct ib_mr *mr;
-@@ -1805,8 +1805,9 @@ again:
-
- wr = &frd->frd_fastreg_wr;
- memset(wr, 0, sizeof(*wr));
-+
- wr->wr.opcode = IB_WR_REG_MR;
-- wr->wr.wr_id = IBLND_WID_MR;
-+ wr->wr.wr_id = IBLND_WID_MR;
- wr->wr.num_sge = 0;
- wr->wr.send_flags = 0;
- wr->mr = mr;
-diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h
-index e784adf..38e5f14 100644
---- a/lnet/klnds/o2iblnd/o2iblnd.h
-+++ b/lnet/klnds/o2iblnd/o2iblnd.h
-@@ -350,12 +350,12 @@ struct ib_rdma_wr {
-
- struct kib_fast_reg_descriptor { /* For fast registration */
- struct list_head frd_list;
-- struct ib_send_wr frd_inv_wr;
-+ struct ib_rdma_wr frd_inv_wr;
- #ifdef HAVE_IB_MAP_MR_SG
- struct ib_reg_wr frd_fastreg_wr;
- #else
-- struct ib_send_wr frd_fastreg_wr;
-- struct ib_fast_reg_page_list *frd_frpl;
-+ struct ib_rdma_wr frd_fastreg_wr;
-+ struct ib_fast_reg_page_list *frd_frpl;
- #endif
- struct ib_mr *frd_mr;
- bool frd_valid;
-diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c
-index e400eb2..6541d94 100644
---- a/lnet/klnds/o2iblnd/o2iblnd_cb.c
-+++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c
-@@ -840,20 +840,12 @@ __must_hold(&conn->ibc_lock)
-
- if (frd != NULL) {
- if (!frd->frd_valid) {
-- wrq = &frd->frd_inv_wr;
--#ifdef HAVE_IB_MAP_MR_SG
-- wrq->next = &frd->frd_fastreg_wr.wr;
-- } else {
-- wrq = &frd->frd_fastreg_wr.wr;
-- }
-- frd->frd_fastreg_wr.wr.next = tx->tx_wrq;
--#else
-- wrq->next = &frd->frd_fastreg_wr;
-+ wr = &frd->frd_inv_wr.wr;
-+ wr->next = &frd->frd_fastreg_wr.wr;
- } else {
- wr = &frd->frd_fastreg_wr.wr;
- }
-- frd->frd_fastreg_wr.next = tx->tx_wrq;
--#endif
-+ frd->frd_fastreg_wr.wr.next = &tx->tx_wrq[0].wr;
- }
-
- LASSERTF(wrq->wr_id == kiblnd_ptr2wreqid(tx, IBLND_WID_TX),
---
-2.8.2
-
diff --git a/sys-cluster/lustre/lustre-2.8.0.ebuild b/sys-cluster/lustre/lustre-2.8.54.ebuild
similarity index 61%
rename from sys-cluster/lustre/lustre-2.8.0.ebuild
rename to sys-cluster/lustre/lustre-2.8.54.ebuild
index c56b6b1..57f0f37 100644
--- a/sys-cluster/lustre/lustre-2.8.0.ebuild
+++ b/sys-cluster/lustre/lustre-2.8.54.ebuild
@@ -40,30 +40,18 @@ DEPEND="${RDEPEND}
virtual/linux-sources"
REQUIRED_USE="
- modules? ( client )
- modules? ( server )"
+ client? ( modules )
+ server? ( modules )"
PATCHES=(
- "${FILESDIR}/0001-LU-6215-lprocfs-handle-seq_printf-api-change.patch"
- "${FILESDIR}/0002-LU-6215-gss-cache_head-is-now-on-a-hlist-in-4.3-kern.patch"
- "${FILESDIR}/0003-LU-6215-llite-handle-locks-API-change-in-4.4-kernels.patch"
- "${FILESDIR}/0004-LU-6215-llite-make_request_fn-returns-blk_qc_t-in-ke.patch"
- "${FILESDIR}/0005-LU-6215-gss-key-payload.data-is-an-array-in-4.4-kern.patch"
- "${FILESDIR}/0006-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch"
- "${FILESDIR}/0007-LU-6215-lnet-split-struct-ib_send_wr.patch"
- "${FILESDIR}/0008-LU-6215-o2iblnd-ib_alloc_fast_reg_mr-removed-in-4.3.patch"
- "${FILESDIR}/0009-LU-6215-o2iblnd-port-to-new-fast-reg-API-introduced-.patch"
- "${FILESDIR}/0010-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch"
- "${FILESDIR}/0011-LU-6215-llite-remove-obsolete-conditional-code.patch"
- "${FILESDIR}/0012-LU-6215-lnet-split-struct-ib_send_wr.patch"
- "${FILESDIR}/0013-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch"
- "${FILESDIR}/0014-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch"
- "${FILESDIR}/0015-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch"
- "${FILESDIR}/0016-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch"
- "${FILESDIR}/0017-LU-8056-llite-inode_operations-interface-changed-in-.patch"
- "${FILESDIR}/0018-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch"
- "${FILESDIR}/0019-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch"
"${FILESDIR}/lustre-do-not-include-udef.h.patch"
+ "${FILESDIR}/0001-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch"
+ "${FILESDIR}/0002-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch"
+ "${FILESDIR}/0003-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch"
+ "${FILESDIR}/0004-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch"
+ "${FILESDIR}/0005-LU-8056-llite-inode_operations-interface-changed-in-.patch"
+ "${FILESDIR}/0006-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch"
+ "${FILESDIR}/0007-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch"
)
pkg_setup() {
diff --git a/sys-cluster/lustre/lustre-9999.ebuild b/sys-cluster/lustre/lustre-9999.ebuild
index c56b6b1..5d9301c 100644
--- a/sys-cluster/lustre/lustre-9999.ebuild
+++ b/sys-cluster/lustre/lustre-9999.ebuild
@@ -40,29 +40,10 @@ DEPEND="${RDEPEND}
virtual/linux-sources"
REQUIRED_USE="
- modules? ( client )
- modules? ( server )"
+ client? ( modules )
+ server? ( modules )"
PATCHES=(
- "${FILESDIR}/0001-LU-6215-lprocfs-handle-seq_printf-api-change.patch"
- "${FILESDIR}/0002-LU-6215-gss-cache_head-is-now-on-a-hlist-in-4.3-kern.patch"
- "${FILESDIR}/0003-LU-6215-llite-handle-locks-API-change-in-4.4-kernels.patch"
- "${FILESDIR}/0004-LU-6215-llite-make_request_fn-returns-blk_qc_t-in-ke.patch"
- "${FILESDIR}/0005-LU-6215-gss-key-payload.data-is-an-array-in-4.4-kern.patch"
- "${FILESDIR}/0006-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch"
- "${FILESDIR}/0007-LU-6215-lnet-split-struct-ib_send_wr.patch"
- "${FILESDIR}/0008-LU-6215-o2iblnd-ib_alloc_fast_reg_mr-removed-in-4.3.patch"
- "${FILESDIR}/0009-LU-6215-o2iblnd-port-to-new-fast-reg-API-introduced-.patch"
- "${FILESDIR}/0010-LU-6215-o2iblnd-rdma_create_id-takes-extra-parameter.patch"
- "${FILESDIR}/0011-LU-6215-llite-remove-obsolete-conditional-code.patch"
- "${FILESDIR}/0012-LU-6215-lnet-split-struct-ib_send_wr.patch"
- "${FILESDIR}/0013-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch"
- "${FILESDIR}/0014-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch"
- "${FILESDIR}/0015-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch"
- "${FILESDIR}/0016-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch"
- "${FILESDIR}/0017-LU-8056-llite-inode_operations-interface-changed-in-.patch"
- "${FILESDIR}/0018-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch"
- "${FILESDIR}/0019-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch"
"${FILESDIR}/lustre-do-not-include-udef.h.patch"
)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sys-cluster/lustre/files/, sys-cluster/lustre/
@ 2016-06-13 11:25 Alexey Shvetsov
0 siblings, 0 replies; 5+ messages in thread
From: Alexey Shvetsov @ 2016-06-13 11:25 UTC (permalink / raw
To: gentoo-commits
commit: 279da36e2dc5c1f36caf952117ebfd8d5030bf34
Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 13 11:23:50 2016 +0000
Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
CommitDate: Mon Jun 13 11:23:50 2016 +0000
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=279da36e
sys-cluster/lustre: fix build with gcc-6.1
Package-Manager: portage-2.3.0_rc1
...8056-libcfs-Support-for-linux-4.2-kernels.patch | 2 +-
...56-o2iblnd-ib_query_device-removed-in-4.5.patch | 2 +-
...klnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch | 2 +-
...56-llite-use-inode_lock-to-access-i_mutex.patch | 2 +-
...te-inode_operations-interface-changed-in-.patch | 2 +-
...te-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch | 2 +-
...op-fix-bio_for_each_segment_all-for-newer.patch | 2 +-
.../files/0008-Fix-build-error-with-gcc-6.1.patch | 31 ++++++++++++++++++++++
.../files/lustre-do-not-include-udef.h.patch | 12 ---------
sys-cluster/lustre/lustre-2.8.54.ebuild | 4 +--
10 files changed, 40 insertions(+), 21 deletions(-)
diff --git a/sys-cluster/lustre/files/0001-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch b/sys-cluster/lustre/files/0001-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch
index e16ec2e..4e07906 100644
--- a/sys-cluster/lustre/files/0001-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch
+++ b/sys-cluster/lustre/files/0001-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch
@@ -1,7 +1,7 @@
From 9b478d607922c9683663f8e317d93b840e528884 Mon Sep 17 00:00:00 2001
From: Dmitry Eremin <dmitry.eremin@intel.com>
Date: Thu, 5 May 2016 22:08:05 +0300
-Subject: [PATCH 1/7] LU-8056 libcfs: Support for linux 4.2 kernels
+Subject: [PATCH 1/8] LU-8056 libcfs: Support for linux 4.2 kernels
In kernel version 4.2 commit df6b35f409af0a8ff1ef62f552b8402f3fef8665
header file i387.h was renamed to fpu/api.h
diff --git a/sys-cluster/lustre/files/0002-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch b/sys-cluster/lustre/files/0002-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch
index 6ce8433..5c0fcf9 100644
--- a/sys-cluster/lustre/files/0002-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch
+++ b/sys-cluster/lustre/files/0002-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch
@@ -1,7 +1,7 @@
From 0242d060692573dcb6f09750a62db1fa0f6d36df Mon Sep 17 00:00:00 2001
From: Li Dongyang <dongyang.li@anu.edu.au>
Date: Mon, 16 May 2016 17:18:39 +1000
-Subject: [PATCH 2/7] LU-8056 o2iblnd: ib_query_device removed in 4.5
+Subject: [PATCH 2/8] LU-8056 o2iblnd: ib_query_device removed in 4.5
We should use the cached attributes in ib_device instead of
calling ib_query_device since kernel 4.5
diff --git a/sys-cluster/lustre/files/0003-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch b/sys-cluster/lustre/files/0003-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch
index 756c911..6101219 100644
--- a/sys-cluster/lustre/files/0003-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch
+++ b/sys-cluster/lustre/files/0003-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch
@@ -1,7 +1,7 @@
From 6c3f19ba5b6db287980241e4d20be9ac5d0c1293 Mon Sep 17 00:00:00 2001
From: Li Dongyang <dongyang.li@anu.edu.au>
Date: Mon, 16 May 2016 17:27:23 +1000
-Subject: [PATCH 3/7] LU-8056 socklnd: NETIF_F_ALL_CSUM renamed to
+Subject: [PATCH 3/8] LU-8056 socklnd: NETIF_F_ALL_CSUM renamed to
NETIF_F_CSUM_MASK
In kernel 4.5 NETIF_F_CSUM_MASK got renamed to NETIF_F_CSUM_MASK.
diff --git a/sys-cluster/lustre/files/0004-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch b/sys-cluster/lustre/files/0004-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch
index e0aab10..361061f 100644
--- a/sys-cluster/lustre/files/0004-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch
+++ b/sys-cluster/lustre/files/0004-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch
@@ -1,7 +1,7 @@
From ab0006e3a3bf5b0ff63f0914a9e7246dfa1729f8 Mon Sep 17 00:00:00 2001
From: Li Dongyang <dongyang.li@anu.edu.au>
Date: Mon, 16 May 2016 17:40:55 +1000
-Subject: [PATCH 4/7] LU-8056 llite: use inode_lock to access i_mutex
+Subject: [PATCH 4/8] LU-8056 llite: use inode_lock to access i_mutex
Linux kernel 4.5 introduced wrappers for i_mutex as the type
of i_mutex will be changed in the future.
diff --git a/sys-cluster/lustre/files/0005-LU-8056-llite-inode_operations-interface-changed-in-.patch b/sys-cluster/lustre/files/0005-LU-8056-llite-inode_operations-interface-changed-in-.patch
index 11f2de4..72af637 100644
--- a/sys-cluster/lustre/files/0005-LU-8056-llite-inode_operations-interface-changed-in-.patch
+++ b/sys-cluster/lustre/files/0005-LU-8056-llite-inode_operations-interface-changed-in-.patch
@@ -1,7 +1,7 @@
From 0ec0c36d7a0ec5636e19eece4d5df7615f656c23 Mon Sep 17 00:00:00 2001
From: Li Dongyang <dongyang.li@anu.edu.au>
Date: Mon, 16 May 2016 21:57:31 +1000
-Subject: [PATCH 5/7] LU-8056 llite: inode_operations interface changed in 4.5
+Subject: [PATCH 5/8] LU-8056 llite: inode_operations interface changed in 4.5
Linux kernel 4.5 replaced follow_link() with get_link()
while put_link() is removed.
diff --git a/sys-cluster/lustre/files/0006-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch b/sys-cluster/lustre/files/0006-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch
index a564203..6879248 100644
--- a/sys-cluster/lustre/files/0006-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch
+++ b/sys-cluster/lustre/files/0006-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch
@@ -1,7 +1,7 @@
From 103a363fa53f691d2bdbb38280e44d1c830c7322 Mon Sep 17 00:00:00 2001
From: Li Dongyang <dongyang.li@anu.edu.au>
Date: Mon, 16 May 2016 22:07:54 +1000
-Subject: [PATCH 6/7] LU-8056 llite: POSIX_ACL_XATTR_{ACCESS,DEFAULT} removed
+Subject: [PATCH 6/8] LU-8056 llite: POSIX_ACL_XATTR_{ACCESS,DEFAULT} removed
in 4.5
POSIX_ACL_XATTR_{ACCESS,DEFAULT} are duplicate
diff --git a/sys-cluster/lustre/files/0007-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch b/sys-cluster/lustre/files/0007-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch
index 656f7f6..be495b9 100644
--- a/sys-cluster/lustre/files/0007-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch
+++ b/sys-cluster/lustre/files/0007-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch
@@ -1,7 +1,7 @@
From 028c4416216af21dcae53f7daa4f549d0c2bad4f Mon Sep 17 00:00:00 2001
From: James Simmons <uja.ornl@yahoo.com>
Date: Fri, 3 Jun 2016 14:09:54 -0400
-Subject: [PATCH 7/7] LU-8056 lloop: fix bio_for_each_segment_all for newer
+Subject: [PATCH 7/8] LU-8056 lloop: fix bio_for_each_segment_all for newer
kernels
Lustre patch http://review.whamcloud.com/20478 back ported
diff --git a/sys-cluster/lustre/files/0008-Fix-build-error-with-gcc-6.1.patch b/sys-cluster/lustre/files/0008-Fix-build-error-with-gcc-6.1.patch
new file mode 100644
index 0000000..a6e167f
--- /dev/null
+++ b/sys-cluster/lustre/files/0008-Fix-build-error-with-gcc-6.1.patch
@@ -0,0 +1,31 @@
+From 476bd7023e01ab844bcdb81ca2f43e3a07f91b3d Mon Sep 17 00:00:00 2001
+From: Alexey Shvetsov <alexxy@gentoo.org>
+Date: Mon, 13 Jun 2016 14:22:04 +0300
+Subject: [PATCH 8/8] Fix build error with gcc-6.1
+
+Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
+---
+ lustre/utils/liblustreapi_hsm.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/lustre/utils/liblustreapi_hsm.c b/lustre/utils/liblustreapi_hsm.c
+index 0b12f37..2f5b95d 100644
+--- a/lustre/utils/liblustreapi_hsm.c
++++ b/lustre/utils/liblustreapi_hsm.c
+@@ -429,11 +429,12 @@ static int llapi_hsm_log_ct_progress(struct hsm_copyaction_private **phcp,
+ goto err;
+ }
+
+- if (progress_type == CT_RUNNING)
++ if (progress_type == CT_RUNNING) {
+ rc = llapi_json_add_item(&json_items, "current_bytes",
+ LLAPI_JSON_BIGNUM, ¤t);
+ if (rc < 0)
+ goto err;
++ }
+
+ cancel:
+ rc = llapi_json_add_item(&json_items, "event_type", LLAPI_JSON_STRING,
+--
+2.8.2
+
diff --git a/sys-cluster/lustre/files/lustre-do-not-include-udef.h.patch b/sys-cluster/lustre/files/lustre-do-not-include-udef.h.patch
deleted file mode 100644
index 4bb353c..0000000
--- a/sys-cluster/lustre/files/lustre-do-not-include-udef.h.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urN lustre-2.8.0.orig/config/lustre-build.m4 lustre-2.8.0/config/lustre-build.m4
---- lustre-2.8.0.orig/config/lustre-build.m4 2016-06-12 23:18:39.992712332 +0300
-+++ lustre-2.8.0/config/lustre-build.m4 2016-06-12 23:21:39.928433319 +0300
-@@ -266,7 +266,7 @@
- #
- AC_DEFUN([LB_CONFIG_HEADERS], [
- AC_CONFIG_HEADERS([config.h])
--CPPFLAGS="-include $PWD/undef.h -include $PWD/config.h $CPPFLAGS"
-+CPPFLAGS="-include $PWD/config.h $CPPFLAGS"
- EXTRA_KCFLAGS="-include $PWD/undef.h -include $PWD/config.h $EXTRA_KCFLAGS"
- AC_SUBST(EXTRA_KCFLAGS)
- ]) # LB_CONFIG_HEADERS
diff --git a/sys-cluster/lustre/lustre-2.8.54.ebuild b/sys-cluster/lustre/lustre-2.8.54.ebuild
index 57f0f37..2a976b2 100644
--- a/sys-cluster/lustre/lustre-2.8.54.ebuild
+++ b/sys-cluster/lustre/lustre-2.8.54.ebuild
@@ -44,7 +44,6 @@ REQUIRED_USE="
server? ( modules )"
PATCHES=(
- "${FILESDIR}/lustre-do-not-include-udef.h.patch"
"${FILESDIR}/0001-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch"
"${FILESDIR}/0002-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch"
"${FILESDIR}/0003-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch"
@@ -52,6 +51,7 @@ PATCHES=(
"${FILESDIR}/0005-LU-8056-llite-inode_operations-interface-changed-in-.patch"
"${FILESDIR}/0006-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch"
"${FILESDIR}/0007-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch"
+ "${FILESDIR}/0008-Fix-build-error-with-gcc-6.1.patch"
)
pkg_setup() {
@@ -64,7 +64,7 @@ pkg_setup() {
}
src_prepare() {
- if [ ! -z ${PATCHES[@]} ]; then
+ if [ ! -z ${#PATCHES[0]} ]; then
epatch ${PATCHES[@]}
fi
eapply_user
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sys-cluster/lustre/files/, sys-cluster/lustre/
@ 2020-09-27 15:55 Aisha Tammy
0 siblings, 0 replies; 5+ messages in thread
From: Aisha Tammy @ 2020-09-27 15:55 UTC (permalink / raw
To: gentoo-commits
commit: 1444a16c3163253eb3117f30b0fc7154d1445324
Author: Aisha Tammy <gentoo <AT> aisha <DOT> cc>
AuthorDate: Sun Sep 27 15:55:05 2020 +0000
Commit: Aisha Tammy <gentoo <AT> aisha <DOT> cc>
CommitDate: Sun Sep 27 15:55:05 2020 +0000
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=1444a16c
sys-cluster/lustre: drop package
present in ::gentoo
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Aisha Tammy <gentoo <AT> aisha.cc>
sys-cluster/lustre/files/lnet.initd | 45 ----------
sys-cluster/lustre/files/lustre-client.initd | 47 -----------
sys-cluster/lustre/lustre-2.10.1.ebuild | 120 ---------------------------
sys-cluster/lustre/lustre-2.8.0.ebuild | 116 --------------------------
sys-cluster/lustre/lustre-9999.ebuild | 118 --------------------------
sys-cluster/lustre/metadata.xml | 18 ----
6 files changed, 464 deletions(-)
diff --git a/sys-cluster/lustre/files/lnet.initd b/sys-cluster/lustre/files/lnet.initd
deleted file mode 100644
index 227780c52..000000000
--- a/sys-cluster/lustre/files/lnet.initd
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-description="Loads lnet module and configures network."
-
-depend() {
- need net
- after bootmisc
-}
-
-start() {
- if [ "${RC_CMD}" = "restart" ];
- then
- einfo "Restarting..."
- fi
-
- ebegin "Loading LNet modules:"
- modprobe lnet
- eend $*
-
- ebegin "Bringing up LNet"
- lnetctl lnet configure --all
- eend $*
-}
-
-stop() {
- local LNETMODULES=( "ko2iblnd" "lnet" "libcfs" )
- ebegin "Bringing down LNet"
- lnetctl lnet unconfigure --all
- eend $*
-
- einfo "Unloading LNet modules:"
- for mod in ${LNETMODULES[@]}; do
- ebegin "... ${mod}"
- modprobe -r ${mod}
- eend $*
- done
-}
-
-status()
-{
- einfo "LNet status:"
- lnetctl net show
-}
diff --git a/sys-cluster/lustre/files/lustre-client.initd b/sys-cluster/lustre/files/lustre-client.initd
deleted file mode 100644
index 2978b42b9..000000000
--- a/sys-cluster/lustre/files/lustre-client.initd
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-description="Load lustre modules"
-
-extra_commands="checkmodule"
-
-depend() {
- need lnet
- before netmount
-}
-
-checkmodule() {
- local LOADED="$(lctl modules | awk -F"/" /lustre/'{print $2F}')"
- for mod in ${LOADED[@]}; do
- ewarn "Module is still loaded: ${mod}"
- eend $*
- done
-}
-
-start() {
- if [ "${RC_CMD}" = "restart" ];
- then
- einfo "Restarting Lustre..."
- checkmodule
- fi
-
- ebegin "Loading Lustre modules..."
- modprobe lustre
- eend $*
-}
-
-stop() {
- local LMODULES=( "lustre" "osc" "mgc" "lmv" "fld" "mdc" "fid" "lov" "ptlrpc" )
- ebegin "Trying to unmount all Lustre fs"
- umount -a -t lustre
- eend $*
- einfo "Unloading lustre modules:"
- for mod in ${LMODULES[@]}; do
- ebegin "... ${mod}"
- modprobe -r ${mod}
- eend $*
- done
-
- checkmodule
-}
diff --git a/sys-cluster/lustre/lustre-2.10.1.ebuild b/sys-cluster/lustre/lustre-2.10.1.ebuild
deleted file mode 100644
index b2b1d1b35..000000000
--- a/sys-cluster/lustre/lustre-2.10.1.ebuild
+++ /dev/null
@@ -1,120 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-WANT_AUTOCONF="2.5"
-WANT_AUTOMAKE="1.15"
-WANT_LIBTOOL="latest"
-
-if [[ $PV = *9999* ]]; then
- scm="git-r3"
- SRC_URI=""
- EGIT_REPO_URI="git://git.whamcloud.com/fs/lustre-release.git"
- KEYWORDS=""
- EGIT_BRANCH="master"
-else
- scm=""
- SRC_URI="https://dev.gentoo.org/~alexxy/distfiles/${P}.tar.gz"
- KEYWORDS="~amd64"
-fi
-
-SUPPORTED_KV_MAJOR=4
-SUPPORTED_KV_MINOR=9
-
-inherit ${scm} autotools linux-info linux-mod toolchain-funcs udev flag-o-matic
-
-DESCRIPTION="Lustre is a parallel distributed file system"
-HOMEPAGE="http://wiki.whamcloud.com/"
-
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="+client +utils +modules +dlc server readline tests"
-
-RDEPEND="
- virtual/awk
- dlc? ( dev-libs/libyaml )
- readline? ( sys-libs/readline:0 )
- server? (
- >=sys-kernel/spl-0.6.1
- >=sys-fs/zfs-kmod-0.6.1
- sys-fs/zfs
- )
- "
-DEPEND="${RDEPEND}
- dev-python/docutils
- virtual/linux-sources"
-
-REQUIRED_USE="
- client? ( modules )
- server? ( modules )"
-
-pkg_pretend() {
- KVSUPP=${SUPPORTED_KV_MAJOR}.${SUPPORTED_KV_MINOR}.x
- if kernel_is gt ${SUPPORTED_KV_MAJOR} ${SUPPORTED_KV_MINOR}; then
- eerror "Unsupported kernel version! Latest supported one is ${KVSUPP}"
- die
- fi
-}
-
-pkg_setup() {
- filter-mfpmath sse
- filter-mfpmath i386
- filter-flags -msse* -mavx* -mmmx -m3dnow
- linux-mod_pkg_setup
- ARCH="$(tc-arch-kernel)"
- ABI="${KERNEL_ABI}"
-}
-
-src_prepare() {
- if [ ${#PATCHES[0]} -ne 0 ]; then
- epatch ${PATCHES[@]}
- fi
- eapply_user
- if [[ ${PV} == "9999" ]]; then
- # replace upstream autogen.sh by our src_prepare()
- local DIRS="libcfs lnet lustre snmp"
- local ACLOCAL_FLAGS
- for dir in $DIRS ; do
- ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $dir/autoconf"
- done
- _elibtoolize -q
- eaclocal -I config $ACLOCAL_FLAGS
- eautoheader
- eautomake
- eautoconf
- fi
-}
-
-src_configure() {
- local myconf
- if use server; then
- SPL_PATH=$(basename $(echo "${EROOT}usr/src/spl-"*)) \
- myconf="${myconf} --with-spl=${EROOT}usr/src/${SPL_PATH} \
- --with-spl-obj=${EROOT}usr/src/${SPL_PATH}/${KV_FULL}"
- ZFS_PATH=$(basename $(echo "${EROOT}usr/src/zfs-"*)) \
- myconf="${myconf} --with-zfs=${EROOT}usr/src/${ZFS_PATH} \
- --with-zfs-obj=${EROOT}usr/src/${ZFS_PATH}/${KV_FULL}"
- fi
- econf \
- ${myconf} \
- --without-ldiskfs \
- --with-linux="${KERNEL_DIR}" \
- $(use_enable dlc) \
- $(use_enable client) \
- $(use_enable utils) \
- $(use_enable modules) \
- $(use_enable server) \
- $(use_enable readline) \
- $(use_enable tests)
-}
-
-src_compile() {
- default
-}
-
-src_install() {
- default
- newinitd "${FILESDIR}/lnet.initd" lnet
- newinitd "${FILESDIR}/lustre-client.initd" lustre-client
-}
diff --git a/sys-cluster/lustre/lustre-2.8.0.ebuild b/sys-cluster/lustre/lustre-2.8.0.ebuild
deleted file mode 100644
index 3cf01dd73..000000000
--- a/sys-cluster/lustre/lustre-2.8.0.ebuild
+++ /dev/null
@@ -1,116 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-WANT_AUTOCONF="2.5"
-WANT_AUTOMAKE="1.15"
-WANT_LIBTOOL="latest"
-
-if [[ $PV = *9999* ]]; then
- KEYWORDS=""
- EGIT_BRANCH="master"
-else
- KEYWORDS="~amd64"
- EGIT_COMMIT="${PV}"
-fi
-
-SUPPORTED_KV_MAJOR=4
-SUPPORTED_KV_MINOR=1
-
-inherit git-r3 autotools linux-info linux-mod toolchain-funcs udev flag-o-matic
-
-DESCRIPTION="Lustre is a parallel distributed file system"
-HOMEPAGE="http://wiki.whamcloud.com/"
-SRC_URI=""
-EGIT_REPO_URI="git://git.whamcloud.com/fs/lustre-release.git"
-
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="+client +utils +modules +dlc server readline tests"
-
-RDEPEND="
- virtual/awk
- dlc? ( dev-libs/libyaml )
- readline? ( sys-libs/readline:0 )
- server? (
- >=sys-kernel/spl-0.6.1
- >=sys-fs/zfs-kmod-0.6.1
- sys-fs/zfs
- )
- "
-DEPEND="${RDEPEND}
- dev-python/docutils
- virtual/linux-sources"
-
-REQUIRED_USE="
- client? ( modules )
- server? ( modules )"
-
-pkg_pretend() {
- KVSUPP=${SUPPORTED_KV_MAJOR}.${SUPPORTED_KV_MINOR}.x
- if kernel_is gt ${SUPPORTED_KV_MAJOR} ${SUPPORTED_KV_MINOR}; then
- eerror "Unsupported kernel version! Latest supported one is ${KVSUPP}"
- die
- fi
-}
-
-pkg_setup() {
- filter-mfpmath sse
- filter-mfpmath i386
- filter-flags -msse* -mavx* -mmmx -m3dnow
- linux-mod_pkg_setup
- ARCH="$(tc-arch-kernel)"
- ABI="${KERNEL_ABI}"
-}
-
-src_prepare() {
- if [ ${#PATCHES[0]} -ne 0 ]; then
- epatch ${PATCHES[@]}
- fi
- eapply_user
- # replace upstream autogen.sh by our src_prepare()
- local DIRS="libcfs lnet lustre snmp"
- local ACLOCAL_FLAGS
- for dir in $DIRS ; do
- ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $dir/autoconf"
- done
- _elibtoolize -q
- eaclocal -I config $ACLOCAL_FLAGS
- eautoheader
- eautomake
- eautoconf
-}
-
-src_configure() {
- local myconf
- if use server; then
- SPL_PATH=$(basename $(echo "${EROOT}usr/src/spl-"*)) \
- myconf="${myconf} --with-spl=${EROOT}usr/src/${SPL_PATH} \
- --with-spl-obj=${EROOT}usr/src/${SPL_PATH}/${KV_FULL}"
- ZFS_PATH=$(basename $(echo "${EROOT}usr/src/zfs-"*)) \
- myconf="${myconf} --with-zfs=${EROOT}usr/src/${ZFS_PATH} \
- --with-zfs-obj=${EROOT}usr/src/${ZFS_PATH}/${KV_FULL}"
- fi
- econf \
- ${myconf} \
- --without-ldiskfs \
- --with-linux="${KERNEL_DIR}" \
- $(use_enable dlc) \
- $(use_enable client) \
- $(use_enable utils) \
- $(use_enable modules) \
- $(use_enable server) \
- $(use_enable readline) \
- $(use_enable tests)
-}
-
-src_compile() {
- default
-}
-
-src_install() {
- default
- newinitd "${FILESDIR}/lnet.initd" lnet
- newinitd "${FILESDIR}/lustre-client.initd" lustre-client
-}
diff --git a/sys-cluster/lustre/lustre-9999.ebuild b/sys-cluster/lustre/lustre-9999.ebuild
deleted file mode 100644
index 1f17955bb..000000000
--- a/sys-cluster/lustre/lustre-9999.ebuild
+++ /dev/null
@@ -1,118 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-WANT_AUTOCONF="2.5"
-WANT_AUTOMAKE="1.15"
-WANT_LIBTOOL="latest"
-
-if [[ $PV = *9999* ]]; then
- scm="git-r3"
- SRC_URI=""
- EGIT_REPO_URI="git://git.whamcloud.com/fs/lustre-release.git"
- KEYWORDS=""
- EGIT_BRANCH="master"
-else
- scm=""
- SRC_URI="https://dev.gentoo.org/~alexxy/distfiles/${P}.tar.gz"
- KEYWORDS="~amd64"
-fi
-
-SUPPORTED_KV_MAJOR=4
-SUPPORTED_KV_MINOR=9
-
-inherit ${scm} autotools linux-info linux-mod toolchain-funcs udev flag-o-matic
-
-DESCRIPTION="Lustre is a parallel distributed file system"
-HOMEPAGE="http://wiki.whamcloud.com/"
-
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="+client +utils +modules +dlc server readline tests"
-
-RDEPEND="
- virtual/awk
- dlc? ( dev-libs/libyaml )
- readline? ( sys-libs/readline:0 )
- server? (
- >=sys-kernel/spl-0.6.1
- >=sys-fs/zfs-kmod-0.6.1
- sys-fs/zfs
- )
- "
-DEPEND="${RDEPEND}
- dev-python/docutils
- virtual/linux-sources"
-
-REQUIRED_USE="
- client? ( modules )
- server? ( modules )"
-
-pkg_pretend() {
- KVSUPP=${SUPPORTED_KV_MAJOR}.${SUPPORTED_KV_MINOR}.x
- if kernel_is gt ${SUPPORTED_KV_MAJOR} ${SUPPORTED_KV_MINOR}; then
- eerror "Unsupported kernel version! Latest supported one is ${KVSUPP}"
- die
- fi
-}
-
-pkg_setup() {
- filter-mfpmath sse
- filter-mfpmath i386
- filter-flags -msse* -mavx* -mmmx -m3dnow
- linux-mod_pkg_setup
- ARCH="$(tc-arch-kernel)"
- ABI="${KERNEL_ABI}"
-}
-
-src_prepare() {
- if [ ${#PATCHES[0]} -ne 0 ]; then
- epatch ${PATCHES[@]}
- fi
- eapply_user
- # replace upstream autogen.sh by our src_prepare()
- local DIRS="libcfs lnet lustre snmp"
- local ACLOCAL_FLAGS
- for dir in $DIRS ; do
- ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $dir/autoconf"
- done
- _elibtoolize -q
- eaclocal -I config $ACLOCAL_FLAGS
- eautoheader
- eautomake
- eautoconf
-}
-
-src_configure() {
- local myconf
- if use server; then
- SPL_PATH=$(basename $(echo "${EROOT}usr/src/spl-"*)) \
- myconf="${myconf} --with-spl=${EROOT}usr/src/${SPL_PATH} \
- --with-spl-obj=${EROOT}usr/src/${SPL_PATH}/${KV_FULL}"
- ZFS_PATH=$(basename $(echo "${EROOT}usr/src/zfs-"*)) \
- myconf="${myconf} --with-zfs=${EROOT}usr/src/${ZFS_PATH} \
- --with-zfs-obj=${EROOT}usr/src/${ZFS_PATH}/${KV_FULL}"
- fi
- econf \
- ${myconf} \
- --without-ldiskfs \
- --with-linux="${KERNEL_DIR}" \
- $(use_enable dlc) \
- $(use_enable client) \
- $(use_enable utils) \
- $(use_enable modules) \
- $(use_enable server) \
- $(use_enable readline) \
- $(use_enable tests)
-}
-
-src_compile() {
- default
-}
-
-src_install() {
- default
- newinitd "${FILESDIR}/lnet.initd" lnet
- newinitd "${FILESDIR}/lustre-client.initd" lustre-client
-}
diff --git a/sys-cluster/lustre/metadata.xml b/sys-cluster/lustre/metadata.xml
deleted file mode 100644
index bb4904291..000000000
--- a/sys-cluster/lustre/metadata.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
- <maintainer type="project">
- <email>cluster@gentoo.org</email>
- <name>Gentoo Cluster Project</name>
- </maintainer>
- <longdescription>
-Lustre is a parallel distributed file system, generally used for large scale cluster computing
-</longdescription>
- <use>
- <flag name="client">Enable kernel client modules</flag>
- <flag name="dlc">Enable Dynamic LNET Configuration</flag>
- <flag name="server">Enable kernels server modules</flag>
- <flag name="utils">Enable lustre utils</flag>
- <flag name="tests">Enable installation of tests</flag>
- </use>
-</pkgmetadata>
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-09-27 15:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-13 10:13 [gentoo-commits] proj/sci:master commit in: sys-cluster/lustre/files/, sys-cluster/lustre/ Alexey Shvetsov
-- strict thread matches above, loose matches on Subject: below --
2020-09-27 15:55 Aisha Tammy
2016-06-13 11:25 Alexey Shvetsov
2016-06-13 10:38 Alexey Shvetsov
2014-11-13 0:15 Christoph Junghans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox