X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=buffer_tree.c;h=45650a241d65efb3858ecbea737002e7725ffb10;hb=a5927501e41fa3fca2975452617474e78ffecc48;hp=2a78959c5ad569bc6c950be20f6b0def1d801772;hpb=49fe9fc6200ec91f7feb811d7aacda44216828ec;p=paraslash.git diff --git a/buffer_tree.c b/buffer_tree.c index 2a78959c..45650a24 100644 --- a/buffer_tree.c +++ b/buffer_tree.c @@ -756,12 +756,15 @@ void btr_splice_out_node(struct btr_node *btrn) assert(list_empty(&btrn->children)); } -/* - * Return the size of the largest input queue. +/** + * Return number of queued output bytes of a buffer tree node. + * + * \param btrn The node whose output queue size should be computed. * - * Iterates over all children of the given node. + * This function iterates over all children of the given node and returns the + * size of the largest input queue. */ -static size_t btr_bytes_pending(struct btr_node *btrn) +size_t btr_get_output_queue_size(struct btr_node *btrn) { size_t max_size = 0; struct btr_node *ch; @@ -1103,7 +1106,7 @@ int btr_node_status(struct btr_node *btrn, size_t min_iqs, if (type != BTR_NT_LEAF) { if (btr_no_children(btrn)) return -E_BTR_NO_CHILD; - if (btr_bytes_pending(btrn) > BTRN_MAX_PENDING) + if (btr_get_output_queue_size(btrn) > BTRN_MAX_PENDING) return 0; } if (type != BTR_NT_ROOT) {