1 From: Joel Becker <joel.becker@oracle.com>
2 Subject: ocfs2: Move ocfs2_bread() into dir.c
5 dir.c is the only place using ocfs2_bread(), so let's make it static to
8 Signed-off-by: Joel Becker <joel.becker@oracle.com>
9 Signed-off-by: Mark Fasheh <mfasheh@suse.com>
11 fs/ocfs2/dir.c | 43 +++++++++++++++++++++++++++++++++++++++++++
12 fs/ocfs2/inode.c | 50 --------------------------------------------------
13 fs/ocfs2/inode.h | 2 --
14 3 files changed, 43 insertions(+), 52 deletions(-)
16 Index: linux-2.6.27/fs/ocfs2/dir.c
17 ===================================================================
18 --- linux-2.6.27.orig/fs/ocfs2/dir.c
19 +++ linux-2.6.27/fs/ocfs2/dir.c
20 @@ -82,6 +82,49 @@ static int ocfs2_do_extend_dir(struct su
21 struct ocfs2_alloc_context *meta_ac,
22 struct buffer_head **new_bh);
24 +static struct buffer_head *ocfs2_bread(struct inode *inode,
25 + int block, int *err, int reada)
27 + struct buffer_head *bh = NULL;
30 + int readflags = OCFS2_BH_CACHED;
33 + readflags |= OCFS2_BH_READAHEAD;
35 + if (((u64)block << inode->i_sb->s_blocksize_bits) >=
36 + i_size_read(inode)) {
41 + down_read(&OCFS2_I(inode)->ip_alloc_sem);
42 + tmperr = ocfs2_extent_map_get_blocks(inode, block, &p_blkno, NULL,
44 + up_read(&OCFS2_I(inode)->ip_alloc_sem);
50 + tmperr = ocfs2_read_blocks(inode, p_blkno, 1, &bh, readflags);
68 * bh passed here can be an inode block or a dir data block, depending
69 * on the inode inline data flag.
70 Index: linux-2.6.27/fs/ocfs2/inode.c
71 ===================================================================
72 --- linux-2.6.27.orig/fs/ocfs2/inode.c
73 +++ linux-2.6.27/fs/ocfs2/inode.c
74 @@ -1133,56 +1133,6 @@ void ocfs2_drop_inode(struct inode *inod
78 - * TODO: this should probably be merged into ocfs2_get_block
80 - * However, you now need to pay attention to the cont_prepare_write()
81 - * stuff in ocfs2_get_block (that is, ocfs2_get_block pretty much
82 - * expects never to extend).
84 -struct buffer_head *ocfs2_bread(struct inode *inode,
85 - int block, int *err, int reada)
87 - struct buffer_head *bh = NULL;
90 - int readflags = OCFS2_BH_CACHED;
93 - readflags |= OCFS2_BH_READAHEAD;
95 - if (((u64)block << inode->i_sb->s_blocksize_bits) >=
96 - i_size_read(inode)) {
101 - down_read(&OCFS2_I(inode)->ip_alloc_sem);
102 - tmperr = ocfs2_extent_map_get_blocks(inode, block, &p_blkno, NULL,
104 - up_read(&OCFS2_I(inode)->ip_alloc_sem);
106 - mlog_errno(tmperr);
110 - tmperr = ocfs2_read_blocks(inode, p_blkno, 1, &bh, readflags);
128 * This is called from our getattr.
130 int ocfs2_inode_revalidate(struct dentry *dentry)
131 Index: linux-2.6.27/fs/ocfs2/inode.h
132 ===================================================================
133 --- linux-2.6.27.orig/fs/ocfs2/inode.h
134 +++ linux-2.6.27/fs/ocfs2/inode.h
135 @@ -117,8 +117,6 @@ extern struct kmem_cache *ocfs2_inode_ca
137 extern const struct address_space_operations ocfs2_aops;
139 -struct buffer_head *ocfs2_bread(struct inode *inode, int block,
140 - int *err, int reada);
141 void ocfs2_clear_inode(struct inode *inode);
142 void ocfs2_delete_inode(struct inode *inode);
143 void ocfs2_drop_inode(struct inode *inode);