Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 151303 Details for
Bug 234627
Speed up gfs2_fsck
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
First go at a fix
gfs2lib.patch (text/plain), 5.31 KB, created by
Robert Peterson
on 2007-03-30 18:13:52 UTC
(
hide
)
Description:
First go at a fix
Filename:
MIME Type:
Creator:
Robert Peterson
Created:
2007-03-30 18:13:52 UTC
Size:
5.31 KB
patch
obsolete
>Index: Makefile >=================================================================== >RCS file: /cvs/cluster/cluster/gfs2/libgfs2/Makefile,v >retrieving revision 1.4 >diff -w -u -p -p -u -r1.4 Makefile >--- Makefile 11 Aug 2006 15:18:13 -0000 1.4 >+++ Makefile 30 Mar 2007 18:11:46 -0000 >@@ -22,8 +22,7 @@ INCLUDEPATH=-I${top_srcdir}/include -I${ > INSTALL=install > CC=gcc -c > LD=gcc >-## Bob: add -O2 back in and take -ggdb out >-CFLAGS=-Wall -ggdb -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \ >+CFLAGS=-Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \ > -D_GNU_SOURCE -DGFS2_RELEASE_NAME=\"2\" ${INCLUDEPATH} > > H=gfs2_disk_hash.h libgfs2.h linux_endian.h ondisk.h osi_list.h >Index: bitmap.c >=================================================================== >RCS file: /cvs/cluster/cluster/gfs2/libgfs2/bitmap.c,v >retrieving revision 1.2 >diff -w -u -p -p -u -r1.2 bitmap.c >--- bitmap.c 20 Sep 2006 15:23:34 -0000 1.2 >+++ bitmap.c 30 Mar 2007 18:11:46 -0000 >@@ -21,12 +21,40 @@ > #include "libgfs2.h" > > #define BITMAP_SIZE(size, cpb) (size / cpb) >+#define BITMAP_SIZE1(size) (size >> 3) >+#define BITMAP_SIZE4(size) (size >> 1) > > #define BITMAP_BYTE_OFFSET(x, map) ((x % map->chunks_per_byte) \ > * map->chunksize ) >+/* BITMAP_BYTE_OFFSET1 is for chunksize==1, which implies chunks_per_byte==8 */ >+/* Reducing the math, we get: */ >+/* #define BITMAP_BYTE_OFFSET1(x) ((x % 8) * 1) */ >+/* #define BITMAP_BYTE_OFFSET1(x) (x % 8) */ >+/* #define BITMAP_BYTE_OFFSET1(x) (x & 0x0000000000000007) */ >+#define BITMAP_BYTE_OFFSET1(x) (x & 0x0000000000000007) >+ >+/* BITMAP_BYTE_OFFSET4 is for chunksize==4, which implies chunks_per_byte==2 */ >+/* Reducing the math, we get: */ >+/* #define BITMAP_BYTE_OFFSET4(x) ((x % 2) * 4) */ >+/* #define BITMAP_BYTE_OFFSET4(x) ((x & 0x0000000000000001) * 4) */ >+/* #define BITMAP_BYTE_OFFSET4(x) ((x & 0x0000000000000001) << 2) */ >+#define BITMAP_BYTE_OFFSET4(x) ((x & 0x0000000000000001) << 2) > > #define BITMAP_MASK(chunksize) ((2 << (chunksize - 1)) - 1) > >+/* BITMAP_MASK1 is for chunksize==1 */ >+/* Reducing the math, we get: */ >+/* #define BITMAP_MASK1(chunksize) ((2 << (1 - 1)) - 1) */ >+/* #define BITMAP_MASK1(chunksize) ((2 << 0) - 1) */ >+/* #define BITMAP_MASK1(chunksize) ((2) - 1) */ >+#define BITMAP_MASK1(chunksize) (1) >+ >+/* BITMAP_MASK4 is for chunksize==4 */ >+/* #define BITMAP_MASK(chunksize) ((2 << (4 - 1)) - 1) */ >+/* #define BITMAP_MASK(chunksize) ((2 << 3) - 1) */ >+/* #define BITMAP_MASK(chunksize) (0x10 - 1) */ >+#define BITMAP_MASK4(chunksize) (0xf) >+ > uint64_t gfs2_bitmap_size(struct gfs2_bmap *bmap) { > return bmap->size; > } >@@ -59,14 +87,19 @@ int gfs2_bitmap_create(struct gfs2_bmap > > int gfs2_bitmap_set(struct gfs2_bmap *bmap, uint64_t offset, uint8_t val) > { >- char *byte = NULL; >- uint64_t b = offset; >+ static char *byte; >+ static uint64_t b; > > if(offset < bmap->size) { >- byte = bmap->map + BITMAP_SIZE(offset, bmap->chunks_per_byte); >- b = BITMAP_BYTE_OFFSET(offset, bmap); >- >- *byte |= (val & BITMAP_MASK(bmap->chunksize)) << b; >+ if (bmap->chunksize == 1) { >+ byte = bmap->map + BITMAP_SIZE1(offset); >+ b = BITMAP_BYTE_OFFSET1(offset); >+ *byte |= (val & BITMAP_MASK1(bmap->chunksize)); >+ } else { >+ byte = bmap->map + BITMAP_SIZE4(offset); >+ b = BITMAP_BYTE_OFFSET4(offset); >+ *byte |= (val & BITMAP_MASK4(bmap->chunksize)) << b; >+ } > return 0; > } > return -1; >@@ -74,14 +107,19 @@ int gfs2_bitmap_set(struct gfs2_bmap *bm > > int gfs2_bitmap_get(struct gfs2_bmap *bmap, uint64_t bit, uint8_t *val) > { >- char *byte = NULL; >- uint64_t b = bit; >+ static char *byte; >+ static uint64_t b; > > if(bit < bmap->size) { >- byte = bmap->map + BITMAP_SIZE(bit, bmap->chunks_per_byte); >- b = BITMAP_BYTE_OFFSET(bit, bmap); >- >- *val = (*byte & (BITMAP_MASK(bmap->chunksize) << b )) >> b; >+ if (bmap->chunksize == 1) { >+ byte = bmap->map + BITMAP_SIZE1(bit); >+ b = BITMAP_BYTE_OFFSET1(bit); >+ *val = (*byte & (BITMAP_MASK1(bmap->chunksize) << b )) >> b; >+ } else { >+ byte = bmap->map + BITMAP_SIZE4(bit); >+ b = BITMAP_BYTE_OFFSET4(bit); >+ *val = (*byte & (BITMAP_MASK4(bmap->chunksize) << b )) >> b; >+ } > return 0; > } > return -1; >@@ -89,14 +127,19 @@ int gfs2_bitmap_get(struct gfs2_bmap *bm > > int gfs2_bitmap_clear(struct gfs2_bmap *bmap, uint64_t offset) > { >- char *byte = NULL; >- uint64_t b = offset; >+ static char *byte; >+ static uint64_t b; > > if(offset < bmap->size) { >- byte = bmap->map + BITMAP_SIZE(offset, bmap->chunks_per_byte); >- b = BITMAP_BYTE_OFFSET(offset, bmap); >- >- *byte &= ~(BITMAP_MASK(bmap->chunksize) << b); >+ if (bmap->chunksize == 1) { >+ byte = bmap->map + BITMAP_SIZE1(offset); >+ b = BITMAP_BYTE_OFFSET1(offset); >+ *byte &= ~(BITMAP_MASK1(bmap->chunksize) << b); >+ } else { >+ byte = bmap->map + BITMAP_SIZE4(offset); >+ b = BITMAP_BYTE_OFFSET4(offset); >+ *byte &= ~(BITMAP_MASK4(bmap->chunksize) << b); >+ } > return 0; > } > return -1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 234627
: 151303 |
151304