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
···4343#include "fid.h"44444545/**4646- * v9fs_dentry_delete - called when dentry refcount equals 04747- * @dentry: dentry in question4848- *4949- * By returning 1 here we should remove cacheing of unused5050- * dentry components.5151- *5252- */5353-5454-static int v9fs_dentry_delete(const struct dentry *dentry)5555-{5656- p9_debug(P9_DEBUG_VFS, " dentry: %s (%p)\n",5757- dentry->d_name.name, dentry);5858-5959- return 1;6060-}6161-6262-/**6346 * v9fs_cached_dentry_delete - called when dentry refcount equals 06447 * @dentry: dentry in question6548 *···117134};118135119136const struct dentry_operations v9fs_dentry_operations = {120120- .d_delete = v9fs_dentry_delete,137137+ .d_delete = always_delete_dentry,121138 .d_release = v9fs_dentry_release,122139};
+1-11
fs/configfs/dir.c
···6666 iput(inode);6767}68686969-/*7070- * We _must_ delete our dentries on last dput, as the chain-to-parent7171- * behavior is required to clear the parents of default_groups.7272- */7373-static int configfs_d_delete(const struct dentry *dentry)7474-{7575- return 1;7676-}7777-7869const struct dentry_operations configfs_dentry_ops = {7970 .d_iput = configfs_d_iput,8080- /* simple_delete_dentry() isn't exported */8181- .d_delete = configfs_d_delete,7171+ .d_delete = always_delete_dentry,8272};83738474#ifdef CONFIG_LOCKDEP
+1-10
fs/efivarfs/super.c
···8383 return 0;8484}85858686-/*8787- * Retaining negative dentries for an in-memory filesystem just wastes8888- * memory and lookup time: arrange for them to be deleted immediately.8989- */9090-static int efivarfs_delete_dentry(const struct dentry *dentry)9191-{9292- return 1;9393-}9494-9586static struct dentry_operations efivarfs_d_ops = {9687 .d_compare = efivarfs_d_compare,9788 .d_hash = efivarfs_d_hash,9898- .d_delete = efivarfs_delete_dentry,8989+ .d_delete = always_delete_dentry,9990};1009110192static struct dentry *efivarfs_alloc_dentry(struct dentry *parent, char *name)
+1-10
fs/hostfs/hostfs_kern.c
···33333434#define FILE_HOSTFS_I(file) HOSTFS_I(file_inode(file))35353636-static int hostfs_d_delete(const struct dentry *dentry)3737-{3838- return 1;3939-}4040-4141-static const struct dentry_operations hostfs_dentry_ops = {4242- .d_delete = hostfs_d_delete,4343-};4444-4536/* Changed in hostfs_args before the kernel starts running */4637static char *root_ino = "";4738static int append = 0;···916925 sb->s_blocksize_bits = 10;917926 sb->s_magic = HOSTFS_SUPER_MAGIC;918927 sb->s_op = &hostfs_sbops;919919- sb->s_d_op = &hostfs_dentry_ops;928928+ sb->s_d_op = &simple_dentry_operations;920929 sb->s_maxbytes = MAX_LFS_FILESIZE;921930922931 /* NULL is printed as <NULL> by sprintf: avoid that. */
+7-5
fs/libfs.c
···4747 * Retaining negative dentries for an in-memory filesystem just wastes4848 * memory and lookup time: arrange for them to be deleted immediately.4949 */5050-static int simple_delete_dentry(const struct dentry *dentry)5050+int always_delete_dentry(const struct dentry *dentry)5151{5252 return 1;5353}5454+EXPORT_SYMBOL(always_delete_dentry);5555+5656+const struct dentry_operations simple_dentry_operations = {5757+ .d_delete = always_delete_dentry,5858+};5959+EXPORT_SYMBOL(simple_dentry_operations);54605561/*5662 * Lookup the data. This is trivial - if the dentry didn't already···6458 */6559struct dentry *simple_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)6660{6767- static const struct dentry_operations simple_dentry_operations = {6868- .d_delete = simple_delete_dentry,6969- };7070-7161 if (dentry->d_name.len > NAME_MAX)7262 return ERR_PTR(-ENAMETOOLONG);7363 if (!dentry->d_sb->s_d_op)
+1-17
fs/proc/generic.c
···175175};176176177177/*178178- * As some entries in /proc are volatile, we want to 179179- * get rid of unused dentries. This could be made 180180- * smarter: we could keep a "volatile" flag in the 181181- * inode to indicate which ones to keep.182182- */183183-static int proc_delete_dentry(const struct dentry * dentry)184184-{185185- return 1;186186-}187187-188188-static const struct dentry_operations proc_dentry_operations =189189-{190190- .d_delete = proc_delete_dentry,191191-};192192-193193-/*194178 * Don't create negative dentries here, return -ENOENT by hand195179 * instead.196180 */···193209 inode = proc_get_inode(dir->i_sb, de);194210 if (!inode)195211 return ERR_PTR(-ENOMEM);196196- d_set_d_op(dentry, &proc_dentry_operations);212212+ d_set_d_op(dentry, &simple_dentry_operations);197213 d_add(dentry, inode);198214 return NULL;199215 }
+1-7
fs/proc/namespaces.c
···4242 .setattr = proc_setattr,4343};44444545-static int ns_delete_dentry(const struct dentry *dentry)4646-{4747- /* Don't cache namespace inodes when not in use */4848- return 1;4949-}5050-5145static char *ns_dname(struct dentry *dentry, char *buffer, int buflen)5246{5347 struct inode *inode = dentry->d_inode;···53595460const struct dentry_operations ns_dentry_operations =5561{5656- .d_delete = ns_delete_dentry,6262+ .d_delete = always_delete_dentry,5763 .d_dname = ns_dname,5864};5965