From: Liu Bo <bo.li.liu@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 6/6] Btrfs: use larger limit for translation of logical to inode
Date: Fri, 31 Aug 2012 13:36:59 +0800 [thread overview]
Message-ID: <1346391419-4278-7-git-send-email-bo.li.liu@oracle.com> (raw)
In-Reply-To: <1346391419-4278-1-git-send-email-bo.li.liu@oracle.com>
This is the change of the kernel side.
Translation of logical to inode used to have an upper limit 4k on
inode container's size, but the limit is not large enough for a data
with a great many of refs, so when resolving logical address,
we can end up with
"ioctl ret=0, bytes_left=0, bytes_missing=19944, cnt=510, missed=2493"
This changes to regard 64k as the upper limit and use vmalloc instead of
kmalloc to get memory more easily.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
fs/btrfs/backref.c | 2 +-
fs/btrfs/ioctl.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 4e80ba3..fb72931 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -1583,7 +1583,7 @@ struct btrfs_data_container *init_data_container(u32 total_bytes)
size_t alloc_bytes;
alloc_bytes = max_t(size_t, total_bytes, sizeof(*data));
- data = kmalloc(alloc_bytes, GFP_NOFS);
+ data = vmalloc(alloc_bytes);
if (!data)
return ERR_PTR(-ENOMEM);
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 7544134..2a303d5 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -3236,7 +3236,7 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_root *root,
goto out;
}
- size = min_t(u32, loi->size, 4096);
+ size = min_t(u32, loi->size, 64 * 1024);
inodes = init_data_container(size);
if (IS_ERR(inodes)) {
ret = PTR_ERR(inodes);
@@ -3258,7 +3258,7 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_root *root,
out:
btrfs_free_path(path);
- kfree(inodes);
+ vfree(inodes);
kfree(loi);
return ret;
--
1.7.7.6
prev parent reply other threads:[~2012-08-31 5:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-31 5:36 [PATCH 0/6] bug-fixes and cleanup Liu Bo
2012-08-31 5:36 ` [PATCH 1/6] Btrfs: fix a bug of per-file nocow Liu Bo
2012-09-06 16:26 ` David Sterba
2012-08-31 5:36 ` [PATCH 2/6] Btrfs: cleanup for unused ref cache stuff Liu Bo
2012-08-31 5:36 ` [PATCH 3/6] Btrfs: update delayed ref's tracepoints to show sequence Liu Bo
2012-08-31 5:36 ` [PATCH 4/6] Btrfs: fix a bug in parsing return value in logical resolve Liu Bo
2012-08-31 5:36 ` [PATCH 5/6] Btrfs: use helper for " Liu Bo
2012-08-31 5:36 ` Liu Bo [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=1346391419-4278-7-git-send-email-bo.li.liu@oracle.com \
--to=bo.li.liu@oracle.com \
--cc=linux-btrfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).