0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef OCFS2_BUFFER_HEAD_IO_H
0011 #define OCFS2_BUFFER_HEAD_IO_H
0012
0013 #include <linux/buffer_head.h>
0014
0015 int ocfs2_write_block(struct ocfs2_super *osb,
0016 struct buffer_head *bh,
0017 struct ocfs2_caching_info *ci);
0018 int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block,
0019 unsigned int nr, struct buffer_head *bhs[]);
0020
0021
0022
0023
0024
0025
0026
0027
0028 int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
0029 struct buffer_head *bhs[], int flags,
0030 int (*validate)(struct super_block *sb,
0031 struct buffer_head *bh));
0032
0033 int ocfs2_write_super_or_backup(struct ocfs2_super *osb,
0034 struct buffer_head *bh);
0035
0036 #define OCFS2_BH_IGNORE_CACHE 1
0037 #define OCFS2_BH_READAHEAD 8
0038
0039 static inline int ocfs2_read_block(struct ocfs2_caching_info *ci, u64 off,
0040 struct buffer_head **bh,
0041 int (*validate)(struct super_block *sb,
0042 struct buffer_head *bh))
0043 {
0044 int status = 0;
0045
0046 if (bh == NULL) {
0047 printk("ocfs2: bh == NULL\n");
0048 status = -EINVAL;
0049 goto bail;
0050 }
0051
0052 status = ocfs2_read_blocks(ci, off, 1, bh, 0, validate);
0053
0054 bail:
0055 return status;
0056 }
0057
0058 #endif