aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/filesystems/proc.txt17
-rw-r--r--fs/proc/fd.c6
2 files changed, 16 insertions, 7 deletions
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index f00bee144add..8b9cd8eb3f91 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -1648,18 +1648,21 @@ pids, so one need to either stop or freeze processes being inspected
1648if precise results are needed. 1648if precise results are needed.
1649 1649
1650 1650
16513.7 /proc/<pid>/fdinfo/<fd> - Information about opened file 16513.8 /proc/<pid>/fdinfo/<fd> - Information about opened file
1652--------------------------------------------------------------- 1652---------------------------------------------------------------
1653This file provides information associated with an opened file. The regular 1653This file provides information associated with an opened file. The regular
1654files have at least two fields -- 'pos' and 'flags'. The 'pos' represents 1654files have at least three fields -- 'pos', 'flags' and mnt_id. The 'pos'
1655the current offset of the opened file in decimal form [see lseek(2) for 1655represents the current offset of the opened file in decimal form [see lseek(2)
1656details] and 'flags' denotes the octal O_xxx mask the file has been 1656for details], 'flags' denotes the octal O_xxx mask the file has been
1657created with [see open(2) for details]. 1657created with [see open(2) for details] and 'mnt_id' represents mount ID of
1658the file system containing the opened file [see 3.5 /proc/<pid>/mountinfo
1659for details].
1658 1660
1659A typical output is 1661A typical output is
1660 1662
1661 pos: 0 1663 pos: 0
1662 flags: 0100002 1664 flags: 0100002
1665 mnt_id: 19
1663 1666
1664The files such as eventfd, fsnotify, signalfd, epoll among the regular pos/flags 1667The files such as eventfd, fsnotify, signalfd, epoll among the regular pos/flags
1665pair provide additional information particular to the objects they represent. 1668pair provide additional information particular to the objects they represent.
@@ -1668,6 +1671,7 @@ pair provide additional information particular to the objects they represent.
1668 ~~~~~~~~~~~~~ 1671 ~~~~~~~~~~~~~
1669 pos: 0 1672 pos: 0
1670 flags: 04002 1673 flags: 04002
1674 mnt_id: 9
1671 eventfd-count: 5a 1675 eventfd-count: 5a
1672 1676
1673 where 'eventfd-count' is hex value of a counter. 1677 where 'eventfd-count' is hex value of a counter.
@@ -1676,6 +1680,7 @@ pair provide additional information particular to the objects they represent.
1676 ~~~~~~~~~~~~~~ 1680 ~~~~~~~~~~~~~~
1677 pos: 0 1681 pos: 0
1678 flags: 04002 1682 flags: 04002
1683 mnt_id: 9
1679 sigmask: 0000000000000200 1684 sigmask: 0000000000000200
1680 1685
1681 where 'sigmask' is hex value of the signal mask associated 1686 where 'sigmask' is hex value of the signal mask associated
@@ -1685,6 +1690,7 @@ pair provide additional information particular to the objects they represent.
1685 ~~~~~~~~~~~ 1690 ~~~~~~~~~~~
1686 pos: 0 1691 pos: 0
1687 flags: 02 1692 flags: 02
1693 mnt_id: 9
1688 tfd: 5 events: 1d data: ffffffffffffffff 1694 tfd: 5 events: 1d data: ffffffffffffffff
1689 1695
1690 where 'tfd' is a target file descriptor number in decimal form, 1696 where 'tfd' is a target file descriptor number in decimal form,
@@ -1718,6 +1724,7 @@ pair provide additional information particular to the objects they represent.
1718 1724
1719 pos: 0 1725 pos: 0
1720 flags: 02 1726 flags: 02
1727 mnt_id: 9
1721 fanotify flags:10 event-flags:0 1728 fanotify flags:10 event-flags:0
1722 fanotify mnt_id:12 mflags:40 mask:38 ignored_mask:40000003 1729 fanotify mnt_id:12 mflags:40 mask:38 ignored_mask:40000003
1723 fanotify ino:4f969 sdev:800013 mflags:0 mask:3b ignored_mask:40000000 fhandle-bytes:8 fhandle-type:1 f_handle:69f90400c275b5b4 1730 fanotify ino:4f969 sdev:800013 mflags:0 mask:3b ignored_mask:40000000 fhandle-bytes:8 fhandle-type:1 f_handle:69f90400c275b5b4
diff --git a/fs/proc/fd.c b/fs/proc/fd.c
index 985ea881b5bc..0788d093f5d8 100644
--- a/fs/proc/fd.c
+++ b/fs/proc/fd.c
@@ -11,6 +11,7 @@
11 11
12#include <linux/proc_fs.h> 12#include <linux/proc_fs.h>
13 13
14#include "../mount.h"
14#include "internal.h" 15#include "internal.h"
15#include "fd.h" 16#include "fd.h"
16 17
@@ -48,8 +49,9 @@ static int seq_show(struct seq_file *m, void *v)
48 } 49 }
49 50
50 if (!ret) { 51 if (!ret) {
51 seq_printf(m, "pos:\t%lli\nflags:\t0%o\n", 52 seq_printf(m, "pos:\t%lli\nflags:\t0%o\nmnt_id:\t%i\n",
52 (long long)file->f_pos, f_flags); 53 (long long)file->f_pos, f_flags,
54 real_mount(file->f_path.mnt)->mnt_id);
53 if (file->f_op->show_fdinfo) 55 if (file->f_op->show_fdinfo)
54 ret = file->f_op->show_fdinfo(m, file); 56 ret = file->f_op->show_fdinfo(m, file);
55 fput(file); 57 fput(file);