grub2/include/grub/time.h
Carlos Maiolino 8b1e5d1936 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>
2021-06-01 17:20:20 +02:00

49 lines
1.3 KiB
C

/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2007, 2008 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KERNEL_TIME_HEADER
#define KERNEL_TIME_HEADER 1
#include <grub/types.h>
#include <grub/symbol.h>
#if !defined(GRUB_MACHINE_EMU) && !defined(GRUB_UTIL)
#include <grub/cpu/time.h>
#else
static inline void
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);
grub_uint64_t grub_rtc_get_time_ms (void);
static __inline void
grub_sleep (grub_uint32_t s)
{
grub_millisleep (1000 * s);
}
void grub_install_get_time_ms (grub_uint64_t (*get_time_ms_func) (void));
#endif /* ! KERNEL_TIME_HEADER */