A method for allocating data write credits for a storage device includes
gathering requests for the data write credits from a plurality of data
sources and assembling the plurality of data sources in a prioritized
list. The method also includes removing lowest priority data sources one
by one from the prioritized list until a total of the requests made by
all data sources remaining in the prioritized list are within a number of
available data write credits, and granting the requests for all the data
sources remaining in the prioritized list.