Commit Graph

10 Commits (1eb159a295261c56d14b962eb3d4763f8ce38807)

Author SHA1 Message Date
Eric Sandeen fa25b35dcc btrfs-progs: mark static & remove unused from non-kernel code
Mark many functions as static, and remove any resulting dead code.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
2013-09-03 19:40:54 +02:00
Qu Wenruo 7ea01da9c8 btrfs-progs: Fix the return value of btrfs-map-logical
The ret variant in the main function is not changed so even problems
happen, return value is still 0.
The patch fixs the minor bug and return 1 if any problems happen.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
2013-09-03 19:40:50 +02:00
Wang Shilong af6c1650cf Btrfs-progs: make btrfs-map-logical handle error gracefully
If an overflow logical address is passed(for example),the original
code will cause segmentation, this is unfriendly to users,fix it.

Signed-off-by: Wang Shilong<wangsl.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
2013-08-09 14:32:37 +02:00
David Woodhouse 4d48b96b28 Add basic RAID[56] support
David Woodhouse originally contributed this code, and Chris Mason
changed it around to reflect the current design goals for raid56.

The original code expected all metadata and data writes to be full
stripes.  This meant metadata block size == stripe size, and had a few
other restrictions.

This version allows metadata blocks smaller than the stripe size.  It
implements both raid5 and raid6, although it does not have code to
rebuild from parity if one of the drives is missing or incorrect.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
2013-02-01 14:22:07 -05:00
Miao Xie 06cf101a28 Btrfs-progs, btrfs-map-logical: Fix typo in usage
The right option is 'o' not 'c'. And this tool is used for the block devices
on which there is a btrfs file system, so change "mount_point" to "device".

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
2012-07-03 16:27:46 -04:00
Arne Jansen 48d29930ed btrfs-map-logical: segfaults when no output file is given
when no output file is given, info_file stays NULL and the following
fprintf segfaults. Default to stdout.

Signed-off-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:58 -04:00
Anton Blanchard fa81a569ac btrfs-progs: cast u64 to long long to avoid printf warnings
When building on ppc64 I hit a number of warnings in printf:

btrfs-map-logical.c:69: error: format ‘%Lu’ expects type ‘long long
unsigned int’, but argument 4 has type ‘u64’

Fix them.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:57 -04:00
Chris Ball fcdc0929c6 Fix unused-but-set errors in gcc-4.6
gcc-4.6 (as shipped in Fedora) turns on -Wunused-but-set-variable by
default, which breaks the build when combined with -Wall, e.g.:

debug-tree.c: In function ‘print_extent_leaf’:
debug-tree.c:45:13: error: variable ‘last_len’ set but not used [-Werror=unused-but-set-variable]
debug-tree.c:44:13: error: variable ‘last’ set but not used [-Werror=unused-but-set-variable]
debug-tree.c:41:21: error: variable ‘item’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

This patch fixes the errors by removing the unused variables.

Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:32 -04:00
Chris Mason 375714fe11 Fix the help text for btrfs-map-logical
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2011-04-22 14:52:28 -04:00
Chris Mason ab8fb4c995 Add btrfs-map-logical program to map and read logical block numbers
This allows us to figure out which physical byte offset on which device
is the real location for a given logical block number.  It can
optionally read the block in and save it to a file for debugging
analysis.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-11-12 14:49:03 -05:00