aboutsummaryrefslogtreecommitdiff
blob: dad3b481c8bcd7344ecd5cbe20b16ff4554c1605 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
From 82953bddbc3c7b9aa044d9eecc796bc12638f476 Mon Sep 17 00:00:00 2001
From: James Simmons <uja.ornl@gmail.com>
Date: Sun, 9 Feb 2014 11:08:45 -0500
Subject: [PATCH 07/13] 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
layer proc entries over to using seq_files.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: Iaa0f617fcd430e91f12afbc0faf6906fd275a7a5
---
 lustre/lod/lod_dev.c      |  39 ++++---
 lustre/lod/lod_internal.h |   1 -
 lustre/lod/lod_pool.c     |   7 +-
 lustre/lod/lproc_lod.c    | 251 ++++++++++++++++++++++++----------------------
 4 files changed, 152 insertions(+), 146 deletions(-)

diff --git a/lustre/lod/lod_dev.c b/lustre/lod/lod_dev.c
index 02a1e1e..b0ad1fd 100644
--- a/lustre/lod/lod_dev.c
+++ b/lustre/lod/lod_dev.c
@@ -297,12 +297,10 @@ static int lod_process_config(const struct lu_env *env,
 	}
 
 	case LCFG_PARAM: {
-		struct lprocfs_static_vars  v = { 0 };
-		struct obd_device	  *obd = lod2obd(lod);
+		struct obd_device *obd = lod2obd(lod);
 
-		lprocfs_lod_init_vars(&v);
-
-		rc = class_process_proc_param(PARAM_LOV, v.obd_vars, lcfg, obd);
+		rc = class_process_proc_seq_param(PARAM_LOV, obd->obd_vars,
+						  lcfg, obd);
 		if (rc > 0)
 			rc = 0;
 		GOTO(out, rc);
@@ -916,19 +914,16 @@ static struct obd_ops lod_obd_device_ops = {
 
 static int __init lod_mod_init(void)
 {
-	struct lprocfs_static_vars  lvars = { 0 };
-	cfs_proc_dir_entry_t       *lov_proc_dir;
-	int			    rc;
+	struct obd_type *lod, *lov;
+	int rc;
 
 	rc = lu_kmem_init(lod_caches);
 	if (rc)
 		return rc;
 
-	lprocfs_lod_init_vars(&lvars);
-
 	rc = class_register_type(&lod_obd_device_ops, NULL, NULL,
 #ifndef HAVE_ONLY_PROCFS_SEQ
-				lvars.module_vars,
+				NULL,
 #endif
 				LUSTRE_LOD_NAME, &lod_device_type);
 	if (rc) {
@@ -937,23 +932,25 @@ static int __init lod_mod_init(void)
 	}
 
 	/* create "lov" entry in procfs for compatibility purposes */
-	lov_proc_dir = lprocfs_srch(proc_lustre_root, "lov");
-	if (lov_proc_dir == NULL) {
-		lov_proc_dir = lprocfs_register("lov", proc_lustre_root,
-						NULL, NULL);
-		if (IS_ERR(lov_proc_dir))
+	lod = class_search_type(LUSTRE_LOD_NAME);
+	lov = class_search_type(LUSTRE_LOV_NAME);
+	if (lov == NULL) {
+		lod->typ_procsym = lprocfs_seq_register("lov", proc_lustre_root,
+							NULL, NULL);
+		if (IS_ERR(lod->typ_procsym)) {
 			CERROR("lod: can't create compat entry \"lov\": %d\n",
-			       (int)PTR_ERR(lov_proc_dir));
+			       (int)PTR_ERR(lod->typ_procsym));
+			lod->typ_procsym = NULL;
+		}
+	} else {
+		/* Map lov proc root to lod symlink */
+		lod->typ_procsym = lov->typ_procroot;
 	}
-
 	return rc;
 }
 
 static void __exit lod_mod_exit(void)
 {
-
-	lprocfs_try_remove_proc_entry("lov", proc_lustre_root);
-
 	class_unregister_type(LUSTRE_LOD_NAME);
 	lu_kmem_fini(lod_caches);
 }
diff --git a/lustre/lod/lod_internal.h b/lustre/lod/lod_internal.h
index 6d99ad5..9299a91 100644
--- a/lustre/lod/lod_internal.h
+++ b/lustre/lod/lod_internal.h
@@ -376,7 +376,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 */
-void lprocfs_lod_init_vars(struct lprocfs_static_vars *lvars);
 int lod_procfs_init(struct lod_device *lod);
 void lod_procfs_fini(struct lod_device *lod);
 
diff --git a/lustre/lod/lod_pool.c b/lustre/lod/lod_pool.c
index 98b2416..1849e5d 100644
--- a/lustre/lod/lod_pool.c
+++ b/lustre/lod/lod_pool.c
@@ -283,7 +283,7 @@ static int pool_proc_open(struct inode *inode, struct file *file)
 	rc = seq_open(file, &pool_proc_ops);
 	if (!rc) {
 		struct seq_file *s = file->private_data;
-		s->private = PROC_I(inode)->pde->data;
+		s->private = PDE_DATA(inode);
 	}
 	return rc;
 }
@@ -462,7 +462,10 @@ int lod_pool_new(struct obd_device *obd, char *poolname)
 #ifdef LPROCFS
 	lod_pool_getref(new_pool);
 	new_pool->pool_proc_entry = lprocfs_add_simple(lod->lod_pool_proc_entry,
-						       poolname, NULL, NULL,
+						       poolname,
+#ifndef HAVE_ONLY_PROCFS_SEQ
+						       NULL, NULL,
+#endif
 						       new_pool,
 						       &pool_proc_operations);
 	if (IS_ERR(new_pool->pool_proc_entry)) {
diff --git a/lustre/lod/lproc_lod.c b/lustre/lod/lproc_lod.c
index e976063..e420a5e 100644
--- a/lustre/lod/lproc_lod.c
+++ b/lustre/lod/lproc_lod.c
@@ -42,23 +42,22 @@
 #include <lustre_param.h>
 
 #ifdef LPROCFS
-static int lod_rd_stripesize(char *page, char **start, off_t off, int count,
-			     int *eof, void *data)
+static int lod_stripesize_seq_show(struct seq_file *m, void *v)
 {
-	struct obd_device *dev  = (struct obd_device *)data;
+	struct obd_device *dev = m->private;
 	struct lod_device *lod;
 
 	LASSERT(dev != NULL);
 	lod  = lu2lod_dev(dev->obd_lu_dev);
-	*eof = 1;
-	return snprintf(page, count, LPU64"\n",
+	return seq_printf(m, LPU64"\n",
 			lod->lod_desc.ld_default_stripe_size);
 }
 
-static int lod_wr_stripesize(struct file *file, const char *buffer,
-			     unsigned long count, void *data)
+static ssize_t
+lod_stripesize_seq_write(struct file *file, const char *buffer,
+			 size_t count, loff_t *off)
 {
-	struct obd_device *dev = (struct obd_device *)data;
+	struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
 	struct lod_device *lod;
 	__u64 val;
 	int rc;
@@ -73,24 +72,24 @@ static int lod_wr_stripesize(struct file *file, const char *buffer,
 	lod->lod_desc.ld_default_stripe_size = val;
 	return count;
 }
+LPROC_SEQ_FOPS(lod_stripesize);
 
-static int lod_rd_stripeoffset(char *page, char **start, off_t off, int count,
-			       int *eof, void *data)
+static int lod_stripeoffset_seq_show(struct seq_file *m, void *v)
 {
-	struct obd_device *dev = (struct obd_device *)data;
+	struct obd_device *dev = m->private;
 	struct lod_device *lod;
 
 	LASSERT(dev != NULL);
 	lod  = lu2lod_dev(dev->obd_lu_dev);
-	*eof = 1;
-	return snprintf(page, count, LPU64"\n",
+	return seq_printf(m, LPU64"\n",
 			lod->lod_desc.ld_default_stripe_offset);
 }
 
-static int lod_wr_stripeoffset(struct file *file, const char *buffer,
-			       unsigned long count, void *data)
+static ssize_t
+lod_stripeoffset_seq_write(struct file *file, const char *buffer,
+			   size_t count, loff_t *off)
 {
-	struct obd_device *dev = (struct obd_device *)data;
+	struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
 	struct lod_device *lod;
 	__u64 val;
 	int rc;
@@ -104,23 +103,23 @@ static int lod_wr_stripeoffset(struct file *file, const char *buffer,
 	lod->lod_desc.ld_default_stripe_offset = val;
 	return count;
 }
+LPROC_SEQ_FOPS(lod_stripeoffset);
 
-static int lod_rd_stripetype(char *page, char **start, off_t off, int count,
-			     int *eof, void *data)
+static int lod_stripetype_seq_show(struct seq_file *m, void *v)
 {
-	struct obd_device *dev = (struct obd_device *)data;
+	struct obd_device *dev = m->private;
 	struct lod_device *lod;
 
 	LASSERT(dev != NULL);
 	lod  = lu2lod_dev(dev->obd_lu_dev);
-	*eof = 1;
-	return snprintf(page, count, "%u\n", lod->lod_desc.ld_pattern);
+	return seq_printf(m, "%u\n", lod->lod_desc.ld_pattern);
 }
 
-static int lod_wr_stripetype(struct file *file, const char *buffer,
-			     unsigned long count, void *data)
+static ssize_t
+lod_stripetype_seq_write(struct file *file, const char *buffer,
+			 size_t count, loff_t *off)
 {
-	struct obd_device *dev = (struct obd_device *)data;
+	struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
 	struct lod_device *lod;
 	int val, rc;
 
@@ -134,24 +133,24 @@ static int lod_wr_stripetype(struct file *file, const char *buffer,
 	lod->lod_desc.ld_pattern = val;
 	return count;
 }
+LPROC_SEQ_FOPS(lod_stripetype);
 
-static int lod_rd_stripecount(char *page, char **start, off_t off, int count,
-			      int *eof, void *data)
+static int lod_stripecount_seq_show(struct seq_file *m, void *v)
 {
-	struct obd_device *dev = (struct obd_device *)data;
+	struct obd_device *dev = m->private;
 	struct lod_device *lod;
 
 	LASSERT(dev != NULL);
 	lod  = lu2lod_dev(dev->obd_lu_dev);
-	*eof = 1;
-	return snprintf(page, count, "%d\n",
+	return seq_printf(m, "%d\n",
 			(__s16)(lod->lod_desc.ld_default_stripe_count + 1) - 1);
 }
 
-static int lod_wr_stripecount(struct file *file, const char *buffer,
-			      unsigned long count, void *data)
+static ssize_t
+lod_stripecount_seq_write(struct file *file, const char *buffer,
+			  size_t count, loff_t *off)
 {
-	struct obd_device *dev = (struct obd_device *)data;
+	struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
 	struct lod_device *lod;
 	int val, rc;
 
@@ -165,62 +164,57 @@ static int lod_wr_stripecount(struct file *file, const char *buffer,
 	lod->lod_desc.ld_default_stripe_count = val;
 	return count;
 }
+LPROC_SEQ_FOPS(lod_stripecount);
 
-static int lod_rd_numobd(char *page, char **start, off_t off, int count,
-			 int *eof, void *data)
+static int lod_numobd_seq_show(struct seq_file *m, void *v)
 {
-	struct obd_device *dev = (struct obd_device*)data;
+	struct obd_device *dev = m->private;
 	struct lod_device *lod;
 
 	LASSERT(dev != NULL);
 	lod  = lu2lod_dev(dev->obd_lu_dev);
-	*eof = 1;
-	return snprintf(page, count, "%u\n", lod->lod_desc.ld_tgt_count);
-
+	return seq_printf(m, "%u\n", lod->lod_desc.ld_tgt_count);
 }
+LPROC_SEQ_FOPS_RO(lod_numobd);
 
-static int lod_rd_activeobd(char *page, char **start, off_t off, int count,
-			    int *eof, void *data)
+static int lod_activeobd_seq_show(struct seq_file *m, void *v)
 {
-	struct obd_device* dev = (struct obd_device*)data;
+	struct obd_device* dev = m->private;
 	struct lod_device *lod;
 
 	LASSERT(dev != NULL);
 	lod  = lu2lod_dev(dev->obd_lu_dev);
-	*eof = 1;
-	return snprintf(page, count, "%u\n",
-			lod->lod_desc.ld_active_tgt_count);
+	return seq_printf(m, "%u\n", lod->lod_desc.ld_active_tgt_count);
 }
+LPROC_SEQ_FOPS_RO(lod_activeobd);
 
-static int lod_rd_desc_uuid(char *page, char **start, off_t off, int count,
-			    int *eof, void *data)
+static int lod_desc_uuid_seq_show(struct seq_file *m, void *v)
 {
-	struct obd_device *dev = (struct obd_device*) data;
+	struct obd_device *dev = m->private;
 	struct lod_device *lod;
 
 	LASSERT(dev != NULL);
 	lod  = lu2lod_dev(dev->obd_lu_dev);
-	*eof = 1;
-	return snprintf(page, count, "%s\n", lod->lod_desc.ld_uuid.uuid);
+	return seq_printf(m, "%s\n", lod->lod_desc.ld_uuid.uuid);
 }
+LPROC_SEQ_FOPS_RO(lod_desc_uuid);
 
 /* free priority (0-255): how badly user wants to choose empty osts */
-static int lod_rd_qos_priofree(char *page, char **start, off_t off, int count,
-			       int *eof, void *data)
+static int lod_qos_priofree_seq_show(struct seq_file *m, void *v)
 {
-	struct obd_device *dev = (struct obd_device*) data;
+	struct obd_device *dev = m->private;
 	struct lod_device *lod = lu2lod_dev(dev->obd_lu_dev);
 
 	LASSERT(lod != NULL);
-	*eof = 1;
-	return snprintf(page, count, "%d%%\n",
+	return seq_printf(m, "%d%%\n",
 			(lod->lod_qos.lq_prio_free * 100 + 255) >> 8);
 }
 
-static int lod_wr_qos_priofree(struct file *file, const char *buffer,
-			       unsigned long count, void *data)
+static ssize_t
+lod_qos_priofree_seq_write(struct file *file, const char *buffer,
+			   size_t count, loff_t *off)
 {
-	struct obd_device *dev = (struct obd_device *)data;
+	struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
 	struct lod_device *lod;
 	int val, rc;
 
@@ -238,24 +232,24 @@ static int lod_wr_qos_priofree(struct file *file, const char *buffer,
 	lod->lod_qos.lq_reset = 1;
 	return count;
 }
+LPROC_SEQ_FOPS(lod_qos_priofree);
 
-static int lod_rd_qos_thresholdrr(char *page, char **start, off_t off,
-				  int count, int *eof, void *data)
+static int lod_qos_thresholdrr_seq_show(struct seq_file *m, void *v)
 {
-	struct obd_device *dev = (struct obd_device*) data;
+	struct obd_device *dev = m->private;
 	struct lod_device *lod;
 
 	LASSERT(dev != NULL);
 	lod = lu2lod_dev(dev->obd_lu_dev);
-	*eof = 1;
-	return snprintf(page, count, "%d%%\n",
+	return seq_printf(m, "%d%%\n",
 			(lod->lod_qos.lq_threshold_rr * 100 + 255) >> 8);
 }
 
-static int lod_wr_qos_thresholdrr(struct file *file, const char *buffer,
-				  unsigned long count, void *data)
+static ssize_t
+lod_qos_thresholdrr_seq_write(struct file *file, const char *buffer,
+			      size_t count, loff_t *off)
 {
-	struct obd_device *dev = (struct obd_device *)data;
+	struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
 	struct lod_device *lod;
 	int val, rc;
 
@@ -273,23 +267,23 @@ static int lod_wr_qos_thresholdrr(struct file *file, const char *buffer,
 	lod->lod_qos.lq_dirty = 1;
 	return count;
 }
+LPROC_SEQ_FOPS(lod_qos_thresholdrr);
 
-static int lod_rd_qos_maxage(char *page, char **start, off_t off, int count,
-			     int *eof, void *data)
+static int lod_qos_maxage_seq_show(struct seq_file *m, void *v)
 {
-	struct obd_device *dev = (struct obd_device*) data;
+	struct obd_device *dev = m->private;
 	struct lod_device *lod;
 
 	LASSERT(dev != NULL);
 	lod = lu2lod_dev(dev->obd_lu_dev);
-	*eof = 1;
-	return snprintf(page, count, "%u Sec\n", lod->lod_desc.ld_qos_maxage);
+	return seq_printf(m, "%u Sec\n", lod->lod_desc.ld_qos_maxage);
 }
 
-static int lod_wr_qos_maxage(struct file *file, const char *buffer,
-			     unsigned long count, void *data)
+static ssize_t
+lod_qos_maxage_seq_write(struct file *file, const char *buffer,
+			 size_t count, loff_t *off)
 {
-	struct obd_device	*dev = (struct obd_device *)data;
+	struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
 	struct lustre_cfg_bufs	 bufs;
 	struct lod_device	*lod;
 	struct lu_device	*next;
@@ -327,6 +321,7 @@ static int lod_wr_qos_maxage(struct file *file, const char *buffer,
 
 	return count;
 }
+LPROC_SEQ_FOPS(lod_qos_maxage);
 
 static void *lod_osts_seq_start(struct seq_file *p, loff_t *pos)
 {
@@ -414,56 +409,63 @@ static const struct seq_operations lod_osts_sops = {
 
 static int lod_osts_seq_open(struct inode *inode, struct file *file)
 {
-	struct proc_dir_entry *dp = PDE(inode);
 	struct seq_file *seq;
 	int rc;
 
-	LPROCFS_ENTRY_CHECK(dp);
 	rc = seq_open(file, &lod_osts_sops);
 	if (rc)
 		return rc;
 
 	seq = file->private_data;
-	seq->private = dp->data;
+	seq->private = PDE_DATA(inode);
 	return 0;
 }
 
-static struct lprocfs_vars lprocfs_lod_obd_vars[] = {
-	{ "uuid",         lprocfs_rd_uuid,        0, 0 },
-	{ "stripesize",   lod_rd_stripesize,      lod_wr_stripesize, 0 },
-	{ "stripeoffset", lod_rd_stripeoffset,    lod_wr_stripeoffset, 0 },
-	{ "stripecount",  lod_rd_stripecount,     lod_wr_stripecount, 0 },
-	{ "stripetype",   lod_rd_stripetype,      lod_wr_stripetype, 0 },
-	{ "numobd",       lod_rd_numobd,          0, 0 },
-	{ "activeobd",    lod_rd_activeobd,       0, 0 },
-	{ "desc_uuid",    lod_rd_desc_uuid,       0, 0 },
-	{ "qos_prio_free",lod_rd_qos_priofree,    lod_wr_qos_priofree, 0 },
-	{ "qos_threshold_rr",  lod_rd_qos_thresholdrr, lod_wr_qos_thresholdrr, 0 },
-	{ "qos_maxage",   lod_rd_qos_maxage,      lod_wr_qos_maxage, 0 },
+LPROC_SEQ_FOPS_RO_TYPE(lod, uuid);
+
+LPROC_SEQ_FOPS_RO_TYPE(lod, dt_blksize);
+LPROC_SEQ_FOPS_RO_TYPE(lod, dt_kbytestotal);
+LPROC_SEQ_FOPS_RO_TYPE(lod, dt_kbytesfree);
+LPROC_SEQ_FOPS_RO_TYPE(lod, dt_kbytesavail);
+LPROC_SEQ_FOPS_RO_TYPE(lod, dt_filestotal);
+LPROC_SEQ_FOPS_RO_TYPE(lod, dt_filesfree);
+
+static struct lprocfs_seq_vars lprocfs_lod_obd_vars[] = {
+	{ .name	=	"uuid",
+	  .fops	=	&lod_uuid_fops		},
+	{ .name	=	"stripesize",
+	  .fops	=	&lod_stripesize_fops	},
+	{ .name	=	"stripeoffset",
+	  .fops	=	&lod_stripeoffset_fops	},
+	{ .name	=	"stripecount",
+	  .fops	=	&lod_stripecount_fops	},
+	{ .name	=	"stripetype",
+	  .fops	=	&lod_stripetype_fops	},
+	{ .name	=	"numobd",
+	  .fops	=	&lod_numobd_fops	},
+	{ .name	=	"activeobd",
+	  .fops	=	&lod_activeobd_fops	},
+	{ .name	=	"desc_uuid",
+	  .fops	=	&lod_desc_uuid_fops	},
+	{ .name	=	"qos_prio_free",
+	  .fops	=	&lod_qos_priofree_fops	},
+	{ .name	=	"qos_threshold_rr",
+	  .fops	=	&lod_qos_thresholdrr_fops },
+	{ .name	=	"qos_maxage",
+	  .fops	=	&lod_qos_maxage_fops	},
 	{ 0 }
 };
 
-static struct lprocfs_vars lprocfs_lod_osd_vars[] = {
-	{ "blocksize",    lprocfs_dt_rd_blksize, 0, 0 },
-	{ "kbytestotal",  lprocfs_dt_rd_kbytestotal, 0, 0 },
-	{ "kbytesfree",   lprocfs_dt_rd_kbytesfree, 0, 0 },
-	{ "kbytesavail",  lprocfs_dt_rd_kbytesavail, 0, 0 },
-	{ "filestotal",   lprocfs_dt_rd_filestotal, 0, 0 },
-	{ "filesfree",    lprocfs_dt_rd_filesfree, 0, 0 },
+static struct lprocfs_seq_vars lprocfs_lod_osd_vars[] = {
+	{ "blocksize",		&lod_dt_blksize_fops		},
+	{ "kbytestotal",	&lod_dt_kbytestotal_fops	},
+	{ "kbytesfree",		&lod_dt_kbytesfree_fops		},
+	{ "kbytesavail",	&lod_dt_kbytesavail_fops	},
+	{ "filestotal",		&lod_dt_filestotal_fops		},
+	{ "filesfree",		&lod_dt_filesfree_fops		},
 	{ 0 }
 };
 
-static struct lprocfs_vars lprocfs_lod_module_vars[] = {
-	{ "num_refs",     lprocfs_rd_numrefs,     0, 0 },
-	{ 0 }
-};
-
-void lprocfs_lod_init_vars(struct lprocfs_static_vars *lvars)
-{
-	lvars->module_vars	= lprocfs_lod_module_vars;
-	lvars->obd_vars		= lprocfs_lod_obd_vars;
-}
-
 static const struct file_operations lod_proc_target_fops = {
 	.owner   = THIS_MODULE,
 	.open    = lod_osts_seq_open,
@@ -475,20 +477,18 @@ static const struct file_operations lod_proc_target_fops = {
 int lod_procfs_init(struct lod_device *lod)
 {
 	struct obd_device *obd = lod2obd(lod);
-	struct lprocfs_static_vars lvars;
-	cfs_proc_dir_entry_t *lov_proc_dir;
 	int rc;
 
-	lprocfs_lod_init_vars(&lvars);
-	rc = lprocfs_obd_setup(obd, lvars.obd_vars);
+	obd->obd_vars = lprocfs_lod_obd_vars;
+	rc = lprocfs_seq_obd_setup(obd);
 	if (rc) {
 		CERROR("%s: cannot setup procfs entry: %d\n",
 		       obd->obd_name, rc);
 		RETURN(rc);
 	}
 
-	rc = lprocfs_add_vars(obd->obd_proc_entry, lprocfs_lod_osd_vars,
-			      &lod->lod_dt_dev);
+	rc = lprocfs_seq_add_vars(obd->obd_proc_entry, lprocfs_lod_osd_vars,
+				  &lod->lod_dt_dev);
 	if (rc) {
 		CERROR("%s: cannot setup procfs entry: %d\n",
 		       obd->obd_name, rc);
@@ -503,9 +503,9 @@ int lod_procfs_init(struct lod_device *lod)
 		GOTO(out, rc);
 	}
 
-	lod->lod_pool_proc_entry = lprocfs_register("pools",
-						    obd->obd_proc_entry,
-						    NULL, NULL);
+	lod->lod_pool_proc_entry = lprocfs_seq_register("pools",
+							obd->obd_proc_entry,
+							NULL, NULL);
 	if (IS_ERR(lod->lod_pool_proc_entry)) {
 		rc = PTR_ERR(lod->lod_pool_proc_entry);
 		lod->lod_pool_proc_entry = NULL;
@@ -514,14 +514,18 @@ int lod_procfs_init(struct lod_device *lod)
 		GOTO(out, rc);
 	}
 
-	/* for compatibility we link old procfs's OSC entries to osp ones */
-	lov_proc_dir = lprocfs_srch(proc_lustre_root, "lov");
-	if (lov_proc_dir != NULL && strstr(obd->obd_name, "lov") != NULL)
+	/* for compatibility we link old procfs's LOV entries to lod ones */
+	if (obd->obd_type->typ_procsym != NULL) {
 		lod->lod_symlink = lprocfs_add_symlink(obd->obd_name,
-						       lov_proc_dir,
-						       "../lod/%s",
-						       obd->obd_name);
-
+							obd->obd_type->typ_procsym,
+							"../lod/%s",
+							obd->obd_name);
+		if (lod->lod_symlink == NULL) {
+			CERROR("could not register LOV symlink for "
+				"/proc/fs/lustre/lod/%s.", obd->obd_name);
+			lprocfs_remove(&obd->obd_type->typ_procsym);
+		}
+	}
 	RETURN(0);
 
 out:
@@ -542,6 +546,9 @@ void lod_procfs_fini(struct lod_device *lod)
 		lod->lod_pool_proc_entry = NULL;
 	}
 
+	if (obd->obd_type->typ_procsym != NULL)
+		lprocfs_remove(&obd->obd_type->typ_procsym);
+
 	lprocfs_obd_cleanup(obd);
 }
 
-- 
1.8.5.3