diff options
Diffstat (limited to 'fs/proc/fd.c')
| -rw-r--r-- | fs/proc/fd.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/fs/proc/fd.c b/fs/proc/fd.c index 8e5ad83b629a..af84ad04df77 100644 --- a/fs/proc/fd.c +++ b/fs/proc/fd.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/security.h> | 8 | #include <linux/security.h> |
| 9 | #include <linux/file.h> | 9 | #include <linux/file.h> |
| 10 | #include <linux/seq_file.h> | 10 | #include <linux/seq_file.h> |
| 11 | #include <linux/fs.h> | ||
| 11 | 12 | ||
| 12 | #include <linux/proc_fs.h> | 13 | #include <linux/proc_fs.h> |
| 13 | 14 | ||
| @@ -48,17 +49,23 @@ static int seq_show(struct seq_file *m, void *v) | |||
| 48 | put_files_struct(files); | 49 | put_files_struct(files); |
| 49 | } | 50 | } |
| 50 | 51 | ||
| 51 | if (!ret) { | 52 | if (ret) |
| 52 | seq_printf(m, "pos:\t%lli\nflags:\t0%o\nmnt_id:\t%i\n", | 53 | return ret; |
| 53 | (long long)file->f_pos, f_flags, | ||
| 54 | real_mount(file->f_path.mnt)->mnt_id); | ||
| 55 | if (file->f_op->show_fdinfo) | ||
| 56 | file->f_op->show_fdinfo(m, file); | ||
| 57 | ret = seq_has_overflowed(m); | ||
| 58 | fput(file); | ||
| 59 | } | ||
| 60 | 54 | ||
| 61 | return ret; | 55 | seq_printf(m, "pos:\t%lli\nflags:\t0%o\nmnt_id:\t%i\n", |
| 56 | (long long)file->f_pos, f_flags, | ||
| 57 | real_mount(file->f_path.mnt)->mnt_id); | ||
| 58 | |||
| 59 | show_fd_locks(m, file, files); | ||
| 60 | if (seq_has_overflowed(m)) | ||
| 61 | goto out; | ||
| 62 | |||
| 63 | if (file->f_op->show_fdinfo) | ||
| 64 | file->f_op->show_fdinfo(m, file); | ||
| 65 | |||
| 66 | out: | ||
| 67 | fput(file); | ||
| 68 | return 0; | ||
| 62 | } | 69 | } |
| 63 | 70 | ||
| 64 | static int seq_fdinfo_open(struct inode *inode, struct file *file) | 71 | static int seq_fdinfo_open(struct inode *inode, struct file *file) |
