From: Andrew Morton <akpm@zip.com.au>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [patch 16/19] clean up alloc_buffer_head()
Date: Sun, 16 Jun 2002 23:53:28 -0700 [thread overview]
Message-ID: <3D0D8768.90C71B84@zip.com.au> (raw)
alloc_bufer_head() does not need the additional argument - GFP_NOFS is
always correct.
--- 2.5.22/fs/buffer.c~cleanup-alloc_buffer_head Sun Jun 16 23:12:52 2002
+++ 2.5.22-akpm/fs/buffer.c Sun Jun 16 23:22:44 2002
@@ -947,12 +947,12 @@ void invalidate_inode_buffers(struct ino
* 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;
@@ -961,7 +961,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;
@@ -998,7 +998,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
@@ -2396,7 +2396,7 @@ asmlinkage long sys_bdflush(int func, lo
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);
}
--- 2.5.22/fs/jbd/journal.c~cleanup-alloc_buffer_head Sun Jun 16 23:12:52 2002
+++ 2.5.22-akpm/fs/jbd/journal.c Sun Jun 16 23:12:52 2002
@@ -463,7 +463,7 @@ int journal_write_metadata_buffer(transa
* 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__);
--- 2.5.22/include/linux/buffer_head.h~cleanup-alloc_buffer_head Sun Jun 16 23:12:52 2002
+++ 2.5.22-akpm/include/linux/buffer_head.h Sun Jun 16 23:22:44 2002
@@ -164,7 +164,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));
-
reply other threads:[~2002-06-17 6:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=3D0D8768.90C71B84@zip.com.au \
--to=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox