diff options
author | Alexey Shvetsov <alexxy@gentoo.org> | 2014-05-19 13:06:02 +0400 |
---|---|---|
committer | Alexey Shvetsov <alexxy@gentoo.org> | 2014-05-19 13:06:02 +0400 |
commit | 2729b8f19c87054cccf7854a70193e887f9cac14 (patch) | |
tree | 3f510ce3fc66d5c23db565a301c16ea5292d0727 /sys-cluster/lustre | |
parent | sci-biology/khmer: Version BUmp (diff) | |
download | sci-2729b8f19c87054cccf7854a70193e887f9cac14.tar.gz sci-2729b8f19c87054cccf7854a70193e887f9cac14.tar.bz2 sci-2729b8f19c87054cccf7854a70193e887f9cac14.zip |
Update lustre patches
Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
Diffstat (limited to 'sys-cluster/lustre')
9 files changed, 924 insertions, 599 deletions
diff --git a/sys-cluster/lustre/files/0001-LU-3319-procfs-Move-NRS-TBF-proc-handling-to-seq_fil.patch b/sys-cluster/lustre/files/0001-LU-3319-procfs-Move-NRS-TBF-proc-handling-to-seq_fil.patch index a00e07006..537f2480b 100644 --- a/sys-cluster/lustre/files/0001-LU-3319-procfs-Move-NRS-TBF-proc-handling-to-seq_fil.patch +++ b/sys-cluster/lustre/files/0001-LU-3319-procfs-Move-NRS-TBF-proc-handling-to-seq_fil.patch @@ -1,7 +1,7 @@ -From b0d57f2b81f5ec6f1f2cad9914cdb01960377f01 Mon Sep 17 00:00:00 2001 +From 0267429e006d1f7ccfe63cbb90849ba430f649a0 Mon Sep 17 00:00:00 2001 From: James Simmons <uja.ornl@gmail.com> Date: Tue, 25 Feb 2014 12:54:05 -0500 -Subject: [PATCH 1/7] LU-3319 procfs: Move NRS TBF proc handling to seq_files +Subject: [PATCH 1/8] LU-3319 procfs: Move NRS TBF proc handling to seq_files With newer kernels moving their proc file system handling to seq_files this patch migrates the proc handling for NRS @@ -14,7 +14,7 @@ Signed-off-by: James Simmons <uja.ornl@gmail.com> 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/lustre/ptlrpc/nrs_tbf.c b/lustre/ptlrpc/nrs_tbf.c -index 80fa9ff..93b9103 100644 +index f0ab74d..046e509 100644 --- a/lustre/ptlrpc/nrs_tbf.c +++ b/lustre/ptlrpc/nrs_tbf.c @@ -1572,30 +1572,26 @@ static void nrs_tbf_req_stop(struct ptlrpc_nrs_policy *policy, @@ -119,5 +119,5 @@ index 80fa9ff..93b9103 100644 return rc; } -- -1.9.1 +1.9.3 diff --git a/sys-cluster/lustre/files/0002-LU-3319-procfs-update-zfs-proc-handling-to-seq_files.patch b/sys-cluster/lustre/files/0002-LU-3319-procfs-update-zfs-proc-handling-to-seq_files.patch index 7a8299b9f..975647d73 100644 --- a/sys-cluster/lustre/files/0002-LU-3319-procfs-update-zfs-proc-handling-to-seq_files.patch +++ b/sys-cluster/lustre/files/0002-LU-3319-procfs-update-zfs-proc-handling-to-seq_files.patch @@ -1,23 +1,23 @@ -From 2c8c53a01d77519c8de108bbe69734e5931f41d8 Mon Sep 17 00:00:00 2001 +From 1d3e2fbd8661a770d2d64a2402076577ec920e9c Mon Sep 17 00:00:00 2001 From: James Simmons <uja.ornl@gmail.com> -Date: Tue, 18 Feb 2014 18:44:22 -0500 -Subject: [PATCH 2/7] LU-3319 procfs: update zfs proc handling to seq_files +Date: Wed, 23 Apr 2014 09:31:09 -0400 +Subject: [PATCH 2/8] LU-3319 procfs: update zfs proc handling to seq_files Migrate all zfs proc handling to using strictly seq_files. Signed-off-by: James Simmons <uja.ornl@gmail.com> Change-Id: I6dc7e65c3e74e7934a17939815ec3c334fac58c7 --- - lustre/osd-zfs/osd_handler.c | 13 ++++--- + lustre/osd-zfs/osd_handler.c | 13 +++--- lustre/osd-zfs/osd_internal.h | 3 +- - lustre/osd-zfs/osd_lproc.c | 90 +++++++++++++++++++++++++------------------ - 3 files changed, 60 insertions(+), 46 deletions(-) + lustre/osd-zfs/osd_lproc.c | 92 +++++++++++++++++++++++++------------------ + 3 files changed, 61 insertions(+), 47 deletions(-) diff --git a/lustre/osd-zfs/osd_handler.c b/lustre/osd-zfs/osd_handler.c -index 0dc8c2e..29a3617 100644 +index 42e6e20..83b243d 100644 --- a/lustre/osd-zfs/osd_handler.c +++ b/lustre/osd-zfs/osd_handler.c -@@ -767,12 +767,13 @@ static int osd_process_config(const struct lu_env *env, +@@ -761,12 +761,13 @@ static int osd_process_config(const struct lu_env *env, break; case LCFG_PARAM: { LASSERT(&o->od_dt_dev); @@ -36,7 +36,7 @@ index 0dc8c2e..29a3617 100644 break; } default: -@@ -920,7 +921,7 @@ int __init osd_init(void) +@@ -923,7 +924,7 @@ int __init osd_init(void) rc = class_register_type(&osd_obd_device_ops, NULL, true, NULL, #ifndef HAVE_ONLY_PROCFS_SEQ @@ -46,10 +46,10 @@ index 0dc8c2e..29a3617 100644 LUSTRE_OSD_ZFS_NAME, &osd_device_type); if (rc) diff --git a/lustre/osd-zfs/osd_internal.h b/lustre/osd-zfs/osd_internal.h -index 63f680c..740dba7 100644 +index c53ad8b..1773313 100644 --- a/lustre/osd-zfs/osd_internal.h +++ b/lustre/osd-zfs/osd_internal.h -@@ -420,8 +420,7 @@ enum { +@@ -405,8 +405,7 @@ enum { }; /* osd_lproc.c */ @@ -60,7 +60,7 @@ index 63f680c..740dba7 100644 int osd_procfs_init(struct osd_device *osd, const char *name); int osd_procfs_fini(struct osd_device *osd); diff --git a/lustre/osd-zfs/osd_lproc.c b/lustre/osd-zfs/osd_lproc.c -index 0854ce6..bed08e9 100644 +index bc8a807..f19ed11 100644 --- a/lustre/osd-zfs/osd_lproc.c +++ b/lustre/osd-zfs/osd_lproc.c @@ -107,27 +107,27 @@ out: @@ -94,7 +94,7 @@ index 0854ce6..bed08e9 100644 -static int lprocfs_osd_wr_force_sync(struct file *file, const char *buffer, - unsigned long count, void *data) +static ssize_t -+lprocfs_osd_force_sync_seq_write(struct file *file, const char *buffer, ++lprocfs_osd_force_sync_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) { - struct dt_device *dt = data; @@ -103,14 +103,14 @@ index 0854ce6..bed08e9 100644 struct lu_env env; int rc; -@@ -139,20 +139,22 @@ static int lprocfs_osd_wr_force_sync(struct file *file, const char *buffer, +@@ -139,21 +139,23 @@ static int lprocfs_osd_wr_force_sync(struct file *file, const char *buffer, return rc == 0 ? count : rc; } +LPROC_SEQ_FOPS_WO_TYPE(zfs, osd_force_sync); --static int lprocfs_osd_rd_iused_est(char *page, char **start, off_t off, int count, -- int *eof, void *data) +-static int lprocfs_osd_rd_iused_est(char *page, char **start, off_t off, +- int count, int *eof, void *data) +static int zfs_osd_iused_est_seq_show(struct seq_file *m, void *data) { - struct osd_device *osd = osd_dt_dev((struct dt_device *)data); @@ -121,10 +121,12 @@ index 0854ce6..bed08e9 100644 + return seq_printf(m, "%d\n", osd->od_quota_iused_est); } --static int lprocfs_osd_wr_iused_est(struct file *file, const char *buffer, -- unsigned long count, void *data) -+static ssize_t zfs_osd_iused_est_seq_write(struct file *file, const char *buffer, -+ size_t count, loff_t *off) +-static int lprocfs_osd_wr_iused_est(struct file *file, +- const char __user *buffer, +- unsigned long count, void *data) ++static ssize_t ++zfs_osd_iused_est_seq_write(struct file *file, const char __user *buffer, ++ size_t count, loff_t *off) { - struct osd_device *osd = osd_dt_dev((struct dt_device *)data); + struct seq_file *m = file->private_data; @@ -133,7 +135,7 @@ index 0854ce6..bed08e9 100644 int rc, val; LASSERT(osd != NULL); -@@ -165,24 +167,36 @@ static int lprocfs_osd_wr_iused_est(struct file *file, const char *buffer, +@@ -166,24 +168,36 @@ static int lprocfs_osd_wr_iused_est(struct file *file, return count; } @@ -188,7 +190,7 @@ index 0854ce6..bed08e9 100644 { 0 } }; -@@ -202,7 +216,7 @@ int osd_procfs_init(struct osd_device *osd, const char *name) +@@ -203,7 +217,7 @@ int osd_procfs_init(struct osd_device *osd, const char *name) LASSERT(name != NULL); LASSERT(type != NULL); @@ -198,5 +200,5 @@ index 0854ce6..bed08e9 100644 if (IS_ERR(osd->od_proc_entry)) { rc = PTR_ERR(osd->od_proc_entry); -- -1.9.1 +1.9.3 diff --git a/sys-cluster/lustre/files/0003-LU-3319-procfs-move-osp-proc-handling-to-seq_files.patch b/sys-cluster/lustre/files/0003-LU-3319-procfs-move-osp-proc-handling-to-seq_files.patch index 1dcde79e1..d9bfa0ba3 100644 --- a/sys-cluster/lustre/files/0003-LU-3319-procfs-move-osp-proc-handling-to-seq_files.patch +++ b/sys-cluster/lustre/files/0003-LU-3319-procfs-move-osp-proc-handling-to-seq_files.patch @@ -1,7 +1,7 @@ -From 9028aafc0c8651d6a840d9066ca7d950106fbdc5 Mon Sep 17 00:00:00 2001 +From 8128e9daa5f394f97bcfcc3f1da0b8285754c5c4 Mon Sep 17 00:00:00 2001 From: James Simmons <uja.ornl@gmail.com> -Date: Wed, 26 Mar 2014 19:59:18 -0400 -Subject: [PATCH 3/7] LU-3319 procfs: move osp proc handling to seq_files +Date: Thu, 24 Apr 2014 12:04:57 -0400 +Subject: [PATCH 3/8] LU-3319 procfs: move osp proc handling to seq_files With 3.10 linux kernel and above proc handling now only uses struct seq_files. This patch migrates the osp @@ -10,14 +10,14 @@ layer proc entries over to using seq_files. Signed-off-by: James Simmons <uja.ornl@gmail.com> Change-Id: Id8f77d72fd35755f1b7b1c17fcf27e0731bd5ac1 --- - lustre/osp/lproc_osp.c | 402 +++++++++++++++++++++++++--------------------- - lustre/osp/lwp_dev.c | 19 +-- + lustre/osp/lproc_osp.c | 431 ++++++++++++++++++++++++---------------------- + lustre/osp/lwp_dev.c | 19 +- lustre/osp/osp_dev.c | 32 ++-- lustre/osp/osp_internal.h | 2 - - 4 files changed, 228 insertions(+), 227 deletions(-) + 4 files changed, 242 insertions(+), 242 deletions(-) diff --git a/lustre/osp/lproc_osp.c b/lustre/osp/lproc_osp.c -index 75ebeb1..1271b7c 100644 +index 118c4df..c23ce18 100644 --- a/lustre/osp/lproc_osp.c +++ b/lustre/osp/lproc_osp.c @@ -45,24 +45,24 @@ @@ -396,13 +396,14 @@ index 75ebeb1..1271b7c 100644 struct osp_device *osp = lu2osp_dev(dev->obd_lu_dev); if (osp == NULL) -@@ -411,126 +404,161 @@ static int osp_rd_destroys_in_flight(char *page, char **start, off_t off, +@@ -411,43 +404,40 @@ static int osp_rd_destroys_in_flight(char *page, char **start, off_t off, * - sync changes are zero - no llog records * - sync in progress are zero - no RPCs in flight */ - return snprintf(page, count, "%lu\n", +- osp->opd_syn_rpc_in_progress + osp->opd_syn_changes); + return seq_printf(m, "%lu\n", - osp->opd_syn_rpc_in_progress + osp->opd_syn_changes); ++ osp->opd_syn_rpc_in_progress + osp->opd_syn_changes); } +LPROC_SEQ_FOPS_RO(osp_destroys_in_flight); @@ -424,6 +425,44 @@ index 75ebeb1..1271b7c 100644 } +LPROC_SEQ_FOPS_RO(osp_old_sync_processed); +-static int osp_rd_lfsck_max_rpcs_in_flight(char *page, char **start, off_t off, +- int count, int *eof, void *data) ++static int ++osp_lfsck_max_rpcs_in_flight_seq_show(struct seq_file *m, void *data) + { +- struct obd_device *dev = data; ++ struct obd_device *dev = m->private; + __u32 max; +- int rc; + +- *eof = 1; + max = obd_get_max_rpcs_in_flight(&dev->u.cli); +- rc = snprintf(page, count, "%u\n", max); +- +- return rc; ++ return seq_printf(m, "%u\n", max); + } + +-static int osp_wr_lfsck_max_rpcs_in_flight(struct file *file, +- const char *buffer, +- unsigned long count, void *data) ++static ssize_t ++osp_lfsck_max_rpcs_in_flight_seq_write(struct file *file, ++ const char __user *buffer, ++ size_t count, loff_t *off) + { +- struct obd_device *dev = data; ++ struct seq_file *m = file->private_data; ++ struct obd_device *dev = m->private; + int val; + int rc; + +@@ -460,111 +450,148 @@ static int osp_wr_lfsck_max_rpcs_in_flight(struct file *file, + + return count; + } ++LPROC_SEQ_FOPS(osp_lfsck_max_rpcs_in_flight); + -static struct lprocfs_vars lprocfs_osp_obd_vars[] = { - { "uuid", lprocfs_rd_uuid, 0, 0 }, - { "ping", 0, lprocfs_wr_ping, 0, 0, 0222 }, @@ -461,6 +500,8 @@ index 75ebeb1..1271b7c 100644 - /* for compatibility reasons */ - { "destroys_in_flight", osp_rd_destroys_in_flight, 0, 0 }, +- { "lfsck_max_rpcs_in_flight", osp_rd_lfsck_max_rpcs_in_flight, +- osp_wr_lfsck_max_rpcs_in_flight, 0 }, - { 0 } -}; +static int osp_max_pages_per_rpc_seq_show(struct seq_file *m, void *v) @@ -474,55 +515,55 @@ index 75ebeb1..1271b7c 100644 +LPROC_SEQ_FOPS_RO_TYPE(osp, state); + +static struct lprocfs_seq_vars lprocfs_osp_obd_vars[] = { -+ { .name = "uuid", -+ .fops = &osp_uuid_fops }, -+ { .name = "ping", -+ .fops = &osp_ping_fops, ++ { .name = "uuid", ++ .fops = &osp_uuid_fops }, ++ { .name = "ping", ++ .fops = &osp_ping_fops, + .proc_mode = 0222 }, -+ { .name = "connect_flags", -+ .fops = &osp_connect_flags_fops }, -+ { .name = "ost_server_uuid", -+ .fops = &osp_server_uuid_fops }, -+ { .name = "ost_conn_uuid", -+ .fops = &osp_conn_uuid_fops }, -+ { .name = "active", -+ .fops = &osp_active_fops }, -+ { .name = "max_rpcs_in_flight", -+ .fops = &osp_max_rpcs_in_flight_fops }, -+ { .name = "max_rpcs_in_progress", -+ .fops = &osp_max_rpcs_in_prog_fops }, -+ { .name = "create_count", -+ .fops = &osp_create_count_fops }, -+ { .name = "max_create_count", -+ .fops = &osp_max_create_count_fops }, -+ { .name = "prealloc_next_id", -+ .fops = &osp_prealloc_next_id_fops }, -+ { .name = "prealloc_next_seq", -+ .fops = &osp_prealloc_next_seq_fops }, -+ { .name = "prealloc_last_id", -+ .fops = &osp_prealloc_last_id_fops }, -+ { .name = "prealloc_last_seq", -+ .fops = &osp_prealloc_last_seq_fops }, -+ { .name = "prealloc_reserved", -+ .fops = &osp_prealloc_reserved_fops }, -+ { .name = "timeouts", -+ .fops = &osp_timeouts_fops }, -+ { .name = "import", -+ .fops = &osp_import_fops }, -+ { .name = "state", -+ .fops = &osp_state_fops }, -+ { .name = "maxage", -+ .fops = &osp_maxage_fops }, -+ { .name = "prealloc_status", -+ .fops = &osp_pre_status_fops }, -+ { .name = "sync_changes", -+ .fops = &osp_syn_changes_fops }, -+ { .name = "sync_in_flight", -+ .fops = &osp_syn_in_flight_fops }, -+ { .name = "sync_in_progress", -+ .fops = &osp_syn_in_prog_fops }, -+ { .name = "old_sync_processed", -+ .fops = &osp_old_sync_processed_fops }, ++ { .name = "connect_flags", ++ .fops = &osp_connect_flags_fops }, ++ { .name = "ost_server_uuid", ++ .fops = &osp_server_uuid_fops }, ++ { .name = "ost_conn_uuid", ++ .fops = &osp_conn_uuid_fops }, ++ { .name = "active", ++ .fops = &osp_active_fops }, ++ { .name = "max_rpcs_in_flight", ++ .fops = &osp_max_rpcs_in_flight_fops }, ++ { .name = "max_rpcs_in_progress", ++ .fops = &osp_max_rpcs_in_prog_fops }, ++ { .name = "create_count", ++ .fops = &osp_create_count_fops }, ++ { .name = "max_create_count", ++ .fops = &osp_max_create_count_fops }, ++ { .name = "prealloc_next_id", ++ .fops = &osp_prealloc_next_id_fops }, ++ { .name = "prealloc_next_seq", ++ .fops = &osp_prealloc_next_seq_fops }, ++ { .name = "prealloc_last_id", ++ .fops = &osp_prealloc_last_id_fops }, ++ { .name = "prealloc_last_seq", ++ .fops = &osp_prealloc_last_seq_fops }, ++ { .name = "prealloc_reserved", ++ .fops = &osp_prealloc_reserved_fops }, ++ { .name = "timeouts", ++ .fops = &osp_timeouts_fops }, ++ { .name = "import", ++ .fops = &osp_import_fops }, ++ { .name = "state", ++ .fops = &osp_state_fops }, ++ { .name = "maxage", ++ .fops = &osp_maxage_fops }, ++ { .name = "prealloc_status", ++ .fops = &osp_pre_status_fops }, ++ { .name = "sync_changes", ++ .fops = &osp_syn_changes_fops }, ++ { .name = "sync_in_flight", ++ .fops = &osp_syn_in_flight_fops }, ++ { .name = "sync_in_progress", ++ .fops = &osp_syn_in_prog_fops }, ++ { .name = "old_sync_processed", ++ .fops = &osp_old_sync_processed_fops }, -static struct lprocfs_vars lprocfs_osp_osd_vars[] = { - { "blocksize", lprocfs_dt_rd_blksize, 0, 0 }, @@ -532,8 +573,10 @@ index 75ebeb1..1271b7c 100644 - { "filestotal", lprocfs_dt_rd_filestotal, 0, 0 }, - { "filesfree", lprocfs_dt_rd_filesfree, 0, 0 }, + /* for compatibility reasons */ -+ { .name = "destroys_in_flight", -+ .fops = &osp_destroys_in_flight_fops }, ++ { .name = "destroys_in_flight", ++ .fops = &osp_destroys_in_flight_fops }, ++ { .name = "lfsck_max_rpcs_in_flight", ++ .fops = &osp_lfsck_max_rpcs_in_flight_fops }, { 0 } }; @@ -547,18 +590,18 @@ index 75ebeb1..1271b7c 100644 +LPROC_SEQ_FOPS_RO_TYPE(osp, dt_filesfree); + +static struct lprocfs_seq_vars lprocfs_osp_osd_vars[] = { -+ { .name = "blocksize", -+ .fops = &osp_dt_blksize_fops }, -+ { .name = "kbytestotal", -+ .fops = &osp_dt_kbytestotal_fops }, -+ { .name = "kbytesfree", -+ .fops = &osp_dt_kbytesfree_fops }, -+ { .name = "kbytesavail", -+ .fops = &osp_dt_kbytesavail_fops }, -+ { .name = "filestotal", -+ .fops = &osp_dt_filestotal_fops }, -+ { .name = "filesfree", -+ .fops = &osp_dt_filesfree_fops }, ++ { .name = "blocksize", ++ .fops = &osp_dt_blksize_fops }, ++ { .name = "kbytestotal", ++ .fops = &osp_dt_kbytestotal_fops }, ++ { .name = "kbytesfree", ++ .fops = &osp_dt_kbytesfree_fops }, ++ { .name = "kbytesavail", ++ .fops = &osp_dt_kbytesavail_fops }, ++ { .name = "filestotal", ++ .fops = &osp_dt_filestotal_fops }, ++ { .name = "filesfree", ++ .fops = &osp_dt_filesfree_fops }, { 0 } }; @@ -641,7 +684,7 @@ index 75ebeb1..1271b7c 100644 + "../osp/%s", obd->obd_name); + if (osp->opd_symlink == NULL) + CERROR("could not register OSC symlink for " -+ "/proc/fs/lustre/osp/%s.", obd->obd_name); ++ "/proc/fs/lustre/osp/%s.", obd->obd_name); } #endif /* LPROCFS */ @@ -686,10 +729,10 @@ index a73973a..c115ee6 100644 RETURN(0); diff --git a/lustre/osp/osp_dev.c b/lustre/osp/osp_dev.c -index 60bf8ef..b0c68ad 100644 +index 0a1cafa..27e3011 100644 --- a/lustre/osp/osp_dev.c +++ b/lustre/osp/osp_dev.c -@@ -366,7 +366,7 @@ static int osp_process_config(const struct lu_env *env, +@@ -367,7 +367,7 @@ static int osp_process_config(const struct lu_env *env, struct lu_device *dev, struct lustre_cfg *lcfg) { struct osp_device *d = lu2osp_dev(dev); @@ -698,7 +741,7 @@ index 60bf8ef..b0c68ad 100644 int rc; ENTRY; -@@ -380,11 +380,9 @@ static int osp_process_config(const struct lu_env *env, +@@ -381,11 +381,9 @@ static int osp_process_config(const struct lu_env *env, rc = osp_shutdown(env, d); break; case LCFG_PARAM: @@ -713,7 +756,7 @@ index 60bf8ef..b0c68ad 100644 if (rc > 0) rc = 0; if (rc == -ENOSYS) { -@@ -1238,33 +1236,27 @@ struct llog_operations osp_mds_ost_orig_logops; +@@ -1241,33 +1239,27 @@ struct llog_operations osp_mds_ost_orig_logops; static int __init osp_mod_init(void) { @@ -750,7 +793,7 @@ index 60bf8ef..b0c68ad 100644 #endif LUSTRE_LWP_NAME, &lwp_device_type); if (rc != 0) { -@@ -1284,18 +1276,18 @@ static int __init osp_mod_init(void) +@@ -1287,18 +1279,18 @@ static int __init osp_mod_init(void) return rc; type = class_search_type(LUSTRE_OSP_NAME); @@ -775,10 +818,10 @@ index 60bf8ef..b0c68ad 100644 class_unregister_type(LUSTRE_OSP_NAME); lu_kmem_fini(osp_caches); diff --git a/lustre/osp/osp_internal.h b/lustre/osp/osp_internal.h -index 1291374..66ad203 100644 +index e220914..d8d4a2b 100644 --- a/lustre/osp/osp_internal.h +++ b/lustre/osp/osp_internal.h -@@ -530,7 +530,6 @@ int osp_write_last_oid_seq_files(struct lu_env *env, struct osp_device *osp, +@@ -586,7 +586,6 @@ int osp_write_last_oid_seq_files(struct lu_env *env, struct osp_device *osp, int osp_init_pre_fid(struct osp_device *osp); /* lproc_osp.c */ @@ -786,7 +829,7 @@ index 1291374..66ad203 100644 void osp_lprocfs_init(struct osp_device *osp); /* osp_sync.c */ -@@ -544,7 +543,6 @@ int osp_sync_fini(struct osp_device *d); +@@ -600,7 +599,6 @@ int osp_sync_fini(struct osp_device *d); void __osp_sync_check_for_work(struct osp_device *d); /* lwp_dev.c */ @@ -795,5 +838,5 @@ index 1291374..66ad203 100644 extern struct lu_device_type lwp_device_type; -- -1.9.1 +1.9.3 diff --git a/sys-cluster/lustre/files/0004-LU-3319-procfs-move-lod-proc-handling-to-seq_files.patch b/sys-cluster/lustre/files/0004-LU-3319-procfs-move-lod-proc-handling-to-seq_files.patch index 9b9e0aedc..7ccbf0eea 100644 --- a/sys-cluster/lustre/files/0004-LU-3319-procfs-move-lod-proc-handling-to-seq_files.patch +++ b/sys-cluster/lustre/files/0004-LU-3319-procfs-move-lod-proc-handling-to-seq_files.patch @@ -1,7 +1,7 @@ -From d13a2c80d2a861b1c9fe98e5db3ae1af06a1103a Mon Sep 17 00:00:00 2001 +From e4533607955d7358071e906746eed32e5c25a90f Mon Sep 17 00:00:00 2001 From: James Simmons <uja.ornl@gmail.com> Date: Wed, 26 Mar 2014 19:57:44 -0400 -Subject: [PATCH 4/7] LU-3319 procfs: move lod proc handling to seq_files +Subject: [PATCH 4/8] LU-3319 procfs: move lod proc handling to seq_files With 3.10 linux kernel and above proc handling now only uses struct seq_files. This patch migrates the lod @@ -82,10 +82,10 @@ index 8a6743d..e63c6ed 100644 lu_kmem_fini(lod_caches); } diff --git a/lustre/lod/lod_internal.h b/lustre/lod/lod_internal.h -index c3b1bc3..fc18f3d 100644 +index 4eab8cd..d4928c7 100644 --- a/lustre/lod/lod_internal.h +++ b/lustre/lod/lod_internal.h -@@ -432,7 +432,6 @@ int qos_add_tgt(struct lod_device*, struct lod_tgt_desc *); +@@ -441,7 +441,6 @@ int qos_add_tgt(struct lod_device*, struct lod_tgt_desc *); int qos_del_tgt(struct lod_device *, struct lod_tgt_desc *); /* lproc_lod.c */ @@ -587,5 +587,5 @@ index e976063..1598658 100644 out: -- -1.9.1 +1.9.3 diff --git a/sys-cluster/lustre/files/0005-LU-3319-procfs-move-mdt-mds-proc-handling-to-seq_fil.patch b/sys-cluster/lustre/files/0005-LU-3319-procfs-move-mdt-mds-proc-handling-to-seq_fil.patch index 62919149a..97fa886e2 100644 --- a/sys-cluster/lustre/files/0005-LU-3319-procfs-move-mdt-mds-proc-handling-to-seq_fil.patch +++ b/sys-cluster/lustre/files/0005-LU-3319-procfs-move-mdt-mds-proc-handling-to-seq_fil.patch @@ -1,7 +1,7 @@ -From dfc3f832947083639506d38c032e8b237198fee2 Mon Sep 17 00:00:00 2001 +From 333393612d269600a68c672af1f1848e865f9e20 Mon Sep 17 00:00:00 2001 From: James Simmons <uja.ornl@gmail.com> -Date: Tue, 25 Mar 2014 11:10:33 -0400 -Subject: [PATCH 5/7] LU-3319 procfs: move mdt/mds proc handling to seq_files +Date: Fri, 9 May 2014 16:30:46 -0400 +Subject: [PATCH 5/8] LU-3319 procfs: move mdt/mds proc handling to seq_files With 3.10 linux kernel and above proc handling now only uses struct seq_files. This patch migrates the mdt/mds @@ -10,18 +10,18 @@ layer proc entries over to using seq_files. Signed-off-by: James Simmons <uja.ornl@gmail.com> Change-Id: Icbafdcd2c2fe3959a51dda3f9c715b0ff8d95742 --- - lustre/mdt/mdt_coordinator.c | 269 +++++++--------- + lustre/mdt/mdt_coordinator.c | 269 +++++++------- lustre/mdt/mdt_handler.c | 16 +- lustre/mdt/mdt_hsm_cdt_actions.c | 5 +- lustre/mdt/mdt_hsm_cdt_agent.c | 5 +- lustre/mdt/mdt_hsm_cdt_requests.c | 5 +- lustre/mdt/mdt_internal.h | 14 +- - lustre/mdt/mdt_lproc.c | 659 +++++++++++++++++++------------------- + lustre/mdt/mdt_lproc.c | 713 +++++++++++++++++++------------------- lustre/mdt/mdt_mds.c | 12 +- - 8 files changed, 469 insertions(+), 516 deletions(-) + 8 files changed, 495 insertions(+), 544 deletions(-) diff --git a/lustre/mdt/mdt_coordinator.c b/lustre/mdt/mdt_coordinator.c -index a9ee560..062f6cc 100644 +index 651ed7a..1617eeb 100644 --- a/lustre/mdt/mdt_coordinator.c +++ b/lustre/mdt/mdt_coordinator.c @@ -45,7 +45,7 @@ @@ -127,8 +127,8 @@ index a9ee560..062f6cc 100644 -static int lprocfs_wr_hsm_policy(struct file *file, const char *buffer, - unsigned long count, void *data) +static ssize_t -+mdt_hsm_policy_seq_write(struct file *file, const char *buffer, -+ size_t count, loff_t *off) ++mdt_hsm_policy_seq_write(struct file *file, const char __user *buffer, ++ size_t count, loff_t *off) { - struct mdt_device *mdt = data; + struct seq_file *m = file->private_data; @@ -190,7 +190,7 @@ index a9ee560..062f6cc 100644 -static int lprocfs_wr_hsm_##VAR(struct file *file, const char *buffer, \ - unsigned long count, void *data) \ +static ssize_t \ -+mdt_hsm_##VAR##_seq_write(struct file *file, const char *buffer, \ ++mdt_hsm_##VAR##_seq_write(struct file *file, const char __user *buffer, \ + size_t count, loff_t *off) \ \ { \ @@ -209,14 +209,14 @@ index a9ee560..062f6cc 100644 GENERATE_PROC_METHOD(cdt_loop_period) GENERATE_PROC_METHOD(cdt_grace_delay) -@@ -1983,10 +1959,12 @@ GENERATE_PROC_METHOD(cdt_default_archive_id) - #define CDT_PURGE_CMD "purge" +@@ -1984,10 +1960,12 @@ GENERATE_PROC_METHOD(cdt_default_archive_id) #define CDT_HELP_CMD "help" + #define CDT_MAX_CMD_LEN 10 --int lprocfs_wr_hsm_cdt_control(struct file *file, const char *buffer, +-int lprocfs_wr_hsm_cdt_control(struct file *file, const char __user *buffer, - unsigned long count, void *data) +ssize_t -+mdt_hsm_cdt_control_seq_write(struct file *file, const char *buffer, ++mdt_hsm_cdt_control_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) { - struct obd_device *obd = data; @@ -225,7 +225,7 @@ index a9ee560..062f6cc 100644 struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); struct coordinator *cdt = &(mdt->mdt_coordinator); int rc, usage = 0; -@@ -2040,83 +2018,71 @@ int lprocfs_wr_hsm_cdt_control(struct file *file, const char *buffer, +@@ -2051,83 +2029,71 @@ int lprocfs_wr_hsm_cdt_control(struct file *file, const char __user *buffer, RETURN(count); } @@ -331,7 +331,7 @@ index a9ee560..062f6cc 100644 } static inline enum hsm_copytool_action -@@ -2136,9 +2102,9 @@ hsm_copytool_name2action(const char *name) +@@ -2147,9 +2113,9 @@ hsm_copytool_name2action(const char *name) return -1; } @@ -344,7 +344,7 @@ index a9ee560..062f6cc 100644 { char *buf, *pos, *name; size_t buf_size; -@@ -2182,69 +2148,76 @@ out: +@@ -2193,69 +2159,76 @@ out: RETURN(rc); } @@ -470,10 +470,10 @@ index a9ee560..062f6cc 100644 { 0 } }; diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c -index 329c5fc..3f46d6e 100644 +index 6b0c683..013cea2 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c -@@ -4672,7 +4672,6 @@ static int mdt_process_config(const struct lu_env *env, +@@ -4666,7 +4666,6 @@ static int mdt_process_config(const struct lu_env *env, switch (cfg->lcfg_command) { case LCFG_PARAM: { @@ -481,7 +481,7 @@ index 329c5fc..3f46d6e 100644 struct obd_device *obd = d->ld_obd; /* For interoperability */ -@@ -4707,14 +4706,13 @@ static int mdt_process_config(const struct lu_env *env, +@@ -4701,14 +4700,13 @@ static int mdt_process_config(const struct lu_env *env, } } @@ -501,7 +501,7 @@ index 329c5fc..3f46d6e 100644 if (rc > 0 || rc == -ENOSYS) /* we don't understand; pass it on */ rc = next->ld_ops->ldo_process_config(env, next, -@@ -5913,7 +5911,6 @@ static struct lu_device_type mdt_device_type = { +@@ -5905,7 +5903,6 @@ static struct lu_device_type mdt_device_type = { static int __init mdt_mod_init(void) { @@ -509,7 +509,7 @@ index 329c5fc..3f46d6e 100644 int rc; CLASSERT(sizeof("0x0123456789ABCDEF:0x01234567:0x01234567") == -@@ -5928,10 +5925,9 @@ static int __init mdt_mod_init(void) +@@ -5920,10 +5917,9 @@ static int __init mdt_mod_init(void) if (rc) GOTO(lu_fini, rc); @@ -522,7 +522,7 @@ index 329c5fc..3f46d6e 100644 LUSTRE_MDT_NAME, &mdt_device_type); if (rc) diff --git a/lustre/mdt/mdt_hsm_cdt_actions.c b/lustre/mdt/mdt_hsm_cdt_actions.c -index da7f5a9..49c6b8b 100644 +index 0f5e0fe..6b1acf0 100644 --- a/lustre/mdt/mdt_hsm_cdt_actions.c +++ b/lustre/mdt/mdt_hsm_cdt_actions.c @@ -513,9 +513,6 @@ static int lprocfs_open_hsm_actions(struct inode *inode, struct file *file) @@ -587,10 +587,10 @@ index 1300861..3125dcc 100644 RETURN(rc); } diff --git a/lustre/mdt/mdt_internal.h b/lustre/mdt/mdt_internal.h -index 5b8cea1..cb52ef4 100644 +index 116d98f..d1a3b66 100644 --- a/lustre/mdt/mdt_internal.h +++ b/lustre/mdt/mdt_internal.h -@@ -759,9 +759,6 @@ void mdt_thread_info_init(struct ptlrpc_request *req, +@@ -756,9 +756,6 @@ void mdt_thread_info_init(struct ptlrpc_request *req, void mdt_thread_info_fini(struct mdt_thread_info *mti); struct mdt_thread_info *tsi2mdt_info(struct tgt_session_info *tsi); @@ -600,7 +600,7 @@ index 5b8cea1..cb52ef4 100644 int mdt_hsm_attr_set(struct mdt_thread_info *info, struct mdt_object *obj, const struct md_hsm *mh); -@@ -899,13 +896,12 @@ int mdt_hsm_cdt_fini(struct mdt_device *mdt); +@@ -896,13 +893,12 @@ int mdt_hsm_cdt_fini(struct mdt_device *mdt); int mdt_hsm_cdt_wakeup(struct mdt_device *mdt); /* coordinator control /proc interface */ @@ -618,7 +618,7 @@ index 5b8cea1..cb52ef4 100644 /* md_hsm helpers */ struct mdt_object *mdt_hsm_get_md_hsm(struct mdt_thread_info *mti, const struct lu_fid *fid, -@@ -1045,8 +1041,6 @@ enum { +@@ -1042,8 +1038,6 @@ enum { }; void mdt_counter_incr(struct ptlrpc_request *req, int opcode); void mdt_stats_counter_init(struct lprocfs_stats *stats); @@ -628,10 +628,22 @@ index 5b8cea1..cb52ef4 100644 void mdt_procfs_fini(struct mdt_device *mdt); diff --git a/lustre/mdt/mdt_lproc.c b/lustre/mdt/mdt_lproc.c -index 0ee5148..a895d57 100644 +index 70eba85..ff7a260 100644 --- a/lustre/mdt/mdt_lproc.c +++ b/lustre/mdt/mdt_lproc.c -@@ -156,7 +156,6 @@ static ssize_t mdt_rename_stats_seq_write(struct file *file, const char *buf, +@@ -144,8 +144,9 @@ static int mdt_rename_stats_seq_show(struct seq_file *seq, void *v) + return 0; + } + +-static ssize_t mdt_rename_stats_seq_write(struct file *file, const char *buf, +- size_t len, loff_t *off) ++static ssize_t ++mdt_rename_stats_seq_write(struct file *file, const char __user *buf, ++ size_t len, loff_t *off) + { + struct seq_file *seq = file->private_data; + struct mdt_device *mdt = seq->private; +@@ -156,7 +157,6 @@ static ssize_t mdt_rename_stats_seq_write(struct file *file, const char *buf, return len; } @@ -639,12 +651,13 @@ index 0ee5148..a895d57 100644 LPROC_SEQ_FOPS(mdt_rename_stats); static int lproc_mdt_attach_rename_seqstat(struct mdt_device *mdt) -@@ -213,143 +212,76 @@ void mdt_rename_counter_tally(struct mdt_thread_info *info, +@@ -213,145 +213,77 @@ void mdt_rename_counter_tally(struct mdt_thread_info *info, (unsigned int)ma->ma_attr.la_size); } -int mdt_procfs_init(struct mdt_device *mdt, const char *name) --{ ++static int mdt_identity_expire_seq_show(struct seq_file *m, void *data) + { - struct obd_device *obd = mdt2obd_dev(mdt); - struct lprocfs_static_vars lvars; - int rc; @@ -685,31 +698,47 @@ index 0ee5148..a895d57 100644 - if (rc) - CERROR("%s: MDT can not create rename stats rc = %d\n", - mdt_obd_name(mdt), rc); -- ++ struct obd_device *obd = m->private; ++ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); + - RETURN(rc); --} -- ++ return seq_printf(m, "%u\n", mdt->mdt_identity_cache->uc_entry_expire); + } + -void mdt_procfs_fini(struct mdt_device *mdt) -+static int mdt_identity_expire_seq_show(struct seq_file *m, void *data) ++static ssize_t ++mdt_identity_expire_seq_write(struct file *file, const char __user *buffer, ++ size_t count, loff_t *off) { - struct obd_device *obd = mdt2obd_dev(mdt); -- ++ struct seq_file *m = file->private_data; ++ struct obd_device *obd = m->private; ++ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); ++ int rc, val; + - if (obd->obd_proc_exports_entry != NULL) { - lprocfs_remove_proc_entry("clear", obd->obd_proc_exports_entry); - obd->obd_proc_exports_entry = NULL; - } -- ++ rc = lprocfs_write_helper(buffer, count, &val); ++ if (rc) ++ return rc; + - lprocfs_free_per_client_stats(obd); - hsm_cdt_procfs_fini(mdt); - lprocfs_obd_cleanup(obd); - lprocfs_free_md_stats(obd); - lprocfs_free_obd_stats(obd); - lprocfs_job_stats_fini(obd); --} -- ++ mdt->mdt_identity_cache->uc_entry_expire = val; ++ return count; + } ++LPROC_SEQ_FOPS(mdt_identity_expire); + -static int lprocfs_rd_identity_expire(char *page, char **start, off_t off, - int count, int *eof, void *data) --{ ++static int mdt_identity_acquire_expire_seq_show(struct seq_file *m, void *data) + { - struct obd_device *obd = data; - struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); + struct obd_device *obd = m->private; @@ -718,61 +747,45 @@ index 0ee5148..a895d57 100644 - *eof = 1; - return snprintf(page, count, "%u\n", - mdt->mdt_identity_cache->uc_entry_expire); -+ return seq_printf(m, "%u\n", mdt->mdt_identity_cache->uc_entry_expire); ++ return seq_printf(m, "%u\n", mdt->mdt_identity_cache->uc_acquire_expire); } --static int lprocfs_wr_identity_expire(struct file *file, const char *buffer, -- unsigned long count, void *data) +-static int lprocfs_wr_identity_expire(struct file *file, +static ssize_t -+mdt_identity_expire_seq_write(struct file *file, const char *buffer, -+ size_t count, loff_t *off) - { ++mdt_identity_acquire_expire_seq_write(struct file *file, + const char __user *buffer, +- unsigned long count, void *data) +-{ - struct obd_device *obd = data; - struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); - int rc, val; -+ struct seq_file *m = file->private_data; -+ struct obd_device *obd = m->private; -+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); -+ int rc, val; - +- - rc = lprocfs_write_helper(buffer, count, &val); - if (rc) - return rc; -+ rc = lprocfs_write_helper(buffer, count, &val); -+ if (rc) -+ return rc; - +- - mdt->mdt_identity_cache->uc_entry_expire = val; - return count; -+ mdt->mdt_identity_cache->uc_entry_expire = val; -+ return count; - } -+LPROC_SEQ_FOPS(mdt_identity_expire); - +-} +- -static int lprocfs_rd_identity_acquire_expire(char *page, char **start, - off_t off, int count, int *eof, - void *data) -+static int mdt_identity_acquire_expire_seq_show(struct seq_file *m, void *data) ++ size_t count, loff_t *off) { - struct obd_device *obd = data; - struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); -+ struct obd_device *obd = m->private; -+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); - +- - *eof = 1; - return snprintf(page, count, "%u\n", - mdt->mdt_identity_cache->uc_acquire_expire); -+ return seq_printf(m, "%u\n", mdt->mdt_identity_cache->uc_acquire_expire); - } - +-} +- -static int lprocfs_wr_identity_acquire_expire(struct file *file, -- const char *buffer, -- unsigned long count, -- void *data) -+static ssize_t -+mdt_identity_acquire_expire_seq_write(struct file *file, const char *buffer, -+ size_t count, loff_t *off) - { +- const char __user *buffer, +- unsigned long count, +- void *data) +-{ - struct obd_device *obd = data; - struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); - int rc, val; @@ -816,11 +829,12 @@ index 0ee5148..a895d57 100644 + return 0; } --static int lprocfs_wr_identity_upcall(struct file *file, const char *buffer, +-static int lprocfs_wr_identity_upcall(struct file *file, +- const char __user *buffer, - unsigned long count, void *data) +static ssize_t -+mdt_identity_upcall_seq_write(struct file *file, const char *buffer, -+ size_t count, loff_t *off) ++mdt_identity_upcall_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; @@ -828,34 +842,46 @@ index 0ee5148..a895d57 100644 struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); struct upcall_cache *hash = mdt->mdt_identity_cache; int rc; -@@ -388,11 +320,14 @@ static int lprocfs_wr_identity_upcall(struct file *file, const char *buffer, +@@ -390,28 +322,32 @@ static int lprocfs_wr_identity_upcall(struct file *file, OBD_FREE(kernbuf, count + 1); RETURN(rc); } +LPROC_SEQ_FOPS(mdt_identity_upcall); --static int lprocfs_wr_identity_flush(struct file *file, const char *buffer, -- unsigned long count, void *data) +-static int lprocfs_wr_identity_flush(struct file *file, +- const char __user *buffer, +- unsigned long count, void *data) +static ssize_t -+lprocfs_identity_flush_seq_write(struct file *file, const char *buffer, ++lprocfs_identity_flush_seq_write(struct file *file, const char __user *buffer, + size_t count, void *data) { - struct obd_device *obd = data; -+ struct seq_file *m = file->private_data; +- struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); +- int rc, uid; ++ struct seq_file *m = file->private_data; + struct obd_device *obd = m->private; - struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); - int rc, uid; ++ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); ++ int rc, uid; -@@ -403,11 +338,14 @@ static int lprocfs_wr_identity_flush(struct file *file, const char *buffer, - mdt_flush_identity(mdt->mdt_identity_cache, uid); - return count; +- rc = lprocfs_write_helper(buffer, count, &uid); +- if (rc) +- return rc; ++ rc = lprocfs_write_helper(buffer, count, &uid); ++ if (rc) ++ return rc; + +- mdt_flush_identity(mdt->mdt_identity_cache, uid); +- return count; ++ mdt_flush_identity(mdt->mdt_identity_cache, uid); ++ return count; } +LPROC_SEQ_FOPS_WO_TYPE(mdt, identity_flush); --static int lprocfs_wr_identity_info(struct file *file, const char *buffer, +-static int lprocfs_wr_identity_info(struct file *file, +- const char __user *buffer, - unsigned long count, void *data) +static ssize_t -+lprocfs_identity_info_seq_write(struct file *file, const char *buffer, ++lprocfs_identity_info_seq_write(struct file *file, const char __user *buffer, + size_t count, void *data) { - struct obd_device *obd = data; @@ -864,7 +890,7 @@ index 0ee5148..a895d57 100644 struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); struct identity_downcall_data *param; int size = sizeof(*param), rc, checked = 0; -@@ -415,7 +353,7 @@ static int lprocfs_wr_identity_info(struct file *file, const char *buffer, +@@ -419,7 +355,7 @@ static int lprocfs_wr_identity_info(struct file *file, again: if (count < size) { CERROR("%s: invalid data count = %lu, size = %d\n", @@ -873,7 +899,7 @@ index 0ee5148..a895d57 100644 return -EINVAL; } -@@ -468,23 +406,25 @@ out: +@@ -472,23 +408,25 @@ out: return rc ? rc : count; } @@ -889,24 +915,26 @@ index 0ee5148..a895d57 100644 struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); - return snprintf(page, count, "capability on: %s %s\n", +- mdt->mdt_lut.lut_oss_capa ? "oss" : "", +- mdt->mdt_lut.lut_mds_capa ? "mds" : ""); + return seq_printf(m, "capability on: %s %s\n", - mdt->mdt_lut.lut_oss_capa ? "oss" : "", - mdt->mdt_lut.lut_mds_capa ? "mds" : ""); ++ mdt->mdt_lut.lut_oss_capa ? "oss" : "", ++ mdt->mdt_lut.lut_mds_capa ? "mds" : ""); } --static int lprocfs_wr_capa(struct file *file, const char *buffer, +-static int lprocfs_wr_capa(struct file *file, const char __user *buffer, - unsigned long count, void *data) +static ssize_t -+mdt_capa_seq_write(struct file *file, const char *buffer, -+ size_t count, loff_t *off) ++mdt_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 seq_file *m = file->private_data; + struct obd_device *obd = m->private; struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); int val, rc; -@@ -521,64 +461,67 @@ static int lprocfs_wr_capa(struct file *file, const char *buffer, +@@ -525,82 +463,87 @@ static int lprocfs_wr_capa(struct file *file, const char __user *buffer, mdt->mdt_lut.lut_oss_capa ? "enabled" : "disabled"); return count; } @@ -951,16 +979,16 @@ index 0ee5148..a895d57 100644 + return seq_printf(m, "%lu\n", mdt->mdt_capa_timeout); } --static int lprocfs_wr_capa_timeout(struct file *file, const char *buffer, -- unsigned long count, void *data) +-static int lprocfs_wr_capa_timeout(struct file *file, const char __user *buffer, +- unsigned long count, void *data) +static ssize_t -+mdt_capa_timeout_seq_write(struct file *file, const char *buffer, ++mdt_capa_timeout_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) { - struct obd_device *obd = data; - struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); - int val, rc; -+ struct seq_file *m = file->private_data; ++ struct seq_file *m = file->private_data; + struct obd_device *obd = m->private; + struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); + int val, rc; @@ -994,39 +1022,54 @@ index 0ee5148..a895d57 100644 + return seq_printf(m, "%lu\n", mdt->mdt_ck_timeout); } --static int lprocfs_wr_ck_timeout(struct file *file, const char *buffer, -- unsigned long count, void *data) +-static int lprocfs_wr_ck_timeout(struct file *file, const char __user *buffer, +- unsigned long count, void *data) +static ssize_t -+mdt_ck_timeout_seq_write(struct file *file, const char *buffer, ++mdt_ck_timeout_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) { - struct obd_device *obd = data; - struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); - int val, rc; -+ struct seq_file *m = file->private_data; -+ struct obd_device *obd = m->private; -+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); ++ struct seq_file *m = file->private_data; ++ struct obd_device *obd = m->private; ++ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); + int val, rc; - rc = lprocfs_write_helper(buffer, count, &val); - if (rc) -@@ -588,11 +531,13 @@ static int lprocfs_wr_ck_timeout(struct file *file, const char *buffer, - mdt->mdt_capa_conf = 1; - return count; +- rc = lprocfs_write_helper(buffer, count, &val); +- if (rc) +- return rc; ++ rc = lprocfs_write_helper(buffer, count, &val); ++ if (rc) ++ return rc; + +- mdt->mdt_ck_timeout = (unsigned long)val; +- mdt->mdt_capa_conf = 1; +- return count; ++ mdt->mdt_ck_timeout = (unsigned long)val; ++ mdt->mdt_capa_conf = 1; ++ return count; } +LPROC_SEQ_FOPS(mdt_ck_timeout); #define BUFLEN (UUID_MAX + 4) --static int lprocfs_mdt_wr_evict_client(struct file *file, const char *buffer, -- unsigned long count, void *data) +-static int lprocfs_mdt_wr_evict_client(struct file *file, +- const char __user *buffer, +- unsigned long count, void *data) +static ssize_t -+lprocfs_mds_evict_client_seq_write(struct file *file, const char *buffer, ++lprocfs_mds_evict_client_seq_write(struct file *file, ++ const char __user *buffer, + size_t count, loff_t *off) { - char *kbuf; - char *tmpbuf; -@@ -614,7 +559,8 @@ static int lprocfs_mdt_wr_evict_client(struct file *file, const char *buffer, +- char *kbuf; +- char *tmpbuf; ++ char *kbuf; ++ char *tmpbuf; + + OBD_ALLOC(kbuf, BUFLEN); + if (kbuf == NULL) +@@ -619,7 +562,8 @@ static int lprocfs_mdt_wr_evict_client(struct file *file, tmpbuf = cfs_firststr(kbuf, min_t(unsigned long, BUFLEN - 1, count)); if (strncmp(tmpbuf, "nid:", 4) != 0) { @@ -1036,7 +1079,7 @@ index 0ee5148..a895d57 100644 goto out; } -@@ -627,21 +573,22 @@ out: +@@ -632,21 +576,22 @@ out: #undef BUFLEN @@ -1053,23 +1096,23 @@ index 0ee5148..a895d57 100644 + return seq_printf(m, "%d\n", mdt->mdt_lut.lut_sec_level); } --static int lprocfs_wr_sec_level(struct file *file, const char *buffer, -- unsigned long count, void *data) +-static int lprocfs_wr_sec_level(struct file *file, const char __user *buffer, +- unsigned long count, void *data) +static ssize_t -+mdt_sec_level_seq_write(struct file *file, const char *buffer, ++mdt_sec_level_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) { - struct obd_device *obd = data; - struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); - int val, rc; -+ struct seq_file *m = file->private_data; -+ struct obd_device *obd = m->private; -+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); ++ struct seq_file *m = file->private_data; ++ struct obd_device *obd = m->private; ++ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); + int val, rc; rc = lprocfs_write_helper(buffer, count, &val); if (rc) -@@ -659,22 +606,24 @@ static int lprocfs_wr_sec_level(struct file *file, const char *buffer, +@@ -664,102 +609,110 @@ static int lprocfs_wr_sec_level(struct file *file, const char __user *buffer, mdt->mdt_lut.lut_sec_level = val; return count; } @@ -1088,102 +1131,108 @@ index 0ee5148..a895d57 100644 + return seq_printf(m, "%u\n", mdt_cos_is_enabled(mdt)); } --static int lprocfs_wr_cos(struct file *file, const char *buffer, -- unsigned long count, void *data) +-static int lprocfs_wr_cos(struct file *file, const char __user *buffer, +- unsigned long count, void *data) +static ssize_t -+mdt_cos_seq_write(struct file *file, const char *buffer, ++mdt_cos_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) { - struct obd_device *obd = data; - struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); - int val, rc; -+ struct seq_file *m = file->private_data; -+ struct obd_device *obd = m->private; -+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); ++ struct seq_file *m = file->private_data; ++ struct obd_device *obd = m->private; ++ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); + int val, rc; - rc = lprocfs_write_helper(buffer, count, &val); - if (rc) -@@ -682,15 +631,15 @@ static int lprocfs_wr_cos(struct file *file, const char *buffer, - mdt_enable_cos(mdt, val); - return count; +- rc = lprocfs_write_helper(buffer, count, &val); +- if (rc) +- return rc; +- mdt_enable_cos(mdt, val); +- return count; ++ rc = lprocfs_write_helper(buffer, count, &val); ++ if (rc) ++ return rc; ++ mdt_enable_cos(mdt, val); ++ return count; } +LPROC_SEQ_FOPS(mdt_cos); --static int lprocfs_rd_root_squash(char *page, char **start, off_t off, -- int count, int *eof, void *data) +-static int lprocfs_rd_mdt_root_squash(char *page, char **start, off_t off, +- int count, int *eof, void *data) +static int mdt_root_squash_seq_show(struct seq_file *m, void *data) { -- struct obd_device *obd = data; -- struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); +- struct obd_device *obd = data; + struct obd_device *obd = m->private; -+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); - -- return snprintf(page, count, "%u:%u\n", mdt->mdt_squash_uid, -- mdt->mdt_squash_gid); -+ return seq_printf(m, "%u:%u\n", mdt->mdt_squash_uid, -+ mdt->mdt_squash_gid); - } + struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); + struct root_squash_info *squash = &mdt->mdt_squash; - static int safe_strtoul(const char *str, char **endp, unsigned long *res) -@@ -708,11 +657,13 @@ static int safe_strtoul(const char *str, char **endp, unsigned long *res) - return 0; +- return snprintf(page, count, "%u:%u\n", squash->rsi_uid, +- squash->rsi_gid); ++ return seq_printf(m, "%u:%u\n", squash->rsi_uid, ++ squash->rsi_gid); } --static int lprocfs_wr_root_squash(struct file *file, const char *buffer, -- unsigned long count, void *data) +-static int lprocfs_wr_mdt_root_squash(struct file *file, +- const char __user *buffer, +- unsigned long count, void *data) +static ssize_t -+mdt_root_squash_seq_write(struct file *file, const char *buffer, ++mdt_root_squash_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) { - struct obd_device *obd = data; -- struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); -+ struct seq_file *m = file->private_data; -+ struct obd_device *obd = m->private; -+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); - int rc; - char kernbuf[50], *tmp, *end, *errmsg; - unsigned long uid, gid; -@@ -765,23 +716,25 @@ failed: - mdt_obd_name(mdt), buffer, errmsg, rc); - RETURN(rc); ++ struct seq_file *m = file->private_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; + + return lprocfs_wr_root_squash(buffer, count, squash, + mdt_obd_name(mdt)); } +LPROC_SEQ_FOPS(mdt_root_squash); --static int lprocfs_rd_nosquash_nids(char *page, char **start, off_t off, -- int count, int *eof, void *data) +-static int lprocfs_rd_mdt_nosquash_nids(char *page, char **start, off_t off, +- int count, int *eof, void *data) +static int mdt_nosquash_nids_seq_show(struct seq_file *m, void *data) { -- struct obd_device *obd = data; -- struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); +- struct obd_device *obd = data; + struct obd_device *obd = m->private; -+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); - -- if (mdt->mdt_nosquash_str) -- return snprintf(page, count, "%s\n", mdt->mdt_nosquash_str); -- return snprintf(page, count, "NONE\n"); -+ if (mdt->mdt_nosquash_str) -+ return seq_printf(m, "%s\n", mdt->mdt_nosquash_str); -+ return seq_printf(m, "NONE\n"); + struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); + struct root_squash_info *squash = &mdt->mdt_squash; +- int rc; ++ int len = 0, rc; + + down_read(&squash->rsi_sem); + if (!list_empty(&squash->rsi_nosquash_nids)) { +- rc = cfs_print_nidlist(page, count, &squash->rsi_nosquash_nids); +- rc += snprintf(page + rc, count - rc, "\n"); ++ len = cfs_print_nidlist(m->buf + m->count, m->size - m->count, ++ &squash->rsi_nosquash_nids); ++ m->count += len; ++ rc = seq_printf(m, "\n"); + } else +- rc = snprintf(page, count, "NONE\n"); ++ rc = seq_printf(m, "NONE\n"); + up_read(&squash->rsi_sem); + + return rc; } --static int lprocfs_wr_nosquash_nids(struct file *file, const char *buffer, -- unsigned long count, void *data) +-static int lprocfs_wr_mdt_nosquash_nids(struct file *file, +- const char __user *buffer, +- unsigned long count, void *data) +static ssize_t -+mdt_nosquash_nids_seq_write(struct file *file, const char *buffer, ++mdt_nosquash_nids_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) { - struct obd_device *obd = data; -- struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); -+ struct seq_file *m = file->private_data; -+ struct obd_device *obd = m->private; -+ struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); - int rc; - char *kernbuf, *errmsg; - cfs_list_t tmp; -@@ -842,25 +795,27 @@ failed: - OBD_FREE(kernbuf, count + 1); - RETURN(rc); ++ struct seq_file *m = file->private_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; + + return lprocfs_wr_nosquash_nids(buffer, count, squash, + mdt_obd_name(mdt)); } +LPROC_SEQ_FOPS(mdt_nosquash_nids); @@ -1202,10 +1251,10 @@ index 0ee5148..a895d57 100644 + mdt->mdt_som_conf ? "en" : "dis"); } --static int lprocfs_wr_mdt_som(struct file *file, const char *buffer, -- unsigned long count, void *data) +-static int lprocfs_wr_mdt_som(struct file *file, const char __user *buffer, +- unsigned long count, void *data) +static ssize_t -+mdt_som_seq_write(struct file *file, const char *buffer, ++mdt_som_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) { - struct obd_export *exp; @@ -1222,7 +1271,7 @@ index 0ee5148..a895d57 100644 if (count > (sizeof(kernbuf) - 1)) return -EINVAL; -@@ -902,20 +857,22 @@ static int lprocfs_wr_mdt_som(struct file *file, const char *buffer, +@@ -801,21 +754,22 @@ static int lprocfs_wr_mdt_som(struct file *file, const char __user *buffer, return count; } @@ -1240,19 +1289,20 @@ index 0ee5148..a895d57 100644 + return seq_printf(m, "%u\n", mdt->mdt_enable_remote_dir); } --static int lprocfs_wr_enable_remote_dir(struct file *file, const char *buffer, +-static int lprocfs_wr_enable_remote_dir(struct file *file, +- const char __user *buffer, - unsigned long count, void *data) +static ssize_t -+mdt_enable_remote_dir_seq_write(struct file *file, const char *buffer, ++mdt_enable_remote_dir_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 seq_file *m = file->private_data; + struct obd_device *obd = m->private; struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); __u32 val; int rc; -@@ -930,22 +887,23 @@ static int lprocfs_wr_enable_remote_dir(struct file *file, const char *buffer, +@@ -830,22 +784,24 @@ static int lprocfs_wr_enable_remote_dir(struct file *file, mdt->mdt_enable_remote_dir = val; return count; } @@ -1273,19 +1323,20 @@ index 0ee5148..a895d57 100644 } -static int lprocfs_wr_enable_remote_dir_gid(struct file *file, -- const char *buffer, +- const char __user *buffer, - unsigned long count, void *data) +static ssize_t -+mdt_enable_remote_dir_gid_seq_write(struct file *file, const char *buffer, ++mdt_enable_remote_dir_gid_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 seq_file *m = file->private_data; + struct obd_device *obd = m->private; struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); __u32 val; int rc; -@@ -957,97 +915,72 @@ static int lprocfs_wr_enable_remote_dir_gid(struct file *file, +@@ -857,97 +813,72 @@ static int lprocfs_wr_enable_remote_dir_gid(struct file *file, mdt->mdt_enable_remote_dir_gid = val; return count; } @@ -1332,11 +1383,11 @@ index 0ee5148..a895d57 100644 - NULL, NULL, 0 }, - { "commit_on_sharing", lprocfs_rd_cos, lprocfs_wr_cos, - NULL, NULL, 0 }, -- { "root_squash", lprocfs_rd_root_squash, -- lprocfs_wr_root_squash, +- { "root_squash", lprocfs_rd_mdt_root_squash, +- lprocfs_wr_mdt_root_squash, - NULL, NULL, 0 }, -- { "nosquash_nids", lprocfs_rd_nosquash_nids, -- lprocfs_wr_nosquash_nids, +- { "nosquash_nids", lprocfs_rd_mdt_nosquash_nids, +- lprocfs_wr_mdt_nosquash_nids, - NULL, NULL, 0 }, - { "som", lprocfs_rd_mdt_som, - lprocfs_wr_mdt_som, @@ -1394,62 +1445,62 @@ index 0ee5148..a895d57 100644 +LPROC_SEQ_FOPS(mdt_hsm_cdt_control); + +static struct lprocfs_seq_vars lprocfs_mdt_obd_vars[] = { -+ { .name = "uuid", -+ .fops = &mdt_uuid_fops }, -+ { .name = "recovery_status", -+ .fops = &mdt_recovery_status_fops }, -+ { .name = "num_exports", -+ .fops = &mdt_num_exports_fops }, -+ { .name = "identity_expire", -+ .fops = &mdt_identity_expire_fops }, -+ { .name = "identity_acquire_expire", -+ .fops = &mdt_identity_acquire_expire_fops }, -+ { .name = "identity_upcall", -+ .fops = &mdt_identity_upcall_fops }, -+ { .name = "identity_flush", -+ .fops = &mdt_identity_flush_fops }, -+ { .name = "identity_info", -+ .fops = &mdt_identity_info_fops }, -+ { .name = "capa", -+ .fops = &mdt_capa_fops }, -+ { .name = "capa_timeout", -+ .fops = &mdt_capa_timeout_fops }, -+ { .name = "capa_key_timeout", -+ .fops = &mdt_ck_timeout_fops }, -+ { .name = "capa_count", -+ .fops = &mdt_capa_count_fops }, -+ { .name = "site_stats", -+ .fops = &mdt_site_stats_fops }, -+ { .name = "evict_client", -+ .fops = &mdt_mds_evict_client_fops }, -+ { .name = "hash_stats", -+ .fops = &mdt_hash_fops }, -+ { .name = "sec_level", -+ .fops = &mdt_sec_level_fops }, -+ { .name = "commit_on_sharing", -+ .fops = &mdt_cos_fops }, -+ { .name = "root_squash", -+ .fops = &mdt_root_squash_fops }, -+ { .name = "nosquash_nids", -+ .fops = &mdt_nosquash_nids_fops }, -+ { .name = "som", -+ .fops = &mdt_som_fops }, -+ { .name = "instance", -+ .fops = &mdt_target_instance_fops }, -+ { .name = "ir_factor", -+ .fops = &mdt_ir_factor_fops }, -+ { .name = "job_cleanup_interval", -+ .fops = &mdt_job_interval_fops }, -+ { .name = "enable_remote_dir", -+ .fops = &mdt_enable_remote_dir_fops }, -+ { .name = "enable_remote_dir_gid", -+ .fops = &mdt_enable_remote_dir_gid_fops }, -+ { .name = "hsm_control", -+ .fops = &mdt_hsm_cdt_control_fops }, ++ { .name = "uuid", ++ .fops = &mdt_uuid_fops }, ++ { .name = "recovery_status", ++ .fops = &mdt_recovery_status_fops }, ++ { .name = "num_exports", ++ .fops = &mdt_num_exports_fops }, ++ { .name = "identity_expire", ++ .fops = &mdt_identity_expire_fops }, ++ { .name = "identity_acquire_expire", ++ .fops = &mdt_identity_acquire_expire_fops }, ++ { .name = "identity_upcall", ++ .fops = &mdt_identity_upcall_fops }, ++ { .name = "identity_flush", ++ .fops = &mdt_identity_flush_fops }, ++ { .name = "identity_info", ++ .fops = &mdt_identity_info_fops }, ++ { .name = "capa", ++ .fops = &mdt_capa_fops }, ++ { .name = "capa_timeout", ++ .fops = &mdt_capa_timeout_fops }, ++ { .name = "capa_key_timeout", ++ .fops = &mdt_ck_timeout_fops }, ++ { .name = "capa_count", ++ .fops = &mdt_capa_count_fops }, ++ { .name = "site_stats", ++ .fops = &mdt_site_stats_fops }, ++ { .name = "evict_client", ++ .fops = &mdt_mds_evict_client_fops }, ++ { .name = "hash_stats", ++ .fops = &mdt_hash_fops }, ++ { .name = "sec_level", ++ .fops = &mdt_sec_level_fops }, ++ { .name = "commit_on_sharing", ++ .fops = &mdt_cos_fops }, ++ { .name = "root_squash", ++ .fops = &mdt_root_squash_fops }, ++ { .name = "nosquash_nids", ++ .fops = &mdt_nosquash_nids_fops }, ++ { .name = "som", ++ .fops = &mdt_som_fops }, ++ { .name = "instance", ++ .fops = &mdt_target_instance_fops }, ++ { .name = "ir_factor", ++ .fops = &mdt_ir_factor_fops }, ++ { .name = "job_cleanup_interval", ++ .fops = &mdt_job_interval_fops }, ++ { .name = "enable_remote_dir", ++ .fops = &mdt_enable_remote_dir_fops }, ++ { .name = "enable_remote_dir_gid", ++ .fops = &mdt_enable_remote_dir_gid_fops }, ++ { .name = "hsm_control", ++ .fops = &mdt_hsm_cdt_control_fops }, { 0 } }; -@@ -1085,21 +1018,15 @@ int lprocfs_mdt_open_files_seq_show(struct seq_file *seq, void *v) +@@ -985,21 +916,15 @@ int lprocfs_mdt_open_files_seq_show(struct seq_file *seq, void *v) int lprocfs_mdt_open_files_seq_open(struct inode *inode, struct file *file) { @@ -1472,7 +1523,7 @@ index 0ee5148..a895d57 100644 return 0; } -@@ -1140,3 +1067,67 @@ void mdt_stats_counter_init(struct lprocfs_stats *stats) +@@ -1040,3 +965,67 @@ void mdt_stats_counter_init(struct lprocfs_stats *stats) lprocfs_counter_init(stats, LPROC_MDT_CROSSDIR_RENAME, 0, "crossdir_rename", "reqs"); } @@ -1489,14 +1540,14 @@ index 0ee5148..a895d57 100644 + rc = lprocfs_seq_obd_setup(obd); + if (rc) { + CERROR("%s: cannot create proc entries: rc = %d\n", -+ mdt_obd_name(mdt), rc); ++ mdt_obd_name(mdt), rc); + return rc; + } + + rc = hsm_cdt_procfs_init(mdt); + if (rc) { + CERROR("%s: cannot create hsm proc entries: rc = %d\n", -+ mdt_obd_name(mdt), rc); ++ mdt_obd_name(mdt), rc); + return rc; + } + @@ -1578,5 +1629,5 @@ index 390164f..424ddf5 100644 LUSTRE_MDS_NAME, &mds_device_type); } -- -1.9.1 +1.9.3 diff --git a/sys-cluster/lustre/files/0006-LU-2096-lprocfs-symlinks-for-forward-compatibility.patch b/sys-cluster/lustre/files/0006-LU-2096-lprocfs-symlinks-for-forward-compatibility.patch new file mode 100644 index 000000000..ae7ef779d --- /dev/null +++ b/sys-cluster/lustre/files/0006-LU-2096-lprocfs-symlinks-for-forward-compatibility.patch @@ -0,0 +1,199 @@ +From c12b96a679cfc5132b68e61c38e7756b9d02a59c Mon Sep 17 00:00:00 2001 +From: Andreas Dilger <andreas.dilger@intel.com> +Date: Tue, 6 May 2014 09:51:45 -0400 +Subject: [PATCH 6/8] LU-2096 lprocfs: symlinks for forward compatibility + +Currently, the "ofd" device is still named "obdfilter" in the Lustre +configuration and in /proc/fs/lustre. It would be better to name it +"ost" which is has been the long term goal but retain the "ofd" +module name. + +The per-OST device statistics should really be under "ost/{target}", +like the per-MDT statistics are under "mdt/{target}" already in 2.x. + +Similarly, the "OSS" statistics have always been under "ost/OSS", but +would be better in their own "oss" subdirectory much like what is done +for "MDS" statistics. + +Add symlinks in lprocfs for "ost/OSS -> oss", "obdfilter -> ofd -> ost", +and "obdfilter/{target} -> ost/{target}" for forward compatibility so +that when we finally are able to make these changes to the module names +userspace tools and scripts can have a smoother transition between +Lustre versions. + +Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> +Signed-off-by: John L. Hammond <john.hammond@intel.com> +Signed-off-by: James Simmons <uja.ornl@gmail.com> +Change-Id: Ia0835e39aba7c8a540a6247bd3d56bc14e500c1e +Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org> +--- + lustre/include/obd.h | 4 ++-- + lustre/mgs/mgs_llog.c | 4 ++-- + lustre/obdclass/genops.c | 2 +- + lustre/ofd/ofd_dev.c | 32 +++++++++++++++++++++++++++++++- + lustre/ofd/ofd_internal.h | 2 ++ + lustre/ost/ost_handler.c | 12 +++++++++++- + 6 files changed, 49 insertions(+), 7 deletions(-) + +diff --git a/lustre/include/obd.h b/lustre/include/obd.h +index b161c115..78b5563 100644 +--- a/lustre/include/obd.h ++++ b/lustre/include/obd.h +@@ -516,8 +516,8 @@ struct niobuf_local { + #define LUSTRE_MDS_NAME "mds" + #define LUSTRE_MDT_NAME "mdt" + #define LUSTRE_MDC_NAME "mdc" +-#define LUSTRE_OSS_NAME "ost" /* FIXME change name to oss */ +-#define LUSTRE_OST_NAME "obdfilter" /* FIXME change name to ost */ ++#define LUSTRE_OSS_NAME "oss" ++#define LUSTRE_OST_NAME "ost" + #define LUSTRE_OSC_NAME "osc" + #define LUSTRE_LOV_NAME "lov" + #define LUSTRE_MGS_NAME "mgs" +diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c +index 55ffe90..c19ba7b4 100644 +--- a/lustre/mgs/mgs_llog.c ++++ b/lustre/mgs/mgs_llog.c +@@ -2469,7 +2469,7 @@ static int mgs_write_log_ost(const struct lu_env *env, + } + + /* +- attach obdfilter ost1 ost1_UUID ++ attach ost ost1 ost1_UUID + setup /dev/loop2 ldiskfs f|n errors=remount-ro,user_xattr + */ + if (class_find_param(ptr, PARAM_FAILMODE, &ptr) == 0) +@@ -2485,7 +2485,7 @@ static int mgs_write_log_ost(const struct lu_env *env, + snprintf(mti->mti_uuid, sizeof(mti->mti_uuid), + "%s_UUID", mti->mti_svname); + rc = record_attach(env, llh, mti->mti_svname, +- "obdfilter"/*LUSTRE_OST_NAME*/, mti->mti_uuid); ++ "ost"/*LUSTRE_OST_NAME*/, mti->mti_uuid); + if (rc) + GOTO(out_end, rc); + rc = record_setup(env, llh, mti->mti_svname, +diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c +index d7c541a..1479f5a 100644 +--- a/lustre/obdclass/genops.c ++++ b/lustre/obdclass/genops.c +@@ -121,7 +121,7 @@ struct obd_type *class_get_type(const char *name) + if (!type) { + const char *modname = name; + +- if (strcmp(modname, "obdfilter") == 0) ++ if (strcmp(modname, "ost") == 0) + modname = "ofd"; + + if (strcmp(modname, LUSTRE_LWP_NAME) == 0) +diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c +index 0f0d51a..b597b03 100644 +--- a/lustre/ofd/ofd_dev.c ++++ b/lustre/ofd/ofd_dev.c +@@ -2375,10 +2375,23 @@ static struct lu_device_type ofd_device_type = { + .ldt_ctx_tags = LCT_DT_THREAD + }; + ++/* ++ * In the normal case all we have one symlink, type->typ_procsym to ++ * address the renaming of proc directories due to the OSD api ++ * introducton. OFD is special in that this subsystem the name has ++ * changed from obdfilter to ofd to lastly ost. So we need two ++ * symlinks to point to "ost". Hopefully in 2.9 we can removal all ++ * this symlink madness. ++ * ++ * Symlink called "obdfilter" that points to "ost" directory. ++ */ ++static struct proc_dir_entry *ofd_symlink; ++ + int __init ofd_init(void) + { + struct lprocfs_static_vars lvars; +- int rc; ++ struct obd_type *type; ++ int rc; + + rc = lu_kmem_init(ofd_caches); + if (rc) +@@ -2397,13 +2410,30 @@ int __init ofd_init(void) + lvars.module_vars, + #endif + LUSTRE_OST_NAME, &ofd_device_type); ++ ++ /* For forward compatibility symlink "obdfilter" and "ofd" to "ost" ++ * in procfs. Remove the symlinks entirely when access via ++ * "obdfilter/ofd" can be deprecated, maybe 2.9? */ ++ type = class_search_type(LUSTRE_OST_NAME); ++ LASSERT(type != NULL); ++ type->typ_procsym = lprocfs_add_symlink("ofd", proc_lustre_root, ++ "ost"); ++ ++ ofd_symlink = lprocfs_add_symlink("obdfilter", proc_lustre_root, ++ "ost"); + return rc; + } + + void __exit ofd_exit(void) + { ++ struct obd_type *type = class_search_type(LUSTRE_OST_NAME); ++ + ofd_fmd_exit(); + lu_kmem_fini(ofd_caches); ++ if (ofd_symlink) ++ lprocfs_remove(&ofd_symlink); ++ if (type->typ_procsym) ++ lprocfs_remove(&type->typ_procsym); + class_unregister_type(LUSTRE_OST_NAME); + } + +diff --git a/lustre/ofd/ofd_internal.h b/lustre/ofd/ofd_internal.h +index 4f12506..98a5cba 100644 +--- a/lustre/ofd/ofd_internal.h ++++ b/lustre/ofd/ofd_internal.h +@@ -193,6 +193,8 @@ struct ofd_device { + struct ptlrpc_thread ofd_inconsistency_thread; + struct list_head ofd_inconsistency_list; + spinlock_t ofd_inconsistency_lock; ++ /* create a symlink "obdfilter" from the "ost" directory */ ++ struct proc_dir_entry *ofd_symlink; + }; + + static inline struct ofd_device *ofd_dev(struct lu_device *d) +diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c +index bae0a40..02ddb87 100644 +--- a/lustre/ost/ost_handler.c ++++ b/lustre/ost/ost_handler.c +@@ -95,13 +95,20 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg) + RETURN(rc); + + #ifdef LPROCFS ++ obd->obd_type->typ_procsym = lprocfs_add_symlink("ost/OSS", proc_lustre_root, ++ "../oss/OSS"); ++ if (IS_ERR(obd->obd_type->typ_procsym)) { ++ CERROR("ost: can't create compat entry \"ost/OSS\": %d\n", ++ (int)PTR_ERR(obd->obd_type->typ_procsym)); ++ obd->obd_type->typ_procsym = NULL; ++ } + obd->obd_vars = lprocfs_ost_obd_vars; + lprocfs_seq_obd_setup(obd); + #endif + mutex_init(&ost->ost_health_mutex); + + svc_conf = (typeof(svc_conf)) { +- .psc_name = LUSTRE_OSS_NAME, ++ .psc_name = "ost", + .psc_watchdog_factor = OSS_SERVICE_WATCHDOG_FACTOR, + .psc_buf = { + .bc_nbufs = OST_NBUFS, +@@ -379,6 +386,9 @@ static int ost_cleanup(struct obd_device *obd) + + mutex_unlock(&ost->ost_health_mutex); + ++ if (obd->obd_type->typ_procsym) ++ lprocfs_remove(&obd->obd_type->typ_procsym); ++ + lprocfs_obd_cleanup(obd); + + if (ost_io_cptable != NULL) { +-- +1.9.3 + diff --git a/sys-cluster/lustre/files/0006-LU-3319-procfs-move-mdd-ofd-proc-handling-to-seq_fil.patch b/sys-cluster/lustre/files/0007-LU-3319-procfs-move-mdd-ofd-proc-handling-to-seq_fil.patch index f41c78700..1f04e5545 100644 --- a/sys-cluster/lustre/files/0006-LU-3319-procfs-move-mdd-ofd-proc-handling-to-seq_fil.patch +++ b/sys-cluster/lustre/files/0007-LU-3319-procfs-move-mdd-ofd-proc-handling-to-seq_fil.patch @@ -1,7 +1,7 @@ -From 61588b698d08017b497f7a93fcf8626ddef9ceb5 Mon Sep 17 00:00:00 2001 +From 7f697da90a35ad00a35df6483261deaba70783dd Mon Sep 17 00:00:00 2001 From: James Simmons <uja.ornl@gmail.com> -Date: Wed, 26 Mar 2014 20:01:52 -0400 -Subject: [PATCH 6/7] LU-3319 procfs: move mdd/ofd proc handling to seq_files +Date: Mon, 5 May 2014 10:02:21 -0400 +Subject: [PATCH 7/8] 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 @@ -11,21 +11,18 @@ Signed-off-by: James Simmons <uja.ornl@gmail.com> Change-Id: I61b7df6bfd5efd0f12e3ca1a1813b7b62d493168 Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org> --- - lustre/include/lustre_lfsck.h | 6 +- - lustre/lfsck/lfsck_internal.h | 9 +- - lustre/lfsck/lfsck_layout.c | 71 ++---- - 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/obdclass/lprocfs_status.c | 9 +- - lustre/ofd/lproc_ofd.c | 467 ++++++++++++++++++++------------------- - lustre/ofd/ofd_dev.c | 80 +++---- - lustre/ofd/ofd_internal.h | 6 +- - lustre/osd-ldiskfs/osd_handler.c | 1 + - lustre/osd-zfs/osd_handler.c | 1 + - 14 files changed, 501 insertions(+), 640 deletions(-) + 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 @@ -48,10 +45,10 @@ index 0d6f666..5adbffe 100644 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 4f84c3b..c4e6430 100644 +index 24b84ae..203ad74 100644 --- a/lustre/lfsck/lfsck_internal.h +++ b/lustre/lfsck/lfsck_internal.h -@@ -299,8 +299,7 @@ struct lfsck_operations { +@@ -303,8 +303,7 @@ struct lfsck_operations { int (*lfsck_dump)(const struct lu_env *env, struct lfsck_component *com, @@ -61,7 +58,7 @@ index 4f84c3b..c4e6430 100644 int (*lfsck_double_scan)(const struct lu_env *env, struct lfsck_component *com); -@@ -586,10 +585,10 @@ void lfsck_component_cleanup(const struct lu_env *env, +@@ -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); @@ -76,10 +73,10 @@ index 4f84c3b..c4e6430 100644 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 c808808..9f2d9d6 100644 +index ced2e4d..e2df62d 100644 --- a/lustre/lfsck/lfsck_layout.c +++ b/lustre/lfsck/lfsck_layout.c -@@ -471,7 +471,7 @@ static struct lfsck_rbtree_node *lfsck_rbtree_new(const struct lu_env *env, +@@ -492,7 +492,7 @@ static struct lfsck_rbtree_node *lfsck_rbtree_new(const struct lu_env *env, return ERR_PTR(-ENOMEM); } @@ -88,7 +85,7 @@ index c808808..9f2d9d6 100644 lrn->lrn_seq = fid_seq(fid); lrn->lrn_first_oid = fid_oid(fid) & ~LFSCK_RBTREE_BITMAP_MASK; atomic_set(&lrn->lrn_known_count, 0); -@@ -4798,69 +4798,53 @@ static int lfsck_layout_slave_post(const struct lu_env *env, +@@ -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, @@ -157,17 +154,17 @@ index c808808..9f2d9d6 100644 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" -@@ -4880,11 +4864,6 @@ static int lfsck_layout_dump(const struct lu_env *env, +@@ -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); @@ -179,7 +176,7 @@ index c808808..9f2d9d6 100644 if (lo->ll_status == LS_SCANNING_PHASE1) { __u64 pos; -@@ -4902,8 +4881,7 @@ static int lfsck_layout_dump(const struct lu_env *env, +@@ -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); @@ -189,7 +186,7 @@ index c808808..9f2d9d6 100644 "checked_phase2: "LPU64"\n" "run_time_phase1: %u seconds\n" "run_time_phase2: %u seconds\n" -@@ -4917,11 +4895,6 @@ static int lfsck_layout_dump(const struct lu_env *env, +@@ -4992,11 +4970,6 @@ static int lfsck_layout_dump(const struct lu_env *env, lo->ll_run_time_phase2, speed, new_checked); @@ -201,7 +198,7 @@ index c808808..9f2d9d6 100644 LASSERT(lfsck->li_di_oit != NULL); -@@ -4934,12 +4907,8 @@ static int lfsck_layout_dump(const struct lu_env *env, +@@ -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--; @@ -215,16 +212,45 @@ index c808808..9f2d9d6 100644 } else if (lo->ll_status == LS_SCANNING_PHASE2) { cfs_duration_t duration = cfs_time_current() - lfsck->li_time_last_checkpoint; -@@ -4957,7 +4926,7 @@ static int lfsck_layout_dump(const struct lu_env *env, +@@ -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, -+ rc = seq_printf(m, - "checked_phase1: "LPU64"\n" - "checked_phase2: "LPU64"\n" - "run_time_phase1: %u seconds\n" -@@ -4978,8 +4947,6 @@ static int lfsck_layout_dump(const struct lu_env *env, +- "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; @@ -233,25 +259,46 @@ index c808808..9f2d9d6 100644 } else { __u64 speed1 = lo->ll_objs_checked_phase1; __u64 speed2 = lo->ll_objs_checked_phase2; -@@ -4988,8 +4955,7 @@ static int lfsck_layout_dump(const struct lu_env *env, +@@ -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" -+ seq_printf(m, "checked_phase1: "LPU64"\n" - "checked_phase2: "LPU64"\n" - "run_time_phase1: %u seconds\n" - "run_time_phase2: %u seconds\n" -@@ -5004,18 +4970,11 @@ static int lfsck_layout_dump(const struct lu_env *env, - lo->ll_run_time_phase2, - speed1, - speed2); +- "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; - @@ -264,10 +311,10 @@ index c808808..9f2d9d6 100644 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 c1304b5..43b09b7 100644 +index db73616..f6f1cce 100644 --- a/lustre/lfsck/lfsck_lib.c +++ b/lustre/lfsck/lfsck_lib.c -@@ -899,21 +899,15 @@ static inline int lfsck_instance_add(struct lfsck_instance *lfsck) +@@ -900,21 +900,15 @@ static inline int lfsck_instance_add(struct lfsck_instance *lfsck) return 0; } @@ -291,7 +338,7 @@ index c1304b5..43b09b7 100644 for (i = 0, flag = 1; bits != 0; i++, flag = 1 << i) { if (flag & bits) { bits &= ~flag; -@@ -921,69 +915,43 @@ int lfsck_bits_dump(char **buf, int *len, int bits, const char *names[], +@@ -922,69 +916,43 @@ int lfsck_bits_dump(char **buf, int *len, int bits, const char *names[], if (bits == 0) newline = true; @@ -380,7 +427,7 @@ index c1304b5..43b09b7 100644 } void lfsck_pos_fill(const struct lu_env *env, struct lfsck_instance *lfsck, -@@ -1655,7 +1623,7 @@ int lfsck_async_request(const struct lu_env *env, struct obd_export *exp, +@@ -1670,7 +1638,7 @@ int lfsck_async_request(const struct lu_env *env, struct obd_export *exp, /* external interfaces */ @@ -389,7 +436,7 @@ index c1304b5..43b09b7 100644 { struct lu_env env; struct lfsck_instance *lfsck; -@@ -1668,8 +1636,7 @@ int lfsck_get_speed(struct dt_device *key, void *buf, int len) +@@ -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)) { @@ -399,7 +446,7 @@ index c1304b5..43b09b7 100644 lfsck_instance_put(&env, lfsck); } else { rc = -ENXIO; -@@ -1709,7 +1676,7 @@ int lfsck_set_speed(struct dt_device *key, int val) +@@ -1724,7 +1691,7 @@ int lfsck_set_speed(struct dt_device *key, int val) } EXPORT_SYMBOL(lfsck_set_speed); @@ -408,7 +455,7 @@ index c1304b5..43b09b7 100644 { struct lu_env env; struct lfsck_instance *lfsck; -@@ -1722,8 +1689,7 @@ int lfsck_get_windows(struct dt_device *key, void *buf, int len) +@@ -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)) { @@ -418,7 +465,7 @@ index c1304b5..43b09b7 100644 lfsck_instance_put(&env, lfsck); } else { rc = -ENXIO; -@@ -1773,7 +1739,7 @@ int lfsck_set_windows(struct dt_device *key, int val) +@@ -1788,7 +1754,7 @@ int lfsck_set_windows(struct dt_device *key, int val) } EXPORT_SYMBOL(lfsck_set_windows); @@ -427,7 +474,7 @@ index c1304b5..43b09b7 100644 { struct lu_env env; struct lfsck_instance *lfsck; -@@ -1789,7 +1755,7 @@ int lfsck_dump(struct dt_device *key, void *buf, int len, enum lfsck_type type) +@@ -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)) { @@ -437,10 +484,10 @@ index c1304b5..43b09b7 100644 } else { rc = -ENOTSUPP; diff --git a/lustre/lfsck/lfsck_namespace.c b/lustre/lfsck/lfsck_namespace.c -index c80fb48..bcbfb8e 100644 +index 4dccb70..fc9a0dc 100644 --- a/lustre/lfsck/lfsck_namespace.c +++ b/lustre/lfsck/lfsck_namespace.c -@@ -1088,65 +1088,56 @@ static int lfsck_namespace_post(const struct lu_env *env, +@@ -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, @@ -523,7 +570,7 @@ index c80fb48..bcbfb8e 100644 "first_failure_position"); if (rc < 0) goto out; -@@ -1166,8 +1157,7 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com, +@@ -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); @@ -533,7 +580,7 @@ index c80fb48..bcbfb8e 100644 "checked_phase2: "LPU64"\n" "updated_phase1: "LPU64"\n" "updated_phase2: "LPU64"\n" -@@ -1199,11 +1189,6 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com, +@@ -1214,11 +1204,6 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com, ns->ln_run_time_phase2, speed, new_checked); @@ -545,7 +592,7 @@ index c80fb48..bcbfb8e 100644 LASSERT(lfsck->li_di_oit != NULL); -@@ -1232,9 +1217,7 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com, +@@ -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); @@ -556,7 +603,7 @@ index c80fb48..bcbfb8e 100644 } else if (ns->ln_status == LS_SCANNING_PHASE2) { cfs_duration_t duration = cfs_time_current() - lfsck->li_time_last_checkpoint; -@@ -1252,8 +1235,7 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com, +@@ -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); @@ -566,7 +613,7 @@ index c80fb48..bcbfb8e 100644 "checked_phase2: "LPU64"\n" "updated_phase1: "LPU64"\n" "updated_phase2: "LPU64"\n" -@@ -1288,11 +1270,6 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com, +@@ -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)); @@ -578,7 +625,7 @@ index c80fb48..bcbfb8e 100644 } else { __u64 speed1 = ns->ln_items_checked; __u64 speed2 = ns->ln_objs_checked_phase2; -@@ -1301,8 +1278,7 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com, +@@ -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); @@ -588,7 +635,7 @@ index c80fb48..bcbfb8e 100644 "checked_phase2: "LPU64"\n" "updated_phase1: "LPU64"\n" "updated_phase2: "LPU64"\n" -@@ -1335,17 +1311,10 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com, +@@ -1358,17 +1334,10 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com, ns->ln_run_time_phase2, speed1, speed2); @@ -608,10 +655,10 @@ index c80fb48..bcbfb8e 100644 static int lfsck_namespace_double_scan_main(void *args) diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c -index 0fe590e..f1c76d6 100644 +index 4f0baa4..f6deaca 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c -@@ -884,16 +884,16 @@ static int mdd_process_config(const struct lu_env *env, +@@ -889,16 +889,16 @@ static int mdd_process_config(const struct lu_env *env, ENTRY; switch (cfg->lcfg_command) { @@ -638,7 +685,7 @@ index 0fe590e..f1c76d6 100644 case LCFG_SETUP: rc = next->ld_ops->ldo_process_config(env, next, cfg); if (rc) -@@ -1564,11 +1564,8 @@ LU_CONTEXT_KEY_DEFINE(mdd, LCT_MD_THREAD); +@@ -1566,11 +1566,8 @@ LU_CONTEXT_KEY_DEFINE(mdd, LCT_MD_THREAD); static int __init mdd_mod_init(void) { @@ -650,7 +697,7 @@ index 0fe590e..f1c76d6 100644 rc = lu_kmem_init(mdd_caches); if (rc) return rc; -@@ -1584,7 +1581,7 @@ static int __init mdd_mod_init(void) +@@ -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 @@ -660,10 +707,10 @@ index 0fe590e..f1c76d6 100644 LUSTRE_MDD_NAME, &mdd_device_type); if (rc) diff --git a/lustre/mdd/mdd_internal.h b/lustre/mdd/mdd_internal.h -index a95a42c..64183e3 100644 +index 4411892..37698f8 100644 --- a/lustre/mdd/mdd_internal.h +++ b/lustre/mdd/mdd_internal.h -@@ -347,7 +347,6 @@ int orph_declare_index_delete(const struct lu_env *, struct mdd_object *, +@@ -248,7 +248,6 @@ int orph_declare_index_delete(const struct lu_env *, struct mdd_object *, struct thandle *); /* mdd_lproc.c */ @@ -1093,31 +1140,11 @@ index de379b3..7ac4afa 100644 + } + RETURN(0); +} -diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c -index 30d9f59..5e479c8 100644 ---- a/lustre/obdclass/lprocfs_status.c -+++ b/lustre/obdclass/lprocfs_status.c -@@ -388,11 +388,10 @@ EXPORT_SYMBOL(lprocfs_evict_client_seq_write); - #undef BUFLEN - - struct file_operations lprocfs_evict_client_fops = { -- .owner = THIS_MODULE, -- .read = lprocfs_fops_read, -- .write = lprocfs_fops_write, -- .open = lprocfs_evict_client_open, -- .release = lprocfs_evict_client_release, -+ .owner = THIS_MODULE, -+ .open = lprocfs_evict_client_open, -+ .release = lprocfs_evict_client_release, -+ .write = lprocfs_evict_client_seq_write, - }; - EXPORT_SYMBOL(lprocfs_evict_client_fops); - #endif diff --git a/lustre/ofd/lproc_ofd.c b/lustre/ofd/lproc_ofd.c -index 000d4ae..eb6bef0 100644 +index 359b373..fcde82a 100644 --- a/lustre/ofd/lproc_ofd.c +++ b/lustre/ofd/lproc_ofd.c -@@ -47,80 +47,75 @@ +@@ -47,81 +47,75 @@ #ifdef LPROCFS @@ -1193,8 +1220,9 @@ index 000d4ae..eb6bef0 100644 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); ++ obd->obd_self_export->exp_filter_data.fed_grant); } +LPROC_SEQ_FOPS_RO(ofd_grant_precreate); @@ -1210,23 +1238,25 @@ index 000d4ae..eb6bef0 100644 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)); ++ (int) ofd_grant_reserved(ofd, 100)); } --static int lprocfs_ofd_wr_grant_ratio(struct file *file, const char *buffer, +-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 *buffer, ++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 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; -@@ -144,23 +139,24 @@ static int lprocfs_ofd_wr_grant_ratio(struct file *file, const char *buffer, +@@ -145,24 +139,24 @@ static int lprocfs_ofd_wr_grant_ratio(struct file *file, spin_unlock(&ofd->ofd_grant_lock); return count; } @@ -1247,19 +1277,20 @@ index 000d4ae..eb6bef0 100644 + return seq_printf(m, "%d\n", ofd->ofd_precreate_batch); } --static int lprocfs_ofd_wr_precreate_batch(struct file *file, const char *buffer, +-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 *buffer, -+ size_t count, loff_t *off) ++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 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; -@@ -177,11 +173,11 @@ static int lprocfs_ofd_wr_precreate_batch(struct file *file, const char *buffer, +@@ -179,11 +173,11 @@ static int lprocfs_ofd_wr_precreate_batch(struct file *file, spin_unlock(&ofd->ofd_batch_lock); return count; } @@ -1274,7 +1305,7 @@ index 000d4ae..eb6bef0 100644 struct ofd_device *ofd; struct ofd_seq *oseq = NULL; int retval = 0, rc; -@@ -199,35 +195,32 @@ static int lprocfs_ofd_rd_last_id(char *page, char **start, off_t off, +@@ -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); @@ -1299,20 +1330,21 @@ index 000d4ae..eb6bef0 100644 +static int ofd_fmd_max_num_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 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 *buffer, +-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 *buffer, -+ size_t count, loff_t *off) ++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; @@ -1320,7 +1352,7 @@ index 000d4ae..eb6bef0 100644 struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev); int val; int rc; -@@ -242,22 +235,22 @@ int lprocfs_ofd_wr_fmd_max_num(struct file *file, const char *buffer, +@@ -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; } @@ -1331,19 +1363,20 @@ index 000d4ae..eb6bef0 100644 +static int ofd_fmd_max_age_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 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 *buffer, +-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 *buffer, ++ofd_fmd_max_age_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) { - struct obd_device *obd = data; @@ -1352,7 +1385,7 @@ index 000d4ae..eb6bef0 100644 struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev); int val; int rc; -@@ -272,22 +265,22 @@ int lprocfs_ofd_wr_fmd_max_age(struct file *file, const char *buffer, +@@ -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; } @@ -1373,10 +1406,10 @@ index 000d4ae..eb6bef0 100644 + obd->u.filter.fo_fl_oss_capa ? "oss" : ""); } --static int lprocfs_ofd_wr_capa(struct file *file, const char *buffer, +-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 *buffer, size_t count, ++ofd_capa_seq_write(struct file *file, const char *__user buffer, size_t count, + loff_t *off) { - struct obd_device *obd = data; @@ -1385,7 +1418,7 @@ index 000d4ae..eb6bef0 100644 int val, rc; rc = lprocfs_write_helper(buffer, count, &val); -@@ -306,28 +299,30 @@ static int lprocfs_ofd_wr_capa(struct file *file, const char *buffer, +@@ -308,28 +299,29 @@ static int lprocfs_ofd_wr_capa(struct file *file, const char __user *buffer, val ? "enabled" : "disabled"); return count; } @@ -1396,9 +1429,10 @@ index 000d4ae..eb6bef0 100644 +static int ofd_capa_count_seq_show(struct seq_file *m, void *data) { - return snprintf(page, count, "%d %d\n", -+ return seq_printf(m, "%d %d\n", - capa_count[CAPA_SITE_CLIENT], - capa_count[CAPA_SITE_SERVER]); +- 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); @@ -1414,10 +1448,10 @@ index 000d4ae..eb6bef0 100644 + return seq_printf(m, "%u\n", ofd->ofd_raid_degraded); } --int lprocfs_ofd_wr_degraded(struct file *file, const char *buffer, +-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 *buffer, ++ofd_degraded_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) { - struct obd_device *obd = data; @@ -1426,7 +1460,7 @@ index 000d4ae..eb6bef0 100644 struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev); int val, rc; -@@ -338,38 +333,37 @@ int lprocfs_ofd_wr_degraded(struct file *file, const char *buffer, +@@ -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); @@ -1466,10 +1500,10 @@ index 000d4ae..eb6bef0 100644 + return seq_printf(m, "%u\n", ofd->ofd_syncjournal); } --int lprocfs_ofd_wr_syncjournal(struct file *file, const char *buffer, +-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 *buffer, ++ofd_syncjournal_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) { - struct obd_device *obd = data; @@ -1478,13 +1512,15 @@ index 000d4ae..eb6bef0 100644 struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev); int val; int rc; -@@ -388,27 +382,27 @@ int lprocfs_ofd_wr_syncjournal(struct file *file, const char *buffer, +@@ -390,6 +381,7 @@ int lprocfs_ofd_wr_syncjournal(struct file *file, const char __user *buffer, return count; } +LPROC_SEQ_FOPS(ofd_syncjournal); - static char *sync_on_cancel_states[] = {"never", + /* 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" }; @@ -1501,22 +1537,23 @@ index 000d4ae..eb6bef0 100644 - 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]); ++ sync_on_cancel_states[tgt->lut_sync_lock_cancel]); } --int lprocfs_ofd_wr_sync_lock_cancel(struct file *file, const char *buffer, +-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 *buffer, -+ size_t count, loff_t *off) ++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; - int i; -@@ -436,22 +430,22 @@ int lprocfs_ofd_wr_sync_lock_cancel(struct file *file, const char *buffer, +@@ -455,23 +445,23 @@ int lprocfs_ofd_wr_sync_lock_cancel(struct file *file, spin_unlock(&tgt->lut_flags_lock); return count; } @@ -1527,20 +1564,23 @@ index 000d4ae..eb6bef0 100644 +static int ofd_grant_compat_disable_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 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 *buffer, +-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 *buffer, -+ size_t count, loff_t *off) ++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; @@ -1548,7 +1588,7 @@ index 000d4ae..eb6bef0 100644 struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev); int val; int rc; -@@ -469,41 +463,43 @@ int lprocfs_ofd_wr_grant_compat_disable(struct file *file, const char *buffer, +@@ -489,42 +479,43 @@ int lprocfs_ofd_wr_grant_compat_disable(struct file *file, return count; } @@ -1567,16 +1607,17 @@ index 000d4ae..eb6bef0 100644 + return lprocfs_uint_seq_show(m, &ofd->ofd_soft_sync_limit); } --int lprocfs_ofd_wr_soft_sync_limit(struct file *file, const char *buffer, +-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 *buffer, ++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 seq_file *m = file->private_data; -+ struct obd_device *obd = m->private; - struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev); +- 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, @@ -1589,7 +1630,7 @@ index 000d4ae..eb6bef0 100644 +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 obd_device *obd = m->private; struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev); - *eof = 1; @@ -1598,10 +1639,11 @@ index 000d4ae..eb6bef0 100644 + return lfsck_get_speed(m, ofd->ofd_osd); } --static int lprocfs_wr_lfsck_speed_limit(struct file *file, const char *buffer, +-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 *buffer, ++ofd_lfsck_speed_limit_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) { - struct obd_device *obd = data; @@ -1610,7 +1652,7 @@ index 000d4ae..eb6bef0 100644 struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev); __u32 val; int rc; -@@ -516,37 +512,34 @@ static int lprocfs_wr_lfsck_speed_limit(struct file *file, const char *buffer, +@@ -537,38 +528,35 @@ static int lprocfs_wr_lfsck_speed_limit(struct file *file, return rc != 0 ? rc : count; } @@ -1648,16 +1690,18 @@ index 000d4ae..eb6bef0 100644 - 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", ++ 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 *buffer, +-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 *buffer, ++ofd_lfsck_verify_pfid_seq_write(struct file *file, const char __user *buffer, + size_t count, loff_t *off) { - struct obd_device *obd = data; @@ -1666,7 +1710,7 @@ index 000d4ae..eb6bef0 100644 struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev); __u32 val; int rc; -@@ -559,75 +552,101 @@ static int lprocfs_wr_lfsck_verify_pfid(struct file *file, const char *buffer, +@@ -581,75 +569,101 @@ static int lprocfs_wr_lfsck_verify_pfid(struct file *file, return count; } @@ -1835,10 +1879,10 @@ index 000d4ae..eb6bef0 100644 { LASSERT(stats && stats->ls_num >= LPROC_OFD_STATS_LAST); diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c -index 9b82e51..126f29e 100644 +index b597b03..e186c41 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c -@@ -240,8 +240,7 @@ static int ofd_process_config(const struct lu_env *env, struct lu_device *d, +@@ -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: { @@ -1848,7 +1892,7 @@ index 9b82e51..126f29e 100644 /* For interoperability */ struct cfg_interop_param *ptr = NULL; struct lustre_cfg *old_cfg = NULL; -@@ -279,8 +278,7 @@ static int ofd_process_config(const struct lu_env *env, struct lu_device *d, +@@ -278,8 +277,7 @@ static int ofd_process_config(const struct lu_env *env, struct lu_device *d, break; } @@ -1858,7 +1902,7 @@ index 9b82e51..126f29e 100644 d->ld_obd); if (rc > 0 || rc == -ENOSYS) { CDEBUG(D_CONFIG, "pass param %s down the stack.\n", -@@ -496,9 +494,10 @@ static struct lu_device_operations ofd_lu_ops = { +@@ -485,9 +483,10 @@ static struct lu_device_operations ofd_lu_ops = { .ldo_prepare = ofd_prepare, }; @@ -1870,7 +1914,7 @@ index 9b82e51..126f29e 100644 struct obd_device *obd = ofd_obd(ofd); cfs_proc_dir_entry_t *entry; int rc = 0; -@@ -507,8 +506,8 @@ static int ofd_procfs_init(struct ofd_device *ofd) +@@ -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 */ @@ -1881,7 +1925,7 @@ index 9b82e51..126f29e 100644 if (rc) { CERROR("%s: lprocfs_obd_setup failed: %d.\n", obd->obd_name, rc); -@@ -524,7 +523,8 @@ static int ofd_procfs_init(struct ofd_device *ofd) +@@ -513,7 +512,8 @@ static int ofd_procfs_init(struct ofd_device *ofd) obd->obd_uses_nid_stats = 1; @@ -1891,7 +1935,7 @@ index 9b82e51..126f29e 100644 if (IS_ERR(entry)) { rc = PTR_ERR(entry); CERROR("%s: error %d setting up lprocfs for %s\n", -@@ -534,8 +534,10 @@ static int ofd_procfs_init(struct ofd_device *ofd) +@@ -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", @@ -1904,7 +1948,7 @@ index 9b82e51..126f29e 100644 if (IS_ERR(entry)) { rc = PTR_ERR(entry); CERROR("%s: add proc entry 'clear' failed: %d.\n", -@@ -551,7 +553,7 @@ static int ofd_procfs_init(struct ofd_device *ofd) +@@ -540,7 +542,7 @@ static int ofd_procfs_init(struct ofd_device *ofd) GOTO(remove_entry_clear, rc); RETURN(0); remove_entry_clear: @@ -1913,16 +1957,29 @@ index 9b82e51..126f29e 100644 obd_cleanup: lprocfs_obd_cleanup(obd); lprocfs_free_obd_stats(obd); -@@ -563,47 +565,36 @@ static void ofd_procfs_add_brw_stats_symlink(struct ofd_device *ofd) +@@ -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; -+ struct proc_dir_entry *osd_dir = osd_obd->obd_type->typ_procsym; - osd_dir = lprocfs_srch(osd_root, obd->obd_name); - if (osd_dir == NULL) +- if (osd_dir == NULL) ++ if (obd->obd_proc_entry == NULL) return; - if (lprocfs_srch(osd_dir, "brw_stats") != NULL) @@ -1981,15 +2038,15 @@ index 9b82e51..126f29e 100644 lprocfs_free_per_client_stats(obd); lprocfs_obd_cleanup(obd); lprocfs_free_obd_stats(obd); -@@ -2387,7 +2378,6 @@ static struct lu_device_type ofd_device_type = { +@@ -2389,7 +2388,6 @@ static struct proc_dir_entry *ofd_symlink; int __init ofd_init(void) { - struct lprocfs_static_vars lvars; - int rc; + struct obd_type *type; + int rc; - rc = lu_kmem_init(ofd_caches); -@@ -2400,11 +2390,9 @@ int __init ofd_init(void) +@@ -2403,11 +2401,9 @@ int __init ofd_init(void) return(rc); } @@ -2001,12 +2058,12 @@ index 9b82e51..126f29e 100644 + 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 3aae6dd..1bdcb80 100644 +index 98a5cba..a630a9c 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, +@@ -405,13 +405,9 @@ int ofd_txn_stop_cb(const struct lu_env *env, struct thandle *txn, /* lproc_ofd.c */ #ifdef LPROCFS @@ -2021,30 +2078,6 @@ index 3aae6dd..1bdcb80 100644 static inline void ofd_stats_counter_init(struct lprocfs_stats *stats) {} #endif -diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c -index 4b5370a..3767f3f 100644 ---- a/lustre/osd-ldiskfs/osd_handler.c -+++ b/lustre/osd-ldiskfs/osd_handler.c -@@ -5931,6 +5931,7 @@ static int osd_obd_connect(const struct lu_env *env, struct obd_export **exp, - osd->od_connects++; - spin_unlock(&osd->od_osfs_lock); - -+ obd->obd_type->typ_procsym = osd->od_proc_entry; - RETURN(0); - } - -diff --git a/lustre/osd-zfs/osd_handler.c b/lustre/osd-zfs/osd_handler.c -index 29a3617..ad8908a 100644 ---- a/lustre/osd-zfs/osd_handler.c -+++ b/lustre/osd-zfs/osd_handler.c -@@ -822,6 +822,7 @@ static int osd_obd_connect(const struct lu_env *env, struct obd_export **exp, - osd->od_connects++; - spin_unlock(&osd->od_objset.lock); - -+ obd->obd_type->typ_procsym = osd->od_proc_entry; - RETURN(0); - } - -- -1.9.1 +1.9.3 diff --git a/sys-cluster/lustre/files/0007-LU-4416-mm-Backport-shrinker-changes-from-upstream.patch b/sys-cluster/lustre/files/0008-LU-4416-mm-Backport-shrinker-changes-from-upstream.patch index 4fccc4803..e14c7363b 100644 --- a/sys-cluster/lustre/files/0007-LU-4416-mm-Backport-shrinker-changes-from-upstream.patch +++ b/sys-cluster/lustre/files/0008-LU-4416-mm-Backport-shrinker-changes-from-upstream.patch @@ -1,7 +1,7 @@ -From 4112e3a2aefcae89181bbddaf704855f69c8de23 Mon Sep 17 00:00:00 2001 -From: yangsheng <yang.sheng@intel.com> -Date: Fri, 28 Feb 2014 20:30:18 +0800 -Subject: [PATCH 7/7] LU-4416 mm: Backport shrinker changes from upstream +From cec7352d2cf74e8124a499aac74b246baa888c3c Mon Sep 17 00:00:00 2001 +From: Yang Sheng <yang.sheng@intel.com> +Date: Thu, 24 Apr 2014 11:43:09 +0800 +Subject: [PATCH 8/8] LU-4416 mm: Backport shrinker changes from upstream Convert shrinker to new count/scan API. --ptlrpc shrinker @@ -10,55 +10,51 @@ Convert shrinker to new count/scan API. Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> -Signed-off-by: yang sheng <yang.sheng@intel.com> +Signed-off-by: Yang Sheng <yang.sheng@intel.com> Change-Id: Idbd7cd3b7488202e5e8f6fdf757ae6d20e28d642 --- - libcfs/autoconf/lustre-libcfs.m4 | 22 ++++ + libcfs/autoconf/lustre-libcfs.m4 | 18 +++ libcfs/include/libcfs/linux/linux-mem.h | 34 ++++- libcfs/include/libcfs/posix/libcfs.h | 13 +- lustre/ldlm/ldlm_pool.c | 222 ++++++++++++++++++++------------ lustre/obdclass/lu_object.c | 134 +++++++++++-------- lustre/ptlrpc/sec_bulk.c | 80 +++++++++--- - 6 files changed, 342 insertions(+), 163 deletions(-) + 6 files changed, 338 insertions(+), 163 deletions(-) diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4 -index 815f082..a6b728a 100644 +index dba971d..840fcd5 100644 --- a/libcfs/autoconf/lustre-libcfs.m4 +++ b/libcfs/autoconf/lustre-libcfs.m4 -@@ -295,6 +295,26 @@ fi - ]) +@@ -290,6 +290,22 @@ No crc32c pclmulqdq crypto api found, enable internal pclmulqdq based crc32c + ]) # LIBCFS_ENABLE_CRC32C_ACCEL # +# FC19 3.12 kernel struct shrinker change +# -+AC_DEFUN([LIBCFS_SHRINKER_COUNT], -+[AC_MSG_CHECKING([shrinker has count_objects]) -+LB_LINUX_TRY_COMPILE([ ++AC_DEFUN([LIBCFS_SHRINKER_COUNT],[ ++LB_CHECK_COMPILE([shrinker has 'count_objects'], ++shrinker_count_objects, [ + #include <linux/mmzone.h> + #include <linux/shrinker.h> +],[ + ((struct shrinker*)0)->count_objects(NULL, NULL); +],[ -+ AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SHRINKER_COUNT, 1, + [shrinker has count_objects memeber]) -+],[ -+ AC_MSG_RESULT(no) -+],[ +]) +]) + +# # LIBCFS_PROG_LINUX # - # LNet linux kernel checks -@@ -328,6 +348,8 @@ LIBCFS_HAVE_CRC32 + # LibCFS linux kernel checks +@@ -324,6 +340,8 @@ LIBCFS_HAVE_CRC32 LIBCFS_ENABLE_CRC32_ACCEL # 3.10 LIBCFS_ENABLE_CRC32C_ACCEL +# 3.12 +LIBCFS_SHRINKER_COUNT - ]) + ]) # LIBCFS_PROG_LINUX # diff --git a/libcfs/include/libcfs/linux/linux-mem.h b/libcfs/include/libcfs/linux/linux-mem.h @@ -452,7 +448,7 @@ index 6cf50f2..b3eaf1c 100644 RETURN(rc); } diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c -index 1304e95..0850b2a 100644 +index 1304e95..77aa930 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -1884,6 +1884,69 @@ static void lu_site_stats_get(cfs_hash_t *hs, @@ -488,7 +484,7 @@ index 1304e95..0850b2a 100644 +{ + struct lu_site *s; + struct lu_site *tmp; -+ unsigned long remain = sc->nr_to_scan, freed = 0; ++ unsigned long remain = sc->nr_to_scan, freed = remain; + LIST_HEAD(splice); + + if (!(sc->gfp_mask & __GFP_FS)) @@ -507,7 +503,7 @@ index 1304e95..0850b2a 100644 + + mutex_lock(&lu_sites_guard); + list_for_each_entry_safe(s, tmp, &lu_sites, ls_linkage) { -+ freed = lu_site_purge(&lu_shrink_env, s, remain); ++ freed = lu_site_purge(&lu_shrink_env, s, freed); + remain -= freed; + /* + * Move just shrunk site to the tail of site list to @@ -753,5 +749,5 @@ index bb1e782..9da60ad 100644 enc_pools_free(); return -ENOMEM; -- -1.9.1 +1.9.3 diff --git a/sys-cluster/lustre/lustre-9999.ebuild b/sys-cluster/lustre/lustre-9999.ebuild index f777e39ea..26e07bdb0 100644 --- a/sys-cluster/lustre/lustre-9999.ebuild +++ b/sys-cluster/lustre/lustre-9999.ebuild @@ -45,8 +45,9 @@ PATCHES=( "${FILESDIR}/0003-LU-3319-procfs-move-osp-proc-handling-to-seq_files.patch" "${FILESDIR}/0004-LU-3319-procfs-move-lod-proc-handling-to-seq_files.patch" "${FILESDIR}/0005-LU-3319-procfs-move-mdt-mds-proc-handling-to-seq_fil.patch" - "${FILESDIR}/0006-LU-3319-procfs-move-mdd-ofd-proc-handling-to-seq_fil.patch" - "${FILESDIR}/0007-LU-4416-mm-Backport-shrinker-changes-from-upstream.patch" + "${FILESDIR}/0006-LU-2096-lprocfs-symlinks-for-forward-compatibility.patch" + "${FILESDIR}/0007-LU-3319-procfs-move-mdd-ofd-proc-handling-to-seq_fil.patch" + "${FILESDIR}/0008-LU-4416-mm-Backport-shrinker-changes-from-upstream.patch" "${FILESDIR}/lustre-readline6.3_fix.patch" ) |