aboutsummaryrefslogtreecommitdiff
path: root/isofs/inode.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1997-09-16 20:12:02 +0000
committerThomas Bushnell <thomas@gnu.org>1997-09-16 20:12:02 +0000
commit490a300fb1d7d8a780069e97eb0a4509ead37632 (patch)
tree3d08a74dc139ef0c096322a7735002a9728ef9a9 /isofs/inode.c
parent4ebb5a2ce02ccd766687fac8f1d470ca6ca9203e (diff)
downloadhurd-490a300fb1d7d8a780069e97eb0a4509ead37632.tar.gz
hurd-490a300fb1d7d8a780069e97eb0a4509ead37632.tar.bz2
hurd-490a300fb1d7d8a780069e97eb0a4509ead37632.zip
Tue Sep 16 15:34:21 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* rr.c (gnuext_live): New variable. (rrip_work): Comprehend AU, TR, MD, and FL, all as GNU extensions. Recognize GNU extension id field when processing ER fields. (release_rrip): Free RR->trans if it's live. * inode.c (read_disknode): Interpret and install the values set by AU, TR, MD, and FL extensions. (diskfs_node_norefs): Free NP->translator if it's set. * isofs.h (struct disknode): New members `translen' and `translator'. * rr.h (struct gn_au, struct gn_tr, struct gn_md, struct gn_fl): New strucures. (GNUEXT_SRC, GNUEXT_DES, GNUEXT_ID, GNUEXT_VERS): New macros. (struct rrip_lookup): New members author, translen, trans, allmode, flags. (VALID_AU, VALID_TR, VALID_MD, VALID_FL): New macros. * Makefile (DIST_FILES): Add, referring to EXTENSIONS. * EXTENSIONS: New file.
Diffstat (limited to 'isofs/inode.c')
-rw-r--r--isofs/inode.c47
1 files changed, 37 insertions, 10 deletions
diff --git a/isofs/inode.c b/isofs/inode.c
index 13777b6d..cf74ecb7 100644
--- a/isofs/inode.c
+++ b/isofs/inode.c
@@ -322,26 +322,36 @@ read_disknode (struct node *np, struct dirrect *dr,
if (rl->valid & VALID_PX)
{
- st->st_mode = rl->mode;
+ if ((rl->valid & VALID_MD) == 0)
+ st->st_mode = rl->mode;
st->st_nlink = rl->nlink;
st->st_uid = rl->uid;
st->st_gid = rl->gid;
}
else
{
- /* If there are no periods, it's a directory. */
- if (((rl->valid & VALID_NM) && !index (rl->name, '.'))
- || (!(rl->valid & VALID_NM) && !memchr (dr->name, '.', dr->namelen)))
- st->st_mode = S_IFDIR | 0777;
- else
- st->st_mode = S_IFREG | 0666;
-
+ if ((rl->valid & VALID_MD) == 0)
+ {
+ /* If there are no periods, it's a directory. */
+ if (((rl->valid & VALID_NM) && !index (rl->name, '.'))
+ || (!(rl->valid & VALID_NM) && !memchr (dr->name, '.',
+ dr->namelen)))
+ st->st_mode = S_IFDIR | 0777;
+ else
+ st->st_mode = S_IFREG | 0666;
+ }
st->st_nlink = 1;
st->st_uid = 0;
st->st_gid = 0;
}
+
+ if (rl->valid & VALID_MD)
+ st->st_mode = rl->allmode;
- st->st_author = st->st_gid;
+ if (rl->valid & VALID_AU)
+ st->st_author = rl->author;
+ else
+ st->st_author = st->st_gid;
st->st_size = isonum_733 (dr->size);
@@ -391,7 +401,11 @@ read_disknode (struct node *np, struct dirrect *dr,
st->st_blksize = logical_block_size;
st->st_blocks = (st->st_size - 1) / 512 + 1;
- st->st_flags = 0;
+
+ if (rl->valid & VALID_FL)
+ st->st_flags = rl->flags;
+ else
+ st->st_flags = 0;
if (S_ISLNK (st->st_mode))
{
@@ -408,6 +422,16 @@ read_disknode (struct node *np, struct dirrect *dr,
}
}
+ if (rr->valid & VALID_TR)
+ {
+ st->st_mode |= S_IPTRANS;
+ np->dn->translen = rl->translen;
+ np->dn->translator = rl->trans;
+ rl->trans = 0;
+ }
+ else
+ np->dn->translator = np->dn->translen = 0;
+
diskfs_end_catch_exception ();
return 0;
@@ -432,6 +456,9 @@ diskfs_node_norefs (struct node *np)
assert (node_cache[np->cache_id - 1].np == np);
node_cache[np->cache_id - 1].np = 0;
+ if (np->translator)
+ free (np->translator);
+
assert (!np->dn->fileinfo);
free (np->dn);
free (np);