From: Li Zefan Date: Thu, 1 Dec 2011 06:06:42 +0000 (+0800) Subject: Btrfs: simplfy calculation of stripe length for discard operation X-Git-Tag: v3.3-rc1~26^2~11^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec9ef7a13be4dcce964c8503e8999087945e5b9e;p=pandora-kernel.git Btrfs: simplfy calculation of stripe length for discard operation For btrfs raid, while discarding a range of space, we'll need to know the start offset and length to discard for each device, and it's done in btrfs_map_block(). However the calculation is a bit complex for raid0 and raid10, so I reimplement it based on a fact that: dev1 dev2 dev3 (raid0) ----------------------------------- s0 s3 s6 s1 s4 s7 s2 s5 Each device has (total_stripes / nr_dev) stripes, or plus one. Signed-off-by: Li Zefan --- Reading git-diff-tree failed