patch-2.2.6 linux/fs/ufs/super.c

Next file: linux/fs/ufs/util.h
Previous file: linux/fs/ufs/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.5/linux/fs/ufs/super.c linux/fs/ufs/super.c
@@ -125,7 +125,7 @@
 	printk("  cssize:        %u\n", SWAB32(usb1->fs_cssize));
 	printk("  cgsize:        %u\n", SWAB32(usb1->fs_cgsize));
 	printk("  fstodb:        %u\n", SWAB32(usb1->fs_fsbtodb));
-	printk("  contigsumsize: %d\n", SWAB32(usb3->fs_u.fs_44.fs_contigsumsize));
+	printk("  contigsumsize: %d\n", SWAB32(usb3->fs_u2.fs_44.fs_contigsumsize));
 	printk("  postblformat:  %u\n", SWAB32(usb3->fs_postblformat));
 	printk("  nrpos:         %u\n", SWAB32(usb3->fs_nrpos));
 	printk("  ndir           %u\n", SWAB32(usb1->fs_cstotal.cs_ndir));
@@ -269,10 +269,12 @@
 				ufs_set_opt (*mount_options, UFSTYPE_SUN);
 			else if (!strcmp (value, "44bsd"))
 				ufs_set_opt (*mount_options, UFSTYPE_44BSD);
-			else if (!strcmp (value, "next"))
-				ufs_set_opt (*mount_options, UFSTYPE_NEXT);
+			else if (!strcmp (value, "nextstep"))
+				ufs_set_opt (*mount_options, UFSTYPE_NEXTSTEP);
 			else if (!strcmp (value, "openstep"))
 				ufs_set_opt (*mount_options, UFSTYPE_OPENSTEP);
+			else if (!strcmp (value, "sunx86"))
+				ufs_set_opt (*mount_options, UFSTYPE_SUNx86);
 			else {
 				printk ("UFS-fs: Invalid type option: %s\n", value);
 				return 0;
@@ -463,7 +465,7 @@
 	}
 	if (!(sb->u.ufs_sb.s_mount_opt & UFS_MOUNT_UFSTYPE)) {
 		printk("You didn't specify the type of your ufs filesystem\n\n"
-		"       mount -t ufs -o ufstype=sun|44bsd|old|next|openstep ....\n\n"
+		"       mount -t ufs -o ufstype=sun|sunx86|44bsd|old|nextstep|openstep ....\n\n"
 		">>>WARNING<<< Wrong ufstype may corrupt your filesystem, "
 		"default is ufstype=old\n");
 		ufs_set_opt (sb->u.ufs_sb.s_mount_opt, UFSTYPE_OLD);
@@ -495,6 +497,16 @@
 		flags |= UFS_DE_OLD | UFS_UID_EFT | UFS_ST_SUN | UFS_CG_SUN;
 		break;
 
+	case UFS_MOUNT_UFSTYPE_SUNx86:
+		UFSD(("ufstype=sunx86\n"))
+		uspi->s_fsize = block_size = 1024;
+		uspi->s_fmask = ~(1024 - 1);
+		uspi->s_fshift = 10;
+		uspi->s_sbsize = super_block_size = 2048;
+		uspi->s_sbbase = 0;
+		flags |= UFS_DE_OLD | UFS_UID_EFT | UFS_ST_SUNx86 | UFS_CG_SUN;
+		break;
+
 	case UFS_MOUNT_UFSTYPE_OLD:
 		UFSD(("ufstype=old\n"))
 		uspi->s_fsize = block_size = 1024;
@@ -509,8 +521,8 @@
 		}
 		break;
 	
-	case UFS_MOUNT_UFSTYPE_NEXT:
-		UFSD(("ufstype=next\n"))
+	case UFS_MOUNT_UFSTYPE_NEXTSTEP:
+		UFSD(("ufstype=nextstep\n"))
 		uspi->s_fsize = block_size = 1024;
 		uspi->s_fmask = ~(1024 - 1);
 		uspi->s_fshift = 10;
@@ -518,7 +530,7 @@
 		uspi->s_sbbase = 0;
 		flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD;
 		if (!(sb->s_flags & MS_RDONLY)) {
-			printk(KERN_INFO "ufstype=next is supported read-only\n");
+			printk(KERN_INFO "ufstype=nextstep is supported read-only\n");
 			sb->s_flags |= MS_RDONLY;
 		}
 		break;
@@ -579,10 +591,9 @@
 	}
 #endif
 
