ReactOS  0.4.13-dev-698-g77671f0
ext4_ext.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ext4_extent_tail
 
struct  ext4_extent
 
struct  ext4_extent_idx
 
struct  ext4_extent_header
 
struct  ext4_ext_path
 

Macros

#define EXT4_EXT_MAGIC   0xf30a
 
#define get_ext4_header(i)   ((struct ext4_extent_header *) (i)->i_block)
 
#define EXT4_EXTENT_TAIL_OFFSET(hdr)
 
#define EXT_INIT_MAX_LEN   (1UL << 15)
 
#define EXT_UNWRITTEN_MAX_LEN   (EXT_INIT_MAX_LEN - 1)
 
#define EXT_EXTENT_SIZE   sizeof(struct ext4_extent)
 
#define EXT_INDEX_SIZE   sizeof(struct ext4_extent_idx)
 
#define EXT_FIRST_EXTENT(__hdr__)
 
#define EXT_FIRST_INDEX(__hdr__)
 
#define EXT_HAS_FREE_INDEX(__path__)   ((__path__)->p_hdr->eh_entries < (__path__)->p_hdr->eh_max)
 
#define EXT_LAST_EXTENT(__hdr__)   (EXT_FIRST_EXTENT((__hdr__)) + (__hdr__)->eh_entries - 1)
 
#define EXT_LAST_INDEX(__hdr__)   (EXT_FIRST_INDEX((__hdr__)) + (__hdr__)->eh_entries - 1)
 
#define EXT_MAX_EXTENT(__hdr__)   (EXT_FIRST_EXTENT((__hdr__)) + (__hdr__)->eh_max - 1)
 
#define EXT_MAX_INDEX(__hdr__)   (EXT_FIRST_INDEX((__hdr__)) + (__hdr__)->eh_max - 1)
 
#define ext4_ext_dirty(icb, handle, inode, path)   __ext4_ext_dirty("", __LINE__, (icb), (handle), (inode), (path))
 
#define INODE_HAS_EXTENT(i)   ((i)->i_flags & EXT2_EXTENTS_FL)
 

Functions

struct ext4_extent __attribute__ ((__packed__)) EXT4_EXTENT
 
static struct ext4_extent_tailfind_ext4_extent_tail (struct ext4_extent_header *eh)
 
static struct ext4_extent_headerext_inode_hdr (struct inode *inode)
 
static struct ext4_extent_headerext_block_hdr (struct buffer_head *bh)
 
static unsigned short ext_depth (struct inode *inode)
 
static void ext4_ext_mark_uninitialized (struct ext4_extent *ext)
 
static int ext4_ext_is_uninitialized (struct ext4_extent *ext)
 
static uint16_t ext4_ext_get_actual_len (struct ext4_extent *ext)
 
static void ext4_ext_mark_initialized (struct ext4_extent *ext)
 
static void ext4_ext_mark_unwritten (struct ext4_extent *ext)
 
static int ext4_ext_is_unwritten (struct ext4_extent *ext)
 
static ext4_fsblk_t ext4_ext_pblock (struct ext4_extent *ex)
 
static ext4_fsblk_t ext4_idx_pblock (struct ext4_extent_idx *ix)
 
static void ext4_ext_store_pblock (struct ext4_extent *ex, ext4_fsblk_t pb)
 
static void ext4_idx_store_pblock (struct ext4_extent_idx *ix, ext4_fsblk_t pb)
 
static uint64_t ext_to_block (EXT4_EXTENT *extent)
 
static uint64_t idx_to_block (EXT4_EXTENT_IDX *idx)
 
int ext4_ext_get_blocks (void *icb, handle_t *handle, struct inode *inode, ext4_fsblk_t iblock, unsigned long max_blocks, struct buffer_head *bh_result, int create, int flags)
 
int ext4_ext_tree_init (void *icb, handle_t *handle, struct inode *inode)
 
int ext4_ext_truncate (void *icb, struct inode *inode, unsigned long start)
 

Variables

uint32_t ee_block
 
uint16_t ee_len
 
uint16_t ee_start_hi
 
uint32_t ee_start_lo
 
uint32_t ei_block
 
