From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH v2 14/15] hfsplus: implement replay journal functionality Date: Tue, 4 Feb 2014 14:33:01 -0800 Message-ID: <20140204143301.a2c0cbe9ba5957cc86a2b1a6@linux-foundation.org> References: <1390577336.2287.88.camel@slavad-ubuntu-12.04> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Linux FS devel list , Al Viro , ChristophHellwig , Hin-Tak Leung To: Vyacheslav Dubeyko Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:58057 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933342AbaBDWdD (ORCPT ); Tue, 4 Feb 2014 17:33:03 -0500 In-Reply-To: <1390577336.2287.88.camel@slavad-ubuntu-12.04> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, 24 Jan 2014 19:28:56 +0400 Vyacheslav Dubeyko wrote: > From: Vyacheslav Dubeyko > Subject: [PATCH v2 14/15] hfsplus: implement replay journal functionality > > This patch implements functionality of HFS+ journal replay. > > If the journal contains valid transaction then it needs to write > them to disk. In order to replay the journal, an implementation > just loops over the transactions, copying each individual block > in the transaction from the journal to its proper location on > the volume. Once those blocks have been flushed to the media > (not just the driver!), it may update the journal header to > remove the transactions. > > ... > > +static int hfsplus_replay_journal(struct super_block *sb) > +{ > + struct hfsplus_journal *jnl = HFSPLUS_SB(sb)->jnl; > + struct hfsplus_journal_header *jh = jnl->jh; > + struct hfsplus_blist_desc desc; > + u32 last_seq_num = 0; > + int err; > + > > ... > > + if (hfsplus_journal_empty(jh)) > + err = hfsplus_replay_journal_header(sb); > + else { > + pr_err("journal replay failed\n"); > + err = -EIO; > + } > + > + if (unlikely(err)) > + goto failed_journal_replay; > + > + mutex_unlock(&jnl->jnl_lock); > + hfsplus_deinit_block_list_desc(&desc); > + return 0; umm, remove the above five statements? > +failed_journal_replay: > + mutex_unlock(&jnl->jnl_lock); > + hfsplus_deinit_block_list_desc(&desc); > + return err; > +}