.. | .. |
---|
11 | 11 | #include <linux/sched.h> |
---|
12 | 12 | #include <linux/types.h> |
---|
13 | 13 | #include <linux/seq_file.h> |
---|
14 | | -#include <linux/proc_fs.h> |
---|
15 | 14 | #include <linux/exportfs.h> |
---|
16 | 15 | |
---|
17 | 16 | #include "inotify/inotify.h" |
---|
| 17 | +#include "fdinfo.h" |
---|
18 | 18 | #include "fsnotify.h" |
---|
19 | 19 | |
---|
20 | 20 | #if defined(CONFIG_PROC_FS) |
---|
.. | .. |
---|
49 | 49 | f.handle.handle_bytes = sizeof(f.pad); |
---|
50 | 50 | size = f.handle.handle_bytes >> 2; |
---|
51 | 51 | |
---|
52 | | - ret = exportfs_encode_inode_fh(inode, (struct fid *)f.handle.f_handle, &size, 0); |
---|
| 52 | + ret = exportfs_encode_inode_fh(inode, (struct fid *)f.handle.f_handle, &size, NULL); |
---|
53 | 53 | if ((ret == FILEID_INVALID) || (ret < 0)) { |
---|
54 | 54 | WARN_ONCE(1, "Can't encode file handler for inotify: %d\n", ret); |
---|
55 | 55 | return; |
---|
.. | .. |
---|
83 | 83 | inode_mark = container_of(mark, struct inotify_inode_mark, fsn_mark); |
---|
84 | 84 | inode = igrab(fsnotify_conn_inode(mark->connector)); |
---|
85 | 85 | if (inode) { |
---|
86 | | - /* |
---|
87 | | - * IN_ALL_EVENTS represents all of the mask bits |
---|
88 | | - * that we expose to userspace. There is at |
---|
89 | | - * least one bit (FS_EVENT_ON_CHILD) which is |
---|
90 | | - * used only internally to the kernel. |
---|
91 | | - */ |
---|
92 | | - u32 mask = mark->mask & IN_ALL_EVENTS; |
---|
93 | | - seq_printf(m, "inotify wd:%x ino:%lx sdev:%x mask:%x ignored_mask:%x ", |
---|
| 86 | + seq_printf(m, "inotify wd:%x ino:%lx sdev:%x mask:%x ignored_mask:0 ", |
---|
94 | 87 | inode_mark->wd, inode->i_ino, inode->i_sb->s_dev, |
---|
95 | | - mask, mark->ignored_mask); |
---|
| 88 | + inotify_mark_user_mask(mark)); |
---|
96 | 89 | show_mark_fhandle(m, inode); |
---|
97 | 90 | seq_putc(m, '\n'); |
---|
98 | 91 | iput(inode); |
---|
.. | .. |
---|
131 | 124 | |
---|
132 | 125 | seq_printf(m, "fanotify mnt_id:%x mflags:%x mask:%x ignored_mask:%x\n", |
---|
133 | 126 | mnt->mnt_id, mflags, mark->mask, mark->ignored_mask); |
---|
| 127 | + } else if (mark->connector->type == FSNOTIFY_OBJ_TYPE_SB) { |
---|
| 128 | + struct super_block *sb = fsnotify_conn_sb(mark->connector); |
---|
| 129 | + |
---|
| 130 | + seq_printf(m, "fanotify sdev:%x mflags:%x mask:%x ignored_mask:%x\n", |
---|
| 131 | + sb->s_dev, mflags, mark->mask, mark->ignored_mask); |
---|
134 | 132 | } |
---|
135 | 133 | } |
---|
136 | 134 | |
---|
137 | 135 | void fanotify_show_fdinfo(struct seq_file *m, struct file *f) |
---|
138 | 136 | { |
---|
139 | 137 | struct fsnotify_group *group = f->private_data; |
---|
140 | | - unsigned int flags = 0; |
---|
141 | | - |
---|
142 | | - switch (group->priority) { |
---|
143 | | - case FS_PRIO_0: |
---|
144 | | - flags |= FAN_CLASS_NOTIF; |
---|
145 | | - break; |
---|
146 | | - case FS_PRIO_1: |
---|
147 | | - flags |= FAN_CLASS_CONTENT; |
---|
148 | | - break; |
---|
149 | | - case FS_PRIO_2: |
---|
150 | | - flags |= FAN_CLASS_PRE_CONTENT; |
---|
151 | | - break; |
---|
152 | | - } |
---|
153 | | - |
---|
154 | | - if (group->max_events == UINT_MAX) |
---|
155 | | - flags |= FAN_UNLIMITED_QUEUE; |
---|
156 | | - |
---|
157 | | - if (group->fanotify_data.max_marks == UINT_MAX) |
---|
158 | | - flags |= FAN_UNLIMITED_MARKS; |
---|
159 | | - |
---|
160 | | - if (group->fanotify_data.audit) |
---|
161 | | - flags |= FAN_ENABLE_AUDIT; |
---|
162 | 138 | |
---|
163 | 139 | seq_printf(m, "fanotify flags:%x event-flags:%x\n", |
---|
164 | | - flags, group->fanotify_data.f_flags); |
---|
| 140 | + group->fanotify_data.flags, group->fanotify_data.f_flags); |
---|
165 | 141 | |
---|
166 | 142 | show_fdinfo(m, f, fanotify_fdinfo); |
---|
167 | 143 | } |
---|