uint32_t ei_leaf_lo
 
uint16_t ei_leaf_hi
 
uint16_t ei_unused
 
uint16_t eh_magic
 
uint16_t eh_entries
 
uint16_t eh_max
 
uint16_t eh_depth
 
uint32_t eh_generation
 
struct ext4_ext_path __attribute__
 

Macro Definition Documentation

◆ ext4_ext_dirty

#define ext4_ext_dirty (   icb,
  handle,
  inode,
  path 
)    __ext4_ext_dirty("", __LINE__, (icb), (handle), (inode), (path))

Definition at line 225 of file ext4_ext.h.

◆ EXT4_EXT_MAGIC

#define EXT4_EXT_MAGIC   0xf30a

Definition at line 50 of file ext4_ext.h.

◆ EXT4_EXTENT_TAIL_OFFSET

#define EXT4_EXTENT_TAIL_OFFSET (   hdr)
Value:
(sizeof(struct ext4_extent_header) + \
char hdr[14]
Definition: iptest.cpp:33
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
uint16_t eh_max
Definition: ext4_ext.h:116

Definition at line 53 of file ext4_ext.h.

◆ EXT_EXTENT_SIZE

#define EXT_EXTENT_SIZE   sizeof(struct ext4_extent)

Definition at line 104 of file ext4_ext.h.

◆ EXT_FIRST_EXTENT

#define EXT_FIRST_EXTENT (   __hdr__)
Value:
((struct ext4_extent *)(((char *)(__hdr__)) + \
sizeof(struct ext4_extent_header)))

Definition at line 107 of file ext4_ext.h.

◆ EXT_FIRST_INDEX

#define EXT_FIRST_INDEX (   __hdr__)
Value:
((struct ext4_extent_idx *)(((char *)(__hdr__)) + \
sizeof(struct ext4_extent_header)))

Definition at line 110 of file ext4_ext.h.

◆ EXT_HAS_FREE_INDEX

#define EXT_HAS_FREE_INDEX (   __path__)    ((__path__)->p_hdr->eh_entries < (__path__)->p_hdr->eh_max)

Definition at line 113 of file ext4_ext.h.

◆ EXT_INDEX_SIZE

#define EXT_INDEX_SIZE   sizeof(struct ext4_extent_idx)

Definition at line 105 of file ext4_ext.h.

◆ EXT_INIT_MAX_LEN

#define EXT_INIT_MAX_LEN   (1UL << 15)

Definition at line 101 of file ext4_ext.h.

◆ EXT_LAST_EXTENT

#define EXT_LAST_EXTENT (   __hdr__)    (EXT_FIRST_EXTENT((__hdr__)) + (__hdr__)->eh_entries - 1)

Definition at line 115 of file ext4_ext.h.

◆ EXT_LAST_INDEX

#define EXT_LAST_INDEX (   __hdr__)    (EXT_FIRST_INDEX((__hdr__)) + (__hdr__)->eh_entries - 1)

Definition at line 117 of file ext4_ext.h.

◆ EXT_MAX_EXTENT

#define EXT_MAX_EXTENT (   __hdr__)    (EXT_FIRST_EXTENT((__hdr__)) + (__hdr__)->eh_max - 1)

Definition at line 119 of file ext4_ext.h.

◆ EXT_MAX_INDEX

#define EXT_MAX_INDEX (   __hdr__)    (EXT_FIRST_INDEX((__hdr__)) + (__hdr__)->eh_max - 1)

Definition at line 121 of file ext4_ext.h.

◆ EXT_UNWRITTEN_MAX_LEN

#define EXT_UNWRITTEN_MAX_LEN   (EXT_INIT_MAX_LEN - 1)

Definition at line 102 of file ext4_ext.h.

◆ get_ext4_header

#define get_ext4_header (   i)    ((struct ext4_extent_header *) (i)->i_block)

Definition at line 51 of file ext4_ext.h.

◆ INODE_HAS_EXTENT

#define INODE_HAS_EXTENT (   i)    ((i)->i_flags & EXT2_EXTENTS_FL)

Definition at line 228 of file ext4_ext.h.

Function Documentation

◆ __attribute__()

struct ext4_extent __attribute__ ( (__packed__)  )

◆ ext4_ext_get_actual_len()

◆ ext4_ext_get_blocks()

int ext4_ext_get_blocks ( void icb,
handle_t handle,
struct inode inode,
ext4_fsblk_t  iblock,
unsigned long  max_blocks,
struct buffer_head bh_result,
int  create,
int  flags 
)

Definition at line 2374 of file ext4_extents.c.

2377 {
2378  struct ext4_ext_path *path = NULL;
2379  struct ext4_extent newex, *ex;
2380  int goal, err = 0, depth;
2381  unsigned long allocated = 0;
2382  ext4_fsblk_t next, newblock;
2383 
2384  clear_buffer_new(bh_result);
2385  /*mutex_lock(&ext4_I(inode)->truncate_mutex);*/
2386 
2387  /* find extent for this block */
2388  path = ext4_find_extent(inode, iblock, NULL, 0);
2389  if (IS_ERR(path)) {
2390  err = PTR_ERR(path);
2391  path = NULL;
2392  goto out2;
2393  }
2394 
2395  depth = ext_depth(inode);
2396 
2397  /*
2398  * consistent leaf must not be empty
2399  * this situations is possible, though, _during_ tree modification
2400  * this is why assert can't be put in ext4_ext_find_extent()
2401  */
2402  BUG_ON(path[depth].p_ext == NULL && depth != 0);
2403 
2404  if ((ex = path[depth].p_ext)) {
2405  ext4_lblk_t ee_block = le32_to_cpu(ex->ee_block);
2406  ext4_fsblk_t ee_start = ext4_ext_pblock(ex);
2407  unsigned short ee_len = ext4_ext_get_actual_len(ex);
2408  /* if found exent covers block, simple return it */
2409  if (iblock >= ee_block && iblock < ee_block + ee_len) {
2410 
2411  /* number of remain blocks in the extent */
2412  allocated = ee_len + ee_block - iblock;
2413 
2414  if (ext4_ext_is_unwritten(ex)) {
2415  if (create) {
2416  newblock = iblock - ee_block + ee_start;
2418  icb, handle,
2419  inode,
2420  &path,
2421  iblock,
2422  allocated,
2423  flags);
2424  if (err)
2425  goto out2;
2426 
2427  } else {
2428  newblock = 0;
2429  }
2430  } else {
2431  newblock = iblock - ee_block + ee_start;
2432  }
2433  goto out;
2434  }
2435  }
2436 
2437  /*
2438  * requested block isn't allocated yet
2439  * we couldn't try to create block if create flag is zero
2440  */
2441  if (!create) {
2442  goto out2;
2443  }
2444 
2445  /* find next allocated block so that we know how many
2446  * blocks we can allocate without ovelapping next extent */
2448  BUG_ON(next <= iblock);
2449  allocated = next - iblock;
2450  if (flags & EXT4_GET_BLOCKS_PRE_IO && max_blocks > EXT_UNWRITTEN_MAX_LEN)
2451  max_blocks = EXT_UNWRITTEN_MAX_LEN;
2452  if (allocated > max_blocks)
2453  allocated = max_blocks;
2454 
2455  /* allocate new block */
2456  goal = ext4_ext_find_goal(inode, path, iblock);
2457 
2458  newblock = ext4_new_meta_blocks(icb, handle, inode, goal, 0,
2459  &allocated, &err);
2460  if (!newblock)
2461  goto out2;
2462 
2463  /* try to insert new extent into found leaf and return */
2464  newex.ee_block = cpu_to_le32(iblock);
2465  ext4_ext_store_pblock(&newex, newblock);
2466  newex.ee_len = cpu_to_le16(allocated);
2467  /* if it's fallocate, mark ex as unwritten */
2468  if (flags & EXT4_GET_BLOCKS_PRE_IO) {
2469  ext4_ext_mark_unwritten(&newex);
2470  }
2471  err = ext4_ext_insert_extent(icb, handle, inode, &path, &newex,
2473 
2474  if (err) {
2475  /* free data blocks we just allocated */
2478  goto out2;
2479  }
2480 
2482 
2483  /* previous routine could use block we allocated */
2484  if (ext4_ext_is_unwritten(&newex))
2485  newblock = 0;
2486  else
2487  newblock = ext4_ext_pblock(&newex);
2488 
2489  set_buffer_new(bh_result);
2490 
2491 out:
2492  if (allocated > max_blocks)
2493  allocated = max_blocks;
2494 
2496  set_buffer_mapped(bh_result);
2497  bh_result->b_bdev = inode->i_sb->s_bdev;
2498  bh_result->b_blocknr = newblock;
2499 out2:
2500  if (path) {
2502  kfree(path);
2503  }
2504  /*mutex_unlock(&ext4_I(inode)->truncate_mutex);*/
2505 
2506  return err ? err : allocated;
2507 }
Definition: comerr.c:44
static uint16_t ext4_ext_get_actual_len(struct ext4_extent *ext)
Definition: ext4_ext.h:151
#define le16_to_cpu
Definition: module.h:149
#define ext4_mark_inode_dirty(icb, handle, n)
Definition: ext4_extents.c:41
struct ext4_ext_path * ext4_find_extent(struct inode *inode, ext4_lblk_t block, struct ext4_ext_path **orig_path, int flags)
Definition: ext4_extents.c:634
#define EXT4_GET_BLOCKS_PRE_IO
Definition: ext4.h:31
unsigned long long ext4_fsblk_t
Definition: ext3_fs_i.h:27
Definition: fs.h:78
static ext4_fsblk_t ext4_new_meta_blocks(void *icb, handle_t *handle, struct inode *inode, ext4_fsblk_t goal, unsigned int flags, unsigned long *count, int *errp)
Definition: ext4_extents.c:49
static int ext4_ext_convert_to_initialized(void *icb, handle_t *handle, struct inode *inode, struct ext4_ext_path **ppath, ext4_lblk_t split, unsigned long blocks, int flags)
ext4_lblk_t ext4_ext_next_allocated_block(struct ext4_ext_path *path)
#define le32_to_cpu
Definition: module.h:147
static void ext4_ext_mark_unwritten(struct ext4_extent *ext)
Definition: ext4_ext.h:163
smooth NULL
Definition: ftsmooth.c:416
struct block_device * b_bdev
Definition: module.h:721
static ext4_fsblk_t ext4_ext_pblock(struct ext4_extent *ex)
Definition: ext4_ext.h:179
static int get_default_free_blocks_flags(struct inode *inode)
#define EXT_UNWRITTEN_MAX_LEN
Definition: ext4_ext.h:102
#define BUG_ON(c)
Definition: module.h:253
static long IS_ERR(const void *ptr)
Definition: module.h:247
static unsigned short ext_depth(struct inode *inode)
Definition: ext4_ext.h:134
static long PTR_ERR(const void *ptr)
Definition: module.h:242
static FILE * out
Definition: regtests2xml.c:44
blkcnt_t b_blocknr
Definition: module.h:723
uint16_t ee_len
Definition: ext4_ext.h:115
int ext4_ext_insert_extent(void *icb, handle_t *handle, struct inode *inode, struct ext4_ext_path **ppath, struct ext4_extent *newext, int gb_flags)
__u32 ext4_lblk_t
Definition: ext3_fs_i.h:31
GLbitfield flags
Definition: glext.h:7161
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
static void ext4_ext_store_pblock(struct ext4_extent *ex, ext4_fsblk_t pb)
Definition: ext4_ext.h:206
#define err(...)
static unsigned __int64 next
Definition: rand_nt.c:6
Definition: services.c:325
void ext4_ext_drop_refs(struct ext4_ext_path *path)
Definition: ext4_extents.c:370
struct super_block * i_sb
Definition: fs.h:96
#define cpu_to_le16
Definition: module.h:148
uint32_t ee_block
Definition: ext4_ext.h:114
static ext4_fsblk_t ext4_ext_find_goal(struct inode *inode, struct ext4_ext_path *path, ext4_lblk_t block)
Definition: ext4_extents.c:290
static const struct access_res create[16]
Definition: package.c:7720
#define ext4_ext_show_leaf(inode, path)
Definition: ext4_extents.c:629
static void ext4_free_blocks(void *icb, handle_t *handle, struct inode *inode, void *fake, ext4_fsblk_t block, int count, int flags)
Definition: ext4_extents.c:74
static int ext4_ext_is_unwritten(struct ext4_extent *ext)
Definition: ext4_ext.h:169
#define cpu_to_le32
Definition: module.h:146
void kfree(const void *)

Referenced by Ext2DoExtentExpand(), and Ext2MapExtent().

◆ ext4_ext_is_uninitialized()

static int ext4_ext_is_uninitialized ( struct ext4_extent ext)
inlinestatic

Definition at line 145 of file ext4_ext.h.

146 {
147  /* Extent with ee_len of 0x8000 is treated as an initialized extent */
148  return (ext->ee_len > EXT_INIT_MAX_LEN);
149 }
char ext[3]
Definition: mkdosfs.c:358
#define EXT_INIT_MAX_LEN
Definition: ext4_ext.h:101

◆ ext4_ext_is_unwritten()

static int ext4_ext_is_unwritten ( struct ext4_extent ext)
inlinestatic

Definition at line 169 of file ext4_ext.h.

170 {
171  /* Extent with ee_len of 0x8000 is treated as an initialized extent */
172  return (ext->ee_len > EXT_INIT_MAX_LEN);
173 }
char ext[3]
Definition: mkdosfs.c:358
#define EXT_INIT_MAX_LEN
Definition: ext4_ext.h:101

Referenced by ext4_can_extents_be_merged(), ext4_ext_binsearch(), ext4_ext_get_blocks(), ext4_ext_insert_extent(), ext4_ext_try_to_merge_right(), and ext4_force_split_extent_at().

◆ ext4_ext_mark_initialized()

static void ext4_ext_mark_initialized ( struct ext4_extent ext)
inlinestatic

Definition at line 158 of file ext4_ext.h.

159 {
160  ext->ee_len = ext4_ext_get_actual_len(ext);
161 }
static uint16_t ext4_ext_get_actual_len(struct ext4_extent *ext)
Definition: ext4_ext.h:151
char ext[3]
Definition: mkdosfs.c:358

Referenced by ext4_split_extent_at().

◆ ext4_ext_mark_uninitialized()

static void ext4_ext_mark_uninitialized ( struct ext4_extent ext)
inlinestatic

Definition at line 139 of file ext4_ext.h.

140 {
141  /* We can not have an uninitialized extent of zero length! */
142  ext->ee_len |= EXT_INIT_MAX_LEN;
143 }
char ext[3]
Definition: mkdosfs.c:358
#define EXT_INIT_MAX_LEN
Definition: ext4_ext.h:101

◆ ext4_ext_mark_unwritten()

static void ext4_ext_mark_unwritten ( struct ext4_extent ext)
inlinestatic

Definition at line 163 of file ext4_ext.h.

164 {
165  /* We can not have an unwritten extent of zero length! */
166  ext->ee_len |= EXT_INIT_MAX_LEN;
167 }
char ext[3]
Definition: mkdosfs.c:358
#define EXT_INIT_MAX_LEN
Definition: ext4_ext.h:101

Referenced by ext4_ext_get_blocks(), ext4_ext_insert_extent(), ext4_ext_try_to_merge_right(), and ext4_split_extent_at().

◆ ext4_ext_pblock()

static ext4_fsblk_t ext4_ext_pblock ( struct ext4_extent ex)
inlinestatic

Definition at line 179 of file ext4_ext.h.

180 {
182 
183  block = ex->ee_start_lo;
184  block |= ((ext4_fsblk_t)ex->ee_start_hi << 31) << 1;
185  return block;
186 }
static unsigned int block
Definition: xmlmemory.c:118
Definition: comerr.c:44
unsigned long long ext4_fsblk_t
Definition: ext3_fs_i.h:27

Referenced by ext4_can_extents_be_merged(), ext4_ext_binsearch(), ext4_ext_find_goal(), ext4_ext_get_blocks(), ext4_ext_insert_extent(), ext4_ext_search_left(), ext4_ext_search_right(), ext4_ext_zeroout(), ext4_find_extent(), ext4_remove_blocks(), and ext4_split_extent_at().

◆ ext4_ext_store_pblock()

static void ext4_ext_store_pblock ( struct ext4_extent ex,
ext4_fsblk_t  pb 
)
inlinestatic

Definition at line 206 of file ext4_ext.h.

208 {
209  ex->ee_start_lo = (uint32_t)(pb & 0xffffffff);
210  ex->ee_start_hi = (uint16_t)((pb >> 31) >> 1) & 0xffff;
211 }
Definition: comerr.c:44
#define uint16_t
Definition: nsiface.idl:60
#define uint32_t
Definition: nsiface.idl:61

Referenced by ext4_ext_get_blocks(), ext4_ext_insert_extent(), ext4_ext_rm_leaf(), and ext4_split_extent_at().

◆ ext4_ext_tree_init()

int ext4_ext_tree_init ( void icb,
handle_t handle,
struct inode inode 
)

Definition at line 2309 of file ext4_extents.c.

2310 {
2311  struct ext4_extent_header *eh;
2312 
2313  eh = ext_inode_hdr(inode);
2314  eh->eh_depth = 0;
2315  eh->eh_entries = 0;
2319  return 0;
2320 }
#define EXT4_EXT_MAGIC
Definition: ext4_ext.h:50
uint16_t eh_depth
Definition: ext4_ext.h:45
#define ext4_mark_inode_dirty(icb, handle, n)
Definition: ext4_extents.c:41
Definition: fs.h:78
static struct ext4_extent_header * ext_inode_hdr(struct inode *inode)
Definition: ext4_ext.h:124
uint16_t eh_entries
Definition: ext4_ext.h:43
uint16_t eh_magic
Definition: ext4_ext.h:42
static int ext4_ext_space_root(struct inode *inode, int check)
Definition: ext4_extents.c:131
#define cpu_to_le16
Definition: module.h:148
uint16_t eh_max
Definition: ext4_ext.h:44

Referenced by Ext2CreateInode(), Ext2DoExtentExpand(), and Ext2MapExtent().

◆ ext4_ext_truncate()

int ext4_ext_truncate ( void icb,
struct inode inode,
unsigned long  start 
)

Definition at line 2509 of file ext4_extents.c.

2510 {
2511  int ret = ext4_ext_remove_space(icb, inode, start);
2512 
2513  /* Save modifications on i_blocks field of the inode. */
2514  if (!ret)
2516 
2517  return ret;
2518 }
#define ext4_mark_inode_dirty(icb, handle, n)
Definition: ext4_extents.c:41
Definition: fs.h:78
smooth NULL
Definition: ftsmooth.c:416
int ret
int ext4_ext_remove_space(void *icb, struct inode *inode, unsigned long start)
GLuint start
Definition: gl.h:1545

Referenced by Ext2TruncateExtent().

◆ ext4_idx_pblock()

static ext4_fsblk_t ext4_idx_pblock ( struct ext4_extent_idx ix)
inlinestatic

Definition at line 192 of file ext4_ext.h.

193 {
195 
196  block = ix->ei_leaf_lo;
197  block |= ((ext4_fsblk_t)ix->ei_leaf_hi << 31) << 1;
198  return block;
199 }
static unsigned int block
Definition: xmlmemory.c:118
uint16_t ei_leaf_hi
Definition: ext4_ext.h:34
unsigned long long ext4_fsblk_t
Definition: ext3_fs_i.h:27
uint32_t ei_leaf_lo
Definition: ext4_ext.h:32

Referenced by ext4_ext_binsearch_idx(), ext4_ext_grow_indepth(), ext4_ext_remove_space(), ext4_ext_rm_idx(), ext4_ext_search_right(), ext4_ext_try_to_merge_up(), and ext4_find_extent().

◆ ext4_idx_store_pblock()

static void ext4_idx_store_pblock ( struct ext4_extent_idx ix,
ext4_fsblk_t  pb 
)
inlinestatic

Definition at line 218 of file ext4_ext.h.

220 {
221  ix->ei_leaf_lo = (uint32_t)(pb & 0xffffffff);
222  ix->ei_leaf_hi = (uint16_t)((pb >> 31) >> 1) & 0xffff;
223 }
uint16_t ei_leaf_hi
Definition: ext4_ext.h:34
#define uint16_t
Definition: nsiface.idl:60
uint32_t ei_leaf_lo
Definition: ext4_ext.h:32
#define uint32_t
Definition: nsiface.idl:61

Referenced by ext4_ext_grow_indepth(), ext4_ext_insert_index(), and ext4_ext_split().

◆ ext_block_hdr()

◆ ext_depth()

◆ ext_inode_hdr()

static struct ext4_extent_header* ext_inode_hdr ( struct inode inode)
inlinestatic

Definition at line 124 of file ext4_ext.h.

125 {
126  return get_ext4_header(inode);
127 }
Definition: fs.h:78
#define get_ext4_header(i)
Definition: ext4_ext.h:51

Referenced by ext4_ext_check_inode(), ext4_ext_grow_indepth(), ext4_ext_remove_space(), ext4_ext_tree_init(), ext4_find_extent(), and ext_depth().

◆ ext_to_block()

static uint64_t ext_to_block ( EXT4_EXTENT *  extent)
inlinestatic

Definition at line 230 of file ext4_ext.h.

231 {
232  uint64_t block;
233 
234  block = (uint64_t)extent->ee_start_lo;
235  block |= ((uint64_t) extent->ee_start_hi << 31) << 1;
236 
237  return block;
238 }
static unsigned int block
Definition: xmlmemory.c:118
#define uint64_t
Definition: nsiface.idl:62
UINT64 uint64_t
Definition: types.h:77

◆ find_ext4_extent_tail()

static struct ext4_extent_tail* find_ext4_extent_tail ( struct ext4_extent_header eh)
inlinestatic

Definition at line 58 of file ext4_ext.h.

59 {
60  return (struct ext4_extent_tail *)(((char *)eh) +
62 }
#define EXT4_EXTENT_TAIL_OFFSET(hdr)
Definition: ext4_ext.h:53

Referenced by __ext4_ext_check(), and ext4_extent_block_csum_set().

◆ idx_to_block()

static uint64_t idx_to_block ( EXT4_EXTENT_IDX *  idx)
inlinestatic

Definition at line 240 of file ext4_ext.h.

241 {
242  uint64_t block;
243 
244  block = (uint64_t)idx->ei_leaf_lo;
245  block |= ((uint64_t) idx->ei_leaf_hi << 31) << 1;
246 
247  return block;
248 }
static unsigned int block
Definition: xmlmemory.c:118
unsigned int idx
Definition: utils.c:41
#define uint64_t
Definition: nsiface.idl:62
UINT64 uint64_t
Definition: types.h:77

Variable Documentation

◆ __attribute__

Definition at line 38 of file log2.h.

40 {
41  return fls64(n) - 1;
42 }
static int fls64(__u64 x)
Definition: bitops.h:186
GLdouble n
Definition: glext.h:7729

◆ ee_block

◆ ee_len

◆ ee_start_hi

uint16_t ee_start_hi

Definition at line 116 of file ext4_ext.h.

◆ ee_start_lo

uint32_t ee_start_lo

Definition at line 117 of file ext4_ext.h.

◆ eh_depth

uint16_t eh_depth

Definition at line 117 of file ext4_ext.h.

◆ eh_entries

uint16_t eh_entries

Definition at line 115 of file ext4_ext.h.

◆ eh_generation

uint32_t eh_generation

Definition at line 118 of file ext4_ext.h.

◆ eh_magic

uint16_t eh_magic

Definition at line 114 of file ext4_ext.h.

◆ eh_max

uint16_t eh_max

Definition at line 116 of file ext4_ext.h.

◆ ei_block

◆ ei_leaf_hi

uint16_t ei_leaf_hi

Definition at line 117 of file ext4_ext.h.

◆ ei_leaf_lo

uint32_t ei_leaf_lo

Definition at line 115 of file ext4_ext.h.

◆ ei_unused

uint16_t ei_unused

Definition at line 118 of file ext4_ext.h.