Revert "Zero blocks before BLKDISCARD"

This reverts commit 604c583c9d.

Change-Id: I2b0b283dc3f44bae55c5e9f7231d7c712630c2b5
This commit is contained in:
Sami Tolvanen
2015-06-10 15:52:04 +00:00
parent 604c583c9d
commit 6abd52f62b
+9 -5
View File
@@ -39,6 +39,11 @@
#define BLOCKSIZE 4096 #define BLOCKSIZE 4096
// Set this to 0 to interpret 'erase' transfers to mean do a
// BLKDISCARD ioctl (the normal behavior). Set to 1 to interpret
// erase to mean fill the region with zeroes.
#define DEBUG_ERASE 0
#ifndef BLKDISCARD #ifndef BLKDISCARD
#define BLKDISCARD _IO(0x12,119) #define BLKDISCARD _IO(0x12,119)
#endif #endif
@@ -1217,7 +1222,8 @@ static int PerformCommandZero(CommandParameters* params) {
} }
if (params->cmdname[0] == 'z') { if (params->cmdname[0] == 'z') {
// Update only for the zero command, as the erase command will call this // Update only for the zero command, as the erase command will call
// this if DEBUG_ERASE is defined.
params->written += tgt->size; params->written += tgt->size;
} }
@@ -1403,10 +1409,8 @@ static int PerformCommandErase(CommandParameters* params) {
struct stat st; struct stat st;
uint64_t blocks[2]; uint64_t blocks[2];
// Always zero the blocks first to work around possibly flaky BLKDISCARD if (DEBUG_ERASE) {
// Bug: 20881595 return PerformCommandZero(params);
if (PerformCommandZero(params) != 0) {
goto pceout;
} }
if (!params) { if (!params) {