]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: send: lower memory requirements in common case
authorDavid Sterba <dsterba@suse.cz>
Wed, 5 Feb 2014 15:17:34 +0000 (16:17 +0100)
committerJosef Bacik <jbacik@fb.com>
Mon, 10 Mar 2014 19:15:50 +0000 (15:15 -0400)
commit0908b1b2b6531886057cdcfa34f927442f38047b
tree903f5a7da2a76695216aa55840be357c9c7db6a6
parentb447987a63c77feb7d119731f2ef2c2118500f18
btrfs: send: lower memory requirements in common case

The fs_path structure uses an inline buffer and falls back to a chain of
allocations, but vmalloc is not necessary because PATH_MAX fits into
PAGE_SIZE.

The size of fs_path has been reduced to 256 bytes from PAGE_SIZE,
usually 4k. Experimental measurements show that most paths on a single
filesystem do not exceed 200 bytes, and these get stored into the inline
buffer directly, which is now 230 bytes. Longer paths are kmalloced when
needed.

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fb.com>
fs/btrfs/send.c