mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 14:41:27 +00:00
ext4: rename {ext,idx}_pblock and inline small extent functions
Cleanup namespace leaks from fs/ext4 and the inline trivial functions ext4_{ext,idx}_pblock() and ext4_{ext,idx}_store_pblock() since the code size actually shrinks when we make these functions inline, they're so trivial. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
parent
1f109d5a17
commit
bf89d16f6e
4 changed files with 121 additions and 118 deletions
|
@ -225,11 +225,60 @@ static inline void ext4_ext_mark_initialized(struct ext4_extent *ext)
|
|||
ext->ee_len = cpu_to_le16(ext4_ext_get_actual_len(ext));
|
||||
}
|
||||
|
||||
/*
|
||||
* ext4_ext_pblock:
|
||||
* combine low and high parts of physical block number into ext4_fsblk_t
|
||||
*/
|
||||
static inline ext4_fsblk_t ext4_ext_pblock(struct ext4_extent *ex)
|
||||
{
|
||||
ext4_fsblk_t block;
|
||||
|
||||
block = le32_to_cpu(ex->ee_start_lo);
|
||||
block |= ((ext4_fsblk_t) le16_to_cpu(ex->ee_start_hi) << 31) << 1;
|
||||
return block;
|
||||
}
|
||||
|
||||
/*
|
||||
* ext4_idx_pblock:
|
||||
* combine low and high parts of a leaf physical block number into ext4_fsblk_t
|
||||
*/
|
||||
static inline ext4_fsblk_t ext4_idx_pblock(struct ext4_extent_idx *ix)
|
||||
{
|
||||
ext4_fsblk_t block;
|
||||
|
||||
block = le32_to_cpu(ix->ei_leaf_lo);
|
||||
block |= ((ext4_fsblk_t) le16_to_cpu(ix->ei_leaf_hi) << 31) << 1;
|
||||
return block;
|
||||
}
|
||||
|
||||
/*
|
||||
* ext4_ext_store_pblock:
|
||||
* stores a large physical block number into an extent struct,
|
||||
* breaking it into parts
|
||||
*/
|
||||
static inline void ext4_ext_store_pblock(struct ext4_extent *ex,
|
||||
ext4_fsblk_t pb)
|
||||
{
|
||||
ex->ee_start_lo = cpu_to_le32((unsigned long) (pb & 0xffffffff));
|
||||
ex->ee_start_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) &
|
||||
0xffff);
|
||||
}
|
||||
|
||||
/*
|
||||
* ext4_idx_store_pblock:
|
||||
* stores a large physical block number into an index struct,
|
||||
* breaking it into parts
|
||||
*/
|
||||
static inline void ext4_idx_store_pblock(struct ext4_extent_idx *ix,
|
||||
ext4_fsblk_t pb)
|
||||
{
|
||||
ix->ei_leaf_lo = cpu_to_le32((unsigned long) (pb & 0xffffffff));
|
||||
ix->ei_leaf_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) &
|
||||
0xffff);
|
||||
}
|
||||
|
||||
extern int ext4_ext_calc_metadata_amount(struct inode *inode,
|
||||
sector_t lblocks);
|
||||
extern ext4_fsblk_t ext_pblock(struct ext4_extent *ex);
|
||||
extern ext4_fsblk_t idx_pblock(struct ext4_extent_idx *);
|
||||
extern void ext4_ext_store_pblock(struct ext4_extent *, ext4_fsblk_t);
|
||||
extern int ext4_extent_tree_init(handle_t *, struct inode *);
|
||||
extern int ext4_ext_calc_credits_for_single_extent(struct inode *inode,
|
||||
int num,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue