diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2023-01-26 20:23:40 +0100 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2023-01-31 22:40:24 +0100 |
commit | b88beb9a246f7506778f8680ee9627cd85262ba4 (patch) | |
tree | 8b93e29818c8200eed3aa82a4a8203118c9b8e48 /fs/gfs2/super.c | |
parent | 6b388abc33998330c6fe55a712d61be888fd7b67 (diff) | |
download | lwn-b88beb9a246f7506778f8680ee9627cd85262ba4.tar.gz lwn-b88beb9a246f7506778f8680ee9627cd85262ba4.zip |
gfs2: Evict inodes cooperatively
Add a gfs2_evict_inodes() helper that evicts inodes cooperatively across
the cluster. This avoids running into timeouts during unmount
unnecessarily.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r-- | fs/gfs2/super.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 63512bb9d6f0..52c3502de58c 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -935,6 +935,7 @@ static int gfs2_statfs(struct dentry *dentry, struct kstatfs *buf) static int gfs2_drop_inode(struct inode *inode) { struct gfs2_inode *ip = GFS2_I(inode); + struct gfs2_sbd *sdp = GFS2_SB(inode); if (inode->i_nlink && gfs2_holder_initialized(&ip->i_iopen_gh)) { @@ -959,6 +960,12 @@ static int gfs2_drop_inode(struct inode *inode) return 0; } + /* + * No longer cache inodes when trying to evict them all. + */ + if (test_bit(SDF_EVICTING, &sdp->sd_flags)) + return 1; + return generic_drop_inode(inode); } |