search for: btrfs_dir_item

Displaying 15 results from an estimated 15 matches for "btrfs_dir_item".

2008 Jun 24
1
[RFC][PATCH] btrfs orphan code
...int btrfs_find_dead_roots(struct btrfs_r /* dir-item.c */ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, const char *name, int name_len, u64 dir, - struct btrfs_key *location, u8 type); + struct btrfs_key *location, u8 type, int index); struct btrfs_dir_item *btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, u64 dir, @@ -1513,6 +1519,15 @@ struct btrfs_dir_item *btrfs_lookup_xatt struct btrfs_path *path, u64 dir, const char *name, u16 name_len, int mod...
2010 Dec 11
1
[RFC] Improve btrfs subvolume find-new command
...ong)btrfs_stack_inode_nlink(item), + (unsigned long long)btrfs_stack_inode_uid(item), + (unsigned long long)btrfs_stack_inode_gid(item), + (unsigned long long)btrfs_stack_inode_flags(item) + ); + + return 0; +} + + +BTRFS_SETGET_STACK_FUNCS(stack_dir_name_len, + struct btrfs_dir_item, name_len, 16); +BTRFS_SETGET_STACK_FUNCS(stack_dir_data_len, + struct btrfs_dir_item, data_len, 16); +static int print_one_xattr( struct btrfs_dir_item *item ) + +{ + u32 name_len; + u32 data_len; + + name_len = btrfs_stack_dir_name_len(item); + data_len = btrfs_stack_dir_d...
2012 Jun 21
0
[RFC PATCH V2] Btrfs: introduce extent buffer cache for each i-node
...next_leaf(struct btrfs_root *root, struct btrfs_path *path); int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path, u64 time_seq); @@ -2829,7 +2853,8 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_key *location, u8 type, u64 index); struct btrfs_dir_item *btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, - struct btrfs_path *path, u64 dir, + struct inode *dir, + struct btrfs_path *path, u64 dirid, const char *name, int name_len, int mod); struct btrfs_dir_it...
2015 Sep 09
1
[PATCH v1 1/1] extlinux: fix file descriptors leak
...e); free(c32file); @@ -778,7 +779,7 @@ static char * get_default_subvol(char * rootdir, char * subvol) struct btrfs_ioctl_search_key *sk = &args.key; struct btrfs_ioctl_search_header *sh; int ret, i; - int fd; + int fd = -1; struct btrfs_root_ref *ref; struct btrfs_dir_item *dir_item; unsigned long off = 0; @@ -797,6 +798,8 @@ static char * get_default_subvol(char * rootdir, char * subvol) } if (ret <= 0) { subvol[0] = '\0'; + if (fd >= 0) + close(fd); return NULL; } @@ -831,6 +834,8 @@ static cha...
2011 Jul 12
0
[PATCH]: Use a general way to get the default subvolume for btrfs
...FO_SIZE 4096 @@ -8,6 +11,40 @@ #define BTRFS_CSUM_SIZE 32 #define BTRFS_FSID_SIZE 16 +typedef __u64 u64; +typedef __u32 u32; +typedef __u16 u16; +typedef __u8 u8; +typedef u64 __le64; +typedef u16 __le16; + +#define BTRFS_ROOT_BACKREF_KEY 144 +#define BTRFS_ROOT_TREE_DIR_OBJECTID 6ULL +#define BTRFS_DIR_ITEM_KEY 84 + +/* + * * this is used for both forward and backward root refs + * */ +struct btrfs_root_ref { + __le64 dirid; + __le64 sequence; + __le16 name_len; +} __attribute__ ((__packed__)); + +struct btrfs_disk_key { + __le64 objectid; + u8 type; +...
2012 Mar 20
13
[PATCH 0 of 3 v2] PV-GRUB: add support for ext4 and btrfs
Hi, The following patches add support for ext4 and btrfs to PV-GRUB. These patches are taken nearly verbatim from those provided by Fedora and Gentoo. We''ve been using these patches for the PV-GRUB images available in EC2 for some time now with no problems. Changes from v1: - Makefile has been changed to check the exit code from patch - The btrfs patch has been rebased to apply
2012 Aug 01
17
[PATCH] add crtime to the snapshot list
From: Anand <anand.jain@oracle.com> This patch adds creation-time to the snapshot list display, which would help user to better manage the snapshots when number of snapshots grow substantially. This patch is developed and on top of the send/receive btrfs and btrfs-progs repo at git://github.com/ablock84/linux-btrfs.git (send-v2) git://github.com/ablock84/btrfs-progs.git (send-v2)
2015 Sep 09
0
[PATCH v1 1/1] extlinux: fix memory leak
...c +++ b/extlinux/main.c @@ -779,7 +779,7 @@ static char * get_default_subvol(char * rootdir, char * subvol) struct btrfs_ioctl_search_key *sk = &args.key; struct btrfs_ioctl_search_header *sh; int ret, i; - int fd; + int fd = -1; struct btrfs_root_ref *ref; struct btrfs_dir_item *dir_item; unsigned long off = 0; @@ -1044,12 +1044,12 @@ err: } #ifndef __KLIBC__ -static const char *find_device(const char *mtab_file, dev_t dev) +static char *find_device(const char *mtab_file, dev_t dev) { struct mntent *mnt; struct stat dst; FILE *mtab; - const cha...
2011 Jun 30
9
btrfs-progs: integration branch updated
After a reorganisation of patches, and sending a bunch of them to Chris, I''ve also updated the integration branch to match that. It''s available from: http://git.darksatanic.net/repo/btrfs-progs-unstable.git/ integration-20110630 The shortlog of 17 patches in this branch beyond the ones I''ve sent to Chris is below. Hugo. Andreas Philipp (1): print parent
2010 Mar 20
2
[PATCH 4/4] btrfs-convert: split into convert/.
...; - if (ret) - goto out; - data = databuf; - datalen = bufsize; - } - strcpy(namebuf, xattr_prefix_table[name_index]); - strncat(namebuf, EXT2_EXT_ATTR_NAME(entry), entry->e_name_len); - if (name_len + datalen > BTRFS_LEAF_DATA_SIZE(root) - - sizeof(struct btrfs_item) - sizeof(struct btrfs_dir_item)) { - fprintf(stderr, "skip large xattr on inode %Lu name %.*s\n", - objectid - INO_OFFSET, name_len, namebuf); - goto out; - } - ret = btrfs_insert_xattr_item(trans, root, namebuf, name_len, - data, datalen, objectid); -out: - if (databuf) - free(databuf); - return ret; -}...
2008 Jan 07
1
[PATCH]Add rollback support for the converter
...turn 0; fail: - fprintf(stderr, "conversion abort.\n"); + fprintf(stderr, "conversion aborted.\n"); + return -1; +} + +int do_rollback(const char *devname, int force) +{ + int fd; + int ret; + int modified = 0; + struct btrfs_root *root; + struct btrfs_root *ext2_root; + struct btrfs_dir_item *dir; + struct btrfs_inode_item *inode; + struct btrfs_file_extent_item *fi; + struct btrfs_inode_timespec *tspec; + struct extent_buffer *leaf; + struct btrfs_key key; + struct btrfs_path path; + char *buf; + char *name; + u64 bytenr; + u64 num_bytes; + u64 root_dir; + u64 objectid; + u64 offset;...
2008 Jul 20
26
[PATCH] NFS support for btrfs - v2
Hi, Here''s an implementation of NFS support for btrfs. It does not work in one particular case as described in http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg00298.html. This uses the btrfs_iget helper introduced previously. Comments ? --- Signed-off-by: Balaji Rao <balajirrao@gmail.com> diff -r 3f0eee804974 Makefile --- a/Makefile Thu Jun 26 10:34:20 2008 -0400
2008 Jan 30
4
btrfs and git-reflog
I was just playing with git 1.5.3.8 and btrfs 0.11, and I noticed something odd. If I prepare a very simple repository: $ mkdir foo $ cd foo $ git init Initialized empty Git repository in .git/ $ echo hi > blort $ git add . $ git commit -m create Created initial commit 4ae9415: create 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 blort and then
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...>d_name.len); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); if (inode->i_nlink == 0) { ret = btrfs_orphan_add(trans, inode); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); } nr = trans->blocks_used; @@ -2905,7 +2905,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, btrfs_dir_item_key_to_cpu(leaf, di, &key); WARN_ON(key.type != BTRFS_ROOT_ITEM_KEY || key.objectid != objectid); ret = btrfs_delete_one_dir_name(trans, root, path, di); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); btrfs_release_path(root, path); ret = btrfs_del_root_ref(trans, root->fs_info->tr...
2011 Oct 04
68
[patch 00/65] Error handling patchset v3
Hi all - Here''s my current error handling patchset, against 3.1-rc8. Almost all of this patchset is preparing for actual error handling. Before we start in on that work, I''m trying to reduce the surface we need to worry about. It turns out that there is a ton of code that returns an error code but never actually reports an error. The patchset has grown to 65 patches. 46 of them