Skip to content

Commit eb507bc

Browse files
author
Boaz Harrosh
committed
ore: Make ore_striping_info and ore_calc_stripe_info public
The struct ore_striping_info will be used later in other structures. And ore_calc_stripe_info as well. Rename them make struct ore_striping_info public. ore_calc_stripe_info is still static, will be made public on first use. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
1 parent 8d2d83a commit eb507bc

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

‎fs/exofs/ore.c‎

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -287,16 +287,8 @@ EXPORT_SYMBOL(ore_check_io);
287287
*
288288
* O = L % stripe_unit + N * stripe_unit + M * group_depth * stripe_unit
289289
*/
290-
struct _striping_info {
291-
u64 obj_offset;
292-
u64 group_length;
293-
u64 M; /* for truncate */
294-
unsigned dev;
295-
unsigned unit_off;
296-
};
297-
298-
static void _calc_stripe_info(struct ore_layout *layout, u64 file_offset,
299-
struct _striping_info *si)
290+
static void ore_calc_stripe_info(struct ore_layout *layout, u64 file_offset,
291+
struct ore_striping_info *si)
300292
{
301293
u32 stripe_unit = layout->stripe_unit;
302294
u32 group_width = layout->group_width;
@@ -375,7 +367,7 @@ static int _add_stripe_unit(struct ore_io_state *ios, unsigned *cur_pg,
375367
}
376368

377369
static int _prepare_one_group(struct ore_io_state *ios, u64 length,
378-
struct _striping_info *si)
370+
struct ore_striping_info *si)
379371
{
380372
unsigned stripe_unit = ios->layout->stripe_unit;
381373
unsigned mirrors_p1 = ios->layout->mirrors_p1;
@@ -434,14 +426,14 @@ static int _prepare_for_striping(struct ore_io_state *ios)
434426
{
435427
u64 length = ios->length;
436428
u64 offset = ios->offset;
437-
struct _striping_info si;
429+
struct ore_striping_info si;
438430
int ret = 0;
439431

440432
if (!ios->pages) {
441433
if (ios->kern_buff) {
442434
struct ore_per_dev_state *per_dev = &ios->per_dev[0];
443435

444-
_calc_stripe_info(ios->layout, ios->offset, &si);
436+
ore_calc_stripe_info(ios->layout, ios->offset, &si);
445437
per_dev->offset = si.obj_offset;
446438
per_dev->dev = si.dev;
447439

@@ -455,7 +447,7 @@ static int _prepare_for_striping(struct ore_io_state *ios)
455447
}
456448

457449
while (length) {
458-
_calc_stripe_info(ios->layout, offset, &si);
450+
ore_calc_stripe_info(ios->layout, offset, &si);
459451

460452
if (length < si.group_length)
461453
si.group_length = length;
@@ -744,7 +736,7 @@ static int _truncate_mirrors(struct ore_io_state *ios, unsigned cur_comp,
744736
}
745737

746738
struct _trunc_info {
747-
struct _striping_info si;
739+
struct ore_striping_info si;
748740
u64 prev_group_obj_off;
749741
u64 next_group_obj_off;
750742

@@ -758,7 +750,7 @@ static void _calc_trunk_info(struct ore_layout *layout, u64 file_offset,
758750
{
759751
unsigned stripe_unit = layout->stripe_unit;
760752

761-
_calc_stripe_info(layout, file_offset, &ti->si);
753+
ore_calc_stripe_info(layout, file_offset, &ti->si);
762754

763755
ti->prev_group_obj_off = ti->si.M * stripe_unit;
764756
ti->next_group_obj_off = ti->si.M ? (ti->si.M - 1) * stripe_unit : 0;

‎include/scsi/osd_ore.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ struct ore_components {
5656
struct osd_dev **ods; /* osd_dev array */
5757
};
5858

59+
struct ore_striping_info {
60+
u64 obj_offset;
61+
u64 group_length;
62+
u64 M; /* for truncate */
63+
unsigned dev;
64+
unsigned unit_off;
65+
};
66+
5967
struct ore_io_state;
6068
typedef void (*ore_io_done_fn)(struct ore_io_state *ios, void *private);
6169

0 commit comments

Comments
 (0)