From df12c601cd8ddd0f60e5cabbef52cd48d5c22dc9 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sat, 27 Jan 1996 16:49:50 +0000 Subject: (diskfs_S_file_getcontrol): Use ports_create_port instead of ports_allocate_port. --- libdiskfs/file-getcontrol.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'libdiskfs/file-getcontrol.c') diff --git a/libdiskfs/file-getcontrol.c b/libdiskfs/file-getcontrol.c index 27225e31..e510a271 100644 --- a/libdiskfs/file-getcontrol.c +++ b/libdiskfs/file-getcontrol.c @@ -1,5 +1,5 @@ /* libdiskfs implementation of fs.defs:file_getcontrol.c - Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation + Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -34,15 +34,17 @@ diskfs_S_file_getcontrol (struct protid *cred, error = EPERM; else { - spin_lock (&_diskfs_control_lock); - _diskfs_ncontrol_ports++; - spin_unlock (&_diskfs_control_lock); - newpi = ports_allocate_port (diskfs_port_bucket, - sizeof (struct port_info), - diskfs_control_class); - *control = ports_get_right (newpi); - *controltype = MACH_MSG_TYPE_MAKE_SEND; - ports_port_deref (newpi); + error = ports_create_port (diskfs_control_class, diskfs_port_bucket, + sizeof (struct port_info), &newpi); + if (! error) + { + spin_lock (&_diskfs_control_lock); + _diskfs_ncontrol_ports++; + spin_unlock (&_diskfs_control_lock); + *control = ports_get_right (newpi); + *controltype = MACH_MSG_TYPE_MAKE_SEND; + ports_port_deref (newpi); + } } return error; -- cgit v1.2.3