From patchwork Fri Jun 7 12:09:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "jeff.liu" X-Patchwork-Id: 2686621 Return-Path: X-Original-To: patchwork-ocfs2-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by patchwork2.kernel.org (Postfix) with ESMTP id 5FEFBDFB78 for ; Fri, 7 Jun 2013 12:10:12 +0000 (UTC) Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r57C9Xet004362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 7 Jun 2013 12:09:33 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r57C9Vxl020445 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 7 Jun 2013 12:09:31 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1UkvU3-0006zs-7l; Fri, 07 Jun 2013 05:09:31 -0700 Received: from acsinet22.oracle.com ([141.146.126.238]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1UkvTk-0006yk-Nx for ocfs2-devel@oss.oracle.com; Fri, 07 Jun 2013 05:09:12 -0700 Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r57C9BL8019801 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 7 Jun 2013 12:09:12 GMT Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70]) by userz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r57C9B21012175; Fri, 7 Jun 2013 12:09:11 GMT Received: from [192.168.1.101] (/123.119.107.170) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 07 Jun 2013 05:09:11 -0700 Message-ID: <51B1CD65.1070508@oracle.com> Date: Fri, 07 Jun 2013 20:09:09 +0800 From: Jeff Liu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120410 Thunderbird/11.0.1 MIME-Version: 1.0 To: Goldwyn Rodrigues References: <20130607114918.GA3332@shrek.cartoons> In-Reply-To: <20130607114918.GA3332@shrek.cartoons> Cc: Ocfs2-Devel Subject: Re: [Ocfs2-devel] [PATCH] Remove unecessary variable needs_checkpoint X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Source-IP: acsinet22.oracle.com [141.146.126.238] On 06/07/2013 07:49 PM, Goldwyn Rodrigues wrote: > Code cleanup: needs_checkpoint is only assigned but never used to check. > Delete the variable. > > Signed-off-by: Goldwyn Rodrigues > > --- > diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h > index a3385b6..0a99273 100644 > --- a/fs/ocfs2/journal.h > +++ b/fs/ocfs2/journal.h > @@ -200,7 +200,6 @@ void ocfs2_complete_quota_recovery(struct ocfs2_super *osb); > > static inline void ocfs2_start_checkpoint(struct ocfs2_super *osb) > { > - atomic_set(&osb->needs_checkpoint, 1); > wake_up(&osb->checkpoint_event); > } > > diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h > index d355e6e..3a90347 100644 > --- a/fs/ocfs2/ocfs2.h > +++ b/fs/ocfs2/ocfs2.h > @@ -347,7 +347,6 @@ struct ocfs2_super > struct task_struct *recovery_thread_task; > int disable_recovery; > wait_queue_head_t checkpoint_event; > - atomic_t needs_checkpoint; > struct ocfs2_journal *journal; > unsigned long osb_commit_interval; > > diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c > index 01b8516..854d809 100644 > --- a/fs/ocfs2/super.c > +++ b/fs/ocfs2/super.c > @@ -286,10 +286,9 @@ static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len) > spin_unlock(&osb->osb_lock); > > out += snprintf(buf + out, len - out, > - "%10s => Pid: %d Interval: %lu Needs: %d\n", "Commit", > + "%10s => Pid: %d Interval: %lu\n", "Commit", > (osb->commit_task ? task_pid_nr(osb->commit_task) : -1), > - osb->osb_commit_interval, > - atomic_read(&osb->needs_checkpoint)); > + osb->osb_commit_interval); > > out += snprintf(buf + out, len - out, > "%10s => State: %d TxnId: %lu NumTxns: %d\n", > @@ -2154,7 +2153,6 @@ static int ocfs2_initialize_super(struct super_block *sb, > } > > init_waitqueue_head(&osb->checkpoint_event); > - atomic_set(&osb->needs_checkpoint, 0); > > osb->s_atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM; Found another corruption on above line when applying this patch :-P. But never mind, I fixed it for saving your time. This fix looks good to me, thank you. -Jeff From: Goldwyn Rodrigues Code cleanup: needs_checkpoint is only assigned but never used to check. Delete the variable. Signed-off-by: Goldwyn Rodrigues Reviewed-by: Jie Liu Acked-by: Joel Becker --- fs/ocfs2/journal.h | 1 - fs/ocfs2/ocfs2.h | 1 - fs/ocfs2/super.c | 6 ++---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index a3385b6..0a99273 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -200,7 +200,6 @@ void ocfs2_complete_quota_recovery(struct ocfs2_super *osb); static inline void ocfs2_start_checkpoint(struct ocfs2_super *osb) { - atomic_set(&osb->needs_checkpoint, 1); wake_up(&osb->checkpoint_event); } diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index d355e6e..3a90347 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h @@ -347,7 +347,6 @@ struct ocfs2_super struct task_struct *recovery_thread_task; int disable_recovery; wait_queue_head_t checkpoint_event; - atomic_t needs_checkpoint; struct ocfs2_journal *journal; unsigned long osb_commit_interval; diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 01b8516..854d809 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -286,10 +286,9 @@ static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len) spin_unlock(&osb->osb_lock); out += snprintf(buf + out, len - out, - "%10s => Pid: %d Interval: %lu Needs: %d\n", "Commit", + "%10s => Pid: %d Interval: %lu\n", "Commit", (osb->commit_task ? task_pid_nr(osb->commit_task) : -1), - osb->osb_commit_interval, - atomic_read(&osb->needs_checkpoint)); + osb->osb_commit_interval); out += snprintf(buf + out, len - out, "%10s => State: %d TxnId: %lu NumTxns: %d\n", @@ -2154,7 +2153,6 @@ static int ocfs2_initialize_super(struct super_block *sb, } init_waitqueue_head(&osb->checkpoint_event); - atomic_set(&osb->needs_checkpoint, 0); osb->s_atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM;