summaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
authorAnton Arapov <anton@redhat.com>2012-06-27 09:05:37 +0200
committerAnton Arapov <anton@redhat.com>2012-06-27 09:05:37 +0200
commitd91eda5d7b0383e6a0c83e0146ff141ff3b1355b (patch)
tree07a568258d104e4cb79176348cd42141f41e592c /fs/buffer.c
parent3d6fafb8cd68b287130dbd5b19fbb5e9bfa32a54 (diff)
downloadkernel-uprobes-d91eda5d7b0383e6a0c83e0146ff141ff3b1355b.tar.gz
kernel-uprobes-d91eda5d7b0383e6a0c83e0146ff141ff3b1355b.tar.xz
kernel-uprobes-d91eda5d7b0383e6a0c83e0146ff141ff3b1355b.zip
fedora kernel: 5290429908ff3ac614a416fab4a6e2f99b759e6bv3.4.4-3
Signed-off-by: Anton Arapov <anton@redhat.com>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index ad5938ca357..0bc1bed6c4e 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1036,6 +1036,9 @@ grow_buffers(struct block_device *bdev, sector_t block, int size)
static struct buffer_head *
__getblk_slow(struct block_device *bdev, sector_t block, int size)
{
+ int ret;
+ struct buffer_head *bh;
+
/* Size must be multiple of hard sectorsize */
if (unlikely(size & (bdev_logical_block_size(bdev)-1) ||
(size < 512 || size > PAGE_SIZE))) {
@@ -1048,20 +1051,21 @@ __getblk_slow(struct block_device *bdev, sector_t block, int size)
return NULL;
}
- for (;;) {
- struct buffer_head * bh;
- int ret;
+retry:
+ bh = __find_get_block(bdev, block, size);
+ if (bh)
+ return bh;
+ ret = grow_buffers(bdev, block, size);
+ if (ret == 0) {
+ free_more_memory();
+ goto retry;
+ } else if (ret > 0) {
bh = __find_get_block(bdev, block, size);
if (bh)
return bh;
-
- ret = grow_buffers(bdev, block, size);
- if (ret < 0)
- return NULL;
- if (ret == 0)
- free_more_memory();
}
+ return NULL;
}
/*