kill leftover WANT_FUNCS macro indirection
PATCH 1/1 kill leftover WANT_FUNCS macro indirection
This gets rid of some pointless macro defines... I had a version that lower-cased it all too but Nathan liked this better, and he's the man! :)
-Eric
Remove unnecessary macro indirection - left over from old WANT_FUNCS days
xfs_attr_leaf.h | 24 ++++------------ xfs_bit.h | 12 ++------ xfs_bmap.h | 6 +--- xfs_bmap_btree.h | 12 ++------ xfs_dir2_block.h | 6 +--- xfs_dir2_data.h | 10 ++---- xfs_dir2_leaf.h | 44 +++++++++--------------------- xfs_dir2_node.h | 6 +--- xfs_dir2_sf.h | 36 ++++++------------------ xfs_ialloc.h | 6 +--- xfs_ialloc_btree.h | 3 -- xfs_inode_item.h | 9 ++---- xfs_mount.h | 15 +++------- xfs_rw.h | 6 +--- xfs_sb.h | 77 +++++++++++++++++------------------------------------ xfs_trans.h | 33 +++++++--------------- 16 files changed, 97 insertions(+), 208 deletions(-)
xfs_attr_leaf.h +6 -18
@@ -138,27 +138,21 @@ 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) +XFS_ATTR_LEAF_NAME_REMOTE (xfs_attr_leafblock_t *leafp,int idx) {return (xfs_attr_leaf_name_remote_t *) &((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) +XFS_ATTR_LEAF_NAME_LOCAL (xfs_attr_leafblock_t *leafp,int idx) {return (xfs_attr_leaf_name_local_t *) &((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) +static inline char *XFS_ATTR_LEAF_NAME (xfs_attr_leafblock_t *leafp,int idx) {return &((char *)leafp)[be16_to_cpu (leafp->entries[idx].nameidx)]; }
@@ -168,25 +162,19 @@ 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) +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) +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) +static inline int XFS_ATTR_LEAF_ENTSIZE_LOCAL_MAX (int bsize) {return (((bsize) >>1 ) + ((bsize) >>2 )); }
xfs_bit.h +4 -8
@@ -25,23 +25,19 @@/* * masks with n high/low bits set, 32-bit values & 64-bit values */ -#define XFS_MASK32HI (n) xfs_mask32hi(n) -static inline __uint32_t xfs_mask32hi (int 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) +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) +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) +static inline __uint64_t XFS_MASK64LO (int n) {return ((__uint64_t )1 << (n)) -1 ; }
xfs_bmap.h +2 -4
@@ -82,8 +82,7 @@ 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) +static inline int XFS_BMAPI_AFLAG (int w) {return (w ==XFS_ATTR_FORK ?XFS_BMAPI_ATTRFORK :0 ); }
@@ -94,8 +93,7 @@ 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) +static inline void XFS_BMAP_INIT (xfs_bmap_free_t *flp,xfs_fsblock_t *fbp) { ((flp)->xbf_first =NULL , (flp)->xbf_count =0 , \ (flp)->xbf_low =0 , *(fbp) =NULLFSBLOCK );
xfs_bmap_btree.h +4 -8
@@ -100,27 +100,23 @@ typedef xfs_bmbt_rec_64_t xfs_bmbt_rec_t#define DSTARTBLOCKMASK \ (((((xfs_dfsbno_t)1) << DSTARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS) -#define ISNULLSTARTBLOCK (x) isnullstartblock(x) -static inline int isnullstartblock (xfs_fsblock_t 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) +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) +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) +static inline xfs_filblks_t STARTBLOCKVAL (xfs_fsblock_t x) {return (xfs_filblks_t)((x) & ~STARTBLOCKMASK ); }
xfs_dir2_block.h +2 -4
@@ -60,9 +60,8 @@ typedef struct xfs_dir2_block {/* * Pointer to the leaf header embedded in a data block (1-block format) */ -#define XFS_DIR2_BLOCK_TAIL_P (mp,block) xfs_dir2_block_tail_p(mp,block)static inline xfs_dir2_block_tail_t * -xfs_dir2_block_tail_p (struct xfs_mount *mp,xfs_dir2_block_t *block) +XFS_DIR2_BLOCK_TAIL_P (struct xfs_mount *mp,xfs_dir2_block_t *block) {return (((xfs_dir2_block_tail_t *) ((char *)(block) + (mp)->m_dirblksize)) -1 );
@@ -71,9 +70,8 @@ xfs_dir2_block_tail_p(struct xfs_mount */* * Pointer to the leaf entries embedded in a data block (1-block format) */ -#define XFS_DIR2_BLOCK_LEAF_P (btp) xfs_dir2_block_leaf_p(btp)static inline struct xfs_dir2_leaf_entry * -xfs_dir2_block_leaf_p (xfs_dir2_block_tail_t *btp) +XFS_DIR2_BLOCK_LEAF_P (xfs_dir2_block_tail_t *btp) {return ((struct xfs_dir2_leaf_entry *)btp) -be32_to_cpu (btp->count); }
xfs_dir2_data.h +3 -7
@@ -123,8 +123,7 @@ typedef struct xfs_dir2_data {/* * Size of a data entry. */ -#define XFS_DIR2_DATA_ENTSIZE (n) xfs_dir2_data_entsize(n) -static inline int xfs_dir2_data_entsize (int n) +static inline int XFS_DIR2_DATA_ENTSIZE (int n) { return (int)roundup(offsetof(xfs_dir2_data_entry_t, name[0]) + (n) + \ (uint)sizeof(xfs_dir2_data_off_t), XFS_DIR2_DATA_ALIGN);
@@ -133,9 +132,8 @@ static inline int xfs_dir2_data_entsize(/* * Pointer to an entry's tag word. */ -#define XFS_DIR2_DATA_ENTRY_TAG_P (dep) xfs_dir2_data_entry_tag_p(dep)static inline __be16 * -xfs_dir2_data_entry_tag_p (xfs_dir2_data_entry_t *dep) +XFS_DIR2_DATA_ENTRY_TAG_P (xfs_dir2_data_entry_t *dep) {return (__be16 *)((char *)dep +XFS_DIR2_DATA_ENTSIZE (dep->namelen) -sizeof (__be16));
@@ -144,10 +142,8 @@ xfs_dir2_data_entry_tag_p(xfs_dir2_data_/* * Pointer to a freespace's tag word. */ -#define XFS_DIR2_DATA_UNUSED_TAG_P (dup) \ - xfs_dir2_data_unused_tag_p(dup)static inline __be16 * -xfs_dir2_data_unused_tag_p (xfs_dir2_data_unused_t *dup) +XFS_DIR2_DATA_UNUSED_TAG_P (xfs_dir2_data_unused_t *dup) {return (__be16 *)((char *)dup +be16_to_cpu (dup->length) -sizeof (__be16));
xfs_dir2_leaf.h +14 -30
141 lines not on this page · raw message
xfs_dir2_node.h +2 -4
@@ -60,9 +60,8 @@ typedef struct xfs_dir2_free {/* * Convert data space db to the corresponding free db. */ -#define XFS_DIR2_DB_TO_FDB (mp,db) xfs_dir2_db_to_fdb(mp, db)static inline xfs_dir2_db_t -xfs_dir2_db_to_fdb (struct xfs_mount *mp,xfs_dir2_db_t db) +XFS_DIR2_DB_TO_FDB (struct xfs_mount *mp,xfs_dir2_db_t db) {return (XFS_DIR2_FREE_FIRSTDB (mp) + (db) /XFS_DIR2_MAX_FREE_BESTS (mp)); }
@@ -70,9 +69,8 @@ xfs_dir2_db_to_fdb(struct xfs_mount *mp,/* * Convert data space db to the corresponding index in a free db. */ -#define XFS_DIR2_DB_TO_FDINDEX (mp,db) xfs_dir2_db_to_fdindex(mp, db)static inline int -xfs_dir2_db_to_fdindex (struct xfs_mount *mp,xfs_dir2_db_t db) +XFS_DIR2_DB_TO_FDINDEX (struct xfs_mount *mp,xfs_dir2_db_t db) {return ((db) %XFS_DIR2_MAX_FREE_BESTS (mp)); }
xfs_dir2_sf.h +10 -26
@@ -90,33 +90,27 @@ typedef struct xfs_dir2_sf {xfs_dir2_sf_entry_t list[1 ];/* shortform entries */ } xfs_dir2_sf_t; -#define XFS_DIR2_SF_HDR_SIZE (i8count) xfs_dir2_sf_hdr_size(i8count) -static inline int xfs_dir2_sf_hdr_size (int i8count) +static inline int XFS_DIR2_SF_HDR_SIZE (int i8count) {return ((uint )sizeof (xfs_dir2_sf_hdr_t) - \ ((i8count) ==0 ) * \ ((uint )sizeof (xfs_dir2_ino8_t) - (uint )sizeof (xfs_dir2_ino4_t))); } -#define XFS_DIR2_SF_INUMBERP (sfep) xfs_dir2_sf_inumberp(sfep) -static inline xfs_dir2_inou_t *xfs_dir2_sf_inumberp (xfs_dir2_sf_entry_t *sfep) +static inline xfs_dir2_inou_t *XFS_DIR2_SF_INUMBERP (xfs_dir2_sf_entry_t *sfep) {return (xfs_dir2_inou_t *)&(sfep)->name[(sfep)->namelen]; } -#define XFS_DIR2_SF_GET_INUMBER (sfp, from) \ - xfs_dir2_sf_get_inumber(sfp, from)static inline xfs_intino_t -xfs_dir2_sf_get_inumber (xfs_dir2_sf_t *sfp,xfs_dir2_inou_t *from) +XFS_DIR2_SF_GET_INUMBER (xfs_dir2_sf_t *sfp,xfs_dir2_inou_t *from) {return ((sfp)->hdr.i8count ==0 ? \ (xfs_intino_t )XFS_GET_DIR_INO4 ((from)->i4) : \ (xfs_intino_t )XFS_GET_DIR_INO8 ((from)->i8)); } -#define XFS_DIR2_SF_PUT_INUMBER (sfp,from,to) \ - xfs_dir2_sf_put_inumber(sfp,from,to) -static inline void xfs_dir2_sf_put_inumber (xfs_dir2_sf_t *sfp,xfs_ino_t *from, +static inline void XFS_DIR2_SF_PUT_INUMBER (xfs_dir2_sf_t *sfp,xfs_ino_t *from,xfs_dir2_inou_t *to) {if ((sfp)->hdr.i8count ==0 )
@@ -125,51 +119,41 @@ static inline void xfs_dir2_sf_put_inumbXFS_PUT_DIR_INO8 (*(from), (to)->i8); } -#define XFS_DIR2_SF_GET_OFFSET (sfep) \ - xfs_dir2_sf_get_offset(sfep)static inline xfs_dir2_data_aoff_t -xfs_dir2_sf_get_offset (xfs_dir2_sf_entry_t *sfep) +XFS_DIR2_SF_GET_OFFSET (xfs_dir2_sf_entry_t *sfep) {return INT_GET_UNALIGNED_16_BE (&(sfep)->offset.i); } -#define XFS_DIR2_SF_PUT_OFFSET (sfep,off) \ - xfs_dir2_sf_put_offset(sfep,off)static inline void -xfs_dir2_sf_put_offset (xfs_dir2_sf_entry_t *sfep,xfs_dir2_data_aoff_t off) +XFS_DIR2_SF_PUT_OFFSET (xfs_dir2_sf_entry_t *sfep,xfs_dir2_data_aoff_t off) {INT_SET_UNALIGNED_16_BE (&(sfep)->offset.i, off); } -#define XFS_DIR2_SF_ENTSIZE_BYNAME (sfp,len) \ - xfs_dir2_sf_entsize_byname(sfp,len) -static inline int xfs_dir2_sf_entsize_byname (xfs_dir2_sf_t *sfp,int len) +static inline int XFS_DIR2_SF_ENTSIZE_BYNAME (xfs_dir2_sf_t *sfp,int len) {return ((uint )sizeof (xfs_dir2_sf_entry_t) -1 + (len) - \ ((sfp)->hdr.i8count ==0 ) * \ ((uint )sizeof (xfs_dir2_ino8_t) - (uint )sizeof (xfs_dir2_ino4_t))); } -#define XFS_DIR2_SF_ENTSIZE_BYENTRY (sfp,sfep) \ - xfs_dir2_sf_entsize_byentry(sfp,sfep)static inline int -xfs_dir2_sf_entsize_byentry (xfs_dir2_sf_t *sfp,xfs_dir2_sf_entry_t *sfep) +XFS_DIR2_SF_ENTSIZE_BYENTRY (xfs_dir2_sf_t *sfp,xfs_dir2_sf_entry_t *sfep) {return ((uint )sizeof (xfs_dir2_sf_entry_t) -1 + (sfep)->namelen - \ ((sfp)->hdr.i8count ==0 ) * \ ((uint )sizeof (xfs_dir2_ino8_t) - (uint )sizeof (xfs_dir2_ino4_t))); } -#define XFS_DIR2_SF_FIRSTENTRY (sfp) xfs_dir2_sf_firstentry(sfp) -static inline xfs_dir2_sf_entry_t *xfs_dir2_sf_firstentry (xfs_dir2_sf_t *sfp) +static inline xfs_dir2_sf_entry_t *XFS_DIR2_SF_FIRSTENTRY (xfs_dir2_sf_t *sfp) {return ((xfs_dir2_sf_entry_t *) \ ((char *)(sfp) +XFS_DIR2_SF_HDR_SIZE (sfp->hdr.i8count))); } -#define XFS_DIR2_SF_NEXTENTRY (sfp,sfep) xfs_dir2_sf_nextentry(sfp,sfep)static inline xfs_dir2_sf_entry_t * -xfs_dir2_sf_nextentry (xfs_dir2_sf_t *sfp,xfs_dir2_sf_entry_t *sfep) +XFS_DIR2_SF_NEXTENTRY (xfs_dir2_sf_t *sfp,xfs_dir2_sf_entry_t *sfep) {return ((xfs_dir2_sf_entry_t *) \ ((char *)(sfep) +XFS_DIR2_SF_ENTSIZE_BYENTRY (sfp,sfep)));
xfs_ialloc.h +2 -4
@@ -43,9 +43,8 @@ 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) +XFS_MAKE_IPTR (struct xfs_mount *mp,struct xfs_buf *b,int o) {return (xfs_dinode_t *) (xfs_buf_offset (b, o << (mp)->m_sb.sb_inodelog));
@@ -54,8 +53,7 @@ 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) +static inline int XFS_IALLOC_FIND_FREE (xfs_inofree_t *fp) {return xfs_lowbit64 (*fp); }
xfs_ialloc_btree.h +1 -2
@@ -37,8 +37,7 @@ 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) +static inline xfs_inofree_t XFS_INOBT_MASKN (int i,int n) {return (((n) >=XFS_INODES_PER_CHUNK ? \ (xfs_inofree_t )0 : ((xfs_inofree_t )1 << (n))) -1 ) << (i);
xfs_inode_item.h +3 -6
@@ -148,22 +148,19 @@ typedef struct xfs_inode_log_item { } xfs_inode_log_item_t; -#define XFS_ILOG_FDATA (w) xfs_ilog_fdata(w) -static inline int xfs_ilog_fdata (int 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) +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) +static inline int XFS_ILOG_FEXT (int w) {return (w ==XFS_DATA_FORK ?XFS_ILOG_DEXT :XFS_ILOG_AEXT ); }
xfs_mount.h +5 -10
@@ -526,36 +526,31 @@ xfs_preferred_iosize(xfs_mount_t *mp)/* * Macros for getting from mount to vfs and back. */ -#define XFS_MTOVFS (mp) xfs_mtovfs(mp) -static inline struct bhv_vfs *xfs_mtovfs (xfs_mount_t *mp) +static inline struct bhv_vfs *XFS_MTOVFS (xfs_mount_t *mp) {return bhvtovfs (&mp->m_bhv); } -#define XFS_BHVTOM (bdp) xfs_bhvtom(bdp) -static inline xfs_mount_t *xfs_bhvtom (bhv_desc_t *bdp) +static inline xfs_mount_t *XFS_BHVTOM (bhv_desc_t *bdp) {return (xfs_mount_t *)BHV_PDATA (bdp); } -#define XFS_VFSTOM (vfs) xfs_vfstom(vfs) -static inline xfs_mount_t *xfs_vfstom (bhv_vfs_t *vfs) +static inline xfs_mount_t *XFS_VFSTOM (bhv_vfs_t *vfs) {return XFS_BHVTOM (bhv_lookup (VFS_BHVHEAD (vfs), &xfs_vfsops)); } -#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) +XFS_DADDR_TO_AGNO (struct xfs_mount *mp,xfs_daddr_t d) {xfs_daddr_t ld =XFS_BB_TO_FSBT (mp, d);do_div (ld, mp->m_sb.sb_agblocks);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) +XFS_DADDR_TO_AGBNO (struct xfs_mount *mp,xfs_daddr_t d) {xfs_daddr_t ld =XFS_BB_TO_FSBT (mp, d);return (xfs_agblock_t )do_div (ld, mp->m_sb.sb_agblocks);
xfs_rw.h +2 -4
@@ -54,17 +54,15 @@ 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) +XFS_FSB_TO_DB (struct xfs_inode *ip,xfs_fsblock_t fsb) {return (((ip)->i_d.di_flags &XFS_DIFLAG_REALTIME ) ? \ (xfs_daddr_t )XFS_FSB_TO_BB ((ip)->i_mount, (fsb)) : \XFS_FSB_TO_DADDR ((ip)->i_mount, (fsb))); } -#define XFS_FSB_TO_DB_IO (io,fsb) xfs_fsb_to_db_io(io,fsb)static inline xfs_daddr_t -xfs_fsb_to_db_io (struct xfs_iocore *io,xfs_fsblock_t fsb) +XFS_FSB_TO_DB_IO (struct xfs_iocore *io,xfs_fsblock_t fsb) { return (((io)->io_flags & XFS_IOCORE_RT) ? \ XFS_FSB_TO_BB((io)->io_mount, (fsb)) : \
xfs_sb.h +26 -51
219 lines not on this page · raw message
xfs_trans.h +11 -22
@@ -220,63 +220,53 @@ typedef struct xfs_log_item_chunk {* lic_unused to the right value (0 matches all free). The * lic_descs.lid_index values are set up as each desc is allocated. */ -#define XFS_LIC_INIT (cp) xfs_lic_init(cp) -static inline void xfs_lic_init (xfs_log_item_chunk_t *cp) +static inline void XFS_LIC_INIT (xfs_log_item_chunk_t *cp) { cp->lic_free =XFS_LIC_FREEMASK ; } -#define XFS_LIC_INIT_SLOT (cp,slot) xfs_lic_init_slot(cp, slot) -static inline void xfs_lic_init_slot (xfs_log_item_chunk_t *cp,int slot) +static inline void XFS_LIC_INIT_SLOT (xfs_log_item_chunk_t *cp,int slot) { cp->lic_descs[slot].lid_index = (unsigned char )(slot); } -#define XFS_LIC_VACANCY (cp) xfs_lic_vacancy(cp) -static inline int xfs_lic_vacancy (xfs_log_item_chunk_t *cp) +static inline int XFS_LIC_VACANCY (xfs_log_item_chunk_t *cp) {return cp->lic_free &XFS_LIC_FREEMASK ; } -#define XFS_LIC_ALL_FREE (cp) xfs_lic_all_free(cp) -static inline void xfs_lic_all_free (xfs_log_item_chunk_t *cp) +static inline void XFS_LIC_ALL_FREE (xfs_log_item_chunk_t *cp) { cp->lic_free =XFS_LIC_FREEMASK ; } -#define XFS_LIC_ARE_ALL_FREE (cp) xfs_lic_are_all_free(cp) -static inline int xfs_lic_are_all_free (xfs_log_item_chunk_t *cp) +static inline int XFS_LIC_ARE_ALL_FREE (xfs_log_item_chunk_t *cp) {return ((cp->lic_free &XFS_LIC_FREEMASK ) ==XFS_LIC_FREEMASK ); } -#define XFS_LIC_ISFREE (cp,slot) xfs_lic_isfree(cp,slot) -static inline int xfs_lic_isfree (xfs_log_item_chunk_t *cp,int slot) +static inline int XFS_LIC_ISFREE (xfs_log_item_chunk_t *cp,int slot) {return (cp->lic_free & (1 << slot)); } -#define XFS_LIC_CLAIM (cp,slot) xfs_lic_claim(cp,slot) -static inline void xfs_lic_claim (xfs_log_item_chunk_t *cp,int slot) +static inline void XFS_LIC_CLAIM (xfs_log_item_chunk_t *cp,int slot) { cp->lic_free &= ~(1 << slot); } -#define XFS_LIC_RELSE (cp,slot) xfs_lic_relse(cp,slot) -static inline void xfs_lic_relse (xfs_log_item_chunk_t *cp,int slot) +static inline void XFS_LIC_RELSE (xfs_log_item_chunk_t *cp,int slot) { cp->lic_free |=1 << slot; } -#define XFS_LIC_SLOT (cp,slot) xfs_lic_slot(cp,slot)static inline xfs_log_item_desc_t * -xfs_lic_slot (xfs_log_item_chunk_t *cp,int slot) +XFS_LIC_SLOT (xfs_log_item_chunk_t *cp,int slot) {return &(cp->lic_descs[slot]); } -#define XFS_LIC_DESC_TO_SLOT (dp) xfs_lic_desc_to_slot(dp) -static inline int xfs_lic_desc_to_slot (xfs_log_item_desc_t *dp) +static inline int XFS_LIC_DESC_TO_SLOT (xfs_log_item_desc_t *dp) {return (uint )dp->lid_index; }
@@ -288,9 +278,8 @@ static inline int xfs_lic_desc_to_slot(x* All of this yields the address of the chunk, which is * cast to a chunk pointer. */ -#define XFS_LIC_DESC_TO_CHUNK (dp) xfs_lic_desc_to_chunk(dp)static inline xfs_log_item_chunk_t * -xfs_lic_desc_to_chunk (xfs_log_item_desc_t *dp) +XFS_LIC_DESC_TO_CHUNK (xfs_log_item_desc_t *dp) { return (xfs_log_item_chunk_t*) \ (((xfs_caddr_t)((dp) - (dp)->lid_index)) - \
Quoted 3 lines · Eric Sandeen
This gets rid of some pointless macro defines... I had a version that lower-cased it all too but Nathan liked this better, and he's the man! :)
Shouted function names is not exactly Linux code style at least.
-Andi
Quoted 10 lines · Andi Kleen
Quoted 3 lines · Eric Sandeen
This gets rid of some pointless macro defines... I had a version that lower-cased it all too but Nathan liked this better, and he's the man! :)
Shouted function names is not exactly Linux code style at least.
-Andi
well, *shrug* I have both versions, Nathan can take his pick :)
honestly, one-liner static inlines isn't exactly linux code style either, tho the typechecking is nice.
I guess I shouldn't have said "Nathan liked this better" - I think he was being pragmatic about the scope of the change.
-Eric
Quoted 12 lines · Eric Sandeen
Quoted 10 lines · Andi Kleen
Quoted 3 lines · Eric Sandeen
This gets rid of some pointless macro defines... I had a version that lower-cased it all too but Nathan liked this better, and he's the man! :)
Shouted function names is not exactly Linux code style at least.
-Andi
Quoted 7 lines
well, *shrug* I have both versions, Nathan can take his pick :)
honestly, one-liner static inlines isn't exactly linux code style either, tho the typechecking is nice.
I guess I shouldn't have said "Nathan liked this better" - I think he was being pragmatic about the scope of the change.
Right, its more that we don't have a great track record at the moment of not introducing regressions with these cleanups (including myself), so I'm becoming more reluctant to do sweeping changes across the whole codebase. Smaller, specific, and obviously-correct things are less likely to introduce issues, so if we can achieve basically the same thing while churning the code less, I'm all for it.
cheers.
Signature · 1 line
Nathan
Quoted 19 lines · Nathan Scott
Quoted 10 lines · Eric Sandeen
Quoted 9 lines · Andi Kleen
Quoted 3 lines · Eric Sandeen
This gets rid of some pointless macro defines... I had a version that lower-cased it all too but Nathan liked this better, and he's the man! :)
Shouted function names is not exactly Linux code style at least.
-Andi
Quoted 7 lines
well, *shrug* I have both versions, Nathan can take his pick :)
honestly, one-liner static inlines isn't exactly linux code style either, tho the typechecking is nice.
I guess I shouldn't have said "Nathan liked this better" - I think he was being pragmatic about the scope of the change.
Quoted 7 lines
Right, its more that we don't have a great track record at the moment of not introducing regressions with these cleanups (including myself), so I'm becoming more reluctant to do sweeping changes across the whole codebase. Smaller, specific, and obviously-correct things are less likely to introduce issues, so if we can achieve basically the same thing while churning the code less, I'm all for it.
Sam on his previous project had to do significant cleanup/macro changes and wrote some tools to help him do post-preprocessor comparisons to really look at what had changed. I'm not sure how generic these tools are, but worth considering.
David
Quoted 6 lines
Sam on his previous project had to do significant cleanup/macro changes and wrote some tools to help him do post-preprocessor comparisons to really look at what had changed. I'm not sure how generic these tools are, but worth considering.
In this particular case you can just compare .o or .s files. They should be identical.
-Andi
Am Montag 31 Juli 2006 00:54 schrieb Nathan Scott:
Quoted 6 lines
Right, its more that we don't have a great track record at the moment of not introducing regressions with these cleanups (including myself), so I'm becoming more reluctant to do sweeping changes across the whole codebase. Smaller, specific, and obviously-correct things are less likely to introduce issues, so if we can achieve basically the same thing while churning the code less, I'm all for it.
Hello Nathan,
I fully agree with that - especially as XFS is a file system and regressions can easily have desastrous results.
Regards,
Signature · 2 lines
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7
Quoted 3 lines · Eric Sandeen
This gets rid of some pointless macro defines... I had a version that lower-cased it all too but Nathan liked this better, and he's the man! :)
-Eric
Hm, what was the verdict on this one?
-Eric
Eric,
We already have a large number of changes queued up for 2.6.19, I'd prefer that we don't add any more right now unless they are bug fixes.
I've raised a pv with the patch so that it doesn't get dropped.
Thanks,
David
Quoted 10 lines · [email protected] wrote:
Quoted 4 lines · Eric Sandeen
This gets rid of some pointless macro defines... I had a version that lower-cased it all too but Nathan liked this better, and he's the man! :)
-Eric
Hm, what was the verdict on this one?
-Eric
Signature · 3 lines
David Chatterton XFS Engineering Manager SGI Australia
Quoted 6 lines · David Chatterton
Eric,
We already have a large number of changes queued up for 2.6.19, I'd prefer that we don't add any more right now unless they are bug fixes.
I've raised a pv with the patch so that it doesn't get dropped.
No problem, and I'm not hung up about the change, just wondered if I should keep it in my patch stack or if it had been dismissed as undesirable.
Thanks,
-Eric
Quoted 16 lines
Thanks,
David
Quoted 9 lines · [email protected] wrote:
Quoted 4 lines · Eric Sandeen
This gets rid of some pointless macro defines... I had a version that lower-cased it all too but Nathan liked this better, and he's the man! :)
-Eric
Hm, what was the verdict on this one?
-Eric