backref.c (69917e431210f8712fe050f47b7561e7dae89521) | backref.c (425d17a290c0c63785ec65db154a95c6337aeefa) |
---|---|
1/* 2 * Copyright (C) 2011 STRATO. All rights reserved. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public 6 * License v2 as published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public 14 * License along with this program; if not, write to the 15 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 * Boston, MA 021110-1307, USA. 17 */ 18 | 1/* 2 * Copyright (C) 2011 STRATO. All rights reserved. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public 6 * License v2 as published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public 14 * License along with this program; if not, write to the 15 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 * Boston, MA 021110-1307, USA. 17 */ 18 |
19#include <linux/vmalloc.h> |
|
19#include "ctree.h" 20#include "disk-io.h" 21#include "backref.h" 22#include "ulist.h" 23#include "transaction.h" 24#include "delayed-ref.h" 25#include "locking.h" 26 --- 1552 unchanged lines hidden (view full) --- 1579} 1580 1581struct btrfs_data_container *init_data_container(u32 total_bytes) 1582{ 1583 struct btrfs_data_container *data; 1584 size_t alloc_bytes; 1585 1586 alloc_bytes = max_t(size_t, total_bytes, sizeof(*data)); | 20#include "ctree.h" 21#include "disk-io.h" 22#include "backref.h" 23#include "ulist.h" 24#include "transaction.h" 25#include "delayed-ref.h" 26#include "locking.h" 27 --- 1552 unchanged lines hidden (view full) --- 1580} 1581 1582struct btrfs_data_container *init_data_container(u32 total_bytes) 1583{ 1584 struct btrfs_data_container *data; 1585 size_t alloc_bytes; 1586 1587 alloc_bytes = max_t(size_t, total_bytes, sizeof(*data)); |
1587 data = kmalloc(alloc_bytes, GFP_NOFS); | 1588 data = vmalloc(alloc_bytes); |
1588 if (!data) 1589 return ERR_PTR(-ENOMEM); 1590 1591 if (total_bytes >= sizeof(*data)) { 1592 data->bytes_left = total_bytes - sizeof(*data); 1593 data->bytes_missing = 0; 1594 } else { 1595 data->bytes_missing = sizeof(*data) - total_bytes; --- 34 unchanged lines hidden (view full) --- 1630 1631 return ifp; 1632} 1633 1634void free_ipath(struct inode_fs_paths *ipath) 1635{ 1636 if (!ipath) 1637 return; | 1589 if (!data) 1590 return ERR_PTR(-ENOMEM); 1591 1592 if (total_bytes >= sizeof(*data)) { 1593 data->bytes_left = total_bytes - sizeof(*data); 1594 data->bytes_missing = 0; 1595 } else { 1596 data->bytes_missing = sizeof(*data) - total_bytes; --- 34 unchanged lines hidden (view full) --- 1631 1632 return ifp; 1633} 1634 1635void free_ipath(struct inode_fs_paths *ipath) 1636{ 1637 if (!ipath) 1638 return; |
1638 kfree(ipath->fspath); | 1639 vfree(ipath->fspath); |
1639 kfree(ipath); 1640} | 1640 kfree(ipath); 1641} |