Lines Matching +full:usb3 +full:- +full:3
1 /* SPDX-License-Identifier: GPL-2.0 */
19 return &cpi->c_ubh; in UCPI_UBH()
23 return &spi->s_ubh; in USPI_UBH()
33 struct ufs_super_block_third *usb3) in ufs_get_fs_state() argument
35 switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) { in ufs_get_fs_state()
37 if (fs32_to_cpu(sb, usb3->fs_postblformat) == UFS_42POSTBLFMT) in ufs_get_fs_state()
38 return fs32_to_cpu(sb, usb1->fs_u0.fs_sun.fs_state); in ufs_get_fs_state()
41 return fs32_to_cpu(sb, usb3->fs_un2.fs_sun.fs_state); in ufs_get_fs_state()
43 return fs32_to_cpu(sb, usb1->fs_u1.fs_sunx86.fs_state); in ufs_get_fs_state()
46 return fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_state); in ufs_get_fs_state()
52 struct ufs_super_block_third *usb3, s32 value) in ufs_set_fs_state() argument
54 switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) { in ufs_set_fs_state()
56 if (fs32_to_cpu(sb, usb3->fs_postblformat) == UFS_42POSTBLFMT) { in ufs_set_fs_state()
57 usb1->fs_u0.fs_sun.fs_state = cpu_to_fs32(sb, value); in ufs_set_fs_state()
62 usb3->fs_un2.fs_sun.fs_state = cpu_to_fs32(sb, value); in ufs_set_fs_state()
65 usb1->fs_u1.fs_sunx86.fs_state = cpu_to_fs32(sb, value); in ufs_set_fs_state()
68 usb3->fs_un2.fs_44.fs_state = cpu_to_fs32(sb, value); in ufs_set_fs_state()
75 struct ufs_super_block_third *usb3) in ufs_get_fs_npsect() argument
77 if ((UFS_SB(sb)->s_flags & UFS_ST_MASK) == UFS_ST_SUNx86) in ufs_get_fs_npsect()
78 return fs32_to_cpu(sb, usb3->fs_un2.fs_sunx86.fs_npsect); in ufs_get_fs_npsect()
80 return fs32_to_cpu(sb, usb1->fs_u1.fs_sun.fs_npsect); in ufs_get_fs_npsect()
84 ufs_get_fs_qbmask(struct super_block *sb, struct ufs_super_block_third *usb3) in ufs_get_fs_qbmask() argument
88 switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) { in ufs_get_fs_qbmask()
91 ((__fs32 *)&tmp)[0] = usb3->fs_un2.fs_sun.fs_qbmask[0]; in ufs_get_fs_qbmask()
92 ((__fs32 *)&tmp)[1] = usb3->fs_un2.fs_sun.fs_qbmask[1]; in ufs_get_fs_qbmask()
95 ((__fs32 *)&tmp)[0] = usb3->fs_un2.fs_sunx86.fs_qbmask[0]; in ufs_get_fs_qbmask()
96 ((__fs32 *)&tmp)[1] = usb3->fs_un2.fs_sunx86.fs_qbmask[1]; in ufs_get_fs_qbmask()
99 ((__fs32 *)&tmp)[0] = usb3->fs_un2.fs_44.fs_qbmask[0]; in ufs_get_fs_qbmask()
100 ((__fs32 *)&tmp)[1] = usb3->fs_un2.fs_44.fs_qbmask[1]; in ufs_get_fs_qbmask()
108 ufs_get_fs_qfmask(struct super_block *sb, struct ufs_super_block_third *usb3) in ufs_get_fs_qfmask() argument
112 switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) { in ufs_get_fs_qfmask()
115 ((__fs32 *)&tmp)[0] = usb3->fs_un2.fs_sun.fs_qfmask[0]; in ufs_get_fs_qfmask()
116 ((__fs32 *)&tmp)[1] = usb3->fs_un2.fs_sun.fs_qfmask[1]; in ufs_get_fs_qfmask()
119 ((__fs32 *)&tmp)[0] = usb3->fs_un2.fs_sunx86.fs_qfmask[0]; in ufs_get_fs_qfmask()
120 ((__fs32 *)&tmp)[1] = usb3->fs_un2.fs_sunx86.fs_qfmask[1]; in ufs_get_fs_qfmask()
123 ((__fs32 *)&tmp)[0] = usb3->fs_un2.fs_44.fs_qfmask[0]; in ufs_get_fs_qfmask()
124 ((__fs32 *)&tmp)[1] = usb3->fs_un2.fs_44.fs_qfmask[1]; in ufs_get_fs_qfmask()
134 if ((UFS_SB(sb)->s_flags & UFS_DE_MASK) == UFS_DE_OLD) in ufs_get_de_namlen()
135 return fs16_to_cpu(sb, de->d_u.d_namlen); in ufs_get_de_namlen()
137 return de->d_u.d_44.d_namlen; /* XXX this seems wrong */ in ufs_get_de_namlen()
143 if ((UFS_SB(sb)->s_flags & UFS_DE_MASK) == UFS_DE_OLD) in ufs_set_de_namlen()
144 de->d_u.d_namlen = cpu_to_fs16(sb, value); in ufs_set_de_namlen()
146 de->d_u.d_44.d_namlen = value; /* XXX this seems wrong */ in ufs_set_de_namlen()
152 if ((UFS_SB(sb)->s_flags & UFS_DE_MASK) != UFS_DE_44BSD) in ufs_set_de_type()
160 de->d_u.d_44.d_type = DT_SOCK; in ufs_set_de_type()
163 de->d_u.d_44.d_type = DT_LNK; in ufs_set_de_type()
166 de->d_u.d_44.d_type = DT_REG; in ufs_set_de_type()
169 de->d_u.d_44.d_type = DT_BLK; in ufs_set_de_type()
172 de->d_u.d_44.d_type = DT_DIR; in ufs_set_de_type()
175 de->d_u.d_44.d_type = DT_CHR; in ufs_set_de_type()
178 de->d_u.d_44.d_type = DT_FIFO; in ufs_set_de_type()
181 de->d_u.d_44.d_type = DT_UNKNOWN; in ufs_set_de_type()
188 switch (UFS_SB(sb)->s_flags & UFS_UID_MASK) { in ufs_get_inode_uid()
190 return fs32_to_cpu(sb, inode->ui_u3.ui_44.ui_uid); in ufs_get_inode_uid()
192 if (inode->ui_u1.oldids.ui_suid == 0xFFFF) in ufs_get_inode_uid()
193 return fs32_to_cpu(sb, inode->ui_u3.ui_sun.ui_uid); in ufs_get_inode_uid()
196 return fs16_to_cpu(sb, inode->ui_u1.oldids.ui_suid); in ufs_get_inode_uid()
203 switch (UFS_SB(sb)->s_flags & UFS_UID_MASK) { in ufs_set_inode_uid()
205 inode->ui_u3.ui_44.ui_uid = cpu_to_fs32(sb, value); in ufs_set_inode_uid()
206 inode->ui_u1.oldids.ui_suid = cpu_to_fs16(sb, value); in ufs_set_inode_uid()
209 inode->ui_u3.ui_sun.ui_uid = cpu_to_fs32(sb, value); in ufs_set_inode_uid()
214 inode->ui_u1.oldids.ui_suid = cpu_to_fs16(sb, value); in ufs_set_inode_uid()
222 switch (UFS_SB(sb)->s_flags & UFS_UID_MASK) { in ufs_get_inode_gid()
224 return fs32_to_cpu(sb, inode->ui_u3.ui_44.ui_gid); in ufs_get_inode_gid()
226 if (inode->ui_u1.oldids.ui_sgid == 0xFFFF) in ufs_get_inode_gid()
227 return fs32_to_cpu(sb, inode->ui_u3.ui_sun.ui_gid); in ufs_get_inode_gid()
230 return fs16_to_cpu(sb, inode->ui_u1.oldids.ui_sgid); in ufs_get_inode_gid()
237 switch (UFS_SB(sb)->s_flags & UFS_UID_MASK) { in ufs_set_inode_gid()
239 inode->ui_u3.ui_44.ui_gid = cpu_to_fs32(sb, value); in ufs_set_inode_gid()
240 inode->ui_u1.oldids.ui_sgid = cpu_to_fs16(sb, value); in ufs_set_inode_gid()
243 inode->ui_u3.ui_sun.ui_gid = cpu_to_fs32(sb, value); in ufs_set_inode_gid()
248 inode->ui_u1.oldids.ui_sgid = cpu_to_fs16(sb, value); in ufs_set_inode_gid()
292 index = offset >> uspi->s_fshift; in get_usb_offset()
293 offset &= ~uspi->s_fmask; in get_usb_offset()
294 return uspi->s_ubh.bh[index]->b_data + offset; in get_usb_offset()
308 ((struct ufs_cylinder_group *)((ubh)->bh[0]->b_data))
316 ((u8*)(ubh)->bh[(begin) >> uspi->s_fshift]->b_data + \
317 ((begin) & ~uspi->s_fmask))
320 (((__fs16*)((ubh)->bh[(begin) >> (uspi->s_fshift-1)]->b_data)) + \
321 ((begin) & ((uspi->fsize>>1) - 1)))
324 (((__fs32*)((ubh)->bh[(begin) >> (uspi->s_fshift-2)]->b_data)) + \
325 ((begin) & ((uspi->s_fsize>>2) - 1)))
328 (((__fs64*)((ubh)->bh[(begin) >> (uspi->s_fshift-3)]->b_data)) + \
329 ((begin) & ((uspi->s_fsize>>3) - 1)))
337 if (uspi->fs_magic == UFS2_MAGIC) in ubh_get_data_ptr()
344 …((*ubh_get_addr(ubh, (begin) + ((bit) >> 3)) >> ((bit) & 7)) & (0xff >> (UFS_MAXFRAG - uspi->s_fpb…
349 return ufs_blkstofrags(uspi->cs_total.cs_nbfree) + in ufs_freefrags()
350 uspi->cs_total.cs_nffree; in ufs_freefrags()
357 (*((__fs32*)ubh_get_addr(UCPI_UBH(ucpi), (ucpi)->c_btotoff + ((cylno) << 2))))
361 (ucpi)->c_boff + (((cylno) * uspi->s_nrpos + (rpos)) << 1 ))))
372 (*ubh_get_addr(ubh, (begin) + ((bit) >> 3)) |= (1 << ((bit) & 7)))
375 (*ubh_get_addr (ubh, (begin) + ((bit) >> 3)) &= ~(1 << ((bit) & 7)))
378 (*ubh_get_addr (ubh, (begin) + ((bit) >> 3)) & (1 << ((bit) & 7)))
391 size -= offset; in _ubh_find_next_zero_bit_()
392 begin <<= 3; in _ubh_find_next_zero_bit_()
394 base = offset >> uspi->s_bpfshift; in _ubh_find_next_zero_bit_()
395 offset &= uspi->s_bpfmask; in _ubh_find_next_zero_bit_()
397 count = min_t(unsigned int, size + offset, uspi->s_bpf); in _ubh_find_next_zero_bit_()
398 size -= count - offset; in _ubh_find_next_zero_bit_()
399 pos = find_next_zero_bit_le(ubh->bh[base]->b_data, count, offset); in _ubh_find_next_zero_bit_()
405 return (base << uspi->s_bpfshift) + pos - begin; in _ubh_find_next_zero_bit_()
415 mapp = bitmap + (size >> 3); in find_last_zero_bit()
416 map = *mapp--; in find_last_zero_bit()
418 for (i = size; i > offset; i--) { in find_last_zero_bit()
424 map = *mapp--; in find_last_zero_bit()
438 size = start - end; in _ubh_find_last_zero_bit_()
439 begin <<= 3; in _ubh_find_last_zero_bit_()
441 base = start >> uspi->s_bpfshift; in _ubh_find_last_zero_bit_()
442 start &= uspi->s_bpfmask; in _ubh_find_last_zero_bit_()
445 size + (uspi->s_bpf - start), uspi->s_bpf) in _ubh_find_last_zero_bit_()
446 - (uspi->s_bpf - start); in _ubh_find_last_zero_bit_()
447 size -= count; in _ubh_find_last_zero_bit_()
448 pos = find_last_zero_bit (ubh->bh[base]->b_data, in _ubh_find_last_zero_bit_()
449 start, start - count); in _ubh_find_last_zero_bit_()
450 if (pos > start - count || !size) in _ubh_find_last_zero_bit_()
452 base--; in _ubh_find_last_zero_bit_()
453 start = uspi->s_bpf; in _ubh_find_last_zero_bit_()
455 return (base << uspi->s_bpfshift) + pos - begin; in _ubh_find_last_zero_bit_()
465 switch (uspi->s_fpb) { in _ubh_isblockset_()
476 return (*ubh_get_addr (ubh, begin + (block >> 3)) & mask) == mask; in _ubh_isblockset_()
485 switch (uspi->s_fpb) { in _ubh_clrblock_()
496 *ubh_get_addr (ubh, begin + (block >> 3)) &= ~(0x01 << ((block & 0x07))); in _ubh_clrblock_()
505 switch (uspi->s_fpb) { in _ubh_setblock_()
516 *ubh_get_addr(ubh, begin + (block >> 3)) |= (0x01 << ((block & 0x07))); in _ubh_setblock_()
527 uspi = UFS_SB(sb)->s_uspi; in ufs_fragacct()
530 for (pos = 0; pos < uspi->s_fpb; pos++) { in ufs_fragacct()
539 if (fragsize > 0 && fragsize < uspi->s_fpb) in ufs_fragacct()
548 return uspi->fs_magic == UFS2_MAGIC ? in ufs_get_direct_data_ptr()
549 (void *)&ufsi->i_u1.u2_i_data[blk] : in ufs_get_direct_data_ptr()
550 (void *)&ufsi->i_u1.i_data[blk]; in ufs_get_direct_data_ptr()
555 return UFS_SB(sb)->s_uspi->fs_magic == UFS2_MAGIC ? in ufs_data_ptr_to_cpu()
562 if (UFS_SB(sb)->s_uspi->fs_magic == UFS2_MAGIC) in ufs_cpu_to_data_ptr()
571 if (uspi->fs_magic == UFS2_MAGIC) in ufs_data_ptr_clear()
580 if (uspi->fs_magic == UFS2_MAGIC) in ufs_is_data_ptr_zero()
590 /* Signed 32-bit interpretation wraps around in 2038, which in ufs_get_seconds()
591 * happens in ufs1 inode stamps but not ufs2 using 64-bits in ufs_get_seconds()
593 * unsigned 32-bit stamps, which are good until y2106. in ufs_get_seconds()