Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110721454
D35132.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
954 B
Referenced Files
None
Subscribers
None
D35132.diff
View Options
Index: usr.sbin/makefs/ffs.c
===================================================================
--- usr.sbin/makefs/ffs.c
+++ usr.sbin/makefs/ffs.c
@@ -623,12 +623,19 @@
e, tmpdir.d_namlen, this, curdirsize); \
} while (0);
- /*
- * XXX this needs to take into account extra space consumed
- * by indirect blocks, etc.
- */
#define ADDSIZE(x) do { \
- fsopts->size += roundup((x), ffs_opts->fsize); \
+ if ((size_t)(x) < UFS_NDADDR * (size_t)ffs_opts->bsize) { \
+ fsopts->size += roundup((x), ffs_opts->fsize); \
+ } else { \
+ /* Count space consumed by indirecttion blocks. */ \
+ fsopts->size += ffs_opts->bsize * \
+ (howmany((x), UFS_NDADDR * ffs_opts->bsize) - 1); \
+ /* \
+ * If the file is big enough to use indirect blocks, \
+ * we allocate bsize block for trailing data. \
+ */ \
+ fsopts->size += roundup((x), ffs_opts->bsize); \
+ } \
} while (0);
curdirsize = 0;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 23, 8:11 AM (4 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16790974
Default Alt Text
D35132.diff (954 B)
Attached To
Mode
D35132: makefs(8): Fix calculation of file sizes
Attached
Detach File
Event Timeline
Log In to Comment