diff options
-rw-r--r-- | arch/ia64/kernel/perfmon.c | 8 | ||||
-rw-r--r-- | fs/9p/vfs_dentry.c | 19 | ||||
-rw-r--r-- | fs/configfs/dir.c | 12 | ||||
-rw-r--r-- | fs/efivarfs/super.c | 11 | ||||
-rw-r--r-- | fs/hostfs/hostfs_kern.c | 11 | ||||
-rw-r--r-- | fs/libfs.c | 12 | ||||
-rw-r--r-- | fs/proc/generic.c | 18 | ||||
-rw-r--r-- | fs/proc/namespaces.c | 8 | ||||
-rw-r--r-- | include/linux/fs.h | 2 | ||||
-rw-r--r-- | kernel/cgroup.c | 7 | ||||
-rw-r--r-- | net/sunrpc/rpc_pipe.c | 11 |
11 files changed, 18 insertions, 101 deletions
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 5a9ff1c3c3e9..cb592773c78b 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -2166,12 +2166,6 @@ static const struct file_operations pfm_file_ops = { | |||
2166 | .flush = pfm_flush | 2166 | .flush = pfm_flush |
2167 | }; | 2167 | }; |
2168 | 2168 | ||
2169 | static int | ||
2170 | pfmfs_delete_dentry(const struct dentry *dentry) | ||
2171 | { | ||
2172 | return 1; | ||
2173 | } | ||
2174 | |||
2175 | static char *pfmfs_dname(struct dentry *dentry, char *buffer, int buflen) | 2169 | static char *pfmfs_dname(struct dentry *dentry, char *buffer, int buflen) |
2176 | { | 2170 | { |
2177 | return dynamic_dname(dentry, buffer, buflen, "pfm:[%lu]", | 2171 | return dynamic_dname(dentry, buffer, buflen, "pfm:[%lu]", |
@@ -2179,7 +2173,7 @@ static char *pfmfs_dname(struct dentry *dentry, char *buffer, int buflen) | |||
2179 | } | 2173 | } |
2180 | 2174 | ||
2181 | static const struct dentry_operations pfmfs_dentry_operations = { | 2175 | static const struct dentry_operations pfmfs_dentry_operations = { |
2182 | .d_delete = pfmfs_delete_dentry, | 2176 | .d_delete = always_delete_dentry, |
2183 | .d_dname = pfmfs_dname, | 2177 | .d_dname = pfmfs_dname, |
2184 | }; | 2178 | }; |
2185 | 2179 | ||
diff --git a/fs/9p/vfs_dentry.c b/fs/9p/vfs_dentry.c index f039b104a98e..b03dd23feda8 100644 --- a/fs/9p/vfs_dentry.c +++ b/fs/9p/vfs_dentry.c | |||
@@ -43,23 +43,6 @@ | |||
43 | #include "fid.h" | 43 | #include "fid.h" |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * v9fs_dentry_delete - called when dentry refcount equals 0 | ||
47 | * @dentry: dentry in question | ||
48 | * | ||
49 | * By returning 1 here we should remove cacheing of unused | ||
50 | * dentry components. | ||
51 | * | ||
52 | */ | ||
53 | |||
54 | static int v9fs_dentry_delete(const struct dentry *dentry) | ||
55 | { | ||
56 | p9_debug(P9_DEBUG_VFS, " dentry: %s (%p)\n", | ||
57 | dentry->d_name.name, dentry); | ||
58 | |||
59 | return 1; | ||
60 | } | ||
61 | |||
62 | /** | ||
63 | * v9fs_cached_dentry_delete - called when dentry refcount equals 0 | 46 | * v9fs_cached_dentry_delete - called when dentry refcount equals 0 |
64 | * @dentry: dentry in question | 47 | * @dentry: dentry in question |
65 | * | 48 | * |
@@ -134,6 +117,6 @@ const struct dentry_operations v9fs_cached_dentry_operations = { | |||
134 | }; | 117 | }; |
135 | 118 | ||
136 | const struct dentry_operations v9fs_dentry_operations = { | 119 | const struct dentry_operations v9fs_dentry_operations = { |
137 | .d_delete = v9fs_dentry_delete, | 120 | .d_delete = always_delete_dentry, |
138 | .d_release = v9fs_dentry_release, | 121 | .d_release = v9fs_dentry_release, |
139 | }; | 122 | }; |
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 277bd1be21fd..4522e0755773 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c | |||
@@ -66,19 +66,9 @@ static void configfs_d_iput(struct dentry * dentry, | |||
66 | iput(inode); | 66 | iput(inode); |
67 | } | 67 | } |
68 | 68 | ||
69 | /* | ||
70 | * We _must_ delete our dentries on last dput, as the chain-to-parent | ||
71 | * behavior is required to clear the parents of default_groups. | ||
72 | */ | ||
73 | static int configfs_d_delete(const struct dentry *dentry) | ||
74 | { | ||
75 | return 1; | ||
76 | } | ||
77 | |||
78 | const struct dentry_operations configfs_dentry_ops = { | 69 | const struct dentry_operations configfs_dentry_ops = { |
79 | .d_iput = configfs_d_iput, | 70 | .d_iput = configfs_d_iput, |
80 | /* simple_delete_dentry() isn't exported */ | 71 | .d_delete = always_delete_dentry, |
81 | .d_delete = configfs_d_delete, | ||
82 | }; | 72 | }; |
83 | 73 | ||
84 | #ifdef CONFIG_LOCKDEP | 74 | #ifdef CONFIG_LOCKDEP |
diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c index a8766b880c07..becc725a1953 100644 --- a/fs/efivarfs/super.c +++ b/fs/efivarfs/super.c | |||
@@ -83,19 +83,10 @@ static int efivarfs_d_hash(const struct dentry *dentry, struct qstr *qstr) | |||
83 | return 0; | 83 | return 0; |
84 | } | 84 | } |
85 | 85 | ||
86 | /* | ||
87 | * Retaining negative dentries for an in-memory filesystem just wastes | ||
88 | * memory and lookup time: arrange for them to be deleted immediately. | ||
89 | */ | ||
90 | static int efivarfs_delete_dentry(const struct dentry *dentry) | ||
91 | { | ||
92 | return 1; | ||
93 | } | ||
94 | |||
95 | static struct dentry_operations efivarfs_d_ops = { | 86 | static struct dentry_operations efivarfs_d_ops = { |
96 | .d_compare = efivarfs_d_compare, | 87 | .d_compare = efivarfs_d_compare, |
97 | .d_hash = efivarfs_d_hash, | 88 | .d_hash = efivarfs_d_hash, |
98 | .d_delete = efivarfs_delete_dentry, | 89 | .d_delete = always_delete_dentry, |
99 | }; | 90 | }; |
100 | 91 | ||
101 | static struct dentry *efivarfs_alloc_dentry(struct dentry *parent, char *name) | 92 | static struct dentry *efivarfs_alloc_dentry(struct dentry *parent, char *name) |
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 25437280a207..db23ce1bd903 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -33,15 +33,6 @@ static inline struct hostfs_inode_info *HOSTFS_I(struct inode *inode) | |||
33 | 33 | ||
34 | #define FILE_HOSTFS_I(file) HOSTFS_I(file_inode(file)) | 34 | #define FILE_HOSTFS_I(file) HOSTFS_I(file_inode(file)) |
35 | 35 | ||
36 | static int hostfs_d_delete(const struct dentry *dentry) | ||
37 | { | ||
38 | return 1; | ||
39 | } | ||
40 | |||
41 | static const struct dentry_operations hostfs_dentry_ops = { | ||
42 | .d_delete = hostfs_d_delete, | ||
43 | }; | ||
44 | |||
45 | /* Changed in hostfs_args before the kernel starts running */ | 36 | /* Changed in hostfs_args before the kernel starts running */ |
46 | static char *root_ino = ""; | 37 | static char *root_ino = ""; |
47 | static int append = 0; | 38 | static int append = 0; |
@@ -925,7 +916,7 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent) | |||
925 | sb->s_blocksize_bits = 10; | 916 | sb->s_blocksize_bits = 10; |
926 | sb->s_magic = HOSTFS_SUPER_MAGIC; | 917 | sb->s_magic = HOSTFS_SUPER_MAGIC; |
927 | sb->s_op = &hostfs_sbops; | 918 | sb->s_op = &hostfs_sbops; |
928 | sb->s_d_op = &hostfs_dentry_ops; | 919 | sb->s_d_op = &simple_dentry_operations; |
929 | sb->s_maxbytes = MAX_LFS_FILESIZE; | 920 | sb->s_maxbytes = MAX_LFS_FILESIZE; |
930 | 921 | ||
931 | /* NULL is printed as <NULL> by sprintf: avoid that. */ | 922 | /* NULL is printed as <NULL> by sprintf: avoid that. */ |
diff --git a/fs/libfs.c b/fs/libfs.c index 5de06947ba5e..a1844244246f 100644 --- a/fs/libfs.c +++ b/fs/libfs.c | |||
@@ -47,10 +47,16 @@ EXPORT_SYMBOL(simple_statfs); | |||
47 | * Retaining negative dentries for an in-memory filesystem just wastes | 47 | * Retaining negative dentries for an in-memory filesystem just wastes |
48 | * memory and lookup time: arrange for them to be deleted immediately. | 48 | * memory and lookup time: arrange for them to be deleted immediately. |
49 | */ | 49 | */ |
50 | static int simple_delete_dentry(const struct dentry *dentry) | 50 | int always_delete_dentry(const struct dentry *dentry) |
51 | { | 51 | { |
52 | return 1; | 52 | return 1; |
53 | } | 53 | } |
54 | EXPORT_SYMBOL(always_delete_dentry); | ||
55 | |||
56 | const struct dentry_operations simple_dentry_operations = { | ||
57 | .d_delete = always_delete_dentry, | ||
58 | }; | ||
59 | EXPORT_SYMBOL(simple_dentry_operations); | ||
54 | 60 | ||
55 | /* | 61 | /* |
56 | * Lookup the data. This is trivial - if the dentry didn't already | 62 | * Lookup the data. This is trivial - if the dentry didn't already |
@@ -58,10 +64,6 @@ static int simple_delete_dentry(const struct dentry *dentry) | |||
58 | */ | 64 | */ |
59 | struct dentry *simple_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) | 65 | struct dentry *simple_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) |
60 | { | 66 | { |
61 | static const struct dentry_operations simple_dentry_operations = { | ||
62 | .d_delete = simple_delete_dentry, | ||
63 | }; | ||
64 | |||
65 | if (dentry->d_name.len > NAME_MAX) | 67 | if (dentry->d_name.len > NAME_MAX) |
66 | return ERR_PTR(-ENAMETOOLONG); | 68 | return ERR_PTR(-ENAMETOOLONG); |
67 | if (!dentry->d_sb->s_d_op) | 69 | if (!dentry->d_sb->s_d_op) |
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 737e15615b04..cca93b6fb9a9 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
@@ -175,22 +175,6 @@ static const struct inode_operations proc_link_inode_operations = { | |||
175 | }; | 175 | }; |
176 | 176 | ||
177 | /* | 177 | /* |
178 | * As some entries in /proc are volatile, we want to | ||
179 | * get rid of unused dentries. This could be made | ||
180 | * smarter: we could keep a "volatile" flag in the | ||
181 | * inode to indicate which ones to keep. | ||
182 | */ | ||
183 | static int proc_delete_dentry(const struct dentry * dentry) | ||
184 | { | ||
185 | return 1; | ||
186 | } | ||
187 | |||
188 | static const struct dentry_operations proc_dentry_operations = | ||
189 | { | ||
190 | .d_delete = proc_delete_dentry, | ||
191 | }; | ||
192 | |||
193 | /* | ||
194 | * Don't create negative dentries here, return -ENOENT by hand | 178 | * Don't create negative dentries here, return -ENOENT by hand |
195 | * instead. | 179 | * instead. |
196 | */ | 180 | */ |
@@ -209,7 +193,7 @@ struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *dir, | |||
209 | inode = proc_get_inode(dir->i_sb, de); | 193 | inode = proc_get_inode(dir->i_sb, de); |
210 | if (!inode) | 194 | if (!inode) |
211 | return ERR_PTR(-ENOMEM); | 195 | return ERR_PTR(-ENOMEM); |
212 | d_set_d_op(dentry, &proc_dentry_operations); | 196 | d_set_d_op(dentry, &simple_dentry_operations); |
213 | d_add(dentry, inode); | 197 | d_add(dentry, inode); |
214 | return NULL; | 198 | return NULL; |
215 | } | 199 | } |
diff --git a/fs/proc/namespaces.c b/fs/proc/namespaces.c index 49a7fff2e83a..9ae46b87470d 100644 --- a/fs/proc/namespaces.c +++ b/fs/proc/namespaces.c | |||
@@ -42,12 +42,6 @@ static const struct inode_operations ns_inode_operations = { | |||
42 | .setattr = proc_setattr, | 42 | .setattr = proc_setattr, |
43 | }; | 43 | }; |
44 | 44 | ||
45 | static int ns_delete_dentry(const struct dentry *dentry) | ||
46 | { | ||
47 | /* Don't cache namespace inodes when not in use */ | ||
48 | return 1; | ||
49 | } | ||
50 | |||
51 | static char *ns_dname(struct dentry *dentry, char *buffer, int buflen) | 45 | static char *ns_dname(struct dentry *dentry, char *buffer, int buflen) |
52 | { | 46 | { |
53 | struct inode *inode = dentry->d_inode; | 47 | struct inode *inode = dentry->d_inode; |
@@ -59,7 +53,7 @@ static char *ns_dname(struct dentry *dentry, char *buffer, int buflen) | |||
59 | 53 | ||
60 | const struct dentry_operations ns_dentry_operations = | 54 | const struct dentry_operations ns_dentry_operations = |
61 | { | 55 | { |
62 | .d_delete = ns_delete_dentry, | 56 | .d_delete = always_delete_dentry, |
63 | .d_dname = ns_dname, | 57 | .d_dname = ns_dname, |
64 | }; | 58 | }; |
65 | 59 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index bf5d574ebdf4..121f11f001c0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2622,7 +2622,9 @@ extern int simple_write_begin(struct file *file, struct address_space *mapping, | |||
2622 | extern int simple_write_end(struct file *file, struct address_space *mapping, | 2622 | extern int simple_write_end(struct file *file, struct address_space *mapping, |
2623 | loff_t pos, unsigned len, unsigned copied, | 2623 | loff_t pos, unsigned len, unsigned copied, |
2624 | struct page *page, void *fsdata); | 2624 | struct page *page, void *fsdata); |
2625 | extern int always_delete_dentry(const struct dentry *); | ||
2625 | extern struct inode *alloc_anon_inode(struct super_block *); | 2626 | extern struct inode *alloc_anon_inode(struct super_block *); |
2627 | extern const struct dentry_operations simple_dentry_operations; | ||
2626 | 2628 | ||
2627 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags); | 2629 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags); |
2628 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); | 2630 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index e0839bcd48c8..4c62513fe19f 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -895,11 +895,6 @@ static void cgroup_diput(struct dentry *dentry, struct inode *inode) | |||
895 | iput(inode); | 895 | iput(inode); |
896 | } | 896 | } |
897 | 897 | ||
898 | static int cgroup_delete(const struct dentry *d) | ||
899 | { | ||
900 | return 1; | ||
901 | } | ||
902 | |||
903 | static void remove_dir(struct dentry *d) | 898 | static void remove_dir(struct dentry *d) |
904 | { | 899 | { |
905 | struct dentry *parent = dget(d->d_parent); | 900 | struct dentry *parent = dget(d->d_parent); |
@@ -1486,7 +1481,7 @@ static int cgroup_get_rootdir(struct super_block *sb) | |||
1486 | { | 1481 | { |
1487 | static const struct dentry_operations cgroup_dops = { | 1482 | static const struct dentry_operations cgroup_dops = { |
1488 | .d_iput = cgroup_diput, | 1483 | .d_iput = cgroup_diput, |
1489 | .d_delete = cgroup_delete, | 1484 | .d_delete = always_delete_dentry, |
1490 | }; | 1485 | }; |
1491 | 1486 | ||
1492 | struct inode *inode = | 1487 | struct inode *inode = |
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index d0d14a04dce1..bf04b30a788a 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
@@ -471,15 +471,6 @@ struct rpc_filelist { | |||
471 | umode_t mode; | 471 | umode_t mode; |
472 | }; | 472 | }; |
473 | 473 | ||
474 | static int rpc_delete_dentry(const struct dentry *dentry) | ||
475 | { | ||
476 | return 1; | ||
477 | } | ||
478 | |||
479 | static const struct dentry_operations rpc_dentry_operations = { | ||
480 | .d_delete = rpc_delete_dentry, | ||
481 | }; | ||
482 | |||
483 | static struct inode * | 474 | static struct inode * |
484 | rpc_get_inode(struct super_block *sb, umode_t mode) | 475 | rpc_get_inode(struct super_block *sb, umode_t mode) |
485 | { | 476 | { |
@@ -1266,7 +1257,7 @@ rpc_fill_super(struct super_block *sb, void *data, int silent) | |||
1266 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; | 1257 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; |
1267 | sb->s_magic = RPCAUTH_GSSMAGIC; | 1258 | sb->s_magic = RPCAUTH_GSSMAGIC; |
1268 | sb->s_op = &s_ops; | 1259 | sb->s_op = &s_ops; |
1269 | sb->s_d_op = &rpc_dentry_operations; | 1260 | sb->s_d_op = &simple_dentry_operations; |
1270 | sb->s_time_gran = 1; | 1261 | sb->s_time_gran = 1; |
1271 | 1262 | ||
1272 | inode = rpc_get_inode(sb, S_IFDIR | S_IRUGO | S_IXUGO); | 1263 | inode = rpc_get_inode(sb, S_IFDIR | S_IRUGO | S_IXUGO); |