dcache: let the dentry count go down to zero without taking d_lock

We can be more aggressive about this, if we are clever and careful. This is subtle.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Linus Torvalds 2015-01-09 15:19:03 -08:00 committed by Al Viro
parent 32426f6653
commit 360f54796e
3 changed files with 144 additions and 13 deletions

View file

@ -28,12 +28,13 @@ struct lockref {
#endif
struct {
spinlock_t lock;
unsigned int count;
int count;
};
};
};
extern void lockref_get(struct lockref *);
extern int lockref_put_return(struct lockref *);
extern int lockref_get_not_zero(struct lockref *);
extern int lockref_get_or_lock(struct lockref *);
extern int lockref_put_or_lock(struct lockref *);