mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 15:42:32 +00:00
xfs: Make inode reclaim states explicit
A.K.A.: don't rely on xfs_iflush() return value in reclaim We have gradually been moving checks out of the reclaim code because they are duplicated in xfs_iflush(). We've had a history of problems in this area, and many of them stem from the overloading of the return values from xfs_iflush() and interaction with inode flush locking to determine if the inode is safe to reclaim. With the desire to move to delayed write flushing of inodes and non-blocking inode tree reclaim walks, the overloading of the return value of xfs_iflush makes it very difficult to determine the correct thing to do next. This patch explicitly re-adds the checks to the inode reclaim code, removing the reliance on the return value of xfs_iflush() to determine what to do next. It also means that we can clearly document all the inode states that reclaim must handle and hence we can easily see that we handled all the necessary cases. This also removes the need for the xfs_inode_clean() check in xfs_iflush() as all callers now check this first (safely). Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
d5db0f97fb
commit
777df5afdb
3 changed files with 64 additions and 29 deletions
|
@ -2493,7 +2493,7 @@ __xfs_iunpin_wait(
|
|||
wait_event(ip->i_ipin_wait, (atomic_read(&ip->i_pincount) == 0));
|
||||
}
|
||||
|
||||
static inline void
|
||||
void
|
||||
xfs_iunpin_wait(
|
||||
xfs_inode_t *ip)
|
||||
{
|
||||
|
@ -2848,15 +2848,6 @@ xfs_iflush(
|
|||
iip = ip->i_itemp;
|
||||
mp = ip->i_mount;
|
||||
|
||||
/*
|
||||
* If the inode isn't dirty, then just release the inode flush lock and
|
||||
* do nothing.
|
||||
*/
|
||||
if (xfs_inode_clean(ip)) {
|
||||
xfs_ifunlock(ip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* We can't flush the inode until it is unpinned, so wait for it if we
|
||||
* are allowed to block. We know noone new can pin it, because we are
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue