diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2020-01-13 02:35:15 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2020-01-13 02:35:15 +0000 |
commit | 80663cadb825db5aa70756c7292f1f5315535120 (patch) | |
tree | 790d92dfbb5056d21941b8e4b817a7c38e58e4fb /sys/ufs/ufs | |
parent | 57083d257635c2a102f72141bd41c7b8e3d0f31c (diff) | |
download | src-80663cadb825db5aa70756c7292f1f5315535120.tar.gz src-80663cadb825db5aa70756c7292f1f5315535120.zip |
ufs: use lazy list instead of active list for syncer
Quota code is temporarily regressed to do a full vnode scan.
Reviewed by: jeff
Tested by: pho (in a larger patch, previous version)
Differential Revision: https://reviews.freebsd.org/D22996
Notes
Notes:
svn path=/head/; revision=356671
Diffstat (limited to 'sys/ufs/ufs')
-rw-r--r-- | sys/ufs/ufs/inode.h | 21 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 7 |
2 files changed, 23 insertions, 5 deletions
diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h index 4b8ee26519ee..3311512d56ed 100644 --- a/sys/ufs/ufs/inode.h +++ b/sys/ufs/ufs/inode.h @@ -138,11 +138,32 @@ struct inode { "\14b12\13is_ufs2\12truncated\11ea_lockwait\10ea_locked" \ "\7lazyaccess\6lazymod\5needsync\4modified\3update\2change\1access" +#define UFS_INODE_FLAG_LAZY_MASK \ + (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE | IN_LAZYMOD | IN_LAZYACCESS) + #define UFS_INODE_SET_FLAG(ip, flags) do { \ struct inode *_ip = (ip); \ + struct vnode *_vp = ITOV(_ip); \ int _flags = (flags); \ \ _ip->i_flag |= _flags; \ + if (_flags & UFS_INODE_FLAG_LAZY_MASK) \ + vlazy(_vp); \ +} while (0) + +#define UFS_INODE_SET_FLAG_SHARED(ip, flags) do { \ + struct inode *_ip = (ip); \ + struct vnode *_vp = ITOV(_ip); \ + int _flags = (flags); \ + \ + ASSERT_VI_UNLOCKED(_vp, __func__); \ + if ((_ip->i_flag & (_flags)) != _flags) { \ + VI_LOCK(_vp); \ + _ip->i_flag |= _flags; \ + if (_flags & UFS_INODE_FLAG_LAZY_MASK) \ + vlazy(_vp); \ + VI_UNLOCK(_vp); \ + } \ } while (0) #define i_dirhash i_un.dirhash diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index ab159e3f5609..8318844b01de 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -686,12 +686,9 @@ ufs_markatime(ap) struct vnode *a_vp; } */ *ap; { - struct vnode *vp = ap->a_vp; - struct inode *ip = VTOI(vp); + struct inode *ip = VTOI(ap->a_vp); - VI_LOCK(vp); - UFS_INODE_SET_FLAG(ip, IN_ACCESS); - VI_UNLOCK(vp); + UFS_INODE_SET_FLAG_SHARED(ip, IN_ACCESS); /* * XXXKIB No UFS_UPDATE(ap->a_vp, 0) there. */ |