-	if ((((sb->u.ufs_sb.s_mount_opt & UFS_MOUNT_UFSTYPE) == 
-	UFS_MOUNT_UFSTYPE_NEXT) ||
-	((sb->u.ufs_sb.s_mount_opt & UFS_MOUNT_UFSTYPE) ==
-	UFS_MOUNT_UFSTYPE_OPENSTEP)) && uspi->s_sbbase < 256) {
+	if ((((sb->u.ufs_sb.s_mount_opt & UFS_MOUNT_UFSTYPE) == UFS_MOUNT_UFSTYPE_NEXTSTEP) 
+	  || ((sb->u.ufs_sb.s_mount_opt & UFS_MOUNT_UFSTYPE) == UFS_MOUNT_UFSTYPE_OPENSTEP)) 
+	  && uspi->s_sbbase < 256) {
 		ubh_brelse_uspi(uspi);
 		ubh = NULL;
 		uspi->s_sbbase += 8;
@@ -627,9 +638,10 @@
 	 * If not, make it read only.
 	 */
 	if (((flags & UFS_ST_MASK) == UFS_ST_44BSD) ||
-	    ((flags & UFS_ST_MASK) == UFS_ST_OLD) ||
-	   (((flags & UFS_ST_MASK) == UFS_ST_SUN) && 
-	     (ufs_get_fs_state(usb3) == (UFS_FSOK - SWAB32(usb1->fs_time))))) {
+	  ((flags & UFS_ST_MASK) == UFS_ST_OLD) ||
+	  (((flags & UFS_ST_MASK) == UFS_ST_SUN || 
+	  (flags & UFS_ST_MASK) == UFS_ST_SUNx86) && 
+	  (ufs_get_fs_state(usb1, usb3) == (UFS_FSOK - SWAB32(usb1->fs_time))))) {
 		switch(usb1->fs_clean) {
 		case UFS_FSCLEAN:
 			UFSD(("fs is clean\n"))
@@ -649,8 +661,7 @@
 			sb->s_flags |= MS_RDONLY;
 			break;
 		default:
-			printk("ufs_read_super: can't grok fs_clean 0x%x\n",
-				usb1->fs_clean);
+			printk("ufs_read_super: can't grok fs_clean 0x%x\n", usb1->fs_clean);
 			sb->s_flags |= MS_RDONLY;
 			break;
 		}
@@ -694,7 +705,7 @@
 	uspi->s_nindir = SWAB32(usb1->fs_nindir);
 	uspi->s_inopb = SWAB32(usb1->fs_inopb);
 	uspi->s_nspf = SWAB32(usb1->fs_nspf);
-	uspi->s_npsect = SWAB32(usb1->fs_npsect);
+	uspi->s_npsect = ufs_get_fs_npsect(usb1, usb3);
 	uspi->s_interleave = SWAB32(usb1->fs_interleave);
 	uspi->s_trackskew = SWAB32(usb1->fs_trackskew);
 	uspi->s_csaddr = SWAB32(usb1->fs_csaddr);
@@ -706,7 +717,7 @@
 	uspi->s_ipg = SWAB32(usb1->fs_ipg);
 	uspi->s_fpg = SWAB32(usb1->fs_fpg);
 	uspi->s_cpc = SWAB32(usb2->fs_cpc);
-	uspi->s_contigsumsize = SWAB32(usb3->fs_u.fs_44.fs_contigsumsize);
+	uspi->s_contigsumsize = SWAB32(usb3->fs_u2.fs_44.fs_contigsumsize);
 	uspi->s_qbmask = ufs_get_fs_qbmask(usb3);
 	uspi->s_qfmask = ufs_get_fs_qfmask(usb3);
 	uspi->s_postblformat = SWAB32(usb3->fs_postblformat);
@@ -734,8 +745,6 @@
 	
 	sb->u.ufs_sb.s_flags = flags;
 	sb->u.ufs_sb.s_swab = swab;
-	sb->u.ufs_sb.s_rename_lock = 0;
-	sb->u.ufs_sb.s_rename_wait = NULL;
 	 	                                                          
 	sb->s_root = d_alloc_root(iget(sb, UFS_ROOTINO), NULL);
 
@@ -776,8 +785,9 @@
 
 	if (!(sb->s_flags & MS_RDONLY)) {
 		usb1->fs_time = SWAB32(CURRENT_TIME);
-		if (usb1->fs_clean == UFS_FSCLEAN && (flags&UFS_ST_MASK) == UFS_ST_SUN)
-			ufs_set_fs_state(usb3, UFS_FSOK - SWAB32(usb1->fs_time));
+		if ((flags & UFS_ST_MASK) == UFS_ST_SUN 
+		  || (flags & UFS_ST_MASK) == UFS_ST_SUNx86)
+			ufs_set_fs_state(usb1, usb3, UFS_FSOK - SWAB32(usb1->fs_time));
 		ubh_mark_buffer_dirty (USPI_UBH, 1);
 	}
 	sb->s_dirt = 0;
@@ -842,8 +852,9 @@
 	if (*mount_flags & MS_RDONLY) {
 		ufs_put_cylinder_structures(sb);
 		usb1->fs_time = SWAB32(CURRENT_TIME);
-		if (usb1->fs_clean == UFS_FSCLEAN && (flags&UFS_ST_MASK) == UFS_ST_SUN)
-			ufs_set_fs_state(usb3, UFS_FSOK - SWAB32(usb1->fs_time));
+		if ((flags & UFS_ST_MASK) == UFS_ST_SUN
+		  || (flags & UFS_ST_MASK) == UFS_ST_SUNx86) 
+			ufs_set_fs_state(usb1, usb3, UFS_FSOK - SWAB32(usb1->fs_time));
 		ubh_mark_buffer_dirty (USPI_UBH, 1);
 		sb->s_dirt = 0;
 		sb->s_flags |= MS_RDONLY;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)