diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2013-09-02 11:37:06 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-09-15 23:08:37 +0200 |
commit | 2ea00da3929b9b50c3860914249b3ea7691b63c8 (patch) | |
tree | 768ffebcc8ecc0cad41fce5fb54b67a8a19f5630 /libnetfs/make-peropen.c | |
parent | 06d49cdadd9e96361f3fe49b9c940b88bb869284 (diff) | |
download | hurd-2ea00da3929b9b50c3860914249b3ea7691b63c8.tar.gz hurd-2ea00da3929b9b50c3860914249b3ea7691b63c8.tar.bz2 hurd-2ea00da3929b9b50c3860914249b3ea7691b63c8.zip |
libnetfs: track file name in struct peropen
Track the relative path used to obtain a file handle in the
struct peropen.
* libnetfs/netfs.h (struct peropen): New field path.
* libnetfs/make-peropen.c (netfs_make_peropen): Initialize path.
* libnetfs/release-peropen.c (netfs_release_peropen): Free path.
* libnetfs/fsys-getroot.c (netfs_S_fsys_getroot): Initialize path.
* libnetfs/dir-lookup.c (netfs_S_dir_lookup): Preserve the path.
Diffstat (limited to 'libnetfs/make-peropen.c')
-rw-r--r-- | libnetfs/make-peropen.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libnetfs/make-peropen.c b/libnetfs/make-peropen.c index 92f58da0..733bfdcb 100644 --- a/libnetfs/make-peropen.c +++ b/libnetfs/make-peropen.c @@ -31,6 +31,7 @@ netfs_make_peropen (struct node *np, int flags, struct peropen *context) po->refcnt = 0; po->openstat = flags; po->np = np; + po->path = NULL; if (context) { @@ -47,6 +48,13 @@ netfs_make_peropen (struct node *np, int flags, struct peropen *context) if (po->shadow_root_parent != MACH_PORT_NULL) mach_port_mod_refs (mach_task_self (), po->shadow_root_parent, MACH_PORT_RIGHT_SEND, 1); + + if (context->path) + { + po->path = strdup (context->path); + if (! po->path) + return ENOMEM; + } } netfs_nref (np); |