lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 31 Jul 2014 23:25:53 -0400
From:	Nick Krause <xerofoify@...il.com>
To:	"linux-btrfs@...r.kernel.org SYSTEM list:BTRFS FILE" 
	<linux-btrfs@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Help with btrfs_zero_range function

Hey Guys,
I need to ask a question again, I am writing the above function and
basing it off the one of punch hole.
I have only started writing the function and have a few questions
about how to write this. Below this message
are my questions so fair and I also posting my written code in case
you guys want to give any feed back.
Regards and Thanks Again,
Nick
Questions
1. bool no_holes = btrfs_fs_incompat(root->fs_info, NO_HOLES);
   How I change this to check for a zero range or do I just remove
this variable;
2. ret = find_first_non_hole(inode, &offset, &len);
    How do I modify the called function for ret to be for a zero range?
The other parts of this function  are pretty similar to the one for
punch holes and seems pretty easy
to move other the other parts.
Code

static long btrfs_zero_range(struct inode *inode, loff_t loffset,
loff_t len,){
    struct btrfs_root *root = BTRF_I(inode)->root;
    struct btrfs_path *path;
    struct btrfs_block_rsv *rsv;
    struct btrfs_trans_handle *trans;
     u64 lockstart;
     u64 lockend;
     u64 tail_start;
     u64 tail_len;
     u64 orig_start = offset;
    u64 cur_offset;
    u64 min_size = btrfs_calc_trunc_metadata_size(root, 1);
    u64 drop_end;
    int ret = 0;
     int err = 0;
     int rsv_count;
     bool same_page;
     bool no_holes = btrfs_fs_incompat(root->fs_info, NO_HOLES);
     u64 ino_size;
    ret=btrfs_wait_ordered_range(inode, offset, len);
    if(ret)
        return ret;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