aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/hfsplus_fs.h
diff options
context:
space:
mode:
authorSeth Forshee <seth.forshee@canonical.com>2011-07-18 11:06:23 -0400
committerChristoph Hellwig <hch@lst.de>2011-07-22 10:37:44 -0400
commit6596528e391ad978a6a120142cba97a1d7324cb6 (patch)
tree9f9ad6f52b9665074545639c54399e2680e6c889 /fs/hfsplus/hfsplus_fs.h
parentaac4e4198eff7f9551d586c55342403d49249d95 (diff)
hfsplus: ensure bio requests are not smaller than the hardware sectors
Currently all bio requests are 512 bytes, which may fail for media whose physical sector size is larger than this. Ensure these requests are not smaller than the block device logical block size. BugLink: http://bugs.launchpad.net/bugs/734883 Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/hfsplus/hfsplus_fs.h')
-rw-r--r--fs/hfsplus/hfsplus_fs.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h
index 0bebf7488feb..81dfd1e495e3 100644
--- a/fs/hfsplus/hfsplus_fs.h
+++ b/fs/hfsplus/hfsplus_fs.h
@@ -13,6 +13,7 @@
13#include <linux/fs.h> 13#include <linux/fs.h>
14#include <linux/mutex.h> 14#include <linux/mutex.h>
15#include <linux/buffer_head.h> 15#include <linux/buffer_head.h>
16#include <linux/blkdev.h>
16#include "hfsplus_raw.h" 17#include "hfsplus_raw.h"
17 18
18#define DBG_BNODE_REFS 0x00000001 19#define DBG_BNODE_REFS 0x00000001
@@ -110,7 +111,9 @@ struct hfsplus_vh;
110struct hfs_btree; 111struct hfs_btree;
111 112
112struct hfsplus_sb_info { 113struct hfsplus_sb_info {
114 void *s_vhdr_buf;
113 struct hfsplus_vh *s_vhdr; 115 struct hfsplus_vh *s_vhdr;
116 void *s_backup_vhdr_buf;
114 struct hfsplus_vh *s_backup_vhdr; 117 struct hfsplus_vh *s_backup_vhdr;
115 struct hfs_btree *ext_tree; 118 struct hfs_btree *ext_tree;
116 struct hfs_btree *cat_tree; 119 struct hfs_btree *cat_tree;
@@ -258,6 +261,15 @@ struct hfsplus_readdir_data {
258 struct hfsplus_cat_key key; 261 struct hfsplus_cat_key key;
259}; 262};
260 263
264/*
265 * Find minimum acceptible I/O size for an hfsplus sb.
266 */
267static inline unsigned short hfsplus_min_io_size(struct super_block *sb)
268{
269 return max_t(unsigned short, bdev_logical_block_size(sb->s_bdev),
270 HFSPLUS_SECTOR_SIZE);
271}
272
261#define hfs_btree_open hfsplus_btree_open 273#define hfs_btree_open hfsplus_btree_open
262#define hfs_btree_close hfsplus_btree_close 274#define hfs_btree_close hfsplus_btree_close
263#define hfs_btree_write hfsplus_btree_write 275#define hfs_btree_write hfsplus_btree_write
@@ -436,8 +448,8 @@ int hfsplus_compare_dentry(const struct dentry *parent,
436/* wrapper.c */ 448/* wrapper.c */
437int hfsplus_read_wrapper(struct super_block *); 449int hfsplus_read_wrapper(struct super_block *);
438int hfs_part_find(struct super_block *, sector_t *, sector_t *); 450int hfs_part_find(struct super_block *, sector_t *, sector_t *);
439int hfsplus_submit_bio(struct block_device *bdev, sector_t sector, 451int hfsplus_submit_bio(struct super_block *sb, sector_t sector,
440 void *data, int rw); 452 void *buf, void **data, int rw);
441 453
442/* time macros */ 454/* time macros */
443#define __hfsp_mt2ut(t) (be32_to_cpu(t) - 2082844800U) 455#define __hfsp_mt2ut(t) (be32_to_cpu(t) - 2082844800U)