]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit - fs/xfs/xfs_trans_priv.h
xfs: Simplify xfs_ail_min() with list_first_entry_or_null()
authorJie Liu <jeff.liu@oracle.com>
Thu, 15 Aug 2013 05:08:35 +0000 (13:08 +0800)
committerBen Myers <bpm@sgi.com>
Fri, 23 Aug 2013 17:57:43 +0000 (12:57 -0500)
commit8d1d40832b1c53ae73931f1b536ce1ab7375b3c8
treebeeae7e87ad17163cb7577827cde3bf9c93fd1ca
parent46677e679fba8c2db7c94a7142ad9abb72192ebc
xfs: Simplify xfs_ail_min() with list_first_entry_or_null()

At xfs_ail_min(), we do check if the AIL list is empty or not before
returning the first item in it with list_empty() and list_first_entry().

This can be simplified a bit with a new list operation routine that is
the list_first_entry_or_null() which has been introduced by:

commit 6d7581e62f8be462440d7b22c6361f7c9fa4902b
    list: introduce list_first_entry_or_null

v2: make xfs_ail_min() as a static inline function and move it to
    xfs_trans_priv.h as per Dave Chinner's comments.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_trans_ail.c
fs/xfs/xfs_trans_priv.h