summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-11-19 22:38:17 +0000
committerMiles Bader <miles@gnu.org>1996-11-19 22:38:17 +0000
commitae635e83d31faa0e99788278c4b11bdc7eb8bb21 (patch)
tree13301152b74b132ac5a252ebea12b6a315eeaf3e
parent4164e4b0eabd69d9c14a05bdca869c49bd5a99b5 (diff)
(diskfs_S_io_stat):
Set S_IATRANS & S_IROOT bits in st_mode field of returned buffer if appropiate.
-rw-r--r--libdiskfs/io-stat.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libdiskfs/io-stat.c b/libdiskfs/io-stat.c
index df8b4291..be584ff7 100644
--- a/libdiskfs/io-stat.c
+++ b/libdiskfs/io-stat.c
@@ -25,18 +25,32 @@ diskfs_S_io_stat (struct protid *cred,
io_statbuf_t *statbuf)
{
struct node *np;
+ mach_port_t atrans;
if (!cred)
return EOPNOTSUPP;
np = cred->po->np;
mutex_lock (&np->lock);
+
iohelp_get_conch (&np->conch);
if (diskfs_synchronous)
diskfs_node_update (np, 1);
else
diskfs_set_node_times (np);
+
bcopy (&np->dn_stat, statbuf, sizeof (struct stat));
+ statbuf->st_mode &= ~(S_IATRANS | S_IROOT);
+ if (fshelp_fetch_control (&np->transbox, &atrans) == 0
+ && atrans != MACH_PORT_NULL)
+ {
+ statbuf->st_mode |= S_IATRANS;
+ mach_port_deallocate (mach_task_self (), atrans);
+ }
+ if (np == diskfs_root_node)
+ statbuf->st_mode |= S_IROOT;
+
mutex_unlock (&np->lock);
+
return 0;
}