| 4631 | |
| 4632 | #ifdef NOT_USED_OR_REPLACED |
| 4633 | static inline bool writeable(BufferDesc* bdb) |
| 4634 | { |
| 4635 | /************************************** |
| 4636 | * |
| 4637 | * w r i t e a b l e |
| 4638 | * |
| 4639 | ************************************** |
| 4640 | * |
| 4641 | * Functional description |
| 4642 | * See if a buffer is writeable. A buffer is writeable if |
| 4643 | * neither it nor any of it's higher precedence cousins are |
| 4644 | * marked for write. |
| 4645 | * This is the starting point of recursive walk of precedence |
| 4646 | * graph. The writeable_mark member is used to mark already seen |
| 4647 | * buffers to avoid repeated walk of the same sub-graph. |
| 4648 | * Currently this function can't be called from more than one |
| 4649 | * thread simultaneously. When SMP will be implemented we must |
| 4650 | * take additional care about thread-safety. |
| 4651 | * |
| 4652 | **************************************/ |
| 4653 | if (bdb->bdb_flags & BDB_marked) |
| 4654 | return false; |
| 4655 | |
| 4656 | if (QUE_EMPTY(bdb->bdb_higher)) |
| 4657 | return true; |
| 4658 | |
| 4659 | BufferControl* bcb = bdb->bdb_bcb; |
| 4660 | |
| 4661 | Sync syncPrec(&bcb->bcb_syncPrecedence, "writeable"); |
| 4662 | syncPrec.lock(SYNC_EXCLUSIVE); |
| 4663 | |
| 4664 | const ULONG mark = get_prec_walk_mark(bcb); |
| 4665 | return is_writeable(bdb, mark); |
| 4666 | } |
| 4667 | |
| 4668 | |
| 4669 | static bool is_writeable(BufferDesc* bdb, const ULONG mark) |
nothing calls this directly
no test coverage detected