Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6

* 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6:
[XFS] Put the correct offset in dirent d_off
[XFS] Don't wait for pending I/Os when purging blocks beyond eof.

+12 -15
+2 -2
fs/xfs/linux-2.6/xfs_file.c
··· 356 356 357 357 reclen = sizeof(struct hack_dirent) + de->namlen; 358 358 size -= reclen; 359 - curr_offset = de->offset /* & 0x7fffffff */; 360 359 de = (struct hack_dirent *)((char *)de + reclen); 360 + curr_offset = de->offset /* & 0x7fffffff */; 361 361 } 362 362 } 363 363 364 364 done: 365 - if (!error) { 365 + if (!error) { 366 366 if (size == 0) 367 367 filp->f_pos = offset & 0x7fffffff; 368 368 else if (de)
+2 -4
fs/xfs/xfs_dir2_block.c
··· 508 508 continue; 509 509 510 510 cook = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk, 511 - ptr - (char *)block); 511 + (char *)dep - (char *)block); 512 512 ino = be64_to_cpu(dep->inumber); 513 513 #if XFS_BIG_INUMS 514 514 ino += mp->m_inoadd; ··· 519 519 */ 520 520 if (filldir(dirent, dep->name, dep->namelen, cook, 521 521 ino, DT_UNKNOWN)) { 522 - *offset = xfs_dir2_db_off_to_dataptr(mp, 523 - mp->m_dirdatablk, 524 - (char *)dep - (char *)block); 522 + *offset = cook; 525 523 xfs_da_brelse(NULL, bp); 526 524 return 0; 527 525 }
+1 -1
fs/xfs/xfs_dir2_leaf.c
··· 1091 1091 * Won't fit. Return to caller. 1092 1092 */ 1093 1093 if (filldir(dirent, dep->name, dep->namelen, 1094 - xfs_dir2_byte_to_dataptr(mp, curoff + length), 1094 + xfs_dir2_byte_to_dataptr(mp, curoff), 1095 1095 ino, DT_UNKNOWN)) 1096 1096 break; 1097 1097
+3 -6
fs/xfs/xfs_dir2_sf.c
··· 752 752 #if XFS_BIG_INUMS 753 753 ino += mp->m_inoadd; 754 754 #endif 755 - if (filldir(dirent, ".", 1, dotdot_offset, ino, DT_DIR)) { 755 + if (filldir(dirent, ".", 1, dot_offset, ino, DT_DIR)) { 756 756 *offset = dot_offset; 757 757 return 0; 758 758 } ··· 762 762 * Put .. entry unless we're starting past it. 763 763 */ 764 764 if (*offset <= dotdot_offset) { 765 - off = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk, 766 - XFS_DIR2_DATA_FIRST_OFFSET); 767 765 ino = xfs_dir2_sf_get_inumber(sfp, &sfp->hdr.parent); 768 766 #if XFS_BIG_INUMS 769 767 ino += mp->m_inoadd; 770 768 #endif 771 - if (filldir(dirent, "..", 2, off, ino, DT_DIR)) { 769 + if (filldir(dirent, "..", 2, dotdot_offset, ino, DT_DIR)) { 772 770 *offset = dotdot_offset; 773 771 return 0; 774 772 } ··· 791 793 #endif 792 794 793 795 if (filldir(dirent, sfep->name, sfep->namelen, 794 - off + xfs_dir2_data_entsize(sfep->namelen), 795 - ino, DT_UNKNOWN)) { 796 + off, ino, DT_UNKNOWN)) { 796 797 *offset = off; 797 798 return 0; 798 799 }
+4 -2
fs/xfs/xfs_inode.c
··· 1459 1459 mp = ip->i_mount; 1460 1460 vp = XFS_ITOV(ip); 1461 1461 1462 - vn_iowait(ip); /* wait for the completion of any pending DIOs */ 1463 - 1462 + /* wait for the completion of any pending DIOs */ 1463 + if (new_size < ip->i_size) 1464 + vn_iowait(ip); 1465 + 1464 1466 /* 1465 1467 * Call toss_pages or flushinval_pages to get rid of pages 1466 1468 * overlapping the region being removed. We have to use