Re: [PATCH 2/7] noblocking aio: Return if cannot get hold of i_rwsem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +	/* Don't sleep on inode rwsem */
> +	if (iocb->ki_flags & IOCB_NONBLOCKING) {
> +		if (!inode_trylock(inode))
> +			return -EAGAIN;
> +	} else
> +		inode_lock(inode);

A way to avoid the additional branch in the fast path would be:

	if (!inode_trylock(inode)) {
		if (iocb->ki_flags & IOCB_NONBLOCKING)
			return -EAGAIN;
		inode_lock(inode);
	}

but otherwise this looks fine:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux