if (omfs_is_bad(sbi, (struct omfs_header *) bh->b_data, next)) goto out_brelse;
extent_count = be32_to_cpu(oe->e_extent_count);
if (extent_count > max_extents) goto out_brelse;
last = next;
next = be64_to_cpu(oe->e_next);
entry = oe->e_entry;
/* ignore last entry as it is the terminator */ for (; extent_count > 1; extent_count--) {
u64 start, count;
start = be64_to_cpu(entry->e_cluster);
count = be64_to_cpu(entry->e_blocks);
/* * Add new blocks to the current extent, or create new entries/continuations * as necessary.
*/ staticint omfs_grow_extent(struct inode *inode, struct omfs_extent *oe,
u64 *ret_block)
{ struct omfs_extent_entry *terminator; struct omfs_extent_entry *entry = oe->e_entry; struct omfs_sb_info *sbi = OMFS_SB(inode->i_sb);
u32 extent_count = be32_to_cpu(oe->e_extent_count);
u64 new_block = 0;
u32 max_count; int new_count; int ret = 0;
/* reached the end of the extent table with no blocks mapped. * there are three possibilities for adding: grow last extent, * add a new extent to the current extent table, and add a * continuation inode. in last two cases need an allocator for * sbi->s_cluster_size
*/
/* TODO: handle holes */
/* should always have a terminator */ if (extent_count < 1) return -EIO;
/* trivially grow current extent, if next block is not taken */
terminator = entry + extent_count - 1; if (extent_count > 1) {
entry = terminator-1;
new_block = be64_to_cpu(entry->e_cluster) +
be64_to_cpu(entry->e_blocks);
/* * Scans across the directory table for a given file block number. * If block not found, return 0.
*/ static sector_t find_block(struct inode *inode, struct omfs_extent_entry *ent,
sector_t block, int count, int *left)
{ /* count > 1 because of terminator */
sector_t searched = 0; for (; count > 1; count--) { int numblocks = clus_to_blk(OMFS_SB(inode->i_sb),
be64_to_cpu(ent->e_blocks));
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.16Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.