mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
pmem, dax: have direct_access use __pmem annotation
Update the annotation for the kaddr pointer returned by direct_access() so that it is a __pmem pointer. This is consistent with the PMEM driver and with how this direct_access() pointer is used in the DAX code. Signed-off-by: Ross Zwisler <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Dan Williams <[email protected]>
This commit is contained in:
parent
2765cfbb34
commit
e2e05394e4
8 changed files with 41 additions and 34 deletions
|
|
@ -29,7 +29,7 @@ static int dcssblk_open(struct block_device *bdev, fmode_t mode);
|
|||
static void dcssblk_release(struct gendisk *disk, fmode_t mode);
|
||||
static void dcssblk_make_request(struct request_queue *q, struct bio *bio);
|
||||
static long dcssblk_direct_access(struct block_device *bdev, sector_t secnum,
|
||||
void **kaddr, unsigned long *pfn, long size);
|
||||
void __pmem **kaddr, unsigned long *pfn, long size);
|
||||
|
||||
static char dcssblk_segments[DCSSBLK_PARM_LEN] = "\0";
|
||||
|
||||
|
|
@ -879,18 +879,20 @@ fail:
|
|||
|
||||
static long
|
||||
dcssblk_direct_access (struct block_device *bdev, sector_t secnum,
|
||||
void **kaddr, unsigned long *pfn, long size)
|
||||
void __pmem **kaddr, unsigned long *pfn, long size)
|
||||
{
|
||||
struct dcssblk_dev_info *dev_info;
|
||||
unsigned long offset, dev_sz;
|
||||
void *addr;
|
||||
|
||||
dev_info = bdev->bd_disk->private_data;
|
||||
if (!dev_info)
|
||||
return -ENODEV;
|
||||
dev_sz = dev_info->end - dev_info->start;
|
||||
offset = secnum * 512;
|
||||
*kaddr = (void *) (dev_info->start + offset);
|
||||
*pfn = virt_to_phys(*kaddr) >> PAGE_SHIFT;
|
||||
addr = (void *) (dev_info->start + offset);
|
||||
*pfn = virt_to_phys(addr) >> PAGE_SHIFT;
|
||||
*kaddr = (void __pmem *) addr;
|
||||
|
||||
return dev_sz - offset;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue