Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3762ec6b authored by Nathan Scott's avatar Nathan Scott
Browse files

[XFS] Merge in trivial changes, sync up headers with userspace


equivalents.

SGI-PV: 907752
SGI-Modid: xfs-linux-melb:xfs-kern:24961a

Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 6ab65429
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -239,7 +239,7 @@ xfs_qm_dquot_logitem_pushbuf(
	 * trying to duplicate our effort.
	 */
	ASSERT(qip->qli_pushbuf_flag != 0);
	ASSERT(qip->qli_push_owner == get_thread_id());
	ASSERT(qip->qli_push_owner == current_pid());

	/*
	 * If flushlock isn't locked anymore, chances are that the
@@ -333,7 +333,7 @@ xfs_qm_dquot_logitem_trylock(
			qip->qli_pushbuf_flag = 1;
			ASSERT(qip->qli_format.qlf_blkno == dqp->q_blkno);
#ifdef DEBUG
			qip->qli_push_owner = get_thread_id();
			qip->qli_push_owner = current_pid();
#endif
			/*
			 * The dquot is left locked.
+24 −34
Original line number Diff line number Diff line
@@ -32,39 +32,6 @@ static const char * const err_level[XFS_MAX_ERR_LEVEL+1] =
					 KERN_ERR, KERN_WARNING, KERN_NOTICE,
					 KERN_INFO, KERN_DEBUG};

void
assfail(char *a, char *f, int l)
{
    printk("XFS assertion failed: %s, file: %s, line: %d\n", a, f, l);
    BUG();
}

#if ((defined(DEBUG) || defined(INDUCE_IO_ERRROR)) && !defined(NO_WANT_RANDOM))

unsigned long
random(void)
{
	static unsigned long	RandomValue = 1;
	/* cycles pseudo-randomly through all values between 1 and 2^31 - 2 */
	register long	rv = RandomValue;
	register long	lo;
	register long	hi;

	hi = rv / 127773;
	lo = rv % 127773;
	rv = 16807 * lo - 2836 * hi;
	if( rv <= 0 ) rv += 2147483647;
	return( RandomValue = rv );
}

int
get_thread_id(void)
{
	return current->pid;
}

#endif /* DEBUG || INDUCE_IO_ERRROR || !NO_WANT_RANDOM */

void
cmn_err(register int level, char *fmt, ...)
{
@@ -90,7 +57,6 @@ cmn_err(register int level, char *fmt, ...)
		BUG();
}


void
icmn_err(register int level, char *fmt, va_list ap)
{
@@ -109,3 +75,27 @@ icmn_err(register int level, char *fmt, va_list ap)
	if (level == CE_PANIC)
		BUG();
}

void
assfail(char *expr, char *file, int line)
{
	printk("Assertion failed: %s, file: %s, line: %d\n", expr, file, line);
	BUG();
}

#if ((defined(DEBUG) || defined(INDUCE_IO_ERRROR)) && !defined(NO_WANT_RANDOM))
unsigned long random(void)
{
	static unsigned long	RandomValue = 1;
	/* cycles pseudo-randomly through all values between 1 and 2^31 - 2 */
	register long	rv = RandomValue;
	register long	lo;
	register long	hi;

	hi = rv / 127773;
	lo = rv % 127773;
	rv = 16807 * lo - 2836 * hi;
	if (rv <= 0) rv += 2147483647;
	return RandomValue = rv;
}
#endif /* DEBUG || INDUCE_IO_ERRROR || !NO_WANT_RANDOM */
+12 −13
Original line number Diff line number Diff line
@@ -31,24 +31,23 @@ extern void icmn_err(int, char *, va_list)
	__attribute__ ((format (printf, 2, 0)));
extern void cmn_err(int, char *, ...)
	__attribute__ ((format (printf, 2, 3)));
extern void assfail(char *expr, char *f, int l);

