Loading fs/xfs/linux-2.6/xfs_aops.c +6 −7 Original line number Original line Diff line number Diff line Loading @@ -941,13 +941,12 @@ __linvfs_get_block( int retpbbm = 1; int retpbbm = 1; int error; int error; if (blocks) { offset = blocks << inode->i_blkbits; /* 64 bit goodness */ size = (ssize_t) min_t(xfs_off_t, offset, LONG_MAX); } else { size = 1 << inode->i_blkbits; } offset = (xfs_off_t)iblock << inode->i_blkbits; offset = (xfs_off_t)iblock << inode->i_blkbits; if (blocks) size = (ssize_t) min_t(xfs_off_t, LONG_MAX, (xfs_off_t)blocks << inode->i_blkbits); else size = 1 << inode->i_blkbits; VOP_BMAP(vp, offset, size, VOP_BMAP(vp, offset, size, create ? flags : BMAPI_READ, &iomap, &retpbbm, error); create ? flags : BMAPI_READ, &iomap, &retpbbm, error); Loading Loading @@ -1007,7 +1006,7 @@ __linvfs_get_block( ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0); ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0); offset = min_t(xfs_off_t, offset = min_t(xfs_off_t, iomap.iomap_bsize - iomap.iomap_delta, iomap.iomap_bsize - iomap.iomap_delta, blocks << inode->i_blkbits); (xfs_off_t)blocks << inode->i_blkbits); bh_result->b_size = (u32) min_t(xfs_off_t, UINT_MAX, offset); bh_result->b_size = (u32) min_t(xfs_off_t, UINT_MAX, offset); } } Loading fs/xfs/xfs_attr_leaf.c +8 −3 Original line number Original line Diff line number Diff line Loading @@ -310,7 +310,8 @@ xfs_attr_shortform_remove(xfs_da_args_t *args) * Fix up the start offset of the attribute fork * Fix up the start offset of the attribute fork */ */ totsize -= size; totsize -= size; if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname) { if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname && !(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) { /* /* * Last attribute now removed, revert to original * Last attribute now removed, revert to original * inode format making all literal area available * inode format making all literal area available Loading @@ -328,7 +329,8 @@ xfs_attr_shortform_remove(xfs_da_args_t *args) xfs_idata_realloc(dp, -size, XFS_ATTR_FORK); xfs_idata_realloc(dp, -size, XFS_ATTR_FORK); dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize); dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize); ASSERT(dp->i_d.di_forkoff); ASSERT(dp->i_d.di_forkoff); ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname); ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname || (mp->m_flags & XFS_MOUNT_COMPAT_ATTR)); dp->i_afp->if_ext_max = dp->i_afp->if_ext_max = XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t); XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t); dp->i_df.if_ext_max = dp->i_df.if_ext_max = Loading Loading @@ -737,7 +739,8 @@ xfs_attr_shortform_allfit(xfs_dabuf_t *bp, xfs_inode_t *dp) + name_loc->namelen + name_loc->namelen + INT_GET(name_loc->valuelen, ARCH_CONVERT); + INT_GET(name_loc->valuelen, ARCH_CONVERT); } } if (bytes == sizeof(struct xfs_attr_sf_hdr)) if (!(dp->i_mount->m_flags & XFS_MOUNT_COMPAT_ATTR) && (bytes == sizeof(struct xfs_attr_sf_hdr))) return(-1); return(-1); return(xfs_attr_shortform_bytesfit(dp, bytes)); return(xfs_attr_shortform_bytesfit(dp, bytes)); } } Loading Loading @@ -775,6 +778,8 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *bp, xfs_da_args_t *args, int forkoff) goto out; goto out; if (forkoff == -1) { if (forkoff == -1) { ASSERT(!(dp->i_mount->m_flags & XFS_MOUNT_COMPAT_ATTR)); /* /* * Last attribute was removed, revert to original * Last attribute was removed, revert to original * inode format making all literal area available * inode format making all literal area available Loading fs/xfs/xfs_fsops.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -550,7 +550,7 @@ xfs_fs_goingdown( struct vfs *vfsp = XFS_MTOVFS(mp); struct vfs *vfsp = XFS_MTOVFS(mp); struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev); struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev); if (sb) { if (sb && !IS_ERR(sb)) { xfs_force_shutdown(mp, XFS_FORCE_UMOUNT); xfs_force_shutdown(mp, XFS_FORCE_UMOUNT); thaw_bdev(sb->s_bdev, sb); thaw_bdev(sb->s_bdev, sb); } } Loading fs/xfs/xfs_iomap.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -69,7 +69,7 @@ typedef struct xfs_iomap { xfs_buftarg_t *iomap_target; xfs_buftarg_t *iomap_target; xfs_off_t iomap_offset; /* offset of mapping, bytes */ xfs_off_t iomap_offset; /* offset of mapping, bytes */ xfs_off_t iomap_bsize; /* size of mapping, bytes */ xfs_off_t iomap_bsize; /* size of mapping, bytes */ size_t iomap_delta; /* offset into mapping, bytes */ xfs_off_t iomap_delta; /* offset into mapping, bytes */ iomap_flags_t iomap_flags; iomap_flags_t iomap_flags; } xfs_iomap_t; } xfs_iomap_t; Loading fs/xfs/xfs_log_priv.h +12 −24 Original line number Original line Diff line number Diff line Loading @@ -495,9 +495,7 @@ typedef struct log { #define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR) #define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR) #define XLOG_GRANT_SUB_SPACE(log,bytes,type) \ #define XLOG_GRANT_SUB_SPACE(log,bytes,type) \ xlog_grant_sub_space(log,bytes,type) { \ static inline void xlog_grant_sub_space(struct log *log, int bytes, int type) { if (type == 'w') { \ if (type == 'w') { \ (log)->l_grant_write_bytes -= (bytes); \ (log)->l_grant_write_bytes -= (bytes); \ if ((log)->l_grant_write_bytes < 0) { \ if ((log)->l_grant_write_bytes < 0) { \ Loading @@ -512,12 +510,8 @@ static inline void xlog_grant_sub_space(struct log *log, int bytes, int type) } \ } \ } \ } \ } } #define XLOG_GRANT_ADD_SPACE(log,bytes,type) \ #define XLOG_GRANT_ADD_SPACE(log,bytes,type) \ xlog_grant_add_space(log,bytes,type) { \ static inline void xlog_grant_add_space(struct log *log, int bytes, int type) { if (type == 'w') { \ if (type == 'w') { \ (log)->l_grant_write_bytes += (bytes); \ (log)->l_grant_write_bytes += (bytes); \ if ((log)->l_grant_write_bytes > (log)->l_logsize) { \ if ((log)->l_grant_write_bytes > (log)->l_logsize) { \ Loading @@ -532,10 +526,7 @@ xlog_grant_add_space(struct log *log, int bytes, int type) } \ } \ } \ } \ } } #define XLOG_INS_TICKETQ(q, tic) \ #define XLOG_INS_TICKETQ(q, tic) xlog_ins_ticketq(q, tic) static inline void xlog_ins_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic) { \ { \ if (q) { \ if (q) { \ (tic)->t_next = (q); \ (tic)->t_next = (q); \ Loading @@ -548,10 +539,7 @@ xlog_ins_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic) } \ } \ (tic)->t_flags |= XLOG_TIC_IN_Q; \ (tic)->t_flags |= XLOG_TIC_IN_Q; \ } } #define XLOG_DEL_TICKETQ(q, tic) \ #define XLOG_DEL_TICKETQ(q, tic) xlog_del_ticketq(q, tic) static inline void xlog_del_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic) { \ { \ if ((tic) == (tic)->t_next) { \ if ((tic) == (tic)->t_next) { \ (q) = NULL; \ (q) = NULL; \ Loading Loading
fs/xfs/linux-2.6/xfs_aops.c +6 −7 Original line number Original line Diff line number Diff line Loading @@ -941,13 +941,12 @@ __linvfs_get_block( int retpbbm = 1; int retpbbm = 1; int error; int error; if (blocks) { offset = blocks << inode->i_blkbits; /* 64 bit goodness */ size = (ssize_t) min_t(xfs_off_t, offset, LONG_MAX); } else { size = 1 << inode->i_blkbits; } offset = (xfs_off_t)iblock << inode->i_blkbits; offset = (xfs_off_t)iblock << inode->i_blkbits; if (blocks) size = (ssize_t) min_t(xfs_off_t, LONG_MAX, (xfs_off_t)blocks << inode->i_blkbits); else size = 1 << inode->i_blkbits; VOP_BMAP(vp, offset, size, VOP_BMAP(vp, offset, size, create ? flags : BMAPI_READ, &iomap, &retpbbm, error); create ? flags : BMAPI_READ, &iomap, &retpbbm, error); Loading Loading @@ -1007,7 +1006,7 @@ __linvfs_get_block( ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0); ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0); offset = min_t(xfs_off_t, offset = min_t(xfs_off_t, iomap.iomap_bsize - iomap.iomap_delta, iomap.iomap_bsize - iomap.iomap_delta, blocks << inode->i_blkbits); (xfs_off_t)blocks << inode->i_blkbits); bh_result->b_size = (u32) min_t(xfs_off_t, UINT_MAX, offset); bh_result->b_size = (u32) min_t(xfs_off_t, UINT_MAX, offset); } } Loading
fs/xfs/xfs_attr_leaf.c +8 −3 Original line number Original line Diff line number Diff line Loading @@ -310,7 +310,8 @@ xfs_attr_shortform_remove(xfs_da_args_t *args) * Fix up the start offset of the attribute fork * Fix up the start offset of the attribute fork */ */ totsize -= size; totsize -= size; if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname) { if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname && !(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) { /* /* * Last attribute now removed, revert to original * Last attribute now removed, revert to original * inode format making all literal area available * inode format making all literal area available Loading @@ -328,7 +329,8 @@ xfs_attr_shortform_remove(xfs_da_args_t *args) xfs_idata_realloc(dp, -size, XFS_ATTR_FORK); xfs_idata_realloc(dp, -size, XFS_ATTR_FORK); dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize); dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize); ASSERT(dp->i_d.di_forkoff); ASSERT(dp->i_d.di_forkoff); ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname); ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname || (mp->m_flags & XFS_MOUNT_COMPAT_ATTR)); dp->i_afp->if_ext_max = dp->i_afp->if_ext_max = XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t); XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t); dp->i_df.if_ext_max = dp->i_df.if_ext_max = Loading Loading @@ -737,7 +739,8 @@ xfs_attr_shortform_allfit(xfs_dabuf_t *bp, xfs_inode_t *dp) + name_loc->namelen + name_loc->namelen + INT_GET(name_loc->valuelen, ARCH_CONVERT); + INT_GET(name_loc->valuelen, ARCH_CONVERT); } } if (bytes == sizeof(struct xfs_attr_sf_hdr)) if (!(dp->i_mount->m_flags & XFS_MOUNT_COMPAT_ATTR) && (bytes == sizeof(struct xfs_attr_sf_hdr))) return(-1); return(-1); return(xfs_attr_shortform_bytesfit(dp, bytes)); return(xfs_attr_shortform_bytesfit(dp, bytes)); } } Loading Loading @@ -775,6 +778,8 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *bp, xfs_da_args_t *args, int forkoff) goto out; goto out; if (forkoff == -1) { if (forkoff == -1) { ASSERT(!(dp->i_mount->m_flags & XFS_MOUNT_COMPAT_ATTR)); /* /* * Last attribute was removed, revert to original * Last attribute was removed, revert to original * inode format making all literal area available * inode format making all literal area available Loading
fs/xfs/xfs_fsops.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -550,7 +550,7 @@ xfs_fs_goingdown( struct vfs *vfsp = XFS_MTOVFS(mp); struct vfs *vfsp = XFS_MTOVFS(mp); struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev); struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev); if (sb) { if (sb && !IS_ERR(sb)) { xfs_force_shutdown(mp, XFS_FORCE_UMOUNT); xfs_force_shutdown(mp, XFS_FORCE_UMOUNT); thaw_bdev(sb->s_bdev, sb); thaw_bdev(sb->s_bdev, sb); } } Loading
fs/xfs/xfs_iomap.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -69,7 +69,7 @@ typedef struct xfs_iomap { xfs_buftarg_t *iomap_target; xfs_buftarg_t *iomap_target; xfs_off_t iomap_offset; /* offset of mapping, bytes */ xfs_off_t iomap_offset; /* offset of mapping, bytes */ xfs_off_t iomap_bsize; /* size of mapping, bytes */ xfs_off_t iomap_bsize; /* size of mapping, bytes */ size_t iomap_delta; /* offset into mapping, bytes */ xfs_off_t iomap_delta; /* offset into mapping, bytes */ iomap_flags_t iomap_flags; iomap_flags_t iomap_flags; } xfs_iomap_t; } xfs_iomap_t; Loading
fs/xfs/xfs_log_priv.h +12 −24 Original line number Original line Diff line number Diff line Loading @@ -495,9 +495,7 @@ typedef struct log { #define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR) #define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR) #define XLOG_GRANT_SUB_SPACE(log,bytes,type) \ #define XLOG_GRANT_SUB_SPACE(log,bytes,type) \ xlog_grant_sub_space(log,bytes,type) { \ static inline void xlog_grant_sub_space(struct log *log, int bytes, int type) { if (type == 'w') { \ if (type == 'w') { \ (log)->l_grant_write_bytes -= (bytes); \ (log)->l_grant_write_bytes -= (bytes); \ if ((log)->l_grant_write_bytes < 0) { \ if ((log)->l_grant_write_bytes < 0) { \ Loading @@ -512,12 +510,8 @@ static inline void xlog_grant_sub_space(struct log *log, int bytes, int type) } \ } \ } \ } \ } } #define XLOG_GRANT_ADD_SPACE(log,bytes,type) \ #define XLOG_GRANT_ADD_SPACE(log,bytes,type) \ xlog_grant_add_space(log,bytes,type) { \ static inline void xlog_grant_add_space(struct log *log, int bytes, int type) { if (type == 'w') { \ if (type == 'w') { \ (log)->l_grant_write_bytes += (bytes); \ (log)->l_grant_write_bytes += (bytes); \ if ((log)->l_grant_write_bytes > (log)->l_logsize) { \ if ((log)->l_grant_write_bytes > (log)->l_logsize) { \ Loading @@ -532,10 +526,7 @@ xlog_grant_add_space(struct log *log, int bytes, int type) } \ } \ } \ } \ } } #define XLOG_INS_TICKETQ(q, tic) \ #define XLOG_INS_TICKETQ(q, tic) xlog_ins_ticketq(q, tic) static inline void xlog_ins_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic) { \ { \ if (q) { \ if (q) { \ (tic)->t_next = (q); \ (tic)->t_next = (q); \ Loading @@ -548,10 +539,7 @@ xlog_ins_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic) } \ } \ (tic)->t_flags |= XLOG_TIC_IN_Q; \ (tic)->t_flags |= XLOG_TIC_IN_Q; \ } } #define XLOG_DEL_TICKETQ(q, tic) \ #define XLOG_DEL_TICKETQ(q, tic) xlog_del_ticketq(q, tic) static inline void xlog_del_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic) { \ { \ if ((tic) == (tic)->t_next) { \ if ((tic) == (tic)->t_next) { \ (q) = NULL; \ (q) = NULL; \ Loading