Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
util.h File Reference
#include <linux/buffer_head.h>
#include <linux/fs.h>
#include "swab.h"

Go to the source code of this file.

Macros

#define in_range(b, first, len)   ((b)>=(first)&&(b)<(first)+(len))
 
#define ubh_bread(sb, fragment, size)   _ubh_bread_(uspi,sb,fragment,size)
 
#define ubh_ubhcpymem(mem, ubh, size)   _ubh_ubhcpymem_(uspi,mem,ubh,size)
 
#define ubh_memcpyubh(ubh, mem, size)   _ubh_memcpyubh_(uspi,ubh,mem,size)
 
#define ubh_get_usb_first(uspi)   ((struct ufs_super_block_first *)get_usb_offset((uspi), 0))
 
#define ubh_get_usb_second(uspi)   ((struct ufs_super_block_second *)get_usb_offset((uspi), UFS_SECTOR_SIZE))
 
#define ubh_get_usb_third(uspi)   ((struct ufs_super_block_third *)get_usb_offset((uspi), 2*UFS_SECTOR_SIZE))
 
#define ubh_get_ucg(ubh)   ((struct ufs_cylinder_group *)((ubh)->bh[0]->b_data))
 
#define ubh_get_addr8(ubh, begin)
 
#define ubh_get_addr16(ubh, begin)
 
#define ubh_get_addr32(ubh, begin)
 
#define ubh_get_addr64(ubh, begin)
 
#define ubh_get_addr   ubh_get_addr8
 
#define ubh_blkmap(ubh, begin, bit)   ((*ubh_get_addr(ubh, (begin) + ((bit) >> 3)) >> ((bit) & 7)) & (0xff >> (UFS_MAXFRAG - uspi->s_fpb)))
 
#define ubh_cg_blktot(ucpi, cylno)   (*((__fs32*)ubh_get_addr(UCPI_UBH(ucpi), (ucpi)->c_btotoff + ((cylno) << 2))))
 
#define ubh_cg_blks(ucpi, cylno, rpos)
 
#define ubh_setbit(ubh, begin, bit)   (*ubh_get_addr(ubh, (begin) + ((bit) >> 3)) |= (1 << ((bit) & 7)))
 
#define ubh_clrbit(ubh, begin, bit)   (*ubh_get_addr (ubh, (begin) + ((bit) >> 3)) &= ~(1 << ((bit) & 7)))
 
#define ubh_isset(ubh, begin, bit)   (*ubh_get_addr (ubh, (begin) + ((bit) >> 3)) & (1 << ((bit) & 7)))
 
#define ubh_isclr(ubh, begin, bit)   (!ubh_isset(ubh,begin,bit))
 
#define ubh_find_first_zero_bit(ubh, begin, size)   _ubh_find_next_zero_bit_(uspi,ubh,begin,size,0)
 
#define ubh_find_next_zero_bit(ubh, begin, size, offset)   _ubh_find_next_zero_bit_(uspi,ubh,begin,size,offset)
 
#define ubh_find_last_zero_bit(ubh, begin, size, offset)   _ubh_find_last_zero_bit_(uspi,ubh,begin,size,offset)
 
#define ubh_isblockclear(ubh, begin, block)   (!_ubh_isblockset_(uspi,ubh,begin,block))
 
#define ubh_isblockset(ubh, begin, block)   _ubh_isblockset_(uspi,ubh,begin,block)
 
#define ubh_clrblock(ubh, begin, block)   _ubh_clrblock_(uspi,ubh,begin,block)
 
#define ubh_setblock(ubh, begin, block)   _ubh_setblock_(uspi,ubh,begin,block)
 

Functions

dev_t ufs_get_inode_dev (struct super_block *, struct ufs_inode_info *)
 
void ufs_set_inode_dev (struct super_block *, struct ufs_inode_info *, dev_t)
 
int ufs_prepare_chunk (struct page *page, loff_t pos, unsigned len)
 
struct ufs_buffer_head_ubh_bread_ (struct ufs_sb_private_info *, struct super_block *, u64, u64)
 
struct ufs_buffer_headubh_bread_uspi (struct ufs_sb_private_info *, struct super_block *, u64, u64)
 
void ubh_brelse (struct ufs_buffer_head *)
 
void ubh_brelse_uspi (struct ufs_sb_private_info *)
 
void ubh_mark_buffer_dirty (struct ufs_buffer_head *)
 