#ifndef STATIC
# define STATIC static
#endif
#define prdev(fmt,targ,args...) \
	printk("Device %s - " fmt "\n", XFS_BUFTARG_NAME(targ), ## args)

#ifdef DEBUG
# define ASSERT(EX)	((EX) ? ((void)0) : assfail(#EX, __FILE__, __LINE__))
#else
# define ASSERT(x)	((void)0)
#endif
#define ASSERT_ALWAYS(expr)	\
	(unlikely((expr) != 0) ? (void)0 : assfail(#expr, __FILE__, __LINE__))

extern void assfail(char *, char *, int);
#ifdef DEBUG
#ifndef DEBUG
# define ASSERT(expr)	((void)0)
#else
# define ASSERT(expr)	ASSERT_ALWAYS(expr)
extern unsigned long random(void);
extern int get_thread_id(void);
#endif

#define ASSERT_ALWAYS(EX)  ((EX)?((void)0):assfail(#EX, __FILE__, __LINE__))
#define	debug_stop_all_cpus(param)	/* param is "cpumask_t *" */
#ifndef STATIC
# define STATIC static
#endif

#endif  /* __XFS_SUPPORT_DEBUG_H__ */
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@
#define cpu_to_be16(val)	((__be16)(val))
#define cpu_to_be32(val)	((__be32)(val))
#define cpu_to_be64(val)	((__be64)(val))
#define be16_to_cpu(val)	((__uint16_t)(val)
#define be16_to_cpu(val)	((__uint16_t)(val))
#define be32_to_cpu(val)	((__uint32_t)(val))
#define be64_to_cpu(val)	((__uint64_t)(val))
#else
+43 −36
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ struct xfs_trans;
 * the leaf_entry.  The namespaces are independent only because we also look
 * at the namespace bit when we are looking for a matching attribute name.
 *
 * We also store a "incomplete" bit in the leaf_entry.  It shows that an
 * We also store an "incomplete" bit in the leaf_entry.  It shows that an
 * attribute is in the middle of being created and should not be shown to
 * the user if we crash during the time that the bit is set.  We clear the
 * bit when we have finished setting up the attribute.  We do this because
@@ -72,42 +72,48 @@ struct xfs_trans;
 */
#define XFS_ATTR_LEAF_MAPSIZE	3	/* how many freespace slots */

typedef struct xfs_attr_leafblock {
	struct xfs_attr_leaf_hdr {	/* constant-structure header block */
typedef struct xfs_attr_leaf_map {	/* RLE map of free bytes */
	__uint16_t	base;	 	/* base of free region */
	__uint16_t	size;	  	/* length of free region */
} xfs_attr_leaf_map_t;

typedef struct xfs_attr_leaf_hdr {	/* constant-structure header block */
	xfs_da_blkinfo_t info;		/* block type, links, etc. */
	__uint16_t	count;		/* count of active leaf_entry's */
	__uint16_t	usedbytes;	/* num bytes of names/values stored */
	__uint16_t	firstused;	/* first used byte in name area */
	__uint8_t	holes;		/* != 0 if blk needs compaction */
	__uint8_t	pad1;
		struct xfs_attr_leaf_map {	  /* RLE map of free bytes */
			__uint16_t base;	  /* base of free region */
			__uint16_t size;	  /* length of free region */
		} freemap[XFS_ATTR_LEAF_MAPSIZE]; /* N largest free regions */
	} hdr;
	struct xfs_attr_leaf_entry {	/* sorted on key, not name */
	xfs_attr_leaf_map_t freemap[XFS_ATTR_LEAF_MAPSIZE];
					/* N largest free regions */
} xfs_attr_leaf_hdr_t;

typedef struct xfs_attr_leaf_entry {	/* sorted on key, not name */
	xfs_dahash_t	hashval;	/* hash value of name */
	__uint16_t	nameidx;	/* index into buffer of name/value */
	__uint8_t	flags;		/* LOCAL/ROOT/SECURE/INCOMPLETE flag */
	__uint8_t	pad2;		/* unused pad byte */
	} entries[1];			/* variable sized array */
	struct xfs_attr_leaf_name_local {
} xfs_attr_leaf_entry_t;

typedef struct xfs_attr_leaf_name_local {
	__uint16_t	valuelen;	/* number of bytes in value */
	__uint8_t	namelen;	/* length of name bytes */
	__uint8_t	nameval[1];	/* name/value bytes */
	} namelist;			/* grows from bottom of buf */
	struct xfs_attr_leaf_name_remote {
} xfs_attr_leaf_name_local_t;

typedef struct xfs_attr_leaf_name_remote {
	xfs_dablk_t	valueblk;	/* block number of value bytes */
	__uint32_t	valuelen;	/* number of bytes in value */
	__uint8_t	namelen;	/* length of name bytes */
	__uint8_t	name[1];	/* name bytes */
	} valuelist;			/* grows from bottom of buf */
} xfs_attr_leaf_name_remote_t;

typedef struct xfs_attr_leafblock {
	xfs_attr_leaf_hdr_t	hdr;	/* constant-structure header block */
	xfs_attr_leaf_entry_t	entries[1];	/* sorted on key, not name */
	xfs_attr_leaf_name_local_t namelist;	/* grows from bottom of buf */
	xfs_attr_leaf_name_remote_t valuelist;	/* grows from bottom of buf */
} xfs_attr_leafblock_t;
typedef struct xfs_attr_leaf_hdr xfs_attr_leaf_hdr_t;
typedef struct xfs_attr_leaf_map xfs_attr_leaf_map_t;
typedef struct xfs_attr_leaf_entry xfs_attr_leaf_entry_t;
typedef struct xfs_attr_leaf_name_local xfs_attr_leaf_name_local_t;
typedef struct xfs_attr_leaf_name_remote xfs_attr_leaf_name_remote_t;

/*
 * Flags used in the leaf_entry[i].flags field.
@@ -150,7 +156,8 @@ xfs_attr_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx)
		(leafp))[INT_GET((leafp)->entries[idx].nameidx, ARCH_CONVERT)];
}

#define XFS_ATTR_LEAF_NAME(leafp,idx)		xfs_attr_leaf_name(leafp,idx)
#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)
{
	return (&((char *)
Loading