summaryrefslogtreecommitdiff
path: root/volumes.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@fusionio.com>2013-02-01 10:44:22 -0500
committerChris Mason <chris.mason@fusionio.com>2013-02-01 10:51:10 -0500
commit8fe354744cd7b5c4f7a3314dcdbb5095192a032f (patch)
treecb575c48dd3b332b5ec8e36688c60cb23d3e05c7 /volumes.c
parent6cd836d7d95ae61edfca2406f48eeca47b8cfd81 (diff)
Clear caches when opening and closing devices
This should fix problems with cache aliases in the kernel
Diffstat (limited to 'volumes.c')
-rw-r--r--volumes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/volumes.c b/volumes.c
index 581c298f..f3371b22 100644
--- a/volumes.c
+++ b/volumes.c
@@ -176,6 +176,8 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, int flags)
goto fail;
}
+ posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
+
if (device->devid == fs_devices->latest_devid)
fs_devices->latest_bdev = fd;
if (device->devid == fs_devices->lowest_devid)