[Top] [All Lists]

TAKE 981498 - kill xfs_lock_dir_and_entry

To: xfs@xxxxxxxxxxx, sgi.bugs.xfs@xxxxxxxxxxxx
Subject: TAKE 981498 - kill xfs_lock_dir_and_entry
From: donaldd@xxxxxxx (Donald Douwsma)
Date: Fri, 25 Jul 2008 15:18:59 +1000 (EST)
Sender: xfs-bounce@xxxxxxxxxxx
kill xfs_lock_dir_and_entry

When multiple inodes are locked in XFS it happens in order of the inode
number, with the everything but the first inode trylocked if any of
the previous inodes is in the AIL.

Except for the sorting of the inodes this logic is implemented in
xfs_lock_inodes, but also partially duplicated in xfs_lock_dir_and_entry
in a particularly stupid way adds a lock roundtrip if the inode ordering
is not optimal.

This patch adds a new helper xfs_lock_two_inodes that takes two inodes
and locks them in the most optimal way according to the above locking
protocol and uses it for all places that want to lock two inodes.

The only caller of xfs_lock_inodes is xfs_rename which might lock up to
four inodes.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Date:  Fri Jul 25 15:14:03 AEST 2008
Workarea:  linuxbuild.melbourne.sgi.com:/home/donaldd/isms/2.6.x-xfs
Inspected by:  hch

The following file(s) were checked into:

Modid:  xfs-linux-melb:xfs-kern:31772a
fs/xfs/xfs_vnodeops.c - 1.769 - changed
        - kill xfs_lock_dir_and_entry

fs/xfs/xfs_dfrag.c - 1.70 - changed
        - kill xfs_lock_dir_and_entry

fs/xfs/xfs_inode.h - 1.252 - changed
        - kill xfs_lock_dir_and_entry

<Prev in Thread] Current Thread [Next in Thread>