All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Cc: Alex Tomas <alex.tomas@sun.com>
Subject: [PATCH] use atomic functions to set bh_state
Date: Mon, 09 Jun 2008 15:59:39 -0500	[thread overview]
Message-ID: <484D99BB.8070907@redhat.com> (raw)
In-Reply-To: <484D95CF.9020801@redhat.com>

use the BUFFER_FNS functions (set_buffer_foo) to set buffer
head state atomically, not the nonatomic __set_bit.

Alex, please speak up if you had a good reason for __set_bit() :)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---


Index: linux-2.6/fs/ext4/extents.c
===================================================================
--- linux-2.6.orig/fs/ext4/extents.c	2008-06-05 13:44:20.000000000 -0500
+++ linux-2.6/fs/ext4/extents.c	2008-06-09 15:53:11.060045685 -0500
@@ -2616,8 +2616,7 @@ int ext4_ext_get_blocks(handle_t *handle
 				 */
 				if (allocated > max_blocks)
 					allocated = max_blocks;
-				/* mark the buffer unwritten */
-				__set_bit(BH_Unwritten, &bh_result->b_state);
+				set_buffer_unwritten(bh);
 				goto out2;
 			}
 
@@ -2723,7 +2722,7 @@ int ext4_ext_get_blocks(handle_t *handle
 	newblock = ext_pblock(&newex);
 	allocated = ext4_ext_get_actual_len(&newex);
 outnew:
-	__set_bit(BH_New, &bh_result->b_state);
+	set_buffer_new(bh_result);
 
 	/* Cache only when it is _not_ an uninitialized extent */
 	if (create != EXT4_CREATE_UNINITIALIZED_EXT)
@@ -2733,7 +2732,7 @@ out:
 	if (allocated > max_blocks)
 		allocated = max_blocks;
 	ext4_ext_show_leaf(inode, path);
-	__set_bit(BH_Mapped, &bh_result->b_state);
+	set_buffer_mapped(bh_result);
 	bh_result->b_bdev = inode->i_sb->s_bdev;
 	bh_result->b_blocknr = newblock;
 out2:


      reply	other threads:[~2008-06-09 20:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-09 20:42 __set_bit for BH flags in ext4_ext_get_blocks? Eric Sandeen
2008-06-09 20:59 ` Eric Sandeen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=484D99BB.8070907@redhat.com \
    --to=sandeen@redhat.com \
    --cc=alex.tomas@sun.com \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.