diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-09-20 19:53:01 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-09-20 19:53:01 +0000 |
commit | 47768c79e262d915a9b3209244831fde50499e6d (patch) | |
tree | f0fe612950bdd9cfba9d31e8098add2a4ffa7703 | |
parent | 87f910ede730e49d812c16007cf70a07ea50acd7 (diff) |
Formerly pager.c.~27~
-rw-r--r-- | ufs/pager.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/ufs/pager.c b/ufs/pager.c index 7aea0f9d..994d65ee 100644 --- a/ufs/pager.c +++ b/ufs/pager.c @@ -387,8 +387,6 @@ pager_report_extent (struct user_pager_info *pager, vm_address_t *offset, vm_size_t *size) { - int sizet; - *offset = 0; switch (pager->type) { @@ -405,12 +403,24 @@ pager_report_extent (struct user_pager_info *pager, break; case SINDIR: - sizet = pager->np->allocsize; - sizet = (sizet + sblock->fs_bsize - 1) / sblock->fs_bsize; - sizet -= NDADDR; - sizet *= sizeof (daddr_t); - sizet = (sizet + sblock->fs_bsize - 1) / sblock->fs_bsize; - *size = sizet; + { + int sizet; + + /* sizet = disk size of the file */ + sizet = pager->np->allocsize; + + /* sizet = number of fs blocks in file */ + sizet = (sizet + sblock->fs_bsize - 1) / sblock->fs_bsize; + + /* sizet = number of fs blocks not list in di_db */ + sizet -= NDADDR; + + /* sizet = space to hold that many pointers */ + sizet *= sizeof (daddr_t); + + /* And that's the size of the sindir area for the file. */ + *size = sizet; + } break; case FILE_DATA: @@ -543,7 +553,6 @@ sin_remap (struct node *np, newsize = (newsize + sblock->fs_bsize - 1) / sblock->fs_bsize; newsize -= NDADDR; newsize *= sizeof (daddr_t); - newsize = (newsize + sblock->fs_bsize - 1) / sblock->fs_bsize; newsize = round_page (newsize); assert (newsize >= size); |