From e183522e3168c4a31103b3c7910fa8d29333fb5a Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 29 Apr 2012 15:00:38 -0400 Subject: diskspace: only load filesystem info on demand Only load filesystem details for the mount points that we're actually going to write to. This reduces our syscall count considerably. In the case of installation, we would actually stat every mountpoint twice (an extra round for download diskspace) which means (on my system) a total of 60 syscalls to write to 3 partitions when installing the kernel package. This change reduces the 60 syscalls down to the expected 3. A slight debug output change is added here to discern between a mountpoint added to our linked list versus when we actually load the fs info. Signed-off-by: Dave Reisner Signed-off-by: Dan McGee --- lib/libalpm/diskspace.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/libalpm/diskspace.h') diff --git a/lib/libalpm/diskspace.h b/lib/libalpm/diskspace.h index a54aa5e3..591d9337 100644 --- a/lib/libalpm/diskspace.h +++ b/lib/libalpm/diskspace.h @@ -37,6 +37,12 @@ enum mount_used_level { USED_INSTALL = (1 << 1), }; +enum mount_fsinfo { + MOUNT_FSINFO_UNLOADED = 0, + MOUNT_FSINFO_LOADED, + MOUNT_FSINFO_FAIL, +}; + typedef struct __alpm_mountpoint_t { /* mount point information */ char *mount_dir; @@ -46,6 +52,7 @@ typedef struct __alpm_mountpoint_t { blkcnt_t max_blocks_needed; enum mount_used_level used; int read_only; + enum mount_fsinfo fsinfo_loaded; FSSTATSTYPE fsp; } alpm_mountpoint_t; -- cgit v1.2.3-24-g4f1b