diff options
author | Thomas Hellstrom <thellstrom-at-vmware-dot-com> | 2009-04-02 11:58:29 +0200 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2009-08-17 17:03:59 +0200 |
commit | 4f17060a759f1bb0b2ee995e4f46512a33c06bd8 (patch) | |
tree | 159e4ea5b86d49d1799d2eeef5efacb7118ab493 /src/wsbm_manager.c | |
parent | 9632d46b25592c9524097a828a2335ea21a286b1 (diff) |
Revert "Use the default buffer placement as a default value for validate set_flags."
This reverts commit 6007cd391b5241bea1b2c037f7c1e45c3e9a3f2e.
Diffstat (limited to 'src/wsbm_manager.c')
-rw-r--r-- | src/wsbm_manager.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/src/wsbm_manager.c b/src/wsbm_manager.c index 3058b07..e40571d 100644 --- a/src/wsbm_manager.c +++ b/src/wsbm_manager.c @@ -444,7 +444,6 @@ wsbmBOSetStatus(struct _WsbmBufferObject *buf, uint32_t setFlags, uint32_t clrFlags) { struct _WsbmBufStorage *storage = buf->storage; - int ret; if (!storage) return 0; @@ -452,12 +451,7 @@ wsbmBOSetStatus(struct _WsbmBufferObject *buf, if (storage->pool->setStatus == NULL) return -EINVAL; - ret = storage->pool->setStatus(storage, setFlags, clrFlags); - if (ret) - return ret; - - buf->placement = (buf->placement | setFlags) & ~(clrFlags); - return 0; + return storage->pool->setStatus(storage, setFlags, clrFlags); } void @@ -924,9 +918,8 @@ wsbmBOFreeList(struct _WsbmBufferList *list) } static int -wsbmAddValidateItem(struct _ValidateList *list, void *buf, - uint32_t def_placement, uint64_t flags, uint64_t mask, - int *itemLoc, +wsbmAddValidateItem(struct _ValidateList *list, void *buf, uint64_t flags, + uint64_t mask, int *itemLoc, struct _ValidateNode **pnode, int *newItem) { struct _ValidateNode *node, *cur; @@ -952,10 +945,7 @@ wsbmAddValidateItem(struct _ValidateList *list, void *buf, } if (!cur) { - uint64_t first_flags = ((uint64_t) def_placement & ~mask) | - (flags & mask & ~WSBM_PL_MASK_MEM_CACHE); - - cur = validateListAddNode(list, buf, hash, first_flags, mask); + cur = validateListAddNode(list, buf, hash, flags, mask); if (!cur) return -ENOMEM; *newItem = 1; @@ -964,8 +954,8 @@ wsbmAddValidateItem(struct _ValidateList *list, void *buf, uint64_t set_flags = flags & mask; uint64_t clr_flags = (~flags) & mask; - if (((cur->clr_flags | clr_flags) & WSBM_PL_MASK_MEM_CACHE) == - WSBM_PL_MASK_MEM_CACHE) { + if (((cur->clr_flags | clr_flags) & WSBM_PL_MASK_MEM) == + WSBM_PL_MASK_MEM) { /* * No available memory type left. Bail. */ @@ -973,15 +963,15 @@ wsbmAddValidateItem(struct _ValidateList *list, void *buf, } if ((cur->set_flags | set_flags) & - (cur->clr_flags | clr_flags) & ~WSBM_PL_MASK_MEM_CACHE) { + (cur->clr_flags | clr_flags) & ~WSBM_PL_MASK_MEM) { /* * Conflicting flags. Bail. */ return -EINVAL; } - cur->set_flags &= ~(clr_flags & WSBM_PL_MASK_MEM_CACHE); - cur->set_flags |= (set_flags & ~WSBM_PL_MASK_MEM_CACHE); + cur->set_flags &= ~(clr_flags & WSBM_PL_MASK_MEM); + cur->set_flags |= (set_flags & ~WSBM_PL_MASK_MEM); cur->clr_flags |= clr_flags; } *itemLoc = cur->listItem; @@ -1005,8 +995,7 @@ wsbmBOAddListItem(struct _WsbmBufferList *list, if (list->hasKernelBuffers) { ret = wsbmAddValidateItem(&list->kernelBuffers, storage->pool->kernel(storage), - buf->placement, flags, mask, itemLoc, - node, &dummy); + flags, mask, itemLoc, node, &dummy); if (ret) goto out_unlock; } else { @@ -1015,8 +1004,7 @@ wsbmBOAddListItem(struct _WsbmBufferList *list, } ret = wsbmAddValidateItem(&list->userBuffers, storage, - buf->placement, flags, mask, &dummy, - &dummyNode, &newItem); + flags, mask, &dummy, &dummyNode, &newItem); if (ret) goto out_unlock; |