diff options
author | Chao Yu <yuchao0@huawei.com> | 2017-04-26 17:39:54 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-05-02 21:19:50 -0700 |
commit | ec9895add2c519681c45a8599262d1d9b4986349 (patch) | |
tree | c0232c648bb3342b8793797c4c0b3652164f09e6 /fs/f2fs/f2fs.h | |
parent | 4d9780781304af0a57b6e369ce353f7bd2fb5e52 (diff) | |
download | lwn-ec9895add2c519681c45a8599262d1d9b4986349.tar.gz lwn-ec9895add2c519681c45a8599262d1d9b4986349.zip |
f2fs: don't hold cmd_lock during waiting discard command
Previously, with protection of cmd_lock, we will wait for end io of
discard command which potentially may lead long latency, making worse
concurrency.
So, in this patch, we try to add reference into discard entry to prevent
the entry being released by other thread, then we can avoid holding
global cmd_lock during waiting discard to finish.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 9228a36ded41..5759671fc948 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -219,6 +219,7 @@ struct discard_cmd { struct list_head list; /* command list */ struct completion wait; /* compleation */ struct block_device *bdev; /* bdev */ + unsigned short ref; /* reference count */ int state; /* state */ int error; /* bio error */ }; |