diff options
author | Miles Bader <miles@gnu.org> | 1995-10-19 20:49:33 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1995-10-19 20:49:33 +0000 |
commit | 4f60a6280f58cdbf24bac64f2757851597247666 (patch) | |
tree | be6ce7515948ca4e86f16fdffcadecae862b996d | |
parent | d9cf46ccd62c581063bc58980ca9373af8ab8b46 (diff) |
(diskfs_node_reload): New function.
(iget): Move allocsize setting into read_disknode.
-rw-r--r-- | ufs/inode.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/ufs/inode.c b/ufs/inode.c index b15c9848..179a85bc 100644 --- a/ufs/inode.c +++ b/ufs/inode.c @@ -83,11 +83,6 @@ iget (ino_t inum, struct node **npp) spin_unlock (&diskfs_node_refcnt_lock); err = read_disknode (np); - - if (lblkno (sblock, np->dn_stat.st_size) < NDADDR) - np->allocsize = fragroundup (sblock, np->dn_stat.st_size); - else - np->allocsize = blkroundup (sblock, np->dn_stat.st_size); if (!diskfs_readonly && !np->dn_stat.st_gen) { @@ -271,6 +266,24 @@ read_disknode (struct node *np) diskfs_end_catch_exception (); if (!S_ISBLK (st->st_mode) && !S_ISCHR (st->st_mode)) st->st_rdev = 0; + + if (lblkno (sblock, np->dn_stat.st_size) < NDADDR) + np->allocsize = fragroundup (sblock, np->dn_stat.st_size); + else + np->allocsize = blkroundup (sblock, np->dn_stat.st_size); + + return 0; +} + +error_t diskfs_node_reload (struct node *node) +{ + if (node->dn->dirents) + { + free (node->dn->dirents); + node->dn->dirents = 0; + } + flush_node_pager (node); + read_disknode (node); return 0; } |