Lines Matching refs:uspi
265 #define ubh_bread(sb,fragment,size) _ubh_bread_(uspi,sb,fragment,size)
275 #define ubh_ubhcpymem(mem,ubh,size) _ubh_ubhcpymem_(uspi,mem,ubh,size)
277 #define ubh_memcpyubh(ubh,mem,size) _ubh_memcpyubh_(uspi,ubh,mem,size)
294 static inline void *get_usb_offset(struct ufs_sb_private_info *uspi,
299 index = offset >> uspi->s_fshift;
300 offset &= ~uspi->s_fmask;
301 return uspi->s_ubh.bh[index]->b_data + offset;
304 #define ubh_get_usb_first(uspi) \
305 ((struct ufs_super_block_first *)get_usb_offset((uspi), 0))
307 #define ubh_get_usb_second(uspi) \
308 ((struct ufs_super_block_second *)get_usb_offset((uspi), UFS_SECTOR_SIZE))
310 #define ubh_get_usb_third(uspi) \
311 ((struct ufs_super_block_third *)get_usb_offset((uspi), 2*UFS_SECTOR_SIZE))
323 ((u8*)(ubh)->bh[(begin) >> uspi->s_fshift]->b_data + \
324 ((begin) & ~uspi->s_fmask))
327 (((__fs16*)((ubh)->bh[(begin) >> (uspi->s_fshift-1)]->b_data)) + \
328 ((begin) & ((uspi->fsize>>1) - 1)))
331 (((__fs32*)((ubh)->bh[(begin) >> (uspi->s_fshift-2)]->b_data)) + \
332 ((begin) & ((uspi->s_fsize>>2) - 1)))
335 (((__fs64*)((ubh)->bh[(begin) >> (uspi->s_fshift-3)]->b_data)) + \
336 ((begin) & ((uspi->s_fsize>>3) - 1)))
340 static inline void *ubh_get_data_ptr(struct ufs_sb_private_info *uspi,
344 if (uspi->fs_magic == UFS2_MAGIC)
351 ((*ubh_get_addr(ubh, (begin) + ((bit) >> 3)) >> ((bit) & 7)) & (0xff >> (UFS_MAXFRAG - uspi->s_fpb)))
358 ufs_freespace(struct ufs_sb_private_info *uspi, int percentreserved)
360 return ufs_blkstofrags(uspi->cs_total.cs_nbfree) +
361 uspi->cs_total.cs_nffree -
362 (uspi->s_dsize * (percentreserved) / 100);
373 (ucpi)->c_boff + (((cylno) * uspi->s_nrpos + (rpos)) << 1 ))))
394 #define ubh_find_first_zero_bit(ubh,begin,size) _ubh_find_next_zero_bit_(uspi,ubh,begin,size,0)
396 #define ubh_find_next_zero_bit(ubh,begin,size,offset) _ubh_find_next_zero_bit_(uspi,ubh,begin,size,offset)
398 struct ufs_sb_private_info * uspi, struct ufs_buffer_head * ubh,
406 base = offset >> uspi->s_bpfshift;
407 offset &= uspi->s_bpfmask;
409 count = min_t(unsigned int, size + offset, uspi->s_bpf);
417 return (base << uspi->s_bpfshift) + pos - begin;
443 #define ubh_find_last_zero_bit(ubh,begin,size,offset) _ubh_find_last_zero_bit_(uspi,ubh,begin,size,offset)
445 struct ufs_sb_private_info * uspi, struct ufs_buffer_head * ubh,
453 base = start >> uspi->s_bpfshift;
454 start &= uspi->s_bpfmask;
457 size + (uspi->s_bpf - start), uspi->s_bpf)
458 - (uspi->s_bpf - start);
465 start = uspi->s_bpf;
467 return (base << uspi->s_bpfshift) + pos - begin;
470 #define ubh_isblockclear(ubh,begin,block) (!_ubh_isblockset_(uspi,ubh,begin,block))
472 #define ubh_isblockset(ubh,begin,block) _ubh_isblockset_(uspi,ubh,begin,block)
473 static inline int _ubh_isblockset_(struct ufs_sb_private_info * uspi,
476 switch (uspi->s_fpb) {
489 #define ubh_clrblock(ubh,begin,block) _ubh_clrblock_(uspi,ubh,begin,block)
490 static inline void _ubh_clrblock_(struct ufs_sb_private_info * uspi,
493 switch (uspi->s_fpb) {
509 #define ubh_setblock(ubh,begin,block) _ubh_setblock_(uspi,ubh,begin,block)
510 static inline void _ubh_setblock_(struct ufs_sb_private_info * uspi,
513 switch (uspi->s_fpb) {
532 struct ufs_sb_private_info * uspi;
535 uspi = UFS_SB(sb)->s_uspi;
538 for (pos = 0; pos < uspi->s_fpb; pos++) {
547 if (fragsize > 0 && fragsize < uspi->s_fpb)
551 static inline void *ufs_get_direct_data_ptr(struct ufs_sb_private_info *uspi,
556 return uspi->fs_magic == UFS2_MAGIC ?
576 static inline void ufs_data_ptr_clear(struct ufs_sb_private_info *uspi,
579 if (uspi->fs_magic == UFS2_MAGIC)
585 static inline int ufs_is_data_ptr_zero(struct ufs_sb_private_info *uspi,
588 if (uspi->fs_magic == UFS2_MAGIC)