rev |
line source |
gokhlayeh@9257
|
1 diff --git a/fs/file_table.c b/fs/file_table.c
|
gokhlayeh@9257
|
2 index a04bdd8..fbf8908 100644
|
gokhlayeh@9257
|
3 --- a/fs/file_table.c
|
gokhlayeh@9257
|
4 +++ b/fs/file_table.c
|
gokhlayeh@9257
|
5 @@ -20,7 +20,6 @@
|
gokhlayeh@9257
|
6 #include <linux/cdev.h>
|
gokhlayeh@9257
|
7 #include <linux/fsnotify.h>
|
gokhlayeh@9257
|
8 #include <linux/sysctl.h>
|
gokhlayeh@9257
|
9 -#include <linux/lglock.h>
|
gokhlayeh@9257
|
10 #include <linux/percpu_counter.h>
|
gokhlayeh@9257
|
11 #include <linux/percpu.h>
|
gokhlayeh@9257
|
12 #include <linux/ima.h>
|
gokhlayeh@9257
|
13 @@ -34,7 +33,6 @@ struct files_stat_struct files_stat = {
|
gokhlayeh@9257
|
14 .max_files = NR_FILE
|
gokhlayeh@9257
|
15 };
|
gokhlayeh@9257
|
16
|
gokhlayeh@9257
|
17 -DECLARE_LGLOCK(files_lglock);
|
gokhlayeh@9257
|
18 DEFINE_LGLOCK(files_lglock);
|
gokhlayeh@9257
|
19
|
gokhlayeh@9257
|
20 /* SLAB cache for file structures */
|
gokhlayeh@9257
|
21 @@ -394,37 +392,6 @@ void file_sb_list_del(struct file *file)
|
gokhlayeh@9257
|
22 }
|
gokhlayeh@9257
|
23 }
|
gokhlayeh@9257
|
24
|
gokhlayeh@9257
|
25 -#ifdef CONFIG_SMP
|
gokhlayeh@9257
|
26 -
|
gokhlayeh@9257
|
27 -/*
|
gokhlayeh@9257
|
28 - * These macros iterate all files on all CPUs for a given superblock.
|
gokhlayeh@9257
|
29 - * files_lglock must be held globally.
|
gokhlayeh@9257
|
30 - */
|
gokhlayeh@9257
|
31 -#define do_file_list_for_each_entry(__sb, __file) \
|
gokhlayeh@9257
|
32 -{ \
|
gokhlayeh@9257
|
33 - int i; \
|
gokhlayeh@9257
|
34 - for_each_possible_cpu(i) { \
|
gokhlayeh@9257
|
35 - struct list_head *list; \
|
gokhlayeh@9257
|
36 - list = per_cpu_ptr((__sb)->s_files, i); \
|
gokhlayeh@9257
|
37 - list_for_each_entry((__file), list, f_u.fu_list)
|
gokhlayeh@9257
|
38 -
|
gokhlayeh@9257
|
39 -#define while_file_list_for_each_entry \
|
gokhlayeh@9257
|
40 - } \
|
gokhlayeh@9257
|
41 -}
|
gokhlayeh@9257
|
42 -
|
gokhlayeh@9257
|
43 -#else
|
gokhlayeh@9257
|
44 -
|
gokhlayeh@9257
|
45 -#define do_file_list_for_each_entry(__sb, __file) \
|
gokhlayeh@9257
|
46 -{ \
|
gokhlayeh@9257
|
47 - struct list_head *list; \
|
gokhlayeh@9257
|
48 - list = &(sb)->s_files; \
|
gokhlayeh@9257
|
49 - list_for_each_entry((__file), list, f_u.fu_list)
|
gokhlayeh@9257
|
50 -
|
gokhlayeh@9257
|
51 -#define while_file_list_for_each_entry \
|
gokhlayeh@9257
|
52 -}
|
gokhlayeh@9257
|
53 -
|
gokhlayeh@9257
|
54 -#endif
|
gokhlayeh@9257
|
55 -
|
gokhlayeh@9257
|
56 int fs_may_remount_ro(struct super_block *sb)
|
gokhlayeh@9257
|
57 {
|
gokhlayeh@9257
|
58 struct file *file;
|
gokhlayeh@9257
|
59 diff --git a/fs/statfs.c b/fs/statfs.c
|
gokhlayeh@9257
|
60 index 30ea8c8..9025c98 100644
|
gokhlayeh@9257
|
61 --- a/fs/statfs.c
|
gokhlayeh@9257
|
62 +++ b/fs/statfs.c
|
gokhlayeh@9257
|
63 @@ -61,6 +61,7 @@ int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf)
|
gokhlayeh@9257
|
64 buf->f_frsize = buf->f_bsize;
|
gokhlayeh@9257
|
65 return retval;
|
gokhlayeh@9257
|
66 }
|
gokhlayeh@9257
|
67 +EXPORT_SYMBOL(statfs_by_dentry);
|
gokhlayeh@9257
|
68
|
gokhlayeh@9257
|
69 int vfs_statfs(struct path *path, struct kstatfs *buf)
|
gokhlayeh@9257
|
70 {
|
gokhlayeh@9257
|
71 diff --git a/include/linux/fs.h b/include/linux/fs.h
|
gokhlayeh@9257
|
72 index 63d069b..741d296 100644
|
gokhlayeh@9257
|
73 --- a/include/linux/fs.h
|
gokhlayeh@9257
|
74 +++ b/include/linux/fs.h
|
gokhlayeh@9257
|
75 @@ -9,6 +9,7 @@
|
gokhlayeh@9257
|
76 #include <linux/limits.h>
|
gokhlayeh@9257
|
77 #include <linux/ioctl.h>
|
gokhlayeh@9257
|
78 #include <linux/blk_types.h>
|
gokhlayeh@9257
|
79 +#include <linux/lglock.h>
|
gokhlayeh@9257
|
80
|
gokhlayeh@9257
|
81 /*
|
gokhlayeh@9257
|
82 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
|
gokhlayeh@9257
|
83 @@ -1814,6 +1815,7 @@ extern struct vfsmount *collect_mounts(struct path *);
|
gokhlayeh@9257
|
84 extern void drop_collected_mounts(struct vfsmount *);
|
gokhlayeh@9257
|
85 extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *,
|
gokhlayeh@9257
|
86 struct vfsmount *);
|
gokhlayeh@9257
|
87 +extern int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf);
|
gokhlayeh@9257
|
88 extern int vfs_statfs(struct path *, struct kstatfs *);
|
gokhlayeh@9257
|
89 extern int statfs_by_dentry(struct dentry *, struct kstatfs *);
|
gokhlayeh@9257
|
90 extern int freeze_super(struct super_block *super);
|
gokhlayeh@9257
|
91 @@ -2481,5 +2483,39 @@ int __init get_filesystem_list(char *buf);
|
gokhlayeh@9257
|
92 #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \
|
gokhlayeh@9257
|
93 (flag & FMODE_NONOTIFY)))
|
gokhlayeh@9257
|
94
|
gokhlayeh@9257
|
95 +
|
gokhlayeh@9257
|
96 +DECLARE_LGLOCK(files_lglock);
|
gokhlayeh@9257
|
97 +
|
gokhlayeh@9257
|
98 +#ifdef CONFIG_SMP
|
gokhlayeh@9257
|
99 +
|
gokhlayeh@9257
|
100 +/*
|
gokhlayeh@9257
|
101 + * These macros iterate all files on all CPUs for a given superblock.
|
gokhlayeh@9257
|
102 + * files_lglock must be held globally.
|
gokhlayeh@9257
|
103 + */
|
gokhlayeh@9257
|
104 +#define do_file_list_for_each_entry(__sb, __file) \
|
gokhlayeh@9257
|
105 +{ \
|
gokhlayeh@9257
|
106 + int i; \
|
gokhlayeh@9257
|
107 + for_each_possible_cpu(i) { \
|
gokhlayeh@9257
|
108 + struct list_head *list; \
|
gokhlayeh@9257
|
109 + list = per_cpu_ptr((__sb)->s_files, i); \
|
gokhlayeh@9257
|
110 + list_for_each_entry((__file), list, f_u.fu_list)
|
gokhlayeh@9257
|
111 +
|
gokhlayeh@9257
|
112 +#define while_file_list_for_each_entry \
|
gokhlayeh@9257
|
113 + } \
|
gokhlayeh@9257
|
114 +}
|
gokhlayeh@9257
|
115 +
|
gokhlayeh@9257
|
116 +#else
|
gokhlayeh@9257
|
117 +
|
gokhlayeh@9257
|
118 +#define do_file_list_for_each_entry(__sb, __file) \
|
gokhlayeh@9257
|
119 +{ \
|
gokhlayeh@9257
|
120 + struct list_head *list; \
|
gokhlayeh@9257
|
121 + list = &(sb)->s_files; \
|
gokhlayeh@9257
|
122 + list_for_each_entry((__file), list, f_u.fu_list)
|
gokhlayeh@9257
|
123 +
|
gokhlayeh@9257
|
124 +#define while_file_list_for_each_entry \
|
gokhlayeh@9257
|
125 +}
|
gokhlayeh@9257
|
126 +
|
gokhlayeh@9257
|
127 +#endif
|
gokhlayeh@9257
|
128 +
|
gokhlayeh@9257
|
129 #endif /* __KERNEL__ */
|
gokhlayeh@9257
|
130 #endif /* _LINUX_FS_H */
|