diff options
| author | Luis Henriques <luis@igalia.com> | 2025-09-16 14:53:09 +0100 |
|---|---|---|
| committer | Miklos Szeredi <mszeredi@redhat.com> | 2025-11-12 11:45:03 +0100 |
| commit | 64becd224ff99dbdcffab22709dfcf170e52aff1 (patch) | |
| tree | 2beea0c596c49d515aa14fcf585c357b59320f4b /fs/fuse/dir.c | |
| parent | ab84ad5973869a660ca3ad0c54a2b84d975d47c4 (diff) | |
fuse: new work queue to invalidate dentries from old epochs
With the infrastructure introduced to periodically invalidate expired
dentries, it is now possible to add an extra work queue to invalidate
dentries when an epoch is incremented. This work queue will only be
triggered when the 'inval_wq' parameter is set.
Signed-off-by: Luis Henriques <luis@igalia.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/dir.c')
| -rw-r--r-- | fs/fuse/dir.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 77982fdbcf27..8ef8134e1cd5 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -189,6 +189,27 @@ static void fuse_dentry_tree_work(struct work_struct *work) secs_to_jiffies(inval_wq)); } +void fuse_epoch_work(struct work_struct *work) +{ + struct fuse_conn *fc = container_of(work, struct fuse_conn, + epoch_work); + struct fuse_mount *fm; + struct inode *inode; + + down_read(&fc->killsb); + + inode = fuse_ilookup(fc, FUSE_ROOT_ID, &fm); + iput(inode); + + if (fm) { + /* Remove all possible active references to cached inodes */ + shrink_dcache_sb(fm->sb); + } else + pr_warn("Failed to get root inode"); + + up_read(&fc->killsb); +} + void fuse_dentry_tree_init(void) { int i; |
