|
@@ -5198,8 +5198,8 @@ out:
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
-static int ocfs2_split_tree(struct inode *inode, struct ocfs2_extent_tree *et,
|
|
|
|
- handle_t *handle, struct ocfs2_path *path,
|
|
|
|
|
|
+static int ocfs2_split_tree(handle_t *handle, struct ocfs2_extent_tree *et,
|
|
|
|
+ struct ocfs2_path *path,
|
|
int index, u32 new_range,
|
|
int index, u32 new_range,
|
|
struct ocfs2_alloc_context *meta_ac)
|
|
struct ocfs2_alloc_context *meta_ac)
|
|
{
|
|
{
|
|
@@ -5216,7 +5216,8 @@ static int ocfs2_split_tree(struct inode *inode, struct ocfs2_extent_tree *et,
|
|
*/
|
|
*/
|
|
el = path_leaf_el(path);
|
|
el = path_leaf_el(path);
|
|
rec = &el->l_recs[index];
|
|
rec = &el->l_recs[index];
|
|
- ocfs2_make_right_split_rec(inode->i_sb, &split_rec, new_range, rec);
|
|
|
|
|
|
+ ocfs2_make_right_split_rec(ocfs2_metadata_cache_get_super(et->et_ci),
|
|
|
|
+ &split_rec, new_range, rec);
|
|
|
|
|
|
depth = path->p_tree_depth;
|
|
depth = path->p_tree_depth;
|
|
if (depth > 0) {
|
|
if (depth > 0) {
|
|
@@ -5424,9 +5425,9 @@ out:
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
-int ocfs2_remove_extent(struct inode *inode,
|
|
|
|
|
|
+int ocfs2_remove_extent(handle_t *handle,
|
|
struct ocfs2_extent_tree *et,
|
|
struct ocfs2_extent_tree *et,
|
|
- u32 cpos, u32 len, handle_t *handle,
|
|
|
|
|
|
+ u32 cpos, u32 len,
|
|
struct ocfs2_alloc_context *meta_ac,
|
|
struct ocfs2_alloc_context *meta_ac,
|
|
struct ocfs2_cached_dealloc_ctxt *dealloc)
|
|
struct ocfs2_cached_dealloc_ctxt *dealloc)
|
|
{
|
|
{
|
|
@@ -5458,10 +5459,11 @@ int ocfs2_remove_extent(struct inode *inode,
|
|
el = path_leaf_el(path);
|
|
el = path_leaf_el(path);
|
|
index = ocfs2_search_extent_list(el, cpos);
|
|
index = ocfs2_search_extent_list(el, cpos);
|
|
if (index == -1 || index >= le16_to_cpu(el->l_next_free_rec)) {
|
|
if (index == -1 || index >= le16_to_cpu(el->l_next_free_rec)) {
|
|
- ocfs2_error(inode->i_sb,
|
|
|
|
- "Inode %llu has an extent at cpos %u which can no "
|
|
|
|
|
|
+ ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
|
|
|
|
+ "Owner %llu has an extent at cpos %u which can no "
|
|
"longer be found.\n",
|
|
"longer be found.\n",
|
|
- (unsigned long long)OCFS2_I(inode)->ip_blkno, cpos);
|
|
|
|
|
|
+ (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
|
|
|
|
+ cpos);
|
|
ret = -EROFS;
|
|
ret = -EROFS;
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -5488,9 +5490,10 @@ int ocfs2_remove_extent(struct inode *inode,
|
|
|
|
|
|
BUG_ON(cpos < le32_to_cpu(rec->e_cpos) || trunc_range > rec_range);
|
|
BUG_ON(cpos < le32_to_cpu(rec->e_cpos) || trunc_range > rec_range);
|
|
|
|
|
|
- mlog(0, "Inode %llu, remove (cpos %u, len %u). Existing index %d "
|
|
|
|
|
|
+ mlog(0, "Owner %llu, remove (cpos %u, len %u). Existing index %d "
|
|
"(cpos %u, len %u)\n",
|
|
"(cpos %u, len %u)\n",
|
|
- (unsigned long long)OCFS2_I(inode)->ip_blkno, cpos, len, index,
|
|
|
|
|
|
+ (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
|
|
|
|
+ cpos, len, index,
|
|
le32_to_cpu(rec->e_cpos), ocfs2_rec_clusters(el, rec));
|
|
le32_to_cpu(rec->e_cpos), ocfs2_rec_clusters(el, rec));
|
|
|
|
|
|
if (le32_to_cpu(rec->e_cpos) == cpos || rec_range == trunc_range) {
|
|
if (le32_to_cpu(rec->e_cpos) == cpos || rec_range == trunc_range) {
|
|
@@ -5501,7 +5504,7 @@ int ocfs2_remove_extent(struct inode *inode,
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- ret = ocfs2_split_tree(inode, et, handle, path, index,
|
|
|
|
|
|
+ ret = ocfs2_split_tree(handle, et, path, index,
|
|
trunc_range, meta_ac);
|
|
trunc_range, meta_ac);
|
|
if (ret) {
|
|
if (ret) {
|
|
mlog_errno(ret);
|
|
mlog_errno(ret);
|
|
@@ -5523,9 +5526,9 @@ int ocfs2_remove_extent(struct inode *inode,
|
|
el = path_leaf_el(path);
|
|
el = path_leaf_el(path);
|
|
index = ocfs2_search_extent_list(el, cpos);
|
|
index = ocfs2_search_extent_list(el, cpos);
|
|
if (index == -1 || index >= le16_to_cpu(el->l_next_free_rec)) {
|
|
if (index == -1 || index >= le16_to_cpu(el->l_next_free_rec)) {
|
|
- ocfs2_error(inode->i_sb,
|
|
|
|
- "Inode %llu: split at cpos %u lost record.",
|
|
|
|
- (unsigned long long)OCFS2_I(inode)->ip_blkno,
|
|
|
|
|
|
+ ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
|
|
|
|
+ "Owner %llu: split at cpos %u lost record.",
|
|
|
|
+ (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
|
|
cpos);
|
|
cpos);
|
|
ret = -EROFS;
|
|
ret = -EROFS;
|
|
goto out;
|
|
goto out;
|
|
@@ -5539,10 +5542,10 @@ int ocfs2_remove_extent(struct inode *inode,
|
|
rec_range = le32_to_cpu(rec->e_cpos) +
|
|
rec_range = le32_to_cpu(rec->e_cpos) +
|
|
ocfs2_rec_clusters(el, rec);
|
|
ocfs2_rec_clusters(el, rec);
|
|
if (rec_range != trunc_range) {
|
|
if (rec_range != trunc_range) {
|
|
- ocfs2_error(inode->i_sb,
|
|
|
|
- "Inode %llu: error after split at cpos %u"
|
|
|
|
|
|
+ ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
|
|
|
|
+ "Owner %llu: error after split at cpos %u"
|
|
"trunc len %u, existing record is (%u,%u)",
|
|
"trunc len %u, existing record is (%u,%u)",
|
|
- (unsigned long long)OCFS2_I(inode)->ip_blkno,
|
|
|
|
|
|
+ (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
|
|
cpos, len, le32_to_cpu(rec->e_cpos),
|
|
cpos, len, le32_to_cpu(rec->e_cpos),
|
|
ocfs2_rec_clusters(el, rec));
|
|
ocfs2_rec_clusters(el, rec));
|
|
ret = -EROFS;
|
|
ret = -EROFS;
|
|
@@ -5607,8 +5610,7 @@ int ocfs2_remove_btree_range(struct inode *inode,
|
|
vfs_dq_free_space_nodirty(inode,
|
|
vfs_dq_free_space_nodirty(inode,
|
|
ocfs2_clusters_to_bytes(inode->i_sb, len));
|
|
ocfs2_clusters_to_bytes(inode->i_sb, len));
|
|
|
|
|
|
- ret = ocfs2_remove_extent(inode, et, cpos, len, handle, meta_ac,
|
|
|
|
- dealloc);
|
|
|
|
|
|
+ ret = ocfs2_remove_extent(handle, et, cpos, len, meta_ac, dealloc);
|
|
if (ret) {
|
|
if (ret) {
|
|
mlog_errno(ret);
|
|
mlog_errno(ret);
|
|
goto out_commit;
|
|
goto out_commit;
|