Remove unused typedefs & last of the macro-to-function indirections
cover Remove unused typedefs & last of the macro-to-function indirections
At least I think it's the last of them. :)
Signature · 4 lines
_______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 1/4 Remove several unused typedefs.
---
fs/xfs/linux-2.6/xfs_aops.h +0 -2
@@ -21,8 +21,6 @@extern struct workqueue_struct *xfsdatad_workqueue;extern mempool_t *xfs_ioend_pool; -typedef void (*xfs_ioend_func_t )(void *); -/* * xfs_ioend struct manages large extent writes for XFS. * It can manage several multi-page bio's at once.
fs/xfs/xfs_acl.h +0 -1
@@ -22,7 +22,6 @@* Access Control Lists */ typedef __uint16_t xfs_acl_perm_t ; -typedef __int32_t xfs_acl_type_t ;typedef __int32_t xfs_acl_tag_t ;typedef __int32_t xfs_acl_id_t ;
fs/xfs/xfs_types.h +0 -2
@@ -111,8 +111,6 @@ typedef __uint64_t xfs_fileoff_t; /* blotypedef __int64_t xfs_sfiloff_t ;/* signed block number in a file */ typedef __uint64_t xfs_filblks_t ;/* number of blocks in a file */ -typedef __uint8_t xfs_arch_t ;/* architecture of an xfs fs */ -/* * Null values for the types. */
Signature · 4 lines
_______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [patch 1/4] Remove several unused typedefs.
Looks good.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 2/4 Remove macro-to-function indirections in attr code
In reply to Eric Sandeen---
fs/xfs/xfs_attr_leaf.c +36 -36
@@ -736,7 +736,7 @@ xfs_attr_shortform_allfit(xfs_dabuf_t *bcontinue ;/* don't copy partial entries */ if (!(entry->flags &XFS_ATTR_LOCAL ))return (0 ); - name_loc =XFS_ATTR_LEAF_NAME_LOCAL (leaf, i); + name_loc =xfs_attr_leaf_name_local (leaf, i);if (name_loc->namelen >=XFS_ATTR_SF_ENTSIZE_MAX )return (0 );if (be16_to_cpu (name_loc->valuelen) >=XFS_ATTR_SF_ENTSIZE_MAX )
@@ -823,7 +823,7 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *if (!entry->nameidx)continue ;ASSERT (entry->flags &XFS_ATTR_LOCAL ); - name_loc =XFS_ATTR_LEAF_NAME_LOCAL (leaf, i); + name_loc =xfs_attr_leaf_name_local (leaf, i); nargs.name = (char *)name_loc->nameval; nargs.namelen = name_loc->namelen; nargs.value = (char *)&name_loc->nameval[nargs.namelen];
@@ -1141,14 +1141,14 @@ xfs_attr_leaf_add_work(xfs_dabuf_t *bp,* as part of this transaction (a split operation for example). */ if (entry->flags &XFS_ATTR_LOCAL ) { - name_loc =XFS_ATTR_LEAF_NAME_LOCAL (leaf, args->index); + name_loc =xfs_attr_leaf_name_local (leaf, args->index); name_loc->namelen = args->namelen; name_loc->valuelen =cpu_to_be16 (args->valuelen);memcpy ((char *)name_loc->nameval, args->name, args->namelen);memcpy ((char *)&name_loc->nameval[args->namelen], args->value,be16_to_cpu (name_loc->valuelen)); }else { - name_rmt =XFS_ATTR_LEAF_NAME_REMOTE (leaf, args->index); + name_rmt =xfs_attr_leaf_name_remote (leaf, args->index); name_rmt->namelen = args->namelen;memcpy ((char *)name_rmt->name, args->name, args->namelen); entry->flags |=XFS_ATTR_INCOMPLETE ;
@@ -1159,7 +1159,7 @@ xfs_attr_leaf_add_work(xfs_dabuf_t *bp, args->rmtblkcnt =XFS_B_TO_FSB (mp, args->valuelen); }xfs_da_log_buf (args->trans, bp, -XFS_DA_LOGRANGE (leaf,XFS_ATTR_LEAF_NAME (leaf, args->index), +XFS_DA_LOGRANGE (leaf,xfs_attr_leaf_name (leaf, args->index),xfs_attr_leaf_entsize (leaf, args->index)));/*
@@ -1749,10 +1749,10 @@ xfs_attr_leaf_remove(xfs_dabuf_t *bp, xf/* * Compress the remaining entries and zero out the removed stuff. */ -memset (XFS_ATTR_LEAF_NAME (leaf, args->index),0 , entsize); +memset (xfs_attr_leaf_name (leaf, args->index),0 , entsize);be16_add_cpu (&hdr->usedbytes, -entsize);xfs_da_log_buf (args->trans, bp, -XFS_DA_LOGRANGE (leaf,XFS_ATTR_LEAF_NAME (leaf, args->index), +XFS_DA_LOGRANGE (leaf,xfs_attr_leaf_name (leaf, args->index), entsize)); tmp = (be16_to_cpu (hdr->count) - args->index)
@@ -1985,7 +1985,7 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bpcontinue ; }if (entry->flags &XFS_ATTR_LOCAL ) { - name_loc =XFS_ATTR_LEAF_NAME_LOCAL (leaf, probe); + name_loc =xfs_attr_leaf_name_local (leaf, probe);if (name_loc->namelen != args->namelen)continue ;if (memcmp (args->name, (char *)name_loc->nameval, args->namelen) !=0 )
@@ -1995,7 +1995,7 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp args->index = probe;return (XFS_ERROR (EEXIST )); }else { - name_rmt =XFS_ATTR_LEAF_NAME_REMOTE (leaf, probe); + name_rmt =xfs_attr_leaf_name_remote (leaf, probe);if (name_rmt->namelen != args->namelen)continue ; if (memcmp(args->name, (char *)name_rmt->name,
@@ -2035,7 +2035,7 @@ xfs_attr_leaf_getvalue(xfs_dabuf_t *bp, entry = &leaf->entries[args->index];if (entry->flags &XFS_ATTR_LOCAL ) { - name_loc =XFS_ATTR_LEAF_NAME_LOCAL (leaf, args->index); + name_loc =xfs_attr_leaf_name_local (leaf, args->index);ASSERT (name_loc->namelen == args->namelen);ASSERT (memcmp (args->name, name_loc->nameval, args->namelen) ==0 ); valuelen =be16_to_cpu (name_loc->valuelen);
@@ -2050,7 +2050,7 @@ xfs_attr_leaf_getvalue(xfs_dabuf_t *bp, args->valuelen = valuelen;memcpy (args->value, &name_loc->nameval[args->namelen], valuelen); }else { - name_rmt =XFS_ATTR_LEAF_NAME_REMOTE (leaf, args->index); + name_rmt =xfs_attr_leaf_name_remote (leaf, args->index);ASSERT (name_rmt->namelen == args->namelen);ASSERT (memcmp (args->name, name_rmt->name, args->namelen) ==0 ); valuelen =be32_to_cpu (name_rmt->valuelen);
@@ -2143,7 +2143,7 @@ xfs_attr_leaf_moveents(xfs_attr_leafbloc* off for 6.2, should be revisited later. */ if (entry_s->flags &XFS_ATTR_INCOMPLETE ) {/* skip partials? */ -memset (XFS_ATTR_LEAF_NAME (leaf_s, start_s + i),0 , tmp); +memset (xfs_attr_leaf_name (leaf_s, start_s + i),0 , tmp);be16_add_cpu (&hdr_s->usedbytes, -tmp);be16_add_cpu (&hdr_s->count,-1 ); entry_d--;/* to compensate for ++ in loop hdr */
@@ -2160,11 +2160,11 @@ xfs_attr_leaf_moveents(xfs_attr_leafbloc entry_d->flags = entry_s->flags;ASSERT (be16_to_cpu (entry_d->nameidx) + tmp <=XFS_LBSIZE (mp)); -memmove (XFS_ATTR_LEAF_NAME (leaf_d, desti), -XFS_ATTR_LEAF_NAME (leaf_s, start_s + i), tmp); +memmove (xfs_attr_leaf_name (leaf_d, desti), +xfs_attr_leaf_name (leaf_s, start_s + i), tmp);ASSERT (be16_to_cpu (entry_s->nameidx) + tmp <=XFS_LBSIZE (mp)); -memset (XFS_ATTR_LEAF_NAME (leaf_s, start_s + i),0 , tmp); +memset (xfs_attr_leaf_name (leaf_s, start_s + i),0 , tmp);be16_add_cpu (&hdr_s->usedbytes, -tmp);be16_add_cpu (&hdr_d->usedbytes, tmp);be16_add_cpu (&hdr_s->count,-1 );
@@ -2276,12 +2276,12 @@ xfs_attr_leaf_entsize(xfs_attr_leafblockASSERT (be16_to_cpu (leaf->hdr.info.magic) ==XFS_ATTR_LEAF_MAGIC );if (leaf->entries[index].flags &XFS_ATTR_LOCAL ) { - name_loc =XFS_ATTR_LEAF_NAME_LOCAL (leaf, index); - size =XFS_ATTR_LEAF_ENTSIZE_LOCAL (name_loc->namelen, + name_loc =xfs_attr_leaf_name_local (leaf, index); + size =xfs_attr_leaf_entsize_local (name_loc->namelen,be16_to_cpu (name_loc->valuelen)); }else { - name_rmt =XFS_ATTR_LEAF_NAME_REMOTE (leaf, index); - size =XFS_ATTR_LEAF_ENTSIZE_REMOTE (name_rmt->namelen); + name_rmt =xfs_attr_leaf_name_remote (leaf, index); + size =xfs_attr_leaf_entsize_remote (name_rmt->namelen); }return (size); }
@@ -2297,13 +2297,13 @@ xfs_attr_leaf_newentsize(int namelen, in {int size; - size =XFS_ATTR_LEAF_ENTSIZE_LOCAL (namelen, valuelen); -if (size <XFS_ATTR_LEAF_ENTSIZE_LOCAL_MAX (blocksize)) { + size =xfs_attr_leaf_entsize_local (namelen, valuelen); +if (size <xfs_attr_leaf_entsize_local_max (blocksize)) {if (local) { *local =1 ; } }else { - size =XFS_ATTR_LEAF_ENTSIZE_REMOTE (namelen); + size =xfs_attr_leaf_entsize_remote (namelen);if (local) { *local =0 ; }
@@ -2372,7 +2372,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp,if (entry->flags &XFS_ATTR_LOCAL ) {xfs_attr_leaf_name_local_t *name_loc = -XFS_ATTR_LEAF_NAME_LOCAL (leaf, i); +xfs_attr_leaf_name_local (leaf, i); retval = context->put_listent(context, entry->flags,
@@ -2384,7 +2384,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp,return retval; }else {xfs_attr_leaf_name_remote_t *name_rmt = -XFS_ATTR_LEAF_NAME_REMOTE (leaf, i); +xfs_attr_leaf_name_remote (leaf, i);int valuelen =be32_to_cpu (name_rmt->valuelen);
@@ -2468,11 +2468,11 @@ xfs_attr_leaf_clearflag(xfs_da_args_t *a#ifdef DEBUG if (entry->flags &XFS_ATTR_LOCAL ) { - name_loc =XFS_ATTR_LEAF_NAME_LOCAL (leaf, args->index); + name_loc =xfs_attr_leaf_name_local (leaf, args->index); namelen = name_loc->namelen; name = (char *)name_loc->nameval; }else { - name_rmt =XFS_ATTR_LEAF_NAME_REMOTE (leaf, args->index); + name_rmt =xfs_attr_leaf_name_remote (leaf, args->index); namelen = name_rmt->namelen; name = (char *)name_rmt->name; }
@@ -2487,7 +2487,7 @@ xfs_attr_leaf_clearflag(xfs_da_args_t *aif (args->rmtblkno) {ASSERT ((entry->flags &XFS_ATTR_LOCAL ) ==0 ); - name_rmt =XFS_ATTR_LEAF_NAME_REMOTE (leaf, args->index); + name_rmt =xfs_attr_leaf_name_remote (leaf, args->index); name_rmt->valueblk =cpu_to_be32 (args->rmtblkno); name_rmt->valuelen =cpu_to_be32 (args->valuelen); xfs_da_log_buf(args->trans, bp,
@@ -2534,7 +2534,7 @@ xfs_attr_leaf_setflag(xfs_da_args_t *argxfs_da_log_buf (args->trans, bp,XFS_DA_LOGRANGE (leaf, entry,sizeof (*entry)));if ((entry->flags &XFS_ATTR_LOCAL ) ==0 ) { - name_rmt =XFS_ATTR_LEAF_NAME_REMOTE (leaf, args->index); + name_rmt =xfs_attr_leaf_name_remote (leaf, args->index); name_rmt->valueblk =0 ; name_rmt->valuelen =0 ; xfs_da_log_buf(args->trans, bp,
@@ -2607,20 +2607,20 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *a#ifdef DEBUG if (entry1->flags &XFS_ATTR_LOCAL ) { - name_loc =XFS_ATTR_LEAF_NAME_LOCAL (leaf1, args->index); + name_loc =xfs_attr_leaf_name_local (leaf1, args->index); namelen1 = name_loc->namelen; name1 = (char *)name_loc->nameval; }else { - name_rmt =XFS_ATTR_LEAF_NAME_REMOTE (leaf1, args->index); + name_rmt =xfs_attr_leaf_name_remote (leaf1, args->index); namelen1 = name_rmt->namelen; name1 = (char *)name_rmt->name; }if (entry2->flags &XFS_ATTR_LOCAL ) { - name_loc =XFS_ATTR_LEAF_NAME_LOCAL (leaf2, args->index2); + name_loc =xfs_attr_leaf_name_local (leaf2, args->index2); namelen2 = name_loc->namelen; name2 = (char *)name_loc->nameval; }else { - name_rmt =XFS_ATTR_LEAF_NAME_REMOTE (leaf2, args->index2); + name_rmt =xfs_attr_leaf_name_remote (leaf2, args->index2); namelen2 = name_rmt->namelen; name2 = (char *)name_rmt->name; }
@@ -2637,7 +2637,7 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *a XFS_DA_LOGRANGE(leaf1, entry1, sizeof(*entry1)));if (args->rmtblkno) {ASSERT ((entry1->flags &XFS_ATTR_LOCAL ) ==0 ); - name_rmt =XFS_ATTR_LEAF_NAME_REMOTE (leaf1, args->index); + name_rmt =xfs_attr_leaf_name_remote (leaf1, args->index); name_rmt->valueblk =cpu_to_be32 (args->rmtblkno); name_rmt->valuelen =cpu_to_be32 (args->valuelen); xfs_da_log_buf(args->trans, bp1,
@@ -2648,7 +2648,7 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *axfs_da_log_buf (args->trans, bp2,XFS_DA_LOGRANGE (leaf2, entry2,sizeof (*entry2)));if ((entry2->flags &XFS_ATTR_LOCAL ) ==0 ) { - name_rmt =XFS_ATTR_LEAF_NAME_REMOTE (leaf2, args->index2); + name_rmt =xfs_attr_leaf_name_remote (leaf2, args->index2); name_rmt->valueblk =0 ; name_rmt->valuelen =0 ; xfs_da_log_buf(args->trans, bp2,
@@ -2855,7 +2855,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trafor (i =0 ; i <be16_to_cpu (leaf->hdr.count); entry++, i++) {if (be16_to_cpu (entry->nameidx) && ((entry->flags &XFS_ATTR_LOCAL ) ==0 )) { - name_rmt =XFS_ATTR_LEAF_NAME_REMOTE (leaf, i); + name_rmt =xfs_attr_leaf_name_remote (leaf, i);if (name_rmt->valueblk) count++; }
@@ -2883,7 +2883,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trafor (i =0 ; i <be16_to_cpu (leaf->hdr.count); entry++, i++) {if (be16_to_cpu (entry->nameidx) && ((entry->flags &XFS_ATTR_LOCAL ) ==0 )) { - name_rmt =XFS_ATTR_LEAF_NAME_REMOTE (leaf, i); + name_rmt =xfs_attr_leaf_name_remote (leaf, i);if (name_rmt->valueblk) { lp->valueblk =be32_to_cpu (name_rmt->valueblk); lp->valuelen = XFS_B_TO_FSB(dp->i_mount,
fs/xfs/xfs_attr_leaf.h +0 -12
@@ -151,8 +151,6 @@ typedef struct xfs_attr_leafblock {/* * Cast typed pointers for "local" and "remote" name/value structs. */ -#define XFS_ATTR_LEAF_NAME_REMOTE (leafp,idx) \ - xfs_attr_leaf_name_remote(leafp,idx)static inline xfs_attr_leaf_name_remote_t *xfs_attr_leaf_name_remote (xfs_attr_leafblock_t *leafp,int idx) {
@@ -160,8 +158,6 @@ xfs_attr_leaf_name_remote(xfs_attr_leafb &((char *)leafp)[be16_to_cpu (leafp->entries[idx].nameidx)]; } -#define XFS_ATTR_LEAF_NAME_LOCAL (leafp,idx) \ - xfs_attr_leaf_name_local(leafp,idx)static inline xfs_attr_leaf_name_local_t *xfs_attr_leaf_name_local (xfs_attr_leafblock_t *leafp,int idx) {
@@ -169,8 +165,6 @@ xfs_attr_leaf_name_local(xfs_attr_leafbl &((char *)leafp)[be16_to_cpu (leafp->entries[idx].nameidx)]; } -#define XFS_ATTR_LEAF_NAME (leafp,idx) \ - xfs_attr_leaf_name(leafp,idx)static inline char *xfs_attr_leaf_name (xfs_attr_leafblock_t *leafp,int idx) {return &((char *)leafp)[be16_to_cpu (leafp->entries[idx].nameidx)];
@@ -181,24 +175,18 @@ static inline char *xfs_attr_leaf_name(x* a "local" name/value structure, a "remote" name/value structure, and * a pointer which might be either. */ -#define XFS_ATTR_LEAF_ENTSIZE_REMOTE (nlen) \ - xfs_attr_leaf_entsize_remote(nlen)static inline int xfs_attr_leaf_entsize_remote (int nlen) {return ((uint )sizeof (xfs_attr_leaf_name_remote_t) -1 + (nlen) + \XFS_ATTR_LEAF_NAME_ALIGN -1 ) & ~(XFS_ATTR_LEAF_NAME_ALIGN -1 ); } -#define XFS_ATTR_LEAF_ENTSIZE_LOCAL (nlen,vlen) \ - xfs_attr_leaf_entsize_local(nlen,vlen)static inline int xfs_attr_leaf_entsize_local (int nlen,int vlen) {return ((uint )sizeof (xfs_attr_leaf_name_local_t) -1 + (nlen) + (vlen) +XFS_ATTR_LEAF_NAME_ALIGN -1 ) & ~(XFS_ATTR_LEAF_NAME_ALIGN -1 ); } -#define XFS_ATTR_LEAF_ENTSIZE_LOCAL_MAX (bsize) \ - xfs_attr_leaf_entsize_local_max(bsize)static inline int xfs_attr_leaf_entsize_local_max (int bsize) {return (((bsize) >>1 ) + ((bsize) >>2 ));
Signature · 4 lines
_______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [patch 2/4] Remove macro-to-function indirections in attr code
Nice, thanks.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 3/4 Remove macro-to-function indirections in the mask code
In reply to Eric Sandeen---
fs/xfs/xfs_bit.h +1 -9
@@ -23,24 +23,16 @@*/ /* -* masks with n high/low bits set, 32-bit values & 64-bit values +* masks with n high/low bits set, 64-bit values */ -#define XFS_MASK32HI (n) xfs_mask32hi(n) -static inline __uint32_t xfs_mask32hi (int n) -{ -return (__uint32_t)-1 << (32 - (n)); -} -#define XFS_MASK64HI (n) xfs_mask64hi(n)static inline __uint64_t xfs_mask64hi (int n) {return (__uint64_t)-1 << (64 - (n)); } -#define XFS_MASK32LO (n) xfs_mask32lo(n)static inline __uint32_t xfs_mask32lo (int n) {return ((__uint32_t )1 << (n)) -1 ; } -#define XFS_MASK64LO (n) xfs_mask64lo(n)static inline __uint64_t xfs_mask64lo (int n) {return ((__uint64_t )1 << (n)) -1 ;
fs/xfs/xfs_bmap_btree.c +42 -42
223 lines not on this page · raw message
fs/xfs/xfs_ag.h +1 -1
@@ -220,7 +220,7 @@ typedef struct xfs_perag#define XFS_FSB_TO_AGNO (mp,fsbno) \ ((xfs_agnumber_t)((fsbno) >> (mp)->m_sb.sb_agblklog))#define XFS_FSB_TO_AGBNO (mp,fsbno) \ - ((xfs_agblock_t)((fsbno) & XFS_MASK32LO((mp)->m_sb.sb_agblklog))) + ((xfs_agblock_t)((fsbno) & xfs_mask32lo((mp)->m_sb.sb_agblklog)))#define XFS_AGB_TO_DADDR (mp,agno,agbno) \ ((xfs_daddr_t)XFS_FSB_TO_BB(mp, \ (xfs_fsblock_t)(agno) * (mp)->m_sb.sb_agblocks + (agbno)))
Signature · 4 lines
_______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [patch 3/4] Remove macro-to-function indirections in the mask code
Looks good.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 4/4 Remove the rest of the macro-to-function indirections.
In reply to Eric Sandeen---
fs/xfs/quota/xfs_dquot.c +1 -1
@@ -421,7 +421,7 @@ xfs_qm_dqalloc(/* * Initialize the bmap freelist prior to calling bmapi code. */ -XFS_BMAP_INIT (&flist, &firstblock); +xfs_bmap_init (&flist, &firstblock);xfs_ilock (quotip,XFS_ILOCK_EXCL );/* * Return if this type of quotas is turned off while we didn't
fs/xfs/xfs_attr.c +13 -13
@@ -374,7 +374,7 @@ xfs_attr_set_int(xfs_inode_t *dp, struct* It won't fit in the shortform, transform to a leaf block. * GROT: another possible req'mt for a double-split btree op. */ -XFS_BMAP_INIT (args.flist, args.firstblock); +xfs_bmap_init (args.flist, args.firstblock); error =xfs_attr_shortform_to_leaf (&args);if (!error) { error = xfs_bmap_finish(&args.trans, args.flist,
@@ -956,7 +956,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *arg* Commit that transaction so that the node_addname() call * can manage its own transactions. */ -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_attr_leaf_to_node (args);if (!error) { error = xfs_bmap_finish(&args->trans, args->flist,
@@ -1057,7 +1057,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *arg* If the result is small enough, shrink it all into the inode. */ if ((forkoff =xfs_attr_shortform_allfit (bp, dp))) { -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_attr_leaf_to_shortform (bp, args, forkoff);/* bp is gone due to xfs_da_shrink_inode */ if (!error) {
@@ -1135,7 +1135,7 @@ xfs_attr_leaf_removename(xfs_da_args_t ** If the result is small enough, shrink it all into the inode. */ if ((forkoff =xfs_attr_shortform_allfit (bp, dp))) { -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_attr_leaf_to_shortform (bp, args, forkoff);/* bp is gone due to xfs_da_shrink_inode */ if (!error) {
@@ -1290,7 +1290,7 @@ restart:* have been a b-tree. */ xfs_da_state_free (state); -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_attr_leaf_to_node (args);if (!error) { error = xfs_bmap_finish(&args->trans,
@@ -1331,7 +1331,7 @@ restart:* in the index/blkno/rmtblkno/rmtblkcnt fields and * in the index2/blkno2/rmtblkno2/rmtblkcnt2 fields. */ -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_da_split (state);if (!error) { error = xfs_bmap_finish(&args->trans, args->flist,
@@ -1443,7 +1443,7 @@ restart:* Check to see if the tree needs to be collapsed. */ if (retval && (state->path.active >1 )) { -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_da_join (state);if (!error) { error = xfs_bmap_finish(&args->trans,
@@ -1579,7 +1579,7 @@ xfs_attr_node_removename(xfs_da_args_t ** Check to see if the tree needs to be collapsed. */ if (retval && (state->path.active >1 )) { -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_da_join (state);if (!error) { error = xfs_bmap_finish(&args->trans, args->flist,
@@ -1630,7 +1630,7 @@ xfs_attr_node_removename(xfs_da_args_t * == XFS_ATTR_LEAF_MAGIC);if ((forkoff =xfs_attr_shortform_allfit (bp, dp))) { -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_attr_leaf_to_shortform (bp, args, forkoff);/* bp is gone due to xfs_da_shrink_inode */ if (!error) {
@@ -2069,7 +2069,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args)/* * Allocate a single extent, up to the size of the value. */ -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); nmap =1 ; error = xfs_bmapi(args->trans, dp, (xfs_fileoff_t)lblkno, blkcnt,
@@ -2123,7 +2123,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args)/* * Try to remember where we decided to put the value. */ -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); nmap =1 ; error = xfs_bmapi(NULL, dp, (xfs_fileoff_t)lblkno, args->rmtblkcnt,
@@ -2188,7 +2188,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *ar/* * Try to remember where we decided to put the value. */ -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); nmap =1 ; error = xfs_bmapi(NULL, args->dp, (xfs_fileoff_t)lblkno, args->rmtblkcnt,
@@ -2229,7 +2229,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *ar blkcnt = args->rmtblkcnt; done =0 ;while (!done) { -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt, XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, 1, args->firstblock, args->flist,
fs/xfs/xfs_bmap.c +83 -83
539 lines not on this page · raw message
fs/xfs/xfs_bmap.h +0 -2
@@ -95,7 +95,6 @@ typedef struct xfs_bmap_free/* need write cache flushing and no */ /* additional allocation alignments */ -#define XFS_BMAPI_AFLAG (w) xfs_bmapi_aflag(w)static inline int xfs_bmapi_aflag (int w) {return (w ==XFS_ATTR_FORK ?XFS_BMAPI_ATTRFORK :0 );
@@ -107,7 +106,6 @@ static inline int xfs_bmapi_aflag(int w)#define DELAYSTARTBLOCK ((xfs_fsblock_t)-1LL)#define HOLESTARTBLOCK ((xfs_fsblock_t)-2LL) -#define XFS_BMAP_INIT (flp,fbp) xfs_bmap_init(flp,fbp)static inline void xfs_bmap_init (xfs_bmap_free_t *flp,xfs_fsblock_t *fbp) { ((flp)->xbf_first = NULL, (flp)->xbf_count = 0, \
fs/xfs/xfs_bmap_btree.c +10 -10
@@ -949,7 +949,7 @@ xfs_bmbt_killroot( cur->bc_bufs[level -1 ] =NULL ;be16_add_cpu (&block->bb_level,-1 );xfs_trans_log_inode (cur->bc_tp, ip, -XFS_ILOG_CORE |XFS_ILOG_FBROOT (cur->bc_private.b.whichfork)); +XFS_ILOG_CORE |xfs_ilog_fbroot (cur->bc_private.b.whichfork)); cur->bc_nlevels--;XFS_BMBT_TRACE_CURSOR (cur,EXIT );return 0 ;
@@ -986,7 +986,7 @@ xfs_bmbt_log_keys( ip = cur->bc_private.b.ip;xfs_trans_log_inode (tp, ip, -XFS_ILOG_FBROOT (cur->bc_private.b.whichfork)); +xfs_ilog_fbroot (cur->bc_private.b.whichfork)); }XFS_BMBT_TRACE_CURSOR (cur,EXIT ); }
@@ -1022,7 +1022,7 @@ xfs_bmbt_log_ptrs( ip = cur->bc_private.b.ip;xfs_trans_log_inode (tp, ip, -XFS_ILOG_FBROOT (cur->bc_private.b.whichfork)); +xfs_ilog_fbroot (cur->bc_private.b.whichfork)); }XFS_BMBT_TRACE_CURSOR (cur,EXIT ); }
@@ -1838,7 +1838,7 @@ __xfs_bmbt_get_all( b = (((xfs_dfsbno_t )l0 &xfs_mask64lo (9 )) <<43 ) | (((xfs_dfsbno_t )l1) >>21 ); -ASSERT ((b >>32 ) ==0 ||ISNULLDSTARTBLOCK (b)); +ASSERT ((b >>32 ) ==0 ||isnulldstartblock (b)); s->br_startblock = (xfs_fsblock_t)b; }#else /* !DEBUG */
@@ -1914,7 +1914,7 @@ xfs_bmbt_get_startblock( b = (((xfs_dfsbno_t )r->l0 &xfs_mask64lo (9 )) <<43 ) | (((xfs_dfsbno_t )r->l1) >>21 ); -ASSERT ((b >>32 ) ==0 ||ISNULLDSTARTBLOCK (b)); +ASSERT ((b >>32 ) ==0 ||isnulldstartblock (b));return (xfs_fsblock_t )b;#else /* !DEBUG */ return (xfs_fsblock_t)(((xfs_dfsbno_t )r->l1) >>21 );
@@ -2146,7 +2146,7 @@ xfs_bmbt_log_block(xfs_trans_log_buf (tp, bp, first, last); }else xfs_trans_log_inode (tp, cur->bc_private.b.ip, -XFS_ILOG_FBROOT (cur->bc_private.b.whichfork)); +xfs_ilog_fbroot (cur->bc_private.b.whichfork));XFS_BMBT_TRACE_CURSOR (cur,EXIT ); }
@@ -2312,7 +2312,7 @@ xfs_bmbt_newroot(xfs_bmbt_log_ptrs (cur, bp,1 ,be16_to_cpu (cblock->bb_numrecs));XFS_BMBT_TRACE_CURSOR (cur,EXIT ); *logflags |= -XFS_ILOG_CORE |XFS_ILOG_FBROOT (cur->bc_private.b.whichfork); +XFS_ILOG_CORE |xfs_ilog_fbroot (cur->bc_private.b.whichfork); *stat =1 ;return 0 ; }
@@ -2344,7 +2344,7 @@ xfs_bmbt_set_allf( ((xfs_bmbt_rec_base_t )blockcount & (xfs_bmbt_rec_base_t )xfs_mask64lo (21 ));#else /* !XFS_BIG_BLKNOS */ -if (ISNULLSTARTBLOCK (startblock)) { +if (isnullstartblock (startblock)) { r->l0 = ((xfs_bmbt_rec_base_t )extent_flag <<63 ) | ((xfs_bmbt_rec_base_t )startoff <<9 ) | (xfs_bmbt_rec_base_t )xfs_mask64lo (9 );
@@ -2404,7 +2404,7 @@ xfs_bmbt_disk_set_allf( ((xfs_bmbt_rec_base_t )blockcount & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)));#else /* !XFS_BIG_BLKNOS */ -if (ISNULLSTARTBLOCK (startblock)) { +if (isnullstartblock (startblock)) { r->l0 = cpu_to_be64( ((xfs_bmbt_rec_base_t)extent_flag << 63) | ((xfs_bmbt_rec_base_t)startoff << 9) |
@@ -2465,7 +2465,7 @@ xfs_bmbt_set_startblock( r->l1 = (r->l1 & (xfs_bmbt_rec_base_t )xfs_mask64lo (21 )) | (xfs_bmbt_rec_base_t)(v <<21 );#else /* !XFS_BIG_BLKNOS */ -if (ISNULLSTARTBLOCK (v)) { +if (isnullstartblock (v)) { r->l0 |= (xfs_bmbt_rec_base_t )xfs_mask64lo (9 ); r->l1 = (xfs_bmbt_rec_base_t )xfs_mask64hi (11 ) | ((xfs_bmbt_rec_base_t)v << 21) |
fs/xfs/xfs_bmap_btree.h +0 -4
@@ -75,26 +75,22 @@ typedef struct xfs_bmbt_rec_host {#define DSTARTBLOCKMASK \ (((((xfs_dfsbno_t)1) << DSTARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS) -#define ISNULLSTARTBLOCK (x) isnullstartblock(x)static inline int isnullstartblock (xfs_fsblock_t x) {return ((x) &STARTBLOCKMASK ) ==STARTBLOCKMASK ; } -#define ISNULLDSTARTBLOCK (x) isnulldstartblock(x)static inline int isnulldstartblock (xfs_dfsbno_t x) {return ((x) &DSTARTBLOCKMASK ) ==DSTARTBLOCKMASK ; } -#define NULLSTARTBLOCK (k) nullstartblock(k)static inline xfs_fsblock_t nullstartblock (int k) {ASSERT (k < (1 <<STARTBLOCKVALBITS ));return STARTBLOCKMASK | (k); } -#define STARTBLOCKVAL (x) startblockval(x)static inline xfs_filblks_t startblockval (xfs_fsblock_t x) {return (xfs_filblks_t)((x) & ~STARTBLOCKMASK );
fs/xfs/xfs_da_btree.c +4 -4
@@ -1594,7 +1594,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, x nmap =1 ;ASSERT (args->firstblock !=NULL );if ((error =xfs_bmapi (tp, dp, bno, count, -XFS_BMAPI_AFLAG (w)|XFS_BMAPI_WRITE |XFS_BMAPI_METADATA | +xfs_bmapi_aflag (w)|XFS_BMAPI_WRITE |XFS_BMAPI_METADATA |XFS_BMAPI_CONTIG , args->firstblock, args->total, &map, &nmap, args->flist,NULL ))) {
@@ -1615,7 +1615,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, x nmap =MIN (XFS_BMAP_MAX_NMAP , count); c = (int )(bno + count - b); if ((error = xfs_bmapi(tp, dp, b, c, - XFS_BMAPI_AFLAG(w)|XFS_BMAPI_WRITE| + xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE| XFS_BMAPI_METADATA, args->firstblock, args->total, &mapp[mapi], &nmap, args->flist,
@@ -1877,7 +1877,7 @@ xfs_da_shrink_inode(xfs_da_args_t *args,* the last block to the place we want to kill. */ if ((error =xfs_bunmapi (tp, dp, dead_blkno, count, -XFS_BMAPI_AFLAG (w)|XFS_BMAPI_METADATA , +xfs_bmapi_aflag (w)|XFS_BMAPI_METADATA ,0 , args->firstblock, args->flist,NULL , &done)) ==ENOSPC ) {if (w !=XFS_DATA_FORK )
@@ -1982,7 +1982,7 @@ xfs_da_do_buf(if ((error =xfs_bmapi (trans, dp, (xfs_fileoff_t )bno, nfsb,XFS_BMAPI_METADATA | -XFS_BMAPI_AFLAG (whichfork), +xfs_bmapi_aflag (whichfork),NULL ,0 , mapp, &nmap,NULL ,NULL ))) goto exit0; }
fs/xfs/xfs_ialloc.c +2 -2
@@ -315,7 +315,7 @@ xfs_ialloc_ag_alloc(*/ xfs_biozero (fbuf,0 , ninodes << args.mp->m_sb.sb_inodelog);for (i =0 ; i < ninodes; i++) { - free =XFS_MAKE_IPTR (args.mp, fbuf, i); + free =xfs_make_iptr (args.mp, fbuf, i); free->di_core.di_magic =cpu_to_be16 (XFS_DINODE_MAGIC ); free->di_core.di_version = version; free->di_core.di_gen =cpu_to_be32 (gen);
@@ -898,7 +898,7 @@ nextag: } } } - offset =XFS_IALLOC_FIND_FREE (&rec.ir_free); + offset =xfs_ialloc_find_free (&rec.ir_free);ASSERT (offset >=0 );ASSERT (offset <XFS_INODES_PER_CHUNK ); ASSERT((XFS_AGINO_TO_OFFSET(mp, rec.ir_startino) %
fs/xfs/xfs_ialloc.h +0 -2
@@ -38,7 +38,6 @@ struct xfs_trans;/* * Make an inode pointer out of the buffer/offset. */ -#define XFS_MAKE_IPTR (mp,b,o) xfs_make_iptr(mp,b,o)static inline struct xfs_dinode *xfs_make_iptr (struct xfs_mount *mp,struct xfs_buf *b,int o) {
@@ -49,7 +48,6 @@ xfs_make_iptr(struct xfs_mount *mp, stru/* * Find a free (set) bit in the inode bitmask. */ -#define XFS_IALLOC_FIND_FREE (fp) xfs_ialloc_find_free(fp)static inline int xfs_ialloc_find_free (xfs_inofree_t *fp) {return xfs_lowbit64 (*fp);
fs/xfs/xfs_ialloc_btree.h +0 -1
@@ -37,7 +37,6 @@ typedef __uint64_t xfs_inofree_t;#define XFS_INODES_PER_CHUNK_LOG (XFS_NBBYLOG + 3)#define XFS_INOBT_ALL_FREE ((xfs_inofree_t)-1) -#define XFS_INOBT_MASKN (i,n) xfs_inobt_maskn(i,n)static inline xfs_inofree_t xfs_inobt_maskn (int i,int n) { return (((n) >= XFS_INODES_PER_CHUNK ? \
fs/xfs/xfs_inode.c +3 -3
@@ -1662,10 +1662,10 @@ xfs_itruncate_finish(* in this file with garbage in them once recovery * runs. */ -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block); error = xfs_bunmapi(ntp, ip, first_unmap_block, unmap_len, - XFS_BMAPI_AFLAG(fork) | + xfs_bmapi_aflag(fork) | (sync ? 0 : XFS_BMAPI_ASYNC), XFS_ITRUNC_MAX_EXTENTS, &first_block, &free_list,
@@ -2784,7 +2784,7 @@ xfs_iextents_copy(for (i =0 ; i < nrecs; i++) {xfs_bmbt_rec_host_t *ep =xfs_iext_get_ext (ifp, i); start_block =xfs_bmbt_get_startblock (ep); -if (ISNULLSTARTBLOCK (start_block)) { +if (isnullstartblock (start_block)) {/* * It's a delayed allocation extent, so skip it. */
fs/xfs/xfs_inode_item.h +0 -9
@@ -147,22 +147,13 @@ typedef struct xfs_inode_log_item { xfs_inode_log_format_t ili_format; /* logged structure */ } xfs_inode_log_item_t; - -#define XFS_ILOG_FDATA (w) xfs_ilog_fdata(w) -static inline int xfs_ilog_fdata (int w) -{ -return (w ==XFS_DATA_FORK ?XFS_ILOG_DDATA :XFS_ILOG_ADATA ); -} -#endif /* __KERNEL__ */ -#define XFS_ILOG_FBROOT (w) xfs_ilog_fbroot(w)static inline int xfs_ilog_fbroot (int w) {return (w ==XFS_DATA_FORK ?XFS_ILOG_DBROOT :XFS_ILOG_ABROOT ); } -#define XFS_ILOG_FEXT (w) xfs_ilog_fext(w)static inline int xfs_ilog_fext (int w) {return (w ==XFS_DATA_FORK ?XFS_ILOG_DEXT :XFS_ILOG_AEXT );
fs/xfs/xfs_iomap.c +5 -5
@@ -155,7 +155,7 @@ xfs_imap_to_bmap( iomapp->iomap_bn =IOMAP_DADDR_NULL ; iomapp->iomap_flags |=IOMAP_DELAY ; }else { - iomapp->iomap_bn =XFS_FSB_TO_DB (ip, start_block); + iomapp->iomap_bn =xfs_fsb_to_db (ip, start_block);if (ISUNWRITTEN (imap)) iomapp->iomap_flags |=IOMAP_UNWRITTEN ; }
@@ -261,7 +261,7 @@ xfs_iomap(xfs_iunlock (ip, lockmode); lockmode =0 ; -if (nimaps && !ISNULLSTARTBLOCK (imap.br_startblock)) { +if (nimaps && !isnullstartblock (imap.br_startblock)) {xfs_iomap_map_trace (XFS_IOMAP_WRITE_MAP , ip, offset, count, iomapp, &imap, flags);break ;
@@ -498,7 +498,7 @@ xfs_iomap_write_direct(/* * Issue the xfs_bmapi() call to allocate the blocks */ -XFS_BMAP_INIT (&free_list, &firstfsb); +xfs_bmap_init (&free_list, &firstfsb); nimaps =1 ; error =xfs_bmapi (tp, ip, offset_fsb, count_fsb, bmapi_flag, &firstfsb,0 , &imap, &nimaps, &free_list,NULL );
@@ -765,7 +765,7 @@ xfs_iomap_write_allocate(xfs_trans_ijoin (tp, ip,XFS_ILOCK_EXCL );xfs_trans_ihold (tp, ip); -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block);/* * it is possible that the extents have changed since
@@ -925,7 +925,7 @@ xfs_iomap_write_unwritten(/* * Modify the unwritten extent state of the buffer. */ -XFS_BMAP_INIT (&free_list, &firstfsb); +xfs_bmap_init (&free_list, &firstfsb); nimaps =1 ; error = xfs_bmapi(tp, ip, offset_fsb, count_fsb, XFS_BMAPI_WRITE|XFS_BMAPI_CONVERT, &firstfsb,
fs/xfs/xfs_itable.c +3 -3
@@ -442,7 +442,7 @@ xfs_bulkstat( (chunkidx = agino - gino +1 ) <XFS_INODES_PER_CHUNK &&/* there are some left allocated */ -XFS_INOBT_MASKN (chunkidx, +xfs_inobt_maskn (chunkidx, XFS_INODES_PER_CHUNK - chunkidx) & ~gfree) {/* * Grab the chunk record. Mark all the
@@ -453,7 +453,7 @@ xfs_bulkstat(if (XFS_INOBT_MASK (i) & ~gfree) gcnt++; } - gfree |=XFS_INOBT_MASKN (0 , chunkidx); + gfree |=xfs_inobt_maskn (0 , chunkidx); irbp->ir_startino = gino; irbp->ir_freecount = gcnt; irbp->ir_free = gfree;
@@ -524,7 +524,7 @@ xfs_bulkstat( chunkidx <XFS_INODES_PER_CHUNK ; chunkidx += nicluster, agbno += nbcluster) { -if (XFS_INOBT_MASKN (chunkidx, +if (xfs_inobt_maskn (chunkidx, nicluster) & ~gfree)xfs_btree_reada_bufs (mp, agno, agbno, nbcluster);
fs/xfs/xfs_rename.c +1 -1
@@ -172,7 +172,7 @@ xfs_rename(xfs_sort_for_rename (src_dp, target_dp, src_ip, target_ip, inodes, &num_inodes); -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block); tp =xfs_trans_alloc (mp,XFS_TRANS_RENAME ); cancel_flags =XFS_TRANS_RELEASE_LOG_RES ; spaceres =XFS_RENAME_SPACE_RES (mp, target_name->len);
fs/xfs/xfs_rtalloc.c +1 -1
@@ -120,7 +120,7 @@ xfs_growfs_rt_alloc(if ((error =xfs_trans_iget (mp, tp, ino,0 ,XFS_ILOCK_EXCL , &ip))) goto error_cancel; -XFS_BMAP_INIT (&flist, &firstblock); +xfs_bmap_init (&flist, &firstblock);/* * Allocate blocks to the bitmap file. */
fs/xfs/xfs_rw.h +0 -1
@@ -28,7 +28,6 @@ struct xfs_mount;* file is a real time file or not, because the bmap code * does. */ -#define XFS_FSB_TO_DB (ip,fsb) xfs_fsb_to_db(ip,fsb)static inline xfs_daddr_t xfs_fsb_to_db (struct xfs_inode *ip,xfs_fsblock_t fsb) {
fs/xfs/xfs_vnodeops.c +10 -10
@@ -971,7 +971,7 @@ xfs_inactive_symlink_rmt(* Find the block(s) so we can inval and unmap them. */ done =0 ; -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block); nmaps =ARRAY_SIZE (mval); if ((error = xfs_bmapi(tp, ip, 0, XFS_B_TO_FSB(mp, size), XFS_BMAPI_METADATA, &first_block, 0, mval, &nmaps,
@@ -1391,7 +1391,7 @@ xfs_inactive(/* * Free the inode. */ -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block); error =xfs_ifree (tp, ip, &free_list);if (error) {/*
@@ -1564,7 +1564,7 @@ xfs_create(xfs_ilock (dp,XFS_ILOCK_EXCL |XFS_ILOCK_PARENT ); unlock_dp_on_error =B_TRUE ; -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block);ASSERT (ip ==NULL );
@@ -1984,7 +1984,7 @@ xfs_remove( } } -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block); error =xfs_dir_removename (tp, dp, name, ip->i_ino, &first_block, &free_list, resblks);if (error) {
@@ -2171,7 +2171,7 @@ xfs_link(if (error) goto error_return; -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block); error =xfs_dir_createname (tp, tdp, target_name, sip->i_ino, &first_block, &free_list, resblks);
@@ -2344,7 +2344,7 @@ xfs_mkdir(xfs_trans_ijoin (tp, dp,XFS_ILOCK_EXCL ); unlock_dp_on_error =B_FALSE ; -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block); error = xfs_dir_createname(tp, dp, dir_name, cdp->i_ino, &first_block, &free_list, resblks ?
@@ -2559,7 +2559,7 @@ xfs_symlink(* Initialize the bmap freelist prior to calling either * bmapi or the directory create code. */ -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block);/* * Allocate an inode for the symlink.
@@ -3100,7 +3100,7 @@ retry:/* * Issue the xfs_bmapi() call to allocate the blocks */ -XFS_BMAP_INIT (&free_list, &firstfsb); +xfs_bmap_init (&free_list, &firstfsb); error = xfs_bmapi(tp, ip, startoffset_fsb, allocatesize_fsb, bmapi_flag, &firstfsb, 0, imapp, &nimaps,
@@ -3218,7 +3218,7 @@ xfs_zero_remaining_bytes(XFS_BUF_UNDONE (bp);XFS_BUF_UNWRITE (bp);XFS_BUF_READ (bp); -XFS_BUF_SET_ADDR (bp,XFS_FSB_TO_DB (ip, imap.br_startblock)); +XFS_BUF_SET_ADDR (bp,xfs_fsb_to_db (ip, imap.br_startblock));xfsbdstrat (mp, bp); error =xfs_iowait (bp);if (error) {
@@ -3423,7 +3423,7 @@ xfs_free_file_space(/* * issue the bunmapi() call to free the blocks */ -XFS_BMAP_INIT (&free_list, &firstfsb); +xfs_bmap_init (&free_list, &firstfsb); error =xfs_bunmapi (tp, ip, startoffset_fsb, endoffset_fsb - startoffset_fsb,0 ,2 , &firstfsb, &free_list,NULL , &done);
fs/xfs/xfs_ag.h +3 -3
@@ -233,8 +233,8 @@ typedef struct xfs_perag#define XFS_AG_CHECK_DADDR (mp,d,len) \ ((len) == 1 ? \ ASSERT((d) == XFS_SB_DADDR || \ - XFS_DADDR_TO_AGBNO(mp, d) != XFS_SB_DADDR) : \ - ASSERT(XFS_DADDR_TO_AGNO(mp, d) == \ - XFS_DADDR_TO_AGNO(mp, (d) + (len) - 1))) + xfs_daddr_to_agbno(mp, d) != XFS_SB_DADDR) : \ + ASSERT(xfs_daddr_to_agno(mp, d) == \ + xfs_daddr_to_agno(mp, (d) + (len) - 1)))#endif /* __XFS_AG_H__ */
fs/xfs/xfs_alloc_btree.c +3 -3
@@ -1368,7 +1368,7 @@ xfs_alloc_newroot(/* * Our block is left, pick up the right block. */ - lbno =XFS_DADDR_TO_AGBNO (mp,XFS_BUF_ADDR (lbp)); + lbno =xfs_daddr_to_agbno (mp,XFS_BUF_ADDR (lbp)); rbno =be32_to_cpu (left->bb_rightsib); if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, cur->bc_private.a.agno, rbno, 0, &rbp,
@@ -1385,7 +1385,7 @@ xfs_alloc_newroot(*/ rbp = lbp; right = left; - rbno =XFS_DADDR_TO_AGBNO (mp,XFS_BUF_ADDR (rbp)); + rbno =xfs_daddr_to_agbno (mp,XFS_BUF_ADDR (rbp)); lbno =be32_to_cpu (right->bb_leftsib); if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, cur->bc_private.a.agno, lbno, 0, &lbp,
@@ -1688,7 +1688,7 @@ xfs_alloc_split(* Find the left block number by looking in the buffer. * Adjust numrecs, sibling pointers. */ - lbno =XFS_DADDR_TO_AGBNO (cur->bc_mp,XFS_BUF_ADDR (lbp)); + lbno =xfs_daddr_to_agbno (cur->bc_mp,XFS_BUF_ADDR (lbp));be16_add_cpu (&left->bb_numrecs, -(be16_to_cpu (right->bb_numrecs))); right->bb_rightsib = left->bb_rightsib; left->bb_rightsib =cpu_to_be32 (rbno);
fs/xfs/xfs_ialloc_btree.c +3 -3
@@ -1252,7 +1252,7 @@ xfs_inobt_newroot(* Our block is left, pick up the right block. */ lbp = bp; - lbno =XFS_DADDR_TO_AGBNO (args.mp,XFS_BUF_ADDR (lbp)); + lbno =xfs_daddr_to_agbno (args.mp,XFS_BUF_ADDR (lbp)); left = block; rbno =be32_to_cpu (left->bb_rightsib); if ((error = xfs_btree_read_bufs(args.mp, args.tp, args.agno,
@@ -1269,7 +1269,7 @@ xfs_inobt_newroot(* Our block is right, pick up the left block. */ rbp = bp; - rbno =XFS_DADDR_TO_AGBNO (args.mp,XFS_BUF_ADDR (rbp)); + rbno =xfs_daddr_to_agbno (args.mp,XFS_BUF_ADDR (rbp)); right = block; lbno =be32_to_cpu (right->bb_leftsib); if ((error = xfs_btree_read_bufs(args.mp, args.tp, args.agno,
@@ -1487,7 +1487,7 @@ xfs_inobt_split( lbp = cur->bc_bufs[level]; args.tp = cur->bc_tp; args.mp = cur->bc_mp; - lbno =XFS_DADDR_TO_AGBNO (args.mp,XFS_BUF_ADDR (lbp)); + lbno =xfs_daddr_to_agbno (args.mp,XFS_BUF_ADDR (lbp));/* * Allocate the new block. * If we can't do it, we're toast. Give up.
fs/xfs/xfs_mount.h +2 -4
@@ -47,9 +47,9 @@ typedef struct xfs_trans_reservations {/* * Moved here from xfs_ag.h to avoid reordering header files */ -#define XFS_DADDR_TO_AGNO (mp,d) \ +#define xfs_daddr_to_agno (mp,d) \ ((xfs_agnumber_t)(XFS_BB_TO_FSBT(mp, d) / (mp)->m_sb.sb_agblocks)) -#define XFS_DADDR_TO_AGBNO (mp,d) \ +#define xfs_daddr_to_agbno (mp,d) \ ((xfs_agblock_t)(XFS_BB_TO_FSBT(mp, d) % (mp)->m_sb.sb_agblocks))#else struct cred ;
@@ -444,7 +444,6 @@ void xfs_do_force_shutdown(struct xfs_mo*/ #define XFS_MFSI_QUIET 0x40/* Be silent if mount errors found */ -#define XFS_DADDR_TO_AGNO (mp,d) xfs_daddr_to_agno(mp,d)static inline xfs_agnumber_t xfs_daddr_to_agno (struct xfs_mount *mp,xfs_daddr_t d) {
@@ -453,7 +452,6 @@ xfs_daddr_to_agno(struct xfs_mount *mp,return (xfs_agnumber_t ) ld; } -#define XFS_DADDR_TO_AGBNO (mp,d) xfs_daddr_to_agbno(mp,d)static inline xfs_agblock_t xfs_daddr_to_agbno (struct xfs_mount *mp,xfs_daddr_t d) {
fs/xfs/xfs_sb.h +1 -1
@@ -498,7 +498,7 @@ static inline void xfs_sb_version_remove#define XFS_HDR_BLOCK (mp,d) ((xfs_agblock_t)XFS_BB_TO_FSBT(mp,d))#define XFS_DADDR_TO_FSB (mp,d) XFS_AGB_TO_FSB(mp, \ - XFS_DADDR_TO_AGNO(mp,d), XFS_DADDR_TO_AGBNO(mp,d)) + xfs_daddr_to_agno(mp,d), xfs_daddr_to_agbno(mp,d))#define XFS_FSB_TO_DADDR (mp,fsbno) XFS_AGB_TO_DADDR(mp, \ XFS_FSB_TO_AGNO(mp,fsbno), XFS_FSB_TO_AGBNO(mp,fsbno))
Signature · 4 lines
_______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [patch 4/4] Remove the rest of the macro-to-function indirections.
Looks good.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [patch 4/4] Remove the rest of the macro-to-function indirections.
In reply to Eric SandeenEric, I just tried to apply this patch and it failed. Could you please update it and repost?
The other three patches in this series were fine.
Lachlan
Eric Sandeen wrote:
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [patch 4/4] Remove the rest of the macro-to-function indirections.
Quoted 6 lines · Lachlan McIlroy
Eric, I just tried to apply this patch and it failed. Could you please update it and repost?
The other three patches in this series were fine.
Lachlan
sorry, this one slipped. Will get on it :)
Thanks,
-Eric
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 4/4 Remove the rest of the macro-to-function indirections.
In reply to Eric SandeenRemove the last of the macros-defined-to-static-functions.
Test built only.
---
(sorry, somehow the last send was on an old tree)
fs/xfs/quota/xfs_dquot.c +1 -1
@@ -421,7 +421,7 @@ xfs_qm_dqalloc(/* * Initialize the bmap freelist prior to calling bmapi code. */ -XFS_BMAP_INIT (&flist, &firstblock); +xfs_bmap_init (&flist, &firstblock);xfs_ilock (quotip,XFS_ILOCK_EXCL );/* * Return if this type of quotas is turned off while we didn't
fs/xfs/xfs_ag.h +3 -3
@@ -244,8 +244,8 @@ typedef struct xfs_perag#define XFS_AG_CHECK_DADDR (mp,d,len) \ ((len) == 1 ? \ ASSERT((d) == XFS_SB_DADDR || \ - XFS_DADDR_TO_AGBNO(mp, d) != XFS_SB_DADDR) : \ - ASSERT(XFS_DADDR_TO_AGNO(mp, d) == \ - XFS_DADDR_TO_AGNO(mp, (d) + (len) - 1))) + xfs_daddr_to_agbno(mp, d) != XFS_SB_DADDR) : \ + ASSERT(xfs_daddr_to_agno(mp, d) == \ + xfs_daddr_to_agno(mp, (d) + (len) - 1)))#endif /* __XFS_AG_H__ */
fs/xfs/xfs_alloc_btree.c +1 -1
@@ -115,7 +115,7 @@ xfs_allocbt_free_block(xfs_agblock_t bno;int error; - bno =XFS_DADDR_TO_AGBNO (cur->bc_mp,XFS_BUF_ADDR (bp)); + bno =xfs_daddr_to_agbno (cur->bc_mp,XFS_BUF_ADDR (bp)); error =xfs_alloc_put_freelist (cur->bc_tp, agbp,NULL , bno,1 );if (error)return error;
fs/xfs/xfs_attr.c +13 -13
@@ -374,7 +374,7 @@ xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name,* It won't fit in the shortform, transform to a leaf block. * GROT: another possible req'mt for a double-split btree op. */ -XFS_BMAP_INIT (args.flist, args.firstblock); +xfs_bmap_init (args.flist, args.firstblock); error =xfs_attr_shortform_to_leaf (&args);if (!error) { error = xfs_bmap_finish(&args.trans, args.flist,
@@ -956,7 +956,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)* Commit that transaction so that the node_addname() call * can manage its own transactions. */ -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_attr_leaf_to_node (args);if (!error) { error = xfs_bmap_finish(&args->trans, args->flist,
@@ -1057,7 +1057,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)* If the result is small enough, shrink it all into the inode. */ if ((forkoff =xfs_attr_shortform_allfit (bp, dp))) { -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_attr_leaf_to_shortform (bp, args, forkoff);/* bp is gone due to xfs_da_shrink_inode */ if (!error) {
@@ -1135,7 +1135,7 @@ xfs_attr_leaf_removename(xfs_da_args_t *args)* If the result is small enough, shrink it all into the inode. */ if ((forkoff =xfs_attr_shortform_allfit (bp, dp))) { -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_attr_leaf_to_shortform (bp, args, forkoff);/* bp is gone due to xfs_da_shrink_inode */ if (!error) {
@@ -1290,7 +1290,7 @@ restart:* have been a b-tree. */ xfs_da_state_free (state); -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_attr_leaf_to_node (args);if (!error) { error = xfs_bmap_finish(&args->trans,
@@ -1331,7 +1331,7 @@ restart:* in the index/blkno/rmtblkno/rmtblkcnt fields and * in the index2/blkno2/rmtblkno2/rmtblkcnt2 fields. */ -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_da_split (state);if (!error) { error = xfs_bmap_finish(&args->trans, args->flist,
@@ -1443,7 +1443,7 @@ restart:* Check to see if the tree needs to be collapsed. */ if (retval && (state->path.active >1 )) { -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_da_join (state);if (!error) { error = xfs_bmap_finish(&args->trans,
@@ -1579,7 +1579,7 @@ xfs_attr_node_removename(xfs_da_args_t *args)* Check to see if the tree needs to be collapsed. */ if (retval && (state->path.active >1 )) { -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_da_join (state);if (!error) { error = xfs_bmap_finish(&args->trans, args->flist,
@@ -1630,7 +1630,7 @@ xfs_attr_node_removename(xfs_da_args_t *args) == XFS_ATTR_LEAF_MAGIC);if ((forkoff =xfs_attr_shortform_allfit (bp, dp))) { -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error =xfs_attr_leaf_to_shortform (bp, args, forkoff);/* bp is gone due to xfs_da_shrink_inode */ if (!error) {
@@ -2069,7 +2069,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args)/* * Allocate a single extent, up to the size of the value. */ -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); nmap =1 ; error = xfs_bmapi(args->trans, dp, (xfs_fileoff_t)lblkno, blkcnt,
@@ -2123,7 +2123,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args)/* * Try to remember where we decided to put the value. */ -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); nmap =1 ; error = xfs_bmapi(NULL, dp, (xfs_fileoff_t)lblkno, args->rmtblkcnt,
@@ -2188,7 +2188,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args)/* * Try to remember where we decided to put the value. */ -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); nmap =1 ; error = xfs_bmapi(NULL, args->dp, (xfs_fileoff_t)lblkno, args->rmtblkcnt,
@@ -2229,7 +2229,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args) blkcnt = args->rmtblkcnt; done =0 ;while (!done) { -XFS_BMAP_INIT (args->flist, args->firstblock); +xfs_bmap_init (args->flist, args->firstblock); error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt, XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, 1, args->firstblock, args->flist,
fs/xfs/xfs_bmap.c +83 -83
539 lines not on this page · raw message
fs/xfs/xfs_bmap.h +0 -2
@@ -95,7 +95,6 @@ typedef struct xfs_bmap_free/* need write cache flushing and no */ /* additional allocation alignments */ -#define XFS_BMAPI_AFLAG (w) xfs_bmapi_aflag(w)static inline int xfs_bmapi_aflag (int w) {return (w ==XFS_ATTR_FORK ?XFS_BMAPI_ATTRFORK :0 );
@@ -107,7 +106,6 @@ static inline int xfs_bmapi_aflag(int w)#define DELAYSTARTBLOCK ((xfs_fsblock_t)-1LL)#define HOLESTARTBLOCK ((xfs_fsblock_t)-2LL) -#define XFS_BMAP_INIT (flp,fbp) xfs_bmap_init(flp,fbp)static inline void xfs_bmap_init (xfs_bmap_free_t *flp,xfs_fsblock_t *fbp) { ((flp)->xbf_first = NULL, (flp)->xbf_count = 0, \
fs/xfs/xfs_bmap_btree.c +5 -5
@@ -121,7 +121,7 @@ __xfs_bmbt_get_all( b = (((xfs_dfsbno_t )l0 &xfs_mask64lo (9 )) <<43 ) | (((xfs_dfsbno_t )l1) >>21 ); -ASSERT ((b >>32 ) ==0 ||ISNULLDSTARTBLOCK (b)); +ASSERT ((b >>32 ) ==0 ||isnulldstartblock (b)); s->br_startblock = (xfs_fsblock_t)b; }#else /* !DEBUG */
@@ -172,7 +172,7 @@ xfs_bmbt_get_startblock( b = (((xfs_dfsbno_t )r->l0 &xfs_mask64lo (9 )) <<43 ) | (((xfs_dfsbno_t )r->l1) >>21 ); -ASSERT ((b >>32 ) ==0 ||ISNULLDSTARTBLOCK (b)); +ASSERT ((b >>32 ) ==0 ||isnulldstartblock (b));return (xfs_fsblock_t )b;#else /* !DEBUG */ return (xfs_fsblock_t)(((xfs_dfsbno_t )r->l1) >>21 );
@@ -261,7 +261,7 @@ xfs_bmbt_set_allf( ((xfs_bmbt_rec_base_t )blockcount & (xfs_bmbt_rec_base_t )xfs_mask64lo (21 ));#else /* !XFS_BIG_BLKNOS */ -if (ISNULLSTARTBLOCK (startblock)) { +if (isnullstartblock (startblock)) { r->l0 = ((xfs_bmbt_rec_base_t )extent_flag <<63 ) | ((xfs_bmbt_rec_base_t )startoff <<9 ) | (xfs_bmbt_rec_base_t )xfs_mask64lo (9 );
@@ -321,7 +321,7 @@ xfs_bmbt_disk_set_allf( ((xfs_bmbt_rec_base_t )blockcount & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)));#else /* !XFS_BIG_BLKNOS */ -if (ISNULLSTARTBLOCK (startblock)) { +if (isnullstartblock (startblock)) { r->l0 = cpu_to_be64( ((xfs_bmbt_rec_base_t)extent_flag << 63) | ((xfs_bmbt_rec_base_t)startoff << 9) |
@@ -382,7 +382,7 @@ xfs_bmbt_set_startblock( r->l1 = (r->l1 & (xfs_bmbt_rec_base_t )xfs_mask64lo (21 )) | (xfs_bmbt_rec_base_t)(v <<21 );#else /* !XFS_BIG_BLKNOS */ -if (ISNULLSTARTBLOCK (v)) { +if (isnullstartblock (v)) { r->l0 |= (xfs_bmbt_rec_base_t )xfs_mask64lo (9 ); r->l1 = (xfs_bmbt_rec_base_t )xfs_mask64hi (11 ) | ((xfs_bmbt_rec_base_t)v << 21) |
fs/xfs/xfs_bmap_btree.h +0 -4
@@ -76,26 +76,22 @@ typedef struct xfs_bmbt_rec_host {#define DSTARTBLOCKMASK \ (((((xfs_dfsbno_t)1) << DSTARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS) -#define ISNULLSTARTBLOCK (x) isnullstartblock(x)static inline int isnullstartblock (xfs_fsblock_t x) {return ((x) &STARTBLOCKMASK ) ==STARTBLOCKMASK ; } -#define ISNULLDSTARTBLOCK (x) isnulldstartblock(x)static inline int isnulldstartblock (xfs_dfsbno_t x) {return ((x) &DSTARTBLOCKMASK ) ==DSTARTBLOCKMASK ; } -#define NULLSTARTBLOCK (k) nullstartblock(k)static inline xfs_fsblock_t nullstartblock (int k) {ASSERT (k < (1 <<STARTBLOCKVALBITS ));return STARTBLOCKMASK | (k); } -#define STARTBLOCKVAL (x) startblockval(x)static inline xfs_filblks_t startblockval (xfs_fsblock_t x) {return (xfs_filblks_t)((x) & ~STARTBLOCKMASK );
fs/xfs/xfs_btree.c +3 -3
@@ -960,7 +960,7 @@ xfs_btree_buf_to_ptr( ptr->l =cpu_to_be64 (XFS_DADDR_TO_FSB (cur->bc_mp,XFS_BUF_ADDR (bp))); else { - ptr->s =cpu_to_be32 (XFS_DADDR_TO_AGBNO (cur->bc_mp, + ptr->s =cpu_to_be32 (xfs_daddr_to_agbno (cur->bc_mp,XFS_BUF_ADDR (bp))); } }
@@ -2454,7 +2454,7 @@ xfs_btree_new_iroot(xfs_btree_log_ptrs (cur, cbp,1 ,be16_to_cpu (cblock->bb_numrecs)); *logflags |= -XFS_ILOG_CORE |XFS_ILOG_FBROOT (cur->bc_private.b.whichfork); +XFS_ILOG_CORE |xfs_ilog_fbroot (cur->bc_private.b.whichfork); *stat =1 ;XFS_BTREE_TRACE_CURSOR (cur,XBT_EXIT );return 0 ;
@@ -3048,7 +3048,7 @@ xfs_btree_kill_iroot( cur->bc_bufs[level -1 ] =NULL ;be16_add_cpu (&block->bb_level,-1 );xfs_trans_log_inode (cur->bc_tp, ip, -XFS_ILOG_CORE |XFS_ILOG_FBROOT (cur->bc_private.b.whichfork)); +XFS_ILOG_CORE |xfs_ilog_fbroot (cur->bc_private.b.whichfork)); cur->bc_nlevels--; out0:XFS_BTREE_TRACE_CURSOR (cur,XBT_EXIT );
fs/xfs/xfs_da_btree.c +4 -4
@@ -1597,7 +1597,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno) nmap =1 ;ASSERT (args->firstblock !=NULL );if ((error =xfs_bmapi (tp, dp, bno, count, -XFS_BMAPI_AFLAG (w)|XFS_BMAPI_WRITE |XFS_BMAPI_METADATA | +xfs_bmapi_aflag (w)|XFS_BMAPI_WRITE |XFS_BMAPI_METADATA |XFS_BMAPI_CONTIG , args->firstblock, args->total, &map, &nmap, args->flist,NULL ))) {
@@ -1618,7 +1618,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno) nmap =MIN (XFS_BMAP_MAX_NMAP , count); c = (int )(bno + count - b); if ((error = xfs_bmapi(tp, dp, b, c, - XFS_BMAPI_AFLAG(w)|XFS_BMAPI_WRITE| + xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE| XFS_BMAPI_METADATA, args->firstblock, args->total, &mapp[mapi], &nmap, args->flist,
@@ -1882,7 +1882,7 @@ xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,* the last block to the place we want to kill. */ if ((error =xfs_bunmapi (tp, dp, dead_blkno, count, -XFS_BMAPI_AFLAG (w)|XFS_BMAPI_METADATA , +xfs_bmapi_aflag (w)|XFS_BMAPI_METADATA ,0 , args->firstblock, args->flist,NULL , &done)) ==ENOSPC ) {if (w !=XFS_DATA_FORK )
@@ -1987,7 +1987,7 @@ xfs_da_do_buf(if ((error =xfs_bmapi (trans, dp, (xfs_fileoff_t )bno, nfsb,XFS_BMAPI_METADATA | -XFS_BMAPI_AFLAG (whichfork), +xfs_bmapi_aflag (whichfork),NULL ,0 , mapp, &nmap,NULL ,NULL ))) goto exit0; }
fs/xfs/xfs_ialloc.c +3 -3
@@ -357,7 +357,7 @@ xfs_ialloc_ag_alloc(int ioffset = i << args.mp->m_sb.sb_inodelog;uint isize =sizeof (struct xfs_dinode ); - free =XFS_MAKE_IPTR (args.mp, fbuf, i); + free =xfs_make_iptr (args.mp, fbuf, i); free->di_magic =cpu_to_be16 (XFS_DINODE_MAGIC ); free->di_version = version; free->di_gen =cpu_to_be32 (gen);
@@ -937,7 +937,7 @@ nextag: } } } - offset =XFS_IALLOC_FIND_FREE (&rec.ir_free); + offset =xfs_ialloc_find_free (&rec.ir_free);ASSERT (offset >=0 );ASSERT (offset <XFS_INODES_PER_CHUNK ); ASSERT((XFS_AGINO_TO_OFFSET(mp, rec.ir_startino) %
@@ -1279,7 +1279,7 @@ xfs_imap( offset =XFS_INO_TO_OFFSET (mp, ino);ASSERT (offset < mp->m_sb.sb_inopblock); - cluster_agbno =XFS_DADDR_TO_AGBNO (mp, imap->im_blkno); + cluster_agbno =xfs_daddr_to_agbno (mp, imap->im_blkno); offset += (agbno - cluster_agbno) * mp->m_sb.sb_inopblock; imap->im_len =XFS_FSB_TO_BB (mp, blks_per_cluster);
fs/xfs/xfs_ialloc.h +0 -2
@@ -39,7 +39,6 @@ struct xfs_trans;/* * Make an inode pointer out of the buffer/offset. */ -#define XFS_MAKE_IPTR (mp,b,o) xfs_make_iptr(mp,b,o)static inline struct xfs_dinode *xfs_make_iptr (struct xfs_mount *mp,struct xfs_buf *b,int o) {
@@ -50,7 +49,6 @@ xfs_make_iptr(struct xfs_mount *mp, struct xfs_buf *b, int o)/* * Find a free (set) bit in the inode bitmask. */ -#define XFS_IALLOC_FIND_FREE (fp) xfs_ialloc_find_free(fp)static inline int xfs_ialloc_find_free (xfs_inofree_t *fp) {return xfs_lowbit64 (*fp);
fs/xfs/xfs_ialloc_btree.h +0 -1
@@ -36,7 +36,6 @@ typedef __uint64_t xfs_inofree_t;#define XFS_INODES_PER_CHUNK_LOG (XFS_NBBYLOG + 3)#define XFS_INOBT_ALL_FREE ((xfs_inofree_t)-1) -#define XFS_INOBT_MASKN (i,n) xfs_inobt_maskn(i,n)static inline xfs_inofree_t xfs_inobt_maskn (int i,int n) { return (((n) >= XFS_INODES_PER_CHUNK ? \
fs/xfs/xfs_inode.c +3 -3
@@ -1601,10 +1601,10 @@ xfs_itruncate_finish(* in this file with garbage in them once recovery * runs. */ -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block); error = xfs_bunmapi(ntp, ip, first_unmap_block, unmap_len, - XFS_BMAPI_AFLAG(fork) | + xfs_bmapi_aflag(fork) | (sync ? 0 : XFS_BMAPI_ASYNC), XFS_ITRUNC_MAX_EXTENTS, &first_block, &free_list,
@@ -2557,7 +2557,7 @@ xfs_iextents_copy(for (i =0 ; i < nrecs; i++) {xfs_bmbt_rec_host_t *ep =xfs_iext_get_ext (ifp, i); start_block =xfs_bmbt_get_startblock (ep); -if (ISNULLSTARTBLOCK (start_block)) { +if (isnullstartblock (start_block)) {/* * It's a delayed allocation extent, so skip it. */
fs/xfs/xfs_inode_item.h +0 -4
@@ -111,20 +111,16 @@ typedef struct xfs_inode_log_format_64 {#define XFS_ILI_IOLOCKED_ANY (XFS_ILI_IOLOCKED_EXCL | XFS_ILI_IOLOCKED_SHARED) - -#define XFS_ILOG_FBROOT (w) xfs_ilog_fbroot(w)static inline int xfs_ilog_fbroot (int w) {return (w ==XFS_DATA_FORK ?XFS_ILOG_DBROOT :XFS_ILOG_ABROOT ); } -#define XFS_ILOG_FEXT (w) xfs_ilog_fext(w)static inline int xfs_ilog_fext (int w) {return (w ==XFS_DATA_FORK ?XFS_ILOG_DEXT :XFS_ILOG_AEXT ); } -#define XFS_ILOG_FDATA (w) xfs_ilog_fdata(w)static inline int xfs_ilog_fdata (int w) {return (w ==XFS_DATA_FORK ?XFS_ILOG_DDATA :XFS_ILOG_ADATA );
fs/xfs/xfs_iomap.c +5 -5
@@ -155,7 +155,7 @@ xfs_imap_to_bmap( iomapp->iomap_bn =IOMAP_DADDR_NULL ; iomapp->iomap_flags |=IOMAP_DELAY ; }else { - iomapp->iomap_bn =XFS_FSB_TO_DB (ip, start_block); + iomapp->iomap_bn =xfs_fsb_to_db (ip, start_block);if (ISUNWRITTEN (imap)) iomapp->iomap_flags |=IOMAP_UNWRITTEN ; }
@@ -261,7 +261,7 @@ xfs_iomap(xfs_iunlock (ip, lockmode); lockmode =0 ; -if (nimaps && !ISNULLSTARTBLOCK (imap.br_startblock)) { +if (nimaps && !isnullstartblock (imap.br_startblock)) {xfs_iomap_map_trace (XFS_IOMAP_WRITE_MAP , ip, offset, count, iomapp, &imap, flags);break ;
@@ -491,7 +491,7 @@ xfs_iomap_write_direct(/* * Issue the xfs_bmapi() call to allocate the blocks */ -XFS_BMAP_INIT (&free_list, &firstfsb); +xfs_bmap_init (&free_list, &firstfsb); nimaps =1 ; error =xfs_bmapi (tp, ip, offset_fsb, count_fsb, bmapi_flag, &firstfsb,0 , &imap, &nimaps, &free_list,NULL );
@@ -751,7 +751,7 @@ xfs_iomap_write_allocate(xfs_trans_ijoin (tp, ip,XFS_ILOCK_EXCL );xfs_trans_ihold (tp, ip); -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block);/* * it is possible that the extents have changed since
@@ -911,7 +911,7 @@ xfs_iomap_write_unwritten(/* * Modify the unwritten extent state of the buffer. */ -XFS_BMAP_INIT (&free_list, &firstfsb); +xfs_bmap_init (&free_list, &firstfsb); nimaps =1 ; error = xfs_bmapi(tp, ip, offset_fsb, count_fsb, XFS_BMAPI_WRITE|XFS_BMAPI_CONVERT, &firstfsb,
fs/xfs/xfs_itable.c +3 -3
@@ -453,7 +453,7 @@ xfs_bulkstat( (chunkidx = agino - gino +1 ) <XFS_INODES_PER_CHUNK &&/* there are some left allocated */ -XFS_INOBT_MASKN (chunkidx, +xfs_inobt_maskn (chunkidx, XFS_INODES_PER_CHUNK - chunkidx) & ~gfree) {/* * Grab the chunk record. Mark all the
@@ -464,7 +464,7 @@ xfs_bulkstat(if (XFS_INOBT_MASK (i) & ~gfree) gcnt++; } - gfree |=XFS_INOBT_MASKN (0 , chunkidx); + gfree |=xfs_inobt_maskn (0 , chunkidx); irbp->ir_startino = gino; irbp->ir_freecount = gcnt; irbp->ir_free = gfree;
@@ -535,7 +535,7 @@ xfs_bulkstat( chunkidx <XFS_INODES_PER_CHUNK ; chunkidx += nicluster, agbno += nbcluster) { -if (XFS_INOBT_MASKN (chunkidx, +if (xfs_inobt_maskn (chunkidx, nicluster) & ~gfree)xfs_btree_reada_bufs (mp, agno, agbno, nbcluster);
fs/xfs/xfs_mount.h +2 -4
@@ -44,9 +44,9 @@ typedef struct xfs_trans_reservations {#ifndef __KERNEL__ -#define XFS_DADDR_TO_AGNO (mp,d) \ +#define xfs_daddr_to_agno (mp,d) \ ((xfs_agnumber_t)(XFS_BB_TO_FSBT(mp, d) / (mp)->m_sb.sb_agblocks)) -#define XFS_DADDR_TO_AGBNO (mp,d) \ +#define xfs_daddr_to_agbno (mp,d) \ ((xfs_agblock_t)(XFS_BB_TO_FSBT(mp, d) % (mp)->m_sb.sb_agblocks))#else /* __KERNEL__ */
@@ -439,7 +439,6 @@ void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname,*/ #define XFS_MFSI_QUIET 0x40/* Be silent if mount errors found */ -#define XFS_DADDR_TO_AGNO (mp,d) xfs_daddr_to_agno(mp,d)static inline xfs_agnumber_t xfs_daddr_to_agno (struct xfs_mount *mp,xfs_daddr_t d) {
@@ -448,7 +447,6 @@ xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d)return (xfs_agnumber_t ) ld; } -#define XFS_DADDR_TO_AGBNO (mp,d) xfs_daddr_to_agbno(mp,d)static inline xfs_agblock_t xfs_daddr_to_agbno (struct xfs_mount *mp,xfs_daddr_t d) {
fs/xfs/xfs_rename.c +1 -1
@@ -147,7 +147,7 @@ xfs_rename(xfs_sort_for_rename (src_dp, target_dp, src_ip, target_ip, inodes, &num_inodes); -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block); tp =xfs_trans_alloc (mp,XFS_TRANS_RENAME ); cancel_flags =XFS_TRANS_RELEASE_LOG_RES ; spaceres =XFS_RENAME_SPACE_RES (mp, target_name->len);
fs/xfs/xfs_rtalloc.c +1 -1
@@ -120,7 +120,7 @@ xfs_growfs_rt_alloc(if ((error =xfs_trans_iget (mp, tp, ino,0 ,XFS_ILOCK_EXCL , &ip))) goto error_cancel; -XFS_BMAP_INIT (&flist, &firstblock); +xfs_bmap_init (&flist, &firstblock);/* * Allocate blocks to the bitmap file. */
fs/xfs/xfs_rw.h +0 -1
@@ -28,7 +28,6 @@ struct xfs_mount;* file is a real time file or not, because the bmap code * does. */ -#define XFS_FSB_TO_DB (ip,fsb) xfs_fsb_to_db(ip,fsb)static inline xfs_daddr_t xfs_fsb_to_db (struct xfs_inode *ip,xfs_fsblock_t fsb) {
fs/xfs/xfs_sb.h +1 -1
@@ -505,7 +505,7 @@ static inline void xfs_sb_version_removeattr2(xfs_sb_t *sbp)#define XFS_HDR_BLOCK (mp,d) ((xfs_agblock_t)XFS_BB_TO_FSBT(mp,d))#define XFS_DADDR_TO_FSB (mp,d) XFS_AGB_TO_FSB(mp, \ - XFS_DADDR_TO_AGNO(mp,d), XFS_DADDR_TO_AGBNO(mp,d)) + xfs_daddr_to_agno(mp,d), xfs_daddr_to_agbno(mp,d))#define XFS_FSB_TO_DADDR (mp,fsbno) XFS_AGB_TO_DADDR(mp, \ XFS_FSB_TO_AGNO(mp,fsbno), XFS_FSB_TO_AGBNO(mp,fsbno))
fs/xfs/xfs_vnodeops.c +10 -10
@@ -862,7 +862,7 @@ xfs_inactive_symlink_rmt(* Find the block(s) so we can inval and unmap them. */ done =0 ; -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block); nmaps =ARRAY_SIZE (mval); if ((error = xfs_bmapi(tp, ip, 0, XFS_B_TO_FSB(mp, size), XFS_BMAPI_METADATA, &first_block, 0, mval, &nmaps,
@@ -1288,7 +1288,7 @@ xfs_inactive(/* * Free the inode. */ -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block); error =xfs_ifree (tp, ip, &free_list);if (error) {/*
@@ -1461,7 +1461,7 @@ xfs_create(xfs_ilock (dp,XFS_ILOCK_EXCL |XFS_ILOCK_PARENT ); unlock_dp_on_error =B_TRUE ; -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block);ASSERT (ip ==NULL );
@@ -1879,7 +1879,7 @@ xfs_remove( } } -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block); error =xfs_dir_removename (tp, dp, name, ip->i_ino, &first_block, &free_list, resblks);if (error) {
@@ -2059,7 +2059,7 @@ xfs_link(if (error) goto error_return; -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block); error =xfs_dir_createname (tp, tdp, target_name, sip->i_ino, &first_block, &free_list, resblks);
@@ -2231,7 +2231,7 @@ xfs_mkdir(xfs_trans_ijoin (tp, dp,XFS_ILOCK_EXCL ); unlock_dp_on_error =B_FALSE ; -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block); error = xfs_dir_createname(tp, dp, dir_name, cdp->i_ino, &first_block, &free_list, resblks ?
@@ -2438,7 +2438,7 @@ xfs_symlink(* Initialize the bmap freelist prior to calling either * bmapi or the directory create code. */ -XFS_BMAP_INIT (&free_list, &first_block); +xfs_bmap_init (&free_list, &first_block);/* * Allocate an inode for the symlink.
@@ -2860,7 +2860,7 @@ retry:/* * Issue the xfs_bmapi() call to allocate the blocks */ -XFS_BMAP_INIT (&free_list, &firstfsb); +xfs_bmap_init (&free_list, &firstfsb); error = xfs_bmapi(tp, ip, startoffset_fsb, allocatesize_fsb, bmapi_flag, &firstfsb, 0, imapp, &nimaps,
@@ -2980,7 +2980,7 @@ xfs_zero_remaining_bytes(XFS_BUF_UNDONE (bp);XFS_BUF_UNWRITE (bp);XFS_BUF_READ (bp); -XFS_BUF_SET_ADDR (bp,XFS_FSB_TO_DB (ip, imap.br_startblock)); +XFS_BUF_SET_ADDR (bp,xfs_fsb_to_db (ip, imap.br_startblock));xfsbdstrat (mp, bp); error =xfs_iowait (bp);if (error) {
@@ -3186,7 +3186,7 @@ xfs_free_file_space(/* * issue the bunmapi() call to free the blocks */ -XFS_BMAP_INIT (&free_list, &firstfsb); +xfs_bmap_init (&free_list, &firstfsb); error =xfs_bunmapi (tp, ip, startoffset_fsb, endoffset_fsb - startoffset_fsb,0 ,2 , &firstfsb, &free_list,NULL , &done);
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs