aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-16 16:29:39 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-16 16:29:39 -0500
commitbea4c899f2b5fad80099aea979780ef19f9b1987 (patch)
tree65130f4bc91b92e72498fc58bf895d35f2ebf0f2 /fs/xfs
parent73efc4681cb5e3c8807daf106f001e7f0798d8a0 (diff)
parent3fc98b1ac036675b95f6e3fafd5ef147b97d4d30 (diff)
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
* 'for-linus' of git://oss.sgi.com/xfs/xfs: XFS: Free buffer pages array unconditionally xfs: kill xfs_bmbt_rec_32/64 types xfs: improve metadata I/O merging in the elevator xfs: check for not fully initialized inodes in xfs_ireclaim
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c10
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.h1
-rw-r--r--fs/xfs/xfs_bmap_btree.h14
-rw-r--r--fs/xfs/xfs_iget.c12
-rw-r--r--fs/xfs/xfs_inode_item.h6
-rw-r--r--fs/xfs/xfs_log.c2
6 files changed, 24 insertions, 21 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index b4c7d4248aac..77b8be81c769 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -292,6 +292,7 @@ _xfs_buf_free_pages(
292{ 292{
293 if (bp->b_pages != bp->b_page_array) { 293 if (bp->b_pages != bp->b_page_array) {
294 kmem_free(bp->b_pages); 294 kmem_free(bp->b_pages);
295 bp->b_pages = NULL;
295 } 296 }
296} 297}
297 298
@@ -323,9 +324,8 @@ xfs_buf_free(
323 ASSERT(!PagePrivate(page)); 324 ASSERT(!PagePrivate(page));
324 page_cache_release(page); 325 page_cache_release(page);
325 } 326 }
326 _xfs_buf_free_pages(bp);
327 } 327 }
328 328 _xfs_buf_free_pages(bp);
329 xfs_buf_deallocate(bp); 329 xfs_buf_deallocate(bp);
330} 330}
331 331
@@ -1149,10 +1149,14 @@ _xfs_buf_ioapply(
1149 if (bp->b_flags & XBF_ORDERED) { 1149 if (bp->b_flags & XBF_ORDERED) {
1150 ASSERT(!(bp->b_flags & XBF_READ)); 1150 ASSERT(!(bp->b_flags & XBF_READ));
1151 rw = WRITE_BARRIER; 1151 rw = WRITE_BARRIER;
1152 } else if (bp->b_flags & _XBF_RUN_QUEUES) { 1152 } else if (bp->b_flags & XBF_LOG_BUFFER) {
1153 ASSERT(!(bp->b_flags & XBF_READ_AHEAD)); 1153 ASSERT(!(bp->b_flags & XBF_READ_AHEAD));
1154 bp->b_flags &= ~_XBF_RUN_QUEUES; 1154 bp->b_flags &= ~_XBF_RUN_QUEUES;
1155 rw = (bp->b_flags & XBF_WRITE) ? WRITE_SYNC : READ_SYNC; 1155 rw = (bp->b_flags & XBF_WRITE) ? WRITE_SYNC : READ_SYNC;
1156 } else if (bp->b_flags & _XBF_RUN_QUEUES) {
1157 ASSERT(!(bp->b_flags & XBF_READ_AHEAD));
1158 bp->b_flags &= ~_XBF_RUN_QUEUES;
1159 rw = (bp->b_flags & XBF_WRITE) ? WRITE_META : READ_META;
1156 } else { 1160 } else {
1157 rw = (bp->b_flags & XBF_WRITE) ? WRITE : 1161 rw = (bp->b_flags & XBF_WRITE) ? WRITE :
1158 (bp->b_flags & XBF_READ_AHEAD) ? READA : READ; 1162 (bp->b_flags & XBF_READ_AHEAD) ? READA : READ;
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h
index a509f4addc2a..a34c7b54822d 100644
--- a/fs/xfs/linux-2.6/xfs_buf.h
+++ b/fs/xfs/linux-2.6/xfs_buf.h
@@ -55,6 +55,7 @@ typedef enum {
55 XBF_FS_MANAGED = (1 << 8), /* filesystem controls freeing memory */ 55 XBF_FS_MANAGED = (1 << 8), /* filesystem controls freeing memory */
56 XBF_ORDERED = (1 << 11), /* use ordered writes */ 56 XBF_ORDERED = (1 << 11), /* use ordered writes */
57 XBF_READ_AHEAD = (1 << 12), /* asynchronous read-ahead */ 57 XBF_READ_AHEAD = (1 << 12), /* asynchronous read-ahead */
58 XBF_LOG_BUFFER = (1 << 13), /* this is a buffer used for the log */
58 59
59 /* flags used only as arguments to access routines */ 60 /* flags used only as arguments to access routines */
60 XBF_LOCK = (1 << 14), /* lock requested */ 61 XBF_LOCK = (1 << 14), /* lock requested */
diff --git a/fs/xfs/xfs_bmap_btree.h b/fs/xfs/xfs_bmap_btree.h
index 5549d495947f..cf07ca7c22e7 100644
--- a/fs/xfs/xfs_bmap_btree.h
+++ b/fs/xfs/xfs_bmap_btree.h
@@ -46,20 +46,12 @@ typedef struct xfs_bmdr_block {
46#define BMBT_STARTBLOCK_BITLEN 52 46#define BMBT_STARTBLOCK_BITLEN 52
47#define BMBT_BLOCKCOUNT_BITLEN 21 47#define BMBT_BLOCKCOUNT_BITLEN 21
48 48
49 49typedef struct xfs_bmbt_rec {
50#define BMBT_USE_64 1
51
52typedef struct xfs_bmbt_rec_32
53{
54 __uint32_t l0, l1, l2, l3;
55} xfs_bmbt_rec_32_t;
56typedef struct xfs_bmbt_rec_64
57{
58 __be64 l0, l1; 50 __be64 l0, l1;
59} xfs_bmbt_rec_64_t; 51} xfs_bmbt_rec_t;
60 52
61typedef __uint64_t xfs_bmbt_rec_base_t; /* use this for casts */ 53typedef __uint64_t xfs_bmbt_rec_base_t; /* use this for casts */
62typedef xfs_bmbt_rec_64_t xfs_bmbt_rec_t, xfs_bmdr_rec_t; 54typedef xfs_bmbt_rec_t xfs_bmdr_rec_t;
63 55
64typedef struct xfs_bmbt_rec_host { 56typedef struct xfs_bmbt_rec_host {
65 __uint64_t l0, l1; 57 __uint64_t l0, l1;
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index f5c904a10c11..0de36c2a46f1 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -478,17 +478,21 @@ xfs_ireclaim(
478{ 478{
479 struct xfs_mount *mp = ip->i_mount; 479 struct xfs_mount *mp = ip->i_mount;
480 struct xfs_perag *pag; 480 struct xfs_perag *pag;
481 xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ip->i_ino);
481 482
482 XFS_STATS_INC(xs_ig_reclaims); 483 XFS_STATS_INC(xs_ig_reclaims);
483 484
484 /* 485 /*
485 * Remove the inode from the per-AG radix tree. It doesn't matter 486 * Remove the inode from the per-AG radix tree.
486 * if it was never added to it because radix_tree_delete can deal 487 *
487 * with that case just fine. 488 * Because radix_tree_delete won't complain even if the item was never
489 * added to the tree assert that it's been there before to catch
490 * problems with the inode life time early on.
488 */ 491 */
489 pag = xfs_get_perag(mp, ip->i_ino); 492 pag = xfs_get_perag(mp, ip->i_ino);
490 write_lock(&pag->pag_ici_lock); 493 write_lock(&pag->pag_ici_lock);
491 radix_tree_delete(&pag->pag_ici_root, XFS_INO_TO_AGINO(mp, ip->i_ino)); 494 if (!radix_tree_delete(&pag->pag_ici_root, agino))
495 ASSERT(0);
492 write_unlock(&pag->pag_ici_lock); 496 write_unlock(&pag->pag_ici_lock);
493 xfs_put_perag(mp, pag); 497 xfs_put_perag(mp, pag);
494 498
diff --git a/fs/xfs/xfs_inode_item.h b/fs/xfs/xfs_inode_item.h
index 65bae4c9b8bf..cc8df1ac7783 100644
--- a/fs/xfs/xfs_inode_item.h
+++ b/fs/xfs/xfs_inode_item.h
@@ -127,7 +127,7 @@ static inline int xfs_ilog_fdata(int w)
127#ifdef __KERNEL__ 127#ifdef __KERNEL__
128 128
129struct xfs_buf; 129struct xfs_buf;
130struct xfs_bmbt_rec_64; 130struct xfs_bmbt_rec;
131struct xfs_inode; 131struct xfs_inode;
132struct xfs_mount; 132struct xfs_mount;
133 133
@@ -140,9 +140,9 @@ typedef struct xfs_inode_log_item {
140 unsigned short ili_flags; /* misc flags */ 140 unsigned short ili_flags; /* misc flags */
141 unsigned short ili_logged; /* flushed logged data */ 141 unsigned short ili_logged; /* flushed logged data */
142 unsigned int ili_last_fields; /* fields when flushed */ 142 unsigned int ili_last_fields; /* fields when flushed */
143 struct xfs_bmbt_rec_64 *ili_extents_buf; /* array of logged 143 struct xfs_bmbt_rec *ili_extents_buf; /* array of logged
144 data exts */ 144 data exts */
145 struct xfs_bmbt_rec_64 *ili_aextents_buf; /* array of logged 145 struct xfs_bmbt_rec *ili_aextents_buf; /* array of logged
146 attr exts */ 146 attr exts */
147 unsigned int ili_pushbuf_flag; /* one bit used in push_ail */ 147 unsigned int ili_pushbuf_flag; /* one bit used in push_ail */
148 148
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 4cb1792040e3..600b5b06aaeb 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1441,6 +1441,7 @@ xlog_sync(xlog_t *log,
1441 XFS_BUF_ZEROFLAGS(bp); 1441 XFS_BUF_ZEROFLAGS(bp);
1442 XFS_BUF_BUSY(bp); 1442 XFS_BUF_BUSY(bp);
1443 XFS_BUF_ASYNC(bp); 1443 XFS_BUF_ASYNC(bp);
1444 bp->b_flags |= XBF_LOG_BUFFER;
1444 /* 1445 /*
1445 * Do an ordered write for the log block. 1446 * Do an ordered write for the log block.
1446 * Its unnecessary to flush the first split block in the log wrap case. 1447 * Its unnecessary to flush the first split block in the log wrap case.
@@ -1478,6 +1479,7 @@ xlog_sync(xlog_t *log,
1478 XFS_BUF_ZEROFLAGS(bp); 1479 XFS_BUF_ZEROFLAGS(bp);
1479 XFS_BUF_BUSY(bp); 1480 XFS_BUF_BUSY(bp);
1480 XFS_BUF_ASYNC(bp); 1481 XFS_BUF_ASYNC(bp);
1482 bp->b_flags |= XBF_LOG_BUFFER;
1481 if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) 1483 if (log->l_mp->m_flags & XFS_MOUNT_BARRIER)
1482 XFS_BUF_ORDERED(bp); 1484 XFS_BUF_ORDERED(bp);
1483 dptr = XFS_BUF_PTR(bp); 1485 dptr = XFS_BUF_PTR(bp);