host-drivers/base-driver/vca/blockio/vcablk_bcknd/vcablk_bcknd_media.c
static int
media_transfer_mem(struct vcablk_media *media, unsigned long sector,
		unsigned long nsect, char *buffer, int write)
{
	unsigned long offset = sector << SECTOR_SHIFT;
	unsigned long nbytes = nsect << SECTOR_SHIFT;

	if ((offset + nbytes) > media->size_bytes) {
		pr_notice("Beyond-end write (%ld %ld)\n", offset, nbytes);
		return -EIO;
	}

	if (write) {
		memcpy_toio(media->data.memory + offset, buffer, nbytes);
	} else {
		memcpy_toio(buffer, media->data.memory + offset, nbytes);
	}

	return 0;
}
/*
 * Handle an I/O request for memory.
 */
Handle an I/O request for memory.
Handle an I / O request for memory .
static int
media_transfer_mem(struct vcablk_media *media, unsigned long sector,
		unsigned long nsect, char *buffer, int write)
{
	unsigned long offset = sector << SECTOR_SHIFT;
	unsigned long nbytes = nsect << SECTOR_SHIFT;
	if ((offset + nbytes) > media->size_bytes) {
		pr_notice("Beyond-end write (%ld %ld)\n", offset, nbytes);
		return -EIO;
	}
	if (write) {
		memcpy_toio(media->data.memory + offset, buffer, nbytes);
	} else {
		memcpy_toio(buffer, media->data.memory + offset, nbytes);
	}
	return 0;
}
static int media_transfer_mem ( struct vcablk_media * media , unsigned long sector , unsigned long nsect , char * buffer , int write ) { unsigned long offset = sector << SECTOR_SHIFT ; unsigned long nbytes = nsect << SECTOR_SHIFT ; if ( ( offset + nbytes ) > media -> size_bytes ) { pr_notice ( " \n " , offset , nbytes ) ; return - EIO ; } if ( write ) { memcpy_toio ( media -> data . memory + offset , buffer , nbytes ) ; } else { memcpy_toio ( buffer , media -> data . memory + offset , nbytes ) ; } return 0 ; }
Handle an I/O request for memory.
Handle an I / O request for memory .