]> git.hungrycats.org Git - linux/commitdiff
[PATCH] clean up alloc_buffer_head()
authorAndrew Morton <akpm@zip.com.au>
Tue, 18 Jun 2002 03:20:09 +0000 (20:20 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Tue, 18 Jun 2002 03:20:09 +0000 (20:20 -0700)
alloc_bufer_head() does not need the additional argument - GFP_NOFS is
always correct.

fs/buffer.c
fs/jbd/journal.c
include/linux/buffer_head.h

index 5d9dee75f2875cbfaaa862ad88ae54e4589ff232..70025ee603a64210a3fd07ef6f1ab4e33e59e211 100644 (file)
@@ -945,12 +945,12 @@ void invalidate_inode_buffers(struct inode *inode)
  * the size of each buffer.. Use the bh->b_this_page linked list to
  * follow the buffers created.  Return NULL if unable to create more
  * buffers.
- * The async flag is used to differentiate async IO (paging, swapping)
- * from ordinary buffer allocations, and only async requests are allowed
- * to sleep waiting for buffer heads. 
+ *
+ * The retry flag is used to differentiate async IO (paging, swapping)
+ * which may not fail from ordinary buffer allocations.
  */
 static struct buffer_head *
-create_buffers(struct page * page, unsigned long size, int async)
+create_buffers(struct page * page, unsigned long size, int retry)
 {
        struct buffer_head *bh, *head;
        long offset;
@@ -959,7 +959,7 @@ try_again:
        head = NULL;
        offset = PAGE_SIZE;
        while ((offset -= size) >= 0) {
-               bh = alloc_buffer_head(async);
+               bh = alloc_buffer_head();
                if (!bh)
                        goto no_grow;
 
@@ -996,7 +996,7 @@ no_grow:
         * become available.  But we don't want tasks sleeping with 
         * partially complete buffers, so all were released above.
         */
-       if (!async)
+       if (!retry)
                return NULL;
 
        /* We're _really_ low on memory. Now we just
@@ -2392,7 +2392,7 @@ asmlinkage long sys_bdflush(int func, long data)
 static kmem_cache_t *bh_cachep;
 static mempool_t *bh_mempool;
 
-struct buffer_head *alloc_buffer_head(int async)
+struct buffer_head *alloc_buffer_head(void)
 {
        return mempool_alloc(bh_mempool, GFP_NOFS);
 }
index 052dd4ef3f01521e2846ae0bd66c39eff8d2f8d0..ade37ad43606d1360b41f1b0c9c402cf3916295b 100644 (file)
@@ -463,7 +463,7 @@ int journal_write_metadata_buffer(transaction_t *transaction,
         * Right, time to make up the new buffer_head.
         */
        do {
-               new_bh = alloc_buffer_head(0);
+               new_bh = alloc_buffer_head();
                if (!new_bh) {
                        printk (KERN_NOTICE "%s: ENOMEM at alloc_buffer_head, "
                                "trying again.\n", __FUNCTION__);
index fda967ab9358a82cf83958f8f632ddd3e7a8076f..5df63727fa7a183c8d11cf5ab0588953744a65ab 100644 (file)
@@ -181,7 +181,7 @@ void __brelse(struct buffer_head *);
 void __bforget(struct buffer_head *);
 struct buffer_head * __bread(struct block_device *, int, int);
 void wakeup_bdflush(void);
-struct buffer_head *alloc_buffer_head(int async);
+struct buffer_head *alloc_buffer_head(void);
 void free_buffer_head(struct buffer_head * bh);
 void FASTCALL(unlock_buffer(struct buffer_head *bh));