dir: Explicitly state buffer locations for data
authorSimon Wilkinson <sxw@your-file-system.com>
Wed, 27 Apr 2011 18:24:56 +0000 (14:24 -0400)
committerDerrick Brashear <shadow@dementia.org>
Thu, 2 Jun 2011 14:37:59 +0000 (07:37 -0700)
commit0284e65f97861e888d95576f22a93cd681813c39
tree915d1e820db79448c0adb8bd74a5bdc110008a1d
parentb3ea4fa4ff6408cd98d610022270a5099e08c128
dir: Explicitly state buffer locations for data

DNew and DRead always returned directory page aligned pointers,
however the directory code further manipulates those pointers,
requiring the DRelease be able to fill a page when passed a pointer
to any address within that page. This is relatively straightforward
in the userspace implementation, but much more complex in the kernel,
where all of the directory pages are not necessarily contiguous.

Resolve this issue by making DNew, DRead and DRelease all return a
new structure, struct DirBuffer. This structure contains both a
pointer to the data, and an implementation specific private
pointer to data describing the page containing the address. The
directory code is free to play with the data pointer as it wishes,
as long as the private pointer to the page is passed through intact.

DRelease (and DVOffset) can then simply use the private pointer for
their operations, without having to walk page lists.

This new behaviour also requires changes to the directory functions
GetBlob, FindItem and FindFid which all return pointers to directory
data.

Change-Id: I8b8b003b789976b593a7c752969f47d55f4ee707
Reviewed-on: http://gerrit.openafs.org/4744
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/afs/LINUX/osi_vnodeops.c
src/afs/LINUX24/osi_vnodeops.c
src/afs/VNOPS/afs_vnop_lookup.c
src/afs/VNOPS/afs_vnop_readdir.c
src/afs/afs_buffer.c
src/afs/afs_prototypes.h
src/dir/Makefile.in
src/dir/buffer.c
src/dir/dir.c
src/dir/dir.h
src/dir/salvage.c