/*
* linux/fs/ufs/super.c
*
* Copyright (C) 1998
* Daniel Pirkl <daniel.pirkl@email.cz>
* Charles University, Faculty of Mathematics and Physics
*/
/* Derived from
*
* linux/fs/ext2/super.c
*
* Copyright (C) 1992, 1993, 1994, 1995
* Remy Card (card@masi.ibp.fr)
* Laboratoire MASI - Institut Blaise Pascal
* Universite Pierre et Marie Curie (Paris VI)
*
* from
*
* linux/fs/minix/inode.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*
* Big-endian to little-endian byte-swapping/bitmaps by
* David S. Miller (davem@caip.rutgers.edu), 1995
*/
/*
* Inspired by
*
* linux/fs/ufs/super.c
*
* Copyright (C) 1996
* Adrian Rodriguez (adrian@franklins-tower.rutgers.edu)
* Laboratory for Computer Science Research Computing Facility
* Rutgers, The State University of New Jersey
*
* Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
*
* Kernel module support added on 96/04/26 by
* Stefan Reinauer <stepan@home.culture.mipt.ru>
*
* Module usage counts added on 96/04/29 by
* Gertjan van Wingerde <gertjan@cs.vu.nl>
*
* Clean swab support on 19970406 by
* Francois-Rene Rideau <fare@tunes.org>
*
* 4.4BSD (FreeBSD) support added on February 1st 1998 by
* Niels Kristian Bech Jensen <nkbj@image.dk> partially based
* on code by Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>.
*
* NeXTstep support added on February 5th 1998 by
* Niels Kristian Bech Jensen <nkbj@image.dk>.
*
* write support Daniel Pirkl <daniel.pirkl@email.cz> 1998
*
* HP/UX hfs filesystem support added by
* Martin K. Petersen <mkp@mkp.net>, August 1999
*
* UFS2 (of FreeBSD 5.x) support added by
* Niraj Kumar <niraj17@iitbombay.org>, Jan 2004
*
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/bitops.h>
#include <stdarg.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/ufs_fs.h>
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/blkdev.h>
#include <linux/init.h>
#include <linux/parser.h>
#include <linux/smp_lock.h>
#include <linux/buffer_head.h>
#include <linux/vfs.h>
#include "swab.h"
#include "util.h"
#undef UFS_SUPER_DEBUG
#undef UFS_SUPER_DEBUG_MORE
#undef UFS_SUPER_DEBUG_MORE
#ifdef UFS_SUPER_DEBUG
#define UFSD(x) printk("(%s, %d), %s: ", __FILE__, __LINE__, __FUNCTION__); printk x;
#else
#define UFSD(x)
#endif
#ifdef UFS_SUPER_DEBUG_MORE
/*
* Print contents of ufs_super_block, useful for debugging
*/
void ufs_print_super_stuff(struct super_block *sb,
struct ufs_super_block_first * usb1,
struct ufs_super_block_second * usb2,
struct ufs_super_block_third * usb3)
{
printk("ufs_print_super_stuff\n");
printk("size of usb: %u\n", sizeof(struct ufs_super_block));
printk(" magic: 0x%x\n", fs32_to_cpu(sb, usb3->fs_magic));
printk(" sblkno: %u\n", fs32_to_cpu(sb, usb1->fs_sblkno));
printk(" cblkno: %u\n", fs32_to_cpu(sb, usb1->fs_cblkno));
printk(" iblkno: %u\n", fs32_to_cpu(sb, usb1->fs_iblkno));
printk(" dblkno: %u\n", fs32_to_cpu(sb, usb1->fs_dblkno));
printk(" cgoffset: %u\n", fs32_to_cpu(sb,