afs.fs module that simply exports the same whichcell function.
Signed-off-by: Evan Broder <broder@mit.edu>
afs/_pts.dep
afs/_acl.c
afs/_acl.dep
+afs/_fs.c
+afs/_fs.dep
*.so
build
--- /dev/null
+from afs cimport *
+from afs import pyafs_error
+
+def whichcell(char* path):
+ """Determine which AFS cell a particular path is in."""
+ cdef char cell[MAXCELLCHARS]
+
+ pioctl_read(path, VIOC_FILE_CELL_NAME, cell, sizeof(cell), 1)
+ return cell
cdef import from "afs/venus.h":
enum:
# PIOCTLS to Venus that we use
- VIOCGETAL, VIOC_GETVCXSTATUS2, VIOCSETAL
+ VIOCGETAL, VIOC_GETVCXSTATUS2, VIOCSETAL, VIOC_FILE_CELL_NAME
# pioctl doesn't actually have a header, so we have to define it here
cdef extern int pioctl(char *, afs_int32, ViceIoctl *, afs_int32)
--- /dev/null
+import _fs
+from _fs import whichcell
packages=['afs', 'afs.tests'],
ext_modules=[
PyAFSExtension("afs.afs"),
- PyAFSExtension("afs._pts", libraries=['krb5']),
PyAFSExtension("afs._acl"),
+ PyAFSExtension("afs._fs"),
+ PyAFSExtension("afs._pts", libraries=['krb5']),
],
cmdclass= {"build_ext": build_ext}
)