From: Christoph Hellwig <hch@infradead.org>
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] sb_set_blocksize/sb_min_blocksize
Date: Mon, 29 Apr 2002 18:29:13 +0100 [thread overview]
Message-ID: <20020429182913.A22344@infradead.org> (raw)
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.
diff -uNr -Xdontdiff linux-2.4.19-pre7/fs/block_dev.c linux/fs/block_dev.c
--- linux-2.4.19-pre7/fs/block_dev.c Tue Apr 16 20:50:07 2002
+++ linux/fs/block_dev.c Mon Apr 29 16:35:04 2002
@@ -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))
diff -uNr -Xdontdiff linux-2.4.19-pre7/fs/freevxfs/vxfs_kcompat.h linux/fs/freevxfs/vxfs_kcompat.h
--- linux-2.4.19-pre7/fs/freevxfs/vxfs_kcompat.h Tue Apr 16 20:48:11 2002
+++ linux/fs/freevxfs/vxfs_kcompat.h Mon Apr 29 16:33:07 2002
@@ -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 */
diff -uNr -Xdontdiff linux-2.4.19-pre7/include/linux/fs.h linux/include/linux/fs.h
--- linux-2.4.19-pre7/include/linux/fs.h Tue Apr 16 20:48:18 2002
+++ linux/include/linux/fs.h Mon Apr 29 16:32:42 2002
@@ -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)
{
diff -uNr -Xdontdiff linux-2.4.19-pre7/kernel/ksyms.c linux/kernel/ksyms.c
--- linux-2.4.19-pre7/kernel/ksyms.c Tue Apr 16 20:46:39 2002
+++ linux/kernel/ksyms.c Mon Apr 29 16:35:30 2002
@@ -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);
reply other threads:[~2002-04-29 17:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020429182913.A22344@infradead.org \
--to=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).