Commit 613d70436c1aeda6843ca8b70c7fab6d0484a591
Committed by
Lachlan McIlroy
1 parent
007c61c686
[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>
Showing 13 changed files with 54 additions and 211 deletions Side-by-side Diff
fs/xfs/Makefile-linux-2.6
fs/xfs/linux-2.6/xfs_aops.c
... | ... | @@ -163,7 +163,7 @@ |
163 | 163 | /* |
164 | 164 | * Update on-disk file size now that data has been written to disk. |
165 | 165 | * The current in-memory file size is i_size. If a write is beyond |
166 | - * eof io_new_size will be the intended file size until i_size is | |
166 | + * eof i_new_size will be the intended file size until i_size is | |
167 | 167 | * updated. If this write does not extend all the way to the valid |
168 | 168 | * file size then restrict this update to the end of the write. |
169 | 169 | */ |
... | ... | @@ -185,7 +185,7 @@ |
185 | 185 | |
186 | 186 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
187 | 187 | |
188 | - isize = MAX(ip->i_size, ip->i_iocore.io_new_size); | |
188 | + isize = MAX(ip->i_size, ip->i_new_size); | |
189 | 189 | isize = MIN(isize, bsize); |
190 | 190 | |
191 | 191 | if (ip->i_d.di_size < isize) { |
fs/xfs/linux-2.6/xfs_lrw.c
... | ... | @@ -58,14 +58,12 @@ |
58 | 58 | void |
59 | 59 | xfs_rw_enter_trace( |
60 | 60 | int tag, |
61 | - xfs_iocore_t *io, | |
61 | + xfs_inode_t *ip, | |
62 | 62 | void *data, |
63 | 63 | size_t segs, |
64 | 64 | loff_t offset, |
65 | 65 | int ioflags) |
66 | 66 | { |
67 | - xfs_inode_t *ip = XFS_IO_INODE(io); | |
68 | - | |
69 | 67 | if (ip->i_rwtrace == NULL) |
70 | 68 | return; |
71 | 69 | ktrace_enter(ip->i_rwtrace, |
... | ... | @@ -78,8 +76,8 @@ |
78 | 76 | (void *)((unsigned long)((offset >> 32) & 0xffffffff)), |
79 | 77 | (void *)((unsigned long)(offset & 0xffffffff)), |
80 | 78 | (void *)((unsigned long)ioflags), |
81 | - (void *)((unsigned long)((io->io_new_size >> 32) & 0xffffffff)), | |
82 | - (void *)((unsigned long)(io->io_new_size & 0xffffffff)), | |
79 | + (void *)((unsigned long)((ip->i_new_size >> 32) & 0xffffffff)), | |
80 | + (void *)((unsigned long)(ip->i_new_size & 0xffffffff)), | |
83 | 81 | (void *)((unsigned long)current_pid()), |
84 | 82 | (void *)NULL, |
85 | 83 | (void *)NULL, |
86 | 84 | |
... | ... | @@ -89,13 +87,12 @@ |
89 | 87 | |
90 | 88 | void |
91 | 89 | xfs_inval_cached_trace( |
92 | - xfs_iocore_t *io, | |
90 | + xfs_inode_t *ip, | |
93 | 91 | xfs_off_t offset, |
94 | 92 | xfs_off_t len, |
95 | 93 | xfs_off_t first, |
96 | 94 | xfs_off_t last) |
97 | 95 | { |
98 | - xfs_inode_t *ip = XFS_IO_INODE(io); | |
99 | 96 | |
100 | 97 | if (ip->i_rwtrace == NULL) |
101 | 98 | return; |
... | ... | @@ -256,7 +253,7 @@ |
256 | 253 | } |
257 | 254 | } |
258 | 255 | |
259 | - xfs_rw_enter_trace(XFS_READ_ENTER, &ip->i_iocore, | |
256 | + xfs_rw_enter_trace(XFS_READ_ENTER, ip, | |
260 | 257 | (void *)iovp, segs, *offset, ioflags); |
261 | 258 | |
262 | 259 | iocb->ki_pos = *offset; |
... | ... | @@ -301,7 +298,7 @@ |
301 | 298 | return -error; |
302 | 299 | } |
303 | 300 | } |
304 | - xfs_rw_enter_trace(XFS_SPLICE_READ_ENTER, &ip->i_iocore, | |
301 | + xfs_rw_enter_trace(XFS_SPLICE_READ_ENTER, ip, | |
305 | 302 | pipe, count, *ppos, ioflags); |
306 | 303 | ret = generic_file_splice_read(infilp, ppos, pipe, count, flags); |
307 | 304 | if (ret > 0) |
... | ... | @@ -323,7 +320,6 @@ |
323 | 320 | { |
324 | 321 | bhv_vnode_t *vp = XFS_ITOV(ip); |
325 | 322 | xfs_mount_t *mp = ip->i_mount; |
326 | - xfs_iocore_t *io = &ip->i_iocore; | |
327 | 323 | ssize_t ret; |
328 | 324 | struct inode *inode = outfilp->f_mapping->host; |
329 | 325 | xfs_fsize_t isize, new_size; |
330 | 326 | |
... | ... | @@ -350,10 +346,10 @@ |
350 | 346 | |
351 | 347 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
352 | 348 | if (new_size > ip->i_size) |
353 | - io->io_new_size = new_size; | |
349 | + ip->i_new_size = new_size; | |
354 | 350 | xfs_iunlock(ip, XFS_ILOCK_EXCL); |
355 | 351 | |
356 | - xfs_rw_enter_trace(XFS_SPLICE_WRITE_ENTER, &ip->i_iocore, | |
352 | + xfs_rw_enter_trace(XFS_SPLICE_WRITE_ENTER, ip, | |
357 | 353 | pipe, count, *ppos, ioflags); |
358 | 354 | ret = generic_file_splice_write(pipe, outfilp, ppos, count, flags); |
359 | 355 | if (ret > 0) |
360 | 356 | |
... | ... | @@ -370,9 +366,9 @@ |
370 | 366 | xfs_iunlock(ip, XFS_ILOCK_EXCL); |
371 | 367 | } |
372 | 368 | |
373 | - if (io->io_new_size) { | |
369 | + if (ip->i_new_size) { | |
374 | 370 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
375 | - io->io_new_size = 0; | |
371 | + ip->i_new_size = 0; | |
376 | 372 | if (ip->i_d.di_size > ip->i_size) |
377 | 373 | ip->i_d.di_size = ip->i_size; |
378 | 374 | xfs_iunlock(ip, XFS_ILOCK_EXCL); |
379 | 375 | |
380 | 376 | |
... | ... | @@ -461,20 +457,19 @@ |
461 | 457 | xfs_off_t offset, /* starting I/O offset */ |
462 | 458 | xfs_fsize_t isize) /* current inode size */ |
463 | 459 | { |
464 | - xfs_iocore_t *io = &ip->i_iocore; | |
460 | + xfs_mount_t *mp = ip->i_mount; | |
465 | 461 | xfs_fileoff_t start_zero_fsb; |
466 | 462 | xfs_fileoff_t end_zero_fsb; |
467 | 463 | xfs_fileoff_t zero_count_fsb; |
468 | 464 | xfs_fileoff_t last_fsb; |
469 | 465 | xfs_fileoff_t zero_off; |
470 | 466 | xfs_fsize_t zero_len; |
471 | - xfs_mount_t *mp = io->io_mount; | |
472 | 467 | int nimaps; |
473 | 468 | int error = 0; |
474 | 469 | xfs_bmbt_irec_t imap; |
475 | 470 | |
476 | - ASSERT(ismrlocked(io->io_lock, MR_UPDATE)); | |
477 | - ASSERT(ismrlocked(io->io_iolock, MR_UPDATE)); | |
471 | + ASSERT(ismrlocked(&ip->i_lock, MR_UPDATE)); | |
472 | + ASSERT(ismrlocked(&ip->i_iolock, MR_UPDATE)); | |
478 | 473 | ASSERT(offset > isize); |
479 | 474 | |
480 | 475 | /* |
... | ... | @@ -483,8 +478,8 @@ |
483 | 478 | */ |
484 | 479 | error = xfs_zero_last_block(ip, offset, isize); |
485 | 480 | if (error) { |
486 | - ASSERT(ismrlocked(io->io_lock, MR_UPDATE)); | |
487 | - ASSERT(ismrlocked(io->io_iolock, MR_UPDATE)); | |
481 | + ASSERT(ismrlocked(&ip->i_lock, MR_UPDATE)); | |
482 | + ASSERT(ismrlocked(&ip->i_iolock, MR_UPDATE)); | |
488 | 483 | return error; |
489 | 484 | } |
490 | 485 | |
... | ... | @@ -515,8 +510,8 @@ |
515 | 510 | error = xfs_bmapi(NULL, ip, start_zero_fsb, zero_count_fsb, |
516 | 511 | 0, NULL, 0, &imap, &nimaps, NULL, NULL); |
517 | 512 | if (error) { |
518 | - ASSERT(ismrlocked(io->io_lock, MR_UPDATE)); | |
519 | - ASSERT(ismrlocked(io->io_iolock, MR_UPDATE)); | |
513 | + ASSERT(ismrlocked(&ip->i_lock, MR_UPDATE)); | |
514 | + ASSERT(ismrlocked(&ip->i_iolock, MR_UPDATE)); | |
520 | 515 | return error; |
521 | 516 | } |
522 | 517 | ASSERT(nimaps > 0); |
... | ... | @@ -584,7 +579,6 @@ |
584 | 579 | xfs_mount_t *mp; |
585 | 580 | ssize_t ret = 0, error = 0; |
586 | 581 | xfs_fsize_t isize, new_size; |
587 | - xfs_iocore_t *io; | |
588 | 582 | int iolock; |
589 | 583 | int eventsent = 0; |
590 | 584 | bhv_vrwlock_t locktype; |
... | ... | @@ -604,8 +598,7 @@ |
604 | 598 | if (count == 0) |
605 | 599 | return 0; |
606 | 600 | |
607 | - io = &xip->i_iocore; | |
608 | - mp = io->io_mount; | |
601 | + mp = xip->i_mount; | |
609 | 602 | |
610 | 603 | xfs_wait_for_freeze(mp, SB_FREEZE_WRITE); |
611 | 604 | |
... | ... | @@ -685,7 +678,7 @@ |
685 | 678 | |
686 | 679 | new_size = pos + count; |
687 | 680 | if (new_size > xip->i_size) |
688 | - io->io_new_size = new_size; | |
681 | + xip->i_new_size = new_size; | |
689 | 682 | |
690 | 683 | if (likely(!(ioflags & IO_INVIS))) { |
691 | 684 | file_update_time(file); |
... | ... | @@ -737,7 +730,7 @@ |
737 | 730 | if ((ioflags & IO_ISDIRECT)) { |
738 | 731 | if (VN_CACHED(vp)) { |
739 | 732 | WARN_ON(need_i_mutex == 0); |
740 | - xfs_inval_cached_trace(io, pos, -1, | |
733 | + xfs_inval_cached_trace(xip, pos, -1, | |
741 | 734 | ctooff(offtoct(pos)), -1); |
742 | 735 | error = xfs_flushinval_pages(xip, |
743 | 736 | ctooff(offtoct(pos)), |
... | ... | @@ -756,7 +749,7 @@ |
756 | 749 | need_i_mutex = 0; |
757 | 750 | } |
758 | 751 | |
759 | - xfs_rw_enter_trace(XFS_DIOWR_ENTER, io, (void *)iovp, segs, | |
752 | + xfs_rw_enter_trace(XFS_DIOWR_ENTER, xip, (void *)iovp, segs, | |
760 | 753 | *offset, ioflags); |
761 | 754 | ret = generic_file_direct_write(iocb, iovp, |
762 | 755 | &segs, pos, offset, count, ocount); |
... | ... | @@ -776,7 +769,7 @@ |
776 | 769 | goto relock; |
777 | 770 | } |
778 | 771 | } else { |
779 | - xfs_rw_enter_trace(XFS_WRITE_ENTER, io, (void *)iovp, segs, | |
772 | + xfs_rw_enter_trace(XFS_WRITE_ENTER, xip, (void *)iovp, segs, | |
780 | 773 | *offset, ioflags); |
781 | 774 | ret = generic_file_buffered_write(iocb, iovp, segs, |
782 | 775 | pos, offset, count, ret); |
783 | 776 | |
... | ... | @@ -840,9 +833,9 @@ |
840 | 833 | } |
841 | 834 | |
842 | 835 | out_unlock_internal: |
843 | - if (io->io_new_size) { | |
836 | + if (xip->i_new_size) { | |
844 | 837 | xfs_ilock(xip, XFS_ILOCK_EXCL); |
845 | - io->io_new_size = 0; | |
838 | + xip->i_new_size = 0; | |
846 | 839 | /* |
847 | 840 | * If this was a direct or synchronous I/O that failed (such |
848 | 841 | * as ENOSPC) then part of the I/O may have been written to |
fs/xfs/linux-2.6/xfs_lrw.h
... | ... | @@ -19,7 +19,6 @@ |
19 | 19 | #define __XFS_LRW_H__ |
20 | 20 | |
21 | 21 | struct xfs_mount; |
22 | -struct xfs_iocore; | |
23 | 22 | struct xfs_inode; |
24 | 23 | struct xfs_bmbt_irec; |
25 | 24 | struct xfs_buf; |
26 | 25 | |
... | ... | @@ -60,13 +59,13 @@ |
60 | 59 | #define XFS_IOMAP_UNWRITTEN 27 |
61 | 60 | #define XFS_SPLICE_READ_ENTER 28 |
62 | 61 | #define XFS_SPLICE_WRITE_ENTER 29 |
63 | -extern void xfs_rw_enter_trace(int, struct xfs_iocore *, | |
64 | - void *, size_t, loff_t, int); | |
65 | -extern void xfs_inval_cached_trace(struct xfs_iocore *, | |
66 | - xfs_off_t, xfs_off_t, xfs_off_t, xfs_off_t); | |
62 | +extern void xfs_rw_enter_trace(int, struct xfs_inode *, | |
63 | + void *, size_t, loff_t, int); | |
64 | +extern void xfs_inval_cached_trace(struct xfs_inode *, | |
65 | + xfs_off_t, xfs_off_t, xfs_off_t, xfs_off_t); | |
67 | 66 | #else |
68 | -#define xfs_rw_enter_trace(tag, io, data, size, offset, ioflags) | |
69 | -#define xfs_inval_cached_trace(io, offset, len, first, last) | |
67 | +#define xfs_rw_enter_trace(tag, ip, data, size, offset, ioflags) | |
68 | +#define xfs_inval_cached_trace(ip, offset, len, first, last) | |
70 | 69 | #endif |
71 | 70 | |
72 | 71 | extern int xfsbdstrat(struct xfs_mount *, struct xfs_buf *); |
fs/xfs/xfs_dfrag.c
fs/xfs/xfs_iget.c
... | ... | @@ -199,12 +199,9 @@ |
199 | 199 | XFS_STATS_INC(xs_ig_found); |
200 | 200 | |
201 | 201 | finish_inode: |
202 | - if (ip->i_d.di_mode == 0) { | |
203 | - if (!(flags & XFS_IGET_CREATE)) { | |
204 | - xfs_put_perag(mp, pag); | |
205 | - return ENOENT; | |
206 | - } | |
207 | - xfs_iocore_inode_reinit(ip); | |
202 | + if (ip->i_d.di_mode == 0 && !(flags & XFS_IGET_CREATE)) { | |
203 | + xfs_put_perag(mp, pag); | |
204 | + return ENOENT; | |
208 | 205 | } |
209 | 206 | |
210 | 207 | if (lock_flags != 0) |
... | ... | @@ -235,7 +232,6 @@ |
235 | 232 | xfs_itrace_exit_tag(ip, "xfs_iget.alloc"); |
236 | 233 | |
237 | 234 | xfs_inode_lock_init(ip, vp); |
238 | - xfs_iocore_inode_init(ip); | |
239 | 235 | if (lock_flags) |
240 | 236 | xfs_ilock(ip, lock_flags); |
241 | 237 | |
... | ... | @@ -330,9 +326,6 @@ |
330 | 326 | return_ip: |
331 | 327 | ASSERT(ip->i_df.if_ext_max == |
332 | 328 | XFS_IFORK_DSIZE(ip) / sizeof(xfs_bmbt_rec_t)); |
333 | - | |
334 | - ASSERT(((ip->i_d.di_flags & XFS_DIFLAG_REALTIME) != 0) == | |
335 | - ((ip->i_iocore.io_flags & XFS_IOCORE_RT) != 0)); | |
336 | 329 | |
337 | 330 | xfs_iflags_set(ip, XFS_IMODIFIED); |
338 | 331 | *ipp = ip; |
fs/xfs/xfs_inode.c
... | ... | @@ -1220,10 +1220,8 @@ |
1220 | 1220 | ip->i_d.di_extsize = pip->i_d.di_extsize; |
1221 | 1221 | } |
1222 | 1222 | } else if ((mode & S_IFMT) == S_IFREG) { |
1223 | - if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) { | |
1223 | + if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) | |
1224 | 1224 | di_flags |= XFS_DIFLAG_REALTIME; |
1225 | - ip->i_iocore.io_flags |= XFS_IOCORE_RT; | |
1226 | - } | |
1227 | 1225 | if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) { |
1228 | 1226 | di_flags |= XFS_DIFLAG_EXTSIZE; |
1229 | 1227 | ip->i_d.di_extsize = pip->i_d.di_extsize; |
fs/xfs/xfs_inode.h
... | ... | @@ -132,46 +132,7 @@ |
132 | 132 | __uint16_t da_pad; /* DMIG extra padding */ |
133 | 133 | } dm_attrs_t; |
134 | 134 | |
135 | -typedef struct xfs_iocore { | |
136 | - void *io_obj; /* pointer to container | |
137 | - * inode or dcxvn structure */ | |
138 | - struct xfs_mount *io_mount; /* fs mount struct ptr */ | |
139 | -#ifdef DEBUG | |
140 | - mrlock_t *io_lock; /* inode IO lock */ | |
141 | - mrlock_t *io_iolock; /* inode IO lock */ | |
142 | -#endif | |
143 | - | |
144 | - /* I/O state */ | |
145 | - xfs_fsize_t io_new_size; /* sz when write completes */ | |
146 | - | |
147 | - /* Miscellaneous state. */ | |
148 | - unsigned int io_flags; /* IO related flags */ | |
149 | - | |
150 | - /* DMAPI state */ | |
151 | - dm_attrs_t io_dmattrs; | |
152 | - | |
153 | -} xfs_iocore_t; | |
154 | - | |
155 | -#define io_dmevmask io_dmattrs.da_dmevmask | |
156 | -#define io_dmstate io_dmattrs.da_dmstate | |
157 | - | |
158 | -#define XFS_IO_INODE(io) ((xfs_inode_t *) ((io)->io_obj)) | |
159 | -#define XFS_IO_DCXVN(io) ((dcxvn_t *) ((io)->io_obj)) | |
160 | - | |
161 | 135 | /* |
162 | - * Flags in the flags field | |
163 | - */ | |
164 | - | |
165 | -#define XFS_IOCORE_RT 0x1 | |
166 | - | |
167 | -/* | |
168 | - * xfs_iocore prototypes | |
169 | - */ | |
170 | - | |
171 | -extern void xfs_iocore_inode_init(struct xfs_inode *); | |
172 | -extern void xfs_iocore_inode_reinit(struct xfs_inode *); | |
173 | - | |
174 | -/* | |
175 | 136 | * This is the xfs inode cluster structure. This structure is used by |
176 | 137 | * xfs_iflush to find inodes that share a cluster and can be flushed to disk at |
177 | 138 | * the same time. |
... | ... | @@ -283,9 +244,6 @@ |
283 | 244 | struct xfs_inode **i_refcache; /* ptr to entry in ref cache */ |
284 | 245 | struct xfs_inode *i_release; /* inode to unref */ |
285 | 246 | #endif |
286 | - /* I/O state */ | |
287 | - xfs_iocore_t i_iocore; /* I/O core */ | |
288 | - | |
289 | 247 | /* Miscellaneous state. */ |
290 | 248 | unsigned short i_flags; /* see defined flags below */ |
291 | 249 | unsigned char i_update_core; /* timestamps/size is dirty */ |
... | ... | @@ -298,6 +256,7 @@ |
298 | 256 | struct hlist_node i_cnode; /* cluster link node */ |
299 | 257 | |
300 | 258 | xfs_fsize_t i_size; /* in-memory size */ |
259 | + xfs_fsize_t i_new_size; /* size when write completes */ | |
301 | 260 | atomic_t i_iocount; /* outstanding I/O count */ |
302 | 261 | /* Trace buffers per inode. */ |
303 | 262 | #ifdef XFS_INODE_TRACE |
fs/xfs/xfs_iocore.c
1 | -/* | |
2 | - * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc. | |
3 | - * All Rights Reserved. | |
4 | - * | |
5 | - * This program is free software; you can redistribute it and/or | |
6 | - * modify it under the terms of the GNU General Public License as | |
7 | - * published by the Free Software Foundation. | |
8 | - * | |
9 | - * This program is distributed in the hope that it would be useful, | |
10 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | - * GNU General Public License for more details. | |
13 | - * | |
14 | - * You should have received a copy of the GNU General Public License | |
15 | - * along with this program; if not, write the Free Software Foundation, | |
16 | - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
17 | - */ | |
18 | -#include "xfs.h" | |
19 | -#include "xfs_fs.h" | |
20 | -#include "xfs_types.h" | |
21 | -#include "xfs_bit.h" | |
22 | -#include "xfs_log.h" | |
23 | -#include "xfs_inum.h" | |
24 | -#include "xfs_trans.h" | |
25 | -#include "xfs_sb.h" | |
26 | -#include "xfs_ag.h" | |
27 | -#include "xfs_dir2.h" | |
28 | -#include "xfs_dfrag.h" | |
29 | -#include "xfs_dmapi.h" | |
30 | -#include "xfs_mount.h" | |
31 | -#include "xfs_bmap_btree.h" | |
32 | -#include "xfs_alloc_btree.h" | |
33 | -#include "xfs_ialloc_btree.h" | |
34 | -#include "xfs_dir2_sf.h" | |
35 | -#include "xfs_attr_sf.h" | |
36 | -#include "xfs_dinode.h" | |
37 | -#include "xfs_inode.h" | |
38 | -#include "xfs_inode_item.h" | |
39 | -#include "xfs_itable.h" | |
40 | -#include "xfs_btree.h" | |
41 | -#include "xfs_alloc.h" | |
42 | -#include "xfs_ialloc.h" | |
43 | -#include "xfs_bmap.h" | |
44 | -#include "xfs_error.h" | |
45 | -#include "xfs_rw.h" | |
46 | -#include "xfs_quota.h" | |
47 | -#include "xfs_trans_space.h" | |
48 | -#include "xfs_iomap.h" | |
49 | - | |
50 | -void | |
51 | -xfs_iocore_inode_reinit( | |
52 | - xfs_inode_t *ip) | |
53 | -{ | |
54 | - xfs_iocore_t *io = &ip->i_iocore; | |
55 | - | |
56 | - io->io_flags = 0; | |
57 | - if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) | |
58 | - io->io_flags |= XFS_IOCORE_RT; | |
59 | - io->io_dmevmask = ip->i_d.di_dmevmask; | |
60 | - io->io_dmstate = ip->i_d.di_dmstate; | |
61 | -} | |
62 | - | |
63 | -void | |
64 | -xfs_iocore_inode_init( | |
65 | - xfs_inode_t *ip) | |
66 | -{ | |
67 | - xfs_iocore_t *io = &ip->i_iocore; | |
68 | - xfs_mount_t *mp = ip->i_mount; | |
69 | - | |
70 | - io->io_mount = mp; | |
71 | -#ifdef DEBUG | |
72 | - io->io_lock = &ip->i_lock; | |
73 | - io->io_iolock = &ip->i_iolock; | |
74 | -#endif | |
75 | - | |
76 | - io->io_obj = (void *)ip; | |
77 | - | |
78 | - xfs_iocore_inode_reinit(ip); | |
79 | -} |
fs/xfs/xfs_iomap.c
... | ... | @@ -57,8 +57,6 @@ |
57 | 57 | xfs_off_t offset, |
58 | 58 | ssize_t count) |
59 | 59 | { |
60 | - xfs_iocore_t *io = &ip->i_iocore; | |
61 | - | |
62 | 60 | if (!ip->i_rwtrace) |
63 | 61 | return; |
64 | 62 | |
... | ... | @@ -70,8 +68,8 @@ |
70 | 68 | (void *)((unsigned long)((offset >> 32) & 0xffffffff)), |
71 | 69 | (void *)((unsigned long)(offset & 0xffffffff)), |
72 | 70 | (void *)((unsigned long)count), |
73 | - (void *)((unsigned long)((io->io_new_size >> 32) & 0xffffffff)), | |
74 | - (void *)((unsigned long)(io->io_new_size & 0xffffffff)), | |
71 | + (void *)((unsigned long)((ip->i_new_size >> 32) & 0xffffffff)), | |
72 | + (void *)((unsigned long)(ip->i_new_size & 0xffffffff)), | |
75 | 73 | (void *)((unsigned long)current_pid()), |
76 | 74 | (void *)NULL, |
77 | 75 | (void *)NULL, |
... | ... | @@ -186,8 +184,6 @@ |
186 | 184 | int iomap_flags = 0; |
187 | 185 | |
188 | 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 | 188 | if (XFS_FORCED_SHUTDOWN(mp)) |
193 | 189 | return XFS_ERROR(EIO); |
... | ... | @@ -402,7 +398,6 @@ |
402 | 398 | int found) |
403 | 399 | { |
404 | 400 | xfs_mount_t *mp = ip->i_mount; |
405 | - xfs_iocore_t *io = &ip->i_iocore; | |
406 | 401 | xfs_fileoff_t offset_fsb; |
407 | 402 | xfs_fileoff_t last_fsb; |
408 | 403 | xfs_filblks_t count_fsb, resaligned; |
... | ... | @@ -432,8 +427,8 @@ |
432 | 427 | extsz = xfs_get_extsz_hint(ip); |
433 | 428 | |
434 | 429 | isize = ip->i_size; |
435 | - if (io->io_new_size > isize) | |
436 | - isize = io->io_new_size; | |
430 | + if (ip->i_new_size > isize) | |
431 | + isize = ip->i_new_size; | |
437 | 432 | |
438 | 433 | offset_fsb = XFS_B_TO_FSBT(mp, offset); |
439 | 434 | last_fsb = XFS_B_TO_FSB(mp, ((xfs_ufsize_t)(offset + count))); |
... | ... | @@ -528,7 +523,8 @@ |
528 | 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 | 528 | error = xfs_cmn_err_fsblock_zero(ip, &imap); |
533 | 529 | goto error_out; |
534 | 530 | } |
... | ... | @@ -616,7 +612,6 @@ |
616 | 612 | int *nmaps) |
617 | 613 | { |
618 | 614 | xfs_mount_t *mp = ip->i_mount; |
619 | - xfs_iocore_t *io = &ip->i_iocore; | |
620 | 615 | xfs_fileoff_t offset_fsb; |
621 | 616 | xfs_fileoff_t last_fsb; |
622 | 617 | xfs_off_t aligned_offset; |
... | ... | @@ -644,8 +639,8 @@ |
644 | 639 | |
645 | 640 | retry: |
646 | 641 | isize = ip->i_size; |
647 | - if (io->io_new_size > isize) | |
648 | - isize = io->io_new_size; | |
642 | + if (ip->i_new_size > isize) | |
643 | + isize = ip->i_new_size; | |
649 | 644 | |
650 | 645 | error = xfs_iomap_eof_want_preallocate(mp, ip, isize, offset, count, |
651 | 646 | ioflag, imap, XFS_WRITE_IMAPS, &prealloc); |
... | ... | @@ -691,7 +686,8 @@ |
691 | 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 | 691 | return xfs_cmn_err_fsblock_zero(ip, &imap[0]); |
696 | 692 | |
697 | 693 | *ret_imap = imap[0]; |
... | ... | @@ -716,7 +712,6 @@ |
716 | 712 | int *retmap) |
717 | 713 | { |
718 | 714 | xfs_mount_t *mp = ip->i_mount; |
719 | - xfs_iocore_t *io = &ip->i_iocore; | |
720 | 715 | xfs_fileoff_t offset_fsb, last_block; |
721 | 716 | xfs_fileoff_t end_fsb, map_start_fsb; |
722 | 717 | xfs_fsblock_t first_block; |
... | ... | @@ -814,7 +809,7 @@ |
814 | 809 | */ |
815 | 810 | for (i = 0; i < nimaps; i++) { |
816 | 811 | if (unlikely(!imap[i].br_startblock && |
817 | - !(io->io_flags & XFS_IOCORE_RT))) | |
812 | + !(ip->i_d.di_flags & XFS_DIFLAG_REALTIME))) | |
818 | 813 | return xfs_cmn_err_fsblock_zero(ip, &imap[i]); |
819 | 814 | if ((offset_fsb >= imap[i].br_startoff) && |
820 | 815 | (offset_fsb < (imap[i].br_startoff + |
... | ... | @@ -850,7 +845,6 @@ |
850 | 845 | size_t count) |
851 | 846 | { |
852 | 847 | xfs_mount_t *mp = ip->i_mount; |
853 | - xfs_iocore_t *io = &ip->i_iocore; | |
854 | 848 | xfs_fileoff_t offset_fsb; |
855 | 849 | xfs_filblks_t count_fsb; |
856 | 850 | xfs_filblks_t numblks_fsb; |
... | ... | @@ -913,7 +907,7 @@ |
913 | 907 | return XFS_ERROR(error); |
914 | 908 | |
915 | 909 | if (unlikely(!imap.br_startblock && |
916 | - !(io->io_flags & XFS_IOCORE_RT))) | |
910 | + !(ip->i_d.di_flags & XFS_DIFLAG_REALTIME))) | |
917 | 911 | return xfs_cmn_err_fsblock_zero(ip, &imap); |
918 | 912 | |
919 | 913 | if ((numblks_fsb = imap.br_blockcount) == 0) { |
fs/xfs/xfs_mount.h
fs/xfs/xfs_rw.h
... | ... | @@ -36,14 +36,6 @@ |
36 | 36 | (xfs_daddr_t)XFS_FSB_TO_BB((ip)->i_mount, (fsb)) : \ |
37 | 37 | XFS_FSB_TO_DADDR((ip)->i_mount, (fsb))); |
38 | 38 | } |
39 | -#define XFS_FSB_TO_DB_IO(io,fsb) xfs_fsb_to_db_io(io,fsb) | |
40 | -static inline xfs_daddr_t | |
41 | -xfs_fsb_to_db_io(struct xfs_iocore *io, xfs_fsblock_t fsb) | |
42 | -{ | |
43 | - return (((io)->io_flags & XFS_IOCORE_RT) ? \ | |
44 | - XFS_FSB_TO_BB((io)->io_mount, (fsb)) : \ | |
45 | - XFS_FSB_TO_DADDR((io)->io_mount, (fsb))); | |
46 | -} | |
47 | 39 | |
48 | 40 | /* |
49 | 41 | * Flags for xfs_free_eofblocks |
fs/xfs/xfs_vnodeops.c
... | ... | @@ -804,12 +804,8 @@ |
804 | 804 | if (vap->va_xflags & XFS_XFLAG_EXTSZINHERIT) |
805 | 805 | di_flags |= XFS_DIFLAG_EXTSZINHERIT; |
806 | 806 | } else if ((ip->i_d.di_mode & S_IFMT) == S_IFREG) { |
807 | - if (vap->va_xflags & XFS_XFLAG_REALTIME) { | |
807 | + if (vap->va_xflags & XFS_XFLAG_REALTIME) | |
808 | 808 | di_flags |= XFS_DIFLAG_REALTIME; |
809 | - ip->i_iocore.io_flags |= XFS_IOCORE_RT; | |
810 | - } else { | |
811 | - ip->i_iocore.io_flags &= ~XFS_IOCORE_RT; | |
812 | - } | |
813 | 809 | if (vap->va_xflags & XFS_XFLAG_EXTSIZE) |
814 | 810 | di_flags |= XFS_DIFLAG_EXTSIZE; |
815 | 811 | } |
... | ... | @@ -3633,8 +3629,8 @@ |
3633 | 3629 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
3634 | 3630 | xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); |
3635 | 3631 | |
3636 | - ip->i_iocore.io_dmevmask = ip->i_d.di_dmevmask = evmask; | |
3637 | - ip->i_iocore.io_dmstate = ip->i_d.di_dmstate = state; | |
3632 | + ip->i_d.di_dmevmask = evmask; | |
3633 | + ip->i_d.di_dmstate = state; | |
3638 | 3634 | |
3639 | 3635 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); |
3640 | 3636 | IHOLD(ip); |
... | ... | @@ -4172,7 +4168,7 @@ |
4172 | 4168 | ioffset = offset & ~(rounding - 1); |
4173 | 4169 | |
4174 | 4170 | if (VN_CACHED(vp) != 0) { |
4175 | - xfs_inval_cached_trace(&ip->i_iocore, ioffset, -1, | |
4171 | + xfs_inval_cached_trace(ip, ioffset, -1, | |
4176 | 4172 | ctooff(offtoct(ioffset)), -1); |
4177 | 4173 | error = xfs_flushinval_pages(ip, |
4178 | 4174 | ctooff(offtoct(ioffset)), |