Hi Alastair,
On Thu, Oct 19, 2006 at 12:31:18PM +0100, Alastair McKinstry
wrote:> on 2.6.18; it used to be
> statfs blah_statfs(struct super_block *sb, struct kstatfs * buf);
> now its:
> statfs blah_statfs(struct dentry * dentry, struct kstatfs * buf);
>
> This leads to Oops in fsfilt_ldiskfs() for me. Has anyone done a patch
> for this yet?
You can try the patch below.
Cheers,
Johann
--
Index: lustre-1.5.95/lustre/lvfs/fsfilt_ext3.c
==================================================================---
lustre-1.5.95.orig/lustre/lvfs/fsfilt_ext3.c
+++ lustre-1.5.95/lustre/lvfs/fsfilt_ext3.c
@@ -728,7 +728,11 @@ static int fsfilt_ext3_statfs(struct sup
memset(&sfs, 0, sizeof(sfs));
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18))
rc = sb->s_op->statfs(sb, &sfs);
+#else
+ rc = sb->s_op->statfs(sb->s_root, &sfs);
+#endif
if (!rc && sfs.f_bfree < sfs.f_ffree) {
sfs.f_files = (sfs.f_files - sfs.f_ffree) + sfs.f_bfree;
Index: lustre-1.5.95/lustre/obdclass/obd_mount.c
==================================================================---
lustre-1.5.95.orig/lustre/obdclass/obd_mount.c
+++ lustre-1.5.95/lustre/obdclass/obd_mount.c
@@ -1393,13 +1393,23 @@ static void server_umount_begin(struct s
EXIT;
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18))
static int server_statfs (struct super_block *sb, struct kstatfs *buf)
{
+#else
+static int server_statfs (struct dentry *de, struct kstatfs *buf)
+{
+ struct super_block *sb = de->d_sb;
+#endif
struct vfsmount *mnt = s2lsi(sb)->lsi_srv_mnt;
ENTRY;
if (mnt && mnt->mnt_sb &&
mnt->mnt_sb->s_op->statfs) {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18))
int rc = mnt->mnt_sb->s_op->statfs(mnt->mnt_sb,
buf);
+#else
+ int rc = mnt->mnt_sb->s_op->statfs(mnt->mnt_root,
buf);
+#endif
if (!rc) {
buf->f_type = sb->s_magic;
RETURN(0);
Index: lustre-1.5.95/lustre/llite/llite_internal.h
==================================================================---
lustre-1.5.95.orig/lustre/llite/llite_internal.h
+++ lustre-1.5.95/lustre/llite/llite_internal.h
@@ -511,7 +511,11 @@ struct inode *ll_inode_from_lock(struct
void ll_clear_inode(struct inode *inode);
int ll_setattr_raw(struct inode *inode, struct iattr *attr);
int ll_setattr(struct dentry *de, struct iattr *attr);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18))
int ll_statfs(struct super_block *sb, struct kstatfs *sfs);
+#else
+int ll_statfs(struct dentry *de, struct kstatfs *sfs);
+#endif
int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
__u64 max_age);
void ll_update_inode(struct inode *inode, struct lustre_md *md);
Index: lustre-1.5.95/lustre/llite/llite_lib.c
==================================================================---
lustre-1.5.95.orig/lustre/llite/llite_lib.c
+++ lustre-1.5.95/lustre/llite/llite_lib.c
@@ -1410,8 +1410,14 @@ int ll_statfs_internal(struct super_bloc
RETURN(rc);
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18))
int ll_statfs(struct super_block *sb, struct kstatfs *sfs)
{
+#else
+int ll_statfs(struct dentry *de, struct kstatfs *sfs)
+{
+ struct super_block *sb = de->d_sb;
+#endif
struct obd_statfs osfs;
int rc;