linux/mmnommu/filemap.c
/*
 * This is the "read()" routine for all filesystems
 * that can use the page cache directly.
 */
This is the "read()" routine for all filesystems
that can use the page cache directly.
This is the " read () " routine for all filesystems that can use the page cache directly .
ssize_t generic_file_read(struct file * filp, char * buf, size_t count, loff_t *ppos)
{
	ssize_t retval;
	retval = -EFAULT;
	if (access_ok(VERIFY_WRITE, buf, count)) {
		retval = 0;
		if (count) {
			read_descriptor_t desc;
			desc.written = 0;
			desc.count = count;
			desc.buf = buf;
			desc.error = 0;
			do_generic_file_read(filp, ppos, &desc, file_read_actor);
			retval = desc.written;
			if (!retval)
				retval = desc.error;
		}
	}
	return retval;
}
ssize_t generic_file_read ( struct file * filp , char * buf , size_t count , loff_t * ppos ) { ssize_t retval ; retval = - EFAULT ; if ( access_ok ( VERIFY_WRITE , buf , count ) ) { retval = 0 ; if ( count ) { read_descriptor_t desc ; desc . written = 0 ; desc . count = count ; desc . buf = buf ; desc . error = 0 ; do_generic_file_read ( filp , ppos , & desc , file_read_actor ) ; retval = desc . written ; if ( ! retval ) retval = desc . error ; } } return retval ; }
This is the "read()" routine for all filesystems
 that can use the page cache directly.
This is the " read () " routine for all filesystems that can use the page cache directly .