diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2007-06-18 13:48:04 -0400 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2007-07-10 20:32:00 -0400 |
commit | 328d5752e1259dfb29b7e65f6c2d145fddbaa750 (patch) | |
tree | 08198271a0382cafcc4c0de2fc1efcf35cb400af /fs/ocfs2/extent_map.c | |
parent | c3afcbb34426a9291e4c038540129053a72c3cd8 (diff) |
ocfs2: btree changes for unwritten extents
Writes to a region marked as unwritten might result in a record split or
merge. We can support splits by making minor changes to the existing insert
code. Merges require left rotations which mostly re-use right rotation
support functions.
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/extent_map.c')
-rw-r--r-- | fs/ocfs2/extent_map.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/fs/ocfs2/extent_map.c b/fs/ocfs2/extent_map.c index e23e416ca74c..03c1d365c78b 100644 --- a/fs/ocfs2/extent_map.c +++ b/fs/ocfs2/extent_map.c | |||
@@ -373,37 +373,6 @@ out: | |||
373 | return ret; | 373 | return ret; |
374 | } | 374 | } |
375 | 375 | ||
376 | /* | ||
377 | * Return the index of the extent record which contains cluster #v_cluster. | ||
378 | * -1 is returned if it was not found. | ||
379 | * | ||
380 | * Should work fine on interior and exterior nodes. | ||
381 | */ | ||
382 | static int ocfs2_search_extent_list(struct ocfs2_extent_list *el, | ||
383 | u32 v_cluster) | ||
384 | { | ||
385 | int ret = -1; | ||
386 | int i; | ||
387 | struct ocfs2_extent_rec *rec; | ||
388 | u32 rec_end, rec_start, clusters; | ||
389 | |||
390 | for(i = 0; i < le16_to_cpu(el->l_next_free_rec); i++) { | ||
391 | rec = &el->l_recs[i]; | ||
392 | |||
393 | rec_start = le32_to_cpu(rec->e_cpos); | ||
394 | clusters = ocfs2_rec_clusters(el, rec); | ||
395 | |||
396 | rec_end = rec_start + clusters; | ||
397 | |||
398 | if (v_cluster >= rec_start && v_cluster < rec_end) { | ||
399 | ret = i; | ||
400 | break; | ||
401 | } | ||
402 | } | ||
403 | |||
404 | return ret; | ||
405 | } | ||
406 | |||
407 | int ocfs2_get_clusters(struct inode *inode, u32 v_cluster, | 376 | int ocfs2_get_clusters(struct inode *inode, u32 v_cluster, |
408 | u32 *p_cluster, u32 *num_clusters, | 377 | u32 *p_cluster, u32 *num_clusters, |
409 | unsigned int *extent_flags) | 378 | unsigned int *extent_flags) |