diff --git a/fs/proc/fd.c b/fs/proc/fd.c index f28a875f8779f8cd1fec3ff8869eb4b2d802764c..d7a4a28ef63024c66ef862594701d1e389e77a47 100644 --- a/fs/proc/fd.c +++ b/fs/proc/fd.c @@ -50,6 +50,8 @@ static int seq_show(struct seq_file *m, void *v) if (!ret) { seq_printf(m, "pos:\t%lli\nflags:\t0%o\n", (long long)file->f_pos, f_flags); + if (file->f_op->show_fdinfo) + ret = file->f_op->show_fdinfo(m, file); fput(file); } diff --git a/include/linux/fs.h b/include/linux/fs.h index 029552ff774c0a7a29edbd7d108497e2ec70e4c0..5abf703d06ba8de5767dabf30dcc78136b47068f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -44,6 +44,7 @@ struct vm_area_struct; struct vfsmount; struct cred; struct swap_info_struct; +struct seq_file; extern void __init inode_init(void); extern void __init inode_init_early(void); @@ -1543,6 +1544,7 @@ struct file_operations { int (*setlease)(struct file *, long, struct file_lock **); long (*fallocate)(struct file *file, int mode, loff_t offset, loff_t len); + int (*show_fdinfo)(struct seq_file *m, struct file *f); }; struct inode_operations { @@ -1578,8 +1580,6 @@ struct inode_operations { umode_t create_mode, int *opened); } ____cacheline_aligned; -struct seq_file; - ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, unsigned long nr_segs, unsigned long fast_segs, struct iovec *fast_pointer,