Name

bdev_direct_access — Get the address for directly-accessibly memory

Synopsis

long bdev_direct_access (struct block_device * bdev,
 sector_t sector,
 void ** addr,
 unsigned long * pfn,
 long size);
 

Arguments

bdev

The device containing the memory

sector

The offset within the device

addr

Where to put the address of the memory

pfn

The Page Frame Number for the memory

size

The number of bytes requested

Description

If a block device is made up of directly addressable memory, this function will tell the caller the PFN and the address of the memory. The address may be directly dereferenced within the kernel without the need to call ioremap, kmap or similar. The PFN is suitable for inserting into page tables.

Return

negative errno if an error occurs, otherwise the number of bytes accessible at this address.