Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329199
b: refs/heads/master
c: 84f4141
h: refs/heads/master
i:
  329197: 956af16
  329195: 41ddca5
  329191: ab99845
  329183: a3fe2d7
v: v3
  • Loading branch information
Dave Kleikamp committed Sep 18, 2012
1 parent 0c800a7 commit 5e9f83e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 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: 550d6da288df57f154ca27c4acb1c398ced42ea9
refs/heads/master: 84f4141ee3ea11035f741d4298cb6bbad1850fcf
7 changes: 4 additions & 3 deletions trunk/fs/jfs/jfs_dmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1641,14 +1641,15 @@ s64 dbDiscardAG(struct inode *ip, int agno, s64 minlen)

/* max blkno / nblocks pairs to trim */
int count = 0, range_cnt;
u64 max_ranges;

/* prevent others from writing new stuff here, while trimming */
IWRITE_LOCK(ipbmap, RDWRLOCK_DMAP);

nblocks = bmp->db_agfree[agno];
range_cnt = nblocks;
do_div(range_cnt, (int)minlen);
range_cnt = min(range_cnt + 1, 32 * 1024);
max_ranges = nblocks;
do_div(max_ranges, minlen);
range_cnt = min_t(u64, max_ranges + 1, 32 * 1024);
totrim = kmalloc(sizeof(struct range2trim) * range_cnt, GFP_NOFS);
if (totrim == NULL) {
jfs_error(bmp->db_ipbmap->i_sb,
Expand Down

0 comments on commit 5e9f83e

Please sign in to comment.