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

Commit c0341b0f authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://oss.sgi.com:8090/xfs/xfs-2.6: (49 commits)
  [XFS] Remove v1 dir trace macro - missed in a past commit.
  [XFS] 955947: Infinite loop in xfs_bulkstat() on formatter() error
  [XFS] pv 956241, author: nathans, rv: vapo - make ino validation checks
  [XFS] pv 956240, author: nathans, rv: vapo - Minor fixes in
  [XFS] Really fix use after free in xfs_iunpin.
  [XFS] Collapse sv_init and init_sv into just the one interface.
  [XFS] standardize on one sema init macro
  [XFS] Reduce endian flipping in alloc_btree, same as was done for
  [XFS] Minor cleanup from dio locking fix, remove an extra conditional.
  [XFS] Fix kmem_zalloc_greedy warnings on 64 bit platforms.
  [XFS] pv 955157, rv bnaujok - break the loop on EFAULT formatter() error
  [XFS] pv 955157, rv bnaujok - break the loop on formatter() error
  [XFS] Fixes the leak in reservation space because we weren't ungranting
  [XFS] Add lock annotations to xfs_trans_update_ail and
  [XFS] Fix a porting botch on the realtime subvol growfs code path.
  [XFS] Minor code rearranging and cleanup to prevent some coverity false
  [XFS] Remove a no-longer-correct debug assert from dio completion
  [XFS] Add a greedy allocation interface, allocating within a min/max size
  [XFS] Improve error handling for the zero-fsblock extent detection code.
  [XFS] Be more defensive with page flags (error/private) for metadata
  ...
parents ae1390d8 1b06e792
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ ifeq ($(CONFIG_XFS_TRACE),y)
	EXTRA_CFLAGS += -DXFS_BLI_TRACE
	EXTRA_CFLAGS += -DXFS_BMAP_TRACE
	EXTRA_CFLAGS += -DXFS_BMBT_TRACE
	EXTRA_CFLAGS += -DXFS_DIR_TRACE
	EXTRA_CFLAGS += -DXFS_DIR2_TRACE
	EXTRA_CFLAGS += -DXFS_DQUOT_TRACE
	EXTRA_CFLAGS += -DXFS_ILOCK_TRACE
+29 −0
Original line number Diff line number Diff line
@@ -34,6 +34,14 @@ kmem_alloc(size_t size, unsigned int __nocast flags)
	gfp_t	lflags = kmem_flags_convert(flags);
	void	*ptr;

#ifdef DEBUG
	if (unlikely(!(flags & KM_LARGE) && (size > PAGE_SIZE))) {
		printk(KERN_WARNING "Large %s attempt, size=%ld\n",
			__FUNCTION__, (long)size);
		dump_stack();
	}
#endif

	do {
		if (size < MAX_SLAB_SIZE || retries > MAX_VMALLOCS)
			ptr = kmalloc(size, lflags);
@@ -60,6 +68,27 @@ kmem_zalloc(size_t size, unsigned int __nocast flags)
	return ptr;
}

void *
kmem_zalloc_greedy(size_t *size, size_t minsize, size_t maxsize,
		   unsigned int __nocast flags)
{
	void		*ptr;
	size_t		kmsize = maxsize;
	unsigned int	kmflags = (flags & ~KM_SLEEP) | KM_NOSLEEP;

	while (!(ptr = kmem_zalloc(kmsize, kmflags))) {
		if ((kmsize <= minsize) && (flags & KM_NOSLEEP))
			break;
		if ((kmsize >>= 1) <= minsize) {
			kmsize = minsize;
			kmflags = flags;
		}
	}
	if (ptr)
		*size = kmsize;
	return ptr;
}

void
kmem_free(void *ptr, size_t size)
{
+4 −2
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#define KM_NOSLEEP	0x0002u
#define KM_NOFS		0x0004u
#define KM_MAYFAIL	0x0008u
#define KM_LARGE	0x0010u

/*
 * We use a special process flag to avoid recursive callbacks into
@@ -41,7 +42,7 @@ kmem_flags_convert(unsigned int __nocast flags)
{
	gfp_t	lflags;

	BUG_ON(flags & ~(KM_SLEEP|KM_NOSLEEP|KM_NOFS|KM_MAYFAIL));
	BUG_ON(flags & ~(KM_SLEEP|KM_NOSLEEP|KM_NOFS|KM_MAYFAIL|KM_LARGE));

	if (flags & KM_NOSLEEP) {
		lflags = GFP_ATOMIC | __GFP_NOWARN;
@@ -54,8 +55,9 @@ kmem_flags_convert(unsigned int __nocast flags)
}

extern void *kmem_alloc(size_t, unsigned int __nocast);
extern void *kmem_realloc(void *, size_t, size_t, unsigned int __nocast);
extern void *kmem_zalloc(size_t, unsigned int __nocast);
extern void *kmem_zalloc_greedy(size_t *, size_t, size_t, unsigned int __nocast);
extern void *kmem_realloc(void *, size_t, size_t, unsigned int __nocast);
extern void  kmem_free(void *, size_t);

/*
+0 −2
Original line number Diff line number Diff line
@@ -29,8 +29,6 @@

typedef struct semaphore sema_t;

#define init_sema(sp, val, c, d)	sema_init(sp, val)
#define initsema(sp, val)		sema_init(sp, val)
#define initnsema(sp, val, name)	sema_init(sp, val)
#define psema(sp, b)			down(sp)
#define vsema(sp)			up(sp)
+0 −2
Original line number Diff line number Diff line
@@ -53,8 +53,6 @@ static inline void _sv_wait(sv_t *sv, spinlock_t *lock, int state,
	remove_wait_queue(&sv->waiters, &wait);
}

#define init_sv(sv,type,name,flag) \
	init_waitqueue_head(&(sv)->waiters)
#define sv_init(sv,flag,name) \
	init_waitqueue_head(&(sv)->waiters)
#define sv_destroy(sv) \
Loading