• Dave Chinner's avatar
    xfs: introduce xfs_rw_lock() helpers for locking the inode · 487f84f3
    Dave Chinner authored
    We need to obtain the i_mutex, i_iolock and i_ilock during the read
    and write paths. Add a set of wrapper functions to neatly
    encapsulate the lock ordering and shared/exclusive semantics to make
    the locking easier to follow and get right.
    
    Note that this changes some of the exclusive locking serialisation in
    that serialisation will occur against the i_mutex instead of the
    XFS_IOLOCK_EXCL. This does not change any behaviour, and it is
    arguably more efficient to use the mutex for such serialisation than
    the rw_sem.
    Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    487f84f3
xfs_file.c 24.5 KB