~ubuntu-branches/debian/jessie/btrfs-tools/jessie

« back to all changes in this revision

Viewing changes to btrfs-map-logical.c

  • Committer: Package Import Robot
  • Author(s): Dimitri John Ledkov
  • Date: 2014-04-19 12:12:11 UTC
  • mfrom: (1.2.12) (6.1.37 sid)
  • Revision ID: package-import@ubuntu.com-20140419121211-mski0g757tsdv4x1
Tags: 3.14.1-1
* New upstream release.
* Switch to git-dpm.
* Rebase and cleanup patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include "transaction.h"
32
32
#include "list.h"
33
33
#include "version.h"
 
34
#include "utils.h"
34
35
 
35
36
/* we write the mirror info to stdout unless they are dumping the data
36
37
 * to stdout
38
39
static FILE *info_file;
39
40
 
40
41
static struct extent_buffer * debug_read_block(struct btrfs_root *root,
41
 
                u64 bytenr, u32 blocksize, int copy)
 
42
                u64 bytenr, u32 blocksize, u64 copy)
42
43
{
43
44
        int ret;
44
45
        struct extent_buffer *eb;
120
121
        u64 logical = 0;
121
122
        int ret = 0;
122
123
        int option_index = 0;
123
 
        int copy = 0;
 
124
        u64 copy = 0;
124
125
        u64 bytes = 0;
125
126
        int out_fd = 0;
126
127
 
132
133
                        break;
133
134
                switch(c) {
134
135
                        case 'l':
135
 
                                logical = atoll(optarg);
136
 
                                if (logical == 0) {
137
 
                                        fprintf(stderr,
138
 
                                                "invalid extent number\n");
139
 
                                        print_usage();
140
 
                                }
 
136
                                logical = arg_strtou64(optarg);
141
137
                                break;
142
138
                        case 'c':
143
 
                                copy = atoi(optarg);
144
 
                                if (copy == 0) {
145
 
                                        fprintf(stderr,
146
 
                                                "invalid copy number\n");
147
 
                                        print_usage();
148
 
                                }
 
139
                                copy = arg_strtou64(optarg);
149
140
                                break;
150
141
                        case 'b':
151
 
                                bytes = atoll(optarg);
152
 
                                if (bytes == 0) {
153
 
                                        fprintf(stderr,
154
 
                                                "invalid byte count\n");
155
 
                                        print_usage();
156
 
                                }
 
142
                                bytes = arg_strtou64(optarg);
157
143
                                break;
158
144
                        case 'o':
159
145
                                output_file = strdup(optarg);