summaryrefslogtreecommitdiff
path: root/e2fsprogs/ext2fs/irel_ma.c
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsprogs/ext2fs/irel_ma.c')
-rw-r--r--e2fsprogs/ext2fs/irel_ma.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/e2fsprogs/ext2fs/irel_ma.c b/e2fsprogs/ext2fs/irel_ma.c
index eedbe55..d9e73f7 100644
--- a/e2fsprogs/ext2fs/irel_ma.c
+++ b/e2fsprogs/ext2fs/irel_ma.c
@@ -1,6 +1,6 @@
/*
* irel_ma.c
- *
+ *
* Copyright (C) 1996, 1997 Theodore Ts'o.
*
* %Begin-Header%
@@ -64,7 +64,7 @@ errcode_t ext2fs_irel_memarray_create(char *name, ext2_ino_t max_inode,
{
ext2_irel irel = 0;
errcode_t retval;
- struct irel_ma *ma = 0;
+ struct irel_ma *ma = 0;
size_t size;
*new_irel = 0;
@@ -77,18 +77,18 @@ errcode_t ext2fs_irel_memarray_create(char *name, ext2_ino_t max_inode,
if (retval)
goto errout;
memset(irel, 0, sizeof(struct ext2_inode_relocation_table));
-
+
retval = ext2fs_get_mem(strlen(name)+1, &irel->name);
if (retval)
goto errout;
strcpy(irel->name, name);
-
+
retval = ext2fs_get_mem(sizeof(struct irel_ma), &ma);
if (retval)
goto errout;
memset(ma, 0, sizeof(struct irel_ma));
irel->priv_data = ma;
-
+
size = (size_t) (sizeof(ext2_ino_t) * (max_inode+1));
retval = ext2fs_get_mem(size, &ma->orig_map);
if (retval)
@@ -124,7 +124,7 @@ errcode_t ext2fs_irel_memarray_create(char *name, ext2_ino_t max_inode,
irel->move = ima_move;
irel->delete = ima_delete;
irel->free = ima_free;
-
+
*new_irel = irel;
return 0;
@@ -137,7 +137,7 @@ static errcode_t ima_put(ext2_irel irel, ext2_ino_t old,
struct ext2_inode_relocate_entry *ent)
{
struct inode_reference_entry *ref_ent;
- struct irel_ma *ma;
+ struct irel_ma *ma;
errcode_t retval;
size_t size, old_size;
@@ -153,7 +153,7 @@ static errcode_t ima_put(ext2_irel irel, ext2_ino_t old,
ent->orig = old;
else
ent->orig = ma->entries[(unsigned) old].orig;
-
+
/*
* If max_refs has changed, reallocate the refs array
*/
@@ -176,7 +176,7 @@ static errcode_t ima_put(ext2_irel irel, ext2_ino_t old,
static errcode_t ima_get(ext2_irel irel, ext2_ino_t old,
struct ext2_inode_relocate_entry *ent)
{
- struct irel_ma *ma;
+ struct irel_ma *ma;
ma = irel->priv_data;
if (old > ma->max_inode)
@@ -190,7 +190,7 @@ static errcode_t ima_get(ext2_irel irel, ext2_ino_t old,
static errcode_t ima_get_by_orig(ext2_irel irel, ext2_ino_t orig, ext2_ino_t *old,
struct ext2_inode_relocate_entry *ent)
{
- struct irel_ma *ma;
+ struct irel_ma *ma;
ext2_ino_t ino;
ma = irel->priv_data;
@@ -213,7 +213,7 @@ static errcode_t ima_start_iter(ext2_irel irel)
static errcode_t ima_next(ext2_irel irel, ext2_ino_t *old,
struct ext2_inode_relocate_entry *ent)
{
- struct irel_ma *ma;
+ struct irel_ma *ma;
ma = irel->priv_data;
while (++irel->current < ma->max_inode) {
@@ -230,7 +230,7 @@ static errcode_t ima_next(ext2_irel irel, ext2_ino_t *old,
static errcode_t ima_add_ref(ext2_irel irel, ext2_ino_t ino,
struct ext2_inode_reference *ref)
{
- struct irel_ma *ma;
+ struct irel_ma *ma;
size_t size;
struct inode_reference_entry *ref_ent;
struct ext2_inode_relocate_entry *ent;
@@ -242,12 +242,12 @@ static errcode_t ima_add_ref(ext2_irel irel, ext2_ino_t ino,
ref_ent = ma->ref_entries + (unsigned) ino;
ent = ma->entries + (unsigned) ino;
-
+
/*
* If the inode reference array doesn't exist, create it.
*/
if (ref_ent->refs == 0) {
- size = (size_t) ((sizeof(struct ext2_inode_reference) *
+ size = (size_t) ((sizeof(struct ext2_inode_reference) *
ent->max_refs));
retval = ext2fs_get_mem(size, &ref_ent->refs);
if (retval)
@@ -265,7 +265,7 @@ static errcode_t ima_add_ref(ext2_irel irel, ext2_ino_t ino,
static errcode_t ima_start_iter_ref(ext2_irel irel, ext2_ino_t ino)
{
- struct irel_ma *ma;
+ struct irel_ma *ma;
ma = irel->priv_data;
if (ino > ma->max_inode)
@@ -280,11 +280,11 @@ static errcode_t ima_start_iter_ref(ext2_irel irel, ext2_ino_t ino)
static errcode_t ima_next_ref(ext2_irel irel,
struct ext2_inode_reference *ref)
{
- struct irel_ma *ma;
+ struct irel_ma *ma;
struct inode_reference_entry *ref_ent;
ma = irel->priv_data;
-
+
ref_ent = ma->ref_entries + ma->ref_current;
if ((ref_ent->refs == NULL) ||
@@ -300,19 +300,19 @@ static errcode_t ima_next_ref(ext2_irel irel,
static errcode_t ima_move(ext2_irel irel, ext2_ino_t old, ext2_ino_t new)
{
- struct irel_ma *ma;
+ struct irel_ma *ma;
ma = irel->priv_data;
if ((old > ma->max_inode) || (new > ma->max_inode))
return EXT2_ET_INVALID_ARGUMENT;
if (ma->entries[(unsigned) old].new == 0)
return ENOENT;
-
+
ma->entries[(unsigned) new] = ma->entries[(unsigned) old];
if (ma->ref_entries[(unsigned) new].refs)
ext2fs_free_mem(&ma->ref_entries[(unsigned) new].refs);
ma->ref_entries[(unsigned) new] = ma->ref_entries[(unsigned) old];
-
+
ma->entries[(unsigned) old].new = 0;
ma->ref_entries[(unsigned) old].num = 0;
ma->ref_entries[(unsigned) old].refs = 0;
@@ -323,19 +323,19 @@ static errcode_t ima_move(ext2_irel irel, ext2_ino_t old, ext2_ino_t new)
static errcode_t ima_delete(ext2_irel irel, ext2_ino_t old)
{
- struct irel_ma *ma;
+ struct irel_ma *ma;
ma = irel->priv_data;
if (old > ma->max_inode)
return EXT2_ET_INVALID_ARGUMENT;
if (ma->entries[(unsigned) old].new == 0)
return ENOENT;
-
+
ma->entries[old].new = 0;
if (ma->ref_entries[(unsigned) old].refs)
ext2fs_free_mem(&ma->ref_entries[(unsigned) old].refs);
ma->orig_map[ma->entries[(unsigned) old].orig] = 0;
-
+
ma->ref_entries[(unsigned) old].num = 0;
ma->ref_entries[(unsigned) old].refs = 0;
return 0;
@@ -343,7 +343,7 @@ static errcode_t ima_delete(ext2_irel irel, ext2_ino_t old)
static errcode_t ima_free(ext2_irel irel)
{
- struct irel_ma *ma;
+ struct irel_ma *ma;
ext2_ino_t ino;
if (!irel)