22 static unsigned long romfs_get_unmapped_area(
struct file *
file,
30 unsigned long isize,
offset, maxpages, lpages;
34 return (
unsigned long) -
ENOSYS;
38 isize = i_size_read(inode);
41 maxpages = (isize +
PAGE_SIZE - 1) >> PAGE_SHIFT;
42 if ((pgoff >= maxpages) || (maxpages - pgoff < lpages))
43 return (
unsigned long) -
EINVAL;
46 return (
unsigned long) -
EINVAL;
48 if (len > mtd->
size || pgoff >= (mtd->
size >> PAGE_SHIFT))
49 return (
unsigned long) -
EINVAL;
51 offset += ROMFS_I(inode)->i_dataoffset;
52 if (offset > mtd->
size - len)
53 return (
unsigned long) -
EINVAL;
58 return (
unsigned long)
ret;
65 static int romfs_mmap(
struct file *file,
struct vm_area_struct *vma)
76 .get_unmapped_area = romfs_get_unmapped_area,