Skip to content

Commit

Permalink
exofs: Rename struct ore_components comps => oc
Browse files Browse the repository at this point in the history
ore_components already has a comps member so this leads
to things like comps->comps which is annoying. the name oc
was already used in new code. So rename all old usage of
ore_components comps => ore_components oc.

Signed-off-by: Boaz Harrosh <[email protected]>
  • Loading branch information
Boaz Harrosh committed Oct 3, 2011
1 parent de74b05 commit 5bf696d
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 64 deletions.
16 changes: 8 additions & 8 deletions fs/exofs/exofs.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct exofs_sb_info {
*/
struct ore_layout layout; /* Default files layout */
struct ore_comp one_comp; /* id & cred of partition id=0*/
struct ore_components comps; /* comps for the partition */
struct ore_components oc; /* comps for the partition */
struct osd_dev *_min_one_dev[1]; /* Place holder for one dev */
};

Expand All @@ -86,7 +86,7 @@ struct exofs_i_info {
uint32_t i_dir_start_lookup; /* which page to start lookup */
uint64_t i_commit_size; /* the object's written length */
struct ore_comp one_comp; /* same component for all devices */
struct ore_components comps; /* inode view of the device table */
struct ore_components oc; /* inode view of the device table */
};

static inline osd_id exofs_oi_objno(struct exofs_i_info *oi)
Expand Down Expand Up @@ -207,7 +207,7 @@ extern const struct inode_operations exofs_fast_symlink_inode_operations;
* bigger and that the device table repeats twice.
* See: exofs_read_lookup_dev_table()
*/
static inline void exofs_init_comps(struct ore_components *comps,
static inline void exofs_init_comps(struct ore_components *oc,
struct ore_comp *one_comp,
struct exofs_sb_info *sbi, osd_id oid)
{
Expand All @@ -217,13 +217,13 @@ static inline void exofs_init_comps(struct ore_components *comps,
one_comp->obj.id = oid;
exofs_make_credential(one_comp->cred, &one_comp->obj);

comps->numdevs = sbi->comps.numdevs;
comps->single_comp = EC_SINGLE_COMP;
comps->comps = one_comp;
oc->numdevs = sbi->oc.numdevs;
oc->single_comp = EC_SINGLE_COMP;
oc->comps = one_comp;

/* Round robin device view of the table */
first_dev = (dev_mod * sbi->layout.mirrors_p1) % sbi->comps.numdevs;
comps->ods = sbi->comps.ods + first_dev;
first_dev = (dev_mod * sbi->layout.mirrors_p1) % sbi->oc.numdevs;
oc->ods = sbi->oc.ods + first_dev;
}

#endif
22 changes: 11 additions & 11 deletions fs/exofs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ static int read_exec(struct page_collect *pcol)
return 0;

if (!pcol->ios) {
int ret = ore_get_rw_state(&pcol->sbi->layout, &oi->comps, true,
int ret = ore_get_rw_state(&pcol->sbi->layout, &oi->oc, true,
pcol->pg_first << PAGE_CACHE_SHIFT,
pcol->length, &pcol->ios);

Expand Down Expand Up @@ -516,7 +516,7 @@ static int write_exec(struct page_collect *pcol)
return 0;

BUG_ON(pcol->ios);
ret = ore_get_rw_state(&pcol->sbi->layout, &oi->comps, false,
ret = ore_get_rw_state(&pcol->sbi->layout, &oi->oc, false,
pcol->pg_first << PAGE_CACHE_SHIFT,
pcol->length, &pcol->ios);

Expand Down Expand Up @@ -860,7 +860,7 @@ static int _do_truncate(struct inode *inode, loff_t newsize)

inode->i_mtime = inode->i_ctime = CURRENT_TIME;

ret = ore_truncate(&sbi->layout, &oi->comps, (u64)newsize);
ret = ore_truncate(&sbi->layout, &oi->oc, (u64)newsize);
if (likely(!ret))
truncate_setsize(inode, newsize);

Expand Down Expand Up @@ -927,14 +927,14 @@ static int exofs_get_inode(struct super_block *sb, struct exofs_i_info *oi,
struct exofs_on_disk_inode_layout *layout;
int ret;

ret = ore_get_io_state(&sbi->layout, &oi->comps, &ios);
ret = ore_get_io_state(&sbi->layout, &oi->oc, &ios);
if (unlikely(ret)) {
EXOFS_ERR("%s: ore_get_io_state failed.\n", __func__);
return ret;
}

attrs[1].len = exofs_on_disk_inode_layout_size(sbi->comps.numdevs);
attrs[2].len = exofs_on_disk_inode_layout_size(sbi->comps.numdevs);
attrs[1].len = exofs_on_disk_inode_layout_size(sbi->oc.numdevs);
attrs[2].len = exofs_on_disk_inode_layout_size(sbi->oc.numdevs);

ios->in_attr = attrs;
ios->in_attr_len = ARRAY_SIZE(attrs);
Expand Down Expand Up @@ -1018,7 +1018,7 @@ struct inode *exofs_iget(struct super_block *sb, unsigned long ino)
return inode;
oi = exofs_i(inode);
__oi_init(oi);
exofs_init_comps(&oi->comps, &oi->one_comp, sb->s_fs_info,
exofs_init_comps(&oi->oc, &oi->one_comp, sb->s_fs_info,
exofs_oi_objno(oi));

/* read the inode from the osd */
Expand Down Expand Up @@ -1172,13 +1172,13 @@ struct inode *exofs_new_inode(struct inode *dir, int mode)
spin_unlock(&sbi->s_next_gen_lock);
insert_inode_hash(inode);

exofs_init_comps(&oi->comps, &oi->one_comp, sb->s_fs_info,
exofs_init_comps(&oi->oc, &oi->one_comp, sb->s_fs_info,
exofs_oi_objno(oi));
exofs_sbi_write_stats(sbi); /* Make sure new sbi->s_nextid is on disk */

mark_inode_dirty(inode);

ret = ore_get_io_state(&sbi->layout, &oi->comps, &ios);
ret = ore_get_io_state(&sbi->layout, &oi->oc, &ios);
if (unlikely(ret)) {
EXOFS_ERR("exofs_new_inode: ore_get_io_state failed\n");
return ERR_PTR(ret);
Expand Down Expand Up @@ -1267,7 +1267,7 @@ static int exofs_update_inode(struct inode *inode, int do_sync)
} else
memcpy(fcb->i_data, oi->i_data, sizeof(fcb->i_data));

ret = ore_get_io_state(&sbi->layout, &oi->comps, &ios);
ret = ore_get_io_state(&sbi->layout, &oi->oc, &ios);
if (unlikely(ret)) {
EXOFS_ERR("%s: ore_get_io_state failed.\n", __func__);
goto free_args;
Expand Down Expand Up @@ -1350,7 +1350,7 @@ void exofs_evict_inode(struct inode *inode)
/* ignore the error, attempt a remove anyway */

/* Now Remove the OSD objects */
ret = ore_get_io_state(&sbi->layout, &oi->comps, &ios);
ret = ore_get_io_state(&sbi->layout, &oi->oc, &ios);
if (unlikely(ret)) {
EXOFS_ERR("%s: ore_get_io_state failed\n", __func__);
return;
Expand Down
30 changes: 15 additions & 15 deletions fs/exofs/ore.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ MODULE_LICENSE("GPL");

static u8 *_ios_cred(struct ore_io_state *ios, unsigned index)
{
return ios->comps->comps[index & ios->comps->single_comp].cred;
return ios->oc->comps[index & ios->oc->single_comp].cred;
}

static struct osd_obj_id *_ios_obj(struct ore_io_state *ios, unsigned index)
{
return &ios->comps->comps[index & ios->comps->single_comp].obj;
return &ios->oc->comps[index & ios->oc->single_comp].obj;
}

static struct osd_dev *_ios_od(struct ore_io_state *ios, unsigned index)
{
return ios->comps->ods[index];
return ios->oc->ods[index];
}

int ore_get_rw_state(struct ore_layout *layout, struct ore_components *comps,
int ore_get_rw_state(struct ore_layout *layout, struct ore_components *oc,
bool is_reading, u64 offset, u64 length,
struct ore_io_state **pios)
{
Expand All @@ -71,16 +71,16 @@ int ore_get_rw_state(struct ore_layout *layout, struct ore_components *comps,
/*TODO: Maybe use kmem_cach per sbi of size
* exofs_io_state_size(layout->s_numdevs)
*/
ios = kzalloc(ore_io_state_size(comps->numdevs), GFP_KERNEL);
ios = kzalloc(ore_io_state_size(oc->numdevs), GFP_KERNEL);
if (unlikely(!ios)) {
ORE_DBGMSG("Failed kzalloc bytes=%d\n",
ore_io_state_size(comps->numdevs));
ore_io_state_size(oc->numdevs));
*pios = NULL;
return -ENOMEM;
}

ios->layout = layout;
ios->comps = comps;
ios->oc = oc;
ios->offset = offset;
ios->length = length;
ios->reading = is_reading;
Expand All @@ -90,10 +90,10 @@ int ore_get_rw_state(struct ore_layout *layout, struct ore_components *comps,
}
EXPORT_SYMBOL(ore_get_rw_state);

int ore_get_io_state(struct ore_layout *layout, struct ore_components *comps,
int ore_get_io_state(struct ore_layout *layout, struct ore_components *oc,
struct ore_io_state **ios)
{
return ore_get_rw_state(layout, comps, true, 0, 0, ios);
return ore_get_rw_state(layout, oc, true, 0, 0, ios);
}
EXPORT_SYMBOL(ore_get_io_state);

Expand Down Expand Up @@ -476,7 +476,7 @@ int ore_create(struct ore_io_state *ios)
{
int i, ret;

for (i = 0; i < ios->comps->numdevs; i++) {
for (i = 0; i < ios->oc->numdevs; i++) {
struct osd_request *or;

or = osd_start_request(_ios_od(ios, i), GFP_KERNEL);
Expand All @@ -501,7 +501,7 @@ int ore_remove(struct ore_io_state *ios)
{
int i, ret;

for (i = 0; i < ios->comps->numdevs; i++) {
for (i = 0; i < ios->oc->numdevs; i++) {
struct osd_request *or;

or = osd_start_request(_ios_od(ios, i), GFP_KERNEL);
Expand Down Expand Up @@ -768,7 +768,7 @@ static void _calc_trunk_info(struct ore_layout *layout, u64 file_offset,
ti->max_devs = layout->group_width * layout->group_count;
}

int ore_truncate(struct ore_layout *layout, struct ore_components *comps,
int ore_truncate(struct ore_layout *layout, struct ore_components *oc,
u64 size)
{
struct ore_io_state *ios;
Expand All @@ -779,7 +779,7 @@ int ore_truncate(struct ore_layout *layout, struct ore_components *comps,
struct _trunc_info ti;
int i, ret;

ret = ore_get_io_state(layout, comps, &ios);
ret = ore_get_io_state(layout, oc, &ios);
if (unlikely(ret))
return ret;

Expand All @@ -792,7 +792,7 @@ int ore_truncate(struct ore_layout *layout, struct ore_components *comps,
goto out;
}

ios->numdevs = ios->comps->numdevs;
ios->numdevs = ios->oc->numdevs;

for (i = 0; i < ti.max_devs; ++i) {
struct exofs_trunc_attr *size_attr = &size_attrs[i];
Expand All @@ -815,7 +815,7 @@ int ore_truncate(struct ore_layout *layout, struct ore_components *comps,
size_attr->attr.val_ptr = &size_attr->newsize;

ORE_DBGMSG("trunc(0x%llx) obj_offset=0x%llx dev=%d\n",
_LLU(comps->comps->obj.id), _LLU(obj_size), i);
_LLU(oc->comps->obj.id), _LLU(obj_size), i);
ret = _truncate_mirrors(ios, i * ios->layout->mirrors_p1,
&size_attr->attr);
if (unlikely(ret))
Expand Down
Loading

0 comments on commit 5bf696d

Please sign in to comment.