fs/xfs: Add bigtime incompat feature support

The XFS filesystem supports a bigtime feature to overcome y2038 problem.
This patch makes the GRUB able to support the XFS filesystems with this
feature enabled.

The XFS counter for the bigtime enabled timestamps starts at 0, which
translates to GRUB_INT32_MIN (Dec 31 20:45:52 UTC 1901) in the legacy
timestamps. The conversion to Unix timestamps is made before passing the
value to other GRUB functions.

For this to work properly, GRUB requires an access to flags2 field in the
XFS ondisk inode. So, the grub_xfs_inode structure has been updated to
cover full ondisk inode.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Carlos Maiolino authored and Daniel Kiper committed 2021-06-01 17:20:20 +02:00
1 parent 81f1962393
commit 8b1e5d1936
2 files changed
+42 -9

No files matched your search

+2
View File
@@ -30,6 +30,8 @@ grub_cpu_idle(void)
}
#endif
#define NSEC_PER_SEC ((grub_int64_t) 1000000000)
void EXPORT_FUNC(grub_millisleep) (grub_uint32_t ms);
grub_uint64_t EXPORT_FUNC(grub_get_time_ms) (void);