From 6707f62fbcf71108e12a018d26dc4baa33864913 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 1 Oct 2001 01:05:06 +0000 Subject: 2001-09-30 Roland McGrath * node.c (diskfs_S_file_get_storage_info): Implement it to return the memory object port with STORAGE_MEMORY. --- tmpfs/node.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'tmpfs/node.c') diff --git a/tmpfs/node.c b/tmpfs/node.c index 32d7b062..75c1e188 100644 --- a/tmpfs/node.c +++ b/tmpfs/node.c @@ -20,6 +20,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "tmpfs.h" #include #include +#include +#include +#include #include unsigned int num_files; @@ -526,5 +529,31 @@ diskfs_S_file_get_storage_info (struct protid *cred, mach_msg_type_number_t *num_offsets, char **data, mach_msg_type_number_t *data_len) { - return EOPNOTSUPP; + mach_port_t memobj = diskfs_get_filemap (cred->po->np, VM_PROT_ALL); + if (memobj == MACH_PORT_NULL) + return errno; + + assert (*num_ports >= 1); /* mig always gives us some */ + *num_ports = 1; + *ports_type = MACH_MSG_TYPE_MOVE_SEND; + (*ports)[0] = memobj; + + assert (*num_offsets >= 2); /* mig always gives us some */ + *num_offsets = 2; + (*offsets)[0] = 0; + (*offsets)[1] = cred->po->np->dn_stat.st_size; + + assert (*num_ints >= 6); /* mig always gives us some */ + *num_ints = 6; + (*ints)[0] = STORAGE_MEMORY; + (*ints)[1] = (((cred->po->openstat & O_RDWR) == O_READ) + ? STORE_READONLY : 0); + (*ints)[2] = 1; /* block size */ + (*ints)[3] = 1; /* 1 run in offsets list */ + (*ints)[4] = 0; /* name len */ + (*ints)[5] = 0; /* misc len */ + + *data_len = 0; + + return 0; } -- cgit v1.2.3