From: Christoph Hellwig <hch@lst.de>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] kill compat clutter for statfs
Date: Fri Aug 13 16:59:08 2004 [thread overview]
Message-ID: <20040813215903.GA15397@lst.de> (raw)
Index: src/super.c
===================================================================
--- src/super.c (revision 1355)
+++ src/super.c (working copy)
@@ -170,11 +170,11 @@
static void ocfs_free_mem_lists (void);
static void ocfs_delete_osb (ocfs_super * osb);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static int ocfs_statfs (struct super_block *sb, struct kstatfs *buf);
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static int ocfs_sync_fs(struct super_block *sb, int wait);
#else
-static int ocfs_statfs (struct super_block *sb, struct statfs *buf);
static int ocfs_sync_fs(struct super_block *sb);
#endif
@@ -725,11 +725,7 @@
* ocfs_statfs()
*
*/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static int ocfs_statfs(struct super_block *sb, struct kstatfs *buf)
-#else
-static int ocfs_statfs(struct super_block *sb, struct statfs *buf)
-#endif
{
ocfs_super *osb;
__u32 numbits, freebits;
@@ -780,27 +776,15 @@
buf->f_bsize = sb->s_blocksize;
buf->f_namelen = OCFS2_MAX_FILENAME_LENGTH;
buf->f_bavail = buf->f_bfree;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- buf->f_blocks =
- (unsigned long) ((unsigned long) (numbits) *
- (unsigned long) (osb->s_clustersize >> osb->sb->s_blocksize_bits) -
- reserved_bits);
- buf->f_bfree =
- (unsigned long) (freebits * (osb->s_clustersize >> osb->sb->s_blocksize_bits));
+ buf->f_blocks = (sector_t) ((unsigned long) (numbits) *
+ (unsigned long) (osb->s_clustersize >>
+ osb->sb->s_blocksize_bits) -
+ reserved_bits);
+ buf->f_bfree = (sector_t) (freebits *
+ (osb->s_clustersize >> osb->sb->s_blocksize_bits));
buf->f_bavail = buf->f_bfree;
- buf->f_files = (unsigned long) (numbits);
- buf->f_ffree = (unsigned long) (numbits) - freebits;
-#else
- buf->f_blocks =
- (sector_t) ((unsigned long) (numbits) *
- (unsigned long) (osb->s_clustersize >> osb->sb->s_blocksize_bits) -
- reserved_bits);
- buf->f_bfree =
- (sector_t) (freebits * (osb->s_clustersize >> osb->sb->s_blocksize_bits));
- buf->f_bavail = buf->f_bfree;
buf->f_files = (sector_t) (numbits);
buf->f_ffree = (sector_t) (numbits) - freebits;
-#endif
brelse(bh);
Index: src/ocfs_compat.h
===================================================================
--- src/ocfs_compat.h (revision 1355)
+++ src/ocfs_compat.h (working copy)
@@ -153,6 +153,8 @@
return (u64)((MAJOR(dev) << 8) | MINOR(dev));
}
+#define kstatfs statfs
+
#else /* LINUX_VERSION_CODE < 2.6 */
#define OCFS_GENERIC_SB_MEMBER(sb) ((sb)->s_fs_info)
reply other threads:[~2004-08-13 16:59 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=20040813215903.GA15397@lst.de \
--to=hch@lst.de \
--cc=ocfs2-devel@oss.oracle.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.