aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/alloc.c
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2007-07-03 16:34:11 -0400
committerMark Fasheh <mark.fasheh@oracle.com>2007-07-10 20:32:08 -0400
commit063c4561f52a74de686fe0ff2f96f4f54c9fecd2 (patch)
tree73a202c316df70bdfafa489d70e2863c5c5ea33a /fs/ocfs2/alloc.c
parent35edec1d52c075975991471d624b33b9336226f2 (diff)
ocfs2: support for removing file regions
Provide an internal interface for the removal of arbitrary file regions. ocfs2_remove_inode_range() takes a byte range within a file and will remove existing extents within that range. Partial clusters will be zeroed so that any read from within the region will return zeros. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/alloc.c')
-rw-r--r--fs/ocfs2/alloc.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index df186d2e8248..f5e11f4fa952 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -4373,10 +4373,10 @@ out:
4373 return ret; 4373 return ret;
4374} 4374}
4375 4375
4376static int ocfs2_remove_extent(struct inode *inode, struct buffer_head *di_bh, 4376int ocfs2_remove_extent(struct inode *inode, struct buffer_head *di_bh,
4377 u32 cpos, u32 len, handle_t *handle, 4377 u32 cpos, u32 len, handle_t *handle,
4378 struct ocfs2_alloc_context *meta_ac, 4378 struct ocfs2_alloc_context *meta_ac,
4379 struct ocfs2_cached_dealloc_ctxt *dealloc) 4379 struct ocfs2_cached_dealloc_ctxt *dealloc)
4380{ 4380{
4381 int ret, index; 4381 int ret, index;
4382 u32 rec_range, trunc_range; 4382 u32 rec_range, trunc_range;
@@ -4506,7 +4506,7 @@ out:
4506 return ret; 4506 return ret;
4507} 4507}
4508 4508
4509static inline int ocfs2_truncate_log_needs_flush(struct ocfs2_super *osb) 4509int ocfs2_truncate_log_needs_flush(struct ocfs2_super *osb)
4510{ 4510{
4511 struct buffer_head *tl_bh = osb->osb_tl_bh; 4511 struct buffer_head *tl_bh = osb->osb_tl_bh;
4512 struct ocfs2_dinode *di; 4512 struct ocfs2_dinode *di;
@@ -4539,10 +4539,10 @@ static int ocfs2_truncate_log_can_coalesce(struct ocfs2_truncate_log *tl,
4539 return current_tail == new_start; 4539 return current_tail == new_start;
4540} 4540}
4541 4541
4542static int ocfs2_truncate_log_append(struct ocfs2_super *osb, 4542int ocfs2_truncate_log_append(struct ocfs2_super *osb,
4543 handle_t *handle, 4543 handle_t *handle,
4544 u64 start_blk, 4544 u64 start_blk,
4545 unsigned int num_clusters) 4545 unsigned int num_clusters)
4546{ 4546{
4547 int status, index; 4547 int status, index;
4548 unsigned int start_cluster, tl_count; 4548 unsigned int start_cluster, tl_count;
@@ -4698,7 +4698,7 @@ bail:
4698} 4698}
4699 4699
4700/* Expects you to already be holding tl_inode->i_mutex */ 4700/* Expects you to already be holding tl_inode->i_mutex */
4701static int __ocfs2_flush_truncate_log(struct ocfs2_super *osb) 4701int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)
4702{ 4702{
4703 int status; 4703 int status;
4704 unsigned int num_to_flush; 4704 unsigned int num_to_flush;