From 86e3141aaf13b1bc55d74bd6f557a62b814e944c Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Wed, 29 Jan 2014 14:06:15 +0100 Subject: 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. --- libdiskfs/fsys-getfile.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'libdiskfs/fsys-getfile.c') 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) { -- cgit v1.2.3