Lines Matching +full:usb3 +full:- +full:if

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()
210 if (value > 0xFFFF) 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()
244 if (value > 0xFFFF) in ufs_set_inode_gid()
248 inode->ui_u1.oldids.ui_sgid = cpu_to_fs16(sb, value); in ufs_set_inode_gid()
287 index = offset >> uspi->s_fshift; in get_usb_offset()
288 offset &= ~uspi->s_fmask; in get_usb_offset()
289 return uspi->s_ubh.bh[index]->b_data + offset; in get_usb_offset()
303 ((struct ufs_cylinder_group *)((ubh)->bh[0]->b_data))
311 ((u8*)(ubh)->bh[(begin) >> uspi->s_fshift]->b_data + \
312 ((begin) & ~uspi->s_fmask))
315 (((__fs16*)((ubh)->bh[(begin) >> (uspi->s_fshift-1)]->b_data)) + \
316 ((begin) & ((uspi->fsize>>1) - 1)))
319 (((__fs32*)((ubh)->bh[(begin) >> (uspi->s_fshift-2)]->b_data)) + \
320 ((begin) & ((uspi->s_fsize>>2) - 1)))
323 (((__fs64*)((ubh)->bh[(begin) >> (uspi->s_fshift-3)]->b_data)) + \
324 ((begin) & ((uspi->s_fsize>>3) - 1)))
332 if (uspi->fs_magic == UFS2_MAGIC) in ubh_get_data_ptr()
339 …((*ubh_get_addr(ubh, (begin) + ((bit) >> 3)) >> ((bit) & 7)) & (0xff >> (UFS_MAXFRAG - uspi->s_fpb…
344 return ufs_blkstofrags(uspi->cs_total.cs_nbfree) + in ufs_freefrags()
345 uspi->cs_total.cs_nffree; in ufs_freefrags()
352 (*((__fs32*)ubh_get_addr(UCPI_UBH(ucpi), (ucpi)->c_btotoff + ((cylno) << 2))))
356 (ucpi)->c_boff + (((cylno) * uspi->s_nrpos + (rpos)) << 1 ))))
386 size -= offset; in _ubh_find_next_zero_bit_()
389 base = offset >> uspi->s_bpfshift; in _ubh_find_next_zero_bit_()
390 offset &= uspi->s_bpfmask; in _ubh_find_next_zero_bit_()
392 count = min_t(unsigned int, size + offset, uspi->s_bpf); in _ubh_find_next_zero_bit_()
393 size -= count - offset; in _ubh_find_next_zero_bit_()
394 pos = find_next_zero_bit_le(ubh->bh[base]->b_data, count, offset); in _ubh_find_next_zero_bit_()
395 if (pos < count || !size) in _ubh_find_next_zero_bit_()
400 return (base << uspi->s_bpfshift) + pos - begin; in _ubh_find_next_zero_bit_()
411 map = *mapp--; in find_last_zero_bit()
413 for (i = size; i > offset; i--) { in find_last_zero_bit()
414 if ((map & bit) == 0) in find_last_zero_bit()
416 if ((i & 7) != 0) { in find_last_zero_bit()
419 map = *mapp--; in find_last_zero_bit()
433 size = start - end; in _ubh_find_last_zero_bit_()
436 base = start >> uspi->s_bpfshift; in _ubh_find_last_zero_bit_()
437 start &= uspi->s_bpfmask; in _ubh_find_last_zero_bit_()
440 size + (uspi->s_bpf - start), uspi->s_bpf) in _ubh_find_last_zero_bit_()
441 - (uspi->s_bpf - start); in _ubh_find_last_zero_bit_()
442 size -= count; in _ubh_find_last_zero_bit_()
443 pos = find_last_zero_bit (ubh->bh[base]->b_data, in _ubh_find_last_zero_bit_()
444 start, start - count); in _ubh_find_last_zero_bit_()
445 if (pos > start - count || !size) in _ubh_find_last_zero_bit_()
447 base--; in _ubh_find_last_zero_bit_()
448 start = uspi->s_bpf; in _ubh_find_last_zero_bit_()
450 return (base << uspi->s_bpfshift) + pos - begin; in _ubh_find_last_zero_bit_()
457 u8 *p = ubh_get_addr(ubh, ucpi->c_freeoff + (frag >> 3)); in ubh_isblockset()
460 switch (uspi->s_fpb) { in ubh_isblockset()
480 u8 *p = ubh_get_addr(ubh, ucpi->c_freeoff + (frag >> 3)); in ubh_clrblock()
482 switch (uspi->s_fpb) { in ubh_clrblock()
502 u8 *p = ubh_get_addr(ubh, ucpi->c_freeoff + (frag >> 3)); in ubh_setblock()
504 switch (uspi->s_fpb) { in ubh_setblock()
526 uspi = UFS_SB(sb)->s_uspi; in ufs_fragacct()
529 for (pos = 0; pos < uspi->s_fpb; pos++) { in ufs_fragacct()
530 if (blockmap & (1 << pos)) { in ufs_fragacct()
533 else if (fragsize > 0) { in ufs_fragacct()
538 if (fragsize > 0 && fragsize < uspi->s_fpb) in ufs_fragacct()
547 return uspi->fs_magic == UFS2_MAGIC ? in ufs_get_direct_data_ptr()
548 (void *)&ufsi->i_u1.u2_i_data[blk] : in ufs_get_direct_data_ptr()
549 (void *)&ufsi->i_u1.i_data[blk]; in ufs_get_direct_data_ptr()
554 return UFS_SB(sb)->s_uspi->fs_magic == UFS2_MAGIC ? in ufs_data_ptr_to_cpu()
561 if (UFS_SB(sb)->s_uspi->fs_magic == UFS2_MAGIC) in ufs_cpu_to_data_ptr()
570 if (uspi->fs_magic == UFS2_MAGIC) in ufs_data_ptr_clear()
579 if (uspi->fs_magic == UFS2_MAGIC) in ufs_is_data_ptr_zero()
589 /* Signed 32-bit interpretation wraps around in 2038, which in ufs_get_seconds()
590 * happens in ufs1 inode stamps but not ufs2 using 64-bits in ufs_get_seconds()
592 * unsigned 32-bit stamps, which are good until y2106. in ufs_get_seconds()