代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/qemu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From db37bc0d85e141a666dd287cdc562a47f29b4343 Mon Sep 17 00:00:00 2001
From: Jinhua Cao <caojinhua1@huawei.com>
Date: Mon, 18 Mar 2024 10:01:28 +0800
Subject: [PATCH] Revert "file-posix: Remove unused s->discard_zeroes"
This reverts commit a7ca2eb488ff149c898f43abe103f8bd8e3ca3c4.
---
block/file-posix.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/block/file-posix.c b/block/file-posix.c
index b862406c71..01ae5fd88c 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -158,6 +158,7 @@ typedef struct BDRVRawState {
bool has_discard:1;
bool has_write_zeroes:1;
+ bool discard_zeroes:1;
bool use_linux_aio:1;
bool use_linux_io_uring:1;
int page_cache_inconsistent; /* errno from fdatasync failure */
@@ -765,6 +766,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
ret = -EINVAL;
goto fail;
} else {
+ s->discard_zeroes = true;
s->has_fallocate = true;
}
} else {
@@ -790,12 +792,19 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
#endif
if (S_ISBLK(st.st_mode)) {
+#ifdef BLKDISCARDZEROES
+ unsigned int arg;
+ if (ioctl(s->fd, BLKDISCARDZEROES, &arg) == 0 && arg) {
+ s->discard_zeroes = true;
+ }
+#endif
#ifdef __linux__
/* On Linux 3.10, BLKDISCARD leaves stale data in the page cache. Do
* not rely on the contents of discarded blocks unless using O_DIRECT.
* Same for BLKZEROOUT.
*/
if (!(bs->open_flags & BDRV_O_NOCACHE)) {
+ s->discard_zeroes = false;
s->has_write_zeroes = false;
}
#endif
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。