[Cluster-devel] [PATCH 3/6] gfs2: simplify current_tail() via list_last_entry_or_null()

2013-11-15 Thread Jeff Liu
From: Jie Liu Simplify the code in current_tail() via list_last_entry_or_null(). Signed-off-by: Jie Liu --- fs/gfs2/log.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 610613f..555f767 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2

[Cluster-devel] [PATCH 2/6] xfs: simplify xfs_ail_max() via list_last_entry_or_null()

2013-11-15 Thread Jeff Liu
From: Jie Liu Simplify xfs_ail_max() with list_last_entry_or_null(), and move it to xfs_trans_priv.h as an inline function as now it is one line. Signed-off-by: Jie Liu --- fs/xfs/xfs_trans_ail.c | 14 -- fs/xfs/xfs_trans_priv.h | 12 2 files changed, 12 insertions(+)

[Cluster-devel] [PATCH 1/6] list: introduce list_last_entry_or_null()

2013-11-15 Thread Jeff Liu
From: Jie Liu Introduce a trivial helper list_last_entry_or_null() to fetch the last entry from a list, return NULL if the list is empty. Signed-off-by: Jie Liu --- include/linux/list.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/linux/list.h b/include/linux/list.h

[Cluster-devel] [PATCH 0/6] list: introduce list_last_entry_or_null()

2013-11-15 Thread Jeff Liu
Hi Folks, This patch is trying to introduce a new list helper to retrieve the last entry or return NULL if the list is empty corresponding to it, which is inspired by Jiri Pirko's list_first_entry_or_null(). With this trivial helper, we could get a little benefit to simplify the code logic of xfs

[Cluster-devel] [PATCH 6/6] jfs: simplify lmLogSync() via list_last_entry_or_null()

2013-11-15 Thread Jeff Liu
From: Jie Liu Simplify the code in lmLogSync() via list_last_entry_or_null(). Signed-off-by: Jie Liu --- fs/jfs/jfs_logmgr.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 7b565d0..2f90779 100644 --- a/fs/jfs/jfs_l

[Cluster-devel] [PATCH 4/6] ubifs: simplify drop_last_node() via list_last_entry_or_null()

2013-11-15 Thread Jeff Liu
From: Jie Liu Simplify the code in drop_last_node() via list_last_entry_or_null(). Signed-off-by: Jie Liu --- fs/ubifs/recovery.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index 065096e..e46c394 100644 --- a/fs/ubifs/r

Re: [Cluster-devel] [PATCH 6/6] jfs: simplify lmLogSync() via list_last_entry_or_null()

2013-11-15 Thread Jeff Liu
Hi Dave and all, Please ignore this patch from this series. On 11/15 2013 12:35 PM, Jeff Liu wrote: > From: Jie Liu > > Simplify the code in lmLogSync() via list_last_entry_or_null(). > > Signed-off-by: Jie Liu > --- > fs/jfs/jfs_logmgr.c | 10 +++--- > 1 file changed, 3 insertions(+), 7

[Cluster-devel] [PATCH 5/6] jfs: simplify lmNextPage() via list_last_entry_or_null()

2013-11-15 Thread Jeff Liu
From: Jie Liu Simplify the code in lmNextPage via list_last_entry_or_null(). Signed-off-by: Jie Liu --- fs/jfs/jfs_logmgr.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 360d27c..7b565d0 100644 --- a/fs/jfs/jfs_logmgr.c

Re: [Cluster-devel] [PATCH 0/6] list: introduce list_last_entry_or_null()

2013-11-15 Thread Christoph Hellwig
On Fri, Nov 15, 2013 at 12:29:48PM +0800, Jeff Liu wrote: > Hi Folks, > > This patch is trying to introduce a new list helper to retrieve the > last entry or return NULL if the list is empty corresponding to it, > which is inspired by Jiri Pirko's list_first_entry_or_null(). How did we end up wit

Re: [Cluster-devel] [PATCH 0/6] list: introduce list_last_entry_or_null()

2013-11-15 Thread Steven Whitehouse
Hi, On Fri, 2013-11-15 at 06:11 -0800, Christoph Hellwig wrote: > On Fri, Nov 15, 2013 at 12:29:48PM +0800, Jeff Liu wrote: > > Hi Folks, > > > > This patch is trying to introduce a new list helper to retrieve the > > last entry or return NULL if the list is empty corresponding to it, > > which i

Re: [Cluster-devel] [PATCH 0/6] list: introduce list_last_entry_or_null()

2013-11-15 Thread Jeff Liu
On 11/15 2013 22:11, Christoph Hellwig wrote: > On Fri, Nov 15, 2013 at 12:29:48PM +0800, Jeff Liu wrote: >> Hi Folks, >> >> This patch is trying to introduce a new list helper to retrieve the >> last entry or return NULL if the list is empty corresponding to it, >> which is inspired by Jiri Pirko

Re: [Cluster-devel] [PATCH 3/6] gfs2: simplify current_tail() via list_last_entry_or_null()

2013-11-15 Thread Oleg Nesterov
On 11/15, Jeff Liu wrote: > > @@ -441,13 +441,9 @@ static unsigned int current_tail(struct gfs2_sbd *sdp) > > spin_lock(&sdp->sd_ail_lock); > > - if (list_empty(&sdp->sd_ail1_list)) { > - tail = sdp->sd_log_head; > - } else { > - tr = list_entry(sdp->sd_ail

[Cluster-devel] introduce list_get_first/last (Was: [PATCH 3/6] gfs2: simplify current_tail() via list_last_entry_or_null())

2013-11-15 Thread Oleg Nesterov
On 11/15, Oleg Nesterov wrote: > > But probably list_last_entry() makes sense in the "else" branch, > athough this is minor. > > > Off-topic. Not sure this really makes sense, but I was thinking about > > list_get_first(pos, head, member) \ > ((pos) = list_first_entry(head

[Cluster-devel] [cluster.git][PATCH] rng: enforce unfence action to always be "on" convention

2013-11-15 Thread Jan Pokorný
There a silent agreement on this probably "since beginning" already (cf. [1]). Enforce it to move a boundary of what it explicitly wrong a bit futher. Counterpart changeset for fence-agents (relevant branch) will follow. [1] https://bugzilla.redhat.com/show_bug.cgi?id=865161#c17 Signed-off-by:

[Cluster-devel] [fence-agents.git][PATCH] rng: enforce unfence action to always be "on" convention (FA part)

2013-11-15 Thread Jan Pokorný
There is a silent agreement on this probably "since beginning" already (cf. [1]). Enforce it to move a boundary of what is explicitly wrong a bit further. Counterpart change for [2]. [1] https://bugzilla.redhat.com/show_bug.cgi?id=865161#c17 [2] http://www.redhat.com/archives/cluster-devel/2013-