Merge git://oss.sgi.com:8090/oss/git/xfs-2.6

+31 -38
+6 -7
fs/xfs/linux-2.6/xfs_aops.c
··· 941 int retpbbm = 1; 942 int error; 943 944 - if (blocks) { 945 - offset = blocks << inode->i_blkbits; /* 64 bit goodness */ 946 - size = (ssize_t) min_t(xfs_off_t, offset, LONG_MAX); 947 - } else { 948 - size = 1 << inode->i_blkbits; 949 - } 950 offset = (xfs_off_t)iblock << inode->i_blkbits; 951 952 VOP_BMAP(vp, offset, size, 953 create ? flags : BMAPI_READ, &iomap, &retpbbm, error); ··· 1006 ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0); 1007 offset = min_t(xfs_off_t, 1008 iomap.iomap_bsize - iomap.iomap_delta, 1009 - blocks << inode->i_blkbits); 1010 bh_result->b_size = (u32) min_t(xfs_off_t, UINT_MAX, offset); 1011 } 1012
··· 941 int retpbbm = 1; 942 int error; 943 944 offset = (xfs_off_t)iblock << inode->i_blkbits; 945 + if (blocks) 946 + size = (ssize_t) min_t(xfs_off_t, LONG_MAX, 947 + (xfs_off_t)blocks << inode->i_blkbits); 948 + else 949 + size = 1 << inode->i_blkbits; 950 951 VOP_BMAP(vp, offset, size, 952 create ? flags : BMAPI_READ, &iomap, &retpbbm, error); ··· 1007 ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0); 1008 offset = min_t(xfs_off_t, 1009 iomap.iomap_bsize - iomap.iomap_delta, 1010 + (xfs_off_t)blocks << inode->i_blkbits); 1011 bh_result->b_size = (u32) min_t(xfs_off_t, UINT_MAX, offset); 1012 } 1013
+8 -3
fs/xfs/xfs_attr_leaf.c
··· 310 * Fix up the start offset of the attribute fork 311 */ 312 totsize -= size; 313 - if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname) { 314 /* 315 * Last attribute now removed, revert to original 316 * inode format making all literal area available ··· 329 xfs_idata_realloc(dp, -size, XFS_ATTR_FORK); 330 dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize); 331 ASSERT(dp->i_d.di_forkoff); 332 - ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname); 333 dp->i_afp->if_ext_max = 334 XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t); 335 dp->i_df.if_ext_max = ··· 739 + name_loc->namelen 740 + INT_GET(name_loc->valuelen, ARCH_CONVERT); 741 } 742 - if (bytes == sizeof(struct xfs_attr_sf_hdr)) 743 return(-1); 744 return(xfs_attr_shortform_bytesfit(dp, bytes)); 745 } ··· 778 goto out; 779 780 if (forkoff == -1) { 781 /* 782 * Last attribute was removed, revert to original 783 * inode format making all literal area available
··· 310 * Fix up the start offset of the attribute fork 311 */ 312 totsize -= size; 313 + if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname && 314 + !(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) { 315 /* 316 * Last attribute now removed, revert to original 317 * inode format making all literal area available ··· 328 xfs_idata_realloc(dp, -size, XFS_ATTR_FORK); 329 dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize); 330 ASSERT(dp->i_d.di_forkoff); 331 + ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname || 332 + (mp->m_flags & XFS_MOUNT_COMPAT_ATTR)); 333 dp->i_afp->if_ext_max = 334 XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t); 335 dp->i_df.if_ext_max = ··· 737 + name_loc->namelen 738 + INT_GET(name_loc->valuelen, ARCH_CONVERT); 739 } 740 + if (!(dp->i_mount->m_flags & XFS_MOUNT_COMPAT_ATTR) && 741 + (bytes == sizeof(struct xfs_attr_sf_hdr))) 742 return(-1); 743 return(xfs_attr_shortform_bytesfit(dp, bytes)); 744 } ··· 775 goto out; 776 777 if (forkoff == -1) { 778 + ASSERT(!(dp->i_mount->m_flags & XFS_MOUNT_COMPAT_ATTR)); 779 + 780 /* 781 * Last attribute was removed, revert to original 782 * inode format making all literal area available
+1 -1
fs/xfs/xfs_fsops.c
··· 550 struct vfs *vfsp = XFS_MTOVFS(mp); 551 struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev); 552 553 - if (sb) { 554 xfs_force_shutdown(mp, XFS_FORCE_UMOUNT); 555 thaw_bdev(sb->s_bdev, sb); 556 }
··· 550 struct vfs *vfsp = XFS_MTOVFS(mp); 551 struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev); 552 553 + if (sb && !IS_ERR(sb)) { 554 xfs_force_shutdown(mp, XFS_FORCE_UMOUNT); 555 thaw_bdev(sb->s_bdev, sb); 556 }
+1 -1
fs/xfs/xfs_iomap.h
··· 69 xfs_buftarg_t *iomap_target; 70 xfs_off_t iomap_offset; /* offset of mapping, bytes */ 71 xfs_off_t iomap_bsize; /* size of mapping, bytes */ 72 - size_t iomap_delta; /* offset into mapping, bytes */ 73 iomap_flags_t iomap_flags; 74 } xfs_iomap_t; 75
··· 69 xfs_buftarg_t *iomap_target; 70 xfs_off_t iomap_offset; /* offset of mapping, bytes */ 71 xfs_off_t iomap_bsize; /* size of mapping, bytes */ 72 + xfs_off_t iomap_delta; /* offset into mapping, bytes */ 73 iomap_flags_t iomap_flags; 74 } xfs_iomap_t; 75
+12 -24
fs/xfs/xfs_log_priv.h
··· 494 495 #define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR) 496 497 - #define XLOG_GRANT_SUB_SPACE(log,bytes,type) \ 498 - xlog_grant_sub_space(log,bytes,type) 499 - static inline void xlog_grant_sub_space(struct log *log, int bytes, int type) 500 - { 501 if (type == 'w') { \ 502 (log)->l_grant_write_bytes -= (bytes); \ 503 if ((log)->l_grant_write_bytes < 0) { \ ··· 509 (log)->l_grant_reserve_cycle--; \ 510 } \ 511 } \ 512 - } 513 - 514 - #define XLOG_GRANT_ADD_SPACE(log,bytes,type) \ 515 - xlog_grant_add_space(log,bytes,type) 516 - static inline void 517 - xlog_grant_add_space(struct log *log, int bytes, int type) 518 - { 519 if (type == 'w') { \ 520 (log)->l_grant_write_bytes += (bytes); \ 521 if ((log)->l_grant_write_bytes > (log)->l_logsize) { \ ··· 525 (log)->l_grant_reserve_cycle++; \ 526 } \ 527 } \ 528 - } 529 - 530 - #define XLOG_INS_TICKETQ(q, tic) xlog_ins_ticketq(q, tic) 531 - static inline void 532 - xlog_ins_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic) 533 - { \ 534 if (q) { \ 535 (tic)->t_next = (q); \ 536 (tic)->t_prev = (q)->t_prev; \ ··· 538 (q) = (tic); \ 539 } \ 540 (tic)->t_flags |= XLOG_TIC_IN_Q; \ 541 - } 542 - 543 - #define XLOG_DEL_TICKETQ(q, tic) xlog_del_ticketq(q, tic) 544 - static inline void 545 - xlog_del_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic) 546 - { \ 547 if ((tic) == (tic)->t_next) { \ 548 (q) = NULL; \ 549 } else { \ ··· 550 } \ 551 (tic)->t_next = (tic)->t_prev = NULL; \ 552 (tic)->t_flags &= ~XLOG_TIC_IN_Q; \ 553 - } 554 555 /* common routines */ 556 extern xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp);
··· 494 495 #define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR) 496 497 + #define XLOG_GRANT_SUB_SPACE(log,bytes,type) \ 498 + { \ 499 if (type == 'w') { \ 500 (log)->l_grant_write_bytes -= (bytes); \ 501 if ((log)->l_grant_write_bytes < 0) { \ ··· 511 (log)->l_grant_reserve_cycle--; \ 512 } \ 513 } \ 514 + } 515 + #define XLOG_GRANT_ADD_SPACE(log,bytes,type) \ 516 + { \ 517 if (type == 'w') { \ 518 (log)->l_grant_write_bytes += (bytes); \ 519 if ((log)->l_grant_write_bytes > (log)->l_logsize) { \ ··· 531 (log)->l_grant_reserve_cycle++; \ 532 } \ 533 } \ 534 + } 535 + #define XLOG_INS_TICKETQ(q, tic) \ 536 + { \ 537 if (q) { \ 538 (tic)->t_next = (q); \ 539 (tic)->t_prev = (q)->t_prev; \ ··· 547 (q) = (tic); \ 548 } \ 549 (tic)->t_flags |= XLOG_TIC_IN_Q; \ 550 + } 551 + #define XLOG_DEL_TICKETQ(q, tic) \ 552 + { \ 553 if ((tic) == (tic)->t_next) { \ 554 (q) = NULL; \ 555 } else { \ ··· 562 } \ 563 (tic)->t_next = (tic)->t_prev = NULL; \ 564 (tic)->t_flags &= ~XLOG_TIC_IN_Q; \ 565 + } 566 567 /* common routines */ 568 extern xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp);
+3 -2
fs/xfs/xfs_vnodeops.c
··· 3958 } 3959 } 3960 XFS_MOUNT_IUNLOCK(mp); 3961 - xfs_finish_reclaim(ip, noblock, 3962 - XFS_IFLUSH_DELWRI_ELSE_ASYNC); 3963 purged = 1; 3964 break; 3965 }
··· 3958 } 3959 } 3960 XFS_MOUNT_IUNLOCK(mp); 3961 + if (xfs_finish_reclaim(ip, noblock, 3962 + XFS_IFLUSH_DELWRI_ELSE_ASYNC)) 3963 + delay(1); 3964 purged = 1; 3965 break; 3966 }