aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dir.h
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2007-09-07 21:21:26 -0400
committerMark Fasheh <mark.fasheh@oracle.com>2007-10-12 14:54:36 -0400
commit316f4b9f98a353ac1be93199694fd97272378815 (patch)
treec54f7feb08fc1693f64879d8a3edc18cf3bb2713 /fs/ocfs2/dir.h
parent1d410a6e337a0d2d5543ad1d9bccb670a7a05312 (diff)
ocfs2: Move directory manipulation code into dir.c
The code for adding, removing, deleting directory entries was splattered all over namei.c. I'd rather have this all centralized, so that it's easier to make changes for inline dir data, and eventually indexed directories. None of the code in any of the functions was changed. I only removed the static keyword from some prototypes so that they could be exported. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com> Reviewed-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/dir.h')
-rw-r--r--fs/ocfs2/dir.h44
1 files changed, 37 insertions, 7 deletions
diff --git a/fs/ocfs2/dir.h b/fs/ocfs2/dir.h
index 3f67e146864a..7bf9c0a01cdf 100644
--- a/fs/ocfs2/dir.h
+++ b/fs/ocfs2/dir.h
@@ -26,6 +26,31 @@
26#ifndef OCFS2_DIR_H 26#ifndef OCFS2_DIR_H
27#define OCFS2_DIR_H 27#define OCFS2_DIR_H
28 28
29struct buffer_head *ocfs2_find_entry(const char *name,
30 int namelen,
31 struct inode *dir,
32 struct ocfs2_dir_entry **res_dir);
33int ocfs2_delete_entry(handle_t *handle,
34 struct inode *dir,
35 struct ocfs2_dir_entry *de_del,
36 struct buffer_head *bh);
37int __ocfs2_add_entry(handle_t *handle,
38 struct inode *dir,
39 const char *name, int namelen,
40 struct inode *inode, u64 blkno,
41 struct buffer_head *parent_fe_bh,
42 struct buffer_head *insert_bh);
43static inline int ocfs2_add_entry(handle_t *handle,
44 struct dentry *dentry,
45 struct inode *inode, u64 blkno,
46 struct buffer_head *parent_fe_bh,
47 struct buffer_head *insert_bh)
48{
49 return __ocfs2_add_entry(handle, dentry->d_parent->d_inode,
50 dentry->d_name.name, dentry->d_name.len,
51 inode, blkno, parent_fe_bh, insert_bh);
52}
53
29int ocfs2_check_dir_for_entry(struct inode *dir, 54int ocfs2_check_dir_for_entry(struct inode *dir,
30 const char *name, 55 const char *name,
31 int namelen); 56 int namelen);
@@ -44,11 +69,16 @@ int ocfs2_prepare_dir_for_insert(struct ocfs2_super *osb,
44 int namelen, 69 int namelen,
45 struct buffer_head **ret_de_bh); 70 struct buffer_head **ret_de_bh);
46struct ocfs2_alloc_context; 71struct ocfs2_alloc_context;
47int ocfs2_do_extend_dir(struct super_block *sb, 72int ocfs2_fill_new_dir(struct ocfs2_super *osb,
48 handle_t *handle, 73 handle_t *handle,
49 struct inode *dir, 74 struct inode *parent,
50 struct buffer_head *parent_fe_bh, 75 struct inode *inode,
51 struct ocfs2_alloc_context *data_ac, 76 struct buffer_head *fe_bh,
52 struct ocfs2_alloc_context *meta_ac, 77 struct ocfs2_alloc_context *data_ac);
53 struct buffer_head **new_bh); 78
79int ocfs2_check_dir_entry(struct inode *dir,
80 struct ocfs2_dir_entry *de,
81 struct buffer_head *bh,
82 unsigned long offset);
83
54#endif /* OCFS2_DIR_H */ 84#endif /* OCFS2_DIR_H */