On Wed, Apr 03, 2019 at 12:00:54PM +1100, NeilBrown wrote: > I would find it useful if the documentation said something about why > this API exists at all. As you say, it cannot change the dentry - so > what is it expected to do. *shrug* It tell filesystem that this dentry is going away now. > I had a look at the two in-tree users and my guess is that it can be > useful if the filesystem caches some other information which would be > invalidated by a dentry being removed. > I *think* cephfs has a flag which records if "All entries in a directory > are currently in the dcache". When a dentry is pruned, that flag needs > to be cleared. > > i.e. ->d_prune allows a filesystem to maintain summary state about what > is currently in the dcache. For one thing... Or, if you keep a (non-counting) reference to that dentry, this tells you to forget it, etc. I can think of other uses; it's really just telling the fs that this is becoming an ex-parrot.