Changeset: b41d5cecef0c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b41d5cecef0c
Modified Files:
gdk/gdk.h
gdk/gdk_bat.c
gdk/gdk_bbp.c
gdk/gdk_heap.c
gdk/gdk_storage.c
gdk/gdk_storage.h
Branch: default
Log Message:
Cleanup: remove fields from bat descriptor that aren't ever set anymore.
Since BATmmap is gone (since it wasn't called anymore), the batMap*
fields in the bat descriptor can't be changed anymore, so there is no
point in keeping them around.
diffs (156 lines):
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -847,10 +847,6 @@ typedef struct {
role:8, /* role of the bat */
unused:15; /* value=0 for now */
int sharecnt; /* incoming view count */
- char map_head; /* mmap mode for head bun heap */
- char map_tail; /* mmap mode for tail bun heap */
- char map_hheap; /* mmap mode for head atom heap */
- char map_theap; /* mmap mode for tail atom heap */
/* delta status administration */
BUN deleted; /* start of deleted elements */
@@ -958,10 +954,6 @@ typedef int (*GDKfcn) ();
#define halign H->align
#define talign T->align
-#define batMaphead S->map_head
-#define batMaptail S->map_tail
-#define batMaphheap S->map_hheap
-#define batMaptheap S->map_theap
/*
* @- Heap Management
* Heaps are the low-level entities of mass storage in
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -132,10 +132,6 @@ BATcreatedesc(int tt, int heapnames, int
bn->T->heap.filename = NULL;
bn->H->heap.farmid = BBPselectfarm(role, bn->htype, offheap);
bn->T->heap.farmid = BBPselectfarm(role, bn->ttype, offheap);
- bn->batMaphead = 0;
- bn->batMaptail = 0;
- bn->batMaphheap = 0;
- bn->batMaptheap = 0;
if (heapnames) {
const char *nme = BBP_physical(bn->batCacheid);
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -984,10 +984,6 @@ BBPreadEntries(FILE *fp, int *min_stamp,
bs->S.first = (BUN) first;
bs->S.count = (BUN) count;
bs->S.capacity = (BUN) capacity;
- bs->S.map_head = (char) map_head;
- bs->S.map_tail = (char) map_tail;
- bs->S.map_hheap = (char) map_hheap;
- bs->S.map_theap = (char) map_theap;
nread += heapinit(&bs->H, buf + nread, &Hhashash, "H", oidsize,
bbpversion, bid);
nread += heapinit(&bs->T, buf + nread, &Thashash, "T", oidsize,
bbpversion, bid);
@@ -1402,10 +1398,10 @@ new_bbpentry(FILE *fp, bat i)
BBP_desc(i)->S.first,
BBP_desc(i)->S.count,
BBP_desc(i)->S.capacity,
- (unsigned char) BBP_desc(i)->S.map_head,
- (unsigned char) BBP_desc(i)->S.map_tail,
- (unsigned char) BBP_desc(i)->S.map_hheap,
- (unsigned char) BBP_desc(i)->S.map_theap) < 0 ||
+ (unsigned char) 0,
+ (unsigned char) 0,
+ (unsigned char) 0,
+ (unsigned char) 0) < 0 ||
heap_entry(fp, &BBP_desc(i)->H) < 0 ||
heap_entry(fp, &BBP_desc(i)->T) < 0 ||
vheap_entry(fp, BBP_desc(i)->H.vheap) < 0 ||
diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c
--- a/gdk/gdk_heap.c
+++ b/gdk/gdk_heap.c
@@ -41,8 +41,6 @@
* X.new files take preference over X files when opening them.
* @end table
* Read also the discussion in BATsetaccess (gdk_bat.mx).
- *
- * Todo: check DESCsetmodes/HEAPcheckmode (gdk_storage.mx).
*/
#include "monetdb_config.h"
#include "gdk.h"
diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -607,40 +607,6 @@ DESCload(int i)
return bs;
}
-#define STORE_MODE(m,r,e) (((m) ==
STORE_MEM)?STORE_MEM:((r)&&(e))?STORE_PRIV:STORE_MMAP)
-int
-DESCsetmodes(BAT *b)
-{
- int existing = (BBPstatus(b->batCacheid) & BBPEXISTING);
- int brestrict = (b->batRestricted == BAT_WRITE);
- int ret = 0;
- storage_t m;
-
- if (b->batMaphead) {
- m = STORE_MODE(b->batMaphead, brestrict, existing);
- ret |= m != b->H->heap.newstorage || m != b->H->heap.storage;
- b->H->heap.newstorage = b->H->heap.storage = m;
- }
- if (b->batMaptail) {
- m = STORE_MODE(b->batMaptail, brestrict, existing);
- ret |= b->T->heap.newstorage != m || b->T->heap.storage != m;
- b->T->heap.newstorage = b->T->heap.storage = m;
- }
- if (b->H->vheap && b->batMaphheap) {
- int hrestrict = (b->batRestricted == BAT_APPEND) &&
ATOMappendpriv(b->htype, b->H->vheap);
- m = STORE_MODE(b->batMaphheap, brestrict || hrestrict,
existing);
- ret |= b->H->vheap->newstorage != m || b->H->vheap->storage !=
m;
- b->H->vheap->newstorage = b->H->vheap->storage = m;
- }
- if (b->T->vheap && b->batMaptheap) {
- int trestrict = (b->batRestricted == BAT_APPEND) &&
ATOMappendpriv(b->ttype, b->T->vheap);
- m = STORE_MODE(b->batMaptheap, brestrict || trestrict,
existing);
- ret |= b->T->vheap->newstorage != m || b->T->vheap->storage !=
m;
- b->T->vheap->newstorage = b->T->vheap->storage = m;
- }
- return ret;
-}
-
void
DESCclean(BAT *b)
{
@@ -855,13 +821,11 @@ BATload_intern(bat i, int lock)
str nme = BBP_physical(bid);
BATstore *bs = DESCload(bid);
BAT *b;
- int batmapdirty;
if (bs == NULL) {
return NULL;
}
b = &bs->B;
- batmapdirty = DESCsetmodes(b);
/* LOAD bun heap */
if (b->htype != TYPE_void) {
@@ -940,7 +904,6 @@ BATload_intern(bat i, int lock)
if (!DELTAdirty(b)) {
ALIGNcommit(b);
}
- b->batDirtydesc |= batmapdirty; /* if some heap mode changed, make desc
dirty */
if ((b->batRestricted == BAT_WRITE && (GDKdebug & CHECKMASK)) ||
(GDKdebug & PROPMASK)) {
diff --git a/gdk/gdk_storage.h b/gdk/gdk_storage.h
--- a/gdk/gdk_storage.h
+++ b/gdk/gdk_storage.h
@@ -10,6 +10,5 @@
#define _GDK_STORAGE_H_
extern void DESCclean(BAT *);
-extern int DESCsetmodes(BAT *b);
#endif /* _GDK_STORAGE_H_ */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list