* [Ocfs2-devel] [PATCH] kill compat clutter for statfs
@ 2004-08-13 16:59 Christoph Hellwig
0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2004-08-13 16:59 UTC (permalink / raw)
To: ocfs2-devel
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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-08-13 16:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-13 16:59 [Ocfs2-devel] [PATCH] kill compat clutter for statfs Christoph Hellwig
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.