1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:08:13 +00:00

Kernel+LibC: Use 64 bit values for ino_t

Since the InodeIndex encapsulates a 64 bit value, it is correct to
ensure that the Kernel is exposing the entire value and the LibC is
aware of it.

This commit requires an entire re-compile because it's essentially a
change in the Kernel ABI, together with a corresponding change in LibC.
This commit is contained in:
Liav A 2021-08-08 21:23:27 +03:00 committed by Andreas Kling
parent 04c2addaa8
commit bf1adc2d5d
6 changed files with 7 additions and 6 deletions

View file

@ -261,7 +261,7 @@ KResultOr<size_t> FileDescription::get_dir_entries(UserOrKernelBuffer& output_bu
return false; return false;
} }
} }
stream << (u32)entry.inode.index().value(); stream << (u64)entry.inode.index().value();
stream << m_inode->fs().internal_file_type_to_directory_entry_type(entry); stream << m_inode->fs().internal_file_type_to_directory_entry_type(entry);
stream << (u32)entry.name.length(); stream << (u32)entry.name.length();
stream << entry.name.bytes(); stream << entry.name.bytes();

View file

@ -357,7 +357,7 @@ enum {
#define TCSAFLUSH 2 #define TCSAFLUSH 2
typedef u32 dev_t; typedef u32 dev_t;
typedef u32 ino_t; typedef u64 ino_t;
typedef u16 mode_t; typedef u16 mode_t;
typedef u32 nlink_t; typedef u32 nlink_t;
typedef u32 uid_t; typedef u32 uid_t;

View file

@ -5,6 +5,7 @@
*/ */
#include <AK/Assertions.h> #include <AK/Assertions.h>
#include <AK/Format.h>
#include <AK/ScopeGuard.h> #include <AK/ScopeGuard.h>
#include <AK/StdLibExtras.h> #include <AK/StdLibExtras.h>
#include <AK/Vector.h> #include <AK/Vector.h>

View file

@ -32,7 +32,7 @@ typedef char* caddr_t;
typedef int id_t; typedef int id_t;
typedef uint32_t ino_t; typedef uint64_t ino_t;
typedef int64_t off_t; typedef int64_t off_t;
typedef uint32_t blkcnt_t; typedef uint32_t blkcnt_t;

View file

@ -279,7 +279,7 @@ static size_t print_name(const struct stat& st, const String& name, const char*
static bool print_filesystem_object(const String& path, const String& name, const struct stat& st) static bool print_filesystem_object(const String& path, const String& name, const struct stat& st)
{ {
if (flag_show_inode) if (flag_show_inode)
printf("%08u ", st.st_ino); printf("%s ", String::formatted("{}", st.st_ino).characters());
if (S_ISDIR(st.st_mode)) if (S_ISDIR(st.st_mode))
printf("d"); printf("d");
@ -445,7 +445,7 @@ static bool print_filesystem_object_short(const char* path, const char* name, si
} }
if (flag_show_inode) if (flag_show_inode)
printf("%08u ", st.st_ino); printf("%s ", String::formatted("{}", st.st_ino).characters());
*nprinted = print_name(st, name, nullptr, path); *nprinted = print_name(st, name, nullptr, path);
return true; return true;

View file

@ -26,7 +26,7 @@ static int stat(const char* file, bool should_follow_links)
return 1; return 1;
} }
printf(" File: %s\n", file); printf(" File: %s\n", file);
printf(" Inode: %u\n", st.st_ino); printf(" Inode: %s\n", String::formatted("{}", st.st_ino).characters());
if (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode)) if (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode))
printf(" Device: %u,%u\n", major(st.st_rdev), minor(st.st_rdev)); printf(" Device: %u,%u\n", major(st.st_rdev), minor(st.st_rdev));
else else