}
typedef struct {
- u32 *p;
- u32 key;
+ __le32 *p;
+ __le32 key;
struct buffer_head *bh;
} Indirect;
-static inline void add_chain(Indirect *p, struct buffer_head *bh, u32 *v)
+static inline void add_chain(Indirect *p, struct buffer_head *bh, __le32 *v)
{
p->key = *(p->p = v);
p->bh = bh;
read_lock(&EXT2_I(inode)->i_meta_lock);
if (!verify_chain(chain, p))
goto changed;
- add_chain(++p, bh, (u32*)bh->b_data + *++offsets);
+ add_chain(++p, bh, (__le32*)bh->b_data + *++offsets);
read_unlock(&EXT2_I(inode)->i_meta_lock);
if (!p->key)
goto no_block;
static unsigned long ext2_find_near(struct inode *inode, Indirect *ind)
{
struct ext2_inode_info *ei = EXT2_I(inode);
- u32 *start = ind->bh ? (u32*) ind->bh->b_data : ei->i_data;
- u32 *p;
+ __le32 *start = ind->bh ? (__le32 *) ind->bh->b_data : ei->i_data;
+ __le32 *p;
unsigned long bg_start;
unsigned long colour;
lock_buffer(bh);
memset(bh->b_data, 0, blocksize);
branch[n].bh = bh;
- branch[n].p = (u32*) bh->b_data + offsets[n];
+ branch[n].p = (__le32 *) bh->b_data + offsets[n];
*branch[n].p = branch[n].key;
set_buffer_uptodate(bh);
unlock_buffer(bh);
* or memcmp with zero_page, whatever is better for particular architecture.
* Linus?
*/
-static inline int all_zeroes(u32 *p, u32 *q)
+static inline int all_zeroes(__le32 *p, __le32 *q)
{
while (p < q)
if (*p++)
int depth,
int offsets[4],
Indirect chain[4],
- u32 *top)
+ __le32 *top)
{
Indirect *partial, *p;
int k, err;
write_unlock(&EXT2_I(inode)->i_meta_lock);
goto no_top;
}
- for (p=partial; p>chain && all_zeroes((u32*)p->bh->b_data,p->p); p--)
+ for (p=partial; p>chain && all_zeroes((__le32*)p->bh->b_data,p->p); p--)
;
/*
* OK, we've found the last block that must survive. The rest of our
* stored as little-endian 32-bit) and updating @inode->i_blocks
* appropriately.
*/
-static inline void ext2_free_data(struct inode *inode, u32 *p, u32 *q)
+static inline void ext2_free_data(struct inode *inode, __le32 *p, __le32 *q)
{
unsigned long block_to_free = 0, count = 0;
unsigned long nr;
* stored as little-endian 32-bit) and updating @inode->i_blocks
* appropriately.
*/
-static void ext2_free_branches(struct inode *inode, u32 *p, u32 *q, int depth)
+static void ext2_free_branches(struct inode *inode, __le32 *p, __le32 *q, int depth)
{
struct buffer_head * bh;
unsigned long nr;
continue;
}
ext2_free_branches(inode,
- (u32*)bh->b_data,
- (u32*)bh->b_data + addr_per_block,
+ (__le32*)bh->b_data,
+ (__le32*)bh->b_data + addr_per_block,
depth);
bforget(bh);
ext2_free_blocks(inode, nr, 1);
static void ext2_truncate_nocheck(struct inode * inode)
{
- u32 *i_data = EXT2_I(inode)->i_data;
+ __le32 *i_data = EXT2_I(inode)->i_data;
int addr_per_block = EXT2_ADDR_PER_BLOCK(inode->i_sb);
int offsets[4];
Indirect chain[4];
Indirect *partial;
- int nr = 0;
+ __le32 nr = 0;
int n;
long iblock;
unsigned blocksize;
while (partial > chain) {
ext2_free_branches(inode,
partial->p + 1,
- (u32*)partial->bh->b_data + addr_per_block,
+ (__le32*)partial->bh->b_data+addr_per_block,
(chain+n-1) - partial);
mark_buffer_dirty_inode(partial->bh, inode);
brelse (partial->bh);
return err;
}
-void ext2_write_inode(struct inode *inode, int wait)
+int ext2_write_inode(struct inode *inode, int wait)
{
- ext2_update_inode(inode, wait);
+ return ext2_update_inode(inode, wait);
}
int ext2_sync_inode(struct inode *inode)
oldflags = EXT2_I(inode)->i_flags;
newflags = oldflags &
- ~(EXT2_IMMUTABLE_FL | EXT2_IUNLINK_FL | EXT2_BARRIER_FL);
+ ~(EXT2_IMMUTABLE_FL | EXT2_IUNLINK_FL | EXT2_BARRIER_FL);
if (flags & ATTR_FLAG_IMMUTABLE)
newflags |= EXT2_IMMUTABLE_FL;
if (flags & ATTR_FLAG_IUNLINK)