On Mon, 2008-08-04 at 20:43 +1000, Nick Piggin wrote:
We considered using anonymous pages, but as the user-mapping is not a
feature, it seemed like it wasn't the right model. Plus, many of these
objects need to be shared across multiple processes, so anonymous pages
would be a pain there.
Ok, that's useful information which isn't clear from the docs.
That does look a lot more like what I want, as it returns an unlocked
page. And, makes my code look cleaner to boot:
inode =3D obj->filp->f_path.dentry->d_inode;
mapping =3D inode->i_mapping;
for (i =3D 0; i < page_count; i++) {
page =3D read_mapping_page(mapping, i, NULL);
if (IS_ERR(page)) {
ret =3D PTR_ERR(page);
DRM_ERROR("read_mapping_page failed: %d\n", ret);
i915_gem_object_free_page_list(obj);
return ret;
}
obj_priv->page_list[i] =3D page;
}
Does this look like it conforms to the vfs api? It appears to work when
using shmem at least.
Yup, I'm liking the general file mechanism, I used shmem only because
that seemed like the obvious file system you'd want underneath these
objects.
--=20
keith.packard@intel.com