From 2f8883deadd186db69430bd08863f9e56a80e2a8 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Mon, 25 Feb 2002 22:24:34 +0000 Subject: [PATCH] Merge of xfs-cmds-2.4.18:slinx:111238a by nathans. add a note about the BLKSIZE64 change to come. --- doc/CHANGES | 4 ++- include/xfs_attr_leaf.h | 2 +- include/xfs_attr_sf.h | 1 + include/xfs_cred.h | 4 --- libxfs/xfs.h | 8 +++--- libxfs/xfs_da_btree.c | 15 +++++------ libxfs/xfs_inode.c | 57 +++++++++++++++++------------------------ 7 files changed, 39 insertions(+), 52 deletions(-) diff --git a/doc/CHANGES b/doc/CHANGES index 2e695fd67..200f4795a 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -5,7 +5,9 @@ xfsprogs-2.0.0 (26 February 2002) the reworked extended attributes handle ioctl interface - xfs_repair in no-modify mode opens the filesystem device read-only now (fix from Chris Pascoe) - - sync up with recent changes to kernel headers + - sync up with recent (minor) changes to shared kernel code + - switch to using the BLKGETSIZE64 ioctl in libxfs, instead + of the (previously busted) BLKGETSIZE ioctl xfsprogs-1.3.19 (15 February 2002) - fix xfs_repair option parsing for external logs diff --git a/include/xfs_attr_leaf.h b/include/xfs_attr_leaf.h index 41d63b526..adf63bb86 100644 --- a/include/xfs_attr_leaf.h +++ b/include/xfs_attr_leaf.h @@ -299,7 +299,7 @@ int xfs_attr_leaf_newentsize(struct xfs_da_args *args, int blocksize, int *local); int xfs_attr_leaf_entsize(struct xfs_attr_leafblock *leaf, int index); int xfs_attr_put_listent(struct xfs_attr_list_context *context, - char *name, int namelen, int valuelen); + int ns, char *name, int namelen, int valuelen); int xfs_attr_rolltrans(struct xfs_trans **transp, struct xfs_inode *dp); #endif /* __XFS_ATTR_LEAF_H__ */ diff --git a/include/xfs_attr_sf.h b/include/xfs_attr_sf.h index c5106f87c..9ea57f5c0 100644 --- a/include/xfs_attr_sf.h +++ b/include/xfs_attr_sf.h @@ -66,6 +66,7 @@ typedef struct xfs_attr_sf_sort { __uint8_t entno; /* entry number in original list */ __uint8_t namelen; /* length of name value (no null) */ __uint8_t valuelen; /* length of value */ + __uint8_t flags; /* flags bits (see xfs_attr_leaf.h) */ xfs_dahash_t hash; /* this entry's hash value */ char *name; /* name value, pointer into buffer */ } xfs_attr_sf_sort_t; diff --git a/include/xfs_cred.h b/include/xfs_cred.h index 1ed66ca4f..d3e7a8597 100644 --- a/include/xfs_cred.h +++ b/include/xfs_cred.h @@ -111,11 +111,7 @@ typedef struct xfs_mac_label { #define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1) /* On-disk XFS extended attribute names (mandatory access control) */ -#define SGI_BI_FILE "SGI_BI_FILE" -#define SGI_BLS_FILE "SGI_BLS_FILE" #define SGI_MAC_FILE "SGI_MAC_FILE" -#define SGI_BI_FILE_SIZE (sizeof(SGI_BI_FILE)-1) -#define SGI_BLS_FILE_SIZE (sizeof(SGI_BLS_FILE)-1) #define SGI_MAC_FILE_SIZE (sizeof(SGI_MAC_FILE)-1) /* On-disk XFS extended attribute names (capabilities) */ diff --git a/libxfs/xfs.h b/libxfs/xfs.h index 7bd9a50cb..94cb4174b 100644 --- a/libxfs/xfs.h +++ b/libxfs/xfs.h @@ -373,9 +373,9 @@ int xfs_iextents_copy (xfs_inode_t *, xfs_bmbt_rec_32_t *, int); int xfs_iflush_int (xfs_inode_t *, xfs_buf_t *); int xfs_iflush_fork (xfs_inode_t *, xfs_dinode_t *, xfs_inode_log_item_t *, int, xfs_buf_t *); -int xfs_iformat_local (xfs_inode_t *, xfs_dinode_t *, int, int, int); -int xfs_iformat_extents (xfs_inode_t *, xfs_dinode_t *, int, int); -int xfs_iformat_btree (xfs_inode_t *, xfs_dinode_t *, int, int); +int xfs_iformat_local (xfs_inode_t *, xfs_dinode_t *, int, int); +int xfs_iformat_extents (xfs_inode_t *, xfs_dinode_t *, int); +int xfs_iformat_btree (xfs_inode_t *, xfs_dinode_t *, int); void xfs_iroot_realloc (xfs_inode_t *, int, int); void xfs_idata_realloc (xfs_inode_t *, int, int); void xfs_iext_realloc (xfs_inode_t *, int, int); @@ -455,7 +455,7 @@ int xfs_alloc_split (xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_alloc_key_t *, xfs_btree_cur_t **, int *); /* xfs_da_btree.c */ -xfs_dabuf_t *xfs_da_buf_make (int, xfs_buf_t **, inst_t *, int); +xfs_dabuf_t *xfs_da_buf_make (int, xfs_buf_t **, inst_t *); int xfs_da_root_join (xfs_da_state_t *, xfs_da_state_blk_t *); int xfs_da_root_split (xfs_da_state_t *, xfs_da_state_blk_t *, xfs_da_state_blk_t *); diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c index e38bf0fe8..d19265b93 100644 --- a/libxfs/xfs_da_btree.c +++ b/libxfs/xfs_da_btree.c @@ -2013,7 +2013,6 @@ xfs_da_do_buf( int nbplist=0; int nfsb; int nmap; - int mem_flags = trans ? KM_SLEEP : KM_SLEEP_IO; xfs_dabuf_t *rbp; mp = dp->i_mount; @@ -2051,7 +2050,7 @@ xfs_da_do_buf( xfs_fsblock_t firstblock; firstblock = NULLFSBLOCK; - mapp = kmem_alloc(sizeof(*mapp) * nfsb, mem_flags); + mapp = kmem_alloc(sizeof(*mapp) * nfsb, KM_SLEEP); nmap = nfsb; if ((error = xfs_bmapi(trans, dp, (xfs_fileoff_t)bno, nfsb, @@ -2072,7 +2071,7 @@ xfs_da_do_buf( goto exit0; } if (caller != 3 && nmap > 1) { - bplist = kmem_alloc(sizeof(*bplist) * nmap, mem_flags); + bplist = kmem_alloc(sizeof(*bplist) * nmap, KM_SLEEP); nbplist = 0; } else bplist = NULL; @@ -2132,9 +2131,9 @@ xfs_da_do_buf( * Build a dabuf structure. */ if (bplist) { - rbp = xfs_da_buf_make(nbplist, bplist, ra, mem_flags); + rbp = xfs_da_buf_make(nbplist, bplist, ra); } else if (bp) - rbp = xfs_da_buf_make(1, &bp, ra, mem_flags); + rbp = xfs_da_buf_make(1, &bp, ra); else rbp = NULL; /* @@ -2297,7 +2296,7 @@ lock_t xfs_dabuf_global_lock; */ /* ARGSUSED */ STATIC xfs_dabuf_t * -xfs_da_buf_make(int nbuf, xfs_buf_t **bps, inst_t *ra, int mem_flags) +xfs_da_buf_make(int nbuf, xfs_buf_t **bps, inst_t *ra) { xfs_buf_t *bp; xfs_dabuf_t *dabuf; @@ -2305,9 +2304,9 @@ xfs_da_buf_make(int nbuf, xfs_buf_t **bps, inst_t *ra, int mem_flags) int off; if (nbuf == 1) - dabuf = kmem_zone_alloc(xfs_dabuf_zone, mem_flags); + dabuf = kmem_zone_alloc(xfs_dabuf_zone, KM_SLEEP); else - dabuf = kmem_alloc(XFS_DA_BUF_SIZE(nbuf), mem_flags); + dabuf = kmem_alloc(XFS_DA_BUF_SIZE(nbuf), KM_SLEEP); dabuf->dirty = 0; #ifdef XFS_DABUF_DEBUG dabuf->ra = ra; diff --git a/libxfs/xfs_inode.c b/libxfs/xfs_inode.c index 13d24001e..d0675dba6 100644 --- a/libxfs/xfs_inode.c +++ b/libxfs/xfs_inode.c @@ -221,8 +221,7 @@ xfs_itobp( STATIC int xfs_iformat( xfs_inode_t *ip, - xfs_dinode_t *dip, - int alloc_mode) + xfs_dinode_t *dip) { xfs_attr_shortform_t *atp; int size; @@ -296,16 +295,13 @@ xfs_iformat( } size = (int)di_size; - error = xfs_iformat_local(ip, dip, XFS_DATA_FORK, - size, alloc_mode); + error = xfs_iformat_local(ip, dip, XFS_DATA_FORK, size); break; case XFS_DINODE_FMT_EXTENTS: - error = xfs_iformat_extents(ip, dip, XFS_DATA_FORK, - alloc_mode); + error = xfs_iformat_extents(ip, dip, XFS_DATA_FORK); break; case XFS_DINODE_FMT_BTREE: - error = xfs_iformat_btree(ip, dip, XFS_DATA_FORK, - alloc_mode); + error = xfs_iformat_btree(ip, dip, XFS_DATA_FORK); break; default: return XFS_ERROR(EFSCORRUPTED); @@ -321,23 +317,20 @@ xfs_iformat( if (!XFS_DFORK_Q_ARCH(dip, ARCH_CONVERT)) return 0; ASSERT(ip->i_afp == NULL); - ip->i_afp = kmem_zone_zalloc(xfs_ifork_zone, alloc_mode); + ip->i_afp = kmem_zone_zalloc(xfs_ifork_zone, KM_SLEEP); ip->i_afp->if_ext_max = XFS_IFORK_ASIZE(ip) / (uint)sizeof(xfs_bmbt_rec_t); switch (INT_GET(dip->di_core.di_aformat, ARCH_CONVERT)) { case XFS_DINODE_FMT_LOCAL: atp = (xfs_attr_shortform_t *)XFS_DFORK_APTR_ARCH(dip, ARCH_CONVERT); size = (int)INT_GET(atp->hdr.totsize, ARCH_CONVERT); - error = xfs_iformat_local(ip, dip, XFS_ATTR_FORK, size, - alloc_mode); + error = xfs_iformat_local(ip, dip, XFS_ATTR_FORK, size); break; case XFS_DINODE_FMT_EXTENTS: - error = xfs_iformat_extents(ip, dip, XFS_ATTR_FORK, - alloc_mode); + error = xfs_iformat_extents(ip, dip, XFS_ATTR_FORK); break; case XFS_DINODE_FMT_BTREE: - error = xfs_iformat_btree(ip, dip, XFS_ATTR_FORK, - alloc_mode); + error = xfs_iformat_btree(ip, dip, XFS_ATTR_FORK); break; default: error = XFS_ERROR(EFSCORRUPTED); @@ -366,8 +359,7 @@ xfs_iformat_local( xfs_inode_t *ip, xfs_dinode_t *dip, int whichfork, - int size, - int alloc_mode) + int size) { xfs_ifork_t *ifp; int real_size; @@ -394,7 +386,7 @@ xfs_iformat_local( ifp->if_u1.if_data = ifp->if_u2.if_inline_data; else { real_size = roundup(size, 4); - ifp->if_u1.if_data = kmem_alloc(real_size, alloc_mode); + ifp->if_u1.if_data = kmem_alloc(real_size, KM_SLEEP); } ifp->if_bytes = size; ifp->if_real_bytes = real_size; @@ -418,8 +410,7 @@ STATIC int xfs_iformat_extents( xfs_inode_t *ip, xfs_dinode_t *dip, - int whichfork, - int alloc_mode) + int whichfork) { xfs_ifork_t *ifp; int nex; @@ -449,7 +440,7 @@ xfs_iformat_extents( else if (nex <= XFS_INLINE_EXTS) ifp->if_u1.if_extents = ifp->if_u2.if_inline_ext; else { - ifp->if_u1.if_extents = kmem_alloc(size, alloc_mode); + ifp->if_u1.if_extents = kmem_alloc(size, KM_SLEEP); ASSERT(ifp->if_u1.if_extents != NULL); real_size = size; } @@ -485,8 +476,7 @@ STATIC int xfs_iformat_btree( xfs_inode_t *ip, xfs_dinode_t *dip, - int whichfork, - int alloc_mode) + int whichfork) { xfs_bmdr_block_t *dfp; xfs_ifork_t *ifp; @@ -518,7 +508,7 @@ xfs_iformat_btree( } ifp->if_broot_bytes = size; - ifp->if_broot = kmem_alloc(size, alloc_mode); + ifp->if_broot = kmem_alloc(size, KM_SLEEP); ASSERT(ifp->if_broot != NULL); /* * Copy and convert from the on-disk structure @@ -624,11 +614,10 @@ xfs_iread( xfs_dinode_t *dip; xfs_inode_t *ip; int error; - int alloc_mode = tp ? KM_SLEEP : KM_SLEEP_IO; ASSERT(xfs_inode_zone != NULL); - ip = kmem_zone_zalloc(xfs_inode_zone, alloc_mode); + ip = kmem_zone_zalloc(xfs_inode_zone, KM_SLEEP); ip->i_ino = ino; ip->i_dev = mp->m_dev; ip->i_mount = mp; @@ -652,22 +641,22 @@ xfs_iread( * Do this before xfs_iformat in case it adds entries. */ #ifdef XFS_BMAP_TRACE - ip->i_xtrace = ktrace_alloc(XFS_BMAP_KTRACE_SIZE, alloc_mode); + ip->i_xtrace = ktrace_alloc(XFS_BMAP_KTRACE_SIZE, KM_SLEEP); #endif #ifdef XFS_BMBT_TRACE - ip->i_btrace = ktrace_alloc(XFS_BMBT_KTRACE_SIZE, alloc_mode); + ip->i_btrace = ktrace_alloc(XFS_BMBT_KTRACE_SIZE, KM_SLEEP); #endif #ifdef XFS_RW_TRACE - ip->i_rwtrace = ktrace_alloc(XFS_RW_KTRACE_SIZE, alloc_mode); + ip->i_rwtrace = ktrace_alloc(XFS_RW_KTRACE_SIZE, KM_SLEEP); #endif #ifdef XFS_STRAT_TRACE - ip->i_strat_trace = ktrace_alloc(XFS_STRAT_KTRACE_SIZE, alloc_mode); + ip->i_strat_trace = ktrace_alloc(XFS_STRAT_KTRACE_SIZE, KM_SLEEP); #endif #ifdef XFS_ILOCK_TRACE - ip->i_lock_trace = ktrace_alloc(XFS_ILOCK_KTRACE_SIZE, alloc_mode); + ip->i_lock_trace = ktrace_alloc(XFS_ILOCK_KTRACE_SIZE, KM_SLEEP); #endif #ifdef XFS_DIR2_TRACE - ip->i_dir_trace = ktrace_alloc(XFS_DIR2_KTRACE_SIZE, alloc_mode); + ip->i_dir_trace = ktrace_alloc(XFS_DIR2_KTRACE_SIZE, KM_SLEEP); #endif /* @@ -697,7 +686,7 @@ xfs_iread( if (!INT_ISZERO(dip->di_core.di_mode, ARCH_CONVERT)) { xfs_xlate_dinode_core((xfs_caddr_t)&dip->di_core, &(ip->i_d), 1, ARCH_CONVERT); - error = xfs_iformat(ip, dip, alloc_mode); + error = xfs_iformat(ip, dip); if (error) { kmem_zone_free(xfs_inode_zone, ip); xfs_trans_brelse(tp, bp); @@ -793,7 +782,7 @@ xfs_iread_extents( /* * We know that the size is legal (it's checked in iformat_btree) */ - ifp->if_u1.if_extents = kmem_alloc(size, tp ? KM_SLEEP : KM_SLEEP_IO); + ifp->if_u1.if_extents = kmem_alloc(size, KM_SLEEP); ASSERT(ifp->if_u1.if_extents != NULL); ifp->if_lastex = NULLEXTNUM; ifp->if_bytes = ifp->if_real_bytes = (int)size; -- 2.47.2