• Christoph Hellwig's avatar
    xfs: replace i_flock with a sleeping bitlock · 474fce06
    Christoph Hellwig authored
    We almost never block on i_flock, the exception is synchronous inode
    flushing.  Instead of bloating the inode with a 16/24-byte completion
    that we abuse as a semaphore just implement it as a bitlock that uses
    a bit waitqueue for the rare sleeping path.  This primarily is a
    tradeoff between a much smaller inode and a faster non-blocking
    path vs faster wakeups, and we are much better off with the former.
    
    A small downside is that we will lose lockdep checking for i_flock, but
    given that it's always taken inside the ilock that should be acceptable.
    
    Note that for example the inode writeback locking is implemented in a
    very similar way.
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarAlex Elder <aelder@sgi.com>
    Signed-off-by: default avatarBen Myers <bpm@sgi.com>
    474fce06
xfs_inode.h 19.5 KB