Merge of xfs-cmds-melb:slinx:19613a by kenmcd.
#
PKG_MAJOR=2
PKG_MINOR=6
-PKG_REVISION=23
+PKG_REVISION=24
PKG_BUILD=1
+xfsprogs (2.6.24-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Nathan Scott <nathans@debian.org> Wed, 29 Sep 2004 11:28:20 +1000
+
xfsprogs (2.6.23-1) unstable; urgency=low
* New upstream release.
+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
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)
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)
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 */
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 *);
# 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
/* 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) \
/* 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)) \
)
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.
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 */
/*
/*
- * 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
*/
typedef enum {
XFS_EXT_NORM, XFS_EXT_UNWRITTEN,
- XFS_EXT_DMAPI_OFFLINE
+ XFS_EXT_DMAPI_OFFLINE, XFS_EXT_INVALID
} xfs_exntst_t;
/*
xfs_filblks_t,
xfs_exntst_t);
-#ifdef XFSDEBUG
+#ifdef DEBUG
/*
* Get the data from the pointed-to record.
*/
/*
* Syscall interface for xfs_swapext
*/
-int xfs_swapext(struct xfs_swapext *sx);
+int xfs_swapext(struct xfs_swapext __user *sx);
#endif /* __KERNEL__ */
#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)
/*
- * 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
__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;
* 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;
*/
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;
/*
*/
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;
/*
#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,
#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
/*
* 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.
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 *);
/*
- * 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
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 *,
#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)
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;
#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;
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;
} 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, \
((((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) \
#define XFS_LID_DIRTY 0x1
#define XFS_LID_PINNED 0x2
-#define XFS_LID_SYNC_UNLOCK 0x4
#define XFS_LID_BUF_STALE 0x8
/*
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 *);
typedef __int64_t prid_t; /* project ID */
typedef __uint32_t inst_t; /* an instruction */
-typedef __u64 xfs_off_t;
+typedef __s64 xfs_off_t; /* <file offset> type */
typedef __u64 xfs_ino_t; /* <inode> type */
typedef __s64 xfs_daddr_t; /* <disk address> type */
typedef char * xfs_caddr_t; /* <core address> type */
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.
* 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
* 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));
* 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;
/*
* 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.
*/
* 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.
*/
* search.
*/
bno_cur_gt = bno_cur_lt;
- bno_cur_lt = 0;
+ bno_cur_lt = NULL;
}
/*
* Found something. Duplicate the cursor for the rightward search.
* 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.
* 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;
/*
* 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;
/*
/*
* 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.
/*
* 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)))
*curp = cur;
}
done:
-#ifdef XFSDEBUG
+#ifdef DEBUG
if (!error)
xfs_bmap_check_leaf_extents(*curp, ip, whichfork);
#endif
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
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);
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;
}
/*
}
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;
*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;
int caller,
inst_t *ra)
{
- xfs_buf_t *bp = 0;
+ xfs_buf_t *bp = NULL;
xfs_buf_t **bplist;
int error=0;
int i;
}
}
-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;
pag->pagi_inodeok = 1;
}
}
- mp->m_maxagi = index;
+ return index;
}
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.
.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
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
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
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
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
.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
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
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
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
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.
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;
}