Add stat object in diskdump_data. This is used in validation of
entries of page descriptor table to avoid calling fstat() many
times. The validation will be added in the next commit.
---
 diskdump.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/diskdump.c b/diskdump.c
index 3ae7bf2..a495120 100644
--- a/diskdump.c
+++ b/diskdump.c
@@ -78,6 +78,7 @@ struct diskdump_data {
        int     max_sect_len;           /* highest bucket of valid_pages */
        ulong   accesses;
        ulong   snapshot_task;
+       struct stat stat;
 };
 
 static struct diskdump_data diskdump_data = { 0 };
@@ -967,6 +968,9 @@ restart:
                }
        }
 
+       if (fstat(dd->dfd, &dd->stat) < 0)
+               error(FATAL, "diskdump: cannot stat dumpfile\n");
+
         return TRUE;
 
 err:
-- 
2.43.1
--
Crash-utility mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/
Contribution Guidelines: https://github.com/crash-utility/crash/wiki

Reply via email to