/* * try to determine where a shared mapping can be made * - only supported for NOMMU at the moment (MMU can't doesn't copy private * mappings) * - attempts to map through to the underlying MTD device
*/ staticunsignedlong romfs_get_unmapped_area(struct file *file, unsignedlong addr, unsignedlong len, unsignedlong pgoff, unsignedlong flags)
{ struct inode *inode = file->f_mapping->host; struct mtd_info *mtd = inode->i_sb->s_mtd; unsignedlong isize, offset, maxpages, lpages; int ret;
offset += ROMFS_I(inode)->i_dataoffset; if (offset >= mtd->size) return (unsignedlong) -EINVAL; /* the mapping mustn't extend beyond the EOF */ if ((offset + len) > mtd->size)
len = mtd->size - offset;
ret = mtd_get_unmapped_area(mtd, len, offset, flags); if (ret == -EOPNOTSUPP)
ret = -ENOSYS; return (unsignedlong) ret;
}
/* * permit a R/O mapping to be made directly through onto an MTD device if * possible
*/ staticint romfs_mmap_prepare(struct vm_area_desc *desc)
{ return is_nommu_shared_mapping(desc->vm_flags) ? 0 : -ENOSYS;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.