0001
0002
0003 #ifndef BTRFS_INODE_ITEM_H
0004 #define BTRFS_INODE_ITEM_H
0005
0006 #include <linux/types.h>
0007
0008 struct btrfs_trans_handle;
0009 struct btrfs_root;
0010 struct btrfs_path;
0011 struct btrfs_key;
0012 struct btrfs_inode_extref;
0013 struct btrfs_inode;
0014 struct extent_buffer;
0015
0016
0017
0018
0019
0020 #define BTRFS_NEED_TRUNCATE_BLOCK 1
0021
0022 struct btrfs_truncate_control {
0023
0024
0025
0026
0027 struct btrfs_inode *inode;
0028
0029
0030 u64 new_size;
0031
0032
0033 u64 extents_found;
0034
0035
0036 u64 last_size;
0037
0038
0039 u64 sub_bytes;
0040
0041
0042 u64 ino;
0043
0044
0045
0046
0047
0048 u32 min_type;
0049
0050
0051
0052
0053
0054 bool skip_ref_updates;
0055
0056
0057
0058
0059
0060 bool clear_extent_range;
0061 };
0062
0063 int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
0064 struct btrfs_root *root,
0065 struct btrfs_truncate_control *control);
0066 int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans,
0067 struct btrfs_root *root,
0068 const char *name, int name_len,
0069 u64 inode_objectid, u64 ref_objectid, u64 index);
0070 int btrfs_del_inode_ref(struct btrfs_trans_handle *trans,
0071 struct btrfs_root *root,
0072 const char *name, int name_len,
0073 u64 inode_objectid, u64 ref_objectid, u64 *index);
0074 int btrfs_insert_empty_inode(struct btrfs_trans_handle *trans,
0075 struct btrfs_root *root,
0076 struct btrfs_path *path, u64 objectid);
0077 int btrfs_lookup_inode(struct btrfs_trans_handle *trans, struct btrfs_root
0078 *root, struct btrfs_path *path,
0079 struct btrfs_key *location, int mod);
0080
0081 struct btrfs_inode_extref *btrfs_lookup_inode_extref(
0082 struct btrfs_trans_handle *trans,
0083 struct btrfs_root *root,
0084 struct btrfs_path *path,
0085 const char *name, int name_len,
0086 u64 inode_objectid, u64 ref_objectid, int ins_len,
0087 int cow);
0088
0089 struct btrfs_inode_ref *btrfs_find_name_in_backref(struct extent_buffer *leaf,
0090 int slot, const char *name,
0091 int name_len);
0092 struct btrfs_inode_extref *btrfs_find_name_in_ext_backref(
0093 struct extent_buffer *leaf, int slot, u64 ref_objectid,
0094 const char *name, int name_len);
0095
0096 #endif