From: Nathan Scott Date: Thu, 30 Sep 2004 14:52:19 +0000 (+0000) Subject: Keep userspace packaging in sync, portability changes; sync user/kernel source/header... X-Git-Tag: v2.7.0~65 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=062998e3ba06c707db6d0381800fe361127ae8e7;p=thirdparty%2Fxfsprogs-dev.git Keep userspace packaging in sync, portability changes; sync user/kernel source/headers; man page updates; allow e size suffix in mkfs. Merge of xfs-cmds-melb:slinx:19613a by kenmcd. --- diff --git a/VERSION b/VERSION index da221c84d..714a5aabc 100644 --- a/VERSION +++ b/VERSION @@ -3,5 +3,5 @@ # PKG_MAJOR=2 PKG_MINOR=6 -PKG_REVISION=23 +PKG_REVISION=24 PKG_BUILD=1 diff --git a/debian/changelog b/debian/changelog index e756b5087..741c7d00a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xfsprogs (2.6.24-1) unstable; urgency=low + + * New upstream release + + -- Nathan Scott Wed, 29 Sep 2004 11:28:20 +1000 + xfsprogs (2.6.23-1) unstable; urgency=low * New upstream release. diff --git a/doc/CHANGES b/doc/CHANGES index 26cbf781c..0cc43a539 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,10 +1,18 @@ +xfsprogs-2.6.24 (29 September 2004) + - Allow 'e' suffix in size arguments to mkfs. + - Update mkfs man page description of maximum allocation + group size. + - Update mkfs and xfs_db man pages to use consistent, + standard notations. + - Sync up user/kernel source in libxfs and headers. + xfsprogs-2.6.23 (17 September 2004) - Fix xfs_io pread/pwrite -b option, when used more than once we would use the largest of the previous values, instead of the (possibly smaller) value specified. - Add recursive modes to lsattr/chattr xfs_io commands. - - Make xfs_io run any given command line commands (-c) - on all files specified, not just the first. + - Make xfs_io run any given command line commands (-c) + on all files specified, not just the first. xfsprogs-2.6.22 (10 September 2004) - Update xfs_io to get a clean compile on IRIX with the diff --git a/include/builddefs.in b/include/builddefs.in index 7710215aa..ea27618da 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -113,9 +113,9 @@ PLDLIBS = -L/usr/local/lib -lintl PCFLAGS = -I/usr/local/include endif -GCFLAGS += -O1 $(OPTIMIZER) $(DEBUG) -funsigned-char -Wall -I$(TOPDIR)/include \ - -DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\" \ - -DPACKAGE=\"$(PKG_NAME)\" +GCFLAGS = -O1 $(OPTIMIZER) $(DEBUG) -funsigned-char -fno-strict-aliasing -Wall \ + -DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\" \ + -DPACKAGE=\"$(PKG_NAME)\" -I$(TOPDIR)/include # Global, Platform, Local CFLAGS CFLAGS += $(GCFLAGS) $(PCFLAGS) $(LCFLAGS) diff --git a/include/buildmacros b/include/buildmacros index 2cfaa52fe..28806272d 100644 --- a/include/buildmacros +++ b/include/buildmacros @@ -72,7 +72,7 @@ LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) LTLINK = $(LIBTOOL) --mode=link $(CC) LTEXEC = $(LIBTOOL) --mode=execute LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CCF) -D_REENTRANT -fno-strict-aliasing +LTCOMPILE = $(LIBTOOL) --mode=compile $(CCF) ifeq ($(ENABLE_SHARED),yes) LTLDFLAGS += -rpath $(PKG_LIB_DIR) diff --git a/include/libxfs.h b/include/libxfs.h index c971a9875..0262c4ce1 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -145,6 +145,7 @@ extern int libxfs_log_header (xfs_caddr_t, uuid_t *, int, int, int, struct xfs_inode; typedef struct xfs_mount { xfs_sb_t m_sb; /* copy of fs superblock */ + char *m_fsname; /* filesystem name */ int m_bsize; /* fs logical block size */ xfs_agnumber_t m_agfrotor; /* last ag where space found */ xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ @@ -206,7 +207,7 @@ typedef struct xfs_mount { extern xfs_mount_t *libxfs_mount (xfs_mount_t *, xfs_sb_t *, dev_t, dev_t, dev_t, int); extern void libxfs_mount_common (xfs_mount_t *, xfs_sb_t *); -extern void libxfs_initialize_perag (xfs_mount_t *, int); +extern xfs_agnumber_t libxfs_initialize_perag (xfs_mount_t *, xfs_agnumber_t); extern void libxfs_umount (xfs_mount_t *); extern int libxfs_rtmount_init (xfs_mount_t *); extern void libxfs_alloc_compute_maxlevels (xfs_mount_t *); diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in index 902be05bb..c216e9336 100644 --- a/include/platform_defs.h.in +++ b/include/platform_defs.h.in @@ -127,6 +127,10 @@ typedef unsigned long long __psunsigned_t; # define ASSERT(EX) ((void) 0) #endif +#ifndef __user +#define __user +#endif + #define IRIX_DEV_BITSMAJOR 14 #define IRIX_DEV_BITSMINOR 18 #define IRIX_DEV_MAXMAJ 0x1ff diff --git a/include/xfs_arch.h b/include/xfs_arch.h index 3d65fe3c6..3c7a90bfb 100644 --- a/include/xfs_arch.h +++ b/include/xfs_arch.h @@ -157,11 +157,11 @@ /* does not return a value */ #define INT_MOD_EXPR(reference,arch,code) \ - (void)(((arch) == ARCH_NOCONVERT) \ + (((arch) == ARCH_NOCONVERT) \ ? \ - ((reference) code) \ + (void)((reference) code) \ : \ - ( \ + (void)( \ (reference) = INT_GET((reference),arch) , \ ((reference) code), \ INT_SET(reference, arch, reference) \ @@ -187,10 +187,10 @@ /* does not return a value */ #define INT_COPY(dst,src,arch) \ - (void)( \ + ( \ ((sizeof(dst) == sizeof(src)) || ((arch) == ARCH_NOCONVERT)) \ ? \ - ((dst) = (src)) \ + (void)((dst) = (src)) \ : \ INT_SET(dst, arch, INT_GET(src, arch)) \ ) diff --git a/include/xfs_bmap.h b/include/xfs_bmap.h index 429e053f6..f1bc22fb2 100644 --- a/include/xfs_bmap.h +++ b/include/xfs_bmap.h @@ -177,13 +177,6 @@ void xfs_bmap_cancel( xfs_bmap_free_t *flist); /* free list to clean up */ -/* - * Routine to check if a specified inode is swap capable. - */ -int -xfs_bmap_check_swappable( - struct xfs_inode *ip); /* incore inode */ - /* * Compute and fill in the value of the maximum depth of a bmap btree * in this filesystem. Done once, during mount. @@ -335,7 +328,7 @@ int /* error code */ xfs_getbmap( bhv_desc_t *bdp, /* XFS behavior descriptor*/ struct getbmap *bmv, /* user bmap structure */ - void *ap, /* pointer to user's array */ + void __user *ap, /* pointer to user's array */ int iflags); /* interface flags */ /* diff --git a/include/xfs_bmap_btree.h b/include/xfs_bmap_btree.h index 6bc85d791..a4a666a7c 100644 --- a/include/xfs_bmap_btree.h +++ b/include/xfs_bmap_btree.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000,2002-2004 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -153,7 +153,7 @@ typedef enum { */ typedef enum { XFS_EXT_NORM, XFS_EXT_UNWRITTEN, - XFS_EXT_DMAPI_OFFLINE + XFS_EXT_DMAPI_OFFLINE, XFS_EXT_INVALID } xfs_exntst_t; /* @@ -673,7 +673,7 @@ xfs_bmbt_update( xfs_filblks_t, xfs_exntst_t); -#ifdef XFSDEBUG +#ifdef DEBUG /* * Get the data from the pointed-to record. */ diff --git a/include/xfs_dfrag.h b/include/xfs_dfrag.h index 0e1c26fba..904860594 100644 --- a/include/xfs_dfrag.h +++ b/include/xfs_dfrag.h @@ -60,7 +60,7 @@ typedef struct xfs_swapext /* * Syscall interface for xfs_swapext */ -int xfs_swapext(struct xfs_swapext *sx); +int xfs_swapext(struct xfs_swapext __user *sx); #endif /* __KERNEL__ */ diff --git a/include/xfs_dinode.h b/include/xfs_dinode.h index f43530fdc..d395f7838 100644 --- a/include/xfs_dinode.h +++ b/include/xfs_dinode.h @@ -457,7 +457,7 @@ xfs_dinode_t *xfs_buf_to_dinode(struct xfs_buf *bp); #define XFS_DIFLAG_NOATIME_BIT 6 /* do not update atime */ #define XFS_DIFLAG_NODUMP_BIT 7 /* do not dump */ #define XFS_DIFLAG_RTINHERIT_BIT 8 /* create with realtime bit set */ -#define XFS_DIFLAG_PROJINHERIT_BIT 9 /* create with parents project id */ +#define XFS_DIFLAG_PROJINHERIT_BIT 9 /* create with parents projid */ #define XFS_DIFLAG_NOSYMLINKS_BIT 10 /* disallow symlink creation */ #define XFS_DIFLAG_REALTIME (1 << XFS_DIFLAG_REALTIME_BIT) #define XFS_DIFLAG_PREALLOC (1 << XFS_DIFLAG_PREALLOC_BIT) diff --git a/include/xfs_fs.h b/include/xfs_fs.h index 4c95ee8ec..6ee8443bf 100644 --- a/include/xfs_fs.h +++ b/include/xfs_fs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995-2004 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 1995-2003 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2.1 of the GNU Lesser General Public License @@ -167,7 +167,7 @@ typedef struct xfs_flock64 { __s64 l_start; __s64 l_len; /* len == 0 means until end of file */ __s32 l_sysid; - pid_t l_pid; + __u32 l_pid; __s32 l_pad[4]; /* reserve area */ } xfs_flock64_t; @@ -316,10 +316,10 @@ typedef struct xfs_bstat { * The user-level BulkStat Request interface structure. */ typedef struct xfs_fsop_bulkreq { - __u64 *lastip; /* last inode # pointer */ + __u64 __user *lastip; /* last inode # pointer */ __s32 icount; /* count of entries in buffer */ - void *ubuffer; /* user buffer for inode desc. */ - __s32 *ocount; /* output count pointer */ + void __user *ubuffer;/* user buffer for inode desc. */ + __s32 __user *ocount; /* output count pointer */ } xfs_fsop_bulkreq_t; @@ -347,12 +347,12 @@ typedef struct xfs_error_injection { */ typedef struct xfs_fsop_handlereq { __u32 fd; /* fd for FD_TO_HANDLE */ - void *path; /* user pathname */ + void __user *path; /* user pathname */ __u32 oflags; /* open flags */ - void *ihandle; /* user supplied handle */ + void __user *ihandle;/* user supplied handle */ __u32 ihandlen; /* user supplied length */ - void *ohandle; /* user buffer for handle */ - __u32 *ohandlen; /* user buffer length */ + void __user *ohandle;/* user buffer for handle */ + __u32 __user *ohandlen;/* user buffer length */ } xfs_fsop_handlereq_t; /* @@ -363,35 +363,35 @@ typedef struct xfs_fsop_handlereq { */ typedef struct xfs_fsop_setdm_handlereq { - struct xfs_fsop_handlereq hreq; /* handle interface structure */ - struct fsdmidata *data; /* DMAPI data to set */ + struct xfs_fsop_handlereq hreq; /* handle information */ + struct fsdmidata __user *data; /* DMAPI data */ } xfs_fsop_setdm_handlereq_t; typedef struct xfs_attrlist_cursor { - __u32 opaque[4]; + __u32 opaque[4]; } xfs_attrlist_cursor_t; typedef struct xfs_fsop_attrlist_handlereq { - struct xfs_fsop_handlereq hreq; /* handle interface structure */ - struct xfs_attrlist_cursor pos; /* opaque cookie, list offset */ - __u32 flags; /* flags, use ROOT/USER names */ - __u32 buflen; /* length of buffer supplied */ - void *buffer; /* attrlist data to return */ + struct xfs_fsop_handlereq hreq; /* handle interface structure */ + struct xfs_attrlist_cursor pos; /* opaque cookie, list offset */ + __u32 flags; /* which namespace to use */ + __u32 buflen; /* length of buffer supplied */ + void __user *buffer; /* returned names */ } xfs_fsop_attrlist_handlereq_t; typedef struct xfs_attr_multiop { - __u32 am_opcode; - __s32 am_error; - void *am_attrname; - void *am_attrvalue; - __u32 am_length; - __u32 am_flags; + __u32 am_opcode; + __s32 am_error; + void __user *am_attrname; + void __user *am_attrvalue; + __u32 am_length; + __u32 am_flags; } xfs_attr_multiop_t; typedef struct xfs_fsop_attrmulti_handlereq { - struct xfs_fsop_handlereq hreq; /* handle interface structure */ - __u32 opcount; /* count of following multiop */ - struct xfs_attr_multiop *ops; /* attr_multi data to get/set */ + struct xfs_fsop_handlereq hreq; /* handle interface structure */ + __u32 opcount;/* count of following multiop */ + struct xfs_attr_multiop __user *ops; /* attr_multi data */ } xfs_fsop_attrmulti_handlereq_t; /* @@ -447,7 +447,13 @@ typedef struct xfs_handle { #define XFS_FSOP_GOING_FLAGS_LOGFLUSH 0x1 /* flush log but not data */ #define XFS_FSOP_GOING_FLAGS_NOLOGFLUSH 0x2 /* don't flush log nor data */ -#ifndef HAVE_IOCMACROS +/* + * ioctl commands that are used by Linux filesystems + */ +#define XFS_IOC_GETXFLAGS _IOR('f', 1, long) +#define XFS_IOC_SETXFLAGS _IOW('f', 2, long) +#define XFS_IOC_GETVERSION _IOR('v', 1, long) + /* * ioctl commands that replace IRIX fcntl()'s * For 'documentation' purposed more than anything else, @@ -502,7 +508,7 @@ typedef struct xfs_handle { #define XFS_IOC_FSGEOMETRY _IOR ('X', 124, struct xfs_fsop_geom) #define XFS_IOC_GOINGDOWN _IOR ('X', 125, __uint32_t) /* XFS_IOC_GETFSUUID ---------- deprecated 140 */ -#endif + #ifndef HAVE_BBMACROS /* diff --git a/include/xfs_inode.h b/include/xfs_inode.h index aa07ce3dc..f606073ad 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -459,8 +459,8 @@ xfs_inode_t *xfs_bhvtoi(struct bhv_desc *bhvp); * directory, group of new file is set to that of the parent, and * new subdirectory gets S_ISGID bit from parent. */ -#define XFS_INHERIT_GID(pip, vfsp) ((pip) != NULL && \ - (((vfsp)->vfs_flag & VFS_GRPID) || ((pip)->i_d.di_mode & S_ISGID))) +#define XFS_INHERIT_GID(pip, vfsp) \ + (((vfsp)->vfs_flag & VFS_GRPID) || ((pip)->i_d.di_mode & S_ISGID)) /* * xfs_iget.c prototypes. @@ -503,8 +503,9 @@ int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int); int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, nlink_t, xfs_dev_t, struct cred *, xfs_prid_t, int, struct xfs_buf **, boolean_t *, xfs_inode_t **); -void xfs_xlate_dinode_core(xfs_caddr_t, struct xfs_dinode_core *, int, - xfs_arch_t); +void xfs_xlate_dinode_core(xfs_caddr_t, struct xfs_dinode_core *, + int, xfs_arch_t); +uint xfs_dic2xflags(struct xfs_dinode_core *, xfs_arch_t); int xfs_ifree(struct xfs_trans *, xfs_inode_t *, struct xfs_bmap_free *); int xfs_atruncate_start(xfs_inode_t *); diff --git a/include/xfs_mount.h b/include/xfs_mount.h index ea86fbaff..c194b8ef0 100644 --- a/include/xfs_mount.h +++ b/include/xfs_mount.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -95,7 +95,8 @@ typedef int (*xfs_send_data_t)(int, struct vnode *, xfs_off_t, size_t, int, vrwlock_t *); typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint); typedef int (*xfs_send_destroy_t)(struct vnode *, dm_right_t); -typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct vnode *, +typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct vfs *, + struct vnode *, dm_right_t, struct vnode *, dm_right_t, char *, char *, mode_t, int, int); typedef void (*xfs_send_unmount_t)(struct vfs *, struct vnode *, @@ -116,7 +117,9 @@ typedef struct xfs_dmops { #define XFS_SEND_DESTROY(mp, vp,right) \ (*(mp)->m_dm_ops.xfs_send_destroy)(vp,right) #define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ - (*(mp)->m_dm_ops.xfs_send_namesp)(ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) + (*(mp)->m_dm_ops.xfs_send_namesp)(ev,NULL,b1,r1,b2,r2,n1,n2,mode,rval,fl) +#define XFS_SEND_PREUNMOUNT(mp, vfs,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ + (*(mp)->m_dm_ops.xfs_send_namesp)(DM_EVENT_PREUNMOUNT,vfs,b1,r1,b2,r2,n1,n2,mode,rval,fl) #define XFS_SEND_UNMOUNT(mp, vfsp,vp,right,mode,rval,fl) \ (*(mp)->m_dm_ops.xfs_send_unmount)(vfsp,vp,right,mode,rval,fl) @@ -379,10 +382,6 @@ typedef struct xfs_mount { struct xfs_dmops m_dm_ops; /* vector of DMI ops */ struct xfs_qmops m_qm_ops; /* vector of XQM ops */ struct xfs_ioops m_io_ops; /* vector of I/O ops */ - lock_t m_freeze_lock; /* Lock for m_frozen */ - uint m_frozen; /* FS frozen for shutdown or - * snapshot */ - sv_t m_wait_unfreeze;/* waiting to unfreeze */ atomic_t m_active_trans; /* number trans frozen */ } xfs_mount_t; @@ -417,16 +416,14 @@ typedef struct xfs_mount { #define XFS_MOUNT_NOUUID 0x00010000 /* ignore uuid during mount */ #define XFS_MOUNT_NOLOGFLUSH 0x00020000 #define XFS_MOUNT_IDELETE 0x00040000 /* delete empty inode clusters*/ +#define XFS_MOUNT_SWALLOC 0x00080000 /* turn on stripe width + * allocation */ /* * Default minimum read and write sizes. */ #define XFS_READIO_LOG_LARGE 16 #define XFS_WRITEIO_LOG_LARGE 16 -/* - * Default allocation size - */ -#define XFS_WRITE_IO_LOG 16 /* * Max and min values for UIO and mount-option defined I/O sizes; @@ -554,20 +551,10 @@ extern int xfs_readsb(xfs_mount_t *mp); extern void xfs_freesb(xfs_mount_t *); extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int); extern int xfs_syncsub(xfs_mount_t *, int, int, int *); -extern void xfs_initialize_perag(xfs_mount_t *, int); +extern xfs_agnumber_t xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t); extern void xfs_xlatesb(void *, struct xfs_sb *, int, xfs_arch_t, __int64_t); -/* - * Flags for freeze operations. - */ -#define XFS_FREEZE_WRITE 1 -#define XFS_FREEZE_TRANS 2 - -extern void xfs_start_freeze(xfs_mount_t *, int); -extern void xfs_finish_freeze(xfs_mount_t *); -extern void xfs_check_frozen(xfs_mount_t *, bhv_desc_t *, int); - extern struct vfsops xfs_vfsops; extern struct vnodeops xfs_vnodeops; diff --git a/include/xfs_quota.h b/include/xfs_quota.h index 8cddc1639..703ec4efc 100644 --- a/include/xfs_quota.h +++ b/include/xfs_quota.h @@ -309,23 +309,27 @@ typedef struct xfs_dqtrxops { } xfs_dqtrxops_t; #define XFS_DQTRXOP(mp, tp, op, args...) \ - ((mp)->m_qm_ops.xfs_dqtrxops ? \ - ((mp)->m_qm_ops.xfs_dqtrxops->op)(tp, ## args) : 0) + ((mp)->m_qm_ops.xfs_dqtrxops ? \ + ((mp)->m_qm_ops.xfs_dqtrxops->op)(tp, ## args) : 0) + +#define XFS_DQTRXOP_VOID(mp, tp, op, args...) \ + ((mp)->m_qm_ops.xfs_dqtrxops ? \ + ((mp)->m_qm_ops.xfs_dqtrxops->op)(tp, ## args) : (void)0) #define XFS_TRANS_DUP_DQINFO(mp, otp, ntp) \ - XFS_DQTRXOP(mp, otp, qo_dup_dqinfo, ntp) + XFS_DQTRXOP_VOID(mp, otp, qo_dup_dqinfo, ntp) #define XFS_TRANS_FREE_DQINFO(mp, tp) \ - XFS_DQTRXOP(mp, tp, qo_free_dqinfo) + XFS_DQTRXOP_VOID(mp, tp, qo_free_dqinfo) #define XFS_TRANS_MOD_DQUOT_BYINO(mp, tp, ip, field, delta) \ - XFS_DQTRXOP(mp, tp, qo_mod_dquot_byino, ip, field, delta) + XFS_DQTRXOP_VOID(mp, tp, qo_mod_dquot_byino, ip, field, delta) #define XFS_TRANS_APPLY_DQUOT_DELTAS(mp, tp) \ - XFS_DQTRXOP(mp, tp, qo_apply_dquot_deltas) + XFS_DQTRXOP_VOID(mp, tp, qo_apply_dquot_deltas) #define XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, tp, ip, nblks, ninos, fl) \ XFS_DQTRXOP(mp, tp, qo_reserve_quota_nblks, mp, ip, nblks, ninos, fl) #define XFS_TRANS_RESERVE_QUOTA_BYDQUOTS(mp, tp, ud, gd, nb, ni, fl) \ XFS_DQTRXOP(mp, tp, qo_reserve_quota_bydquots, mp, ud, gd, nb, ni, fl) #define XFS_TRANS_UNRESERVE_AND_MOD_DQUOTS(mp, tp) \ - XFS_DQTRXOP(mp, tp, qo_unreserve_and_mod_dquots) + XFS_DQTRXOP_VOID(mp, tp, qo_unreserve_and_mod_dquots) #define XFS_TRANS_RESERVE_BLKQUOTA(mp, tp, ip, nblks) \ XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, tp, ip, nblks, 0, \ diff --git a/include/xfs_sb.h b/include/xfs_sb.h index 9e0adf4c4..ad090a834 100644 --- a/include/xfs_sb.h +++ b/include/xfs_sb.h @@ -250,9 +250,9 @@ int xfs_sb_good_version(xfs_sb_t *sbp); ((((sbp)->sb_versionnum >= XFS_SB_VERSION_1) && \ ((sbp)->sb_versionnum <= XFS_SB_VERSION_3)) || \ ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ - !(((sbp)->sb_versionnum & ~XFS_SB_VERSION_OKREALBITS) && \ - ((sbp)->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT) && \ - ((sbp)->sb_features2 & ~XFS_SB_VERSION2_OKREALBITS)) + !(((sbp)->sb_versionnum & ~XFS_SB_VERSION_OKREALBITS) || \ + (((sbp)->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT) && \ + ((sbp)->sb_features2 & ~XFS_SB_VERSION2_OKREALBITS))) #ifdef __KERNEL__ #define XFS_SB_GOOD_VERSION(sbp) \ diff --git a/include/xfs_trans.h b/include/xfs_trans.h index b415975b8..86e53377e 100644 --- a/include/xfs_trans.h +++ b/include/xfs_trans.h @@ -220,7 +220,6 @@ typedef struct xfs_log_item_desc { #define XFS_LID_DIRTY 0x1 #define XFS_LID_PINNED 0x2 -#define XFS_LID_SYNC_UNLOCK 0x4 #define XFS_LID_BUF_STALE 0x8 /* @@ -1001,7 +1000,6 @@ struct xfs_buf *xfs_trans_getsb(xfs_trans_t *, struct xfs_mount *, int); void xfs_trans_brelse(xfs_trans_t *, struct xfs_buf *); void xfs_trans_bjoin(xfs_trans_t *, struct xfs_buf *); void xfs_trans_bhold(xfs_trans_t *, struct xfs_buf *); -void xfs_trans_bhold_until_committed(xfs_trans_t *, struct xfs_buf *); void xfs_trans_binval(xfs_trans_t *, struct xfs_buf *); void xfs_trans_inode_buf(xfs_trans_t *, struct xfs_buf *); void xfs_trans_inode_buf(xfs_trans_t *, struct xfs_buf *); diff --git a/include/xfs_types.h b/include/xfs_types.h index 8d6aac750..04609d27e 100644 --- a/include/xfs_types.h +++ b/include/xfs_types.h @@ -58,7 +58,7 @@ typedef enum { B_FALSE,B_TRUE } boolean_t; typedef __int64_t prid_t; /* project ID */ typedef __uint32_t inst_t; /* an instruction */ -typedef __u64 xfs_off_t; +typedef __s64 xfs_off_t; /* type */ typedef __u64 xfs_ino_t; /* type */ typedef __s64 xfs_daddr_t; /* type */ typedef char * xfs_caddr_t; /* type */ diff --git a/libxfs/init.c b/libxfs/init.c index 12bd0c086..79f75449a 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -682,7 +682,7 @@ libxfs_mount( exit(1); } - libxfs_initialize_perag(mp, sbp->sb_agcount); + mp->m_maxagi = libxfs_initialize_perag(mp, sbp->sb_agcount); /* * mkfs calls mount before the root inode is allocated. diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c index c77f137c6..90f7e9091 100644 --- a/libxfs/xfs_alloc.c +++ b/libxfs/xfs_alloc.c @@ -572,7 +572,7 @@ xfs_alloc_ag_vextent_exact( * Allocate/initialize a cursor for the by-number freespace btree. */ bno_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_BNO, 0, 0); + args->agno, XFS_BTNUM_BNO, NULL, 0); /* * Lookup bno and minlen in the btree (minlen is irrelevant, really). * Look for the closest free block <= bno, it must contain bno @@ -628,7 +628,7 @@ xfs_alloc_ag_vextent_exact( * Allocate/initialize a cursor for the by-size btree. */ cnt_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_CNT, 0, 0); + args->agno, XFS_BTNUM_CNT, NULL, 0); ASSERT(args->agbno + args->len <= INT_GET(XFS_BUF_TO_AGF(args->agbp)->agf_length, ARCH_CONVERT)); @@ -695,7 +695,7 @@ xfs_alloc_ag_vextent_near( * Get a cursor for the by-size btree. */ cnt_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_CNT, 0, 0); + args->agno, XFS_BTNUM_CNT, NULL, 0); ltlen = 0; bno_cur_lt = bno_cur_gt = NULL; /* @@ -823,7 +823,7 @@ xfs_alloc_ag_vextent_near( * Set up a cursor for the by-bno tree. */ bno_cur_lt = xfs_btree_init_cursor(args->mp, args->tp, - args->agbp, args->agno, XFS_BTNUM_BNO, 0, 0); + args->agbp, args->agno, XFS_BTNUM_BNO, NULL, 0); /* * Fix up the btree entries. */ @@ -851,7 +851,7 @@ xfs_alloc_ag_vextent_near( * Allocate and initialize the cursor for the leftward search. */ bno_cur_lt = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_BNO, 0, 0); + args->agno, XFS_BTNUM_BNO, NULL, 0); /* * Lookup <= bno to find the leftward search's starting point. */ @@ -863,7 +863,7 @@ xfs_alloc_ag_vextent_near( * search. */ bno_cur_gt = bno_cur_lt; - bno_cur_lt = 0; + bno_cur_lt = NULL; } /* * Found something. Duplicate the cursor for the rightward search. @@ -1208,7 +1208,7 @@ xfs_alloc_ag_vextent_size( * Allocate and initialize a cursor for the by-size btree. */ cnt_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_CNT, 0, 0); + args->agno, XFS_BTNUM_CNT, NULL, 0); bno_cur = NULL; /* * Look for an entry >= maxlen+alignment-1 blocks. @@ -1313,7 +1313,7 @@ xfs_alloc_ag_vextent_size( * Allocate and initialize a cursor for the by-block tree. */ bno_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_BNO, 0, 0); + args->agno, XFS_BTNUM_BNO, NULL, 0); if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen, rbno, rlen, XFSA_FIXUP_CNT_OK))) goto error0; @@ -1460,7 +1460,7 @@ xfs_free_ag_extent( /* * Allocate and initialize a cursor for the by-block btree. */ - bno_cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_BNO, 0, + bno_cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_BNO, NULL, 0); cnt_cur = NULL; /* @@ -1520,7 +1520,7 @@ xfs_free_ag_extent( /* * Now allocate and initialize a cursor for the by-size tree. */ - cnt_cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_CNT, 0, + cnt_cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_CNT, NULL, 0); /* * Have both left and right contiguous neighbors. diff --git a/libxfs/xfs_alloc_btree.c b/libxfs/xfs_alloc_btree.c index 235db5d78..c3338a27b 100644 --- a/libxfs/xfs_alloc_btree.c +++ b/libxfs/xfs_alloc_btree.c @@ -227,7 +227,7 @@ xfs_alloc_delrec( /* * Update the cursor so there's one fewer level. */ - xfs_btree_setbuf(cur, level, 0); + xfs_btree_setbuf(cur, level, NULL); cur->bc_nlevels--; } else if (level > 0 && (error = xfs_alloc_decrement(cur, level, &i))) diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index 5042c45c0..135607ec5 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -195,7 +195,7 @@ xfs_bmap_add_extent( *curp = cur; } done: -#ifdef XFSDEBUG +#ifdef DEBUG if (!error) xfs_bmap_check_leaf_extents(*curp, ip, whichfork); #endif @@ -2929,6 +2929,20 @@ xfs_bmap_do_search_extents( int high; /* high index of binary search */ int low; /* low index of binary search */ + /* + * Initialize the extent entry structure to catch access to + * uninitialized br_startblock field. + */ + got.br_startoff = 0xffa5a5a5a5a5a5a5LL; + got.br_blockcount = 0xa55a5a5a5a5a5a5aLL; + got.br_state = XFS_EXT_INVALID; + +#if XFS_BIG_BLKNOS + got.br_startblock = 0xffffa5a5a5a5a5a5LL; +#else + got.br_startblock = 0xffffa5a5; +#endif + if (lastx != NULLEXTNUM && lastx < nextents) ep = base + lastx; else @@ -3027,6 +3041,8 @@ xfs_bmap_search_extents( xfs_bmbt_rec_t *base; /* base of extent list */ xfs_extnum_t lastx; /* last extent index used */ xfs_extnum_t nextents; /* extent list size */ + xfs_bmbt_rec_t *ep; /* extent list entry pointer */ + int rt; /* realtime flag */ XFS_STATS_INC(xs_look_exlist); ifp = XFS_IFORK_PTR(ip, whichfork); @@ -3034,8 +3050,18 @@ xfs_bmap_search_extents( nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t); base = &ifp->if_u1.if_extents[0]; - return xfs_bmap_do_search_extents(base, lastx, nextents, bno, eofp, + ep = xfs_bmap_do_search_extents(base, lastx, nextents, bno, eofp, lastxp, gotp, prevp); + rt = ip->i_d.di_flags & XFS_DIFLAG_REALTIME; + if(!rt && !gotp->br_startblock && (*lastxp != NULLEXTNUM)) { + cmn_err(CE_PANIC,"Access to block zero: fs: <%s> inode: %lld " + "start_block : %llx start_off : %llx blkcnt : %llx " + "extent-state : %x \n", + (ip->i_mount)->m_fsname,(long long)ip->i_ino, + gotp->br_startblock, gotp->br_startoff, + gotp->br_blockcount,gotp->br_state); + } + return ep; } /* @@ -3697,8 +3723,41 @@ xfs_bmapi( } break; } + + /* + * Split changing sb for alen and indlen since + * they could be coming from different places. + */ + if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) { + xfs_extlen_t extsz; + xfs_extlen_t ralen; + if (!(extsz = ip->i_d.di_extsize)) + extsz = mp->m_sb.sb_rextsize; + ralen = roundup(alen, extsz); + ralen = ralen / mp->m_sb.sb_rextsize; + if (xfs_mod_incore_sb(mp, + XFS_SBS_FREXTENTS, + -(ralen), rsvd)) { + if (XFS_IS_QUOTA_ON(ip->i_mount)) + XFS_TRANS_UNRESERVE_BLKQUOTA( + mp, NULL, ip, + (long)alen); + break; + } + } else { + if (xfs_mod_incore_sb(mp, + XFS_SBS_FDBLOCKS, + -(alen), rsvd)) { + if (XFS_IS_QUOTA_ON(ip->i_mount)) + XFS_TRANS_UNRESERVE_BLKQUOTA( + mp, NULL, ip, + (long)alen); + break; + } + } + if (xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, - -(alen + indlen), rsvd)) { + -(indlen), rsvd)) { XFS_TRANS_UNRESERVE_BLKQUOTA( mp, NULL, ip, (long)alen); break; diff --git a/libxfs/xfs_bmap_btree.c b/libxfs/xfs_bmap_btree.c index 233204d48..45754a5c6 100644 --- a/libxfs/xfs_bmap_btree.c +++ b/libxfs/xfs_bmap_btree.c @@ -1616,7 +1616,7 @@ xfs_bmbt_get_block( *bpp = cur->bc_bufs[level]; rval = XFS_BUF_TO_BMBT_BLOCK(*bpp); } else { - *bpp = 0; + *bpp = NULL; ifp = XFS_IFORK_PTR(cur->bc_private.b.ip, cur->bc_private.b.whichfork); rval = ifp->if_broot; diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c index 85beff01a..f0e9e4856 100644 --- a/libxfs/xfs_da_btree.c +++ b/libxfs/xfs_da_btree.c @@ -2017,7 +2017,7 @@ xfs_da_do_buf( int caller, inst_t *ra) { - xfs_buf_t *bp = 0; + xfs_buf_t *bp = NULL; xfs_buf_t **bplist; int error=0; int i; diff --git a/libxfs/xfs_mount.c b/libxfs/xfs_mount.c index 32035c7e0..89eea4e65 100644 --- a/libxfs/xfs_mount.c +++ b/libxfs/xfs_mount.c @@ -228,10 +228,10 @@ xfs_xlatesb( } } -void -xfs_initialize_perag(xfs_mount_t *mp, int agcount) +xfs_agnumber_t +xfs_initialize_perag(xfs_mount_t *mp, xfs_agnumber_t agcount) { - int index, max_metadata; + xfs_agnumber_t index, max_metadata; xfs_perag_t *pag; xfs_agino_t agino; xfs_ino_t ino; @@ -287,5 +287,5 @@ xfs_initialize_perag(xfs_mount_t *mp, int agcount) pag->pagi_inodeok = 1; } } - mp->m_maxagi = index; + return index; } diff --git a/man/man8/mkfs.xfs.8 b/man/man8/mkfs.xfs.8 index 8864ac419..1d4e81462 100644 --- a/man/man8/mkfs.xfs.8 +++ b/man/man8/mkfs.xfs.8 @@ -57,9 +57,15 @@ If suffixed with \f3b\f1 then the size is converted by multiplying it by the filesystems block size (defaults to 4K, see \f3\-b\f1 option below). If suffixed with \f3k\f1 then the size is converted by multiplying it by 1024. If suffixed with \f3m\f1 then the size is converted by multiplying it by -1048576 (1024 * 1024). +one megabyte (1024 * 1024 bytes). If suffixed with \f3g\f1 then the size is converted by multiplying it by -1073741824 (1024 * 1024 * 1024). +one gigabyte (1024 * 1024 * 1024 bytes). +If suffixed with \f3t\f1 then the size is converted by multiplying it by +one terabyte (1024 * 1024 * 1024 * 1024 bytes). +If suffixed with \f3p\f1 then the size is converted by multiplying it by +one petabyte (1024 * 1024 * 1024 * 1024 * 1024 bytes). +If suffixed with \f3e\f1 then the size is converted by multiplying it by +one exabyte (1024 * 1024 * 1024 * 1024 * 1024 * 1024 bytes). .TP .B \-b Block size options. @@ -74,8 +80,8 @@ The block size is specified either as a base two logarithm value with .BR log= , or in bytes with .BR size= . -The default value is 4096 bytes (4 KB), the minimum is 512, and the -maximum is 65536 (64 KB). +The default value is 4096 bytes (4 KiB), the minimum is 512, and the +maximum is 65536 (64 KiB). XFS on Linux currently only supports pagesize or smaller blocks. .TP .B \-d @@ -103,12 +109,12 @@ The data section of the filesystem is divided into allocation groups to improve the performance of XFS. More allocation groups imply that more parallelism can be achieved when allocating blocks and inodes. -The minimum allocation group size is 16 MB; -the maximum size is just under 4 GB. +The minimum allocation group size is 16 MiB; +the maximum size is just under 1 TiB. The data section of the filesystem is divided into .I agcount -allocation groups (default value 8, unless the filesystem is smaller -than 128 MB or larger than 8 GB). +allocation groups (default value is scaled automatically based +on the underlying device size). Setting .I agcount to a very large number should be avoided, since this causes an unreasonable @@ -123,7 +129,7 @@ The argument provided to is the desired size of the allocation group expressed in bytes (usually using the \f3m\f1 or \f3g\f1 suffixes). This value must be a multiple of the filesystem block size, and -must be at least 16MB, and no more than 4GB, and may +must be at least 16MiB, and no more than 1TiB, and may be automatically adjusted to properly align with the stripe geometry. The .B agcount @@ -170,7 +176,7 @@ Use the suboption to specify the stripe unit size in bytes. This suboption ensures that data allocations will be stripe unit aligned when the current end of file is being extended and the file size is larger -than 512KB. +than 512KiB. Also inode allocations and the internal log will be stripe unit aligned. .IP The @@ -271,7 +277,7 @@ in bytes with or as the number fitting in a filesystem block with .BR perblock= . The mininum (and default) value is 256 bytes. -The maximum value is 2048 (2 KB) subject to the restriction that +The maximum value is 2048 (2 KiB) subject to the restriction that the inode size cannot exceed one half of the filesystem block size. .IP XFS uses 64-bit inode numbers internally; however, the number of @@ -420,7 +426,7 @@ The block size is specified either as a base two logarithm value with .BR log= , or in bytes with .BR size= . -The default size value for version 2 directories is 4096 bytes (4 KB), +The default size value for version 2 directories is 4096 bytes (4 KiB), unless the filesystem block size is larger than 4096, in which case the default value is the filesystem block size. For version 1 directories the block size is the same as the @@ -607,10 +613,10 @@ suboption is used to specify the size of the blocks in the real-time section of the filesystem. This size must be a multiple of the filesystem block size. The minimum allowed value is the filesystem block size -or 4 KB (whichever is larger); -the default value is the stripe width for striped volumes or 64 KB for +or 4 KiB (whichever is larger); +the default value is the stripe width for striped volumes or 64 KiB for non-striped volumes; -the maximum allowed value is 1 GB. +the maximum allowed value is 1 GiB. The real-time extent size should be carefully chosen to match the parameters of the physical media used. .IP @@ -635,7 +641,7 @@ The sector size is specified either as a base two logarithm value with or in bytes with .BR size= . The default value is 512 bytes. -The minimum value for sector size is 512; the maximum is 32768 (32 KB). +The minimum value for sector size is 512; the maximum is 32768 (32 KiB). The sector size must be a power of 2 size and cannot be made larger than the filesystem block size. .TP diff --git a/man/man8/xfs_db.8 b/man/man8/xfs_db.8 index 08334537f..87cccdc2d 100644 --- a/man/man8/xfs_db.8 +++ b/man/man8/xfs_db.8 @@ -746,9 +746,9 @@ Data blocks start at offset 0 in the file. There are two kinds of data blocks: single-block directories have the leaf information embedded at the end of the block, data blocks in multi-block directories do not. -Node and leaf blocks start at offset 32GB (with either a single +Node and leaf blocks start at offset 32GiB (with either a single leaf block or the root node block). -Freespace blocks start at offset 64GB. +Freespace blocks start at offset 64GiB. The node and leaf blocks form a Btree, with references to the data in the data blocks. The freespace blocks form an index of longest free spaces within the @@ -834,7 +834,7 @@ The quota information is stored in files referred to by the superblock Each filesystem block in a quota file contains a constant number of quota entries. The quota entry size is currently 136 bytes, -so with a 4KB filesystem block size there are 30 quota entries per block. +so with a 4KiB filesystem block size there are 30 quota entries per block. The \f3dquot\f1 command is used to locate these entries in the filesystem. The file entries are indexed by the user or project identifier to determine the block and offset. diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 6d7531d90..b79a1631e 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -2385,6 +2385,8 @@ cvtnum( return 1024LL * 1024LL * 1024LL * 1024LL * i; if (*sp == 'p' && sp[1] == '\0') return 1024LL * 1024LL * 1024LL * 1024LL * 1024LL * i; + if (*sp == 'e' && sp[1] == '\0') + return 1024LL * 1024LL * 1024LL * 1024LL * 1024LL * 1024LL * i; return -1LL; }