|
|
f96e0b |
From 10519a65aaf196c32e687a681b9565a763d772dc Mon Sep 17 00:00:00 2001
|
|
|
f96e0b |
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
|
|
|
f96e0b |
Date: Sat, 8 Dec 2012 21:14:08 +0100
|
|
|
f96e0b |
Subject: [PATCH 058/482] Fix big-endian mtime.
|
|
|
f96e0b |
|
|
|
f96e0b |
* grub-core/fs/ufs.c (grub_ufs_inode): Split improperly attached
|
|
|
f96e0b |
together sec and usec.
|
|
|
f96e0b |
(grub_ufs_dir): Use correct byteswapping for UFS time.
|
|
|
f96e0b |
---
|
|
|
f96e0b |
ChangeLog | 8 ++++++++
|
|
|
f96e0b |
grub-core/fs/ufs.c | 19 +++++++++++++------
|
|
|
f96e0b |
2 files changed, 21 insertions(+), 6 deletions(-)
|
|
|
f96e0b |
|
|
|
f96e0b |
diff --git a/ChangeLog b/ChangeLog
|
|
|
f96e0b |
index d565547..9c6dde5 100644
|
|
|
f96e0b |
--- a/ChangeLog
|
|
|
f96e0b |
+++ b/ChangeLog
|
|
|
f96e0b |
@@ -1,5 +1,13 @@
|
|
|
f96e0b |
2012-12-08 Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
f96e0b |
|
|
|
f96e0b |
+ Fix big-endian mtime.
|
|
|
f96e0b |
+
|
|
|
f96e0b |
+ * grub-core/fs/ufs.c (grub_ufs_inode): Split improperly attached
|
|
|
f96e0b |
+ together sec and usec.
|
|
|
f96e0b |
+ (grub_ufs_dir): Use correct byteswapping for UFS time.
|
|
|
f96e0b |
+
|
|
|
f96e0b |
+2012-12-08 Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
f96e0b |
+
|
|
|
f96e0b |
Support big-endian UFS1.
|
|
|
f96e0b |
|
|
|
f96e0b |
* Makefile.util.def (libgrubmods): Add ufs_be.c
|
|
|
f96e0b |
diff --git a/grub-core/fs/ufs.c b/grub-core/fs/ufs.c
|
|
|
f96e0b |
index 3f2dba1..c862336 100644
|
|
|
f96e0b |
--- a/grub-core/fs/ufs.c
|
|
|
f96e0b |
+++ b/grub-core/fs/ufs.c
|
|
|
f96e0b |
@@ -151,9 +151,9 @@ struct grub_ufs_inode
|
|
|
f96e0b |
grub_uint64_t mtime;
|
|
|
f96e0b |
grub_uint64_t ctime;
|
|
|
f96e0b |
grub_uint64_t create_time;
|
|
|
f96e0b |
- grub_uint32_t atime_sec;
|
|
|
f96e0b |
- grub_uint32_t mtime_sec;
|
|
|
f96e0b |
- grub_uint32_t ctime_sec;
|
|
|
f96e0b |
+ grub_uint32_t atime_usec;
|
|
|
f96e0b |
+ grub_uint32_t mtime_usec;
|
|
|
f96e0b |
+ grub_uint32_t ctime_usec;
|
|
|
f96e0b |
grub_uint32_t create_time_sec;
|
|
|
f96e0b |
grub_uint32_t gen;
|
|
|
f96e0b |
grub_uint32_t kernel_flags;
|
|
|
f96e0b |
@@ -181,9 +181,12 @@ struct grub_ufs_inode
|
|
|
f96e0b |
grub_uint16_t uid;
|
|
|
f96e0b |
grub_uint16_t gid;
|
|
|
f96e0b |
grub_uint64_t size;
|
|
|
f96e0b |
- grub_uint64_t atime;
|
|
|
f96e0b |
- grub_uint64_t mtime;
|
|
|
f96e0b |
- grub_uint64_t ctime;
|
|
|
f96e0b |
+ grub_uint32_t atime;
|
|
|
f96e0b |
+ grub_uint32_t atime_usec;
|
|
|
f96e0b |
+ grub_uint32_t mtime;
|
|
|
f96e0b |
+ grub_uint32_t mtime_usec;
|
|
|
f96e0b |
+ grub_uint32_t ctime;
|
|
|
f96e0b |
+ grub_uint32_t ctime_usec;
|
|
|
f96e0b |
union
|
|
|
f96e0b |
{
|
|
|
f96e0b |
struct
|
|
|
f96e0b |
@@ -684,7 +687,11 @@ grub_ufs_dir (grub_device_t device, const char *path,
|
|
|
f96e0b |
|
|
|
f96e0b |
info.dir = ((grub_ufs_to_cpu16 (inode.mode) & GRUB_UFS_ATTR_TYPE)
|
|
|
f96e0b |
== GRUB_UFS_ATTR_DIR);
|
|
|
f96e0b |
+#ifdef MODE_UFS2
|
|
|
f96e0b |
info.mtime = grub_ufs_to_cpu64 (inode.mtime);
|
|
|
f96e0b |
+#else
|
|
|
f96e0b |
+ info.mtime = grub_ufs_to_cpu32 (inode.mtime);
|
|
|
f96e0b |
+#endif
|
|
|
f96e0b |
info.mtimeset = 1;
|
|
|
f96e0b |
|
|
|
f96e0b |
if (hook (filename, &info))
|
|
|
f96e0b |
--
|
|
|
f96e0b |
1.8.2.1
|
|
|
f96e0b |
|