chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename F_TYPE_CMP() to F_TYPE_EQUAL()
[elogind.git]
/
src
/
readahead
/
readahead-collect.c
diff --git
a/src/readahead/readahead-collect.c
b/src/readahead/readahead-collect.c
index 735bd8e3e0b055d49182a3999dbeea75aa427d43..32888add01be1a84cc3b178689ab141426e6e809 100644
(file)
--- a/
src/readahead/readahead-collect.c
+++ b/
src/readahead/readahead-collect.c
@@
-44,6
+44,10
@@
#include <sys/inotify.h>
#include <math.h>
#include <sys/inotify.h>
#include <math.h>
+#ifdef HAVE_LINUX_BTRFS_H
+#include <linux/btrfs.h>
+#endif
+
#ifdef HAVE_FANOTIFY_INIT
#include <sys/fanotify.h>
#endif
#ifdef HAVE_FANOTIFY_INIT
#include <sys/fanotify.h>
#endif
@@
-479,8
+483,9
@@
static int collect(const char *root) {
}
entry->bin = (entrytime - starttime) / 2000000;
}
entry->bin = (entrytime - starttime) / 2000000;
- if ((k = hashmap_put(files, p, entry)) < 0) {
- log_warning("set_put() failed: %s", strerror(-k));
+ k = hashmap_put(files, p, entry);
+ if (k < 0) {
+ log_warning("hashmap_put() failed: %s", strerror(-k));
free(p);
}
}
free(p);
}
}
@@
-505,7
+510,7
@@
done:
on_ssd = fs_on_ssd(root) > 0;
log_debug("On SSD: %s", yes_no(on_ssd));
on_ssd = fs_on_ssd(root) > 0;
log_debug("On SSD: %s", yes_no(on_ssd));
- on_btrfs = statfs(root, &sfs) >= 0 &&
(unsigned long) sfs.f_type == BTRFS_SUPER_MAGIC
;
+ on_btrfs = statfs(root, &sfs) >= 0 &&
F_TYPE_EQUAL(sfs.f_type, BTRFS_SUPER_MAGIC)
;
log_debug("On btrfs: %s", yes_no(on_btrfs));
if (asprintf(&pack_fn_new, "%s/.readahead.new", root) < 0) {
log_debug("On btrfs: %s", yes_no(on_btrfs));
if (asprintf(&pack_fn_new, "%s/.readahead.new", root) < 0) {