Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302691
b: refs/heads/master
c: 886b141
h: refs/heads/master
i:
  302689: 3c0f5bb
  302687: 4107fcf
v: v3
  • Loading branch information
Bob Peterson authored and Steven Whitehouse committed Apr 24, 2012
1 parent 01b4585 commit ec6f20f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 29c578f567eec57b8db761d7adf6512d2d3e8efe
refs/heads/master: 886b1416752d7b00fd04468a7c3f036699bddc31
28 changes: 16 additions & 12 deletions trunk/fs/gfs2/rgrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ static inline void gfs2_setbit(struct gfs2_rgrpd *rgd, unsigned char *buf1,

/**
* gfs2_testbit - test a bit in the bitmaps
* @rgd: the resource group descriptor
* @buffer: the buffer that holds the bitmaps
* @buflen: the length (in bytes) of the buffer
* @block: the block to read
Expand Down Expand Up @@ -180,7 +181,7 @@ static inline u64 gfs2_bit_search(const __le64 *ptr, u64 mask, u8 state)
/**
* gfs2_bitfit - Search an rgrp's bitmap buffer to find a bit-pair representing
* a block in a given allocation state.
* @buffer: the buffer that holds the bitmaps
* @buf: the buffer that holds the bitmaps
* @len: the length (in bytes) of the buffer
* @goal: start search at this block's bit-pair (within @buffer)
* @state: GFS2_BLKST_XXX the state of the block we're looking for.
Expand Down Expand Up @@ -232,6 +233,7 @@ static u32 gfs2_bitfit(const u8 *buf, const unsigned int len,

/**
* gfs2_bitcount - count the number of bits in a certain state
* @rgd: the resource group descriptor
* @buffer: the buffer that holds the bitmaps
* @buflen: the length (in bytes) of the buffer
* @state: the state of the block we're looking for
Expand Down Expand Up @@ -265,7 +267,6 @@ static u32 gfs2_bitcount(struct gfs2_rgrpd *rgd, const u8 *buffer,

/**
* gfs2_rgrp_verify - Verify that a resource group is consistent
* @sdp: the filesystem
* @rgd: the rgrp
*
*/
Expand Down Expand Up @@ -323,7 +324,8 @@ static inline int rgrp_contains_block(struct gfs2_rgrpd *rgd, u64 block)
/**
* gfs2_blk2rgrpd - Find resource group for a given data/meta block number
* @sdp: The GFS2 superblock
* @n: The data block number
* @blk: The data block number
* @exact: True if this needs to be an exact match
*
* Returns: The resource group, or NULL if not found
*/
Expand Down Expand Up @@ -381,7 +383,7 @@ struct gfs2_rgrpd *gfs2_rgrpd_get_first(struct gfs2_sbd *sdp)

/**
* gfs2_rgrpd_get_next - get the next RG
* @rgd: A RG
* @rgd: the resource group descriptor
*
* Returns: The next rgrp
*/
Expand Down Expand Up @@ -530,6 +532,7 @@ static int compute_bitstructs(struct gfs2_rgrpd *rgd)

/**
* gfs2_ri_total - Total up the file system space, according to the rindex.
* @sdp: the filesystem
*
*/
u64 gfs2_ri_total(struct gfs2_sbd *sdp)
Expand Down Expand Up @@ -583,7 +586,8 @@ static int rgd_insert(struct gfs2_rgrpd *rgd)

/**
* read_rindex_entry - Pull in a new resource index entry from the disk
* @gl: The glock covering the rindex inode
* @ip: The GFS2 inode
* @ra_state: The read-ahead state
*
* Returns: 0 on success, > 0 on EOF, error code otherwise
*/
Expand Down Expand Up @@ -742,7 +746,7 @@ static void gfs2_rgrp_out(struct gfs2_rgrpd *rgd, void *buf)

/**
* gfs2_rgrp_go_lock - Read in a RG's header and bitmaps
* @rgd: the struct gfs2_rgrpd describing the RG to read in
* @gh: The glock holder for the resource group
*
* Read in all of a Resource Group's header and bitmap blocks.
* Caller must eventually call gfs2_rgrp_relse() to free the bitmaps.
Expand Down Expand Up @@ -802,7 +806,7 @@ int gfs2_rgrp_go_lock(struct gfs2_holder *gh)

/**
* gfs2_rgrp_go_unlock - Release RG bitmaps read in with gfs2_rgrp_bh_get()
* @rgd: the struct gfs2_rgrpd describing the RG to read in
* @gh: The glock holder for the resource group
*
*/

Expand Down Expand Up @@ -1041,6 +1045,8 @@ static inline u32 gfs2_bi2rgd_blk(struct gfs2_bitmap *bi, u32 blk)
/**
* try_rgrp_unlink - Look for any unlinked, allocated, but unused inodes
* @rgd: The rgrp
* @last_unlinked: block address of the last dinode we unlinked
* @skip: block address we should explicitly not unlink
*
* Returns: 0 if no error
* The inode, if one has been found, in inode.
Expand Down Expand Up @@ -1105,7 +1111,7 @@ static void try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked, u64 skip
/**
* get_local_rgrp - Choose and lock a rgrp for allocation
* @ip: the inode to reserve space for
* @rgp: the chosen and locked rgrp
* @last_unlinked: the last unlinked block
*
* Try to acquire rgrp in way which avoids contending with others.
*
Expand Down Expand Up @@ -1174,6 +1180,7 @@ static void gfs2_blkrsv_put(struct gfs2_inode *ip)
/**
* gfs2_inplace_reserve - Reserve space in the filesystem
* @ip: the inode to reserve space for
* @requested: the number of blocks to be reserved
*
* Returns: errno
*/
Expand Down Expand Up @@ -1272,7 +1279,6 @@ static unsigned char gfs2_get_block_type(struct gfs2_rgrpd *rgd, u64 block)
* @rgd: the resource group descriptor
* @goal: the goal block within the RG (start here to search for avail block)
* @state: GFS2_BLKST_XXX the before-allocation state to find
* @dinode: TRUE if the first block we allocate is for a dinode
* @rbi: address of the pointer to the bitmap containing the block found
*
* Walk rgrp's bitmap to find bits that represent a block in @state.
Expand All @@ -1286,8 +1292,7 @@ static unsigned char gfs2_get_block_type(struct gfs2_rgrpd *rgd, u64 block)
* Returns: the block number found relative to the bitmap rbi
*/

static u32 rgblk_search(struct gfs2_rgrpd *rgd, u32 goal,
unsigned char state,
static u32 rgblk_search(struct gfs2_rgrpd *rgd, u32 goal, unsigned char state,
struct gfs2_bitmap **rbi)
{
struct gfs2_bitmap *bi = NULL;
Expand Down Expand Up @@ -1756,7 +1761,6 @@ void gfs2_rlist_add(struct gfs2_inode *ip, struct gfs2_rgrp_list *rlist,
* and initialize an array of glock holders for them
* @rlist: the list of resource groups
* @state: the lock state to acquire the RG lock in
* @flags: the modifier flags for the holder structures
*
* FIXME: Don't use NOFAIL
*
Expand Down

0 comments on commit ec6f20f

Please sign in to comment.