Re: [PATCH 3/4] xfs: simplify xfs_ail_max

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/24/13 06:48, Jeff Liu wrote:
From: Jie Liu<jeff.liu@xxxxxxxxxx>

We have already simplified xfs_ail_min() with a new list helper, i.e,
list_first_entry_or_null(), but xfs_ail_max() still remains as same
as there is no corresponding list helper we can use for now.  It's
fairly easy to simulate the list behavior of getting the last item
in the AIL, therefore we can simplify xfs_ail_max() and move it to
the header file to make this pair of AIL routines looks symmetrical.

Signed-off-by: Jie Liu<jeff.liu@xxxxxxxxxx>
---

+/*
+ * Return a pointer to the last item in the AIL.  If the AIL is empty, then
+ * return NULL.
+ */
+static inline struct xfs_log_item *
+xfs_ail_max(
+	struct xfs_ail  *ailp)
+{
+	return list_empty(&ailp->xa_ail) ? NULL :
+		list_last_entry(&ailp->xa_ail, struct xfs_log_item, li_ail);
+}
+
+
  static inline void
  xfs_trans_ail_update(
  	struct xfs_ail		*ailp,

Looks good.

Reviewed-by: Mark Tinguely <tinguely@xxxxxxx>

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux