ctree.h (4cb5300bc839b8a943eb19c9f27f25470e22d0ca) | ctree.h (aa38572954ade525817fe88c54faebf85e5a61c0) |
---|---|
1/* 2 * Copyright (C) 2007 Oracle. 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 unchanged lines hidden (view full) --- 18 19#ifndef __BTRFS_CTREE__ 20#define __BTRFS_CTREE__ 21 22#include <linux/version.h> 23#include <linux/mm.h> 24#include <linux/highmem.h> 25#include <linux/fs.h> | 1/* 2 * Copyright (C) 2007 Oracle. 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 unchanged lines hidden (view full) --- 18 19#ifndef __BTRFS_CTREE__ 20#define __BTRFS_CTREE__ 21 22#include <linux/version.h> 23#include <linux/mm.h> 24#include <linux/highmem.h> 25#include <linux/fs.h> |
26#include <linux/rwsem.h> | |
27#include <linux/completion.h> 28#include <linux/backing-dev.h> 29#include <linux/wait.h> 30#include <linux/slab.h> 31#include <linux/kobject.h> 32#include <trace/events/btrfs.h> 33#include <asm/kmap_types.h> 34#include "extent_io.h" 35#include "extent_map.h" 36#include "async-thread.h" | 26#include <linux/completion.h> 27#include <linux/backing-dev.h> 28#include <linux/wait.h> 29#include <linux/slab.h> 30#include <linux/kobject.h> 31#include <trace/events/btrfs.h> 32#include <asm/kmap_types.h> 33#include "extent_io.h" 34#include "extent_map.h" 35#include "async-thread.h" |
37#include "ioctl.h" | |
38 39struct btrfs_trans_handle; 40struct btrfs_transaction; 41struct btrfs_pending_snapshot; 42extern struct kmem_cache *btrfs_trans_handle_cachep; 43extern struct kmem_cache *btrfs_transaction_cachep; 44extern struct kmem_cache *btrfs_bit_radix_cachep; 45extern struct kmem_cache *btrfs_path_cachep; --- 56 unchanged lines hidden (view full) --- 102 * this allows them to share the logging tree 103 * for fsyncs 104 */ 105#define BTRFS_EXTENT_CSUM_OBJECTID -10ULL 106 107/* For storing free space cache */ 108#define BTRFS_FREE_SPACE_OBJECTID -11ULL 109 | 36 37struct btrfs_trans_handle; 38struct btrfs_transaction; 39struct btrfs_pending_snapshot; 40extern struct kmem_cache *btrfs_trans_handle_cachep; 41extern struct kmem_cache *btrfs_transaction_cachep; 42extern struct kmem_cache *btrfs_bit_radix_cachep; 43extern struct kmem_cache *btrfs_path_cachep; --- 56 unchanged lines hidden (view full) --- 100 * this allows them to share the logging tree 101 * for fsyncs 102 */ 103#define BTRFS_EXTENT_CSUM_OBJECTID -10ULL 104 105/* For storing free space cache */ 106#define BTRFS_FREE_SPACE_OBJECTID -11ULL 107 |
110/* 111 * The inode number assigned to the special inode for sotring 112 * free ino cache 113 */ 114#define BTRFS_FREE_INO_OBJECTID -12ULL 115 | |
116/* dummy objectid represents multiple objectids */ 117#define BTRFS_MULTIPLE_OBJECTIDS -255ULL 118 119/* 120 * All files have objectids in this range. 121 */ 122#define BTRFS_FIRST_FREE_OBJECTID 256ULL 123#define BTRFS_LAST_FREE_OBJECTID -256ULL --- 66 unchanged lines hidden (view full) --- 190 u8 type; 191 u64 offset; 192} __attribute__ ((__packed__)); 193 194struct btrfs_mapping_tree { 195 struct extent_map_tree map_tree; 196}; 197 | 108/* dummy objectid represents multiple objectids */ 109#define BTRFS_MULTIPLE_OBJECTIDS -255ULL 110 111/* 112 * All files have objectids in this range. 113 */ 114#define BTRFS_FIRST_FREE_OBJECTID 256ULL 115#define BTRFS_LAST_FREE_OBJECTID -256ULL --- 66 unchanged lines hidden (view full) --- 182 u8 type; 183 u64 offset; 184} __attribute__ ((__packed__)); 185 186struct btrfs_mapping_tree { 187 struct extent_map_tree map_tree; 188}; 189 |
190#define BTRFS_UUID_SIZE 16 |
|
198struct btrfs_dev_item { 199 /* the internal btrfs device id */ 200 __le64 devid; 201 202 /* size of the device */ 203 __le64 total_bytes; 204 205 /* bytes used */ --- 90 unchanged lines hidden (view full) --- 296 297static inline unsigned long btrfs_chunk_item_size(int num_stripes) 298{ 299 BUG_ON(num_stripes == 0); 300 return sizeof(struct btrfs_chunk) + 301 sizeof(struct btrfs_stripe) * (num_stripes - 1); 302} 303 | 191struct btrfs_dev_item { 192 /* the internal btrfs device id */ 193 __le64 devid; 194 195 /* size of the device */ 196 __le64 total_bytes; 197 198 /* bytes used */ --- 90 unchanged lines hidden (view full) --- 289 290static inline unsigned long btrfs_chunk_item_size(int num_stripes) 291{ 292 BUG_ON(num_stripes == 0); 293 return sizeof(struct btrfs_chunk) + 294 sizeof(struct btrfs_stripe) * (num_stripes - 1); 295} 296 |
297#define BTRFS_FSID_SIZE 16 |
|
304#define BTRFS_HEADER_FLAG_WRITTEN (1ULL << 0) 305#define BTRFS_HEADER_FLAG_RELOC (1ULL << 1) 306 307/* 308 * File system states 309 */ 310 311/* Errors detected */ --- 199 unchanged lines hidden (view full) --- 511#define BTRFS_EXTENT_FLAG_DATA (1ULL << 0) 512#define BTRFS_EXTENT_FLAG_TREE_BLOCK (1ULL << 1) 513 514/* following flags only apply to tree blocks */ 515 516/* use full backrefs for extent pointers in the block */ 517#define BTRFS_BLOCK_FLAG_FULL_BACKREF (1ULL << 8) 518 | 298#define BTRFS_HEADER_FLAG_WRITTEN (1ULL << 0) 299#define BTRFS_HEADER_FLAG_RELOC (1ULL << 1) 300 301/* 302 * File system states 303 */ 304 305/* Errors detected */ --- 199 unchanged lines hidden (view full) --- 505#define BTRFS_EXTENT_FLAG_DATA (1ULL << 0) 506#define BTRFS_EXTENT_FLAG_TREE_BLOCK (1ULL << 1) 507 508/* following flags only apply to tree blocks */ 509 510/* use full backrefs for extent pointers in the block */ 511#define BTRFS_BLOCK_FLAG_FULL_BACKREF (1ULL << 8) 512 |
519/* 520 * this flag is only used internally by scrub and may be changed at any time 521 * it is only declared here to avoid collisions 522 */ 523#define BTRFS_EXTENT_FLAG_SUPER (1ULL << 48) 524 | |
525struct btrfs_tree_block_info { 526 struct btrfs_disk_key key; 527 u8 level; 528} __attribute__ ((__packed__)); 529 530struct btrfs_extent_data_ref { 531 __le64 root; 532 __le64 objectid; --- 214 unchanged lines hidden (view full) --- 747 * we bump reservation progress every time we decrement 748 * bytes_reserved. This way people waiting for reservations 749 * know something good has happened and they can check 750 * for progress. The number here isn't to be trusted, it 751 * just shows reclaim activity 752 */ 753 unsigned long reservation_progress; 754 | 513struct btrfs_tree_block_info { 514 struct btrfs_disk_key key; 515 u8 level; 516} __attribute__ ((__packed__)); 517 518struct btrfs_extent_data_ref { 519 __le64 root; 520 __le64 objectid; --- 214 unchanged lines hidden (view full) --- 735 * we bump reservation progress every time we decrement 736 * bytes_reserved. This way people waiting for reservations 737 * know something good has happened and they can check 738 * for progress. The number here isn't to be trusted, it 739 * just shows reclaim activity 740 */ 741 unsigned long reservation_progress; 742 |
755 unsigned int full:1; /* indicates that we cannot allocate any more | 743 int full:1; /* indicates that we cannot allocate any more |
756 chunks for this space */ | 744 chunks for this space */ |
757 unsigned int chunk_alloc:1; /* set if we are allocating a chunk */ | 745 int chunk_alloc:1; /* set if we are allocating a chunk */ |
758 | 746 |
759 unsigned int force_alloc; /* set if we need to force a chunk 760 alloc for this space */ | 747 int force_alloc; /* set if we need to force a chunk alloc for 748 this space */ |
761 762 struct list_head list; 763 764 /* for block groups in our same type */ 765 struct list_head block_groups[BTRFS_NR_RAID_TYPES]; 766 spinlock_t lock; 767 struct rw_semaphore groups_sem; 768 atomic_t caching_threads; --- 68 unchanged lines hidden (view full) --- 837 struct inode *inode; 838 spinlock_t lock; 839 u64 pinned; 840 u64 reserved; 841 u64 reserved_pinned; 842 u64 bytes_super; 843 u64 flags; 844 u64 sectorsize; | 749 750 struct list_head list; 751 752 /* for block groups in our same type */ 753 struct list_head block_groups[BTRFS_NR_RAID_TYPES]; 754 spinlock_t lock; 755 struct rw_semaphore groups_sem; 756 atomic_t caching_threads; --- 68 unchanged lines hidden (view full) --- 825 struct inode *inode; 826 spinlock_t lock; 827 u64 pinned; 828 u64 reserved; 829 u64 reserved_pinned; 830 u64 bytes_super; 831 u64 flags; 832 u64 sectorsize; |
833 int extents_thresh; 834 int free_extents; 835 int total_bitmaps; |
|
845 unsigned int ro:1; 846 unsigned int dirty:1; 847 unsigned int iref:1; 848 849 int disk_cache_state; 850 851 /* cache tracking stuff */ 852 int cached; 853 struct btrfs_caching_control *caching_ctl; 854 u64 last_byte_to_unpin; 855 856 struct btrfs_space_info *space_info; 857 858 /* free space cache stuff */ | 836 unsigned int ro:1; 837 unsigned int dirty:1; 838 unsigned int iref:1; 839 840 int disk_cache_state; 841 842 /* cache tracking stuff */ 843 int cached; 844 struct btrfs_caching_control *caching_ctl; 845 u64 last_byte_to_unpin; 846 847 struct btrfs_space_info *space_info; 848 849 /* free space cache stuff */ |
859 struct btrfs_free_space_ctl *free_space_ctl; | 850 spinlock_t tree_lock; 851 struct rb_root free_space_offset; 852 u64 free_space; |
860 861 /* block group cache stuff */ 862 struct rb_node cache_node; 863 864 /* for block groups in the same raid type */ 865 struct list_head list; 866 867 /* usage count */ 868 atomic_t count; 869 870 /* List of struct btrfs_free_clusters for this block group. 871 * Today it will only have one thing on it, but that may change 872 */ 873 struct list_head cluster_list; 874}; 875 876struct reloc_control; 877struct btrfs_device; 878struct btrfs_fs_devices; | 853 854 /* block group cache stuff */ 855 struct rb_node cache_node; 856 857 /* for block groups in the same raid type */ 858 struct list_head list; 859 860 /* usage count */ 861 atomic_t count; 862 863 /* List of struct btrfs_free_clusters for this block group. 864 * Today it will only have one thing on it, but that may change 865 */ 866 struct list_head cluster_list; 867}; 868 869struct reloc_control; 870struct btrfs_device; 871struct btrfs_fs_devices; |
879struct btrfs_delayed_root; | |
880struct btrfs_fs_info { 881 u8 fsid[BTRFS_FSID_SIZE]; 882 u8 chunk_tree_uuid[BTRFS_UUID_SIZE]; 883 struct btrfs_root *extent_root; 884 struct btrfs_root *tree_root; 885 struct btrfs_root *chunk_root; 886 struct btrfs_root *dev_root; 887 struct btrfs_root *fs_root; --- 10 unchanged lines hidden (view full) --- 898 struct rb_root block_group_cache_tree; 899 900 struct extent_io_tree freed_extents[2]; 901 struct extent_io_tree *pinned_extents; 902 903 /* logical->physical extent mapping */ 904 struct btrfs_mapping_tree mapping_tree; 905 | 872struct btrfs_fs_info { 873 u8 fsid[BTRFS_FSID_SIZE]; 874 u8 chunk_tree_uuid[BTRFS_UUID_SIZE]; 875 struct btrfs_root *extent_root; 876 struct btrfs_root *tree_root; 877 struct btrfs_root *chunk_root; 878 struct btrfs_root *dev_root; 879 struct btrfs_root *fs_root; --- 10 unchanged lines hidden (view full) --- 890 struct rb_root block_group_cache_tree; 891 892 struct extent_io_tree freed_extents[2]; 893 struct extent_io_tree *pinned_extents; 894 895 /* logical->physical extent mapping */ 896 struct btrfs_mapping_tree mapping_tree; 897 |
906 /* 907 * block reservation for extent, checksum, root tree and 908 * delayed dir index item 909 */ | 898 /* block reservation for extent, checksum and root tree */ |
910 struct btrfs_block_rsv global_block_rsv; 911 /* block reservation for delay allocation */ 912 struct btrfs_block_rsv delalloc_block_rsv; 913 /* block reservation for metadata operations */ 914 struct btrfs_block_rsv trans_block_rsv; 915 /* block reservation for chunk tree */ 916 struct btrfs_block_rsv chunk_block_rsv; 917 --- 110 unchanged lines hidden (view full) --- 1028 struct btrfs_workers endio_freespace_worker; 1029 struct btrfs_workers submit_workers; 1030 /* 1031 * fixup workers take dirty pages that didn't properly go through 1032 * the cow mechanism and make them safe to write. It happens 1033 * for the sys_munmap function call path 1034 */ 1035 struct btrfs_workers fixup_workers; | 899 struct btrfs_block_rsv global_block_rsv; 900 /* block reservation for delay allocation */ 901 struct btrfs_block_rsv delalloc_block_rsv; 902 /* block reservation for metadata operations */ 903 struct btrfs_block_rsv trans_block_rsv; 904 /* block reservation for chunk tree */ 905 struct btrfs_block_rsv chunk_block_rsv; 906 --- 110 unchanged lines hidden (view full) --- 1017 struct btrfs_workers endio_freespace_worker; 1018 struct btrfs_workers submit_workers; 1019 /* 1020 * fixup workers take dirty pages that didn't properly go through 1021 * the cow mechanism and make them safe to write. It happens 1022 * for the sys_munmap function call path 1023 */ 1024 struct btrfs_workers fixup_workers; |
1036 struct btrfs_workers delayed_workers; | |
1037 struct task_struct *transaction_kthread; 1038 struct task_struct *cleaner_kthread; 1039 int thread_pool_size; 1040 1041 struct kobject super_kobj; 1042 struct completion kobj_unregister; 1043 int do_barriers; 1044 int closing; --- 24 unchanged lines hidden (view full) --- 1069 u64 delalloc_bytes; 1070 1071 /* data_alloc_cluster is only used in ssd mode */ 1072 struct btrfs_free_cluster data_alloc_cluster; 1073 1074 /* all metadata allocations go through this cluster */ 1075 struct btrfs_free_cluster meta_alloc_cluster; 1076 | 1025 struct task_struct *transaction_kthread; 1026 struct task_struct *cleaner_kthread; 1027 int thread_pool_size; 1028 1029 struct kobject super_kobj; 1030 struct completion kobj_unregister; 1031 int do_barriers; 1032 int closing; --- 24 unchanged lines hidden (view full) --- 1057 u64 delalloc_bytes; 1058 1059 /* data_alloc_cluster is only used in ssd mode */ 1060 struct btrfs_free_cluster data_alloc_cluster; 1061 1062 /* all metadata allocations go through this cluster */ 1063 struct btrfs_free_cluster meta_alloc_cluster; 1064 |
1077 /* auto defrag inodes go here */ 1078 spinlock_t defrag_inodes_lock; 1079 struct rb_root defrag_inodes; 1080 atomic_t defrag_running; 1081 | |
1082 spinlock_t ref_cache_lock; 1083 u64 total_ref_cache_size; 1084 1085 u64 avail_data_alloc_bits; 1086 u64 avail_metadata_alloc_bits; 1087 u64 avail_system_alloc_bits; 1088 u64 data_alloc_profile; 1089 u64 metadata_alloc_profile; 1090 u64 system_alloc_profile; 1091 1092 unsigned data_chunk_allocations; 1093 unsigned metadata_ratio; 1094 1095 void *bdev_holder; 1096 | 1065 spinlock_t ref_cache_lock; 1066 u64 total_ref_cache_size; 1067 1068 u64 avail_data_alloc_bits; 1069 u64 avail_metadata_alloc_bits; 1070 u64 avail_system_alloc_bits; 1071 u64 data_alloc_profile; 1072 u64 metadata_alloc_profile; 1073 u64 system_alloc_profile; 1074 1075 unsigned data_chunk_allocations; 1076 unsigned metadata_ratio; 1077 1078 void *bdev_holder; 1079 |
1097 /* private scrub information */ 1098 struct mutex scrub_lock; 1099 atomic_t scrubs_running; 1100 atomic_t scrub_pause_req; 1101 atomic_t scrubs_paused; 1102 atomic_t scrub_cancel_req; 1103 wait_queue_head_t scrub_pause_wait; 1104 struct rw_semaphore scrub_super_lock; 1105 int scrub_workers_refcnt; 1106 struct btrfs_workers scrub_workers; 1107 | |
1108 /* filesystem state */ 1109 u64 fs_state; | 1080 /* filesystem state */ 1081 u64 fs_state; |
1110 1111 struct btrfs_delayed_root *delayed_root; | |
1112}; 1113 1114/* 1115 * in ram representation of the tree. extent_root is used for all allocations 1116 * and for the extent tree extent_root root. 1117 */ 1118struct btrfs_root { 1119 struct extent_buffer *node; 1120 | 1082}; 1083 1084/* 1085 * in ram representation of the tree. extent_root is used for all allocations 1086 * and for the extent tree extent_root root. 1087 */ 1088struct btrfs_root { 1089 struct extent_buffer *node; 1090 |
1091 /* the node lock is held while changing the node pointer */ 1092 spinlock_t node_lock; 1093 |
|
1121 struct extent_buffer *commit_root; 1122 struct btrfs_root *log_root; 1123 struct btrfs_root *reloc_root; 1124 1125 struct btrfs_root_item root_item; 1126 struct btrfs_key root_key; 1127 struct btrfs_fs_info *fs_info; 1128 struct extent_io_tree dirty_log_pages; 1129 1130 struct kobject root_kobj; 1131 struct completion kobj_unregister; 1132 struct mutex objectid_mutex; 1133 1134 spinlock_t accounting_lock; 1135 struct btrfs_block_rsv *block_rsv; 1136 | 1094 struct extent_buffer *commit_root; 1095 struct btrfs_root *log_root; 1096 struct btrfs_root *reloc_root; 1097 1098 struct btrfs_root_item root_item; 1099 struct btrfs_key root_key; 1100 struct btrfs_fs_info *fs_info; 1101 struct extent_io_tree dirty_log_pages; 1102 1103 struct kobject root_kobj; 1104 struct completion kobj_unregister; 1105 struct mutex objectid_mutex; 1106 1107 spinlock_t accounting_lock; 1108 struct btrfs_block_rsv *block_rsv; 1109 |
1137 /* free ino cache stuff */ 1138 struct mutex fs_commit_mutex; 1139 struct btrfs_free_space_ctl *free_ino_ctl; 1140 enum btrfs_caching_type cached; 1141 spinlock_t cache_lock; 1142 wait_queue_head_t cache_wait; 1143 struct btrfs_free_space_ctl *free_ino_pinned; 1144 u64 cache_progress; 1145 struct inode *cache_inode; 1146 | |
1147 struct mutex log_mutex; 1148 wait_queue_head_t log_writer_wait; 1149 wait_queue_head_t log_commit_wait[2]; 1150 atomic_t log_writers; 1151 atomic_t log_commit[2]; 1152 unsigned long log_transid; 1153 unsigned long last_log_commit; 1154 unsigned long log_batch; --- 39 unchanged lines hidden (view full) --- 1194 int orphan_item_inserted; 1195 int orphan_cleanup_state; 1196 1197 spinlock_t inode_lock; 1198 /* red-black tree that keeps track of in-memory inodes */ 1199 struct rb_root inode_tree; 1200 1201 /* | 1110 struct mutex log_mutex; 1111 wait_queue_head_t log_writer_wait; 1112 wait_queue_head_t log_commit_wait[2]; 1113 atomic_t log_writers; 1114 atomic_t log_commit[2]; 1115 unsigned long log_transid; 1116 unsigned long last_log_commit; 1117 unsigned long log_batch; --- 39 unchanged lines hidden (view full) --- 1157 int orphan_item_inserted; 1158 int orphan_cleanup_state; 1159 1160 spinlock_t inode_lock; 1161 /* red-black tree that keeps track of in-memory inodes */ 1162 struct rb_root inode_tree; 1163 1164 /* |
1202 * radix tree that keeps track of delayed nodes of every inode, 1203 * protected by inode_lock 1204 */ 1205 struct radix_tree_root delayed_nodes_tree; 1206 /* | |
1207 * right now this just gets used so that a root has its own devid 1208 * for stat. It may be used for more later 1209 */ 1210 struct super_block anon_super; 1211}; 1212 | 1165 * right now this just gets used so that a root has its own devid 1166 * for stat. It may be used for more later 1167 */ 1168 struct super_block anon_super; 1169}; 1170 |
1213struct btrfs_ioctl_defrag_range_args { 1214 /* start of the defrag operation */ 1215 __u64 start; 1216 1217 /* number of bytes to defrag, use (u64)-1 to say all */ 1218 __u64 len; 1219 1220 /* 1221 * flags for the operation, which can include turning 1222 * on compression for this one defrag 1223 */ 1224 __u64 flags; 1225 1226 /* 1227 * any extent bigger than this will be considered 1228 * already defragged. Use 0 to take the kernel default 1229 * Use 1 to say every single extent must be rewritten 1230 */ 1231 __u32 extent_thresh; 1232 1233 /* 1234 * which compression method to use if turning on compression 1235 * for this defrag operation. If unspecified, zlib will 1236 * be used 1237 */ 1238 __u32 compress_type; 1239 1240 /* spare for later */ 1241 __u32 unused[4]; 1242}; 1243 1244 | |
1245/* 1246 * inode items have the data typically returned from stat and store other 1247 * info about object characteristics. There is one for every file and dir in 1248 * the FS 1249 */ 1250#define BTRFS_INODE_ITEM_KEY 1 1251#define BTRFS_INODE_REF_KEY 12 1252#define BTRFS_XATTR_ITEM_KEY 24 --- 81 unchanged lines hidden (view full) --- 1334#define BTRFS_MOUNT_SSD_SPREAD (1 << 8) 1335#define BTRFS_MOUNT_NOSSD (1 << 9) 1336#define BTRFS_MOUNT_DISCARD (1 << 10) 1337#define BTRFS_MOUNT_FORCE_COMPRESS (1 << 11) 1338#define BTRFS_MOUNT_SPACE_CACHE (1 << 12) 1339#define BTRFS_MOUNT_CLEAR_CACHE (1 << 13) 1340#define BTRFS_MOUNT_USER_SUBVOL_RM_ALLOWED (1 << 14) 1341#define BTRFS_MOUNT_ENOSPC_DEBUG (1 << 15) | 1171/* 1172 * inode items have the data typically returned from stat and store other 1173 * info about object characteristics. There is one for every file and dir in 1174 * the FS 1175 */ 1176#define BTRFS_INODE_ITEM_KEY 1 1177#define BTRFS_INODE_REF_KEY 12 1178#define BTRFS_XATTR_ITEM_KEY 24 --- 81 unchanged lines hidden (view full) --- 1260#define BTRFS_MOUNT_SSD_SPREAD (1 << 8) 1261#define BTRFS_MOUNT_NOSSD (1 << 9) 1262#define BTRFS_MOUNT_DISCARD (1 << 10) 1263#define BTRFS_MOUNT_FORCE_COMPRESS (1 << 11) 1264#define BTRFS_MOUNT_SPACE_CACHE (1 << 12) 1265#define BTRFS_MOUNT_CLEAR_CACHE (1 << 13) 1266#define BTRFS_MOUNT_USER_SUBVOL_RM_ALLOWED (1 << 14) 1267#define BTRFS_MOUNT_ENOSPC_DEBUG (1 << 15) |
1342#define BTRFS_MOUNT_AUTO_DEFRAG (1 << 16) | |
1343 1344#define btrfs_clear_opt(o, opt) ((o) &= ~BTRFS_MOUNT_##opt) 1345#define btrfs_set_opt(o, opt) ((o) |= BTRFS_MOUNT_##opt) 1346#define btrfs_test_opt(root, opt) ((root)->fs_info->mount_opt & \ 1347 BTRFS_MOUNT_##opt) 1348/* 1349 * Inode flags 1350 */ --- 159 unchanged lines hidden (view full) --- 1510} 1511 1512static inline u64 btrfs_stripe_offset_nr(struct extent_buffer *eb, 1513 struct btrfs_chunk *c, int nr) 1514{ 1515 return btrfs_stripe_offset(eb, btrfs_stripe_nr(c, nr)); 1516} 1517 | 1268 1269#define btrfs_clear_opt(o, opt) ((o) &= ~BTRFS_MOUNT_##opt) 1270#define btrfs_set_opt(o, opt) ((o) |= BTRFS_MOUNT_##opt) 1271#define btrfs_test_opt(root, opt) ((root)->fs_info->mount_opt & \ 1272 BTRFS_MOUNT_##opt) 1273/* 1274 * Inode flags 1275 */ --- 159 unchanged lines hidden (view full) --- 1435} 1436 1437static inline u64 btrfs_stripe_offset_nr(struct extent_buffer *eb, 1438 struct btrfs_chunk *c, int nr) 1439{ 1440 return btrfs_stripe_offset(eb, btrfs_stripe_nr(c, nr)); 1441} 1442 |
1443static inline void btrfs_set_stripe_offset_nr(struct extent_buffer *eb, 1444 struct btrfs_chunk *c, int nr, 1445 u64 val) 1446{ 1447 btrfs_set_stripe_offset(eb, btrfs_stripe_nr(c, nr), val); 1448} 1449 |
|
1518static inline u64 btrfs_stripe_devid_nr(struct extent_buffer *eb, 1519 struct btrfs_chunk *c, int nr) 1520{ 1521 return btrfs_stripe_devid(eb, btrfs_stripe_nr(c, nr)); 1522} 1523 | 1450static inline u64 btrfs_stripe_devid_nr(struct extent_buffer *eb, 1451 struct btrfs_chunk *c, int nr) 1452{ 1453 return btrfs_stripe_devid(eb, btrfs_stripe_nr(c, nr)); 1454} 1455 |
1456static inline void btrfs_set_stripe_devid_nr(struct extent_buffer *eb, 1457 struct btrfs_chunk *c, int nr, 1458 u64 val) 1459{ 1460 btrfs_set_stripe_devid(eb, btrfs_stripe_nr(c, nr), val); 1461} 1462 |
|
1524/* struct btrfs_block_group_item */ 1525BTRFS_SETGET_STACK_FUNCS(block_group_used, struct btrfs_block_group_item, 1526 used, 64); 1527BTRFS_SETGET_FUNCS(disk_block_group_used, struct btrfs_block_group_item, 1528 used, 64); 1529BTRFS_SETGET_STACK_FUNCS(block_group_chunk_objectid, 1530 struct btrfs_block_group_item, chunk_objectid, 64); 1531 --- 41 unchanged lines hidden (view full) --- 1573static inline struct btrfs_timespec * 1574btrfs_inode_ctime(struct btrfs_inode_item *inode_item) 1575{ 1576 unsigned long ptr = (unsigned long)inode_item; 1577 ptr += offsetof(struct btrfs_inode_item, ctime); 1578 return (struct btrfs_timespec *)ptr; 1579} 1580 | 1463/* struct btrfs_block_group_item */ 1464BTRFS_SETGET_STACK_FUNCS(block_group_used, struct btrfs_block_group_item, 1465 used, 64); 1466BTRFS_SETGET_FUNCS(disk_block_group_used, struct btrfs_block_group_item, 1467 used, 64); 1468BTRFS_SETGET_STACK_FUNCS(block_group_chunk_objectid, 1469 struct btrfs_block_group_item, chunk_objectid, 64); 1470 --- 41 unchanged lines hidden (view full) --- 1512static inline struct btrfs_timespec * 1513btrfs_inode_ctime(struct btrfs_inode_item *inode_item) 1514{ 1515 unsigned long ptr = (unsigned long)inode_item; 1516 ptr += offsetof(struct btrfs_inode_item, ctime); 1517 return (struct btrfs_timespec *)ptr; 1518} 1519 |
1520static inline struct btrfs_timespec * 1521btrfs_inode_otime(struct btrfs_inode_item *inode_item) 1522{ 1523 unsigned long ptr = (unsigned long)inode_item; 1524 ptr += offsetof(struct btrfs_inode_item, otime); 1525 return (struct btrfs_timespec *)ptr; 1526} 1527 |
|
1581BTRFS_SETGET_FUNCS(timespec_sec, struct btrfs_timespec, sec, 64); 1582BTRFS_SETGET_FUNCS(timespec_nsec, struct btrfs_timespec, nsec, 32); 1583 1584/* struct btrfs_dev_extent */ 1585BTRFS_SETGET_FUNCS(dev_extent_chunk_tree, struct btrfs_dev_extent, 1586 chunk_tree, 64); 1587BTRFS_SETGET_FUNCS(dev_extent_chunk_objectid, struct btrfs_dev_extent, 1588 chunk_objectid, 64); --- 334 unchanged lines hidden (view full) --- 1923} 1924 1925static inline u8 *btrfs_header_chunk_tree_uuid(struct extent_buffer *eb) 1926{ 1927 unsigned long ptr = offsetof(struct btrfs_header, chunk_tree_uuid); 1928 return (u8 *)ptr; 1929} 1930 | 1528BTRFS_SETGET_FUNCS(timespec_sec, struct btrfs_timespec, sec, 64); 1529BTRFS_SETGET_FUNCS(timespec_nsec, struct btrfs_timespec, nsec, 32); 1530 1531/* struct btrfs_dev_extent */ 1532BTRFS_SETGET_FUNCS(dev_extent_chunk_tree, struct btrfs_dev_extent, 1533 chunk_tree, 64); 1534BTRFS_SETGET_FUNCS(dev_extent_chunk_objectid, struct btrfs_dev_extent, 1535 chunk_objectid, 64); --- 334 unchanged lines hidden (view full) --- 1870} 1871 1872static inline u8 *btrfs_header_chunk_tree_uuid(struct extent_buffer *eb) 1873{ 1874 unsigned long ptr = offsetof(struct btrfs_header, chunk_tree_uuid); 1875 return (u8 *)ptr; 1876} 1877 |
1878static inline u8 *btrfs_super_fsid(struct extent_buffer *eb) 1879{ 1880 unsigned long ptr = offsetof(struct btrfs_super_block, fsid); 1881 return (u8 *)ptr; 1882} 1883 1884static inline u8 *btrfs_header_csum(struct extent_buffer *eb) 1885{ 1886 unsigned long ptr = offsetof(struct btrfs_header, csum); 1887 return (u8 *)ptr; 1888} 1889 1890static inline struct btrfs_node *btrfs_buffer_node(struct extent_buffer *eb) 1891{ 1892 return NULL; 1893} 1894 1895static inline struct btrfs_leaf *btrfs_buffer_leaf(struct extent_buffer *eb) 1896{ 1897 return NULL; 1898} 1899 1900static inline struct btrfs_header *btrfs_buffer_header(struct extent_buffer *eb) 1901{ 1902 return NULL; 1903} 1904 |
|
1931static inline int btrfs_is_leaf(struct extent_buffer *eb) 1932{ 1933 return btrfs_header_level(eb) == 0; 1934} 1935 1936/* struct btrfs_root_item */ 1937BTRFS_SETGET_FUNCS(disk_root_generation, struct btrfs_root_item, 1938 generation, 64); --- 137 unchanged lines hidden (view full) --- 2076 return btrfs_item_size(eb, e) - offset; 2077} 2078 2079static inline struct btrfs_root *btrfs_sb(struct super_block *sb) 2080{ 2081 return sb->s_fs_info; 2082} 2083 | 1905static inline int btrfs_is_leaf(struct extent_buffer *eb) 1906{ 1907 return btrfs_header_level(eb) == 0; 1908} 1909 1910/* struct btrfs_root_item */ 1911BTRFS_SETGET_FUNCS(disk_root_generation, struct btrfs_root_item, 1912 generation, 64); --- 137 unchanged lines hidden (view full) --- 2050 return btrfs_item_size(eb, e) - offset; 2051} 2052 2053static inline struct btrfs_root *btrfs_sb(struct super_block *sb) 2054{ 2055 return sb->s_fs_info; 2056} 2057 |
2058static inline int btrfs_set_root_name(struct btrfs_root *root, 2059 const char *name, int len) 2060{ 2061 /* if we already have a name just free it */ 2062 kfree(root->name); 2063 2064 root->name = kmalloc(len+1, GFP_KERNEL); 2065 if (!root->name) 2066 return -ENOMEM; 2067 2068 memcpy(root->name, name, len); 2069 root->name[len] = '\0'; 2070 2071 return 0; 2072} 2073 |
|
2084static inline u32 btrfs_level_size(struct btrfs_root *root, int level) 2085{ 2086 if (level == 0) 2087 return root->leafsize; 2088 return root->nodesize; 2089} 2090 2091/* helper function to cast into the data area of the leaf. */ --- 12 unchanged lines hidden (view full) --- 2104 2105static inline bool btrfs_mixed_space_info(struct btrfs_space_info *space_info) 2106{ 2107 return ((space_info->flags & BTRFS_BLOCK_GROUP_METADATA) && 2108 (space_info->flags & BTRFS_BLOCK_GROUP_DATA)); 2109} 2110 2111/* extent-tree.c */ | 2074static inline u32 btrfs_level_size(struct btrfs_root *root, int level) 2075{ 2076 if (level == 0) 2077 return root->leafsize; 2078 return root->nodesize; 2079} 2080 2081/* helper function to cast into the data area of the leaf. */ --- 12 unchanged lines hidden (view full) --- 2094 2095static inline bool btrfs_mixed_space_info(struct btrfs_space_info *space_info) 2096{ 2097 return ((space_info->flags & BTRFS_BLOCK_GROUP_METADATA) && 2098 (space_info->flags & BTRFS_BLOCK_GROUP_DATA)); 2099} 2100 2101/* extent-tree.c */ |
2112static inline u64 btrfs_calc_trans_metadata_size(struct btrfs_root *root, 2113 int num_items) 2114{ 2115 return (root->leafsize + root->nodesize * (BTRFS_MAX_LEVEL - 1)) * 2116 3 * num_items; 2117} 2118 | |
2119void btrfs_put_block_group(struct btrfs_block_group_cache *cache); 2120int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, 2121 struct btrfs_root *root, unsigned long count); 2122int btrfs_lookup_extent(struct btrfs_root *root, u64 start, u64 len); 2123int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans, 2124 struct btrfs_root *root, u64 bytenr, 2125 u64 num_bytes, u64 *refs, u64 *flags); 2126int btrfs_pin_extent(struct btrfs_root *root, 2127 u64 bytenr, u64 num, int reserved); | 2102void btrfs_put_block_group(struct btrfs_block_group_cache *cache); 2103int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, 2104 struct btrfs_root *root, unsigned long count); 2105int btrfs_lookup_extent(struct btrfs_root *root, u64 start, u64 len); 2106int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans, 2107 struct btrfs_root *root, u64 bytenr, 2108 u64 num_bytes, u64 *refs, u64 *flags); 2109int btrfs_pin_extent(struct btrfs_root *root, 2110 u64 bytenr, u64 num, int reserved); |
2111int btrfs_drop_leaf_ref(struct btrfs_trans_handle *trans, 2112 struct btrfs_root *root, struct extent_buffer *leaf); |
|
2128int btrfs_cross_ref_exist(struct btrfs_trans_handle *trans, 2129 struct btrfs_root *root, 2130 u64 objectid, u64 offset, u64 bytenr); | 2113int btrfs_cross_ref_exist(struct btrfs_trans_handle *trans, 2114 struct btrfs_root *root, 2115 u64 objectid, u64 offset, u64 bytenr); |
2116int btrfs_copy_pinned(struct btrfs_root *root, struct extent_io_tree *copy); |
|
2131struct btrfs_block_group_cache *btrfs_lookup_block_group( 2132 struct btrfs_fs_info *info, 2133 u64 bytenr); 2134void btrfs_put_block_group(struct btrfs_block_group_cache *cache); 2135u64 btrfs_find_block_group(struct btrfs_root *root, 2136 u64 search_start, u64 search_hint, int owner); 2137struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, 2138 struct btrfs_root *root, u32 blocksize, --- 160 unchanged lines hidden (view full) --- 2299 struct btrfs_key *new_key); 2300int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root 2301 *root, struct btrfs_key *key, struct btrfs_path *p, int 2302 ins_len, int cow); 2303int btrfs_realloc_node(struct btrfs_trans_handle *trans, 2304 struct btrfs_root *root, struct extent_buffer *parent, 2305 int start_slot, int cache_only, u64 *last_ret, 2306 struct btrfs_key *progress); | 2117struct btrfs_block_group_cache *btrfs_lookup_block_group( 2118 struct btrfs_fs_info *info, 2119 u64 bytenr); 2120void btrfs_put_block_group(struct btrfs_block_group_cache *cache); 2121u64 btrfs_find_block_group(struct btrfs_root *root, 2122 u64 search_start, u64 search_hint, int owner); 2123struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, 2124 struct btrfs_root *root, u32 blocksize, --- 160 unchanged lines hidden (view full) --- 2285 struct btrfs_key *new_key); 2286int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root 2287 *root, struct btrfs_key *key, struct btrfs_path *p, int 2288 ins_len, int cow); 2289int btrfs_realloc_node(struct btrfs_trans_handle *trans, 2290 struct btrfs_root *root, struct extent_buffer *parent, 2291 int start_slot, int cache_only, u64 *last_ret, 2292 struct btrfs_key *progress); |
2307void btrfs_release_path(struct btrfs_path *p); | 2293void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p); |
2308struct btrfs_path *btrfs_alloc_path(void); 2309void btrfs_free_path(struct btrfs_path *p); 2310void btrfs_set_path_blocking(struct btrfs_path *p); | 2294struct btrfs_path *btrfs_alloc_path(void); 2295void btrfs_free_path(struct btrfs_path *p); 2296void btrfs_set_path_blocking(struct btrfs_path *p); |
2311void btrfs_clear_path_blocking(struct btrfs_path *p, 2312 struct extent_buffer *held); | |
2313void btrfs_unlock_up_safe(struct btrfs_path *p, int level); 2314 2315int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, 2316 struct btrfs_path *path, int slot, int nr); 2317static inline int btrfs_del_item(struct btrfs_trans_handle *trans, 2318 struct btrfs_root *root, 2319 struct btrfs_path *path) 2320{ 2321 return btrfs_del_items(trans, root, path, path->slots[0], 1); 2322} 2323 | 2297void btrfs_unlock_up_safe(struct btrfs_path *p, int level); 2298 2299int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, 2300 struct btrfs_path *path, int slot, int nr); 2301static inline int btrfs_del_item(struct btrfs_trans_handle *trans, 2302 struct btrfs_root *root, 2303 struct btrfs_path *path) 2304{ 2305 return btrfs_del_items(trans, root, path, path->slots[0], 1); 2306} 2307 |
2324int setup_items_for_insert(struct btrfs_trans_handle *trans, 2325 struct btrfs_root *root, struct btrfs_path *path, 2326 struct btrfs_key *cpu_key, u32 *data_size, 2327 u32 total_data, u32 total_size, int nr); | |
2328int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root 2329 *root, struct btrfs_key *key, void *data, u32 data_size); | 2308int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root 2309 *root, struct btrfs_key *key, void *data, u32 data_size); |
2310int btrfs_insert_some_items(struct btrfs_trans_handle *trans, 2311 struct btrfs_root *root, 2312 struct btrfs_path *path, 2313 struct btrfs_key *cpu_key, u32 *data_size, 2314 int nr); |
|
2330int btrfs_insert_empty_items(struct btrfs_trans_handle *trans, 2331 struct btrfs_root *root, 2332 struct btrfs_path *path, 2333 struct btrfs_key *cpu_key, u32 *data_size, int nr); 2334 2335static inline int btrfs_insert_empty_item(struct btrfs_trans_handle *trans, 2336 struct btrfs_root *root, 2337 struct btrfs_path *path, --- 29 unchanged lines hidden (view full) --- 2367int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root 2368 *root, struct btrfs_key *key, struct btrfs_root_item 2369 *item); 2370int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root 2371 *root, struct btrfs_key *key, struct btrfs_root_item 2372 *item); 2373int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct 2374 btrfs_root_item *item, struct btrfs_key *key); | 2315int btrfs_insert_empty_items(struct btrfs_trans_handle *trans, 2316 struct btrfs_root *root, 2317 struct btrfs_path *path, 2318 struct btrfs_key *cpu_key, u32 *data_size, int nr); 2319 2320static inline int btrfs_insert_empty_item(struct btrfs_trans_handle *trans, 2321 struct btrfs_root *root, 2322 struct btrfs_path *path, --- 29 unchanged lines hidden (view full) --- 2352int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root 2353 *root, struct btrfs_key *key, struct btrfs_root_item 2354 *item); 2355int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root 2356 *root, struct btrfs_key *key, struct btrfs_root_item 2357 *item); 2358int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct 2359 btrfs_root_item *item, struct btrfs_key *key); |
2360int btrfs_search_root(struct btrfs_root *root, u64 search_start, 2361 u64 *found_objectid); |
|
2375int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid); 2376int btrfs_find_orphan_roots(struct btrfs_root *tree_root); 2377int btrfs_set_root_node(struct btrfs_root_item *item, 2378 struct extent_buffer *node); 2379void btrfs_check_and_init_root_item(struct btrfs_root_item *item); 2380 2381/* dir-item.c */ 2382int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, 2383 struct btrfs_root *root, const char *name, | 2362int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid); 2363int btrfs_find_orphan_roots(struct btrfs_root *tree_root); 2364int btrfs_set_root_node(struct btrfs_root_item *item, 2365 struct extent_buffer *node); 2366void btrfs_check_and_init_root_item(struct btrfs_root_item *item); 2367 2368/* dir-item.c */ 2369int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, 2370 struct btrfs_root *root, const char *name, |
2384 int name_len, struct inode *dir, | 2371 int name_len, u64 dir, |
2385 struct btrfs_key *location, u8 type, u64 index); 2386struct btrfs_dir_item *btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, 2387 struct btrfs_root *root, 2388 struct btrfs_path *path, u64 dir, 2389 const char *name, int name_len, 2390 int mod); 2391struct btrfs_dir_item * 2392btrfs_lookup_dir_index_item(struct btrfs_trans_handle *trans, --- 28 unchanged lines hidden (view full) --- 2421 2422/* orphan.c */ 2423int btrfs_insert_orphan_item(struct btrfs_trans_handle *trans, 2424 struct btrfs_root *root, u64 offset); 2425int btrfs_del_orphan_item(struct btrfs_trans_handle *trans, 2426 struct btrfs_root *root, u64 offset); 2427int btrfs_find_orphan_item(struct btrfs_root *root, u64 offset); 2428 | 2372 struct btrfs_key *location, u8 type, u64 index); 2373struct btrfs_dir_item *btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, 2374 struct btrfs_root *root, 2375 struct btrfs_path *path, u64 dir, 2376 const char *name, int name_len, 2377 int mod); 2378struct btrfs_dir_item * 2379btrfs_lookup_dir_index_item(struct btrfs_trans_handle *trans, --- 28 unchanged lines hidden (view full) --- 2408 2409/* orphan.c */ 2410int btrfs_insert_orphan_item(struct btrfs_trans_handle *trans, 2411 struct btrfs_root *root, u64 offset); 2412int btrfs_del_orphan_item(struct btrfs_trans_handle *trans, 2413 struct btrfs_root *root, u64 offset); 2414int btrfs_find_orphan_item(struct btrfs_root *root, u64 offset); 2415 |
2416/* inode-map.c */ 2417int btrfs_find_free_objectid(struct btrfs_trans_handle *trans, 2418 struct btrfs_root *fs_root, 2419 u64 dirid, u64 *objectid); 2420int btrfs_find_highest_inode(struct btrfs_root *fs_root, u64 *objectid); 2421 |
|
2429/* inode-item.c */ 2430int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans, 2431 struct btrfs_root *root, 2432 const char *name, int name_len, 2433 u64 inode_objectid, u64 ref_objectid, u64 index); 2434int btrfs_del_inode_ref(struct btrfs_trans_handle *trans, 2435 struct btrfs_root *root, 2436 const char *name, int name_len, --- 28 unchanged lines hidden (view full) --- 2465 struct btrfs_root *root, 2466 struct btrfs_path *path, u64 objectid, 2467 u64 bytenr, int mod); 2468int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans, 2469 struct btrfs_root *root, 2470 struct btrfs_ordered_sum *sums); 2471int btrfs_csum_one_bio(struct btrfs_root *root, struct inode *inode, 2472 struct bio *bio, u64 file_start, int contig); | 2422/* inode-item.c */ 2423int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans, 2424 struct btrfs_root *root, 2425 const char *name, int name_len, 2426 u64 inode_objectid, u64 ref_objectid, u64 index); 2427int btrfs_del_inode_ref(struct btrfs_trans_handle *trans, 2428 struct btrfs_root *root, 2429 const char *name, int name_len, --- 28 unchanged lines hidden (view full) --- 2458 struct btrfs_root *root, 2459 struct btrfs_path *path, u64 objectid, 2460 u64 bytenr, int mod); 2461int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans, 2462 struct btrfs_root *root, 2463 struct btrfs_ordered_sum *sums); 2464int btrfs_csum_one_bio(struct btrfs_root *root, struct inode *inode, 2465 struct bio *bio, u64 file_start, int contig); |
2466int btrfs_csum_file_bytes(struct btrfs_root *root, struct inode *inode, 2467 u64 start, unsigned long len); |
|
2473struct btrfs_csum_item *btrfs_lookup_csum(struct btrfs_trans_handle *trans, 2474 struct btrfs_root *root, 2475 struct btrfs_path *path, 2476 u64 bytenr, int cow); 2477int btrfs_csum_truncate(struct btrfs_trans_handle *trans, 2478 struct btrfs_root *root, struct btrfs_path *path, 2479 u64 isize); | 2468struct btrfs_csum_item *btrfs_lookup_csum(struct btrfs_trans_handle *trans, 2469 struct btrfs_root *root, 2470 struct btrfs_path *path, 2471 u64 bytenr, int cow); 2472int btrfs_csum_truncate(struct btrfs_trans_handle *trans, 2473 struct btrfs_root *root, struct btrfs_path *path, 2474 u64 isize); |
2480int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end, 2481 struct list_head *list, int search_commit); | 2475int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, 2476 u64 end, struct list_head *list); |
2482/* inode.c */ 2483 2484/* RHEL and EL kernels have a patch that renames PG_checked to FsMisc */ 2485#if defined(ClearPageFsMisc) && !defined(ClearPageChecked) 2486#define ClearPageChecked ClearPageFsMisc 2487#define SetPageChecked SetPageFsMisc 2488#define PageChecked PageFsMisc 2489#endif --- 12 unchanged lines hidden (view full) --- 2502 struct inode *dir, u64 objectid, 2503 const char *name, int name_len); 2504int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, 2505 struct btrfs_root *root, 2506 struct inode *inode, u64 new_size, 2507 u32 min_type); 2508 2509int btrfs_start_delalloc_inodes(struct btrfs_root *root, int delay_iput); | 2477/* inode.c */ 2478 2479/* RHEL and EL kernels have a patch that renames PG_checked to FsMisc */ 2480#if defined(ClearPageFsMisc) && !defined(ClearPageChecked) 2481#define ClearPageChecked ClearPageFsMisc 2482#define SetPageChecked SetPageFsMisc 2483#define PageChecked PageFsMisc 2484#endif --- 12 unchanged lines hidden (view full) --- 2497 struct inode *dir, u64 objectid, 2498 const char *name, int name_len); 2499int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, 2500 struct btrfs_root *root, 2501 struct inode *inode, u64 new_size, 2502 u32 min_type); 2503 2504int btrfs_start_delalloc_inodes(struct btrfs_root *root, int delay_iput); |
2505int btrfs_start_one_delalloc_inode(struct btrfs_root *root, int delay_iput, 2506 int sync); |
|
2510int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end, 2511 struct extent_state **cached_state); 2512int btrfs_writepages(struct address_space *mapping, 2513 struct writeback_control *wbc); 2514int btrfs_create_subvol_root(struct btrfs_trans_handle *trans, 2515 struct btrfs_root *new_root, 2516 u64 new_dirid, u64 alloc_hint); 2517int btrfs_merge_bio_hook(struct page *page, unsigned long offset, 2518 size_t size, struct bio *bio, unsigned long bio_flags); 2519 2520unsigned long btrfs_force_ra(struct address_space *mapping, 2521 struct file_ra_state *ra, struct file *file, 2522 pgoff_t offset, pgoff_t last_index); 2523int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); 2524int btrfs_readpage(struct file *file, struct page *page); 2525void btrfs_evict_inode(struct inode *inode); | 2507int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end, 2508 struct extent_state **cached_state); 2509int btrfs_writepages(struct address_space *mapping, 2510 struct writeback_control *wbc); 2511int btrfs_create_subvol_root(struct btrfs_trans_handle *trans, 2512 struct btrfs_root *new_root, 2513 u64 new_dirid, u64 alloc_hint); 2514int btrfs_merge_bio_hook(struct page *page, unsigned long offset, 2515 size_t size, struct bio *bio, unsigned long bio_flags); 2516 2517unsigned long btrfs_force_ra(struct address_space *mapping, 2518 struct file_ra_state *ra, struct file *file, 2519 pgoff_t offset, pgoff_t last_index); 2520int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); 2521int btrfs_readpage(struct file *file, struct page *page); 2522void btrfs_evict_inode(struct inode *inode); |
2523void btrfs_put_inode(struct inode *inode); |
|
2526int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc); | 2524int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc); |
2527void btrfs_dirty_inode(struct inode *inode); | 2525void btrfs_dirty_inode(struct inode *inode, int flags); |
2528struct inode *btrfs_alloc_inode(struct super_block *sb); 2529void btrfs_destroy_inode(struct inode *inode); 2530int btrfs_drop_inode(struct inode *inode); 2531int btrfs_init_cachep(void); 2532void btrfs_destroy_cachep(void); 2533long btrfs_ioctl_trans_end(struct file *file); 2534struct inode *btrfs_iget(struct super_block *s, struct btrfs_key *location, 2535 struct btrfs_root *root, int *was_new); | 2526struct inode *btrfs_alloc_inode(struct super_block *sb); 2527void btrfs_destroy_inode(struct inode *inode); 2528int btrfs_drop_inode(struct inode *inode); 2529int btrfs_init_cachep(void); 2530void btrfs_destroy_cachep(void); 2531long btrfs_ioctl_trans_end(struct file *file); 2532struct inode *btrfs_iget(struct super_block *s, struct btrfs_key *location, 2533 struct btrfs_root *root, int *was_new); |
2534int btrfs_commit_write(struct file *file, struct page *page, 2535 unsigned from, unsigned to); |
|
2536struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page, | 2536struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page, |
2537 size_t pg_offset, u64 start, u64 end, | 2537 size_t page_offset, u64 start, u64 end, |
2538 int create); 2539int btrfs_update_inode(struct btrfs_trans_handle *trans, 2540 struct btrfs_root *root, 2541 struct inode *inode); 2542int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode); 2543int btrfs_orphan_del(struct btrfs_trans_handle *trans, struct inode *inode); 2544int btrfs_orphan_cleanup(struct btrfs_root *root); 2545void btrfs_orphan_pre_snapshot(struct btrfs_trans_handle *trans, --- 15 unchanged lines hidden (view full) --- 2561 u64 start, u64 num_bytes, u64 min_size, 2562 loff_t actual_len, u64 *alloc_hint); 2563extern const struct dentry_operations btrfs_dentry_operations; 2564 2565/* ioctl.c */ 2566long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg); 2567void btrfs_update_iflags(struct inode *inode); 2568void btrfs_inherit_iflags(struct inode *inode, struct inode *dir); | 2538 int create); 2539int btrfs_update_inode(struct btrfs_trans_handle *trans, 2540 struct btrfs_root *root, 2541 struct inode *inode); 2542int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode); 2543int btrfs_orphan_del(struct btrfs_trans_handle *trans, struct inode *inode); 2544int btrfs_orphan_cleanup(struct btrfs_root *root); 2545void btrfs_orphan_pre_snapshot(struct btrfs_trans_handle *trans, --- 15 unchanged lines hidden (view full) --- 2561 u64 start, u64 num_bytes, u64 min_size, 2562 loff_t actual_len, u64 *alloc_hint); 2563extern const struct dentry_operations btrfs_dentry_operations; 2564 2565/* ioctl.c */ 2566long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg); 2567void btrfs_update_iflags(struct inode *inode); 2568void btrfs_inherit_iflags(struct inode *inode, struct inode *dir); |
2569int btrfs_defrag_file(struct inode *inode, struct file *file, 2570 struct btrfs_ioctl_defrag_range_args *range, 2571 u64 newer_than, unsigned long max_pages); | 2569 |
2572/* file.c */ | 2570/* file.c */ |
2573int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, 2574 struct inode *inode); 2575int btrfs_run_defrag_inodes(struct btrfs_fs_info *fs_info); | |
2576int btrfs_sync_file(struct file *file, int datasync); 2577int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end, 2578 int skip_pinned); | 2571int btrfs_sync_file(struct file *file, int datasync); 2572int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end, 2573 int skip_pinned); |
2574int btrfs_check_file(struct btrfs_root *root, struct inode *inode); |
|
2579extern const struct file_operations btrfs_file_operations; 2580int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode, 2581 u64 start, u64 end, u64 *hint_byte, int drop_cache); 2582int btrfs_mark_extent_written(struct btrfs_trans_handle *trans, 2583 struct inode *inode, u64 start, u64 end); 2584int btrfs_release_file(struct inode *inode, struct file *file); 2585void btrfs_drop_pages(struct page **pages, size_t num_pages); 2586int btrfs_dirty_pages(struct btrfs_root *root, struct inode *inode, 2587 struct page **pages, size_t num_pages, 2588 loff_t pos, size_t write_bytes, 2589 struct extent_state **cached); 2590 2591/* tree-defrag.c */ 2592int btrfs_defrag_leaves(struct btrfs_trans_handle *trans, 2593 struct btrfs_root *root, int cache_only); 2594 2595/* sysfs.c */ 2596int btrfs_init_sysfs(void); 2597void btrfs_exit_sysfs(void); | 2575extern const struct file_operations btrfs_file_operations; 2576int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode, 2577 u64 start, u64 end, u64 *hint_byte, int drop_cache); 2578int btrfs_mark_extent_written(struct btrfs_trans_handle *trans, 2579 struct inode *inode, u64 start, u64 end); 2580int btrfs_release_file(struct inode *inode, struct file *file); 2581void btrfs_drop_pages(struct page **pages, size_t num_pages); 2582int btrfs_dirty_pages(struct btrfs_root *root, struct inode *inode, 2583 struct page **pages, size_t num_pages, 2584 loff_t pos, size_t write_bytes, 2585 struct extent_state **cached); 2586 2587/* tree-defrag.c */ 2588int btrfs_defrag_leaves(struct btrfs_trans_handle *trans, 2589 struct btrfs_root *root, int cache_only); 2590 2591/* sysfs.c */ 2592int btrfs_init_sysfs(void); 2593void btrfs_exit_sysfs(void); |
2594int btrfs_sysfs_add_super(struct btrfs_fs_info *fs); 2595int btrfs_sysfs_add_root(struct btrfs_root *root); 2596void btrfs_sysfs_del_root(struct btrfs_root *root); 2597void btrfs_sysfs_del_super(struct btrfs_fs_info *root); |
|
2598 2599/* xattr.c */ 2600ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size); 2601 2602/* super.c */ 2603int btrfs_parse_options(struct btrfs_root *root, char *options); 2604int btrfs_sync_fs(struct super_block *sb, int wait); 2605void __btrfs_std_error(struct btrfs_fs_info *fs_info, const char *function, --- 26 unchanged lines hidden (view full) --- 2632void btrfs_reloc_cow_block(struct btrfs_trans_handle *trans, 2633 struct btrfs_root *root, struct extent_buffer *buf, 2634 struct extent_buffer *cow); 2635void btrfs_reloc_pre_snapshot(struct btrfs_trans_handle *trans, 2636 struct btrfs_pending_snapshot *pending, 2637 u64 *bytes_to_reserve); 2638void btrfs_reloc_post_snapshot(struct btrfs_trans_handle *trans, 2639 struct btrfs_pending_snapshot *pending); | 2598 2599/* xattr.c */ 2600ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size); 2601 2602/* super.c */ 2603int btrfs_parse_options(struct btrfs_root *root, char *options); 2604int btrfs_sync_fs(struct super_block *sb, int wait); 2605void __btrfs_std_error(struct btrfs_fs_info *fs_info, const char *function, --- 26 unchanged lines hidden (view full) --- 2632void btrfs_reloc_cow_block(struct btrfs_trans_handle *trans, 2633 struct btrfs_root *root, struct extent_buffer *buf, 2634 struct extent_buffer *cow); 2635void btrfs_reloc_pre_snapshot(struct btrfs_trans_handle *trans, 2636 struct btrfs_pending_snapshot *pending, 2637 u64 *bytes_to_reserve); 2638void btrfs_reloc_post_snapshot(struct btrfs_trans_handle *trans, 2639 struct btrfs_pending_snapshot *pending); |
2640 2641/* scrub.c */ 2642int btrfs_scrub_dev(struct btrfs_root *root, u64 devid, u64 start, u64 end, 2643 struct btrfs_scrub_progress *progress, int readonly); 2644int btrfs_scrub_pause(struct btrfs_root *root); 2645int btrfs_scrub_pause_super(struct btrfs_root *root); 2646int btrfs_scrub_continue(struct btrfs_root *root); 2647int btrfs_scrub_continue_super(struct btrfs_root *root); 2648int btrfs_scrub_cancel(struct btrfs_root *root); 2649int btrfs_scrub_cancel_dev(struct btrfs_root *root, struct btrfs_device *dev); 2650int btrfs_scrub_cancel_devid(struct btrfs_root *root, u64 devid); 2651int btrfs_scrub_progress(struct btrfs_root *root, u64 devid, 2652 struct btrfs_scrub_progress *progress); 2653 | |
2654#endif | 2640#endif |