diff options
author | Miles Bader <miles@gnu.org> | 1995-12-04 22:01:16 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1995-12-04 22:01:16 +0000 |
commit | c848cecdb5cd147cba9040232a72b482d5896bb6 (patch) | |
tree | 11db71fd2e239b3c2ece7f6e4271fd2f49311fa1 | |
parent | 7f040686cfa4a84f16ca1d0404bdc2f7371b50af (diff) |
(trivfs_S_file_set_size, trivfs_S_file_sync,
trivfs_S_file_syncfs, trivfs_S_file_get_storage_info): Add totally
gratuitous, annoying, and trouble-making reply-port args.
(trivfs_S_file_get_storage_info): Use inline return if possible.
-rw-r--r-- | devio/io.c | 31 |
1 files changed, 24 insertions, 7 deletions
@@ -184,7 +184,9 @@ trivfs_S_io_write (struct trivfs_protid *cred, /* Truncate file. */ kern_return_t -trivfs_S_file_set_size (struct trivfs_protid *cred, off_t size) +trivfs_S_file_set_size (struct trivfs_protid *cred, + mach_port_t reply, mach_msg_type_name_t reply_type, + off_t size) { if (!cred) return EOPNOTSUPP; @@ -294,7 +296,9 @@ trivfs_S_io_mod_owner (struct trivfs_protid *cred, device. */ kern_return_t -trivfs_S_file_sync (struct trivfs_protid *cred, int wait) +trivfs_S_file_sync (struct trivfs_protid *cred, + mach_port_t reply, mach_msg_type_name_t reply_type, + int wait) { if (cred) return dev_sync (((struct open *)cred->po->hook)->dev, wait); @@ -303,7 +307,9 @@ trivfs_S_file_sync (struct trivfs_protid *cred, int wait) } kern_return_t -trivfs_S_file_syncfs (struct trivfs_protid *cred, int wait, int dochildren) +trivfs_S_file_syncfs (struct trivfs_protid *cred, + mach_port_t reply, mach_msg_type_name_t reply_type, + int wait, int dochildren) { if (!cred) return dev_sync (((struct open *)cred->po->hook)->dev, wait); @@ -314,7 +320,10 @@ trivfs_S_file_syncfs (struct trivfs_protid *cred, int wait, int dochildren) /* ---------------------------------------------------------------- */ error_t -trivfs_S_file_get_storage_info (struct trivfs_protid *cred, int *class, +trivfs_S_file_get_storage_info (struct trivfs_protid *cred, + mach_port_t reply, + mach_msg_type_name_t reply_type, + int *class, off_t **runs, unsigned *runs_len, size_t *block_size, char *dev_name, mach_port_t *dev_port, @@ -322,15 +331,22 @@ trivfs_S_file_get_storage_info (struct trivfs_protid *cred, int *class, char **misc, unsigned *misc_len, int *flags) { - error_t err; + error_t err = 0; + if (!cred) err = EOPNOTSUPP; else { struct dev *dev = ((struct open *)cred->po->hook)->dev; - err = vm_allocate (mach_task_self (), - (vm_address_t *)runs, 2 * sizeof (off_t), 1); + if (*runs_len < 2 * sizeof (off_t)) + { + *runs_len = 2 * sizeof (off_t); + err = + vm_allocate (mach_task_self (), + (vm_address_t *)runs, *runs_len, 1); + } + if (!err) { *class = STORAGE_DEVICE; @@ -353,5 +369,6 @@ trivfs_S_file_get_storage_info (struct trivfs_protid *cred, int *class, *misc_len = 0; } } + return err; } |