Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F132459623
D18299.id51026.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D18299.id51026.diff
View Options
Index: head/stand/common/bcache.c
===================================================================
--- head/stand/common/bcache.c
+++ head/stand/common/bcache.c
@@ -86,7 +86,6 @@
((bc)->bcache_ctl[BHASH((bc), (blkno))].bc_blkno != (blkno))
#define BCACHE_READAHEAD 256
#define BCACHE_MINREADAHEAD 32
-#define BCACHE_MARKER 0xdeadbeef
static void bcache_invalidate(struct bcache *bc, daddr_t blkno);
static void bcache_insert(struct bcache *bc, daddr_t blkno);
@@ -123,7 +122,6 @@
u_int i;
struct bcache *bc = malloc(sizeof (struct bcache));
int disks = bcache_numdev;
- uint32_t *marker;
if (disks == 0)
disks = 1; /* safe guard */
@@ -142,8 +140,7 @@
bc->bcache_nblks = bcache_total_nblks >> i;
bcache_unit_nblks = bc->bcache_nblks;
- bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize +
- sizeof(uint32_t));
+ bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize);
if (bc->bcache_data == NULL) {
/* dont error out yet. fall back to 32 blocks and try again */
bc->bcache_nblks = 32;
@@ -158,9 +155,6 @@
errno = ENOMEM;
return (NULL);
}
- /* Insert cache end marker. */
- marker = (uint32_t *)(bc->bcache_data + bc->bcache_nblks * bcache_blksize);
- *marker = BCACHE_MARKER;
/* Flush the cache */
for (i = 0; i < bc->bcache_nblks; i++) {
@@ -222,15 +216,12 @@
int result;
daddr_t p_blk;
caddr_t p_buf;
- uint32_t *marker;
if (bc == NULL) {
errno = ENODEV;
return (-1);
}
- marker = (uint32_t *)(bc->bcache_data + bc->bcache_nblks * bcache_blksize);
-
if (rsize != NULL)
*rsize = 0;
@@ -348,12 +339,6 @@
if (size != 0) {
bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)), buf, size);
result = 0;
- }
-
- if (*marker != BCACHE_MARKER) {
- printf("BUG: bcache corruption detected: nblks: %zu p_blk: %lu, "
- "p_size: %zu, ra: %zu\n", bc->bcache_nblks,
- (long unsigned)BHASH(bc, p_blk), p_size, ra);
}
done:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 18, 2:59 AM (1 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23827980
Default Alt Text
D18299.id51026.diff (1 KB)
Attached To
Mode
D18299: Get rid of superfluous "bug marker" code in the bcache
Attached
Detach File
Event Timeline
Log In to Comment