sb_set_blocksize/sb_min_blocksize
PATCH 1/1 sb_set_blocksize/sb_min_blocksize
These two have been in 2.5 for ages and also in the VxFS compat header. Make the global so other filesystems can used them aswell. ACKed by Al.
fs/block_dev.c +20 -0
@@ -102,6 +102,26 @@return 0 ; } +int sb_set_blocksize (struct super_block *sb,int size) +{ +int bits; +if (set_blocksize (sb->s_dev, size) <0 ) +return 0 ; + sb->s_blocksize = size; +for (bits =9 , size >>=9 ; size >>=1 ; bits++) + ; + sb->s_blocksize_bits = bits; +return sb->s_blocksize; +} + +int sb_min_blocksize (struct super_block *sb,int size) +{ +int minsize =get_hardsect_size (sb->s_dev); +if (size < minsize) + size = minsize; +return sb_set_blocksize (sb, size); +} +static int blkdev_get_block (struct inode * inode,long iblock,struct buffer_head * bh,int create) {if (iblock >=max_block (inode->i_rdev))
fs/freevxfs/vxfs_kcompat.h +0 -22
@@ -17,27 +17,5 @@ bh->b_blocknr = block; } -/* From fs/block_dev.c (Linux 2.5.2-pre2) */ -static inline int sb_set_blocksize (struct super_block *sb,int size) -{ -int bits; -if (set_blocksize (sb->s_dev, size) <0 ) -return 0 ; - sb->s_blocksize = size; -for (bits =9 , size >>=9 ; size >>=1 ; bits++) - ; - sb->s_blocksize_bits = bits; -return sb->s_blocksize; -} - -/* Dito. */ -static inline int sb_min_blocksize (struct super_block *sb,int size) -{ -int minsize =get_hardsect_size (sb->s_dev); -if (size < minsize) - size = minsize; -return sb_set_blocksize (sb, size); -} -#endif /* Kernel 2.4 */ #endif /* _VXFS_KCOMPAT_H */
include/linux/fs.h +2 -0
@@ -1375,6 +1375,8 @@__bforget (buf); }extern int set_blocksize (kdev_t ,int ); +extern int sb_set_blocksize (struct super_block *,int ); +extern int sb_min_blocksize (struct super_block *,int );extern struct buffer_head *bread (kdev_t ,int ,int );static inline struct buffer_head *sb_bread (struct super_block *sb,int block) {
kernel/ksyms.c +2 -0
@@ -188,6 +188,8 @@EXPORT_SYMBOL (write_inode_now);EXPORT_SYMBOL (notify_change);EXPORT_SYMBOL (set_blocksize); +EXPORT_SYMBOL (sb_set_blocksize); +EXPORT_SYMBOL (sb_min_blocksize);EXPORT_SYMBOL (getblk);EXPORT_SYMBOL (cdget);EXPORT_SYMBOL (cdput);