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>
char *buf;
int buf_len;
unsigned int reversed:1;
- unsigned int virtual_mem:1;
char inline_buf[];
};
char pad[PAGE_SIZE];
if (!p)
return NULL;
p->reversed = 0;
- p->virtual_mem = 0;
p->buf = p->inline_buf;
p->buf_len = FS_PATH_INLINE_SIZE;
fs_path_reset(p);
if (!p)
return;
if (p->buf != p->inline_buf) {
- if (p->virtual_mem)
+ if (is_vmalloc_addr(p->buf))
vfree(p->buf);
else
kfree(p->buf);
tmp_buf = vmalloc(len);
if (!tmp_buf)
return -ENOMEM;
- p->virtual_mem = 1;
}
memcpy(tmp_buf, p->buf, p->buf_len);
p->buf = tmp_buf;
p->buf_len = len;
} else {
- if (p->virtual_mem) {
+ if (is_vmalloc_addr(p->buf)) {
tmp_buf = vmalloc(len);
if (!tmp_buf)
return -ENOMEM;
return -ENOMEM;
memcpy(tmp_buf, p->buf, p->buf_len);
kfree(p->buf);
- p->virtual_mem = 1;
}
}
p->buf = tmp_buf;