Re: [FSAIO][PATCH 7/8] Filesystem AIO read

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

 



> +	if (in_aio()) {
> +		/* Avoid repeat readahead */
> +		if (kiocbTryRestart(io_wait_to_kiocb(current->io_wait)))
> +			next_index = last_index;
> +	}

Every place we use kiocbTryRestart in this and the next patch it's in
this from, so we should add a little helper for it:

int aio_try_restart(void)
{
	struct wait_queue_head_t *wq = current->io_wait;

	if (!is_sync_wait(wq) && kiocbTryRestart(io_wait_to_kiocb(wq)))
		return 1;
	return 0;
}

with a big kerneldoc comment explaining this idiom (and possible a better
name for the function ;-))

> +
> +		if ((error = __lock_page(page, current->io_wait))) {
> +			goto readpage_error;
> +		}

This should  be

		error = __lock_page(page, current->io_wait);
		if (error)
			goto readpage_error;

Pluse possible naming updates discussed in the last mail.  Also do we
really need to pass current->io_wait here?  Isn't the waitqueue in
the kiocb always guaranteed to be the same?  Now that all pagecache
I/O goes through the ->aio_read/->aio_write routines I'd prefer to
get rid of the task_struct field cludges and pass all this around in
the kiocb.  

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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