aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c114
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c14
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.h9
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c4
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c6
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c5
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c71
-rw-r--r--fs/xfs/linux-2.6/xfs_sync.c15
-rw-r--r--fs/xfs/linux-2.6/xfs_sync.h1
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h1
-rw-r--r--fs/xfs/support/debug.h18
-rw-r--r--fs/xfs/xfs_attr.c16
-rw-r--r--fs/xfs/xfs_attr.h1
-rw-r--r--fs/xfs/xfs_attr_leaf.c2
-rw-r--r--fs/xfs/xfs_bmap_btree.c3
-rw-r--r--fs/xfs/xfs_filestream.h8
-rw-r--r--fs/xfs/xfs_fsops.c25
-rw-r--r--fs/xfs/xfs_ialloc.c2
-rw-r--r--fs/xfs/xfs_iget.c5
-rw-r--r--fs/xfs/xfs_iomap.c9
-rw-r--r--fs/xfs/xfs_log_recover.c40
-rw-r--r--fs/xfs/xfs_mount.c18
-rw-r--r--fs/xfs/xfs_mount.h27
-rw-r--r--fs/xfs/xfs_rw.c30
-rw-r--r--fs/xfs/xfs_rw.h29
-rw-r--r--fs/xfs/xfs_trans.c7
-rw-r--r--fs/xfs/xfs_trans.h2
-rw-r--r--fs/xfs/xfs_trans_buf.c13
-rw-r--r--fs/xfs/xfs_vnodeops.c79
-rw-r--r--fs/xfs/xfs_vnodeops.h1
30 files changed, 254 insertions, 321 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 70f989895d15..87813e405cef 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -235,71 +235,36 @@ xfs_setfilesize(
235} 235}
236 236
237/* 237/*
238 * Buffered IO write completion for delayed allocate extents. 238 * IO write completion.
239 */ 239 */
240STATIC void 240STATIC void
241xfs_end_bio_delalloc( 241xfs_end_io(
242 struct work_struct *work)
243{
244 xfs_ioend_t *ioend =
245 container_of(work, xfs_ioend_t, io_work);
246
247 xfs_setfilesize(ioend);
248 xfs_destroy_ioend(ioend);
249}
250
251/*
252 * Buffered IO write completion for regular, written extents.
253 */
254STATIC void
255xfs_end_bio_written(
256 struct work_struct *work)
257{
258 xfs_ioend_t *ioend =
259 container_of(work, xfs_ioend_t, io_work);
260
261 xfs_setfilesize(ioend);
262 xfs_destroy_ioend(ioend);
263}
264
265/*
266 * IO write completion for unwritten extents.
267 *
268 * Issue transactions to convert a buffer range from unwritten
269 * to written extents.
270 */
271STATIC void
272xfs_end_bio_unwritten(
273 struct work_struct *work) 242 struct work_struct *work)
274{ 243{
275 xfs_ioend_t *ioend = 244 xfs_ioend_t *ioend =
276 container_of(work, xfs_ioend_t, io_work); 245 container_of(work, xfs_ioend_t, io_work);
277 struct xfs_inode *ip = XFS_I(ioend->io_inode); 246 struct xfs_inode *ip = XFS_I(ioend->io_inode);
278 xfs_off_t offset = ioend->io_offset;
279 size_t size = ioend->io_size;
280
281 if (likely(!ioend->io_error)) {
282 if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) {
283 int error;
284 error = xfs_iomap_write_unwritten(ip, offset, size);
285 if (error)
286 ioend->io_error = error;
287 }
288 xfs_setfilesize(ioend);
289 }
290 xfs_destroy_ioend(ioend);
291}
292 247
293/* 248 /*
294 * IO read completion for regular, written extents. 249 * For unwritten extents we need to issue transactions to convert a
295 */ 250 * range to normal written extens after the data I/O has finished.
296STATIC void 251 */
297xfs_end_bio_read( 252 if (ioend->io_type == IOMAP_UNWRITTEN &&
298 struct work_struct *work) 253 likely(!ioend->io_error && !XFS_FORCED_SHUTDOWN(ip->i_mount))) {
299{ 254 int error;
300 xfs_ioend_t *ioend = 255
301 container_of(work, xfs_ioend_t, io_work); 256 error = xfs_iomap_write_unwritten(ip, ioend->io_offset,
257 ioend->io_size);
258 if (error)
259 ioend->io_error = error;
260 }
302 261
262 /*
263 * We might have to update the on-disk file size after extending
264 * writes.
265 */
266 if (ioend->io_type != IOMAP_READ)
267 xfs_setfilesize(ioend);
303 xfs_destroy_ioend(ioend); 268 xfs_destroy_ioend(ioend);
304} 269}
305 270
@@ -314,10 +279,10 @@ xfs_finish_ioend(
314 int wait) 279 int wait)
315{ 280{
316 if (atomic_dec_and_test(&ioend->io_remaining)) { 281 if (atomic_dec_and_test(&ioend->io_remaining)) {
317 struct workqueue_struct *wq = xfsdatad_workqueue; 282 struct workqueue_struct *wq;
318 if (ioend->io_work.func == xfs_end_bio_unwritten)
319 wq = xfsconvertd_workqueue;
320 283
284 wq = (ioend->io_type == IOMAP_UNWRITTEN) ?
285 xfsconvertd_workqueue : xfsdatad_workqueue;
321 queue_work(wq, &ioend->io_work); 286 queue_work(wq, &ioend->io_work);
322 if (wait) 287 if (wait)
323 flush_workqueue(wq); 288 flush_workqueue(wq);
@@ -355,15 +320,7 @@ xfs_alloc_ioend(
355 ioend->io_offset = 0; 320 ioend->io_offset = 0;
356 ioend->io_size = 0; 321 ioend->io_size = 0;
357 322
358 if (type == IOMAP_UNWRITTEN) 323 INIT_WORK(&ioend->io_work, xfs_end_io);
359 INIT_WORK(&ioend->io_work, xfs_end_bio_unwritten);
360 else if (type == IOMAP_DELAY)
361 INIT_WORK(&ioend->io_work, xfs_end_bio_delalloc);
362 else if (type == IOMAP_READ)
363 INIT_WORK(&ioend->io_work, xfs_end_bio_read);
364 else
365 INIT_WORK(&ioend->io_work, xfs_end_bio_written);
366
367 return ioend; 324 return ioend;
368} 325}
369 326
@@ -380,7 +337,7 @@ xfs_map_blocks(
380 return -xfs_iomap(XFS_I(inode), offset, count, flags, mapp, &nmaps); 337 return -xfs_iomap(XFS_I(inode), offset, count, flags, mapp, &nmaps);
381} 338}
382 339
383STATIC_INLINE int 340STATIC int
384xfs_iomap_valid( 341xfs_iomap_valid(
385 xfs_iomap_t *iomapp, 342 xfs_iomap_t *iomapp,
386 loff_t offset) 343 loff_t offset)
@@ -412,8 +369,9 @@ xfs_end_bio(
412 369
413STATIC void 370STATIC void
414xfs_submit_ioend_bio( 371xfs_submit_ioend_bio(
415 xfs_ioend_t *ioend, 372 struct writeback_control *wbc,
416 struct bio *bio) 373 xfs_ioend_t *ioend,
374 struct bio *bio)
417{ 375{
418 atomic_inc(&ioend->io_remaining); 376 atomic_inc(&ioend->io_remaining);
419 bio->bi_private = ioend;