aboutsummaryrefslogtreecommitdiffstats
path: root/fs/libfs.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-10-25 18:47:37 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-11-15 22:04:17 -0500
commitb26d4cd385fc51e8844e2cdf9ba2051f5bba11a5 (patch)
treefcfa7a889b494945abf5705562c0384f88924f78 /fs/libfs.c
parent951b4bd553e35a291e6b5732ab0124619e81da05 (diff)
consolidate simple ->d_delete() instances
Rename simple_delete_dentry() to always_delete_dentry() and export it. Export simple_dentry_operations, while we are at it, and get rid of their duplicates Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/libfs.c')
-rw-r--r--fs/libfs.c12
1 files changed, 7 insertions, 5 deletions
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 */
50static int simple_delete_dentry(const struct dentry *dentry) 50int always_delete_dentry(const struct dentry *dentry)
51{ 51{
52 return 1; 52 return 1;
53} 53}
54EXPORT_SYMBOL(always_delete_dentry);
55
56const struct dentry_operations simple_dentry_operations = {
57 .d_delete = always_delete_dentry,
58};
59EXPORT_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 */
59struct dentry *simple_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) 65struct 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)