TAKE 981498 - kill xfs_lock_dir_and_entry
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.
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:
longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb
Modid: xfs-linux-melb:xfs-kern:31772afs/xfs/xfs_vnodeops.c - 1.769 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.769&r2=text&tr2=1.768&f=h
- kill xfs_lock_dir_and_entry
fs/xfs/xfs_dfrag.c - 1.70 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dfrag.c.diff?r1=text&tr1=1.70&r2=text&tr2=1.69&f=h
- kill xfs_lock_dir_and_entry
fs/xfs/xfs_inode.h - 1.252 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.252&r2=text&tr2=1.251&f=h
- kill xfs_lock_dir_and_entry
Quoted 1 line · Donald Douwsma
kill
xfs_lock_dir_and_entry
....
Quoted 3 lines
Date: Fri Jul 25 15:14:03 AEST 2008 Workarea: linuxbuild.melbourne.sgi.com:/home/donaldd/isms/2.6.x-xfs Inspected by: hch
Ah - I think you are dropping the review on all these checkins, Donald. My name should be against that as having reviewed it....
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]