aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-11-25 12:33:53 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-25 12:33:53 -0500
commit4ad5bd25683ae3a913efb7d5afb7ddf2b2ef09db (patch)
tree6c862858201bc45444497265ccfa39e9f43d5819
parentcd0cca7bf5e201dcea5632f78ad9b37cb419a5df (diff)
parent551c81e2d32c5867fb592091365d8c37e1509dce (diff)
Merge git://oss.sgi.com:8090/oss/git/xfs-2.6
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c13
-rw-r--r--fs/xfs/xfs_attr_leaf.c11
-rw-r--r--fs/xfs/xfs_fsops.c2
-rw-r--r--fs/xfs/xfs_iomap.h2
-rw-r--r--fs/xfs/xfs_log_priv.h36
-rw-r--r--fs/xfs/xfs_vnodeops.c5
6 files changed, 31 insertions, 38 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index c6108971b4e6..94d3cdfbf9b8 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -941,13 +941,12 @@ __linvfs_get_block(
941 int retpbbm = 1; 941 int retpbbm = 1;
942 int error; 942 int error;
943 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; 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;
951 950
952 VOP_BMAP(vp, offset, size, 951 VOP_BMAP(vp, offset, size,
953 create ? flags : BMAPI_READ, &iomap, &retpbbm, error); 952 create ? flags : BMAPI_READ, &iomap, &retpbbm, error);
@@ -1007,7 +1006,7 @@ __linvfs_get_block(
1007 ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0); 1006 ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0);
1008 offset = min_t(xfs_off_t, 1007 offset = min_t(xfs_off_t,
1009 iomap.iomap_bsize - iomap.iomap_delta, 1008 iomap.iomap_bsize - iomap.iomap_delta,
1010 blocks << inode->i_blkbits); 1009 (xfs_off_t)blocks << inode->i_blkbits);
1011 bh_result->b_size = (u32) min_t(xfs_off_t, UINT_MAX, offset); 1010 bh_result->b_size = (u32) min_t(xfs_off_t, UINT_MAX, offset);
1012 } 1011 }
1013 1012
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
index 35e557b00db2..1c7421840c18 100644
--- a/fs/xfs/xfs_attr_leaf.c
+++ b/fs/xfs/xfs_attr_leaf.c
@@ -310,7 +310,8 @@ xfs_attr_shortform_remove(xfs_da_args_t *args)
310 * Fix up the start offset of the attribute fork 310 * Fix up the start offset of the attribute fork
311 */ 311 */
312 totsize -= size; 312 totsize -= size;
313 if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname) { 313 if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname &&
314 !(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) {
314 /* 315 /*
315 * Last attribute now removed, revert to original 316 * Last attribute now removed, revert to original
316 * inode format making all literal area available 317 * inode format making all literal area available
@@ -328,7 +329,8 @@ xfs_attr_shortform_remove(xfs_da_args_t *args)
328 xfs_idata_realloc(dp, -size, XFS_ATTR_FORK); 329 xfs_idata_realloc(dp, -size, XFS_ATTR_FORK);
329 dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize); 330 dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize);
330 ASSERT(dp->i_d.di_forkoff); 331 ASSERT(dp->i_d.di_forkoff);
331 ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname); 332 ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname ||
333 (mp->m_flags & XFS_MOUNT_COMPAT_ATTR));
332 dp->i_afp->if_ext_max = 334 dp->i_afp->if_ext_max =
333 XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t); 335 XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t);
334 dp->i_df.if_ext_max = 336 dp->i_df.if_ext_max =
@@ -737,7 +739,8 @@ xfs_attr_shortform_allfit(xfs_dabuf_t *bp, xfs_inode_t *dp)
737 + name_loc->namelen 739 + name_loc->namelen
738 + INT_GET(name_loc->valuelen, ARCH_CONVERT); 740 + INT_GET(name_loc->valuelen, ARCH_CONVERT);
739 } 741 }
740 if (bytes == sizeof(struct xfs_attr_sf_hdr)) 742 if (!(dp->i_mount->m_flags & XFS_MOUNT_COMPAT_ATTR) &&
743 (bytes == sizeof(struct xfs_attr_sf_hdr)))
741 return(-1); 744 return(-1);
742 return(xfs_attr_shortform_bytesfit(dp, bytes)); 745 return(xfs_attr_shortform_bytesfit(dp, bytes));
743} 746}
@@ -775,6 +778,8 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *bp, xfs_da_args_t *args, int forkoff)
775 goto out; 778 goto out;
776 779
777 if (forkoff == -1) { 780 if (forkoff == -1) {
781 ASSERT(!(dp->i_mount->m_flags & XFS_MOUNT_COMPAT_ATTR));
782
778 /* 783 /*
779 * Last attribute was removed, revert to original 784 * Last attribute was removed, revert to original
780 * inode format making all literal area available 785 * inode format making all literal area available
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 7ceabd0e2d9d..d1236d6f4045 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -550,7 +550,7 @@ xfs_fs_goingdown(
550 struct vfs *vfsp = XFS_MTOVFS(mp); 550 struct vfs *vfsp = XFS_MTOVFS(mp);
551 struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev); 551 struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev);
552 552
553 if (sb) { 553 if (sb && !IS_ERR(sb)) {
554 xfs_force_shutdown(mp, XFS_FORCE_UMOUNT); 554 xfs_force_shutdown(mp, XFS_FORCE_UMOUNT);
555 thaw_bdev(sb->s_bdev, sb); 555 thaw_bdev(sb->s_bdev, sb);
556 } 556 }
diff --git a/fs/xfs/xfs_iomap.h b/fs/xfs/xfs_iomap.h
index fcd6d63bb68b..3ce204a524b0 100644
--- a/fs/xfs/xfs_iomap.h
+++ b/fs/xfs/xfs_iomap.h
@@ -69,7 +69,7 @@ typedef struct xfs_iomap {
69 xfs_buftarg_t *iomap_target; 69 xfs_buftarg_t *iomap_target;
70 xfs_off_t iomap_offset; /* offset of mapping, bytes */ 70 xfs_off_t iomap_offset; /* offset of mapping, bytes */
71 xfs_off_t iomap_bsize; /* size of mapping, bytes */ 71 xfs_off_t iomap_bsize; /* size of mapping, bytes */
72 size_t iomap_delta; /* offset into mapping, bytes */ 72 xfs_off_t iomap_delta; /* offset into mapping, bytes */
73 iomap_flags_t iomap_flags; 73 iomap_flags_t iomap_flags;
74} xfs_iomap_t; 74} xfs_iomap_t;
75 75
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
index 8f285149681f..4518b188ade6 100644
--- a/fs/xfs/xfs_log_priv.h
+++ b/fs/xfs/xfs_log_priv.h
@@ -494,10 +494,8 @@ typedef struct log {
494 494
495#define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR) 495#define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR)
496 496
497#define XLOG_GRANT_SUB_SPACE(log,bytes,type) \ 497#define XLOG_GRANT_SUB_SPACE(log,bytes,type) \
498 xlog_grant_sub_space(log,bytes,type) 498 { \
499static inline void xlog_grant_sub_space(struct log *log, int bytes, int type)
500{
501 if (type == 'w') { \ 499 if (type == 'w') { \
502 (log)->l_grant_write_bytes -= (bytes); \ 500 (log)->l_grant_write_bytes -= (bytes); \
503 if ((log)->l_grant_write_bytes < 0) { \ 501 if ((log)->l_grant_write_bytes < 0) { \
@@ -511,13 +509,9 @@ static inline void xlog_grant_sub_space(struct log *log, int bytes, int type)
511 (log)->l_grant_reserve_cycle--; \ 509 (log)->l_grant_reserve_cycle--; \
512 } \ 510 } \
513 } \ 511 } \
514} 512 }
515 513#define XLOG_GRANT_ADD_SPACE(log,bytes,type) \
516#define XLOG_GRANT_ADD_SPACE(log,bytes,type) \ 514 { \
517 xlog_grant_add_space(log,bytes,type)
518static inline void
519xlog_grant_add_space(struct log *log, int bytes, int type)
520{
521 if (type == 'w') { \ 515 if (type == 'w') { \
522 (log)->l_grant_write_bytes += (bytes); \ 516 (log)->l_grant_write_bytes += (bytes); \
523 if ((log)->l_grant_write_bytes > (log)->l_logsize) { \ 517 if ((log)->l_grant_write_bytes > (log)->l_logsize) { \
@@ -531,12 +525,9 @@ xlog_grant_add_space(struct log *log, int bytes, int type)
531 (log)->l_grant_reserve_cycle++; \ 525 (log)->l_grant_reserve_cycle++; \
532 } \ 526 } \
533 } \ 527 } \
534} 528 }
535 529#define XLOG_INS_TICKETQ(q, tic) \
536#define XLOG_INS_TICKETQ(q, tic) xlog_ins_ticketq(q, tic) 530 { \
537static inline void
538xlog_ins_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic)
539{ \
540 if (q) { \ 531 if (q) { \
541 (tic)->t_next = (q); \ 532 (tic)->t_next = (q); \
542 (tic)->t_prev = (q)->t_prev; \ 533 (tic)->t_prev = (q)->t_prev; \
@@ -547,12 +538,9 @@ xlog_ins_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic)
547 (q) = (tic); \ 538 (q) = (tic); \
548 } \ 539 } \
549 (tic)->t_flags |= XLOG_TIC_IN_Q; \ 540 (tic)->t_flags |= XLOG_TIC_IN_Q; \
550} 541 }
551 542#define XLOG_DEL_TICKETQ(q, tic) \
552#define XLOG_DEL_TICKETQ(q, tic) xlog_del_ticketq(q, tic) 543 { \
553static inline void
554xlog_del_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic)
555{ \
556 if ((tic) == (tic)->t_next) { \ 544 if ((tic) == (tic)->t_next) { \
557 (q) = NULL; \ 545 (q) = NULL; \
558 } else { \ 546 } else { \
@@ -562,7 +550,7 @@ xlog_del_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic)
562 } \ 550 } \
563 (tic)->t_next = (tic)->t_prev = NULL; \ 551 (tic)->t_next = (tic)->t_prev = NULL; \
564 (tic)->t_flags &= ~XLOG_TIC_IN_Q; \ 552 (tic)->t_flags &= ~XLOG_TIC_IN_Q; \
565} 553 }
566 554
567/* common routines */ 555/* common routines */
568extern xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp); 556extern xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp);
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 7c1f74531463..e03fa2a3d5ed 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -3958,8 +3958,9 @@ xfs_finish_reclaim_all(xfs_mount_t *mp, int noblock)
3958 } 3958 }
3959 } 3959 }
3960 XFS_MOUNT_IUNLOCK(mp); 3960 XFS_MOUNT_IUNLOCK(mp);
3961 xfs_finish_reclaim(ip, noblock, 3961 if (xfs_finish_reclaim(ip, noblock,
3962 XFS_IFLUSH_DELWRI_ELSE_ASYNC); 3962 XFS_IFLUSH_DELWRI_ELSE_ASYNC))
3963 delay(1);
3963 purged = 1; 3964 purged = 1;
3964 break; 3965 break;
3965 } 3966 }