diff options
author | Roland McGrath <roland@gnu.org> | 2002-05-13 22:23:37 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2002-05-13 22:23:37 +0000 |
commit | 261c7ad8acc6cdbe4667afe14d635ecdbe1dc1ba (patch) | |
tree | fc18a56fb8521d13cbf82dc5b9b02ed99a373b33 | |
parent | 8317619c2d91aece08082cc46812d78efdf94f7e (diff) |
2002-05-13 Roland McGrath <roland@frob.com>
* netfs.h (struct node): New member `nn_translated'.
* dir-lookup.c (netfs_S_dir_lookup): Examine that in place of
nn_stat.st_mode to decide if there is a passive translator.
-rw-r--r-- | libnetfs/dir-lookup.c | 18 | ||||
-rw-r--r-- | libnetfs/netfs.h | 4 |
2 files changed, 13 insertions, 9 deletions
diff --git a/libnetfs/dir-lookup.c b/libnetfs/dir-lookup.c index bf81a17b..17d9e23e 100644 --- a/libnetfs/dir-lookup.c +++ b/libnetfs/dir-lookup.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1995,96,97,98,99,2000,01 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,2000,01,02 Free Software Foundation, Inc. Written by Michael I. Bushnell, p/BSG. This file is part of the GNU Hurd. @@ -184,10 +184,10 @@ netfs_S_dir_lookup (struct protid *diruser, goto out; if ((((flags & O_NOTRANS) == 0) || !lastcomp) - && ((np->nn_stat.st_mode & S_IPTRANS) - || S_ISFIFO (np->nn_stat.st_mode) - || S_ISCHR (np->nn_stat.st_mode) - || S_ISBLK (np->nn_stat.st_mode) + && ((np->nn_translated & S_IPTRANS) + || S_ISFIFO (np->nn_translated) + || S_ISCHR (np->nn_translated) + || S_ISBLK (np->nn_translated) || fshelp_translated (&np->transbox))) { mach_port_t dirport; @@ -205,12 +205,12 @@ netfs_S_dir_lookup (struct protid *diruser, if (err) return err; - switch (np->nn_stat.st_mode & S_IFMT) + switch (np->nn_translated & S_IFMT) { case S_IFCHR: case S_IFBLK: if (asprintf (argz, "%s%c%d%c%d", - (S_ISCHR (np->nn_stat.st_mode) + (S_ISCHR (np->nn_translated) ? _HURD_CHRDEV : _HURD_BLKDEV), 0, major (np->nn_stat.st_rdev), 0, minor (np->nn_stat.st_rdev)) < 0) @@ -258,7 +258,7 @@ netfs_S_dir_lookup (struct protid *diruser, dirport, diruser->user, lastcomp ? flags : 0, - ((np->nn_stat.st_mode & S_IPTRANS) + ((np->nn_translated & S_IPTRANS) ? _netfs_translator_callback1 : short_circuited_callback1), _netfs_translator_callback2, @@ -286,7 +286,7 @@ netfs_S_dir_lookup (struct protid *diruser, error = 0; } - if (S_ISLNK (np->nn_stat.st_mode) + if (S_ISLNK (np->nn_translated) && (!lastcomp || mustbedir /* "foo/" must see that foo points to a dir */ || !(flags & (O_NOLINK|O_NOTRANS)))) diff --git a/libnetfs/netfs.h b/libnetfs/netfs.h index 9becea59..119c5f65 100644 --- a/libnetfs/netfs.h +++ b/libnetfs/netfs.h @@ -74,6 +74,10 @@ struct node /* The stat information for this particular node. */ struct stat nn_stat; + /* The S_IPTRANS and S_IFMT bits here are examined instead of nn_stat.st_mode + to decide whether to do passive translator processing. Other bits + are ignored, so you can set this to nn_stat.st_mode if you want that. */ + mode_t nn_translated; struct mutex lock; |