aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iomap.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2007-10-11 03:44:08 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-07 00:48:58 -0500
commit613d70436c1aeda6843ca8b70c7fab6d0484a591 (patch)
treee8cc8d1f2cf3720285f0439c9d057555ab293b0c /fs/xfs/xfs_iomap.c
parent007c61c68640ea17c036785b698d05da67b4365e (diff)
[XFS] kill xfs_iocore_t
xfs_iocore_t is a structure embedded in xfs_inode. Except for one field it just duplicates fields already in xfs_inode, and there is nothing this abstraction buys us on XFS/Linux. This patch removes it and shrinks source and binary size of xfs aswell as shrinking the size of xfs_inode by 60/44 bytes in debug/non-debug builds. SGI-PV: 970852 SGI-Modid: xfs-linux-melb:xfs-kern:29754a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_iomap.c')
-rw-r--r--fs/xfs/xfs_iomap.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 4821b8563c41..d16f40cdf5f6 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -57,8 +57,6 @@ xfs_iomap_enter_trace(
57 xfs_off_t offset, 57 xfs_off_t offset,
58 ssize_t count) 58 ssize_t count)
59{ 59{
60 xfs_iocore_t *io = &ip->i_iocore;
61
62 if (!ip->i_rwtrace) 60 if (!ip->i_rwtrace)
63 return; 61 return;
64 62
@@ -70,8 +68,8 @@ xfs_iomap_enter_trace(
70 (void *)((unsigned long)((offset >> 32) & 0xffffffff)), 68 (void *)((unsigned long)((offset >> 32) & 0xffffffff)),
71 (void *)((unsigned long)(offset & 0xffffffff)), 69 (void *)((unsigned long)(offset & 0xffffffff)),
72 (void *)((unsigned long)count), 70 (void *)((unsigned long)count),
73 (void *)((unsigned long)((io->io_new_size >> 32) & 0xffffffff)), 71 (void *)((unsigned long)((ip->i_new_size >> 32) & 0xffffffff)),
74 (void *)((unsigned long)(io->io_new_size & 0xffffffff)), 72 (void *)((unsigned long)(ip->i_new_size & 0xffffffff)),
75 (void *)((unsigned long)current_pid()), 73 (void *)((unsigned long)current_pid()),
76 (void *)NULL, 74 (void *)NULL,
77 (void *)NULL, 75 (void *)NULL,
@@ -186,8 +184,6 @@ xfs_iomap(
186 int iomap_flags = 0; 184 int iomap_flags = 0;
187 185
188 ASSERT((ip->i_d.di_mode & S_IFMT) == S_IFREG); 186 ASSERT((ip->i_d.di_mode & S_IFMT) == S_IFREG);
189 ASSERT(((ip->i_d.di_flags & XFS_DIFLAG_REALTIME) != 0) ==
190 ((ip->i_iocore.io_flags & XFS_IOCORE_RT) != 0));
191 187
192 if (XFS_FORCED_SHUTDOWN(mp)) 188 if (XFS_FORCED_SHUTDOWN(mp))
193 return XFS_ERROR(EIO); 189 return XFS_ERROR(EIO);
@@ -402,7 +398,6 @@ xfs_iomap_write_direct(
402 int found) 398 int found)
403{ 399{
404 xfs_mount_t *mp = ip->i_mount; 400 xfs_mount_t *mp = ip->i_mount;
405 xfs_iocore_t *io = &ip->i_iocore;
406 xfs_fileoff_t offset_fsb; 401 xfs_fileoff_t offset_fsb;
407 xfs_fileoff_t last_fsb; 402 xfs_fileoff_t last_fsb;
408 xfs_filblks_t count_fsb, resaligned; 403 xfs_filblks_t count_fsb, resaligned;
@@ -432,8 +427,8 @@ xfs_iomap_write_direct(
432 extsz = xfs_get_extsz_hint(ip); 427 extsz = xfs_get_extsz_hint(ip);
433 428
434 isize = ip->i_size; 429 isize = ip->i_size;
435 if (io->io_new_size > isize) 430 if (ip->i_new_size > isize)
436 isize = io->io_new_size; 431 isize = ip->i_new_size;
437 432
438 offset_fsb = XFS_B_TO_FSBT(mp, offset); 433 offset_fsb = XFS_B_TO_FSBT(mp, offset);
439 last_fsb = XFS_B_TO_FSB(mp, ((xfs_ufsize_t)(offset + count))); 434 last_fsb = XFS_B_TO_FSB(mp, ((xfs_ufsize_t)(offset + count)));
@@ -528,7 +523,8 @@ xfs_iomap_write_direct(
528 goto error_out; 523 goto error_out;
529 } 524 }
530 525
531 if (unlikely(!imap.br_startblock && !(io->io_flags & XFS_IOCORE_RT))) { 526 if (unlikely(!imap.br_startblock &&
527 !(ip->i_d.di_flags & XFS_DIFLAG_REALTIME))) {
532 error = xfs_cmn_err_fsblock_zero(ip, &imap); 528 error = xfs_cmn_err_fsblock_zero(ip, &imap);
533 goto error_out; 529 goto error_out;
534 } 530 }
@@ -616,7 +612,6 @@ xfs_iomap_write_delay(
616 int *nmaps) 612 int *nmaps)
617{ 613{
618 xfs_mount_t *mp = ip->i_mount; 614 xfs_mount_t *mp = ip->i_mount;
619 xfs_iocore_t *io = &ip->i_iocore;
620 xfs_fileoff_t offset_fsb; 615 xfs_fileoff_t offset_fsb;
621 xfs_fileoff_t last_fsb; 616 xfs_fileoff_t last_fsb;
622 xfs_off_t aligned_offset; 617 xfs_off_t aligned_offset;
@@ -644,8 +639,8 @@ xfs_iomap_write_delay(
644 639
645retry: 640retry:
646 isize = ip->i_size; 641 isize = ip->i_size;
647 if (io->io_new_size > isize) 642 if (ip->i_new_size > isize)
648 isize = io->io_new_size; 643 isize = ip->i_new_size;
649 644
650 error = xfs_iomap_eof_want_preallocate(mp, ip, isize, offset, count, 645 error = xfs_iomap_eof_want_preallocate(mp, ip, isize, offset, count,
651 ioflag, imap, XFS_WRITE_IMAPS, &prealloc); 646 ioflag, imap, XFS_WRITE_IMAPS, &prealloc);
@@ -691,7 +686,8 @@ retry:
691 goto retry; 686 goto retry;
692 } 687 }
693 688
694 if (unlikely(!imap[0].br_startblock && !(io->io_flags & XFS_IOCORE_RT))) 689 if (unlikely(!imap[0].br_startblock &&
690 !(ip->i_d.di_flags & XFS_DIFLAG_REALTIME)))
695 return xfs_cmn_err_fsblock_zero(ip, &imap[0]); 691 return xfs_cmn_err_fsblock_zero(ip, &imap[0]);
696 692
697 *ret_imap = imap[0]; 693 *ret_imap = imap[0];
@@ -716,7 +712,6 @@ xfs_iomap_write_allocate(
716 int *retmap) 712 int *retmap)
717{ 713{
718 xfs_mount_t *mp = ip->i_mount; 714 xfs_mount_t *mp = ip->i_mount;
719 xfs_iocore_t *io = &ip->i_iocore;
720 xfs_fileoff_t offset_fsb, last_block; 715 xfs_fileoff_t offset_fsb, last_block;
721 xfs_fileoff_t end_fsb, map_start_fsb; 716 xfs_fileoff_t end_fsb, map_start_fsb;
722 xfs_fsblock_t first_block; 717 xfs_fsblock_t first_block;
@@ -814,7 +809,7 @@ xfs_iomap_write_allocate(
814 */ 809 */
815 for (i = 0; i < nimaps; i++) { 810 for (i = 0; i < nimaps; i++) {
816 if (unlikely(!imap[i].br_startblock && 811 if (unlikely(!imap[i].br_startblock &&
817 !(io->io_flags & XFS_IOCORE_RT))) 812 !(ip->i_d.di_flags & XFS_DIFLAG_REALTIME)))
818 return xfs_cmn_err_fsblock_zero(ip, &imap[i]); 813 return xfs_cmn_err_fsblock_zero(ip, &imap[i]);
819 if ((offset_fsb >= imap[i].br_startoff) && 814 if ((offset_fsb >= imap[i].br_startoff) &&
820 (offset_fsb < (imap[i].br_startoff + 815 (offset_fsb < (imap[i].br_startoff +
@@ -850,7 +845,6 @@ xfs_iomap_write_unwritten(
850 size_t count) 845 size_t count)
851{ 846{
852 xfs_mount_t *mp = ip->i_mount; 847 xfs_mount_t *mp = ip->i_mount;
853 xfs_iocore_t *io = &ip->i_iocore;
854 xfs_fileoff_t offset_fsb; 848 xfs_fileoff_t offset_fsb;
855 xfs_filblks_t count_fsb; 849 xfs_filblks_t count_fsb;
856 xfs_filblks_t numblks_fsb; 850 xfs_filblks_t numblks_fsb;
@@ -913,7 +907,7 @@ xfs_iomap_write_unwritten(
913 return XFS_ERROR(error); 907 return XFS_ERROR(error);
914 908
915 if (unlikely(!imap.br_startblock && 909 if (unlikely(!imap.br_startblock &&
916 !(io->io_flags & XFS_IOCORE_RT))) 910 !(ip->i_d.di_flags & XFS_DIFLAG_REALTIME)))
917 return xfs_cmn_err_fsblock_zero(ip, &imap); 911 return xfs_cmn_err_fsblock_zero(ip, &imap);
918 912
919 if ((numblks_fsb = imap.br_blockcount) == 0) { 913 if ((numblks_fsb = imap.br_blockcount) == 0) {