summary refs log tree commit diff
path: root/block/badblocks.c
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@infradead.org>2018-03-20 17:07:11 -0400
committerMatthew Wilcox <willy@infradead.org>2018-08-21 23:54:13 -0400
commit5ade60dda43c8906d4554374226c2eb11cc2ffba (patch)
treead246f964d28e84a4c18c0cae666bb434b30b873 /block/badblocks.c
parent50d97d50715a8664f6bddc18211279cd74b8c3bf (diff)
downloadlinux-5ade60dda43c8906d4554374226c2eb11cc2ffba.tar.gz
ida: Add new API
Add ida_alloc(), ida_alloc_min(), ida_alloc_max(), ida_alloc_range()
and ida_free().  The ida_alloc_max() and ida_alloc_range() functions
differ from ida_simple_get() in that they take an inclusive 'max'
parameter instead of an exclusive 'end' parameter.  Callers are about
evenly split whether they'd like inclusive or exclusive parameters and
'max' is easier to document than 'end'.

Change the IDA allocation to first attempt to allocate a bit using
existing memory, and only allocate memory afterwards.  Also change the
behaviour of 'min' > INT_MAX from being a BUG() to returning -ENOSPC.

Leave compatibility wrappers in place for ida_simple_get() and
ida_simple_remove() to avoid changing all callers.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
Diffstat (limited to 'block/badblocks.c')
0 files changed, 0 insertions, 0 deletions