aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/send.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2014-02-03 13:23:33 -0500
committerJosef Bacik <jbacik@fb.com>2014-03-10 15:15:45 -0400
commite25a8122061edcde6175cbcfd2e21367ad017212 (patch)
tree3304e2bb908b7dcbc235f81c5799e1339c263f3b /fs/btrfs/send.c
parentb23ab57d485c985c10ee7c03627359bfbba590d8 (diff)
btrfs: send: remove virtual_mem member from fs_path
We don't need to keep track of that, it's available via is_vmalloc_addr. Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Josef Bacik <jbacik@fb.com>
Diffstat (limited to 'fs/btrfs/send.c')
-rw-r--r--fs/btrfs/send.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 851ebfd43aa7..5b9b82b32cde 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -55,7 +55,6 @@ struct fs_path {
55 char *buf; 55 char *buf;
56 int buf_len; 56 int buf_len;
57 unsigned int reversed:1; 57 unsigned int reversed:1;
58 unsigned int virtual_mem:1;
59 char inline_buf[]; 58 char inline_buf[];
60 }; 59 };
61 char pad[PAGE_SIZE]; 60 char pad[PAGE_SIZE];
@@ -241,7 +240,6 @@ static struct fs_path *fs_path_alloc(void)
241 if (!p) 240 if (!p)
242 return NULL; 241 return NULL;
243 p->reversed = 0; 242 p->reversed = 0;
244 p->virtual_mem = 0;
245 p->buf = p->inline_buf; 243 p->buf = p->inline_buf;
246 p->buf_len = FS_PATH_INLINE_SIZE; 244 p->buf_len = FS_PATH_INLINE_SIZE;
247 fs_path_reset(p); 245 fs_path_reset(p);
@@ -265,7 +263,7 @@ static void fs_path_free(struct fs_path *p)
265 if (!p) 263 if (!p)
266 return; 264 return;
267 if (p->buf != p->inline_buf) { 265 if (p->buf != p->inline_buf) {
268 if (p->virtual_mem) 266 if (is_vmalloc_addr(p->buf))
269 vfree(p->buf); 267 vfree(p->buf);
270 else 268 else
271 kfree(p->buf); 269 kfree(p->buf);
@@ -299,13 +297,12 @@ static int fs_path_ensure_buf(struct fs_path *p, int len)
299 tmp_buf = vmalloc(len); 297 tmp_buf = vmalloc(len);
300 if (!tmp_buf) 298 if (!tmp_buf)
301 return -ENOMEM; 299 return -ENOMEM;
302 p->virtual_mem = 1;
303 } 300 }
304 memcpy(tmp_buf, p->buf, p->buf_len); 301 memcpy(tmp_buf, p->buf, p->buf_len);
305 p->buf = tmp_buf; 302 p->buf = tmp_buf;
306 p->buf_len = len; 303 p->buf_len = len;
307 } else { 304 } else {
308 if (p->virtual_mem) { 305 if (is_vmalloc_addr(p->buf)) {
309 tmp_buf = vmalloc(len); 306 tmp_buf = vmalloc(len);
310 if (!tmp_buf) 307 if (!tmp_buf)
311 return -ENOMEM; 308 return -ENOMEM;
@@ -319,7 +316,6 @@ static int fs_path_ensure_buf(struct fs_path *p, int len)
319 return -ENOMEM; 316 return -ENOMEM;
320 memcpy(tmp_buf, p->buf, p->buf_len); 317 memcpy(tmp_buf, p->buf, p->buf_len);
321 kfree(p->buf); 318 kfree(p->buf);
322 p->virtual_mem = 1;
323 } 319 }
324 } 320 }
325 p->buf = tmp_buf; 321 p->buf = tmp_buf;