From bc7a03f4110b8d3a302a9235d8a047448509951d Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 9 May 2023 00:31:29 +0300 Subject: ext2fs: Port to x86_64 Message-Id: <20230508213136.608575-35-bugaevc@gmail.com> --- ext2fs/dir.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'ext2fs/dir.c') diff --git a/ext2fs/dir.c b/ext2fs/dir.c index 963f0843..ede3eda5 100644 --- a/ext2fs/dir.c +++ b/ext2fs/dir.c @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -415,7 +416,7 @@ dirscanblock (vm_address_t blockaddr, struct node *dp, int idx, || EXT2_DIR_REC_LEN (entry->name_len) > le16toh (entry->rec_len) || memchr (entry->name, '\0', entry->name_len)) { - ext2_warning ("bad directory entry: inode: %Ld offset: %lu", + ext2_warning ("bad directory entry: inode: %" PRIu64 " offset: %lu", dp->cache_id, (unsigned long)(currentoff - blockaddr + idx * DIRBLKSIZ)); return ENOENT; @@ -838,7 +839,7 @@ diskfs_drop_dirstat (struct node *dp, struct dirstat *ds) static error_t count_dirents (struct node *dp, block_t nb, char *buf) { - size_t amt; + mach_msg_type_number_t amt; char *offinblk; struct ext2_dir_entry_2 *entry; int count = 0; @@ -893,7 +894,7 @@ diskfs_get_directs (struct node *dp, char *datap; struct ext2_dir_entry_2 *entryp; int allocsize; - size_t checklen; + mach_msg_type_number_t checklen; struct dirent *userp; nblks = dp->dn_stat.st_size/DIRBLKSIZ; @@ -1069,7 +1070,8 @@ diskfs_get_directs (struct node *dp, if (le16toh (entryp->rec_len) == 0) { - ext2_warning ("zero length directory entry: inode: %Ld offset: %zd", + ext2_warning ("zero length directory entry: inode: %" PRIu64 + " offset: %zd", dp->cache_id, blkno * DIRBLKSIZ + bufp - buf); return EIO; @@ -1083,7 +1085,8 @@ diskfs_get_directs (struct node *dp, } else if (bufp - buf > DIRBLKSIZ) { - ext2_warning ("directory entry too long: inode: %Ld offset: %zd", + ext2_warning ("directory entry too long: inode: %" PRIu64 + " offset: %zd", dp->cache_id, blkno * DIRBLKSIZ + bufp - buf - le16toh (entryp->rec_len)); return EIO; -- cgit v1.2.3