summaryrefslogtreecommitdiff
path: root/lib/libalpm/diskspace.h
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-04-29 15:00:38 -0400
committerDan McGee <dan@archlinux.org>2012-06-25 23:37:10 -0500
commite183522e3168c4a31103b3c7910fa8d29333fb5a (patch)
treeb95bd05a19eb44ffb16cdf0306a7d1579e064863 /lib/libalpm/diskspace.h
parent82c999a8bfbffab4740742b4746435f5f1657643 (diff)
downloadpacman-e183522e3168c4a31103b3c7910fa8d29333fb5a.tar.xz
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 <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/diskspace.h')
-rw-r--r--lib/libalpm/diskspace.h7
1 files changed, 7 insertions, 0 deletions
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;