/* The function returns a value which should be given to the corresponding xfs_iunlock_map_shared(). This value is the mode in which the lock was actually taken.  */
uint xfs_ilock_map_shared(xfs_inode_t *ip)
/* The function returns a value which should be given to the corresponding xfs_iunlock_map_shared(). This value is the mode in which the lock was actually taken.  */
uint xfs_ilock_map_shared(xfs_inode_t *ip)
{
	uint	lock_mode;
	if ((ip->i_d.di_format == XFS_DINODE_FMT_BTREE) &&
	    ((ip->i_df.if_flags & XFS_IFEXTENTS) == 0)) {
		lock_mode = XFS_ILOCK_EXCL;
	} else {
		lock_mode = XFS_ILOCK_SHARED;
	}
	xfs_ilock(ip, lock_mode);
	return lock_mode;
}