summaryrefslogtreecommitdiff
path: root/libdiskfs/fsys-getfile.c
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-01-29 14:06:15 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-02-25 11:19:00 +0100
commit86e3141aaf13b1bc55d74bd6f557a62b814e944c (patch)
tree5478d2359f55b2aae2461695ea4b7bdeb50afdaf /libdiskfs/fsys-getfile.c
parent982261fec4707d0c8d0723d90d9c0e465d98aa93 (diff)
libdiskfs: fix receiver lookups in fsys server functions
* libdiskfs/diskfs.h (struct diskfs_control): New declaration. (diskfs_begin_using_control_port): New declaration and function. (diskfs_end_using_control_port): Likewise. * libdiskfs/fsmutations.h: Add translation functions. * libdiskfs/priv.h (control_t): New type declaration for mig. * libdiskfs/boot-start.c: Fix receiver lookups. * libdiskfs/fsys-getfile.c: Likewise. * libdiskfs/fsys-getroot.c: Likewise. * libdiskfs/fsys-goaway.c: Likewise. * libdiskfs/fsys-options.c: Likewise. * libdiskfs/fsys-syncfs.c: Likewise.
Diffstat (limited to 'libdiskfs/fsys-getfile.c')
-rw-r--r--libdiskfs/fsys-getfile.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/libdiskfs/fsys-getfile.c b/libdiskfs/fsys-getfile.c
index 2fe9495e..9dd5d732 100644
--- a/libdiskfs/fsys-getfile.c
+++ b/libdiskfs/fsys-getfile.c
@@ -27,7 +27,7 @@
/* Return in FILE & FILE_TYPE the file in FSYS corresponding to the NFS file
handle HANDLE & HANDLE_LEN. */
error_t
-diskfs_S_fsys_getfile (mach_port_t fsys,
+diskfs_S_fsys_getfile (struct diskfs_control *pt,
mach_port_t reply, mach_msg_type_name_t reply_type,
uid_t *uids, mach_msg_type_number_t nuids,
gid_t *gids, mach_msg_type_number_t ngids,
@@ -41,15 +41,13 @@ diskfs_S_fsys_getfile (mach_port_t fsys,
struct protid *new_cred;
struct peropen *new_po;
struct iouser *user;
- struct port_info *pt =
- ports_lookup_port (diskfs_port_bucket, fsys, diskfs_control_class);
- if (!pt)
+ if (!pt
+ || pt->pi.class != diskfs_control_class)
return EOPNOTSUPP;
if (handle_len != sizeof *f)
{
- ports_port_deref (pt);
return EINVAL;
}
@@ -58,14 +56,12 @@ diskfs_S_fsys_getfile (mach_port_t fsys,
err = diskfs_cached_lookup (f->data.cache_id, &node);
if (err)
{
- ports_port_deref (pt);
return err;
}
if (node->dn_stat.st_gen != f->data.gen)
{
diskfs_nput (node);
- ports_port_deref (pt);
return ESTALE;
}
@@ -73,7 +69,6 @@ diskfs_S_fsys_getfile (mach_port_t fsys,
if (err)
{
diskfs_nput (node);
- ports_port_deref (pt);
return err;
}
@@ -98,7 +93,6 @@ diskfs_S_fsys_getfile (mach_port_t fsys,
iohelp_free_iouser (user);
diskfs_nput (node);
- ports_port_deref (pt);
if (! err)
{