aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h102
1 files changed, 6 insertions, 96 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 529c157000b1..e7d40791ec9f 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -746,12 +746,12 @@ struct btrfs_space_info {
746 */ 746 */
747 unsigned long reservation_progress; 747 unsigned long reservation_progress;
748 748
749 int full:1; /* indicates that we cannot allocate any more 749 unsigned int full:1; /* indicates that we cannot allocate any more
750 chunks for this space */ 750 chunks for this space */
751 int chunk_alloc:1; /* set if we are allocating a chunk */ 751 unsigned int chunk_alloc:1; /* set if we are allocating a chunk */
752 752
753 int force_alloc; /* set if we need to force a chunk alloc for 753 unsigned int force_alloc; /* set if we need to force a chunk
754 this space */ 754 alloc for this space */
755 755
756 struct list_head list; 756 struct list_head list;
757 757
@@ -1463,26 +1463,12 @@ static inline u64 btrfs_stripe_offset_nr(struct extent_buffer *eb,
1463 return btrfs_stripe_offset(eb, btrfs_stripe_nr(c, nr)); 1463 return btrfs_stripe_offset(eb, btrfs_stripe_nr(c, nr));
1464} 1464}
1465 1465
1466static inline void btrfs_set_stripe_offset_nr(struct extent_buffer *eb,
1467 struct btrfs_chunk *c, int nr,
1468 u64 val)
1469{
1470 btrfs_set_stripe_offset(eb, btrfs_stripe_nr(c, nr), val);
1471}
1472
1473static inline u64 btrfs_stripe_devid_nr(struct extent_buffer *eb, 1466static inline u64 btrfs_stripe_devid_nr(struct extent_buffer *eb,
1474 struct btrfs_chunk *c, int nr) 1467 struct btrfs_chunk *c, int nr)
1475{ 1468{
1476 return btrfs_stripe_devid(eb, btrfs_stripe_nr(c, nr)); 1469 return btrfs_stripe_devid(eb, btrfs_stripe_nr(c, nr));
1477} 1470}
1478 1471
1479static inline void btrfs_set_stripe_devid_nr(struct extent_buffer *eb,
1480 struct btrfs_chunk *c, int nr,
1481 u64 val)
1482{
1483 btrfs_set_stripe_devid(eb, btrfs_stripe_nr(c, nr), val);
1484}
1485
1486/* struct btrfs_block_group_item */ 1472/* struct btrfs_block_group_item */
1487BTRFS_SETGET_STACK_FUNCS(block_group_used, struct btrfs_block_group_item, 1473BTRFS_SETGET_STACK_FUNCS(block_group_used, struct btrfs_block_group_item,
1488 used, 64); 1474 used, 64);
@@ -1540,14 +1526,6 @@ btrfs_inode_ctime(struct btrfs_inode_item *inode_item)
1540 return (struct btrfs_timespec *)ptr; 1526 return (struct btrfs_timespec *)ptr;
1541} 1527}
1542 1528
1543static inline struct btrfs_timespec *
1544btrfs_inode_otime(struct btrfs_inode_item *inode_item)
1545{
1546 unsigned long ptr = (unsigned long)inode_item;
1547 ptr += offsetof(struct btrfs_inode_item, otime);
1548 return (struct btrfs_timespec *)ptr;
1549}
1550
1551BTRFS_SETGET_FUNCS(timespec_sec, struct btrfs_timespec, sec, 64); 1529BTRFS_SETGET_FUNCS(timespec_sec, struct btrfs_timespec, sec, 64);
1552BTRFS_SETGET_FUNCS(timespec_nsec, struct btrfs_timespec, nsec, 32); 1530BTRFS_SETGET_FUNCS(timespec_nsec, struct btrfs_timespec, nsec, 32);
1553 1531
@@ -1898,33 +1876,6 @@ static inline u8 *btrfs_header_chunk_tree_uuid(struct extent_buffer *eb)
1898 return (u8 *)ptr; 1876 return (u8 *)ptr;
1899} 1877}
1900 1878
1901static inline u8 *btrfs_super_fsid(struct extent_buffer *eb)
1902{
1903 unsigned long ptr = offsetof(struct btrfs_super_block, fsid);
1904 return (u8 *)ptr;
1905}
1906
1907static inline u8 *btrfs_header_csum(struct extent_buffer *eb)
1908{
1909 unsigned long ptr = offsetof(struct btrfs_header, csum);
1910 return (u8 *)ptr;
1911}
1912
1913static inline struct btrfs_node *btrfs_buffer_node(struct extent_buffer *eb)
1914{
1915 return NULL;
1916}
1917
1918static inline struct btrfs_leaf *btrfs_buffer_leaf(struct extent_buffer *eb)
1919{
1920 return NULL;
1921}
1922
1923static inline struct btrfs_header *btrfs_buffer_header(struct extent_buffer *eb)
1924{
1925 return NULL;
1926}
1927
1928static inline int btrfs_is_leaf(struct extent_buffer *eb) 1879static inline int btrfs_is_leaf(struct extent_buffer *eb)
1929{ 1880{
1930 return btrfs_header_level(eb) == 0; 1881 return btrfs_header_level(eb) == 0;
@@ -2078,22 +2029,6 @@ static inline struct btrfs_root *btrfs_sb(struct super_block *sb)
2078 return sb->s_fs_info; 2029 return sb->s_fs_info;
2079} 2030}
2080 2031
2081static inline int btrfs_set_root_name(struct btrfs_root *root,
2082 const char *name, int len)
2083{
2084 /* if we already have a name just free it */
2085 kfree(root->name);
2086
2087 root->name = kmalloc(len+1, GFP_KERNEL);
2088 if (!root->name)
2089 return -ENOMEM;
2090
2091 memcpy(root->name, name, len);
2092 root->name[len] = '\0';
2093
2094 return 0;
2095}
2096
2097static inline u32 btrfs_level_size(struct btrfs_root *root, int level) 2032static inline u32 btrfs_level_size(struct btrfs_root *root, int level)
2098{ 2033{
2099 if (level == 0) 2034 if (level == 0)
@@ -2138,12 +2073,9 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
2138 u64 num_bytes, u64 *refs, u64 *flags); 2073 u64 num_bytes, u64 *refs, u64 *flags);
2139int btrfs_pin_extent(struct btrfs_root *root, 2074int btrfs_pin_extent(struct btrfs_root *root,
2140 u64 bytenr, u64 num, int reserved); 2075 u64 bytenr, u64 num, int reserved);
2141int btrfs_drop_leaf_ref(struct btrfs_trans_handle *trans,
2142 struct btrfs_root *root, struct extent_buffer *leaf);
2143int btrfs_cross_ref_exist(struct btrfs_trans_handle *trans, 2076int btrfs_cross_ref_exist(struct btrfs_trans_handle *trans,
2144 struct btrfs_root *root, 2077 struct btrfs_root *root,
2145 u64 objectid, u64 offset, u64 bytenr); 2078 u64 objectid, u64 offset, u64 bytenr);
2146int btrfs_copy_pinned(struct btrfs_root *root, struct extent_io_tree *copy);
2147struct btrfs_block_group_cache *btrfs_lookup_block_group( 2079struct btrfs_block_group_cache *btrfs_lookup_block_group(
2148 struct btrfs_fs_info *info, 2080 struct btrfs_fs_info *info,
2149 u64 bytenr); 2081 u64 bytenr);
@@ -2320,7 +2252,7 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans,
2320 struct btrfs_root *root, struct extent_buffer *parent, 2252 struct btrfs_root *root, struct extent_buffer *parent,
2321 int start_slot, int cache_only, u64 *last_ret, 2253 int start_slot, int cache_only, u64 *last_ret,
2322 struct btrfs_key *progress); 2254 struct btrfs_key *progress);
2323void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p); 2255void btrfs_release_path(struct btrfs_path *p);
2324struct btrfs_path *btrfs_alloc_path(void); 2256struct btrfs_path *btrfs_alloc_path(void);
2325void btrfs_free_path(struct btrfs_path *p); 2257void btrfs_free_path(struct btrfs_path *p);
2326void btrfs_set_path_blocking(struct btrfs_path *p); 2258void btrfs_set_path_blocking(struct btrfs_path *p);
@@ -2343,11 +2275,6 @@ int setup_items_for_insert(struct btrfs_trans_handle *trans,
2343 u32 total_data, u32 total_size, int nr); 2275 u32 total_data, u32 total_size, int nr);
2344int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root 2276int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root
2345 *root, struct btrfs_key *key, void *data, u32 data_size); 2277 *root, struct btrfs_key *key, void *data, u32 data_size);
2346int btrfs_insert_some_items(struct btrfs_trans_handle *trans,
2347 struct btrfs_root *root,
2348 struct btrfs_path *path,
2349 struct btrfs_key *cpu_key, u32 *data_size,
2350 int nr);
2351int btrfs_insert_empty_items(struct btrfs_trans_handle *trans, 2278int btrfs_insert_empty_items(struct btrfs_trans_handle *trans,
2352 struct btrfs_root *root, 2279 struct btrfs_root *root,
2353 struct btrfs_path *path, 2280 struct btrfs_path *path,
@@ -2393,8 +2320,6 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root
2393 *item); 2320 *item);
2394int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct 2321int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct
2395 btrfs_root_item *item, struct btrfs_key *key); 2322 btrfs_root_item *item, struct btrfs_key *key);
2396int btrfs_search_root(struct btrfs_root *root, u64 search_start,
2397 u64 *found_objectid);
2398int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid); 2323int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid);
2399int btrfs_find_orphan_roots(struct btrfs_root *tree_root); 2324int btrfs_find_orphan_roots(struct btrfs_root *tree_root);
2400int btrfs_set_root_node(struct btrfs_root_item *item, 2325int btrfs_set_root_node(struct btrfs_root_item *item,
@@ -2493,15 +2418,10 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
2493 struct btrfs_ordered_sum *sums); 2418 struct btrfs_ordered_sum *sums);
2494int btrfs_csum_one_bio(struct btrfs_root *root, struct inode *inode, 2419int btrfs_csum_one_bio(struct btrfs_root *root, struct inode *inode,
2495 struct bio *bio, u64 file_start, int contig); 2420 struct bio *bio, u64 file_start, int contig);
2496int btrfs_csum_file_bytes(struct btrfs_root *root, struct inode *inode,
2497 u64 start, unsigned long len);
2498struct btrfs_csum_item *btrfs_lookup_csum(struct btrfs_trans_handle *trans, 2421struct btrfs_csum_item *btrfs_lookup_csum(struct btrfs_trans_handle *trans,
2499 struct btrfs_root *root, 2422 struct btrfs_root *root,
2500 struct btrfs_path *path, 2423 struct btrfs_path *path,
2501 u64 bytenr, int cow); 2424 u64 bytenr, int cow);
2502int btrfs_csum_truncate(struct btrfs_trans_handle *trans,
2503 struct btrfs_root *root, struct btrfs_path *path,
2504 u64 isize);
2505int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, 2425int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start,
2506 u64 end, struct list_head *list); 2426 u64 end, struct list_head *list);
2507/* inode.c */ 2427/* inode.c */
@@ -2532,8 +2452,6 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
2532 u32 min_type); 2452 u32 min_type);
2533 2453
2534int btrfs_start_delalloc_inodes(struct btrfs_root *root, int delay_iput); 2454int btrfs_start_delalloc_inodes(struct btrfs_root *root, int delay_iput);
2535int btrfs_start_one_delalloc_inode(struct btrfs_root *root, int delay_iput,
2536 int sync);
2537int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end, 2455int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end,
2538 struct extent_state **cached_state); 2456 struct extent_state **cached_state);
2539int btrfs_writepages(struct address_space *mapping, 2457int btrfs_writepages(struct address_space *mapping,
@@ -2550,7 +2468,6 @@ unsigned long btrfs_force_ra(struct address_space *mapping,
2550int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); 2468int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);
2551int btrfs_readpage(struct file *file, struct page *page); 2469int btrfs_readpage(struct file *file, struct page *page);
2552void btrfs_evict_inode(struct inode *inode); 2470void btrfs_evict_inode(struct inode *inode);
2553void btrfs_put_inode(struct inode *inode);
2554int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc); 2471int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc);
2555void btrfs_dirty_inode(struct inode *inode); 2472void btrfs_dirty_inode(struct inode *inode);
2556struct inode *btrfs_alloc_inode(struct super_block *sb); 2473struct inode *btrfs_alloc_inode(struct super_block *sb);
@@ -2561,10 +2478,8 @@ void btrfs_destroy_cachep(void);
2561long btrfs_ioctl_trans_end(struct file *file); 2478long btrfs_ioctl_trans_end(struct file *file);
2562struct inode *btrfs_iget(struct super_block *s, struct btrfs_key *location, 2479struct inode *btrfs_iget(struct super_block *s, struct btrfs_key *location,
2563 struct btrfs_root *root, int *was_new); 2480 struct btrfs_root *root, int *was_new);
2564int btrfs_commit_write(struct file *file, struct page *page,
2565 unsigned from, unsigned to);
2566struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page, 2481struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
2567 size_t page_offset, u64 start, u64 end, 2482 size_t pg_offset, u64 start, u64 end,
2568 int create); 2483 int create);
2569int btrfs_update_inode(struct btrfs_trans_handle *trans, 2484int btrfs_update_inode(struct btrfs_trans_handle *trans,
2570 struct btrfs_root *root, 2485 struct btrfs_root *root,
@@ -2601,7 +2516,6 @@ void btrfs_inherit_iflags(struct inode *inode, struct inode *dir);
2601int btrfs_sync_file(struct file *file, int datasync); 2516int btrfs_sync_file(struct file *file, int datasync);
2602int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end, 2517int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end,
2603 int skip_pinned); 2518 int skip_pinned);
2604int btrfs_check_file(struct btrfs_root *root, struct inode *inode);
2605extern const struct file_operations btrfs_file_operations; 2519extern const struct file_operations btrfs_file_operations;
2606int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode, 2520int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode,
2607 u64 start, u64 end, u64 *hint_byte, int drop_cache); 2521 u64 start, u64 end, u64 *hint_byte, int drop_cache);
@@ -2621,10 +2535,6 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
2621/* sysfs.c */ 2535/* sysfs.c */
2622int btrfs_init_sysfs(void); 2536int btrfs_init_sysfs(void);
2623void btrfs_exit_sysfs(void); 2537void btrfs_exit_sysfs(void);
2624int btrfs_sysfs_add_super(struct btrfs_fs_info *fs);
2625int btrfs_sysfs_add_root(struct btrfs_root *root);
2626void btrfs_sysfs_del_root(struct btrfs_root *root);
2627void btrfs_sysfs_del_super(struct btrfs_fs_info *root);
2628 2538
2629/* xattr.c */ 2539/* xattr.c */
2630ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size); 2540ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size);