diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-10-24 13:31:34 +0900 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-10-25 16:54:37 +0900 |
commit | 81eb8d6e2869b119d4a7b8c02091c3779733a3ac (patch) | |
tree | cdff776596fa79bfc9c2f2baf7aa59470dc29aec /fs/f2fs/f2fs.h | |
parent | aabe51364f44681cbd83fb1c27ef7d3dbe567c45 (diff) | |
download | linux-81eb8d6e2869b119d4a7b8c02091c3779733a3ac.tar.bz2 |
f2fs: reclaim prefree segments periodically
Previously, f2fs postpones reclaiming prefree segments into free segments
as much as possible.
However, if user writes and deletes a bunch of data without any sync or fsync
calls, some flash storages can suffer from garbage collections.
So, this patch adds the reclaiming codes to f2fs_write_node_pages and background
GC thread.
If there are a lot of prefree segments, let's do checkpoint so that f2fs
submits discard commands for the prefree regions to the flash storage.
Signed-off-by: Changman Lee <cm224.lee@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index e8f3fd345ca3..6dff777cd94a 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -299,6 +299,9 @@ struct f2fs_sm_info { unsigned int main_segments; /* # of segments in main area */ unsigned int reserved_segments; /* # of reserved segments */ unsigned int ovp_segments; /* # of overprovision segments */ + + /* a threshold to reclaim prefree segments */ + unsigned int rec_prefree_segments; }; /* |