void ubh_mark_buffer_uptodate (struct ufs_buffer_head *, int)
 
void ubh_sync_block (struct ufs_buffer_head *)
 
void ubh_bforget (struct ufs_buffer_head *)
 
int ubh_buffer_dirty (struct ufs_buffer_head *)
 
void _ubh_ubhcpymem_ (struct ufs_sb_private_info *, unsigned char *, struct ufs_buffer_head *, unsigned)
 
void _ubh_memcpyubh_ (struct ufs_sb_private_info *, struct ufs_buffer_head *, unsigned char *, unsigned)
 
struct pageufs_get_locked_page (struct address_space *mapping, pgoff_t index)
 

Macro Definition Documentation

#define in_range (   b,
  first,
  len 
)    ((b)>=(first)&&(b)<(first)+(len))

Definition at line 17 of file util.h.

#define ubh_blkmap (   ubh,
  begin,
  bit 
)    ((*ubh_get_addr(ubh, (begin) + ((bit) >> 3)) >> ((bit) & 7)) & (0xff >> (UFS_MAXFRAG - uspi->s_fpb)))

Definition at line 350 of file util.h.

#define ubh_bread (   sb,
  fragment,
  size 
)    _ubh_bread_(uspi,sb,fragment,size)

Definition at line 265 of file util.h.

#define ubh_cg_blks (   ucpi,
  cylno,
  rpos 
)
Value:
(*((__fs16*)ubh_get_addr(UCPI_UBH(ucpi), \
(ucpi)->c_boff + (((cylno) * uspi->s_nrpos + (rpos)) << 1 ))))

Definition at line 371 of file util.h.

#define ubh_cg_blktot (   ucpi,
  cylno 
)    (*((__fs32*)ubh_get_addr(UCPI_UBH(ucpi), (ucpi)->c_btotoff + ((cylno) << 2))))

Definition at line 368 of file util.h.

#define ubh_clrbit (   ubh,
  begin,
  bit 
)    (*ubh_get_addr (ubh, (begin) + ((bit) >> 3)) &= ~(1 << ((bit) & 7)))

Definition at line 386 of file util.h.

#define ubh_clrblock (   ubh,
  begin,
  block 
)    _ubh_clrblock_(uspi,ubh,begin,block)

Definition at line 489 of file util.h.

#define ubh_find_first_zero_bit (   ubh,
  begin,
  size 
)    _ubh_find_next_zero_bit_(uspi,ubh,begin,size,0)

Definition at line 394 of file util.h.

#define ubh_find_last_zero_bit (   ubh,
  begin,
  size,
  offset 
)    _ubh_find_last_zero_bit_(uspi,ubh,begin,size,offset)

Definition at line 443 of file util.h.

#define ubh_find_next_zero_bit (   ubh,
  begin,
  size,
  offset 
)    _ubh_find_next_zero_bit_(uspi,ubh,begin,size,offset)

Definition at line 396 of file util.h.

#define ubh_get_addr   ubh_get_addr8

Definition at line 338 of file util.h.

#define ubh_get_addr16 (   ubh,
  begin 
)
Value:
(((__fs16*)((ubh)->bh[(begin) >> (uspi->s_fshift-1)]->b_data)) + \
((begin) & ((uspi->fsize>>1) - 1)))

Definition at line 326 of file util.h.

#define ubh_get_addr32 (   ubh,
  begin 
)
Value:
(((__fs32*)((ubh)->bh[(begin) >> (uspi->s_fshift-2)]->b_data)) + \
((begin) & ((uspi->s_fsize>>2) - 1)))

Definition at line 330 of file util.h.

#define ubh_get_addr64 (   ubh,
  begin 
)
Value:
(((__fs64*)((ubh)->bh[(begin) >> (uspi->s_fshift-3)]->b_data)) + \
((begin) & ((uspi->s_fsize>>3) - 1)))

Definition at line 334 of file util.h.

#define ubh_get_addr8 (   ubh,
  begin 
)
Value:
((u8*)(ubh)->bh[(begin) >> uspi->s_fshift]->b_data + \
((begin) & ~uspi->s_fmask))

Definition at line 322 of file util.h.

#define ubh_get_ucg (   ubh)    ((struct ufs_cylinder_group *)((ubh)->bh[0]->b_data))

Definition at line 314 of file util.h.

