Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151659853
D10578.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D10578.diff
View Options
Index: sbin/tunefs/tunefs.c
===================================================================
--- sbin/tunefs/tunefs.c
+++ sbin/tunefs/tunefs.c
@@ -691,7 +691,7 @@
dp2 = ip;
dp1 = ip;
if (sblock.fs_magic == FS_UFS1_MAGIC) {
- if ((off_t)dp1->di_size >= lblktosize(&sblock, UFS_NDADDR)) {
+ if (dp1->di_size >= lblktosize(&sblock, UFS_NDADDR)) {
warnx("UFS_ROOTINO extends beyond direct blocks.");
return (-1);
}
@@ -703,7 +703,7 @@
return (ino);
}
} else {
- if ((off_t)dp2->di_size >= lblktosize(&sblock, UFS_NDADDR)) {
+ if (dp2->di_size >= lblktosize(&sblock, UFS_NDADDR)) {
warnx("UFS_ROOTINO extends beyond direct blocks.");
return (-1);
}
Index: sys/ufs/ffs/fs.h
===================================================================
--- sys/ufs/ffs/fs.h
+++ sys/ufs/ffs/fs.h
@@ -574,7 +574,7 @@
#define lfragtosize(fs, frag) /* calculates ((off_t)frag * fs->fs_fsize) */ \
(((off_t)(frag)) << (fs)->fs_fshift)
#define lblktosize(fs, blk) /* calculates ((off_t)blk * fs->fs_bsize) */ \
- (((off_t)(blk)) << (fs)->fs_bshift)
+ (((uint64_t)(blk)) << (fs)->fs_bshift)
/* Use this only when `blk' is known to be small, e.g., < UFS_NDADDR. */
#define smalllblktosize(fs, blk) /* calculates (blk * fs->fs_bsize) */ \
((blk) << (fs)->fs_bshift)
@@ -609,12 +609,12 @@
*/
#define blksize(fs, ip, lbn) \
(((lbn) >= UFS_NDADDR || (ip)->i_size >= smalllblktosize(fs, (lbn) + 1)) \
- ? (fs)->fs_bsize \
+ ? (uint64_t)(fs)->fs_bsize \
: (fragroundup(fs, blkoff(fs, (ip)->i_size))))
#define sblksize(fs, size, lbn) \
(((lbn) >= UFS_NDADDR || (size) >= ((lbn) + 1) << (fs)->fs_bshift) \
- ? (fs)->fs_bsize \
- : (fragroundup(fs, blkoff(fs, (size)))))
+ ? (uint64_t)(fs)->fs_bsize \
+ : (fragroundup(fs, blkoff(fs, (uint64_t)(size)))))
/*
* Number of indirects in a filesystem block.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 10, 8:23 PM (11 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31229163
Default Alt Text
D10578.diff (1 KB)
Attached To
Mode
D10578: fs.h: fix signed/unsigned issues, from NetBSD
Attached
Detach File
Event Timeline
Log In to Comment