diff options
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_aops.c | 6 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 8 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 52 |
3 files changed, 46 insertions, 20 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 120626789406..74d8be87f983 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
@@ -540,7 +540,7 @@ xfs_probe_cluster( | |||
540 | 540 | ||
541 | /* First sum forwards in this page */ | 541 | /* First sum forwards in this page */ |
542 | do { | 542 | do { |
543 | if (mapped != buffer_mapped(bh)) | 543 | if (!buffer_uptodate(bh) || (mapped != buffer_mapped(bh))) |
544 | return total; | 544 | return total; |
545 | total += bh->b_size; | 545 | total += bh->b_size; |
546 | } while ((bh = bh->b_this_page) != head); | 546 | } while ((bh = bh->b_this_page) != head); |
@@ -747,10 +747,11 @@ xfs_convert_page( | |||
747 | struct backing_dev_info *bdi; | 747 | struct backing_dev_info *bdi; |
748 | 748 | ||
749 | bdi = inode->i_mapping->backing_dev_info; | 749 | bdi = inode->i_mapping->backing_dev_info; |
750 | wbc->nr_to_write--; | ||
750 | if (bdi_write_congested(bdi)) { | 751 | if (bdi_write_congested(bdi)) { |
751 | wbc->encountered_congestion = 1; | 752 | wbc->encountered_congestion = 1; |
752 | done = 1; | 753 | done = 1; |
753 | } else if (--wbc->nr_to_write <= 0) { | 754 | } else if (wbc->nr_to_write <= 0) { |
754 | done = 1; | 755 | done = 1; |
755 | } | 756 | } |
756 | } | 757 | } |
@@ -1462,4 +1463,5 @@ struct address_space_operations linvfs_aops = { | |||
1462 | .commit_write = generic_commit_write, | 1463 | .commit_write = generic_commit_write, |
1463 | .bmap = linvfs_bmap, | 1464 | .bmap = linvfs_bmap, |
1464 | .direct_IO = linvfs_direct_IO, | 1465 | .direct_IO = linvfs_direct_IO, |
1466 | .migratepage = buffer_migrate_page, | ||
1465 | }; | 1467 | }; |
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index e44b7c1a3a36..bfb4f2917bb6 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -822,6 +822,13 @@ xfs_buf_rele( | |||
822 | 822 | ||
823 | XB_TRACE(bp, "rele", bp->b_relse); | 823 | XB_TRACE(bp, "rele", bp->b_relse); |
824 | 824 | ||
825 | if (unlikely(!hash)) { | ||
826 | ASSERT(!bp->b_relse); | ||
827 | if (atomic_dec_and_test(&bp->b_hold)) | ||
828 | xfs_buf_free(bp); | ||
829 | return; | ||
830 | } | ||
831 | |||
825 | if (atomic_dec_and_lock(&bp->b_hold, &hash->bh_lock)) { | 832 | if (atomic_dec_and_lock(&bp->b_hold, &hash->bh_lock)) { |
826 | if (bp->b_relse) { | 833 | if (bp->b_relse) { |
827 | atomic_inc(&bp->b_hold); | 834 | atomic_inc(&bp->b_hold); |
@@ -1514,6 +1521,7 @@ xfs_mapping_buftarg( | |||
1514 | struct address_space *mapping; | 1521 | struct address_space *mapping; |
1515 | static struct address_space_operations mapping_aops = { | 1522 | static struct address_space_operations mapping_aops = { |
1516 | .sync_page = block_sync_page, | 1523 | .sync_page = block_sync_page, |
1524 | .migratepage = fail_migrate_page, | ||
1517 | }; | 1525 | }; |
1518 | 1526 | ||
1519 | inode = new_inode(bdev->bd_inode->i_sb); | 1527 | inode = new_inode(bdev->bd_inode->i_sb); |
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 76c6df34d0db..d7f6f2d8ac8e 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -262,6 +262,31 @@ has_fs_struct(struct task_struct *task) | |||
262 | return (task->fs != init_task.fs); | 262 | return (task->fs != init_task.fs); |
263 | } | 263 | } |
264 | 264 | ||
265 | STATIC inline void | ||
266 | cleanup_inode( | ||
267 | vnode_t *dvp, | ||
268 | vnode_t *vp, | ||
269 | struct dentry *dentry, | ||
270 | int mode) | ||
271 | { | ||
272 | struct dentry teardown = {}; | ||
273 | int err2; | ||
274 | |||
275 | /* Oh, the horror. | ||
276 | * If we can't add the ACL or we fail in | ||
277 | * linvfs_init_security we must back out. | ||
278 | * ENOSPC can hit here, among other things. | ||
279 | */ | ||
280 | teardown.d_inode = LINVFS_GET_IP(vp); | ||
281 | teardown.d_name = dentry->d_name; | ||
282 | |||
283 | if (S_ISDIR(mode)) | ||
284 | VOP_RMDIR(dvp, &teardown, NULL, err2); | ||
285 | else | ||
286 | VOP_REMOVE(dvp, &teardown, NULL, err2); | ||
287 | VN_RELE(vp); | ||
288 | } | ||
289 | |||
265 | STATIC int | 290 | STATIC int |
266 | linvfs_mknod( | 291 | linvfs_mknod( |
267 | struct inode *dir, | 292 | struct inode *dir, |
@@ -316,30 +341,19 @@ linvfs_mknod( | |||
316 | } | 341 | } |
317 | 342 | ||
318 | if (!error) | 343 | if (!error) |
344 | { | ||
319 | error = linvfs_init_security(vp, dir); | 345 | error = linvfs_init_security(vp, dir); |
346 | if (error) | ||
347 | cleanup_inode(dvp, vp, dentry, mode); | ||
348 | } | ||
320 | 349 | ||
321 | if (default_acl) { | 350 | if (default_acl) { |
322 | if (!error) { | 351 | if (!error) { |
323 | error = _ACL_INHERIT(vp, &va, default_acl); | 352 | error = _ACL_INHERIT(vp, &va, default_acl); |
324 | if (!error) { | 353 | if (!error) |
325 | VMODIFY(vp); | 354 | VMODIFY(vp); |
326 | } else { | 355 | else |
327 | struct dentry teardown = {}; | 356 | cleanup_inode(dvp, vp, dentry, mode); |
328 | int err2; | ||
329 | |||
330 | /* Oh, the horror. | ||
331 | * If we can't add the ACL we must back out. | ||
332 | * ENOSPC can hit here, among other things. | ||
333 | */ | ||
334 | teardown.d_inode = ip = LINVFS_GET_IP(vp); | ||
335 | teardown.d_name = dentry->d_name; | ||
336 | |||
337 | if (S_ISDIR(mode)) | ||
338 | VOP_RMDIR(dvp, &teardown, NULL, err2); | ||
339 | else | ||
340 | VOP_REMOVE(dvp, &teardown, NULL, err2); | ||
341 | VN_RELE(vp); | ||
342 | } | ||
343 | } | 357 | } |
344 | _ACL_FREE(default_acl); | 358 | _ACL_FREE(default_acl); |
345 | } | 359 | } |
@@ -659,6 +673,8 @@ linvfs_setattr( | |||
659 | if (ia_valid & ATTR_ATIME) { | 673 | if (ia_valid & ATTR_ATIME) { |
660 | vattr.va_mask |= XFS_AT_ATIME; | 674 | vattr.va_mask |= XFS_AT_ATIME; |
661 | vattr.va_atime = attr->ia_atime; | 675 | vattr.va_atime = attr->ia_atime; |
676 | if (ia_valid & ATTR_ATIME_SET) | ||
677 | inode->i_atime = attr->ia_atime; | ||
662 | } | 678 | } |
663 | if (ia_valid & ATTR_MTIME) { | 679 | if (ia_valid & ATTR_MTIME) { |
664 | vattr.va_mask |= XFS_AT_MTIME; | 680 | vattr.va_mask |= XFS_AT_MTIME; |