aboutsummaryrefslogtreecommitdiff
path: root/libnetfs/file-get-storage-info.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnetfs/file-get-storage-info.c')
-rw-r--r--libnetfs/file-get-storage-info.c51
1 files changed, 21 insertions, 30 deletions
diff --git a/libnetfs/file-get-storage-info.c b/libnetfs/file-get-storage-info.c
index 05232e85..ac977be3 100644
--- a/libnetfs/file-get-storage-info.c
+++ b/libnetfs/file-get-storage-info.c
@@ -1,6 +1,6 @@
-/*
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Written by Michael I. Bushnell, p/BSG.
+/*
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Written by Neal H Walfield <neal@cs.uml.edu>
This file is part of the GNU Hurd.
@@ -23,34 +23,25 @@
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 */
- {
- error_t err =
- vm_allocate (mach_task_self (), (vm_address_t *)ints, sizeof (int), 1);
- if (err)
- return err;
- }
-
- *num_ints = 1;
- (*ints)[0] = STORAGE_NETWORK;
-
- return 0;
-}
-
+ 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 err;
+}