Merge lp:~jm-leddy/ubuntu/precise/partman-base/4k-sectors into lp:~ubuntu-core-dev/partman-base/precise-proposed

Proposed by James M. Leddy
Status: Merged
Merged at revision: 1368
Proposed branch: lp:~jm-leddy/ubuntu/precise/partman-base/4k-sectors
Merge into: lp:~ubuntu-core-dev/partman-base/precise-proposed
Diff against target: 157 lines (+34/-30)
3 files modified
debian/changelog (+7/-3)
parted_devices.c (+1/-1)
parted_server.c (+26/-26)
To merge this branch: bzr merge lp:~jm-leddy/ubuntu/precise/partman-base/4k-sectors
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+179559@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-07-02 14:00:04 +0000
3+++ debian/changelog 2013-08-10 01:03:33 +0000
4@@ -1,3 +1,10 @@
5+partman-base (153ubuntu6) precise-proposed; urgency=low
6+
7+ * Use the device's logical sector size throughout rather than
8+ PED_SECTOR_SIZE_DEFAULT (LP: #1065281).
9+
10+ -- James M Leddy <james.leddy@canonical.com> Fri, 09 Aug 2013 20:38:09 -0400
11+
12 partman-base (153ubuntu5) precise-proposed; urgency=low
13
14 * Permit non-cylinder alignment again on GPT (closes: #674894,
15@@ -4488,6 +4495,3 @@
16
17 -- Anton Zinoviev <zinoviev@debian.org> Wed, 27 Aug 2003 07:03:28 +0200
18
19-Local Variables:
20-coding: utf-8
21-End:
22
23=== modified file 'parted_devices.c'
24--- parted_devices.c 2011-09-23 14:31:46 +0000
25+++ parted_devices.c 2013-08-10 01:03:33 +0000
26@@ -82,7 +82,7 @@
27 return;
28 printf("%s\t%lli\t%s\n",
29 dev->path,
30- dev->length * PED_SECTOR_SIZE_DEFAULT,
31+ dev->length * dev->sector_size,
32 dev->model);
33 }
34
35
36=== modified file 'parted_server.c'
37--- parted_server.c 2012-07-02 13:54:37 +0000
38+++ parted_server.c 2013-08-10 01:03:33 +0000
39@@ -1061,8 +1061,8 @@
40 log("partition_with_id(%s)", id);
41 if (2 != sscanf(id, "%lli-%lli", &start, &end))
42 critical_error("Bad id %s", id);
43- start_sector = start / PED_SECTOR_SIZE_DEFAULT;
44- end_sector = (end - PED_SECTOR_SIZE_DEFAULT + 1) / PED_SECTOR_SIZE_DEFAULT;
45+ start_sector = start / disk->dev->sector_size;
46+ end_sector = (end - disk->dev->sector_size + 1) / disk->dev->sector_size;
47 if (disk == NULL)
48 return NULL;
49 for (part = NULL;
50@@ -1147,9 +1147,9 @@
51 name = "";
52 result = xasprintf("%i\t%lli-%lli\t%lli\t%s\t%s\t%s\t%s",
53 part->num,
54- (part->geom).start * PED_SECTOR_SIZE_DEFAULT,
55- (part->geom).end * PED_SECTOR_SIZE_DEFAULT + PED_SECTOR_SIZE_DEFAULT - 1,
56- (part->geom).length * PED_SECTOR_SIZE_DEFAULT, type, fs, path, name);
57+ (part->geom).start * disk->dev->sector_size,
58+ (part->geom).end * disk->dev->sector_size + disk->dev->sector_size - 1,
59+ (part->geom).length * disk->dev->sector_size, type, fs, path, name);
60 free(path);
61 return result;
62 }
63@@ -2026,16 +2026,16 @@
64 free(s_fs_type);
65
66 if (!strcasecmp(position, "full")) {
67- part_start = range_start / PED_SECTOR_SIZE_DEFAULT;
68- part_end = ((range_end - PED_SECTOR_SIZE_DEFAULT + 1)
69- / PED_SECTOR_SIZE_DEFAULT);
70+ part_start = range_start / dev->sector_size;
71+ part_end = ((range_end - dev->sector_size + 1)
72+ / dev->sector_size);
73 } else if (!strcasecmp(position, "beginning")) {
74- part_start = range_start / PED_SECTOR_SIZE_DEFAULT;
75- part_end = (range_start + length) / PED_SECTOR_SIZE_DEFAULT;
76+ part_start = range_start / dev->sector_size;
77+ part_end = (range_start + length) / dev->sector_size;
78 } else if (!strcasecmp(position, "end")) {
79- part_start = (range_end - length) / PED_SECTOR_SIZE_DEFAULT;
80- part_end = ((range_end - PED_SECTOR_SIZE_DEFAULT + 1)
81- / PED_SECTOR_SIZE_DEFAULT);
82+ part_start = (range_end - length) / dev->sector_size;
83+ part_end = ((range_end - dev->sector_size + 1)
84+ / dev->sector_size);
85 } else
86 critical_error("Bad position: %s", position);
87 free(position);
88@@ -2113,7 +2113,7 @@
89 critical_error("Expected new size");
90 log("New size: %lli", new_size);
91 start = (part->geom).start;
92- end = start + new_size / PED_SECTOR_SIZE_DEFAULT - 1;
93+ end = start + new_size / dev->sector_size - 1;
94 if (named_partition_is_virtual(device_name,
95 part->geom.start, part->geom.end)) {
96 resize_partition(disk, part, start, end, false);
97@@ -2124,8 +2124,8 @@
98 }
99 }
100 oprintf("OK\n");
101- oprintf("%lli-%lli\n", (part->geom).start * PED_SECTOR_SIZE_DEFAULT,
102- (part->geom).end * PED_SECTOR_SIZE_DEFAULT + PED_SECTOR_SIZE_DEFAULT - 1);
103+ oprintf("%lli-%lli\n", (part->geom).start * dev->sector_size,
104+ (part->geom).end * dev->sector_size + dev->sector_size - 1);
105 free(id);
106 }
107
108@@ -2153,17 +2153,17 @@
109 critical_error("Expected new size");
110 log("New size: %lli", new_size);
111 start = (part->geom).start;
112- end = start + new_size / PED_SECTOR_SIZE_DEFAULT - 1;
113+ end = start + new_size / dev->sector_size - 1;
114 /* ensure that the size is not less than the requested */
115 do {
116 resize_partition(disk, part, start, end, false);
117 end = end + 1;
118- } while ((part->geom).length * PED_SECTOR_SIZE_DEFAULT < new_size);
119+ } while ((part->geom).length * dev->sector_size < new_size);
120 ped_disk_commit(disk);
121 unchange_named(device_name);
122 oprintf("OK\n");
123- oprintf("%lli-%lli\n", (part->geom).start * PED_SECTOR_SIZE_DEFAULT,
124- (part->geom).end * PED_SECTOR_SIZE_DEFAULT + PED_SECTOR_SIZE_DEFAULT - 1);
125+ oprintf("%lli-%lli\n", (part->geom).start * dev->sector_size,
126+ (part->geom).end * dev->sector_size + dev->sector_size - 1);
127 free(id);
128 }
129
130@@ -2219,10 +2219,10 @@
131 max_geom = ped_disk_get_max_partition_geometry(disk, part, constraint);
132 if (part->type & PED_PARTITION_LOGICAL)
133 minimize_extended_partition(disk);
134- min_size = constraint->min_size * PED_SECTOR_SIZE_DEFAULT;
135- current_size = (part->geom).length * PED_SECTOR_SIZE_DEFAULT;
136+ min_size = constraint->min_size * dev->sector_size;
137+ current_size = (part->geom).length * dev->sector_size;
138 if (max_geom)
139- max_size = max_geom->length * PED_SECTOR_SIZE_DEFAULT;
140+ max_size = max_geom->length * dev->sector_size;
141 else
142 max_size = current_size;
143 oprintf("OK\n");
144@@ -2263,10 +2263,10 @@
145 max_geom = ped_disk_get_max_partition_geometry(disk, part, constraint);
146 if (part->type & PED_PARTITION_LOGICAL)
147 minimize_extended_partition(disk);
148- min_size = constraint->min_size * PED_SECTOR_SIZE_DEFAULT;
149- current_size = (part->geom).length * PED_SECTOR_SIZE_DEFAULT;
150+ min_size = constraint->min_size * dev->sector_size;
151+ current_size = (part->geom).length * dev->sector_size;
152 if (max_geom)
153- max_size = max_geom->length * PED_SECTOR_SIZE_DEFAULT;
154+ max_size = max_geom->length * dev->sector_size;
155 else
156 max_size = current_size;
157 oprintf("OK\n");

Subscribers

People subscribed via source and target branches