alloc.h (811f933df1e55615fd0bb4818f31e3868a8e6e23) alloc.h (e7d4cb6bc19658646357eeff134645cd9bc3479f)
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * alloc.h
5 *
6 * Function prototypes
7 *
8 * Copyright (C) 2002, 2004 Oracle. All rights reserved.

--- 12 unchanged lines hidden (view full) ---

21 * License along with this program; if not, write to the
22 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 * Boston, MA 021110-1307, USA.
24 */
25
26#ifndef OCFS2_ALLOC_H
27#define OCFS2_ALLOC_H
28
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * alloc.h
5 *
6 * Function prototypes
7 *
8 * Copyright (C) 2002, 2004 Oracle. All rights reserved.

--- 12 unchanged lines hidden (view full) ---

21 * License along with this program; if not, write to the
22 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 * Boston, MA 021110-1307, USA.
24 */
25
26#ifndef OCFS2_ALLOC_H
27#define OCFS2_ALLOC_H
28
29enum ocfs2_extent_tree_type {
30 OCFS2_DINODE_EXTENT = 0,
31};
32
29struct ocfs2_alloc_context;
30int ocfs2_insert_extent(struct ocfs2_super *osb,
31 handle_t *handle,
32 struct inode *inode,
33struct ocfs2_alloc_context;
34int ocfs2_insert_extent(struct ocfs2_super *osb,
35 handle_t *handle,
36 struct inode *inode,
33 struct buffer_head *fe_bh,
37 struct buffer_head *root_bh,
34 u32 cpos,
35 u64 start_blk,
36 u32 new_clusters,
37 u8 flags,
38 u32 cpos,
39 u64 start_blk,
40 u32 new_clusters,
41 u8 flags,
38 struct ocfs2_alloc_context *meta_ac);
42 struct ocfs2_alloc_context *meta_ac,
43 enum ocfs2_extent_tree_type et_type);
39struct ocfs2_cached_dealloc_ctxt;
44struct ocfs2_cached_dealloc_ctxt;
40int ocfs2_mark_extent_written(struct inode *inode, struct buffer_head *di_bh,
45int ocfs2_mark_extent_written(struct inode *inode, struct buffer_head *root_bh,
41 handle_t *handle, u32 cpos, u32 len, u32 phys,
42 struct ocfs2_alloc_context *meta_ac,
46 handle_t *handle, u32 cpos, u32 len, u32 phys,
47 struct ocfs2_alloc_context *meta_ac,
43 struct ocfs2_cached_dealloc_ctxt *dealloc);
44int ocfs2_remove_extent(struct inode *inode, struct buffer_head *di_bh,
48 struct ocfs2_cached_dealloc_ctxt *dealloc,
49 enum ocfs2_extent_tree_type et_type);
50int ocfs2_remove_extent(struct inode *inode, struct buffer_head *root_bh,
45 u32 cpos, u32 len, handle_t *handle,
46 struct ocfs2_alloc_context *meta_ac,
51 u32 cpos, u32 len, handle_t *handle,
52 struct ocfs2_alloc_context *meta_ac,
47 struct ocfs2_cached_dealloc_ctxt *dealloc);
53 struct ocfs2_cached_dealloc_ctxt *dealloc,
54 enum ocfs2_extent_tree_type et_type);
48int ocfs2_num_free_extents(struct ocfs2_super *osb,
49 struct inode *inode,
55int ocfs2_num_free_extents(struct ocfs2_super *osb,
56 struct inode *inode,
50 struct buffer_head *bh);
57 struct buffer_head *root_bh,
58 enum ocfs2_extent_tree_type et_type);
59
51/*
52 * how many new metadata chunks would an allocation need at maximum?
53 *
54 * Please note that the caller must make sure that root_el is the root
55 * of extent tree. So for an inode, it should be &fe->id2.i_list. Otherwise
56 * the result may be wrong.
57 */
58static inline int ocfs2_extend_meta_needed(struct ocfs2_extent_list *root_el)

--- 106 unchanged lines hidden ---
60/*
61 * how many new metadata chunks would an allocation need at maximum?
62 *
63 * Please note that the caller must make sure that root_el is the root
64 * of extent tree. So for an inode, it should be &fe->id2.i_list. Otherwise
65 * the result may be wrong.
66 */
67static inline int ocfs2_extend_meta_needed(struct ocfs2_extent_list *root_el)

--- 106 unchanged lines hidden ---