lib: Introduce generic list_sort function

There are two copies of list_sort() in the tree already, one in the DRM
code, another in ubifs.  Now XFS needs this as well.  Create a generic
list_sort() function from the ubifs version and convert existing users
to it so we don't end up with yet another copy in the tree.

Signed-off-by: Dave Chinner <>
Acked-by: Dave Airlie <>
Acked-by: Artem Bityutskiy <>
Signed-off-by: Linus Torvalds <>
5 files changed