From 0e64f4e5701389ae3df1f6c388173e3ec254fc89 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Tue, 30 Jan 2001 00:50:25 +0000 Subject: 2001-01-15 Neal H Walfield * netfs.h: Added netfs_get_storage_info. * file-get-storage-info.c (netfs_S_get_storage_info): Calls netfs_get_storage_info instead of providing default response. * file-get-storage-info-default.c: New file. (netfs_get_storage_info): Provides default response. --- libnetfs/file-get-storage-info.c | 43 +++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'libnetfs/file-get-storage-info.c') diff --git a/libnetfs/file-get-storage-info.c b/libnetfs/file-get-storage-info.c index e9eb32bb..ac977be3 100644 --- a/libnetfs/file-get-storage-info.c +++ b/libnetfs/file-get-storage-info.c @@ -1,6 +1,6 @@ /* - Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc. - Written by Michael I. Bushnell, p/BSG. + Copyright (C) 2001 Free Software Foundation, Inc. + Written by Neal H Walfield This file is part of the GNU Hurd. @@ -20,35 +20,28 @@ #include "netfs.h" #include "fs_S.h" -#include error_t netfs_S_file_get_storage_info (struct protid *user, - mach_port_t **ports, - mach_msg_type_name_t *ports_type, - mach_msg_type_number_t *num_ports, - int **ints, mach_msg_type_number_t *num_ints, - off_t **offsets, - mach_msg_type_number_t *num_offsets, - char **data, mach_msg_type_number_t *data_len) + mach_port_t **ports, + mach_msg_type_name_t *ports_type, + mach_msg_type_number_t *num_ports, + int **ints, mach_msg_type_number_t *num_ints, + off_t **offsets, + mach_msg_type_number_t *num_offsets, + char **data, mach_msg_type_number_t *data_len) { + error_t err; + if (!user) return EOPNOTSUPP; - *data_len = 0; - *num_offsets = 0; - *num_ports = 0; - - if (*num_ints == 0) - /* Argh */ - { - *ints = mmap (0, sizeof (int), PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); - if (*ints == (int *) -1) - return errno; - } - - *num_ints = 1; - (*ints)[0] = STORAGE_NETWORK; + mutex_lock (&user->po->np->lock); + err = netfs_file_get_storage_info (user->user, user->po->np, ports, + ports_type, num_ports, ints, + num_ints, offsets, num_offsets, + data, data_len); + mutex_unlock (&user->po->np->lock); - return 0; + return err; } -- cgit v1.2.3