aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/procfs.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
index 07c2162ef556..33532f79b4f7 100644
--- a/fs/reiserfs/procfs.c
+++ b/fs/reiserfs/procfs.c
@@ -394,20 +394,24 @@ static int set_sb(struct super_block *sb, void *data)
394 return -ENOENT; 394 return -ENOENT;
395} 395}
396 396
397struct reiserfs_seq_private {
398 struct super_block *sb;
399 int (*show) (struct seq_file *, struct super_block *);
400};
401
397static void *r_start(struct seq_file *m, loff_t * pos) 402static void *r_start(struct seq_file *m, loff_t * pos)
398{ 403{
399 struct proc_dir_entry *de = m->private; 404 struct reiserfs_seq_private *priv = m->private;
400 struct super_block *s = de->parent->data;
401 loff_t l = *pos; 405 loff_t l = *pos;
402 406
403 if (l) 407 if (l)
404 return NULL; 408 return NULL;
405 409
406 if (IS_ERR(sget(&reiserfs_fs_type, test_sb, set_sb, 0, s))) 410 if (IS_ERR(sget(&reiserfs_fs_type, test_sb, set_sb, 0, priv->sb)))
407 return NULL; 411 return NULL;
408 412
409 up_write(&s->s_umount); 413 up_write(&priv->sb->s_umount);
410 return s; 414 return priv->sb;
411} 415}
412 416
413static void *r_next(struct seq_file *m, void *v, loff_t * pos) 417static void *r_next(struct seq_file *m, void *v, loff_t * pos)
@@ -426,9 +430,8 @@ static void r_stop(struct seq_file *m, void *v)
426 430
427static int r_show(struct seq_file *m, void *v) 431static int r_show(struct seq_file *m, void *v)
428{ 432{
429 struct proc_dir_entry *de = m->private; 433 struct reiserfs_seq_private *priv = m->private;
430 int (*show) (struct seq_file *, struct super_block *) = de->data; 434 return priv->show(m, v);
431 return show(m, v);
432} 435}
433 436
434static const struct seq_operations r_ops = { 437static const struct seq_operations r_ops = {
@@ -440,11 +443,15 @@ static const struct seq_operations r_ops = {
440 443
441static int r_open(struct inode *inode, struct file *file) 444static int r_open(struct inode *inode, struct file *file)
442{ 445{
443 int ret = seq_open(file, &r_ops); 446 struct reiserfs_seq_private *priv;
447 int ret = seq_open_private(file, &r_ops,
448 sizeof(struct reiserfs_seq_private));
444 449
445 if (!ret) { 450 if (!ret) {
446 struct seq_file *m = file->private_data; 451 struct seq_file *m = file->private_data;
447 m->private = PDE(inode); 452 priv = m->private;
453 priv->sb = proc_get_parent_data(inode);
454 priv->show = PDE_DATA(inode);
448 } 455 }
449 return ret; 456 return ret;
450} 457}
@@ -453,7 +460,7 @@ static const struct file_operations r_file_operations = {
453 .open = r_open, 460 .open = r_open,
454 .read = seq_read, 461 .read = seq_read,
455 .llseek = seq_lseek, 462 .llseek = seq_lseek,
456 .release = seq_release, 463 .release = seq_release_private,
457 .owner = THIS_MODULE, 464 .owner = THIS_MODULE,
458}; 465};
459 466