diff options
author | Roland McGrath <roland@gnu.org> | 2001-02-26 10:43:02 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2001-02-26 10:43:02 +0000 |
commit | 6d2bd2cd475854c7f85e2401f25f2cc91162cbc4 (patch) | |
tree | 9bf05515e937c8de53f0ad0921579597d42e9f4b /tmpfs/tmpfs.c | |
parent | 750ec71475a3d41fb2ced1058bc01d6096e24887 (diff) |
2001-02-26 Roland McGrath <roland@frob.com>
* tmpfs.c (main): Don't lock diskfs_root_node after alloc,
which already locks it. In root node's mode, clear S_ITRANS bits
and set S_IROOT bit.
Diffstat (limited to 'tmpfs/tmpfs.c')
-rw-r--r-- | tmpfs/tmpfs.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tmpfs/tmpfs.c b/tmpfs/tmpfs.c index 200f9394..53b489e2 100644 --- a/tmpfs/tmpfs.c +++ b/tmpfs/tmpfs.c @@ -255,8 +255,6 @@ main (int argc, char **argv) if (err) error (4, err, "cannot create root directory"); - mutex_lock (&diskfs_root_node->lock); - diskfs_spawn_first_thread (); /* Now that we are all set up to handle requests, and diskfs_root_node is @@ -279,6 +277,11 @@ main (int argc, char **argv) else { diskfs_root_node->dn_stat.st_mode = S_IFDIR | (st.st_mode &~ S_IFMT); + if (S_ISREG(st.st_mode) && (st.st_mode & 0111) == 0) + /* There are no execute bits set, as by default on a plain file. + For the virtual directory, set execute bits where read bits are + set on the underlying plain file. */ + diskfs_root_node->dn_stat.st_mode |= (st.st_mode & 0444) >> 2; diskfs_root_node->dn_stat.st_uid = st.st_uid; diskfs_root_node->dn_stat.st_author = st.st_author; diskfs_root_node->dn_stat.st_gid = st.st_gid; @@ -287,6 +290,8 @@ main (int argc, char **argv) diskfs_root_node->dn_stat.st_ctime = st.st_ctime; diskfs_root_node->dn_stat.st_flags = st.st_flags; } + diskfs_root_node->dn_stat.st_mode &= ~S_ITRANS; + diskfs_root_node->dn_stat.st_mode |= S_IROOT; mutex_unlock (&diskfs_root_node->lock); |