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 | 6337cbc4e5f5e0bdb6c41428fc4e15bc7791133c (patch) | |
tree | 6c4ebf832a2a8e2936380599b399eb3916662403 /ufs/pager.c | |
parent | 13843f409047b9458c3ea2fb0a390773afcef5f7 (diff) |
Formerly pager.c.~27~
Diffstat (limited to 'ufs/pager.c')
-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); |