Lines Matching refs:uspi
101 struct ufs_sb_private_info *uspi = UFS_SB(sb)->s_uspi;
104 if (ino < UFS_ROOTINO || ino > uspi->s_ncg * uspi->s_ipg)
280 struct ufs_sb_private_info * uspi;
284 uspi = UFS_SB(sb)->s_uspi;
285 usb1 = ubh_get_usb_first(uspi);
289 ubh_mark_buffer_dirty(USPI_UBH(uspi));
312 struct ufs_sb_private_info * uspi;
317 uspi = UFS_SB(sb)->s_uspi;
318 usb1 = ubh_get_usb_first(uspi);
322 ubh_mark_buffer_dirty(USPI_UBH(uspi));
475 struct ufs_sb_private_info *uspi = sbi->s_uspi;
482 usb1 = ubh_get_usb_first(uspi);
483 usb2 = ubh_get_usb_second(uspi);
484 usb3 = ubh_get_usb_third(uspi);
490 uspi->cs_total.cs_ndir = fs64_to_cpu(sb, usb2->fs_un.fs_u2.cs_ndir);
491 uspi->cs_total.cs_nbfree = fs64_to_cpu(sb, usb2->fs_un.fs_u2.cs_nbfree);
492 uspi->cs_total.cs_nifree = fs64_to_cpu(sb, usb3->fs_un1.fs_u2.cs_nifree);
493 uspi->cs_total.cs_nffree = fs64_to_cpu(sb, usb3->fs_un1.fs_u2.cs_nffree);
495 uspi->cs_total.cs_ndir = fs32_to_cpu(sb, usb1->fs_cstotal.cs_ndir);
496 uspi->cs_total.cs_nbfree = fs32_to_cpu(sb, usb1->fs_cstotal.cs_nbfree);
497 uspi->cs_total.cs_nifree = fs32_to_cpu(sb, usb1->fs_cstotal.cs_nifree);
498 uspi->cs_total.cs_nffree = fs32_to_cpu(sb, usb1->fs_cstotal.cs_nffree);
509 struct ufs_sb_private_info *uspi = sbi->s_uspi;
517 usb3 = ubh_get_usb_third(uspi);
522 size = uspi->s_cssize;
523 blks = (size + uspi->s_fsize - 1) >> uspi->s_fshift;
528 for (i = 0; i < blks; i += uspi->s_fpb) {
529 size = uspi->s_bsize;
530 if (i + uspi->s_fpb > blks)
531 size = (blks - i) * uspi->s_fsize;
533 ubh = ubh_bread(sb, uspi->s_csaddr + i, size);
549 if (!(sbi->s_ucg = kmalloc (sizeof(struct buffer_head *) * uspi->s_ncg, GFP_KERNEL)))
551 for (i = 0; i < uspi->s_ncg; i++)
557 for (i = 0; i < uspi->s_ncg; i++) {
578 for (i = 0; i < uspi->s_ncg; i++)
595 struct ufs_sb_private_info *uspi = UFS_SB(sb)->s_uspi;
601 usb1 = ubh_get_usb_first(uspi);
602 usb2 = ubh_get_usb_second(uspi);
603 usb3 = ubh_get_usb_third(uspi);
610 cpu_to_fs64(sb, uspi->cs_total.cs_ndir);
612 cpu_to_fs64(sb, uspi->cs_total.cs_nbfree);
614 cpu_to_fs64(sb, uspi->cs_total.cs_nifree);
616 cpu_to_fs64(sb, uspi->cs_total.cs_nffree);
619 cpu_to_fs32(sb, uspi->cs_total.cs_ndir);
621 cpu_to_fs32(sb, uspi->cs_total.cs_nbfree);
623 cpu_to_fs32(sb, uspi->cs_total.cs_nifree);
625 cpu_to_fs32(sb, uspi->cs_total.cs_nffree);
627 ubh_mark_buffer_dirty(USPI_UBH(uspi));
641 struct ufs_sb_private_info *uspi = sbi->s_uspi;
652 size = uspi->s_cssize;
653 blks = (size + uspi->s_fsize - 1) >> uspi->s_fshift;
655 for (i = 0; i < blks; i += uspi->s_fpb) {
656 size = uspi->s_bsize;
657 if (i + uspi->s_fpb > blks)
658 size = (blks - i) * uspi->s_fsize;
660 ubh = ubh_bread(sb, uspi->s_csaddr + i, size);
674 for (i = 0; i < uspi->s_ncg; i++)
687 struct ufs_sb_private_info * uspi;
699 uspi = NULL;
739 uspi = kzalloc(sizeof(struct ufs_sb_private_info), GFP_KERNEL);
740 sbi->s_uspi = uspi;
741 if (!uspi)
743 uspi->s_dirblksize = UFS_SECTOR_SIZE;
752 uspi->s_fsize = block_size = 512;
753 uspi->s_fmask = ~(512 - 1);
754 uspi->s_fshift = 9;
755 uspi->s_sbsize = super_block_size = 1536;
756 uspi->s_sbbase = 0;
762 uspi->s_fsize = block_size = 512;
763 uspi->s_fmask = ~(512 - 1);
764 uspi->s_fshift = 9;
765 uspi->s_sbsize = super_block_size = 1536;
766 uspi->s_sbbase = 0;
772 uspi->s_fsize = block_size = 1024;
773 uspi->s_fmask = ~(1024 - 1);
774 uspi->s_fshift = 10;
775 uspi->s_sbsize = super_block_size = 2048;
776 uspi->s_sbbase = 0;
777 uspi->s_maxsymlinklen = 0; /* Not supported on disk */
783 uspi->s_fsize = block_size = 1024;
784 uspi->s_fmask = ~(1024 - 1);
785 uspi->s_fshift = 10;
786 uspi->s_sbsize = 2048;
788 uspi->s_sbbase = 0;
789 uspi->s_maxsymlinklen = 0; /* Not supported on disk */
795 uspi->s_fsize = block_size = 1024;
796 uspi->s_fmask = ~(1024 - 1);
797 uspi->s_fshift = 10;
798 uspi->s_sbsize = super_block_size = 2048;
799 uspi->s_sbbase = 0;
800 uspi->s_maxsymlinklen = 0; /* Not supported on disk */
806 uspi->s_fsize = block_size = 1024;
807 uspi->s_fmask = ~(1024 - 1);
808 uspi->s_fshift = 10;
809 uspi->s_sbsize = super_block_size = 2048;
810 uspi->s_sbbase = 0;
821 uspi->s_fsize = block_size = 1024;
822 uspi->s_fmask = ~(1024 - 1);
823 uspi->s_fshift = 10;
824 uspi->s_sbsize = super_block_size = 2048;
825 uspi->s_sbbase = 0;
826 uspi->s_dirblksize = 1024;
837 uspi->s_fsize = block_size = 2048;
838 uspi->s_fmask = ~(2048 - 1);
839 uspi->s_fshift = 11;
840 uspi->s_sbsize = super_block_size = 2048;
841 uspi->s_sbbase = 0;
842 uspi->s_dirblksize = 1024;
853 uspi->s_fsize = block_size = 1024;
854 uspi->s_fmask = ~(1024 - 1);
855 uspi->s_fshift = 10;
856 uspi->s_sbsize = super_block_size = 2048;
857 uspi->s_sbbase = 0;
858 uspi->s_dirblksize = 1024;
869 uspi->s_fsize = block_size = 1024;
870 uspi->s_fmask = ~(1024 - 1);
871 uspi->s_fshift = 10;
872 uspi->s_sbsize = super_block_size = 2048;
873 uspi->s_sbbase = 0;
897 ubh = ubh_bread_uspi(uspi, sb, uspi->s_sbbase + super_block_offset/block_size, super_block_size);
902 usb1 = ubh_get_usb_first(uspi);
903 usb2 = ubh_get_usb_second(uspi);
904 usb3 = ubh_get_usb_third(uspi);
907 uspi->s_postblformat = fs32_to_cpu(sb, usb3->fs_postblformat);
909 (uspi->s_postblformat != UFS_42POSTBLFMT)) {
918 switch ((uspi->fs_magic = fs32_to_cpu(sb, usb3->fs_magic))) {
928 switch ((uspi->fs_magic = fs32_to_cpu(sb, usb3->fs_magic))) {
941 && uspi->s_sbbase < 256) {
942 ubh_brelse_uspi(uspi);
944 uspi->s_sbbase += 8;
955 uspi->s_bsize = fs32_to_cpu(sb, usb1->fs_bsize);
956 uspi->s_fsize = fs32_to_cpu(sb, usb1->fs_fsize);
957 uspi->s_sbsize = fs32_to_cpu(sb, usb1->fs_sbsize);
958 uspi->s_fmask = fs32_to_cpu(sb, usb1->fs_fmask);
959 uspi->s_fshift = fs32_to_cpu(sb, usb1->fs_fshift);
961 if (!is_power_of_2(uspi->s_fsize)) {
963 uspi->s_fsize);
966 if (uspi->s_fsize < 512) {
968 uspi->s_fsize);
971 if (uspi->s_fsize > 4096) {
973 uspi->s_fsize);
976 if (!is_power_of_2(uspi->s_bsize)) {
978 uspi->s_bsize);
981 if (uspi->s_bsize < 4096) {
983 uspi->s_bsize);
986 if (uspi->s_bsize / uspi->s_fsize > 8) {
988 uspi->s_bsize / uspi->s_fsize);
991 if (uspi->s_fsize != block_size || uspi->s_sbsize != super_block_size) {
992 ubh_brelse_uspi(uspi);
994 block_size = uspi->s_fsize;
995 super_block_size = uspi->s_sbsize;
1052 uspi->s_sblkno = fs32_to_cpu(sb, usb1->fs_sblkno);
1053 uspi->s_cblkno = fs32_to_cpu(sb, usb1->fs_cblkno);
1054 uspi->s_iblkno = fs32_to_cpu(sb, usb1->fs_iblkno);
1055 uspi->s_dblkno = fs32_to_cpu(sb, usb1->fs_dblkno);
1056 uspi->s_cgoffset = fs32_to_cpu(sb, usb1->fs_cgoffset);
1057 uspi->s_cgmask = fs32_to_cpu(sb, usb1->fs_cgmask);
1060 uspi->s_u2_size = fs64_to_cpu(sb, usb3->fs_un1.fs_u2.fs_size);
1061 uspi->s_u2_dsize = fs64_to_cpu(sb, usb3->fs_un1.fs_u2.fs_dsize);
1063 uspi->s_size = fs32_to_cpu(sb, usb1->fs_size);
1064 uspi->s_dsize = fs32_to_cpu(sb, usb1->fs_dsize);
1067 uspi->s_ncg = fs32_to_cpu(sb, usb1->fs_ncg);
1070 uspi->s_fpb = fs32_to_cpu(sb, usb1->fs_frag);
1071 uspi->s_minfree = fs32_to_cpu(sb, usb1->fs_minfree);
1072 uspi->s_bmask = fs32_to_cpu(sb, usb1->fs_bmask);
1073 uspi->s_fmask = fs32_to_cpu(sb, usb1->fs_fmask);
1074 uspi->s_bshift = fs32_to_cpu(sb, usb1->fs_bshift);
1075 uspi->s_fshift = fs32_to_cpu(sb, usb1->fs_fshift);
1076 UFSD("uspi->s_bshift = %d,uspi->s_fshift = %d", uspi->s_bshift,
1077 uspi->s_fshift);
1078 uspi->s_fpbshift = fs32_to_cpu(sb, usb1->fs_fragshift);
1079 uspi->s_fsbtodb = fs32_to_cpu(sb, usb1->fs_fsbtodb);
1081 uspi->s_csmask = fs32_to_cpu(sb, usb1->fs_csmask);
1082 uspi->s_csshift = fs32_to_cpu(sb, usb1->fs_csshift);
1083 uspi->s_nindir = fs32_to_cpu(sb, usb1->fs_nindir);
1084 uspi->s_inopb = fs32_to_cpu(sb, usb1->fs_inopb);
1085 uspi->s_nspf = fs32_to_cpu(sb, usb1->fs_nspf);
1086 uspi->s_npsect = ufs_get_fs_npsect(sb, usb1, usb3);
1087 uspi->s_interleave = fs32_to_cpu(sb, usb1->fs_interleave);
1088 uspi->s_trackskew = fs32_to_cpu(sb, usb1->fs_trackskew);
1090 if (uspi->fs_magic == UFS2_MAGIC)
1091 uspi->s_csaddr = fs64_to_cpu(sb, usb3->fs_un1.fs_u2.fs_csaddr);
1093 uspi->s_csaddr = fs32_to_cpu(sb, usb1->fs_csaddr);
1095 uspi->s_cssize = fs32_to_cpu(sb, usb1->fs_cssize);
1096 uspi->s_cgsize = fs32_to_cpu(sb, usb1->fs_cgsize);
1097 uspi->s_ntrak = fs32_to_cpu(sb, usb1->fs_ntrak);
1098 uspi->s_nsect = fs32_to_cpu(sb, usb1->fs_nsect);
1099 uspi->s_spc = fs32_to_cpu(sb, usb1->fs_spc);
1100 uspi->s_ipg = fs32_to_cpu(sb, usb1->fs_ipg);
1101 uspi->s_fpg = fs32_to_cpu(sb, usb1->fs_fpg);
1102 uspi->s_cpc = fs32_to_cpu(sb, usb2->fs_un.fs_u1.fs_cpc);
1103 uspi->s_contigsumsize = fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_contigsumsize);
1104 uspi->s_qbmask = ufs_get_fs_qbmask(sb, usb3);
1105 uspi->s_qfmask = ufs_get_fs_qfmask(sb, usb3);
1106 uspi->s_nrpos = fs32_to_cpu(sb, usb3->fs_nrpos);
1107 uspi->s_postbloff = fs32_to_cpu(sb, usb3->fs_postbloff);
1108 uspi->s_rotbloff = fs32_to_cpu(sb, usb3->fs_rotbloff);
1113 uspi->s_fpbmask = uspi->s_fpb - 1;
1115 uspi->s_apbshift = uspi->s_bshift - 3;
1117 uspi->s_apbshift = uspi->s_bshift - 2;
1119 uspi->s_2apbshift = uspi->s_apbshift * 2;
1120 uspi->s_3apbshift = uspi->s_apbshift * 3;
1121 uspi->s_apb = 1 << uspi->s_apbshift;
1122 uspi->s_2apb = 1 << uspi->s_2apbshift;
1123 uspi->s_3apb = 1 << uspi->s_3apbshift;
1124 uspi->s_apbmask = uspi->s_apb - 1;
1125 uspi->s_nspfshift = uspi->s_fshift - UFS_SECTOR_BITS;
1126 uspi->s_nspb = uspi->s_nspf << uspi->s_fpbshift;
1127 uspi->s_inopf = uspi->s_inopb >> uspi->s_fpbshift;
1128 uspi->s_bpf = uspi->s_fsize << 3;
1129 uspi->s_bpfshift = uspi->s_fshift + 3;
1130 uspi->s_bpfmask = uspi->s_bpf - 1;
1133 uspi->s_maxsymlinklen =
1136 if (uspi->fs_magic == UFS2_MAGIC)
1140 if (uspi->s_maxsymlinklen > maxsymlen) {
1142 "fast symlink size (%u)\n", uspi->s_maxsymlinklen);
1143 uspi->s_maxsymlinklen = maxsymlen;
1172 ubh_brelse_uspi (uspi);
1173 kfree (uspi);
1186 struct ufs_sb_private_info * uspi;
1197 uspi = UFS_SB(sb)->s_uspi;
1198 usb1 = ubh_get_usb_first(uspi);
1199 usb3 = ubh_get_usb_third(uspi);
1248 struct ufs_sb_private_info * uspi;
1256 uspi = UFS_SB(sb)->s_uspi;
1258 usb1 = ubh_get_usb_first(uspi);
1259 usb3 = ubh_get_usb_third(uspi);
1300 ubh_mark_buffer_dirty (USPI_UBH(uspi));
1362 struct ufs_sb_private_info *uspi= UFS_SB(sb)->s_uspi;
1371 usb1 = ubh_get_usb_first(uspi);
1372 usb2 = ubh_get_usb_second(uspi);
1373 usb3 = ubh_get_usb_third(uspi);
1380 buf->f_blocks = uspi->s_dsize;
1382 buf->f_bfree = ufs_blkstofrags(uspi->cs_total.cs_nbfree) +
1383 uspi->cs_total.cs_nffree;
1384 buf->f_ffree = uspi->cs_total.cs_nifree;
1386 buf->f_bavail = (buf->f_bfree > (((long)buf->f_blocks / 100) * uspi->s_minfree))
1387 ? (buf->f_bfree - (((long)buf->f_blocks / 100) * uspi->s_minfree)) : 0;
1388 buf->f_files = uspi->s_ncg * uspi->s_ipg;