X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Faffs%2Fsuper.c;fp=fs%2Faffs%2Fsuper.c;h=5200f4938df094a3cff4ba5a4f1547c0a2812bff;hb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;hp=4d7e5b19e5cd20b99d76de5e53743dd9836704de;hpb=4e76c8a9fa413ccc09d3f7f664183dcce3555d57;p=linux-2.6.git diff --git a/fs/affs/super.c b/fs/affs/super.c index 4d7e5b19e..5200f4938 100644 --- a/fs/affs/super.c +++ b/fs/affs/super.c @@ -18,7 +18,7 @@ extern struct timezone sys_tz; -static int affs_statfs(struct super_block *sb, struct kstatfs *buf); +static int affs_statfs(struct dentry *dentry, struct kstatfs *buf); static int affs_remount (struct super_block *sb, int *flags, char *data); static void @@ -271,6 +271,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent) int reserved; unsigned long mount_flags; int tmp_flags; /* fix remount prototype... */ + u8 sig[4]; pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options"); @@ -370,8 +371,9 @@ got_root: printk(KERN_ERR "AFFS: Cannot read boot block\n"); goto out_error; } - chksum = be32_to_cpu(*(__be32 *)boot_bh->b_data); + memcpy(sig, boot_bh->b_data, 4); brelse(boot_bh); + chksum = be32_to_cpu(*(__be32 *)sig); /* Dircache filesystems are compatible with non-dircache ones * when reading. As long as they aren't supported, writing is @@ -420,11 +422,11 @@ got_root: } if (mount_flags & SF_VERBOSE) { - chksum = cpu_to_be32(chksum); - printk(KERN_NOTICE "AFFS: Mounting volume \"%*s\": Type=%.3s\\%c, Blocksize=%d\n", - AFFS_ROOT_TAIL(sb, root_bh)->disk_name[0], + u8 len = AFFS_ROOT_TAIL(sb, root_bh)->disk_name[0]; + printk(KERN_NOTICE "AFFS: Mounting volume \"%.*s\": Type=%.3s\\%c, Blocksize=%d\n", + len > 31 ? 31 : len, AFFS_ROOT_TAIL(sb, root_bh)->disk_name + 1, - (char *)&chksum,((char *)&chksum)[3] + '0',blocksize); + sig, sig[3] + '0', blocksize); } sb->s_flags |= MS_NODEV | MS_NOSUID; @@ -508,8 +510,9 @@ affs_remount(struct super_block *sb, int *flags, char *data) } static int -affs_statfs(struct super_block *sb, struct kstatfs *buf) +affs_statfs(struct dentry *dentry, struct kstatfs *buf) { + struct super_block *sb = dentry->d_sb; int free; pr_debug("AFFS: statfs() partsize=%d, reserved=%d\n",AFFS_SB(sb)->s_partition_size, @@ -524,10 +527,11 @@ affs_statfs(struct super_block *sb, struct kstatfs *buf) return 0; } -static struct super_block *affs_get_sb(struct file_system_type *fs_type, - int flags, const char *dev_name, void *data) +static int affs_get_sb(struct file_system_type *fs_type, + int flags, const char *dev_name, void *data, struct vfsmount *mnt) { - return get_sb_bdev(fs_type, flags, dev_name, data, affs_fill_super); + return get_sb_bdev(fs_type, flags, dev_name, data, affs_fill_super, + mnt); } static struct file_system_type affs_fs_type = {