From patchwork Tue Mar 1 13:30:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 84942 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B4A2FB714A for ; Wed, 2 Mar 2011 00:30:28 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752769Ab1CANa1 (ORCPT ); Tue, 1 Mar 2011 08:30:27 -0500 Received: from mail-qy0-f174.google.com ([209.85.216.174]:48606 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752168Ab1CANa0 (ORCPT ); Tue, 1 Mar 2011 08:30:26 -0500 Received: by qyk7 with SMTP id 7so3243516qyk.19 for ; Tue, 01 Mar 2011 05:30:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to:cc :content-type; bh=Jv9nZT2fD5Byq5qao98TQrNc/QvudAN3ljDijGtst1I=; b=hPugKjPIE6gzXoHmX67B9N6wzo0v68fcUfe5OlUpGdzozbUy9QejEDttcGxgPoZVmw i0FS5fBf7EY50ZDhncAjQRKNqsnMmTYVvH2O4V69Y8RFHEGNuRDlZlUmKUx+adPrwS3p 9vX7g8Ao2UDjKQOEOiZ+FElumRQIPpWZd8fU4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=fwVn8MzU6hAMS5bzuC9fhNOdhMgWGHXp7WwoqYApUvTW6O4dvos6/3/doLUA4J+UyP xVJCRyYZeuJWnoOFzVXu2BK+hwQqd+bpz2F0K37nKj7l0xx1ybyCg/EqkGrzWxx9UMZb hTtrBWIw8W2r+tw3cSgt1Ghcqnqzq7/PqEoE0= MIME-Version: 1.0 Received: by 10.229.250.4 with SMTP id mm4mr5713715qcb.266.1298986224786; Tue, 01 Mar 2011 05:30:24 -0800 (PST) Received: by 10.229.96.71 with HTTP; Tue, 1 Mar 2011 05:30:24 -0800 (PST) Date: Tue, 1 Mar 2011 15:30:24 +0200 Message-ID: Subject: [PATCH] ext4: fix callers of ext4_handle_release_buffer() API From: Amir Goldstein To: Theodore Tso Cc: Ext4 Developers List Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org ext4_handle_release_buffer() is an API, which is not being used properly. This is not so bad considering that it calls jbd2_journal_release_buffer(), which does nothing, but the snapshots implementation of this API does something. ext4_jbd2.h defines 2 identical wrapper functions: ext4_journal_release_buffer() and ext4_handle_release_buffer(). The former has no callers, so it was removed. There are 2 users of the API: ext4_new_inode() calls ext4_handle_release_buffer() and ext4_xattr_block_set() calls jbd2_journal_release_buffer() directly. The latter was chagned to call the wrapper API. Signed-off-by: Amir Goldstein --- fs/ext4/ext4_jbd2.h | 7 ------- fs/ext4/xattr.c | 2 +- 2 files changed, 1 insertions(+), 8 deletions(-) diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h index d8b992e..e25e99b 100644 --- a/fs/ext4/ext4_jbd2.h +++ b/fs/ext4/ext4_jbd2.h @@ -202,13 +202,6 @@ static inline int ext4_handle_has_enough_credits(handle_t *handle, int needed) return 1; } -static inline void ext4_journal_release_buffer(handle_t *handle, - struct buffer_head *bh) -{ - if (ext4_handle_valid(handle)) - jbd2_journal_release_buffer(handle, bh); -} - static inline handle_t *ext4_journal_start(struct inode *inode, int nblocks) { return ext4_journal_start_sb(inode->i_sb, nblocks); diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index f4c03af..b545ca1 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -735,7 +735,7 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode, int offset = (char *)s->here - bs->bh->b_data; unlock_buffer(bs->bh); - jbd2_journal_release_buffer(handle, bs->bh); + ext4_handle_release_buffer(handle, bs->bh); if (ce) { mb_cache_entry_release(ce); ce = NULL;