Commit 20ac875e authored by Nathan Scott's avatar Nathan Scott

[XFS] Add back the pagebuf flag for scheduling on the data daemon. Moving

this into just a pagebuf_iodone parameter was broken as we don't have
sufficient state in all the places we need it to make the decision.

SGI Modid: 2.5.x-xfs:slinx:141626a
parent 8db329e8
...@@ -78,6 +78,7 @@ xfs_unwritten_conv( ...@@ -78,6 +78,7 @@ xfs_unwritten_conv(
XFS_BUF_OFFSET(bp), XFS_BUF_SIZE(bp)); XFS_BUF_OFFSET(bp), XFS_BUF_SIZE(bp));
XFS_BUF_SET_FSPRIVATE(bp, NULL); XFS_BUF_SET_FSPRIVATE(bp, NULL);
XFS_BUF_CLR_IODONE_FUNC(bp); XFS_BUF_CLR_IODONE_FUNC(bp);
XFS_BUF_UNDATAIO(bp);
xfs_biodone(bp); xfs_biodone(bp);
} }
...@@ -431,6 +432,7 @@ map_unwritten( ...@@ -431,6 +432,7 @@ map_unwritten(
size = nblocks; /* NB: using 64bit number here */ size = nblocks; /* NB: using 64bit number here */
size <<= block_bits; /* convert fsb's to byte range */ size <<= block_bits; /* convert fsb's to byte range */
XFS_BUF_DATAIO(pb);
XFS_BUF_SET_SIZE(pb, size); XFS_BUF_SET_SIZE(pb, size);
XFS_BUF_SET_OFFSET(pb, offset); XFS_BUF_SET_OFFSET(pb, offset);
XFS_BUF_SET_FSPRIVATE(pb, LINVFS_GET_VP(inode)->v_fbhv); XFS_BUF_SET_FSPRIVATE(pb, LINVFS_GET_VP(inode)->v_fbhv);
......
...@@ -1290,7 +1290,7 @@ bio_end_io_pagebuf( ...@@ -1290,7 +1290,7 @@ bio_end_io_pagebuf(
if (atomic_dec_and_test(&pb->pb_io_remaining) == 1) { if (atomic_dec_and_test(&pb->pb_io_remaining) == 1) {
pb->pb_locked = 0; pb->pb_locked = 0;
pagebuf_iodone(pb, 0, 1); pagebuf_iodone(pb, (pb->pb_flags & PBF_FS_DATAIOD), 1);
} }
bio_put(bio); bio_put(bio);
...@@ -1434,7 +1434,7 @@ pagebuf_iorequest( /* start real I/O */ ...@@ -1434,7 +1434,7 @@ pagebuf_iorequest( /* start real I/O */
if (atomic_dec_and_test(&pb->pb_io_remaining) == 1) { if (atomic_dec_and_test(&pb->pb_io_remaining) == 1) {
pb->pb_locked = 0; pb->pb_locked = 0;
pagebuf_iodone(pb, 0, 0); pagebuf_iodone(pb, (pb->pb_flags & PBF_FS_DATAIOD), 1);
} }
return 0; return 0;
......
...@@ -96,6 +96,7 @@ typedef enum page_buf_flags_e { /* pb_flags values */ ...@@ -96,6 +96,7 @@ typedef enum page_buf_flags_e { /* pb_flags values */
PBF_MAPPABLE = (1 << 9),/* use directly-addressable pages */ PBF_MAPPABLE = (1 << 9),/* use directly-addressable pages */
PBF_STALE = (1 << 10), /* buffer has been staled, do not find it */ PBF_STALE = (1 << 10), /* buffer has been staled, do not find it */
PBF_FS_MANAGED = (1 << 11), /* filesystem controls freeing memory */ PBF_FS_MANAGED = (1 << 11), /* filesystem controls freeing memory */
PBF_FS_DATAIOD = (1 << 12), /* schedule IO completion on fs datad */
/* flags used only as arguments to access routines */ /* flags used only as arguments to access routines */
PBF_LOCK = (1 << 13), /* lock requested */ PBF_LOCK = (1 << 13), /* lock requested */
......
...@@ -124,6 +124,9 @@ typedef struct page_buf_s xfs_buf_t; ...@@ -124,6 +124,9 @@ typedef struct page_buf_s xfs_buf_t;
typedef struct pb_target xfs_buftarg_t; typedef struct pb_target xfs_buftarg_t;
#define xfs_buftarg pb_target #define xfs_buftarg pb_target
#define XFS_BUF_DATAIO(x) ((x)->pb_flags |= PBF_FS_DATAIOD)
#define XFS_BUF_UNDATAIO(x) ((x)->pb_flags &= ~PBF_FS_DATAIOD)
#define XFS_BUF_IODONE_FUNC(buf) (buf)->pb_iodone #define XFS_BUF_IODONE_FUNC(buf) (buf)->pb_iodone
#define XFS_BUF_SET_IODONE_FUNC(buf, func) \ #define XFS_BUF_SET_IODONE_FUNC(buf, func) \
(buf)->pb_iodone = (func) (buf)->pb_iodone = (func)
...@@ -244,7 +247,7 @@ static inline void xfs_buf_relse(page_buf_t *bp) ...@@ -244,7 +247,7 @@ static inline void xfs_buf_relse(page_buf_t *bp)
#define xfs_biodone(pb) \ #define xfs_biodone(pb) \
pagebuf_iodone(pb, 0, 0) pagebuf_iodone(pb, (pb->pb_flags & PBF_FS_DATAIOD), 0)
#define xfs_incore(buftarg,blkno,len,lockit) \ #define xfs_incore(buftarg,blkno,len,lockit) \
pagebuf_find(buftarg, blkno ,len, lockit) pagebuf_find(buftarg, blkno ,len, lockit)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment