diff options
| author | gkostka <kostka.grzegorz@gmail.com> | 2017-01-18 22:35:36 +0100 |
|---|---|---|
| committer | gkostka <kostka.grzegorz@gmail.com> | 2017-01-18 22:42:04 +0100 |
| commit | c1185991fa175c25b4ba47160784e64bc5deb4ce (patch) | |
| tree | 964a17e6fed3540b98c2ca3675b17ad3f57444fb /src | |
| parent | 4c155036f9ce3a74bc3eb3bb79725616d3b6c125 (diff) | |
ext4: add ext4_cache_flush for explicit cache flush
Diffstat (limited to 'src')
| -rw-r--r-- | src/ext4.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -1387,14 +1387,29 @@ int ext4_get_sblock(const char *mount_point, struct ext4_sblock **sb) int ext4_cache_write_back(const char *path, bool on) { struct ext4_mountpoint *mp = ext4_get_mount(path); + int ret; if (!mp) return ENOENT; EXT4_MP_LOCK(mp); - ext4_block_cache_write_back(mp->fs.bdev, on); + ret = ext4_block_cache_write_back(mp->fs.bdev, on); EXT4_MP_UNLOCK(mp); - return EOK; + return ret; +} + +int ext4_cache_flush(const char *path) +{ + struct ext4_mountpoint *mp = ext4_get_mount(path); + int ret; + + if (!mp) + return ENOENT; + + EXT4_MP_LOCK(mp); + ret = ext4_block_cache_flush(mp->fs.bdev); + EXT4_MP_UNLOCK(mp); + return ret; } int ext4_fremove(const char *path) |
