xfsprogs: resync xfs with the kernel code
PATCH 1/1 xfsprogs: resync xfs with the kernel code
Also use the kernel xfs_iread now instead of a duplicated version.
xfsprogs/include/xfs_ag.h +10 -0
@@ -91,6 +91,8 @@#define XFS_AGF_BLOCK (mp) XFS_HDR_BLOCK(mp, XFS_AGF_DADDR(mp))#define XFS_BUF_TO_AGF (bp) ((xfs_agf_t *)XFS_BUF_PTR(bp)) +extern int xfs_read_agf (struct xfs_mount *mp,struct xfs_trans *tp, +xfs_agnumber_t agno,int flags,struct xfs_buf **bpp);/* * Size of the unlinked inode hash table in the agi.
@@ -142,6 +144,9 @@#define XFS_AGI_BLOCK (mp) XFS_HDR_BLOCK(mp, XFS_AGI_DADDR(mp))#define XFS_BUF_TO_AGI (bp) ((xfs_agi_t *)XFS_BUF_PTR(bp)) +extern int xfs_read_agi (struct xfs_mount *mp,struct xfs_trans *tp, +xfs_agnumber_t agno,struct xfs_buf **bpp); +/* * The third a.g. block contains the a.g. freelist, an array * of block pointers to blocks owned by the allocation btree code.
@@ -204,6 +209,11 @@#endif } xfs_perag_t; +/* +* tags for inode radix tree +*/ +#define XFS_ICI_RECLAIM_TAG 0/* inode is to be reclaimed */ +#define XFS_AG_MAXLEVELS (mp) ((mp)->m_ag_maxlevels)#define XFS_MIN_FREELIST_RAW (bl,cl,mp) \ (MIN(bl + 1, XFS_AG_MAXLEVELS(mp)) + MIN(cl + 1, XFS_AG_MAXLEVELS(mp)))
xfsprogs/include/xfs_bmap.h +7 -4
@@ -356,15 +356,18 @@ xfs_bmap_free_t *flist,/* i/o: list extents to free */ int *committed); /* xact committed or not */ +/* bmap to userspace formatter - copy to user & advance pointer */ +typedef int (*xfs_bmap_format_t )(void **,struct getbmapx *,int *); +/* -* Fcntl interface to xfs_bmapi. +* Get inode's extents as described in bmv, and format for output. */ int /* error code */ xfs_getbmap (xfs_inode_t *ip, -struct getbmap *bmv,/* user bmap structure */ -void __user *ap,/* pointer to user's array */ -int iflags);/* interface flags */ +struct getbmapx *bmv,/* user bmap structure */ +xfs_bmap_format_t formatter,/* format to user */ +void *arg);/* formatter arg */ /* * Check if the endoff is outside the last extent. If so the caller will grow
xfsprogs/include/xfs_dfrag.h +1 -1
@@ -46,7 +46,7 @@/* * Syscall interface for xfs_swapext */ -int xfs_swapext (struct xfs_swapext __user *sx); +int xfs_swapext (struct xfs_swapext *sx);int xfs_swap_extents (struct xfs_inode *ip,struct xfs_inode *tip,struct xfs_swapext *sxp);
xfsprogs/include/xfs_dinode.h +52 -93
198 lines not on this page · raw message
xfsprogs/include/xfs_dir2_sf.h +0 -7
@@ -34,13 +34,6 @@struct xfs_trans ;/* -* Maximum size of a shortform directory. -*/ -#define XFS_DIR2_SF_MAX_SIZE \ - (XFS_DINODE_MAX_SIZE - (uint)sizeof(xfs_dinode_core_t) - \ - (uint)sizeof(xfs_agino_t)) - -/* * Inode number stored as 8 8-bit values. */ typedef struct {__uint8_t i[8 ]; }xfs_dir2_ino8_t ;
xfsprogs/include/xfs_fs.h +5 -17
@@ -113,22 +113,14 @@#define BMV_IF_ATTRFORK 0x1/* return attr fork rather than data */ #define BMV_IF_NO_DMAPI_READ 0x2/* Do not generate DMAPI read event */ #define BMV_IF_PREALLOC 0x4/* rtn status BMV_OF_PREALLOC if req */ -#define BMV_IF_VALID (BMV_IF_ATTRFORK|BMV_IF_NO_DMAPI_READ|BMV_IF_PREALLOC) -#ifdef __KERNEL__ -#define BMV_IF_EXTENDED 0x40000000/* getpmapx if set */ -#endif +#define BMV_IF_DELALLOC 0x8/* rtn status BMV_OF_DELALLOC if req */ +#define BMV_IF_VALID \ + (BMV_IF_ATTRFORK|BMV_IF_NO_DMAPI_READ|BMV_IF_PREALLOC|BMV_IF_DELALLOC)/* bmv_oflags values - returned for for each non-header segment */ #define BMV_OF_PREALLOC 0x1/* segment = unwritten pre-allocation */ - -/* Convert getbmap <-> getbmapx - move fields from p1 to p2. */ -#define GETBMAP_CONVERT (p1,p2) { \ - p2.bmv_offset = p1.bmv_offset; \ - p2.bmv_block = p1.bmv_block; \ - p2.bmv_length = p1.bmv_length; \ - p2.bmv_count = p1.bmv_count; \ - p2.bmv_entries = p1.bmv_entries; } - +#define BMV_OF_DELALLOC 0x2/* segment = delayed allocation */ +#define BMV_OF_LAST 0x4/* segment is the last in the file */ /* * Structure for XFS_IOC_FSSETDM.
@@ -426,10 +418,6 @@#define XFS_IOC_GETXFLAGS FS_IOC_GETFLAGS#define XFS_IOC_SETXFLAGS FS_IOC_SETFLAGS#define XFS_IOC_GETVERSION FS_IOC_GETVERSION -/* 32-bit compat counterparts */ -#define XFS_IOC32_GETXFLAGS FS_IOC32_GETFLAGS -#define XFS_IOC32_SETXFLAGS FS_IOC32_SETFLAGS -#define XFS_IOC32_GETVERSION FS_IOC32_GETVERSION/* * ioctl commands that replace IRIX fcntl()'s
xfsprogs/include/xfs_ialloc.h +4 -6
@@ -20,6 +20,7 @@struct xfs_buf ;struct xfs_dinode ; +struct xfs_imap ;struct xfs_mount ;struct xfs_trans ;
@@ -104,17 +105,14 @@ xfs_ino_t *first_ino); /* first inode in deleted cluster *//* -* Return the location of the inode in bno/len/off, -* for mapping it into a buffer. +* Return the location of the inode in imap, for mapping it into a buffer. */ int -xfs_dilocate ( +xfs_imap (struct xfs_mount *mp,/* file system mount structure */ struct xfs_trans *tp,/* transaction pointer */ xfs_ino_t ino,/* inode to locate */ -xfs_fsblock_t *bno,/* output: block containing inode */ -int *len,/* output: num blocks in cluster*/ -int *off,/* output: index in block of inode */ +struct xfs_imap *imap,/* location map structure */ uint flags);/* flags for inode btree lookup */ /*
xfsprogs/include/xfs_inode.h +100 -54
260 lines not on this page · raw message
xfsprogs/include/xfs_log.h +4 -0
@@ -134,6 +134,7 @@#ifdef __KERNEL__/* Log manager interfaces */ struct xfs_mount ; +struct xlog_ticket ; xfs_lsn_t xfs_log_done(struct xfs_mount *mp, xfs_log_ticket_t ticket, void **iclog,
@@ -177,6 +178,9 @@void xlog_iodone (struct xfs_buf *); +struct xlog_ticket *xfs_log_ticket_get (struct xlog_ticket *ticket); +void xfs_log_ticket_put (struct xlog_ticket *ticket); +#endif
xfsprogs/include/xfs_log_priv.h +15 -33
81 lines not on this page · raw message
xfsprogs/include/xfs_mount.h +18 -26
128 lines not on this page · raw message
xfsprogs/include/xfs_quota.h +3 -5
@@ -84,11 +84,9 @@#define XFS_DQ_USER 0x0001/* a user quota */ #define XFS_DQ_PROJ 0x0002/* project quota */ #define XFS_DQ_GROUP 0x0004/* a group quota */ -#define XFS_DQ_FLOCKED 0x0008/* flush lock taken */ -#define XFS_DQ_DIRTY 0x0010/* dquot is dirty */ -#define XFS_DQ_WANT 0x0020/* for lookup/reclaim race */ -#define XFS_DQ_INACTIVE 0x0040/* dq off mplist & hashlist */ -#define XFS_DQ_MARKER 0x0080/* sentinel */ +#define XFS_DQ_DIRTY 0x0008/* dquot is dirty */ +#define XFS_DQ_WANT 0x0010/* for lookup/reclaim race */ +#define XFS_DQ_INACTIVE 0x0020/* dq off mplist & hashlist */ #define XFS_DQ_ALLTYPES (XFS_DQ_USER|XFS_DQ_PROJ|XFS_DQ_GROUP)
xfsprogs/include/xfs_sb.h +86 -80
261 lines not on this page · raw message
xfsprogs/include/xfs_trans.h +1 -4
@@ -768,6 +768,7 @@xfs_lsn_t li_lsn;/* last on-disk lsn */ struct xfs_log_item_desc *li_desc;/* ptr to current desc*/ struct xfs_mount *li_mountp;/* ptr to fs mount */ +struct xfs_ail *li_ailp;/* ptr to AIL */ uint li_type;/* item type */ uint li_flags;/* misc flags */ struct xfs_log_item *li_bio_list;/* buffer item list */
@@ -970,10 +971,6 @@void xfs_trans_cancel (xfs_trans_t *,int );int xfs_trans_ail_init (struct xfs_mount *);void xfs_trans_ail_destroy (struct xfs_mount *); -void xfs_trans_push_ail (struct xfs_mount *,xfs_lsn_t ); -xfs_lsn_t xfs_trans_tail_ail (struct xfs_mount *); -void xfs_trans_unlocked_item (struct xfs_mount *, -xfs_log_item_t *);xfs_log_busy_slot_t *xfs_trans_add_busy (xfs_trans_t *tp,xfs_agnumber_t ag,xfs_extlen_t idx);
xfsprogs/db/bmap.c +2 -2
@@ -171,9 +171,9 @@push_cur ();set_cur_inode (iocur_top->ino); dip = iocur_top->data; -if (be32_to_cpu (dip->di_core.di_nextents)) +if (dip->di_nextents) dfork =1 ; -if (be16_to_cpu (dip->di_core.di_anextents)) +if (dip->di_anextents) afork =1 ;pop_cur (); }
xfsprogs/db/check.c +24 -24
131 lines not on this page · raw message
xfsprogs/db/dir2sf.c +6 -6
@@ -73,10 +73,10 @@ void *obj, int startoff) { -xfs_dir2_sf_t *sf; +xfs_dinode_t *dip = obj; +xfs_dir2_sf_t *sf = (xfs_dir2_sf_t *)XFS_DFORK_DPTR (dip);ASSERT (bitoffs (startoff) ==0 ); - sf = &((xfs_dinode_t *)obj)->di_u.di_dir2sf;return sf->hdr.i8count ==0 ; }
@@ -86,10 +86,10 @@ void *obj, int startoff) { -xfs_dir2_sf_t *sf; +xfs_dinode_t *dip = obj; +xfs_dir2_sf_t *sf = (xfs_dir2_sf_t *)XFS_DFORK_DPTR (dip);ASSERT (bitoffs (startoff) ==0 ); - sf = &((xfs_dinode_t *)obj)->di_u.di_dir2sf;return sf->hdr.i8count !=0 ; }
@@ -100,11 +100,11 @@ int startoff, int idx) { -xfs_dir2_sf_t *sf; +xfs_dinode_t *dip = obj; +xfs_dir2_sf_t *sf = (xfs_dir2_sf_t *)XFS_DFORK_DPTR (dip);ASSERT (bitoffs (startoff) ==0 );ASSERT (idx ==0 ); - sf = &((xfs_dinode_t *)obj)->di_u.di_dir2sf;return bitize (sf->hdr.i8count ? (uint )sizeof (xfs_dir2_ino8_t) : (uint )sizeof (xfs_dir2_ino4_t));
xfsprogs/db/field.c +0 -2
@@ -150,8 +150,6 @@ FTARG_DONULL, fa_dfsbno, NULL }, { FLDT_DINODE_A, "dinode_a", NULL, (char *)inode_a_flds, inode_a_size, FTARG_SIZE|FTARG_OKEMPTY, NULL, inode_a_flds }, - { FLDT_DINODE_CORE, "dinode_core", NULL, (char *)inode_core_flds, - SI(bitsz(xfs_dinode_core_t)), 0, NULL, inode_core_flds }, { FLDT_DINODE_FMT, "dinode_fmt", fp_dinode_fmt, NULL, SI(bitsz(__int8_t)), 0, NULL, NULL }, { FLDT_DINODE_U, "dinode_u", NULL, (char *)inode_u_flds, inode_u_size,
xfsprogs/db/field.h +0 -1
@@ -72,7 +72,6 @@FLDT_DFILOFFD ,FLDT_DFSBNO ,FLDT_DINODE_A , -FLDT_DINODE_CORE ,FLDT_DINODE_FMT ,FLDT_DINODE_U , FLDT_DIR,
xfsprogs/db/frag.c +2 -4
@@ -308,20 +308,18 @@ xfs_dinode_t *dip) {__uint64_t actual; -xfs_dinode_core_t *dic;__uint64_t ideal;xfs_ino_t ino;int skipa;int skipd; - dic = &dip->di_core; ino =XFS_AGINO_TO_INO (mp,be32_to_cpu (agf->agf_seqno), agino); -switch (be16_to_cpu (dic->di_mode) &S_IFMT ) { +switch (be16_to_cpu (dip->di_mode) &S_IFMT ) {case S_IFDIR : skipd = !dflag;break ;case S_IFREG : -if (!rflag && (be16_to_cpu (dic->di_flags) &XFS_DIFLAG_REALTIME )) +if (!rflag && (be16_to_cpu (dip->di_flags) &XFS_DIFLAG_REALTIME )) skipd =1 ; else if (!Rflag && (ino == mp->m_sb.sb_rbmino ||
xfsprogs/db/inode.c +110 -116
445 lines not on this page · raw message
xfsprogs/db/inode.h +1 -1
@@ -17,7 +17,7 @@*/ extern const struct field inode_a_flds[]; -extern const struct field inode_core_flds[]; +extern const struct field inode_flds[];extern const struct field inode_flds[];extern const struct field inode_hfld[];extern const struct field inode_u_flds[];
xfsprogs/db/metadump.c +25 -27
89 lines not on this page · raw message
xfsprogs/libxfs/util.c +12 -134
188 lines not on this page · raw message
xfsprogs/libxfs/xfs_alloc.c +48 -21
109 lines not on this page · raw message
xfsprogs/libxfs/xfs_ialloc.c +160 -158
470 lines not on this page · raw message
xfsprogs/libxfs/xfs_inode.c +212 -125
365 lines not on this page · raw message
xfsprogs/repair/dinode.c +246 -287
533 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Part of the diff is not shown here. View the raw message.