diff options
-rw-r--r-- | fs/dlm/debug_fs.c | 62 |
1 files changed, 48 insertions, 14 deletions
diff --git a/fs/dlm/debug_fs.c b/fs/dlm/debug_fs.c index eea64912c9c0..466f7d60edc2 100644 --- a/fs/dlm/debug_fs.c +++ b/fs/dlm/debug_fs.c | |||
@@ -607,20 +607,54 @@ static const struct file_operations format2_fops; | |||
607 | static const struct file_operations format3_fops; | 607 | static const struct file_operations format3_fops; |
608 | static const struct file_operations format4_fops; | 608 | static const struct file_operations format4_fops; |
609 | 609 | ||
610 | static int table_open(struct inode *inode, struct file *file) | 610 | static int table_open1(struct inode *inode, struct file *file) |
611 | { | 611 | { |
612 | struct seq_file *seq; | 612 | struct seq_file *seq; |
613 | int ret = -1; | 613 | int ret; |
614 | 614 | ||
615 | if (file->f_op == &format1_fops) | 615 | ret = seq_open(file, &format1_seq_ops); |
616 | ret = seq_open(file, &format1_seq_ops); | 616 | if (ret) |
617 | else if (file->f_op == &format2_fops) | 617 | return ret; |
618 | ret = seq_open(file, &format2_seq_ops); | 618 | |
619 | else if (file->f_op == &format3_fops) | 619 | seq = file->private_data; |
620 | ret = seq_open(file, &format3_seq_ops); | 620 | seq->private = inode->i_private; /* the dlm_ls */ |
621 | else if (file->f_op == &format4_fops) | 621 | return 0; |
622 | ret = seq_open(file, &format4_seq_ops); | 622 | } |
623 | |||
624 | static int table_open2(struct inode *inode, struct file *file) | ||
625 | { | ||
626 | struct seq_file *seq; | ||
627 | int ret; | ||
628 | |||
629 | ret = seq_open(file, &format2_seq_ops); | ||
630 | if (ret) | ||
631 | return ret; | ||
632 | |||
633 | seq = file->private_data; | ||
634 | seq->private = inode->i_private; /* the dlm_ls */ | ||
635 | return 0; | ||
636 | } | ||
637 | |||
638 | static int table_open3(struct inode *inode, struct file *file) | ||
639 | { | ||
640 | struct seq_file *seq; | ||
641 | int ret; | ||
642 | |||
643 | ret = seq_open(file, &format3_seq_ops); | ||
644 | if (ret) | ||
645 | return ret; | ||
646 | |||
647 | seq = file->private_data; | ||
648 | seq->private = inode->i_private; /* the dlm_ls */ | ||
649 | return 0; | ||
650 | } | ||
651 | |||
652 | static int table_open4(struct inode *inode, struct file *file) | ||
653 | { | ||
654 | struct seq_file *seq; | ||
655 | int ret; | ||
623 | 656 | ||
657 | ret = seq_open(file, &format4_seq_ops); | ||
624 | if (ret) | 658 | if (ret) |
625 | return ret; | 659 | return ret; |
626 | 660 | ||
@@ -631,7 +665,7 @@ static int table_open(struct inode *inode, struct file *file) | |||
631 | 665 | ||
632 | static const struct file_operations format1_fops = { | 666 | static const struct file_operations format1_fops = { |
633 | .owner = THIS_MODULE, | 667 | .owner = THIS_MODULE, |
634 | .open = table_open, | 668 | .open = table_open1, |
635 | .read = seq_read, | 669 | .read = seq_read, |
636 | .llseek = seq_lseek, | 670 | .llseek = seq_lseek, |
637 | .release = seq_release | 671 | .release = seq_release |
@@ -639,7 +673,7 @@ static const struct file_operations format1_fops = { | |||
639 | 673 | ||
640 | static const struct file_operations format2_fops = { | 674 | static const struct file_operations format2_fops = { |
641 | .owner = THIS_MODULE, | 675 | .owner = THIS_MODULE, |
642 | .open = table_open, | 676 | .open = table_open2, |
643 | .read = seq_read, | 677 | .read = seq_read, |
644 | .llseek = seq_lseek, | 678 | .llseek = seq_lseek, |
645 | .release = seq_release | 679 | .release = seq_release |
@@ -647,7 +681,7 @@ static const struct file_operations format2_fops = { | |||
647 | 681 | ||
648 | static const struct file_operations format3_fops = { | 682 | static const struct file_operations format3_fops = { |
649 | .owner = THIS_MODULE, | 683 | .owner = THIS_MODULE, |
650 | .open = table_open, | 684 | .open = table_open3, |
651 | .read = seq_read, | 685 | .read = seq_read, |
652 | .llseek = seq_lseek, | 686 | .llseek = seq_lseek, |
653 | .release = seq_release | 687 | .release = seq_release |
@@ -655,7 +689,7 @@ static const struct file_operations format3_fops = { | |||
655 | 689 | ||
656 | static const struct file_operations format4_fops = { | 690 | static const struct file_operations format4_fops = { |
657 | .owner = THIS_MODULE, | 691 | .owner = THIS_MODULE, |
658 | .open = table_open, | 692 | .open = table_open4, |
659 | .read = seq_read, | 693 | .read = seq_read, |
660 | .llseek = seq_lseek, | 694 | .llseek = seq_lseek, |
661 | .release = seq_release | 695 | .release = seq_release |