diff options
author | Ahmad Fatoum <ahmad@a3f.at> | 2019-08-22 08:51:01 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-08-23 09:37:59 +0200 |
commit | fe201c695af55df51ee414f89e29558abab97437 (patch) | |
tree | 5e3bb142563ebafe94ad4575a3bc1b127cdb57dd /fs | |
parent | e68c3d08dccb951476d1e31a66f31c15390e4af7 (diff) | |
download | barebox-fe201c695af55df51ee414f89e29558abab97437.tar.gz barebox-fe201c695af55df51ee414f89e29558abab97437.tar.xz |
fs: provide no_revalidate_d_ops for network file systems
Networked file systems may wish to forego dentry caching altogether, so
every lookup goes over the network and stale data is avoided.
Provide a no_revalidate_d_ops helper object that does this.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fs.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1262,6 +1262,15 @@ static void d_invalidate(struct dentry *dentry) { } +static int d_no_revalidate(struct dentry *dir, unsigned int flags) +{ + return 0; +} + +const struct dentry_operations no_revalidate_d_ops = { + .d_revalidate = d_no_revalidate, +}; + static inline int d_revalidate(struct dentry *dentry, unsigned int flags) { if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) |