#define ubh_get_usb_first (   uspi)    ((struct ufs_super_block_first *)get_usb_offset((uspi), 0))

Definition at line 304 of file util.h.

#define ubh_get_usb_second (   uspi)    ((struct ufs_super_block_second *)get_usb_offset((uspi), UFS_SECTOR_SIZE))

Definition at line 307 of file util.h.

#define ubh_get_usb_third (   uspi)    ((struct ufs_super_block_third *)get_usb_offset((uspi), 2*UFS_SECTOR_SIZE))

Definition at line 310 of file util.h.

#define ubh_isblockclear (   ubh,
  begin,
  block 
)    (!_ubh_isblockset_(uspi,ubh,begin,block))

Definition at line 470 of file util.h.

#define ubh_isblockset (   ubh,
  begin,
  block 
)    _ubh_isblockset_(uspi,ubh,begin,block)

Definition at line 472 of file util.h.

#define ubh_isclr (   ubh,
  begin,
  bit 
)    (!ubh_isset(ubh,begin,bit))

Definition at line 392 of file util.h.

#define ubh_isset (   ubh,
  begin,
  bit 
)    (*ubh_get_addr (ubh, (begin) + ((bit) >> 3)) & (1 << ((bit) & 7)))

Definition at line 389 of file util.h.

#define ubh_memcpyubh (   ubh,
  mem,
  size 
)    _ubh_memcpyubh_(uspi,ubh,mem,size)

Definition at line 277 of file util.h.

#define ubh_setbit (   ubh,
  begin,
  bit 
)    (*ubh_get_addr(ubh, (begin) + ((bit) >> 3)) |= (1 << ((bit) & 7)))

Definition at line 383 of file util.h.

#define ubh_setblock (   ubh,
  begin,
  block 
)    _ubh_setblock_(uspi,ubh,begin,block)

Definition at line 509 of file util.h.

#define ubh_ubhcpymem (   mem,
  ubh,
  size 
)    _ubh_ubhcpymem_(uspi,mem,ubh,size)

Definition at line 275 of file util.h.

Function Documentation

struct ufs_buffer_head* _ubh_bread_ ( struct ufs_sb_private_info ,
struct super_block ,
u64  ,
u64   
)
read

Definition at line 18 of file util.c.

void _ubh_memcpyubh_ ( struct ufs_sb_private_info ,
struct ufs_buffer_head ,
unsigned char ,
unsigned   
)

Definition at line 165 of file util.c.

void _ubh_ubhcpymem_ ( struct ufs_sb_private_info ,
unsigned char ,
struct ufs_buffer_head ,
unsigned   
)

Definition at line 149 of file util.c.

void ubh_bforget ( struct ufs_buffer_head )

Definition at line 129 of file util.c.

struct ufs_buffer_head* ubh_bread_uspi ( struct ufs_sb_private_info ,
struct super_block ,
u64  ,
u64   
)
read

Definition at line 48 of file util.c.

void ubh_brelse ( struct ufs_buffer_head )

Definition at line 72 of file util.c.

void ubh_brelse_uspi ( struct ufs_sb_private_info )

Definition at line 82 of file util.c.

int ubh_buffer_dirty ( struct ufs_buffer_head )

Definition at line 138 of file util.c.

void ubh_mark_buffer_dirty ( struct ufs_buffer_head )

Definition at line 93 of file util.c.

void ubh_mark_buffer_uptodate ( struct ufs_buffer_head ,
int   
)

Definition at line 102 of file util.c.

void ubh_sync_block ( struct ufs_buffer_head )

Definition at line 116 of file util.c.

dev_t ufs_get_inode_dev ( struct super_block ,
struct ufs_inode_info  
)

Definition at line 182 of file util.c.

struct page* ufs_get_locked_page ( struct address_space mapping,
pgoff_t  index 
)
read

ufs_get_locked_page() - locate, pin and lock a pagecache page, if not exist read it from disk. : the address_space to search : the page index

Locates the desired pagecache page, if not exist we'll read it, locks it, increments its reference count and returns its address.

Definition at line 244 of file util.c.

int ufs_prepare_chunk ( struct page page,
loff_t  pos,
unsigned  len 
)

Definition at line 524 of file inode.c.

void ufs_set_inode_dev ( struct super_block ,
struct ufs_inode_info ,
dev_t   
)

Definition at line 209 of file util.c.