Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 251767
b: refs/heads/master
c: 55a7bc5
h: refs/heads/master
i:
  251765: d4c7bc1
  251763: 1ae6975
  251759: 951fa0a
v: v3
  • Loading branch information
Christoph Hellwig authored and Alex Elder committed May 24, 2011
1 parent 7b41748 commit c32f281
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e84661aa84e2e003738563f65155d4f12dc474e7
refs/heads/master: 55a7bc5a30ff2d30d8a34fea2af9fc601b32e61a
1 change: 1 addition & 0 deletions trunk/fs/xfs/xfs_ag.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ struct xfs_busy_extent {
xfs_extlen_t length;
unsigned int flags;
#define XFS_ALLOC_BUSY_DISCARDED 0x01 /* undergoing a discard op. */
#define XFS_ALLOC_BUSY_SKIP_DISCARD 0x02 /* do not discard */
};

/*
Expand Down
9 changes: 6 additions & 3 deletions trunk/fs/xfs/xfs_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2469,7 +2469,7 @@ xfs_free_extent(

error = xfs_free_ag_extent(tp, args.agbp, args.agno, args.agbno, len, 0);
if (!error)
xfs_alloc_busy_insert(tp, args.agno, args.agbno, len);
xfs_alloc_busy_insert(tp, args.agno, args.agbno, len, 0);
error0:
xfs_perag_put(args.pag);
return error;
Expand All @@ -2480,7 +2480,8 @@ xfs_alloc_busy_insert(
struct xfs_trans *tp,
xfs_agnumber_t agno,
xfs_agblock_t bno,
xfs_extlen_t len)
xfs_extlen_t len,
unsigned int flags)
{
struct xfs_busy_extent *new;
struct xfs_busy_extent *busyp;
Expand All @@ -2504,6 +2505,7 @@ xfs_alloc_busy_insert(
new->bno = bno;
new->length = len;
INIT_LIST_HEAD(&new->list);
new->flags = flags;

/* trace before insert to be able to see failed inserts */
trace_xfs_alloc_busy(tp->t_mountp, agno, bno, len);
Expand Down Expand Up @@ -3018,7 +3020,8 @@ xfs_alloc_busy_clear(
agno = busyp->agno;
}

if (do_discard && busyp->length)
if (do_discard && busyp->length &&
!(busyp->flags & XFS_ALLOC_BUSY_SKIP_DISCARD))
busyp->flags = XFS_ALLOC_BUSY_DISCARDED;
else
xfs_alloc_busy_clear_one(mp, pag, busyp);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/xfs_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ xfs_alloc_longest_free_extent(struct xfs_mount *mp,
#ifdef __KERNEL__
void
xfs_alloc_busy_insert(struct xfs_trans *tp, xfs_agnumber_t agno,
xfs_agblock_t bno, xfs_extlen_t len);
xfs_agblock_t bno, xfs_extlen_t len, unsigned int flags);

void
xfs_alloc_busy_clear(struct xfs_mount *mp, struct list_head *list,
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/xfs/xfs_alloc_btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ xfs_allocbt_free_block(
if (error)
return error;

xfs_alloc_busy_insert(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1);
xfs_alloc_busy_insert(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1,
XFS_ALLOC_BUSY_SKIP_DISCARD);
xfs_trans_agbtree_delta(cur->bc_tp, -1);
return 0;
}
Expand Down

0 comments on commit c32f281

Please sign in to comment.