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>
This commit is contained in:
12
fs/libfs.c
12
fs/libfs.c
@@ -47,10 +47,16 @@ EXPORT_SYMBOL(simple_statfs);
|
||||
* Retaining negative dentries for an in-memory filesystem just wastes
|
||||
* memory and lookup time: arrange for them to be deleted immediately.
|
||||
*/
|
||||
static int simple_delete_dentry(const struct dentry *dentry)
|
||||
int always_delete_dentry(const struct dentry *dentry)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL(always_delete_dentry);
|
||||
|
||||
const struct dentry_operations simple_dentry_operations = {
|
||||
.d_delete = always_delete_dentry,
|
||||
};
|
||||
EXPORT_SYMBOL(simple_dentry_operations);
|
||||
|
||||
/*
|
||||
* 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)
|
||||
*/
|
||||
struct dentry *simple_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
|
||||
{
|
||||
static const struct dentry_operations simple_dentry_operations = {
|
||||
.d_delete = simple_delete_dentry,
|
||||
};
|
||||
|
||||
if (dentry->d_name.len > NAME_MAX)
|
||||
return ERR_PTR(-ENAMETOOLONG);
|
||||
if (!dentry->d_sb->s_d_op)
|
||||
|
||||
Reference in New Issue
Block a user