From 4f60a6280f58cdbf24bac64f2757851597247666 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 19 Oct 1995 20:49:33 +0000 Subject: (diskfs_node_reload): New function. (iget): Move allocsize setting into read_disknode. --- ufs/inode.c | 23 ++++++++++++++++++----- 1 file 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; } -- cgit v1.2.3