xfs: patches for 3.13
PATCH v2 2/19 xfs: open code inc_inode_iversion when logging an inode
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Michael L Semon reported that generic/069 runtime increased on v5 superblocks by 100% compared to v4 superblocks. his perf-based analysis pointed directly at the timestamp updates being done by the write path in this workload. The append writers are doing 4-byte writes, so there are lots of timestamp updates occurring.
The thing is, they aren't being triggered by timestamp changes - they are being triggered by the inode change counter needing to be updated. That is, every write(2) system call needs to bump the inode version count, and it does that through the timestamp update mechanism. Hence for v5 filesystems, test generic/069 is running 3 orders of magnitude more timestmap update transactions on v5 filesystems due to the fact it does a huge number of *4 byte* write(2) calls.
This isn't a real world scenario we really need to address - anyone doing such sequential IO should be using fwrite(3), not write(2). i.e. fwrite(3) buffers the writes in userspace to minimise the number of write(2) syscalls, and the problem goes away.
However, there is a small change we can make to improve the situation - removing the expensive lock operation on the change counter update. All inode version counter changes in XFS occur under the ip->i_ilock during a transaction, and therefore we don't actually need the spin lock that provides exclusive access to it through inc_inode_iversion().
Hence avoid the lock and just open code the increment ourselves when logging the inode.
--- fs/xfs/xfs_trans_inode.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
fs/xfs/xfs_trans_inode.c +5 -3
@@ -114,12 +114,14 @@ xfs_trans_log_inode(/* * First time we log the inode in a transaction, bump the inode change -* counter if it is configured for this to occur. +* counter if it is configured for this to occur. We don't use +* inode_inc_version() because there is no need for extra locking around +* i_version as we already hold the inode locked exclusively for +* metadata modification. */ if (!(ip->i_itemp->ili_item.li_desc->lid_flags &XFS_LID_DIRTY ) &&IS_I_VERSION (VFS_I (ip))) { -inode_inc_iversion (VFS_I (ip)); - ip->i_d.di_changecount =VFS_I (ip)->i_version; + ip->i_d.di_changecount = ++VFS_I (ip)->i_version; flags |=XFS_ILOG_CORE ; }
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 7/19 xfs: remove unused transaction callback variables
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
We don't do callbacks at transaction commit time, no do we have any infrastructure to set up or run such callbacks, so remove the variables and typedefs for these operations. If we ever need to add callbacks, we can reintroduce the variables at that time.
--- fs/xfs/xfs_trans.h | 7 ------- 1 file changed, 7 deletions(-)
fs/xfs/xfs_trans.h +0 -7
@@ -86,17 +86,10 @@ struct xfs_item_ops {#define XFS_ITEM_FLUSHING 3/* -* This is the type of function which can be given to xfs_trans_callback() -* to be called upon the transaction's commit to disk. -*/ -typedef void (*xfs_trans_callback_t )(struct xfs_trans *,void *); - -/* * This is the structure maintained for every active transaction. */ typedef struct xfs_trans { unsigned int t_magic; /* magic number */ - xfs_log_callback_t t_logcb; /* log callback struct */ unsigned int t_type; /* transaction type */ unsigned int t_log_res; /* amt of log space resvd */ unsigned int t_log_count; /* count for perm log res */
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 3/19 xfs: prevent deadlock trying to cover an active log
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Recent analysis of a deadlocked XFS filesystem from a kernel crash dump indicated that the filesystem was stuck waiting for log space. The short story of the hang on the RHEL6 kernel is this:
- the tail of the log is pinned by an inode
- the inode has been pushed by the xfsaild
- the inode has been flushed to it's backing buffer and is currently flush locked and hence waiting for backing buffer IO to complete and remove it from the AIL
- the backing buffer is marked for write - it is on the delayed write queue
- the inode buffer has been modified directly and logged recently due to unlinked inode list modification
- the backing buffer is pinned in memory as it is in the active CIL context.
- the xfsbufd won't start buffer writeback because it is pinned
- xfssyncd won't force the log because it sees the log as needing to be covered and hence wants to issue a dummy transaction to move the log covering state machine along.
Hence there is no trigger to force the CIL to the log and hence unpin the inode buffer and therefore complete the inode IO, remove it from the AIL and hence move the tail of the log along, allowing transactions to start again.
Mainline kernels also have the same deadlock, though the signature is slightly different - the inode buffer never reaches the delayed write lists because xfs_buf_item_push() sees that it is pinned and hence never adds it to the delayed write list that the xfsaild flushes.
There are two possible solutions here. The first is to simply force the log before trying to cover the log and so ensure that the CIL is emptied before we try to reserve space for the dummy transaction in the xfs_log_worker(). While this might work most of the time, it is still racy and is no guarantee that we don't get stuck in xfs_trans_reserve waiting for log space to come free. Hence it's not the best way to solve the problem.
The second solution is to modify xfs_log_need_covered() to be aware of the CIL. We only should be attempting to cover the log if there is no current activity in the log - covering the log is the process of ensuring that the head and tail in the log on disk are identical (i.e. the log is clean and at idle). Hence, by definition, if there are items in the CIL then the log is not at idle and so we don't need to attempt to cover it.
When we don't need to cover the log because it is active or idle, we issue a log force from xfs_log_worker() - if the log is idle, then this does nothing. However, if the log is active due to there being items in the CIL, it will force the items in the CIL to the log and unpin them.
In the case of the above deadlock scenario, instead of xfs_log_worker() getting stuck in xfs_trans_reserve() attempting to cover the log, it will instead force the log, thereby unpinning the inode buffer, allowing IO to be issued and complete and hence removing the inode that was pinning the tail of the log from the AIL. At that point, everything will start moving along again. i.e. the xfs_log_worker turns back into a watchdog that can alleviate deadlocks based around pinned items that prevent the tail of the log from being moved...
--- fs/xfs/xfs_log.c | 48 +++++++++++++++++++++++++++++------------------- fs/xfs/xfs_log_cil.c | 14 ++++++++++++++ fs/xfs/xfs_log_priv.h | 10 ++++------ 3 files changed, 47 insertions(+), 25 deletions(-)
fs/xfs/xfs_log.c +29 -19
@@ -1000,27 +1000,34 @@ xfs_log_space_wake( }/* -* Determine if we have a transaction that has gone to disk -* that needs to be covered. To begin the transition to the idle state -* firstly the log needs to be idle (no AIL and nothing in the iclogs). -* If we are then in a state where covering is needed, the caller is informed -* that dummy transactions are required to move the log into the idle state. +* Determine if we have a transaction that has gone to disk that needs to be +* covered. To begin the transition to the idle state firstly the log needs to +* be idle. That means the CIL, the AIL and the iclogs needs to be empty before +* we start attempting to cover the log. * -* Because this is called as part of the sync process, we should also indicate -* that dummy transactions should be issued in anything but the covered or -* idle states. This ensures that the log tail is accurately reflected in -* the log at the end of the sync, hence if a crash occurrs avoids replay -* of transactions where the metadata is already on disk. +* Only if we are then in a state where covering is needed, the caller is +* informed that dummy transactions are required to move the log into the idle +* state. +* +* If there are any items in the AIl or CIL, then we do not want to attempt to +* cover the log as we may be in a situation where there isn't log space +* available to run a dummy transaction and this can lead to deadlocks when the +* tail of the log is pinned by an item that is modified in the CIL. Hence +* there's no point in running a dummy transaction at this point because we +* can't start trying to idle the log until both the CIL and AIL are empty. */ int xfs_log_need_covered (xfs_mount_t *mp) { -int needed =0 ;struct xlog *log = mp->m_log; +int needed =0 ;if (!xfs_fs_writable (mp))return 0 ; +if (!xlog_cil_empty (log)) +return 0 ; +spin_lock (&log->l_icloglock);switch (log->l_covered_state) {case XLOG_STATE_COVER_DONE :
@@ -1029,14 +1036,17 @@ xfs_log_need_covered(xfs_mount_t *mp)break ;case XLOG_STATE_COVER_NEED :case XLOG_STATE_COVER_NEED2 : -if (!xfs_ail_min_lsn (log->l_ailp) && -xlog_iclogs_empty (log)) { -if (log->l_covered_state ==XLOG_STATE_COVER_NEED ) - log->l_covered_state =XLOG_STATE_COVER_DONE ; -else - log->l_covered_state =XLOG_STATE_COVER_DONE2 ; - } -/* FALLTHRU */ +if (xfs_ail_min_lsn (log->l_ailp)) +break ; +if (!xlog_iclogs_empty (log)) +break ; + + needed =1 ; +if (log->l_covered_state ==XLOG_STATE_COVER_NEED ) + log->l_covered_state =XLOG_STATE_COVER_DONE ; +else + log->l_covered_state =XLOG_STATE_COVER_DONE2 ; +break ;default : needed =1 ;break ;
fs/xfs/xfs_log_cil.c +14 -0
@@ -711,6 +711,20 @@ xlog_cil_push_foreground(xlog_cil_push (log); } +bool +xlog_cil_empty ( +struct xlog *log) +{ +struct xfs_cil *cil = log->l_cilp; +bool empty = false; + +spin_lock (&cil->xc_push_lock); +if (list_empty (&cil->xc_cil)) + empty = true; +spin_unlock (&cil->xc_push_lock); +return empty; +} +/* * Commit a transaction with the given vector to the Committed Item List. *
fs/xfs/xfs_log_priv.h +4 -6
@@ -514,12 +514,10 @@ xlog_assign_grant_head(atomic64_t *head, int cycle, int space)/* * Committed Item List interfaces */ -int -xlog_cil_init (struct xlog *log); -void -xlog_cil_init_post_recovery (struct xlog *log); -void -xlog_cil_destroy (struct xlog *log); +int xlog_cil_init (struct xlog *log); +void xlog_cil_init_post_recovery (struct xlog *log); +void xlog_cil_destroy (struct xlog *log); +bool xlog_cil_empty (struct xlog *log);/* * CIL force routines
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 1/19 xfs: xfs_remove deadlocks due to inverted AGF vs AGI lock ordering
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Removing an inode from the namespace involves removing the directory entry and dropping the link count on the inode. Removing the directory entry can result in locking an AGF (directory blocks were freed) and removing a link count can result in placing the inode on an unlinked list which results in locking an AGI.
The big problem here is that we have an ordering constraint on AGF and AGI locking - inode allocation locks the AGI, then can allocate a new extent for new inodes, locking the AGF after the AGI. Similarly, freeing the inode removes the inode from the unlinked list, requiring that we lock the AGI first, and then freeing the inode can result in an inode chunk being freed and hence freeing disk space requiring that we lock an AGF.
Hence the ordering that is imposed by other parts of the code is AGI before AGF. This means we cannot remove the directory entry before we drop the inode reference count and put it on the unlinked list as this results in a lock order of AGF then AGI, and this can deadlock against inode allocation and freeing. Therefore we must drop the link counts before we remove the directory entry.
This is still safe from a transactional point of view - it is not until we get to xfs_bmap_finish() that we have the possibility of multiple transactions in this operation. Hence as long as we remove the directory entry and drop the link count in the first transaction of the remove operation, there are no transactional constraints on the ordering here.
Change the ordering of the operations in the xfs_remove() function to align the ordering of AGI and AGF locking to match that of the rest of the code.
--- fs/xfs/xfs_inode.c | 72 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 28 deletions(-)
fs/xfs/xfs_inode.c +44 -28
@@ -2405,6 +2405,33 @@ xfs_iunpin_wait(__xfs_iunpin_wait (ip); } +/* +* Removing an inode from the namespace involves removing the directory entry +* and dropping the link count on the inode. Removing the directory entry can +* result in locking an AGF (directory blocks were freed) and removing a link +* count can result in placing the inode on an unlinked list which results in +* locking an AGI. +* +* The big problem here is that we have an ordering constraint on AGF and AGI +* locking - inode allocation locks the AGI, then can allocate a new extent for +* new inodes, locking the AGF after the AGI. Similarly, freeing the inode +* removes the inode from the unlinked list, requiring that we lock the AGI +* first, and then freeing the inode can result in an inode chunk being freed +* and hence freeing disk space requiring that we lock an AGF. +* +* Hence the ordering that is imposed by other parts of the code is AGI before +* AGF. This means we cannot remove the directory entry before we drop the inode +* reference count and put it on the unlinked list as this results in a lock +* order of AGF then AGI, and this can deadlock against inode allocation and +* freeing. Therefore we must drop the link counts before we remove the +* directory entry. +* +* This is still safe from a transactional point of view - it is not until we +* get to xfs_bmap_finish() that we have the possibility of multiple +* transactions in this operation. Hence as long as we remove the directory +* entry and drop the link count in the first transaction of the remove +* operation, there are no transactional constraints on the ordering here. +*/ int xfs_remove( xfs_inode_t *dp,
@@ -2474,6 +2501,7 @@ xfs_remove(/* * If we're removing a directory perform some additional validation. */ + cancel_flags |=XFS_TRANS_ABORT ;if (is_dir) {ASSERT (ip->i_d.di_nlink >=2 );if (ip->i_d.di_nlink !=2 ) {
@@ -2484,31 +2512,16 @@ xfs_remove( error =XFS_ERROR (ENOTEMPTY ); goto out_trans_cancel; } - } -xfs_bmap_init (&free_list, &first_block); - error =xfs_dir_removename (tp, dp, name, ip->i_ino, - &first_block, &free_list, resblks); -if (error) { -ASSERT (error !=ENOENT ); - goto out_bmap_cancel; - } -xfs_trans_ichgtime (tp, dp,XFS_ICHGTIME_MOD |XFS_ICHGTIME_CHG ); - -if (is_dir) { -/* -* Drop the link from ip's "..". -*/ +/* Drop the link from ip's "..". */ error =xfs_droplink (tp, dp);if (error) - goto out_bmap_cancel; + goto out_trans_cancel; -/* -* Drop the "." link from ip to self. -*/ +/* Drop the "." link from ip to self. */ error =xfs_droplink (tp, ip);if (error) - goto out_bmap_cancel; + goto out_trans_cancel; }else {/* * When removing a non-directory we need to log the parent
@@ -2517,20 +2530,24 @@ xfs_remove(*/ xfs_trans_log_inode (tp, dp,XFS_ILOG_CORE ); } +xfs_trans_ichgtime (tp, dp,XFS_ICHGTIME_MOD |XFS_ICHGTIME_CHG ); -/* -* Drop the link from dp to ip. -*/ +/* Drop the link from dp to ip. */ error =xfs_droplink (tp, ip);if (error) - goto out_bmap_cancel; + goto out_trans_cancel; -/* -* Determine if this is the last link while -* we are in the transaction. -*/ +/* Determine if this is the last link while the inode is locked */ link_zero = (ip->i_d.di_nlink ==0 ); +xfs_bmap_init (&free_list, &first_block); + error =xfs_dir_removename (tp, dp, name, ip->i_ino, + &first_block, &free_list, resblks); +if (error) { +ASSERT (error !=ENOENT ); + goto out_bmap_cancel; + } +/* * If this is a synchronous mount, make sure that the * remove transaction goes to disk before returning to
@@ -2560,7 +2577,6 @@ xfs_remove( out_bmap_cancel:xfs_bmap_cancel (&free_list); - cancel_flags |=XFS_TRANS_ABORT ; out_trans_cancel:xfs_trans_cancel (tp, cancel_flags); std_return:
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
v2 cover xfs: patches for 3.13
Hi folks,
This is an update of the previous patches I sent here:
http://oss.sgi.com/pipermail/xfs/2013-September/030390.html
http://oss.sgi.com/pipermail/xfs/2013-September/030398.html
I've addressed the review comments from Eric, Ben and Christoph and fixed the non-debug build failure that Michael Semon reported. Comments and testing welcome.
Cheers,
Dave.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 4/19 xfs: create a shared header file for format-related information
All of the buffer operations structures are needed to be exported for xfs_db, so move them all to a common location rather than spreading them all over the place. They are verifying the on-disk format, so while xfs_format.h might be a good place, it is not part of the on disk format.
Hence we need to create a new header file that we centralise these related definitions. Start by moving the bffer operations structures, and then also move all the other definitions that have crept into xfs_log_format.h and xfs_format.h as there was no other shared header file to put them in.
--- fs/xfs/xfs_ag.h | 4 - fs/xfs/xfs_alloc.c | 3 +- fs/xfs/xfs_alloc.h | 3 - fs/xfs/xfs_alloc_btree.h | 2 - fs/xfs/xfs_aops.c | 4 +- fs/xfs/xfs_attr.c | 1 + fs/xfs/xfs_attr_inactive.c | 1 + fs/xfs/xfs_attr_leaf.h | 2 - fs/xfs/xfs_attr_remote.h | 2 - fs/xfs/xfs_bmap.c | 1 + fs/xfs/xfs_bmap_btree.h | 2 - fs/xfs/xfs_bmap_util.c | 1 + fs/xfs/xfs_btree.c | 2 +- fs/xfs/xfs_da_btree.c | 3 +- fs/xfs/xfs_da_btree.h | 2 - fs/xfs/xfs_dquot.c | 1 + fs/xfs/xfs_dquot.h | 2 - fs/xfs/xfs_extent_busy.c | 3 +- fs/xfs/xfs_format.h | 10 -- fs/xfs/xfs_fsops.c | 2 + fs/xfs/xfs_ialloc.c | 3 +- fs/xfs/xfs_ialloc.h | 2 - fs/xfs/xfs_ialloc_btree.h | 2 - fs/xfs/xfs_icreate_item.c | 2 +- fs/xfs/xfs_inode.c | 1 + fs/xfs/xfs_inode_buf.c | 1 + fs/xfs/xfs_inode_buf.h | 3 - fs/xfs/xfs_ioctl.c | 1 + fs/xfs/xfs_iomap.c | 1 + fs/xfs/xfs_iops.c | 1 + fs/xfs/xfs_itable.c | 2 +- fs/xfs/xfs_log.c | 2 +- fs/xfs/xfs_log_cil.c | 2 +- fs/xfs/xfs_log_format.h | 177 -------------------------------- fs/xfs/xfs_log_recover.c | 1 + fs/xfs/xfs_log_rlimit.c | 1 + fs/xfs/xfs_mount.c | 1 + fs/xfs/xfs_qm.c | 1 + fs/xfs/xfs_qm_syscalls.c | 1 + fs/xfs/xfs_quota.h | 2 - fs/xfs/xfs_rtalloc.c | 1 + fs/xfs/xfs_sb.h | 3 - fs/xfs/xfs_shared.h | 244 ++++++++++++++++++++++++++++++++++++++++++++ fs/xfs/xfs_super.c | 1 + fs/xfs/xfs_symlink.c | 1 + fs/xfs/xfs_symlink_remote.c | 1 + fs/xfs/xfs_trace.c | 2 +- fs/xfs/xfs_trans.c | 1 + fs/xfs/xfs_trans_buf.c | 2 +- fs/xfs/xfs_trans_dquot.c | 1 + fs/xfs/xfs_trans_extfree.c | 2 +- fs/xfs/xfs_trans_inode.c | 2 +- fs/xfs/xfs_trans_resv.c | 1 + 53 files changed, 288 insertions(+), 232 deletions(-) create mode 100644 fs/xfs/xfs_shared.h
fs/xfs/xfs_ag.h +0 -4
@@ -128,8 +128,6 @@ typedef struct xfs_agf {extern int xfs_read_agf (struct xfs_mount *mp,struct xfs_trans *tp,xfs_agnumber_t agno,int flags,struct xfs_buf **bpp); -extern const struct xfs_buf_ops xfs_agf_buf_ops; -/* * Size of the unlinked inode hash table in the agi. */
@@ -191,8 +189,6 @@ typedef struct xfs_agi {extern int xfs_read_agi (struct xfs_mount *mp,struct xfs_trans *tp,xfs_agnumber_t agno,struct xfs_buf **bpp); -extern const struct xfs_buf_ops xfs_agi_buf_ops; -/* * The third a.g. block contains the a.g. freelist, an array * of block pointers to blocks owned by the allocation btree code.
fs/xfs/xfs_alloc.c +2 -1
@@ -17,7 +17,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_alloc.h +0 -3
@@ -231,7 +231,4 @@ xfs_alloc_get_rec( xfs_extlen_t *len,/* output: length of extent */ int *stat); /* output: success/failure */ -extern const struct xfs_buf_ops xfs_agf_buf_ops; -extern const struct xfs_buf_ops xfs_agfl_buf_ops; -#endif /* __XFS_ALLOC_H__ */
fs/xfs/xfs_alloc_btree.h +0 -2
@@ -95,6 +95,4 @@ extern struct xfs_btree_cur *xfs_allocbt_init_cursor(struct xfs_mount *, xfs_agnumber_t, xfs_btnum_t);extern int xfs_allocbt_maxrecs (struct xfs_mount *,int ,int ); -extern const struct xfs_buf_ops xfs_allocbt_buf_ops; -#endif /* __XFS_ALLOC_BTREE_H__ */
fs/xfs/xfs_aops.c +3 -1
@@ -16,9 +16,11 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" -#include "xfs_log.h" +#include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_sb.h" #include "xfs_ag.h" +#include "xfs_log.h" #include "xfs_trans.h" #include "xfs_mount.h" #include "xfs_bmap_btree.h"
fs/xfs/xfs_attr.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_attr_inactive.c +1 -0
@@ -19,6 +19,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_attr_leaf.h +0 -2
@@ -336,6 +336,4 @@ void xfs_attr3_leaf_hdr_from_disk(struct xfs_attr3_icleaf_hdr *to,void xfs_attr3_leaf_hdr_to_disk (struct xfs_attr_leafblock *to,struct xfs_attr3_icleaf_hdr *from); -extern const struct xfs_buf_ops xfs_attr3_leaf_buf_ops; -#endif /* __XFS_ATTR_LEAF_H__ */
fs/xfs/xfs_attr_remote.h +0 -2
@@ -45,8 +45,6 @@ struct xfs_attr3_rmt_hdr { ((bufsize) - (xfs_sb_version_hascrc (&(mp)->m_sb) ? \ sizeof(struct xfs_attr3_rmt_hdr) : 0)) -extern const struct xfs_buf_ops xfs_attr3_rmt_buf_ops; -int xfs_attr3_rmt_blocks (struct xfs_mount *mp,int attrlen);int xfs_attr_rmtval_get (struct xfs_da_args *args);
fs/xfs/xfs_bmap.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_inum.h"
fs/xfs/xfs_bmap_btree.h +0 -2
@@ -243,6 +243,4 @@ extern int xfs_bmbt_change_owner(struct xfs_trans *tp, struct xfs_inode *ip,extern struct xfs_btree_cur *xfs_bmbt_init_cursor (struct xfs_mount *,struct xfs_trans *,struct xfs_inode *,int ); -extern const struct xfs_buf_ops xfs_bmbt_buf_ops; -#endif /* __XFS_BMAP_BTREE_H__ */
fs/xfs/xfs_bmap_util.c +1 -0
@@ -19,6 +19,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_inum.h"
fs/xfs/xfs_btree.c +1 -1
@@ -17,7 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_da_btree.c +2 -1
@@ -18,7 +18,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_da_btree.h +0 -2
@@ -309,8 +309,6 @@ int xfs_da3_node_read(struct xfs_trans *tp, struct xfs_inode *dp, xfs_dablk_t bno, xfs_daddr_t mappedbno, struct xfs_buf **bpp, int which_fork); -extern const struct xfs_buf_ops xfs_da3_node_buf_ops; -/* * Utility routines. */
fs/xfs/xfs_dquot.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_dquot.h +0 -2
@@ -172,6 +172,4 @@ static inline struct xfs_dquot *xfs_qm_dqhold(struct xfs_dquot *dqp) return dqp; } -extern const struct xfs_buf_ops xfs_dquot_buf_ops; -#endif /* __XFS_DQUOT_H__ */
fs/xfs/xfs_extent_busy.c +2 -1
@@ -19,7 +19,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_format.h +0 -10
@@ -156,14 +156,4 @@ struct xfs_dsymlink_hdr { ((bufsize) - (xfs_sb_version_hascrc (&(mp)->m_sb) ? \ sizeof(struct xfs_dsymlink_hdr) : 0)) -int xfs_symlink_blocks (struct xfs_mount *mp,int pathlen); -int xfs_symlink_hdr_set (struct xfs_mount *mp,xfs_ino_t ino,uint32_t offset, -uint32_t size,struct xfs_buf *bp); -bool xfs_symlink_hdr_ok (struct xfs_mount *mp,xfs_ino_t ino,uint32_t offset, -uint32_t size,struct xfs_buf *bp); -void xfs_symlink_local_to_remote (struct xfs_trans *tp,struct xfs_buf *bp, -struct xfs_inode *ip,struct xfs_ifork *ifp); - -extern const struct xfs_buf_ops xfs_symlink_buf_ops; -#endif /* __XFS_FORMAT_H__ */
fs/xfs/xfs_fsops.c +2 -0
@@ -18,6 +18,8 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_types.h" +#include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_ialloc.c +2 -1
@@ -17,7 +17,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_inum.h"
fs/xfs/xfs_ialloc.h +0 -2
@@ -158,6 +158,4 @@ int xfs_ialloc_inode_init(struct xfs_mount *mp, struct xfs_trans *tp, xfs_agnumber_t agno, xfs_agblock_t agbno, xfs_agblock_t length, unsigned int gen); -extern const struct xfs_buf_ops xfs_agi_buf_ops; -#endif /* __XFS_IALLOC_H__ */
fs/xfs/xfs_ialloc_btree.h +0 -2
@@ -110,6 +110,4 @@ extern struct xfs_btree_cur *xfs_inobt_init_cursor(struct xfs_mount *, struct xfs_trans *, struct xfs_buf *, xfs_agnumber_t);extern int xfs_inobt_maxrecs (struct xfs_mount *,int ,int ); -extern const struct xfs_buf_ops xfs_inobt_buf_ops; -#endif /* __XFS_IALLOC_BTREE_H__ */
fs/xfs/xfs_icreate_item.c +1 -1
@@ -17,7 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_inode.c +1 -0
@@ -20,6 +20,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_inum.h" #include "xfs_trans.h"
fs/xfs/xfs_inode_buf.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_inode_buf.h +0 -3
@@ -47,7 +47,4 @@ void xfs_inobp_check(struct xfs_mount *, struct xfs_buf *);#define xfs_inobp_check (mp, bp)#endif /* DEBUG */ -extern const struct xfs_buf_ops xfs_inode_buf_ops; -extern const struct xfs_buf_ops xfs_inode_buf_ra_ops; -#endif /* __XFS_INODE_BUF_H__ */
fs/xfs/xfs_ioctl.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_iomap.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_iops.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_acl.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_itable.c +1 -1
@@ -17,7 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_inum.h" #include "xfs_trans.h"
fs/xfs/xfs_log.c +1 -1
@@ -17,7 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_log_cil.c +1 -1
@@ -17,7 +17,7 @@#include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_trans_priv.h"
fs/xfs/xfs_log_format.h +0 -177
193 lines not on this page · raw message
fs/xfs/xfs_log_recover.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_inum.h"
fs/xfs/xfs_log_rlimit.c +1 -0
@@ -17,6 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_ag.h"
fs/xfs/xfs_mount.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_inum.h"
fs/xfs/xfs_qm.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_qm_syscalls.c +1 -0
@@ -21,6 +21,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_quota.h +0 -2
@@ -154,6 +154,4 @@ extern int xfs_qm_dqcheck(struct xfs_mount *, xfs_disk_dquot_t *, xfs_dqid_t, uint, uint, char *);extern int xfs_mount_reset_sbqflags (struct xfs_mount *); -extern const struct xfs_buf_ops xfs_dquot_buf_ops; -#endif /* __XFS_QUOTA_H__ */
fs/xfs/xfs_rtalloc.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_sb.h +0 -3
@@ -699,7 +699,4 @@ extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *);extern void xfs_sb_to_disk (struct xfs_dsb *,struct xfs_sb *,__int64_t );extern void xfs_sb_quota_from_disk (struct xfs_sb *sbp); -extern const struct xfs_buf_ops xfs_sb_buf_ops; -extern const struct xfs_buf_ops xfs_sb_quiet_buf_ops; -#endif /* __XFS_SB_H__ */
fs/xfs/xfs_shared.h new file +244 -0
244 lines not on this page · raw message
fs/xfs/xfs_super.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_inum.h" #include "xfs_trans.h"
fs/xfs/xfs_symlink.c +1 -0
@@ -19,6 +19,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_symlink_remote.c +1 -0
@@ -19,6 +19,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_ag.h"
fs/xfs/xfs_trace.c +1 -1
@@ -17,8 +17,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_trans.c +1 -0
@@ -19,6 +19,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_trans_buf.c +1 -1
@@ -17,7 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_trans_dquot.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_trans_extfree.c +1 -1
@@ -17,7 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_trans_inode.c +1 -1
@@ -17,7 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_trans_resv.c +1 -0
@@ -19,6 +19,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans_resv.h" #include "xfs_trans.h"
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 8/19 xfs: decouple log and transaction headers
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
xfs_trans.h has a dependency on xfs_log.h for a couple of structures. Most code that does transactions doesn't need to know anything about the log, bu this dependency means that they have to include xfs_log.h. Decouple the xfs_trans.h and xfs_log.h header files and clean up the includes to be in dependency order.
In doing this, remove the direct include of xfs_trans_reserve.h from xfs_trans.h so that we remove the dependency between xfs_trans.h and xfs_mount.h. Hence the xfs_trans.h include can be moved to the indicate the actual dependencies oher header files have on it.
Note that these are kernel only header files, so this does not translate to any userspace changes at all.
--- fs/xfs/xfs_alloc.c | 6 ++++-- fs/xfs/xfs_alloc_btree.c | 6 +++--- fs/xfs/xfs_aops.c | 7 ++++--- fs/xfs/xfs_attr.c | 8 ++++---- fs/xfs/xfs_attr_inactive.c | 8 ++++---- fs/xfs/xfs_attr_leaf.c | 7 +++---- fs/xfs/xfs_attr_list.c | 6 +++--- fs/xfs/xfs_attr_remote.c | 7 +++---- fs/xfs/xfs_bit.c | 5 +---- fs/xfs/xfs_bmap.c | 7 ++++--- fs/xfs/xfs_bmap_btree.c | 5 +++-- fs/xfs/xfs_bmap_util.c | 9 +++++---- fs/xfs/xfs_btree.c | 5 +++-- fs/xfs/xfs_buf.c | 5 +++-- fs/xfs/xfs_buf_item.c | 7 ++++--- fs/xfs/xfs_da_btree.c | 7 ++++--- fs/xfs/xfs_dir2.c | 6 +++--- fs/xfs/xfs_dir2_block.c | 6 +++--- fs/xfs/xfs_dir2_data.c | 6 +++--- fs/xfs/xfs_dir2_leaf.c | 6 +++--- fs/xfs/xfs_dir2_node.c | 6 +++--- fs/xfs/xfs_dir2_readdir.c | 6 +++--- fs/xfs/xfs_dir2_sf.c | 6 +++--- fs/xfs/xfs_discard.c | 5 +++-- fs/xfs/xfs_dquot.c | 10 ++++++---- fs/xfs/xfs_dquot_buf.c | 5 +++-- fs/xfs/xfs_dquot_item.c | 6 ++++-- fs/xfs/xfs_error.c | 5 ++--- fs/xfs/xfs_export.c | 7 ++++--- fs/xfs/xfs_extent_busy.c | 6 ++++-- fs/xfs/xfs_extfree_item.c | 8 ++++---- fs/xfs/xfs_file.c | 6 ++++-- fs/xfs/xfs_filestream.c | 10 +++++----- fs/xfs/xfs_fsops.c | 9 +++++---- fs/xfs/xfs_ialloc.c | 7 ++++--- fs/xfs/xfs_ialloc_btree.c | 6 +++--- fs/xfs/xfs_icache.c | 9 ++++----- fs/xfs/xfs_icreate_item.c | 5 +++-- fs/xfs/xfs_inode.c | 12 +++++++----- fs/xfs/xfs_inode_buf.c | 7 ++++--- fs/xfs/xfs_inode_fork.c | 6 +++--- fs/xfs/xfs_inode_item.c | 8 ++++---- fs/xfs/xfs_ioctl.c | 7 ++++--- fs/xfs/xfs_ioctl32.c | 4 ++-- fs/xfs/xfs_iomap.c | 11 ++++++----- fs/xfs/xfs_iops.c | 13 +++++++------ fs/xfs/xfs_itable.c | 4 ++-- fs/xfs/xfs_log.c | 8 +++++--- fs/xfs/xfs_log.h | 10 ++-------- fs/xfs/xfs_log_cil.c | 10 ++++++---- fs/xfs/xfs_log_priv.h | 7 ++++--- fs/xfs/xfs_log_recover.c | 13 +++++-------- fs/xfs/xfs_log_rlimit.c | 4 ++-- fs/xfs/xfs_message.c | 5 ++--- fs/xfs/xfs_mount.c | 10 ++++++---- fs/xfs/xfs_qm.c | 9 +++++---- fs/xfs/xfs_qm_bhv.c | 5 +++-- fs/xfs/xfs_qm_syscalls.c | 7 ++++--- fs/xfs/xfs_quotaops.c | 2 +- fs/xfs/xfs_rtalloc.c | 7 ++++--- fs/xfs/xfs_sb.c | 7 ++++--- fs/xfs/xfs_super.c | 8 +++++--- fs/xfs/xfs_symlink.c | 8 +++++--- fs/xfs/xfs_symlink_remote.c | 5 +++-- fs/xfs/xfs_trace.c | 8 +++++--- fs/xfs/xfs_trans.c | 10 ++++++---- fs/xfs/xfs_trans.h | 10 +++++----- fs/xfs/xfs_trans_ail.c | 7 ++++--- fs/xfs/xfs_trans_buf.c | 5 +++-- fs/xfs/xfs_trans_dquot.c | 7 ++++--- fs/xfs/xfs_trans_extfree.c | 5 +++-- fs/xfs/xfs_trans_inode.c | 5 +++-- fs/xfs/xfs_trans_priv.h | 1 - fs/xfs/xfs_trans_resv.c | 6 +++--- fs/xfs/xfs_xattr.c | 3 +-- 75 files changed, 276 insertions(+), 239 deletions(-)
fs/xfs/xfs_alloc.c +4 -2
@@ -18,10 +18,10 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" #include "xfs_shared.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -36,7 +36,9 @@#include "xfs_error.h" #include "xfs_cksum.h" #include "xfs_trace.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" +#include "xfs_log.h" struct workqueue_struct *xfs_alloc_wq;
fs/xfs/xfs_alloc_btree.c +3 -3
@@ -17,9 +17,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -34,6 +33,7 @@#include "xfs_error.h" #include "xfs_trace.h" #include "xfs_cksum.h" +#include "xfs_trans.h" STATIC struct xfs_btree_cur *
fs/xfs/xfs_aops.c +4 -3
@@ -16,16 +16,17 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_mount.h" #include "xfs_bmap_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_alloc.h" #include "xfs_error.h"
fs/xfs/xfs_attr.c +4 -4
@@ -17,12 +17,11 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -33,6 +32,7 @@#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_alloc.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h"
fs/xfs/xfs_attr_inactive.c +4 -4
@@ -18,11 +18,11 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -36,6 +36,7 @@#include "xfs_attr_remote.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_attr.h"
@@ -43,7 +44,6 @@#include "xfs_error.h" #include "xfs_quota.h" #include "xfs_trace.h" -#include "xfs_trans_priv.h" /* * Look at all the extents for this logical region,
fs/xfs/xfs_attr_leaf.c +3 -4
@@ -18,11 +18,9 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -37,6 +35,7 @@#include "xfs_attr_remote.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_attr.h"
fs/xfs/xfs_attr_list.c +3 -3
@@ -18,10 +18,9 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -36,6 +35,7 @@#include "xfs_attr_remote.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_attr.h"
fs/xfs/xfs_attr_remote.c +3 -4
@@ -18,11 +18,9 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -33,6 +31,7 @@#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_alloc.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h"
fs/xfs/xfs_bit.c +1 -4
@@ -16,10 +16,7 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" -#include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" -#include "xfs_buf_item.h" +#include "xfs_log_format.h" /* * XFS bit manipulation routines, used in non-realtime code.
fs/xfs/xfs_bmap.c +4 -3
@@ -17,12 +17,12 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" #include "xfs_inum.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -37,6 +37,7 @@#include "xfs_btree.h" #include "xfs_mount.h" #include "xfs_itable.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_extfree_item.h" #include "xfs_alloc.h"
fs/xfs/xfs_bmap_btree.c +3 -2
@@ -18,9 +18,9 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -29,6 +29,7 @@#include "xfs_ialloc_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_alloc.h" #include "xfs_btree.h"
fs/xfs/xfs_bmap_util.c +5 -4
@@ -18,12 +18,11 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_inum.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -34,6 +33,7 @@#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_trans.h" #include "xfs_extfree_item.h" #include "xfs_alloc.h" #include "xfs_bmap.h"
@@ -44,6 +44,7 @@#include "xfs_trans_space.h" #include "xfs_trace.h" #include "xfs_icache.h" +#include "xfs_log.h" /* Kernel only BMAP related definitions and functions */
fs/xfs/xfs_btree.c +3 -2
@@ -18,9 +18,9 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -29,6 +29,7 @@#include "xfs_ialloc_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_buf_item.h" #include "xfs_btree.h"
fs/xfs/xfs_buf.c +3 -2
@@ -34,12 +34,13 @@#include <linux/backing-dev.h> #include <linux/freezer.h> -#include "xfs_sb.h" +#include "xfs_log_format.h" #include "xfs_trans_resv.h" -#include "xfs_log.h" +#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_trace.h" +#include "xfs_log.h" static kmem_zone_t *xfs_buf_zone;
fs/xfs/xfs_buf_item.c +4 -3
@@ -17,17 +17,18 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_trans_priv.h" #include "xfs_error.h" #include "xfs_trace.h" +#include "xfs_log.h" kmem_zone_t *xfs_buf_item_zone;
fs/xfs/xfs_da_btree.c +4 -3
@@ -18,11 +18,11 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -33,6 +33,7 @@#include "xfs_dir2_priv.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_alloc.h" #include "xfs_bmap.h"
fs/xfs/xfs_dir2.c +3 -3
@@ -17,10 +17,9 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_inum.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -30,6 +29,7 @@#include "xfs_alloc_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_dir2.h"
fs/xfs/xfs_dir2_block.c +3 -3
@@ -18,9 +18,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -29,6 +28,7 @@#include "xfs_bmap_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_buf_item.h"
fs/xfs/xfs_dir2_data.c +3 -3
@@ -18,9 +18,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -32,6 +31,7 @@#include "xfs_dir2.h" #include "xfs_dir2_priv.h" #include "xfs_error.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_cksum.h"
fs/xfs/xfs_dir2_leaf.c +3 -3
@@ -18,10 +18,9 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -35,6 +34,7 @@#include "xfs_dir2_priv.h" #include "xfs_error.h" #include "xfs_trace.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_cksum.h"
fs/xfs/xfs_dir2_node.c +3 -3
@@ -18,9 +18,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -34,6 +33,7 @@#include "xfs_dir2_priv.h" #include "xfs_error.h" #include "xfs_trace.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_cksum.h"
fs/xfs/xfs_dir2_readdir.c +3 -3
@@ -18,10 +18,9 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -35,6 +34,7 @@#include "xfs_error.h" #include "xfs_trace.h" #include "xfs_bmap.h" +#include "xfs_trans.h" /* * Directory file type support functions
fs/xfs/xfs_dir2_sf.c +3 -3
@@ -17,9 +17,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -28,6 +27,7 @@#include "xfs_bmap_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_error.h" #include "xfs_dir2.h"
fs/xfs/xfs_discard.c +3 -2
@@ -17,8 +17,8 @@*/ #include "xfs.h" #include "xfs_format.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -33,6 +33,7 @@#include "xfs_extent_busy.h" #include "xfs_discard.h" #include "xfs_trace.h" +#include "xfs_log.h" STATIC int xfs_trim_extents(
fs/xfs/xfs_dquot.c +6 -4
@@ -18,29 +18,31 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" #include "xfs_shared.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_alloc.h" -#include "xfs_quota.h" #include "xfs_mount.h" #include "xfs_bmap_btree.h" #include "xfs_inode.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" +#include "xfs_alloc.h" +#include "xfs_quota.h" #include "xfs_rtalloc.h" #include "xfs_error.h" #include "xfs_itable.h" #include "xfs_attr.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_trans_space.h" #include "xfs_trans_priv.h" #include "xfs_qm.h" #include "xfs_cksum.h" #include "xfs_trace.h" +#include "xfs_log.h" /* * Lock order:
fs/xfs/xfs_dquot_buf.c +3 -2
@@ -19,15 +19,16 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_bmap_btree.h" #include "xfs_inode.h" #include "xfs_quota.h" +#include "xfs_trans.h" #include "xfs_qm.h" #include "xfs_error.h" #include "xfs_cksum.h"
fs/xfs/xfs_dquot_item.c +4 -2
@@ -18,8 +18,8 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_alloc.h"
@@ -32,9 +32,11 @@#include "xfs_error.h" #include "xfs_itable.h" #include "xfs_attr.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_trans_priv.h" #include "xfs_qm.h" +#include "xfs_log.h" static inline struct xfs_dq_logitem *DQUOT_ITEM (struct xfs_log_item *lip) {
fs/xfs/xfs_error.c +2 -3
@@ -17,9 +17,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
fs/xfs/xfs_export.c +4 -3
@@ -16,9 +16,8 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -27,9 +26,11 @@#include "xfs_export.h" #include "xfs_bmap_btree.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_trace.h" #include "xfs_icache.h" +#include "xfs_log.h" /* * Note that we only accept fileids which are long enough rather than allow
fs/xfs/xfs_extent_busy.c +4 -2
@@ -20,9 +20,9 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -31,6 +31,8 @@#include "xfs_inode.h" #include "xfs_extent_busy.h" #include "xfs_trace.h" +#include "xfs_trans.h" +#include "xfs_log.h" void xfs_extent_busy_insert(
fs/xfs/xfs_extfree_item.c +4 -4
@@ -17,14 +17,14 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" -#include "xfs_buf_item.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_trans.h" #include "xfs_trans_priv.h" +#include "xfs_buf_item.h" #include "xfs_extfree_item.h"
fs/xfs/xfs_file.c +4 -2
@@ -17,10 +17,10 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_log.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_trans.h" #include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_da_btree.h"
@@ -28,6 +28,7 @@#include "xfs_alloc.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h"
@@ -36,6 +37,7 @@#include "xfs_dir2_priv.h" #include "xfs_ioctl.h" #include "xfs_trace.h" +#include "xfs_log.h" #include <linux/aio.h> #include <linux/dcache.h>
fs/xfs/xfs_filestream.c +5 -5
@@ -16,15 +16,15 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" -#include "xfs_log.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" +#include "xfs_ag.h" +#include "xfs_sb.h" +#include "xfs_mount.h" #include "xfs_bmap_btree.h" #include "xfs_inum.h" #include "xfs_dinode.h" #include "xfs_inode.h" -#include "xfs_ag.h" -#include "xfs_trans.h" -#include "xfs_sb.h" -#include "xfs_mount.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" #include "xfs_alloc.h"
fs/xfs/xfs_fsops.c +5 -4
@@ -17,11 +17,10 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -30,6 +29,7 @@#include "xfs_ialloc_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_btree.h" #include "xfs_error.h"
@@ -41,6 +41,7 @@#include "xfs_rtalloc.h" #include "xfs_filestream.h" #include "xfs_trace.h" +#include "xfs_log.h" /* * File system operations
fs/xfs/xfs_ialloc.c +4 -3
@@ -17,12 +17,12 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" #include "xfs_inum.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -38,6 +38,7 @@#include "xfs_error.h" #include "xfs_bmap.h" #include "xfs_cksum.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_icreate_item.h" #include "xfs_icache.h"
fs/xfs/xfs_ialloc_btree.c +3 -3
@@ -17,10 +17,9 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -35,6 +34,7 @@#include "xfs_error.h" #include "xfs_trace.h" #include "xfs_cksum.h" +#include "xfs_trans.h" STATIC int
fs/xfs/xfs_icache.c +4 -5
@@ -18,12 +18,9 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_log_priv.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_inum.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -32,6 +29,8 @@#include "xfs_dinode.h" #include "xfs_error.h" #include "xfs_filestream.h" +#include "xfs_trans.h" +#include "xfs_trans_priv.h" #include "xfs_inode_item.h" #include "xfs_quota.h" #include "xfs_trace.h"
fs/xfs/xfs_icreate_item.c +3 -2
@@ -18,12 +18,13 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_trans.h" #include "xfs_trans_priv.h" #include "xfs_error.h" #include "xfs_icreate_item.h"
fs/xfs/xfs_inode.c +7 -5
@@ -19,13 +19,11 @@#include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_inum.h" -#include "xfs_trans.h" -#include "xfs_trans_space.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -39,6 +37,8 @@#include "xfs_attr.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans_space.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_inode_item.h" #include "xfs_btree.h"
@@ -53,6 +53,8 @@#include "xfs_trace.h" #include "xfs_icache.h" #include "xfs_symlink.h" +#include "xfs_trans_priv.h" +#include "xfs_log.h" kmem_zone_t *xfs_inode_zone;
fs/xfs/xfs_inode_buf.c +4 -3
@@ -17,10 +17,10 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -32,6 +32,7 @@#include "xfs_cksum.h" #include "xfs_icache.h" #include "xfs_ialloc.h" +#include "xfs_trans.h" /* * Check that none of the inode's in the buffer have a next
fs/xfs/xfs_inode_fork.c +3 -3
@@ -20,10 +20,9 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" -#include "xfs_log.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_inum.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -33,6 +32,7 @@#include "xfs_attr_sf.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_inode_item.h" #include "xfs_btree.h"
fs/xfs/xfs_inode_item.c +4 -4
@@ -17,19 +17,19 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_trans_priv.h" #include "xfs_bmap_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_error.h" #include "xfs_trace.h" +#include "xfs_trans_priv.h" kmem_zone_t *xfs_ili_zone;/* inode log item zone */
fs/xfs/xfs_ioctl.c +4 -3
@@ -17,10 +17,10 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_alloc.h"
@@ -35,6 +35,7 @@#include "xfs_attr.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_fsops.h" #include "xfs_discard.h"
fs/xfs/xfs_ioctl32.c +2 -2
@@ -22,8 +22,8 @@#include <asm/uaccess.h> #include "xfs.h" #include "xfs_fs.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
fs/xfs/xfs_iomap.c +6 -5
@@ -17,21 +17,22 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_alloc.h" -#include "xfs_quota.h" #include "xfs_mount.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" +#include "xfs_alloc.h" +#include "xfs_quota.h" #include "xfs_btree.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h"
fs/xfs/xfs_iops.c +7 -6
@@ -17,15 +17,12 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_acl.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_alloc.h" -#include "xfs_quota.h" #include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_bmap_btree.h"
@@ -33,10 +30,14 @@#include "xfs_inode.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" +#include "xfs_acl.h" +#include "xfs_alloc.h" +#include "xfs_quota.h" #include "xfs_rtalloc.h" #include "xfs_error.h" #include "xfs_itable.h" #include "xfs_attr.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_inode_item.h" #include "xfs_trace.h"
fs/xfs/xfs_itable.c +2 -2
@@ -18,9 +18,9 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" -#include "xfs_log.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_inum.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
fs/xfs/xfs_log.c +5 -3
@@ -18,19 +18,21 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_error.h" +#include "xfs_trans.h" +#include "xfs_trans_priv.h" +#include "xfs_log.h" #include "xfs_log_priv.h" #include "xfs_buf_item.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" #include "xfs_log_recover.h" -#include "xfs_trans_priv.h" #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trace.h"
fs/xfs/xfs_log.h +2 -8
@@ -18,8 +18,6 @@ #ifndef __XFS_LOG_H__ #define __XFS_LOG_H__ -#include "xfs_log_format.h" - struct xfs_log_vec { struct xfs_log_vec *lv_next; /* next lv in build list */ int lv_niovecs; /* number of iovecs in lv */
@@ -82,11 +80,7 @@ struct xlog_ticket;struct xfs_log_item ;struct xfs_item_ops ;struct xfs_trans ; - -void xfs_log_item_init (struct xfs_mount *mp, -struct xfs_log_item *item, -int type, -const struct xfs_item_ops *ops); +struct xfs_log_callback ; xfs_lsn_t xfs_log_done(struct xfs_mount *mp, struct xlog_ticket *ticket,
@@ -114,7 +108,7 @@ xfs_lsn_t xlog_assign_tail_lsn_locked(struct xfs_mount *mp);void xfs_log_space_wake (struct xfs_mount *mp);int xfs_log_notify (struct xfs_mount *mp,struct xlog_in_core *iclog, -xfs_log_callback_t *callback_entry); +struct xfs_log_callback *callback_entry);int xfs_log_release_iclog (struct xfs_mount *mp,struct xlog_in_core *iclog); int xfs_log_reserve(struct xfs_mount *mp,
fs/xfs/xfs_log_cil.c +6 -4
@@ -17,11 +17,9 @@#include "xfs.h" #include "xfs_fs.h" +#include "xfs_log_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" -#include "xfs_log_priv.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -29,6 +27,10 @@#include "xfs_alloc.h" #include "xfs_extent_busy.h" #include "xfs_discard.h" +#include "xfs_trans.h" +#include "xfs_trans_priv.h" +#include "xfs_log.h" +#include "xfs_log_priv.h" /* * Allocate a new ticket. Failing to get a new ticket makes it really hard to
fs/xfs/xfs_log_priv.h +4 -3
@@ -22,6 +22,7 @@ struct xfs_buf;struct xlog ;struct xlog_ticket ;struct xfs_mount ; +struct xfs_log_callback ;/* * Flags for log structure
@@ -227,8 +228,8 @@ typedef struct xlog_in_core {/* Callback structures need their own cacheline */ spinlock_t ic_callback_lock____cacheline_aligned_in_smp ; -xfs_log_callback_t *ic_callback; -xfs_log_callback_t **ic_callback_tail; +struct xfs_log_callback *ic_callback; +struct xfs_log_callback **ic_callback_tail;/* reference counts need their own cacheline */ atomic_t ic_refcnt____cacheline_aligned_in_smp ;
@@ -254,7 +255,7 @@ struct xfs_cil_ctx {int space_used;/* aggregate size of regions */ struct list_head busy_extents;/* busy extents in chkpt */ struct xfs_log_vec *lv_chain;/* logvecs being pushed */ -xfs_log_callback_t log_cb;/* completion callback hook. */ +struct xfs_log_callback log_cb;/* completion callback hook. */ struct list_head committing;/* ctx committing list */ };
fs/xfs/xfs_log_recover.c +5 -8
@@ -17,12 +17,12 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" #include "xfs_inum.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -34,11 +34,12 @@#include "xfs_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_alloc.h" #include "xfs_ialloc.h" +#include "xfs_log.h" #include "xfs_log_priv.h" -#include "xfs_buf_item.h" #include "xfs_log_recover.h" #include "xfs_extfree_item.h" #include "xfs_trans_priv.h"
@@ -46,14 +47,10 @@#include "xfs_cksum.h" #include "xfs_trace.h" #include "xfs_icache.h" -#include "xfs_icreate_item.h" /* Need all the magic numbers and buffer ops structures from these headers */ -#include "xfs_symlink.h" #include "xfs_da_btree.h" #include "xfs_dir2.h" -#include "xfs_attr_leaf.h" -#include "xfs_attr_remote.h" #define BLK_AVG (blk1, blk2) ((blk1+blk2) >> 1)
fs/xfs/xfs_log_rlimit.c +2 -2
@@ -18,8 +18,8 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_ag.h" #include "xfs_sb.h" #include "xfs_mount.h"
fs/xfs/xfs_message.c +2 -3
@@ -17,9 +17,8 @@#include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
fs/xfs/xfs_mount.c +6 -4
@@ -17,17 +17,19 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" #include "xfs_inum.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_da_format.h" +#include "xfs_trans.h" +#include "xfs_trans_priv.h" +#include "xfs_log.h" #include "xfs_dir2.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h"
fs/xfs/xfs_qm.c +5 -4
@@ -18,14 +18,12 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" #include "xfs_shared.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_alloc.h" -#include "xfs_quota.h" #include "xfs_mount.h" #include "xfs_bmap_btree.h" #include "xfs_ialloc_btree.h"
@@ -33,10 +31,13 @@#include "xfs_inode.h" #include "xfs_ialloc.h" #include "xfs_itable.h" +#include "xfs_alloc.h" #include "xfs_rtalloc.h" +#include "xfs_quota.h" #include "xfs_error.h" #include "xfs_bmap.h" #include "xfs_attr.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_trans_space.h" #include "xfs_qm.h"
fs/xfs/xfs_qm_bhv.c +3 -2
@@ -18,8 +18,8 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_alloc.h"
@@ -32,6 +32,7 @@#include "xfs_rtalloc.h" #include "xfs_error.h" #include "xfs_attr.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_qm.h"
fs/xfs/xfs_qm_syscalls.c +4 -3
@@ -20,11 +20,11 @@#include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_alloc.h"
@@ -32,6 +32,7 @@#include "xfs_mount.h" #include "xfs_bmap_btree.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_itable.h" #include "xfs_bmap.h"
fs/xfs/xfs_quotaops.c +1 -1
@@ -17,8 +17,8 @@*/ #include "xfs.h" #include "xfs_format.h" +#include "xfs_log_format.h" #include "xfs_trans_resv.h" -#include "xfs_log.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
fs/xfs/xfs_rtalloc.c +4 -3
@@ -17,11 +17,11 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -34,6 +34,7 @@#include "xfs_rtalloc.h" #include "xfs_fsops.h" #include "xfs_error.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_trans_space.h" #include "xfs_trace.h"
fs/xfs/xfs_sb.c +4 -3
@@ -18,11 +18,10 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" #include "xfs_inum.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -44,6 +43,8 @@#include "xfs_fsops.h" #include "xfs_trace.h" #include "xfs_cksum.h" +#include "xfs_trans.h" +#include "xfs_trans_priv.h" #include "xfs_buf_item.h" /*
fs/xfs/xfs_super.c +5 -3
@@ -17,11 +17,11 @@*/ #include "xfs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_inum.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_alloc.h"
@@ -41,7 +41,9 @@#include "xfs_itable.h" #include "xfs_fsops.h" #include "xfs_attr.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" +#include "xfs_log.h" #include "xfs_log_priv.h" #include "xfs_trans_priv.h" #include "xfs_filestream.h"
fs/xfs/xfs_symlink.c +5 -3
@@ -17,12 +17,12 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" +#include "xfs_shared.h" #include "xfs_fs.h" #include "xfs_format.h" -#include "xfs_shared.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -41,7 +41,9 @@#include "xfs_trans_space.h" #include "xfs_trace.h" #include "xfs_symlink.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" +#include "xfs_log.h" /* ----- Kernel only functions below ----- */ STATIC int
fs/xfs/xfs_symlink_remote.c +3 -2
@@ -19,9 +19,9 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_trans_resv.h" #include "xfs_ag.h" #include "xfs_sb.h" #include "xfs_mount.h"
@@ -31,6 +31,7 @@#include "xfs_trace.h" #include "xfs_symlink.h" #include "xfs_cksum.h" +#include "xfs_trans.h" #include "xfs_buf_item.h"
fs/xfs/xfs_trace.c +5 -3
@@ -17,10 +17,10 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -38,6 +38,8 @@#include "xfs_bmap.h" #include "xfs_attr.h" #include "xfs_attr_leaf.h" +#include "xfs_trans.h" +#include "xfs_log.h" #include "xfs_log_priv.h" #include "xfs_buf_item.h" #include "xfs_quota.h"
fs/xfs/xfs_trans.c +6 -4
@@ -18,10 +18,10 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -38,10 +38,12 @@#include "xfs_extent_busy.h" #include "xfs_bmap.h" #include "xfs_quota.h" -#include "xfs_qm.h" +#include "xfs_trans.h" #include "xfs_trans_priv.h" #include "xfs_trans_space.h" +#include "xfs_qm.h" #include "xfs_inode_item.h" +#include "xfs_log.h" #include "xfs_log_priv.h" #include "xfs_buf_item.h" #include "xfs_trace.h"
fs/xfs/xfs_trans.h +5 -5
@@ -18,10 +18,6 @@#ifndef __XFS_TRANS_H__#define __XFS_TRANS_H__ -struct xfs_log_item ; - -#include "xfs_trans_resv.h" -/* kernel only transaction subsystem defines */ struct xfs_buf ;
@@ -77,6 +73,9 @@ struct xfs_item_ops {void (*iop_committing)(xfs_log_item_t *,xfs_lsn_t ); }; +void xfs_log_item_init (struct xfs_mount *mp,struct xfs_log_item *item, +int type,const struct xfs_item_ops *ops); +/* * Return values for the iop_push() routines. */
@@ -85,6 +84,7 @@ struct xfs_item_ops {#define XFS_ITEM_LOCKED 2#define XFS_ITEM_FLUSHING 3 +/* * This is the structure maintained for every active transaction. */
@@ -125,7 +125,6 @@ typedef struct xfs_trans {int64_t t_rextents_delta;/* superblocks rextents chg */ int64_t t_rextslog_delta;/* superblocks rextslog chg */ struct list_head t_items;/* log item descriptors */ -xfs_trans_header_t t_header;/* header for in-log trans */ struct list_head t_busy;/* list of busy extents */ unsigned long t_pflags;/* saved process flags state */ } xfs_trans_t;
@@ -230,6 +229,7 @@ void xfs_trans_log_efd_extent(xfs_trans_t *, xfs_fsblock_t, xfs_extlen_t);int xfs_trans_commit (xfs_trans_t *,uint flags); +int xfs_trans_roll (struct xfs_trans **,struct xfs_inode *);void xfs_trans_cancel (xfs_trans_t *,int );int xfs_trans_ail_init (struct xfs_mount *);void xfs_trans_ail_destroy (struct xfs_mount *);
fs/xfs/xfs_trans_ail.c +4 -3
@@ -18,15 +18,16 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_trans.h" #include "xfs_trans_priv.h" #include "xfs_trace.h" #include "xfs_error.h" +#include "xfs_log.h" #ifdef DEBUG /*
fs/xfs/xfs_trans_buf.c +3 -2
@@ -18,8 +18,8 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -28,6 +28,7 @@#include "xfs_ialloc_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_trans_priv.h" #include "xfs_error.h"
fs/xfs/xfs_trans_dquot.c +4 -3
@@ -17,10 +17,10 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_alloc.h"
@@ -33,6 +33,7 @@#include "xfs_rtalloc.h" #include "xfs_error.h" #include "xfs_attr.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_trans_priv.h" #include "xfs_qm.h"
fs/xfs/xfs_trans_extfree.c +3 -2
@@ -18,11 +18,12 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_trans.h" #include "xfs_trans_priv.h" #include "xfs_extfree_item.h"
fs/xfs/xfs_trans_inode.c +3 -2
@@ -18,8 +18,8 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -29,6 +29,7 @@#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_trans.h" #include "xfs_trans_priv.h" #include "xfs_inode_item.h" #include "xfs_trace.h"
fs/xfs/xfs_trans_priv.h +0 -1
@@ -27,7 +27,6 @@ struct xfs_log_vec;void xfs_trans_init (struct xfs_mount *); -int xfs_trans_roll (struct xfs_trans **,struct xfs_inode *);void xfs_trans_add_item (struct xfs_trans *,struct xfs_log_item *);void xfs_trans_del_item (struct xfs_log_item *); void xfs_trans_free_items(struct xfs_trans *tp, xfs_lsn_t commit_lsn,
fs/xfs/xfs_trans_resv.c +3 -3
@@ -18,11 +18,10 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" +#include "xfs_format.h" +#include "xfs_log_format.h" #include "xfs_trans_resv.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -41,6 +40,7 @@#include "xfs_bmap.h" #include "xfs_bmap_util.h" #include "xfs_quota.h" +#include "xfs_trans.h" #include "xfs_qm.h" #include "xfs_trans_space.h" #include "xfs_trace.h"
fs/xfs/xfs_xattr.c +1 -2
@@ -18,8 +18,7 @@#include "xfs.h" #include "xfs_log_format.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 9/19 xfs: decouple inode and bmap btree header files
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Currently the xfs_inode.h header has a dependency on the definition of the BMAP btree records as the inode fork includes an array of xfs_bmbt_rec_host_t objects in it's definition.
Move all the btree format definitions from xfs_btree.h, xfs_bmap_btree.h, xfs_alloc_btree.h and xfs_ialloc_btree.h to xfs_format.h to continue the process of centralising the on-disk format definitions. With this done, the xfs inode definitions are no longer dependent on btree header files.
The enables a massive culling of unnecessary includes, with close to 200 #include directives removed from the XFS kernel code base.
--- fs/xfs/xfs_acl.c | 8 +- fs/xfs/xfs_alloc.c | 5 +- fs/xfs/xfs_alloc_btree.c | 7 +- fs/xfs/xfs_alloc_btree.h | 33 ------ fs/xfs/xfs_aops.c | 4 +- fs/xfs/xfs_attr.c | 4 +- fs/xfs/xfs_attr_inactive.c | 8 +- fs/xfs/xfs_attr_leaf.c | 13 +-- fs/xfs/xfs_attr_list.c | 12 +-- fs/xfs/xfs_attr_remote.c | 5 +- fs/xfs/xfs_bmap.c | 12 +-- fs/xfs/xfs_bmap_btree.c | 7 +- fs/xfs/xfs_bmap_btree.h | 103 ------------------ fs/xfs/xfs_bmap_util.c | 6 +- fs/xfs/xfs_btree.c | 5 +- fs/xfs/xfs_btree.h | 79 +++----------- fs/xfs/xfs_buf_item.h | 4 - fs/xfs/xfs_da_btree.c | 2 - fs/xfs/xfs_dir2.c | 5 +- fs/xfs/xfs_dir2_block.c | 4 +- fs/xfs/xfs_dir2_data.c | 3 +- fs/xfs/xfs_dir2_leaf.c | 4 +- fs/xfs/xfs_dir2_node.c | 3 +- fs/xfs/xfs_dir2_readdir.c | 4 +- fs/xfs/xfs_dir2_sf.c | 4 +- fs/xfs/xfs_discard.c | 6 +- fs/xfs/xfs_dquot.c | 5 +- fs/xfs/xfs_dquot_buf.c | 2 - fs/xfs/xfs_dquot_item.c | 8 +- fs/xfs/xfs_error.c | 4 +- fs/xfs/xfs_export.c | 2 +- fs/xfs/xfs_extent_busy.c | 2 - fs/xfs/xfs_extent_busy.h | 4 + fs/xfs/xfs_file.c | 5 +- fs/xfs/xfs_filestream.c | 4 +- fs/xfs/xfs_format.h | 255 +++++++++++++++++++++++++++++++++++++++++++++ fs/xfs/xfs_fsops.c | 12 +-- fs/xfs/xfs_ialloc.c | 6 +- fs/xfs/xfs_ialloc.h | 3 +- fs/xfs/xfs_ialloc_btree.c | 6 +- fs/xfs/xfs_ialloc_btree.h | 49 --------- fs/xfs/xfs_icache.c | 4 - fs/xfs/xfs_inode.c | 10 +- fs/xfs/xfs_inode.h | 1 - fs/xfs/xfs_inode_buf.c | 6 +- fs/xfs/xfs_inode_fork.c | 16 +-- fs/xfs/xfs_inode_fork.h | 1 + fs/xfs/xfs_inode_item.c | 4 +- fs/xfs/xfs_ioctl.c | 9 +- fs/xfs/xfs_ioctl32.c | 3 +- fs/xfs/xfs_iomap.c | 16 +-- fs/xfs/xfs_iops.c | 8 +- fs/xfs/xfs_itable.c | 9 +- fs/xfs/xfs_log.c | 6 +- fs/xfs/xfs_log_recover.c | 18 ++-- fs/xfs/xfs_log_rlimit.c | 3 +- fs/xfs/xfs_mount.c | 15 +-- fs/xfs/xfs_qm.c | 11 +- fs/xfs/xfs_qm_bhv.c | 7 -- fs/xfs/xfs_qm_syscalls.c | 10 +- fs/xfs/xfs_quotaops.c | 3 +- fs/xfs/xfs_rtalloc.c | 9 +- fs/xfs/xfs_sb.c | 18 +--- fs/xfs/xfs_super.c | 16 +-- fs/xfs/xfs_symlink.c | 6 +- fs/xfs/xfs_trace.c | 5 +- fs/xfs/xfs_trans.c | 16 +-- fs/xfs/xfs_trans.h | 5 + fs/xfs/xfs_trans_buf.c | 5 +- fs/xfs/xfs_trans_dquot.c | 9 +- fs/xfs/xfs_trans_inode.c | 6 +- fs/xfs/xfs_trans_resv.c | 12 +-- fs/xfs/xfs_xattr.c | 2 +- 73 files changed, 403 insertions(+), 583 deletions(-)
fs/xfs/xfs_acl.c +4 -4
@@ -16,15 +16,15 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" -#include "xfs_acl.h" -#include "xfs_attr.h" -#include "xfs_bmap_btree.h" -#include "xfs_inode.h" #include "xfs_ag.h" #include "xfs_sb.h" #include "xfs_mount.h" +#include "xfs_inode.h" +#include "xfs_acl.h" +#include "xfs_attr.h" #include "xfs_trace.h" #include <linux/slab.h> #include <linux/xattr.h>
fs/xfs/xfs_alloc.c +1 -4
@@ -25,12 +25,9 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_alloc_btree.h" #include "xfs_alloc.h" #include "xfs_extent_busy.h" #include "xfs_error.h"
fs/xfs/xfs_alloc_btree.c +2 -5
@@ -17,17 +17,14 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" -#include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_alloc_btree.h" #include "xfs_alloc.h" #include "xfs_extent_busy.h" #include "xfs_error.h"
fs/xfs/xfs_alloc_btree.h +0 -33
@@ -27,39 +27,6 @@ struct xfs_btree_cur;struct xfs_mount ;/* -* There are two on-disk btrees, one sorted by blockno and one sorted -* by blockcount and blockno. All blocks look the same to make the code -* simpler; if we have time later, we'll make the optimizations. -*/ -#define XFS_ABTB_MAGIC 0x41425442/* 'ABTB' for bno tree */ -#define XFS_ABTB_CRC_MAGIC 0x41423342/* 'AB3B' */ -#define XFS_ABTC_MAGIC 0x41425443/* 'ABTC' for cnt tree */ -#define XFS_ABTC_CRC_MAGIC 0x41423343/* 'AB3C' */ - -/* -* Data record/key structure -*/ -typedef struct xfs_alloc_rec { -__be32 ar_startblock;/* starting block number */ -__be32 ar_blockcount;/* count of free blocks */ -}xfs_alloc_rec_t ,xfs_alloc_key_t ; - -typedef struct xfs_alloc_rec_incore { -xfs_agblock_t ar_startblock;/* starting block number */ -xfs_extlen_t ar_blockcount;/* count of free blocks */ -}xfs_alloc_rec_incore_t ; - -/* btree pointer type */ -typedef __be32 xfs_alloc_ptr_t ; - -/* -* Block numbers in the AG: -* SB is sector 0, AGF is sector 1, AGI is sector 2, AGFL is sector 3. -*/ -#define XFS_BNO_BLOCK (mp) ((xfs_agblock_t)(XFS_AGFL_BLOCK(mp) + 1)) -#define XFS_CNT_BLOCK (mp) ((xfs_agblock_t)(XFS_BNO_BLOCK(mp) + 1)) - -/* * Btree block header size depends on a superblock flag. */ #define XFS_ALLOC_BLOCK_LEN (mp) \
fs/xfs/xfs_aops.c +2 -2
@@ -23,8 +23,6 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trans.h" #include "xfs_inode_item.h"
@@ -34,6 +32,8 @@#include "xfs_trace.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" +#include "xfs_bmap_btree.h" +#include "xfs_dinode.h" #include <linux/aio.h> #include <linux/gfp.h> #include <linux/mpage.h>
fs/xfs/xfs_attr.c +2 -2
@@ -27,15 +27,14 @@#include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" #include "xfs_attr_sf.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_alloc.h" #include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" +#include "xfs_bmap_btree.h" #include "xfs_attr.h" #include "xfs_attr_leaf.h" #include "xfs_attr_remote.h"
@@ -43,6 +42,7 @@#include "xfs_quota.h" #include "xfs_trans_space.h" #include "xfs_trace.h" +#include "xfs_dinode.h" /* * xfs_attr.c
fs/xfs/xfs_attr_inactive.c +2 -6
@@ -28,14 +28,9 @@#include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" +#include "xfs_inode.h" #include "xfs_alloc.h" -#include "xfs_btree.h" #include "xfs_attr_remote.h" -#include "xfs_dinode.h" -#include "xfs_inode.h" #include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h"
@@ -44,6 +39,7 @@#include "xfs_error.h" #include "xfs_quota.h" #include "xfs_trace.h" +#include "xfs_dinode.h" /* * Look at all the extents for this logical region,
fs/xfs/xfs_attr_leaf.c +5 -8
@@ -18,6 +18,7 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_bit.h"
@@ -26,24 +27,20 @@#include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_alloc.h" -#include "xfs_btree.h" -#include "xfs_attr_sf.h" -#include "xfs_attr_remote.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trans.h" #include "xfs_inode_item.h" +#include "xfs_bmap_btree.h" #include "xfs_bmap.h" +#include "xfs_attr_sf.h" +#include "xfs_attr_remote.h" #include "xfs_attr.h" #include "xfs_attr_leaf.h" #include "xfs_error.h" #include "xfs_trace.h" #include "xfs_buf_item.h" #include "xfs_cksum.h" +#include "xfs_dinode.h" /*
fs/xfs/xfs_attr_list.c +4 -8
@@ -18,6 +18,7 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_bit.h"
@@ -26,24 +27,19 @@#include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_alloc.h" -#include "xfs_btree.h" -#include "xfs_attr_sf.h" -#include "xfs_attr_remote.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_attr.h" +#include "xfs_attr_sf.h" +#include "xfs_attr_remote.h" #include "xfs_attr_leaf.h" #include "xfs_error.h" #include "xfs_trace.h" #include "xfs_buf_item.h" #include "xfs_cksum.h" +#include "xfs_dinode.h" STATIC intxfs_attr_shortform_compare (const void *a,const void *b)
fs/xfs/xfs_attr_remote.c +2 -3
@@ -18,6 +18,7 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_bit.h"
@@ -25,10 +26,7 @@#include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_da_format.h" -#include "xfs_error.h" #include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_alloc.h" #include "xfs_trans.h"
@@ -42,6 +40,7 @@#include "xfs_trace.h" #include "xfs_cksum.h" #include "xfs_buf_item.h" +#include "xfs_error.h" #define ATTR_RMTVALUE_MAPSIZE 1/* # of map entries at once */
fs/xfs/xfs_bmap.c +4 -8
@@ -29,29 +29,25 @@#include "xfs_da_format.h" #include "xfs_da_btree.h" #include "xfs_dir2.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" -#include "xfs_mount.h" -#include "xfs_itable.h" #include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_extfree_item.h" #include "xfs_alloc.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" +#include "xfs_bmap_btree.h" #include "xfs_rtalloc.h" #include "xfs_error.h" -#include "xfs_attr_leaf.h" #include "xfs_quota.h" #include "xfs_trans_space.h" #include "xfs_buf_item.h" -#include "xfs_filestream.h" #include "xfs_trace.h" #include "xfs_symlink.h" +#include "xfs_attr_leaf.h" +#include "xfs_dinode.h" +#include "xfs_filestream.h" kmem_zone_t *xfs_bmap_free_item_zone;
fs/xfs/xfs_bmap_btree.c +2 -5
@@ -24,21 +24,18 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_alloc.h" #include "xfs_btree.h" -#include "xfs_itable.h" +#include "xfs_bmap_btree.h" #include "xfs_bmap.h" #include "xfs_error.h" #include "xfs_quota.h" #include "xfs_trace.h" #include "xfs_cksum.h" +#include "xfs_dinode.h" /* * Determine the extent state.
fs/xfs/xfs_bmap_btree.h +0 -103
121 lines not on this page · raw message
fs/xfs/xfs_bmap_util.c +2 -4
@@ -27,10 +27,6 @@#include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_da_format.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" #include "xfs_trans.h"
@@ -38,6 +34,7 @@#include "xfs_alloc.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" +#include "xfs_bmap_btree.h" #include "xfs_rtalloc.h" #include "xfs_error.h" #include "xfs_quota.h"
@@ -45,6 +42,7 @@#include "xfs_trace.h" #include "xfs_icache.h" #include "xfs_log.h" +#include "xfs_dinode.h" /* Kernel only BMAP related definitions and functions */
fs/xfs/xfs_btree.c +1 -4
@@ -18,16 +18,13 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_bit.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trans.h" #include "xfs_inode_item.h"
fs/xfs/xfs_btree.h +12 -67
91 lines not on this page · raw message
fs/xfs/xfs_buf_item.h +0 -4
@@ -71,10 +71,6 @@ void xfs_buf_attach_iodone(struct xfs_buf *,void xfs_buf_iodone_callbacks (struct xfs_buf *);void xfs_buf_iodone (struct xfs_buf *,struct xfs_log_item *); -void xfs_trans_buf_set_type (struct xfs_trans *,struct xfs_buf *, -enum xfs_blft ); -void xfs_trans_buf_copy_type (struct xfs_buf *dst_bp,struct xfs_buf *src_bp); -extern kmem_zone_t *xfs_buf_item_zone;#endif /* __XFS_BUF_ITEM_H__ */
fs/xfs/xfs_da_btree.c +0 -2
@@ -28,10 +28,8 @@#include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" #include "xfs_dir2.h" #include "xfs_dir2_priv.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trans.h" #include "xfs_inode_item.h"
fs/xfs/xfs_dir2.c +2 -3
@@ -17,6 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_inum.h"
@@ -25,9 +26,6 @@#include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trans.h" #include "xfs_inode_item.h"
@@ -36,6 +34,7 @@#include "xfs_dir2_priv.h" #include "xfs_error.h" #include "xfs_trace.h" +#include "xfs_dinode.h" struct xfs_name xfs_name_dotdot = { (unsigned char *)".." ,2 ,XFS_DIR3_FT_DIR };
fs/xfs/xfs_dir2_block.c +2 -2
@@ -18,6 +18,7 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_sb.h"
@@ -25,8 +26,6 @@#include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trans.h" #include "xfs_inode_item.h"
@@ -37,6 +36,7 @@#include "xfs_error.h" #include "xfs_trace.h" #include "xfs_cksum.h" +#include "xfs_dinode.h" /* * Local function prototypes.
fs/xfs/xfs_dir2_data.c +1 -2
@@ -18,6 +18,7 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_sb.h"
@@ -25,8 +26,6 @@#include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_dir2.h" #include "xfs_dir2_priv.h"
fs/xfs/xfs_dir2_leaf.c +1 -3
@@ -18,16 +18,14 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" -#include "xfs_bit.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_bmap.h" #include "xfs_dir2.h"
fs/xfs/xfs_dir2_node.c +1 -2
@@ -18,6 +18,7 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_sb.h"
@@ -25,8 +26,6 @@#include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_bmap.h" #include "xfs_dir2.h"
fs/xfs/xfs_dir2_readdir.c +2 -2
@@ -18,6 +18,7 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_bit.h"
@@ -26,8 +27,6 @@#include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_dir2.h" #include "xfs_dir2_priv.h"
@@ -35,6 +34,7 @@#include "xfs_trace.h" #include "xfs_bmap.h" #include "xfs_trans.h" +#include "xfs_dinode.h" /* * Directory file type support functions
fs/xfs/xfs_dir2_sf.c +2 -2
@@ -17,6 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_sb.h"
@@ -24,8 +25,6 @@#include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trans.h" #include "xfs_inode_item.h"
@@ -33,6 +32,7 @@#include "xfs_dir2.h" #include "xfs_dir2_priv.h" #include "xfs_trace.h" +#include "xfs_dinode.h" /* * Prototypes for internal functions.
fs/xfs/xfs_discard.c +2 -4
@@ -23,11 +23,9 @@#include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_quota.h" -#include "xfs_alloc_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_btree.h" #include "xfs_inode.h" +#include "xfs_btree.h" +#include "xfs_alloc_btree.h" #include "xfs_alloc.h" #include "xfs_error.h" #include "xfs_extent_busy.h"
fs/xfs/xfs_dquot.c +1 -4
@@ -25,16 +25,12 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" #include "xfs_inode.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" #include "xfs_alloc.h" #include "xfs_quota.h" -#include "xfs_rtalloc.h" #include "xfs_error.h" -#include "xfs_itable.h" -#include "xfs_attr.h" #include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_trans_space.h"
@@ -43,6 +39,7 @@#include "xfs_cksum.h" #include "xfs_trace.h" #include "xfs_log.h" +#include "xfs_bmap_btree.h" /* * Lock order:
fs/xfs/xfs_dquot_buf.c +0 -2
@@ -21,11 +21,9 @@#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" -#include "xfs_bit.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" #include "xfs_inode.h" #include "xfs_quota.h" #include "xfs_trans.h"
fs/xfs/xfs_dquot_item.c +1 -7
@@ -22,16 +22,10 @@#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_alloc.h" -#include "xfs_quota.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" #include "xfs_inode.h" -#include "xfs_bmap.h" -#include "xfs_rtalloc.h" +#include "xfs_quota.h" #include "xfs_error.h" -#include "xfs_itable.h" -#include "xfs_attr.h" #include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_trans_priv.h"
fs/xfs/xfs_error.c +1 -3
@@ -16,15 +16,13 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" +#include "xfs_format.h" #include "xfs_fs.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_dinode.h" -#include "xfs_inode.h" #include "xfs_error.h" #ifdef DEBUG
fs/xfs/xfs_export.c +1 -1
@@ -16,6 +16,7 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_sb.h"
@@ -24,7 +25,6 @@#include "xfs_da_format.h" #include "xfs_dir2.h" #include "xfs_export.h" -#include "xfs_bmap_btree.h" #include "xfs_inode.h" #include "xfs_trans.h" #include "xfs_inode_item.h"
fs/xfs/xfs_extent_busy.c +0 -2
@@ -26,9 +26,7 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" #include "xfs_alloc.h" -#include "xfs_inode.h" #include "xfs_extent_busy.h" #include "xfs_trace.h" #include "xfs_trans.h"
fs/xfs/xfs_extent_busy.h +4 -0
@@ -20,6 +20,10 @@#ifndef __XFS_EXTENT_BUSY_H__#define __XFS_EXTENT_BUSY_H__ +struct xfs_mount ; +struct xfs_trans ; +struct xfs_alloc_arg ; +/* * Busy block/extent entry. Indexed by a rbtree in perag to mark blocks that * have been freed but whose transactions aren't committed to disk yet.
fs/xfs/xfs_file.c +2 -3
@@ -17,6 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_sb.h"
@@ -24,9 +25,6 @@#include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trans.h" #include "xfs_inode_item.h"
@@ -38,6 +36,7 @@#include "xfs_ioctl.h" #include "xfs_trace.h" #include "xfs_log.h" +#include "xfs_dinode.h" #include <linux/aio.h> #include <linux/dcache.h>
fs/xfs/xfs_filestream.c +2 -2
@@ -16,19 +16,19 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_ag.h" #include "xfs_sb.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" #include "xfs_inum.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" #include "xfs_alloc.h" #include "xfs_mru_cache.h" +#include "xfs_dinode.h" #include "xfs_filestream.h" #include "xfs_trace.h"
fs/xfs/xfs_format.h +255 -0
259 lines not on this page · raw message
fs/xfs/xfs_fsops.c +5 -7
@@ -18,30 +18,28 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" -#include "xfs_log_format.h" #include "xfs_format.h" +#include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trans.h" #include "xfs_inode_item.h" -#include "xfs_btree.h" #include "xfs_error.h" +#include "xfs_btree.h" +#include "xfs_alloc_btree.h" #include "xfs_alloc.h" #include "xfs_ialloc.h" #include "xfs_fsops.h" #include "xfs_itable.h" #include "xfs_trans_space.h" #include "xfs_rtalloc.h" -#include "xfs_filestream.h" #include "xfs_trace.h" #include "xfs_log.h" +#include "xfs_dinode.h" +#include "xfs_filestream.h" /* * File system operations
fs/xfs/xfs_ialloc.c +2 -4
@@ -26,13 +26,10 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" #include "xfs_ialloc.h" +#include "xfs_ialloc_btree.h" #include "xfs_alloc.h" #include "xfs_rtalloc.h" #include "xfs_error.h"
@@ -42,6 +39,7 @@#include "xfs_buf_item.h" #include "xfs_icreate_item.h" #include "xfs_icache.h" +#include "xfs_dinode.h" /*
fs/xfs/xfs_ialloc.h +2 -1
@@ -23,6 +23,7 @@ struct xfs_dinode;struct xfs_imap ;struct xfs_mount ;struct xfs_trans ; +struct xfs_btree_cur ;/* * Allocation parameters for inode allocation.
@@ -42,7 +43,7 @@ struct xfs_trans;static inline struct xfs_dinode *xfs_make_iptr (struct xfs_mount *mp,struct xfs_buf *b,int o) { -return (xfs_dinode_t *) +return (struct xfs_dinode *) (xfs_buf_offset (b, o << (mp)->m_sb.sb_inodelog)); }
fs/xfs/xfs_ialloc_btree.c +2 -4
@@ -17,19 +17,17 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_bit.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" #include "xfs_ialloc.h" +#include "xfs_ialloc_btree.h" #include "xfs_alloc.h" #include "xfs_error.h" #include "xfs_trace.h"
fs/xfs/xfs_ialloc_btree.h +0 -49
55 lines not on this page · raw message
fs/xfs/xfs_icache.c +0 -4
@@ -24,17 +24,13 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" #include "xfs_inode.h" -#include "xfs_dinode.h" #include "xfs_error.h" -#include "xfs_filestream.h" #include "xfs_trans.h" #include "xfs_trans_priv.h" #include "xfs_inode_item.h" #include "xfs_quota.h" #include "xfs_trace.h" -#include "xfs_fsops.h" #include "xfs_icache.h" #include "xfs_bmap_util.h"
fs/xfs/xfs_inode.c +3 -7
@@ -27,27 +27,22 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_inode.h" #include "xfs_da_format.h" #include "xfs_da_btree.h" #include "xfs_dir2.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" #include "xfs_attr_sf.h" #include "xfs_attr.h" -#include "xfs_dinode.h" -#include "xfs_inode.h" #include "xfs_trans_space.h" #include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_inode_item.h" -#include "xfs_btree.h" -#include "xfs_alloc.h" #include "xfs_ialloc.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" #include "xfs_error.h" #include "xfs_quota.h" +#include "xfs_dinode.h" #include "xfs_filestream.h" #include "xfs_cksum.h" #include "xfs_trace.h"
@@ -55,6 +50,7 @@#include "xfs_symlink.h" #include "xfs_trans_priv.h" #include "xfs_log.h" +#include "xfs_bmap_btree.h" kmem_zone_t *xfs_inode_zone;
fs/xfs/xfs_inode.h +0 -1
@@ -24,7 +24,6 @@/* * Kernel only inode definitions */ -struct xfs_dinode ;struct xfs_inode ;struct xfs_buf ;
fs/xfs/xfs_inode_buf.c +2 -4
@@ -24,15 +24,13 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_error.h" #include "xfs_cksum.h" #include "xfs_icache.h" -#include "xfs_ialloc.h" #include "xfs_trans.h" +#include "xfs_ialloc.h" +#include "xfs_dinode.h" /* * Check that none of the inode's in the buffer have a next
fs/xfs/xfs_inode_fork.c +3 -13
@@ -26,25 +26,15 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_attr_sf.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trans.h" -#include "xfs_buf_item.h" #include "xfs_inode_item.h" -#include "xfs_btree.h" -#include "xfs_alloc.h" -#include "xfs_ialloc.h" +#include "xfs_bmap_btree.h" #include "xfs_bmap.h" #include "xfs_error.h" -#include "xfs_quota.h" -#include "xfs_filestream.h" -#include "xfs_cksum.h" #include "xfs_trace.h" -#include "xfs_icache.h" +#include "xfs_attr_sf.h" +#include "xfs_dinode.h" kmem_zone_t *xfs_ifork_zone;
fs/xfs/xfs_inode_fork.h +1 -0
@@ -19,6 +19,7 @@#define __XFS_INODE_FORK_H__struct xfs_inode_log_item ; +struct xfs_dinode ;/* * The following xfs_ext_irec_t struct introduces a second (top) level
fs/xfs/xfs_inode_item.c +2 -2
@@ -17,19 +17,19 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_error.h" #include "xfs_trace.h" #include "xfs_trans_priv.h" +#include "xfs_dinode.h" kmem_zone_t *xfs_ili_zone;/* inode log item zone */
fs/xfs/xfs_ioctl.c +3 -6
@@ -23,28 +23,25 @@#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_alloc.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_ioctl.h" +#include "xfs_alloc.h" #include "xfs_rtalloc.h" #include "xfs_itable.h" #include "xfs_error.h" #include "xfs_attr.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" -#include "xfs_trans.h" -#include "xfs_buf_item.h" #include "xfs_fsops.h" #include "xfs_discard.h" #include "xfs_quota.h" -#include "xfs_inode_item.h" #include "xfs_export.h" #include "xfs_trace.h" #include "xfs_icache.h" #include "xfs_symlink.h" +#include "xfs_dinode.h" +#include "xfs_trans.h" #include <linux/capability.h> #include <linux/dcache.h>
fs/xfs/xfs_ioctl32.c +1 -2
@@ -22,14 +22,13 @@#include <asm/uaccess.h> #include "xfs.h" #include "xfs_fs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" #include "xfs_vnode.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_itable.h" #include "xfs_error.h"
fs/xfs/xfs_iomap.c +4 -12
@@ -24,29 +24,21 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" -#include "xfs_trans.h" -#include "xfs_inode_item.h" -#include "xfs_alloc.h" -#include "xfs_quota.h" #include "xfs_btree.h" +#include "xfs_bmap_btree.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" -#include "xfs_rtalloc.h" #include "xfs_error.h" -#include "xfs_itable.h" -#include "xfs_attr.h" -#include "xfs_buf_item.h" +#include "xfs_trans.h" #include "xfs_trans_space.h" #include "xfs_iomap.h" #include "xfs_trace.h" #include "xfs_icache.h" +#include "xfs_quota.h" #include "xfs_dquot_item.h" #include "xfs_dquot.h" +#include "xfs_dinode.h" #define XFS_WRITEIO_ALIGN (mp,off) (((off) >> mp->m_writeio_log) \
fs/xfs/xfs_iops.c +1 -7
@@ -25,26 +25,20 @@#include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_da_format.h" -#include "xfs_bmap_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" #include "xfs_acl.h" -#include "xfs_alloc.h" #include "xfs_quota.h" -#include "xfs_rtalloc.h" #include "xfs_error.h" -#include "xfs_itable.h" #include "xfs_attr.h" #include "xfs_trans.h" -#include "xfs_buf_item.h" -#include "xfs_inode_item.h" #include "xfs_trace.h" #include "xfs_icache.h" #include "xfs_symlink.h" #include "xfs_da_btree.h" #include "xfs_dir2_priv.h" +#include "xfs_dinode.h" #include <linux/capability.h> #include <linux/xattr.h>
fs/xfs/xfs_itable.c +4 -5
@@ -18,23 +18,22 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_inum.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_btree.h" #include "xfs_ialloc.h" +#include "xfs_ialloc_btree.h" #include "xfs_itable.h" #include "xfs_error.h" -#include "xfs_btree.h" #include "xfs_trace.h" #include "xfs_icache.h" +#include "xfs_dinode.h" STATIC int xfs_internal_inum(
fs/xfs/xfs_log.c +1 -5
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_sb.h"
@@ -28,12 +29,7 @@#include "xfs_trans_priv.h" #include "xfs_log.h" #include "xfs_log_priv.h" -#include "xfs_buf_item.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" #include "xfs_log_recover.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trace.h" #include "xfs_fsops.h"
fs/xfs/xfs_log_recover.c +6 -12
@@ -27,29 +27,23 @@#include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_da_format.h" -#include "xfs_error.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trans.h" -#include "xfs_inode_item.h" -#include "xfs_alloc.h" -#include "xfs_ialloc.h" #include "xfs_log.h" #include "xfs_log_priv.h" #include "xfs_log_recover.h" +#include "xfs_inode_item.h" #include "xfs_extfree_item.h" #include "xfs_trans_priv.h" +#include "xfs_alloc.h" +#include "xfs_ialloc.h" #include "xfs_quota.h" #include "xfs_cksum.h" #include "xfs_trace.h" #include "xfs_icache.h" - -/* Need all the magic numbers and buffer ops structures from these headers */ -#include "xfs_da_btree.h" +#include "xfs_bmap_btree.h" +#include "xfs_dinode.h" +#include "xfs_error.h" #include "xfs_dir2.h" #define BLK_AVG (blk1, blk2) ((blk1+blk2) >> 1)
fs/xfs/xfs_log_rlimit.c +2 -1
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_ag.h"
@@ -25,10 +26,10 @@#include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_trans_space.h" -#include "xfs_bmap_btree.h" #include "xfs_inode.h" #include "xfs_da_btree.h" #include "xfs_attr_leaf.h" +#include "xfs_bmap_btree.h" /* * Calculate the maximum length in bytes that would be required for a local
fs/xfs/xfs_mount.c +4 -11
@@ -27,27 +27,20 @@#include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_da_format.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" -#include "xfs_log.h" -#include "xfs_dir2.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" -#include "xfs_btree.h" +#include "xfs_dir2.h" #include "xfs_ialloc.h" #include "xfs_alloc.h" #include "xfs_rtalloc.h" #include "xfs_bmap.h" +#include "xfs_trans.h" +#include "xfs_trans_priv.h" +#include "xfs_log.h" #include "xfs_error.h" #include "xfs_quota.h" #include "xfs_fsops.h" #include "xfs_trace.h" #include "xfs_icache.h" -#include "xfs_cksum.h" -#include "xfs_buf_item.h" #ifdef HAVE_PERCPU_SB
fs/xfs/xfs_qm.c +3 -8
@@ -17,33 +17,28 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_shared.h" #include "xfs_format.h" #include "xfs_log_format.h" -#include "xfs_shared.h" #include "xfs_trans_resv.h" #include "xfs_bit.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_ialloc.h" #include "xfs_itable.h" -#include "xfs_alloc.h" -#include "xfs_rtalloc.h" #include "xfs_quota.h" #include "xfs_error.h" #include "xfs_bmap.h" -#include "xfs_attr.h" +#include "xfs_bmap_btree.h" #include "xfs_trans.h" -#include "xfs_buf_item.h" #include "xfs_trans_space.h" #include "xfs_qm.h" #include "xfs_trace.h" #include "xfs_icache.h" #include "xfs_cksum.h" +#include "xfs_dinode.h" /* * The global quota manager. There is only one of these for the entire
fs/xfs/xfs_qm_bhv.c +0 -7
@@ -22,18 +22,11 @@#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_alloc.h" #include "xfs_quota.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" #include "xfs_inode.h" -#include "xfs_itable.h" -#include "xfs_bmap.h" -#include "xfs_rtalloc.h" #include "xfs_error.h" -#include "xfs_attr.h" #include "xfs_trans.h" -#include "xfs_buf_item.h" #include "xfs_qm.h"
fs/xfs/xfs_qm_syscalls.c +1 -9
@@ -27,19 +27,11 @@#include "xfs_bit.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_alloc.h" -#include "xfs_quota.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" #include "xfs_inode.h" #include "xfs_trans.h" -#include "xfs_inode_item.h" -#include "xfs_itable.h" -#include "xfs_bmap.h" -#include "xfs_rtalloc.h" #include "xfs_error.h" -#include "xfs_attr.h" -#include "xfs_buf_item.h" +#include "xfs_quota.h" #include "xfs_qm.h" #include "xfs_trace.h" #include "xfs_icache.h"
fs/xfs/xfs_quotaops.c +1 -2
@@ -22,10 +22,9 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_inode.h" #include "xfs_quota.h" #include "xfs_trans.h" -#include "xfs_bmap_btree.h" -#include "xfs_inode.h" #include "xfs_qm.h" #include <linux/quota.h>
fs/xfs/xfs_rtalloc.c +3 -6
@@ -25,21 +25,18 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" -#include "xfs_alloc.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" -#include "xfs_rtalloc.h" -#include "xfs_fsops.h" +#include "xfs_bmap_btree.h" +#include "xfs_alloc.h" #include "xfs_error.h" #include "xfs_trans.h" -#include "xfs_inode_item.h" #include "xfs_trans_space.h" #include "xfs_trace.h" #include "xfs_buf.h" #include "xfs_icache.h" +#include "xfs_dinode.h" /*
fs/xfs/xfs_sb.c +4 -14
@@ -21,31 +21,21 @@#include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_inum.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_da_format.h" -#include "xfs_da_btree.h" -#include "xfs_dir2.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" -#include "xfs_btree.h" #include "xfs_ialloc.h" #include "xfs_alloc.h" -#include "xfs_rtalloc.h" -#include "xfs_bmap.h" #include "xfs_error.h" -#include "xfs_quota.h" -#include "xfs_fsops.h" #include "xfs_trace.h" #include "xfs_cksum.h" #include "xfs_trans.h" -#include "xfs_trans_priv.h" #include "xfs_buf_item.h" +#include "xfs_dinode.h" +#include "xfs_bmap_btree.h" +#include "xfs_alloc_btree.h" +#include "xfs_ialloc_btree.h" /* * Physical superblock buffer manipulations. Shared with libxfs in userspace.
fs/xfs/xfs_super.c +4 -12
@@ -24,29 +24,18 @@#include "xfs_inum.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_alloc.h" -#include "xfs_quota.h" #include "xfs_mount.h" #include "xfs_da_format.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" -#include "xfs_ialloc.h" #include "xfs_bmap.h" -#include "xfs_rtalloc.h" +#include "xfs_alloc.h" #include "xfs_error.h" -#include "xfs_itable.h" #include "xfs_fsops.h" -#include "xfs_attr.h" #include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_log.h" #include "xfs_log_priv.h" -#include "xfs_trans_priv.h" -#include "xfs_filestream.h" #include "xfs_da_btree.h" #include "xfs_dir2.h" #include "xfs_extfree_item.h"
@@ -55,6 +44,9 @@#include "xfs_icache.h" #include "xfs_trace.h" #include "xfs_icreate_item.h" +#include "xfs_dinode.h" +#include "xfs_filestream.h" +#include "xfs_quota.h" #include <linux/namei.h> #include <linux/init.h>
fs/xfs/xfs_symlink.c +2 -4
@@ -28,13 +28,11 @@#include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_dir2.h" -#include "xfs_bmap_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_ialloc.h" #include "xfs_alloc.h" #include "xfs_bmap.h" +#include "xfs_bmap_btree.h" #include "xfs_bmap_util.h" #include "xfs_error.h" #include "xfs_quota.h"
@@ -42,8 +40,8 @@#include "xfs_trace.h" #include "xfs_symlink.h" #include "xfs_trans.h" -#include "xfs_buf_item.h" #include "xfs_log.h" +#include "xfs_dinode.h" /* ----- Kernel only functions below ----- */ STATIC int
fs/xfs/xfs_trace.c +1 -4
@@ -25,10 +25,6 @@#include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_da_format.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" #include "xfs_da_btree.h"
@@ -49,6 +45,7 @@#include "xfs_dquot.h" #include "xfs_log_recover.h" #include "xfs_inode_item.h" +#include "xfs_bmap_btree.h" /* * We include this last to have the helpers above available for the trace
fs/xfs/xfs_trans.c +1 -15
@@ -25,28 +25,14 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_error.h" -#include "xfs_da_format.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" -#include "xfs_btree.h" -#include "xfs_ialloc.h" -#include "xfs_alloc.h" #include "xfs_extent_busy.h" -#include "xfs_bmap.h" #include "xfs_quota.h" #include "xfs_trans.h" #include "xfs_trans_priv.h" -#include "xfs_trans_space.h" -#include "xfs_qm.h" -#include "xfs_inode_item.h" #include "xfs_log.h" -#include "xfs_log_priv.h" -#include "xfs_buf_item.h" #include "xfs_trace.h" +#include "xfs_error.h" kmem_zone_t *xfs_trans_zone;kmem_zone_t *xfs_log_item_desc_zone;
fs/xfs/xfs_trans.h +5 -0
@@ -234,6 +234,11 @@ void xfs_trans_cancel(xfs_trans_t *, int);int xfs_trans_ail_init (struct xfs_mount *);void xfs_trans_ail_destroy (struct xfs_mount *); +void xfs_trans_buf_set_type (struct xfs_trans *,struct xfs_buf *, +enum xfs_blft ); +void xfs_trans_buf_copy_type (struct xfs_buf *dst_bp, +struct xfs_buf *src_bp); +extern kmem_zone_t *xfs_trans_zone;extern kmem_zone_t *xfs_log_item_desc_zone;
fs/xfs/xfs_trans_buf.c +1 -4
@@ -18,15 +18,12 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trans.h" #include "xfs_buf_item.h"
fs/xfs/xfs_trans_dquot.c +1 -8
@@ -23,19 +23,12 @@#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_alloc.h" -#include "xfs_quota.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" #include "xfs_inode.h" -#include "xfs_itable.h" -#include "xfs_bmap.h" -#include "xfs_rtalloc.h" #include "xfs_error.h" -#include "xfs_attr.h" #include "xfs_trans.h" -#include "xfs_buf_item.h" #include "xfs_trans_priv.h" +#include "xfs_quota.h" #include "xfs_qm.h" STATIC void xfs_trans_alloc_dqinfo(xfs_trans_t *);
fs/xfs/xfs_trans_inode.c +1 -5
@@ -18,17 +18,13 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" -#include "xfs_btree.h" #include "xfs_trans.h" #include "xfs_trans_priv.h" #include "xfs_inode_item.h"
fs/xfs/xfs_trans_resv.c +1 -11
@@ -26,19 +26,9 @@#include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_da_format.h" -#include "xfs_error.h" -#include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dinode.h" #include "xfs_inode.h" -#include "xfs_btree.h" +#include "xfs_bmap_btree.h" #include "xfs_ialloc.h" -#include "xfs_alloc.h" -#include "xfs_extent_busy.h" -#include "xfs_bmap.h" -#include "xfs_bmap_util.h" #include "xfs_quota.h" #include "xfs_trans.h" #include "xfs_qm.h"
fs/xfs/xfs_xattr.c +1 -1
@@ -17,13 +17,13 @@*/ #include "xfs.h" +#include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_da_format.h" -#include "xfs_bmap_btree.h" #include "xfs_inode.h" #include "xfs_attr.h" #include "xfs_attr_leaf.h"
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 19/19 xfs: convert directory vector functions to constants
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Many of the vectorised function calls now take no parameters and return a constant value. There is no reason for these to be vectored functions, so convert them to constants
Binary sizes:
text data bss dec hex filename
794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2 789293 96802 1096 887191 d8997 fs/xfs/xfs.o.p3 789005 96802 1096 886903 d8997 fs/xfs/xfs.o.p4 789061 96802 1096 886959 d88af fs/xfs/xfs.o.p5 789733 96802 1096 887631 d8b4f fs/xfs/xfs.o.p6 791421 96802 1096 889319 d91e7 fs/xfs/xfs.o.p7 791701 96802 1096 889599 d92ff fs/xfs/xfs.o.p8 791205 96802 1096 889103 d91cf fs/xfs/xfs.o.p9
--- fs/xfs/xfs_da_btree.c | 14 ++- fs/xfs/xfs_da_format.c | 222 +++++++++++++++++----------------------------- fs/xfs/xfs_dir2.c | 2 +- fs/xfs/xfs_dir2.h | 14 +-- fs/xfs/xfs_dir2_block.c | 4 +- fs/xfs/xfs_dir2_data.c | 8 +- fs/xfs/xfs_dir2_leaf.c | 6 +- fs/xfs/xfs_dir2_node.c | 8 +- fs/xfs/xfs_dir2_readdir.c | 6 +- fs/xfs/xfs_dir2_sf.c | 6 +- 10 files changed, 113 insertions(+), 177 deletions(-)
fs/xfs/xfs_da_btree.c +6 -8
@@ -333,8 +333,7 @@ xfs_da3_node_create( dp->d_ops->node_hdr_to_disk (node, &ichdr);xfs_trans_log_buf (tp, bp, -XFS_DA_LOGRANGE (node, &node->hdr, - dp->d_ops->node_hdr_size ())); +XFS_DA_LOGRANGE (node, &node->hdr, dp->d_ops->node_hdr_size)); *bpp = bp;return (0 );
@@ -838,13 +837,12 @@ xfs_da3_node_rebalance(*/ dp->d_ops->node_hdr_to_disk (node1, &nodehdr1);xfs_trans_log_buf (tp, blk1->bp, -XFS_DA_LOGRANGE (node1, &node1->hdr, - dp->d_ops->node_hdr_size ())); +XFS_DA_LOGRANGE (node1, &node1->hdr, dp->d_ops->node_hdr_size)); dp->d_ops->node_hdr_to_disk (node2, &nodehdr2);xfs_trans_log_buf (tp, blk2->bp,XFS_DA_LOGRANGE (node2, &node2->hdr, - dp->d_ops->node_hdr_size () + + dp->d_ops->node_hdr_size + (sizeof (btree2[0 ]) * nodehdr2.count)));/*
@@ -915,7 +913,7 @@ xfs_da3_node_add( nodehdr.count +=1 ; dp->d_ops->node_hdr_to_disk (node, &nodehdr);xfs_trans_log_buf (state->args->trans, oldblk->bp, -XFS_DA_LOGRANGE (node, &node->hdr, dp->d_ops->node_hdr_size ())); +XFS_DA_LOGRANGE (node, &node->hdr, dp->d_ops->node_hdr_size));/* * Copy the last hash value from the oldblk to propagate upwards.
@@ -1350,7 +1348,7 @@ xfs_da3_node_remove( nodehdr.count -=1 ; dp->d_ops->node_hdr_to_disk (node, &nodehdr);xfs_trans_log_buf (state->args->trans, drop_blk->bp, -XFS_DA_LOGRANGE (node, &node->hdr, dp->d_ops->node_hdr_size ())); +XFS_DA_LOGRANGE (node, &node->hdr, dp->d_ops->node_hdr_size));/* * Copy the last hash value from the block to propagate upwards.
@@ -1423,7 +1421,7 @@ xfs_da3_node_unbalance( dp->d_ops->node_hdr_to_disk (save_node, &save_hdr);xfs_trans_log_buf (tp, save_blk->bp,XFS_DA_LOGRANGE (save_node, &save_node->hdr, - dp->d_ops->node_hdr_size ())); + dp->d_ops->node_hdr_size));/* * Save the last hashval in the remaining block for upward propagation.
fs/xfs/xfs_da_format.c +80 -142
442 lines not on this page · raw message
fs/xfs/xfs_dir2.c +1 -1
@@ -105,7 +105,7 @@ xfs_dir_mount( mp->m_dirleafblk =xfs_dir2_db_to_da (mp,XFS_DIR2_LEAF_FIRSTDB (mp)); mp->m_dirfreeblk =xfs_dir2_db_to_da (mp,XFS_DIR2_FREE_FIRSTDB (mp)); - nodehdr_size = mp->m_dir_inode_ops->node_hdr_size (); + nodehdr_size = mp->m_dir_inode_ops->node_hdr_size; mp->m_attr_node_ents = (mp->m_sb.sb_blocksize - nodehdr_size) / (uint )sizeof (xfs_da_node_entry_t); mp->m_dir_node_ents = (mp->m_dirblksize - nodehdr_size) /
fs/xfs/xfs_dir2.h +7 -7
@@ -59,10 +59,10 @@ struct xfs_dir_ops {struct xfs_dir2_data_free * (*data_bestfree_p)(struct xfs_dir2_data_hdr *hdr); -xfs_dir2_data_aoff_t (*data_dot_offset)(void); -xfs_dir2_data_aoff_t (*data_dotdot_offset)(void); -xfs_dir2_data_aoff_t (*data_first_offset)(void); -size_t (*data_entry_offset)(void ); +xfs_dir2_data_aoff_t data_dot_offset; +xfs_dir2_data_aoff_t data_dotdot_offset; +xfs_dir2_data_aoff_t data_first_offset; +size_t data_entry_offset;struct xfs_dir2_data_entry * (*data_dot_entry_p)(struct xfs_dir2_data_hdr *hdr);
@@ -75,7 +75,7 @@ struct xfs_dir_ops {struct xfs_dir2_data_unused * (*data_unused_p)(struct xfs_dir2_data_hdr *hdr); -int (*leaf_hdr_size)(void ); +int leaf_hdr_size;void (*leaf_hdr_to_disk)(struct xfs_dir2_leaf *to,struct xfs_dir3_icleaf_hdr *from); void (*leaf_hdr_from_disk)(struct xfs_dir3_icleaf_hdr *to,
@@ -84,7 +84,7 @@ struct xfs_dir_ops {struct xfs_dir2_leaf_entry * (*leaf_ents_p)(struct xfs_dir2_leaf *lp); -int (*node_hdr_size)(void ); +int node_hdr_size;void (*node_hdr_to_disk)(struct xfs_da_intnode *to,struct xfs_da3_icnode_hdr *from); void (*node_hdr_from_disk)(struct xfs_da3_icnode_hdr *to,
@@ -92,7 +92,7 @@ struct xfs_dir_ops {struct xfs_da_node_entry * (*node_tree_p)(struct xfs_da_intnode *dap); -int (*free_hdr_size)(void ); +int free_hdr_size;void (*free_hdr_to_disk)(struct xfs_dir2_free *to,struct xfs_dir3_icfree_hdr *from); void (*free_hdr_from_disk)(struct xfs_dir3_icfree_hdr *to,
fs/xfs/xfs_dir2_block.c +2 -2
@@ -951,7 +951,7 @@ xfs_dir2_leaf_to_block(while (dp->i_d.di_size > mp->m_dirblksize) {int hdrsz; - hdrsz = dp->d_ops->data_entry_offset (); + hdrsz = dp->d_ops->data_entry_offset; bestsp =xfs_dir2_leaf_bests_p (ltp);if (be16_to_cpu (bestsp[be32_to_cpu (ltp->bestcount) -1 ]) == mp->m_dirblksize - hdrsz) {
@@ -1185,7 +1185,7 @@ xfs_dir2_sf_to_block( blp[1 ].hashval =cpu_to_be32 (xfs_dir_hash_dotdot); blp[1 ].address =cpu_to_be32 (xfs_dir2_byte_to_dataptr (mp, (char *)dep - (char *)hdr)); - offset = dp->d_ops->data_first_offset (); + offset = dp->d_ops->data_first_offset;/* * Loop over existing entries, stuff them in. */
fs/xfs/xfs_dir2_data.c +4 -4
@@ -598,7 +598,7 @@ xfs_dir3_data_init( hdr->magic =cpu_to_be32 (XFS_DIR2_DATA_MAGIC ); bf = dp->d_ops->data_bestfree_p (hdr); - bf[0 ].offset =cpu_to_be16 (dp->d_ops->data_entry_offset ()); + bf[0 ].offset =cpu_to_be16 (dp->d_ops->data_entry_offset);for (i =1 ; i <XFS_DIR2_DATA_FD_COUNT ; i++) { bf[i].length =0 ; bf[i].offset =0 ;
@@ -610,7 +610,7 @@ xfs_dir3_data_init( dup = dp->d_ops->data_unused_p (hdr); dup->freetag =cpu_to_be16 (XFS_DIR2_DATA_FREE_TAG ); - t = mp->m_dirblksize - (uint )dp->d_ops->data_entry_offset (); + t = mp->m_dirblksize - (uint )dp->d_ops->data_entry_offset; bf[0 ].length =cpu_to_be16 (t); dup->length =cpu_to_be16 (t); *xfs_dir2_data_unused_tag_p (dup) =cpu_to_be16 ((char *)dup - (char *)hdr);
@@ -663,7 +663,7 @@ xfs_dir2_data_log_header( hdr->magic == cpu_to_be32(XFS_DIR3_BLOCK_MAGIC));#endif -xfs_trans_log_buf (tp, bp,0 , dp->d_ops->data_entry_offset () -1 ); +xfs_trans_log_buf (tp, bp,0 , dp->d_ops->data_entry_offset -1 ); }/*
@@ -742,7 +742,7 @@ xfs_dir2_data_make_free(* If this isn't the start of the block, then back up to * the previous entry and see if it's free. */ -if (offset > dp->d_ops->data_entry_offset ()) { +if (offset > dp->d_ops->data_entry_offset) {__be16 *tagp;/* tag just before us */ tagp = (__be16 *)((char *)hdr + offset) -1 ;
fs/xfs/xfs_dir2_leaf.c +3 -3
@@ -1116,7 +1116,7 @@ xfs_dir3_leaf_log_header( leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC));xfs_trans_log_buf (tp, bp, (uint)((char *)&leaf->hdr - (char *)leaf), - dp->d_ops->leaf_hdr_size () -1 ); + dp->d_ops->leaf_hdr_size -1 ); }/*
@@ -1424,7 +1424,7 @@ xfs_dir2_leaf_removename(* If the data block is now empty then get rid of the data block. */ if (be16_to_cpu (bf[0 ].length) == - mp->m_dirblksize - dp->d_ops->data_entry_offset ()) { + mp->m_dirblksize - dp->d_ops->data_entry_offset) {ASSERT (db != mp->m_dirdatablk);if ((error =xfs_dir2_shrink_inode (args, db, dbp))) {/*
@@ -1623,7 +1623,7 @@ xfs_dir2_leaf_trim_data(ASSERT (hdr->magic ==cpu_to_be32 (XFS_DIR2_DATA_MAGIC ) || hdr->magic ==cpu_to_be32 (XFS_DIR3_DATA_MAGIC ));ASSERT (be16_to_cpu (bf[0 ].length) == - mp->m_dirblksize - dp->d_ops->data_entry_offset ()); + mp->m_dirblksize - dp->d_ops->data_entry_offset); ASSERT(db == be32_to_cpu(ltp->bestcount) - 1); }#endif
fs/xfs/xfs_dir2_node.c +4 -4
@@ -274,7 +274,7 @@ xfs_dir2_free_log_header(ASSERT (free->hdr.magic ==cpu_to_be32 (XFS_DIR2_FREE_MAGIC ) || free->hdr.magic ==cpu_to_be32 (XFS_DIR3_FREE_MAGIC ));#endif -xfs_trans_log_buf (tp, bp,0 , dp->d_ops->free_hdr_size () -1 ); +xfs_trans_log_buf (tp, bp,0 , dp->d_ops->free_hdr_size -1 ); }/*
@@ -1268,7 +1268,7 @@ xfs_dir2_leafn_remove(* (usually). */ if (longest == mp->m_dirblksize - - dp->d_ops->data_entry_offset ()) { + dp->d_ops->data_entry_offset) {/* * Try to punch out the data block. */
@@ -1300,7 +1300,7 @@ xfs_dir2_leafn_remove(* Return indication of whether this leaf block is empty enough * to justify trying to join it with a neighbor. */ - *rval = (dp->d_ops->leaf_hdr_size () + + *rval = (dp->d_ops->leaf_hdr_size + (uint )sizeof (ents[0 ]) * (leafhdr.count - leafhdr.stale)) < mp->m_dir_magicpct;return 0 ;
@@ -1409,7 +1409,7 @@ xfs_dir2_leafn_toosmall(xfs_dir3_leaf_check (dp, blk->bp); count = leafhdr.count - leafhdr.stale; - bytes = dp->d_ops->leaf_hdr_size () + count *sizeof (ents[0 ]); + bytes = dp->d_ops->leaf_hdr_size + count *sizeof (ents[0 ]);if (bytes > (state->blocksize >>1 )) {/* * Blk over 50%, don't try to join.
fs/xfs/xfs_dir2_readdir.c +3 -3
@@ -119,9 +119,9 @@ xfs_dir2_sf_getdents(* mp->m_dirdatablk. */ dot_offset =xfs_dir2_db_off_to_dataptr (mp, mp->m_dirdatablk, - dp->d_ops->data_dot_offset ()); + dp->d_ops->data_dot_offset); dotdot_offset =xfs_dir2_db_off_to_dataptr (mp, mp->m_dirdatablk, - dp->d_ops->data_dotdot_offset ()); + dp->d_ops->data_dotdot_offset);/* * Put . entry unless we're starting past it.
@@ -584,7 +584,7 @@ xfs_dir2_leaf_getdents(* Skip past the header. */ if (byteoff ==0 ) - curoff += dp->d_ops->data_entry_offset (); + curoff += dp->d_ops->data_entry_offset;/* * Skip past entries until we reach our offset. */
fs/xfs/xfs_dir2_sf.c +3 -3
@@ -473,7 +473,7 @@ xfs_dir2_sf_addname_hard(* to insert the new entry. * If it's going to end up at the end then oldsfep will point there. */ - for (offset = dp->d_ops->data_first_offset(), + for (offset = dp->d_ops->data_first_offset, oldsfep = xfs_dir2_sf_firstentry(oldsfp), add_datasize = dp->d_ops->data_entsize(args->namelen), eof = (char *)oldsfep == &buf[old_isize];
@@ -556,7 +556,7 @@ xfs_dir2_sf_addname_pick( sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; size = dp->d_ops->data_entsize (args->namelen); - offset = dp->d_ops->data_first_offset (); + offset = dp->d_ops->data_first_offset; sfep =xfs_dir2_sf_firstentry (sfp); holefit =0 ;/*
@@ -629,7 +629,7 @@ xfs_dir2_sf_check( mp = dp->i_mount; sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; - offset = dp->d_ops->data_first_offset (); + offset = dp->d_ops->data_first_offset; ino = dp->d_ops->sf_get_parent_ino (sfp); i8count = ino >XFS_DIR2_MAX_SHORT_INUM ;
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 13/19 xfs: vectorise directory data operations
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Following from the initial patches to vectorise the shortform directory encode/decode operations, convert half the data block operations to use the vector. The rest will be done in a second patch.
This further reduces the size of the built binary:
text data bss dec hex filename
794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2 789293 96802 1096 887191 d8997 fs/xfs/xfs.o.p3
--- fs/xfs/xfs_da_format.c | 218 +++++++++++++++++++++++++++++++++++++++++++++- fs/xfs/xfs_da_format.h | 123 -------------------------- fs/xfs/xfs_dir2.h | 22 ++++- fs/xfs/xfs_dir2_block.c | 54 ++++++------ fs/xfs/xfs_dir2_data.c | 38 +++++--- fs/xfs/xfs_dir2_leaf.c | 22 ++--- fs/xfs/xfs_dir2_node.c | 23 ++--- fs/xfs/xfs_dir2_readdir.c | 14 +-- fs/xfs/xfs_dir2_sf.c | 20 ++--- 9 files changed, 329 insertions(+), 205 deletions(-)
fs/xfs/xfs_da_format.c +217 -1
@@ -28,7 +28,9 @@#include "xfs_inode.h" #include "xfs_dir2.h" - +/* +* Shortform directory ops +*/ static int xfs_dir2_sf_entsize( struct xfs_dir2_sf_hdr *hdr,
@@ -203,6 +205,184 @@ xfs_dir3_sfe_put_ino( (xfs_dir2_inou_t *)&sfep->name[sfep->namelen + 1], ino); } + +/* +* Directory data block operations +*/ +static int +__xfs_dir3_data_entsize ( +bool ftype, +int n) +{ + int size = offsetof(struct xfs_dir2_data_entry, name[0]); + + size += n; + size +=sizeof (xfs_dir2_data_off_t); +if (ftype) + size +=sizeof (__uint8_t); +return roundup (size,XFS_DIR2_DATA_ALIGN ); +} + +static int +xfs_dir2_data_entsize ( +int n) +{ +return __xfs_dir3_data_entsize (false, n); +} +static int +xfs_dir3_data_entsize ( +int n) +{ +return __xfs_dir3_data_entsize (true, n); +} + +static __uint8_t +xfs_dir2_data_get_ftype ( +struct xfs_dir2_data_entry *dep) +{ +return XFS_DIR3_FT_UNKNOWN ; +} + +static void +xfs_dir2_data_put_ftype ( +struct xfs_dir2_data_entry *dep, +__uint8_t ftype) +{ +ASSERT (ftype <XFS_DIR3_FT_MAX ); +} + +static __uint8_t +xfs_dir3_data_get_ftype ( +struct xfs_dir2_data_entry *dep) +{ +__uint8_t ftype = dep->name[dep->namelen]; + +ASSERT (ftype <XFS_DIR3_FT_MAX ); +if (ftype >=XFS_DIR3_FT_MAX ) +return XFS_DIR3_FT_UNKNOWN ; +return ftype; +} + +static void +xfs_dir3_data_put_ftype ( +struct xfs_dir2_data_entry *dep, +__uint8_t type) +{ +ASSERT (type <XFS_DIR3_FT_MAX ); +ASSERT (dep->namelen !=0 ); + + dep->name[dep->namelen] = type; +} + +/* +* Pointer to an entry's tag word. +*/ +static __be16 * +xfs_dir2_data_entry_tag_p ( +struct xfs_dir2_data_entry *dep) +{ +return (__be16 *)((char *)dep + +xfs_dir2_data_entsize (dep->namelen) -sizeof (__be16)); +} + +static __be16 * +xfs_dir3_data_entry_tag_p ( +struct xfs_dir2_data_entry *dep) +{ +return (__be16 *)((char *)dep + +xfs_dir3_data_entsize (dep->namelen) -sizeof (__be16)); +} + +/* +* Offsets of . and .. in data space (always block 0) +*/ +static xfs_dir2_data_aoff_t +xfs_dir2_data_dot_offset (void ) +{ +return sizeof (struct xfs_dir2_data_hdr ); +} + +static xfs_dir2_data_aoff_t +xfs_dir2_data_dotdot_offset (void ) +{ +return xfs_dir2_data_dot_offset () +xfs_dir2_data_entsize (1 ); +} + +static xfs_dir2_data_aoff_t +xfs_dir2_data_first_offset (void ) +{ +return xfs_dir2_data_dotdot_offset () +xfs_dir2_data_entsize (2 ); +} + +static xfs_dir2_data_aoff_t +xfs_dir3_data_dot_offset (void ) +{ +return sizeof (struct xfs_dir3_data_hdr ); +} + +static xfs_dir2_data_aoff_t +xfs_dir3_data_dotdot_offset (void ) +{ +return xfs_dir3_data_dot_offset () +xfs_dir3_data_entsize (1 ); +} + +static xfs_dir2_data_aoff_t +xfs_dir3_data_first_offset (void ) +{ +return xfs_dir3_data_dotdot_offset () +xfs_dir3_data_entsize (2 ); +} + +/* +* location of . and .. in data space (always block 0) +*/ +static struct xfs_dir2_data_entry * +xfs_dir2_data_dot_entry_p ( +struct xfs_dir2_data_hdr *hdr) +{ +return (struct xfs_dir2_data_entry *) + ((char *)hdr +xfs_dir2_data_dot_offset ()); +} + +static struct xfs_dir2_data_entry * +xfs_dir2_data_dotdot_entry_p ( +struct xfs_dir2_data_hdr *hdr) +{ +return (struct xfs_dir2_data_entry *) + ((char *)hdr +xfs_dir2_data_dotdot_offset ()); +} + +static struct xfs_dir2_data_entry * +xfs_dir2_data_first_entry_p ( +struct xfs_dir2_data_hdr *hdr) +{ +return (struct xfs_dir2_data_entry *) + ((char *)hdr +xfs_dir2_data_first_offset ()); +} + +static struct xfs_dir2_data_entry * +xfs_dir3_data_dot_entry_p ( +struct xfs_dir2_data_hdr *hdr) +{ +return (struct xfs_dir2_data_entry *) + ((char *)hdr +xfs_dir3_data_dot_offset ()); +} + +static struct xfs_dir2_data_entry * +xfs_dir3_data_dotdot_entry_p ( +struct xfs_dir2_data_hdr *hdr) +{ +return (struct xfs_dir2_data_entry *) + ((char *)hdr +xfs_dir3_data_dotdot_offset ()); +} + +static struct xfs_dir2_data_entry * +xfs_dir3_data_first_entry_p ( +struct xfs_dir2_data_hdr *hdr) +{ +return (struct xfs_dir2_data_entry *) + ((char *)hdr +xfs_dir3_data_first_offset ()); +} +const struct xfs_dir_ops xfs_dir2_ops = { .sf_entsize = xfs_dir2_sf_entsize, .sf_nextentry = xfs_dir2_sf_nextentry,
@@ -212,6 +392,18 @@ const struct xfs_dir_ops xfs_dir2_ops = { .sf_put_ino = xfs_dir2_sfe_put_ino, .sf_get_parent_ino = xfs_dir2_sf_get_parent_ino, .sf_put_parent_ino = xfs_dir2_sf_put_parent_ino, + + .data_entsize = xfs_dir2_data_entsize, + .data_get_ftype = xfs_dir2_data_get_ftype, + .data_put_ftype = xfs_dir2_data_put_ftype, + .data_entry_tag_p = xfs_dir2_data_entry_tag_p, + + .data_dot_offset = xfs_dir2_data_dot_offset, + .data_dotdot_offset = xfs_dir2_data_dotdot_offset, + .data_first_offset = xfs_dir2_data_first_offset, + .data_dot_entry_p = xfs_dir2_data_dot_entry_p, + .data_dotdot_entry_p = xfs_dir2_data_dotdot_entry_p, + .data_first_entry_p = xfs_dir2_data_first_entry_p, };const struct xfs_dir_ops xfs_dir2_ftype_ops = {
@@ -223,6 +415,18 @@ const struct xfs_dir_ops xfs_dir2_ftype_ops = { .sf_put_ino = xfs_dir3_sfe_put_ino, .sf_get_parent_ino = xfs_dir2_sf_get_parent_ino, .sf_put_parent_ino = xfs_dir2_sf_put_parent_ino, + + .data_entsize = xfs_dir3_data_entsize, + .data_get_ftype = xfs_dir3_data_get_ftype, + .data_put_ftype = xfs_dir3_data_put_ftype, + .data_entry_tag_p = xfs_dir3_data_entry_tag_p, + + .data_dot_offset = xfs_dir2_data_dot_offset, + .data_dotdot_offset = xfs_dir2_data_dotdot_offset, + .data_first_offset = xfs_dir2_data_first_offset, + .data_dot_entry_p = xfs_dir2_data_dot_entry_p, + .data_dotdot_entry_p = xfs_dir2_data_dotdot_entry_p, + .data_first_entry_p = xfs_dir2_data_first_entry_p, };const struct xfs_dir_ops xfs_dir3_ops = {
@@ -234,4 +438,16 @@ const struct xfs_dir_ops xfs_dir3_ops = { .sf_put_ino = xfs_dir3_sfe_put_ino, .sf_get_parent_ino = xfs_dir2_sf_get_parent_ino, .sf_put_parent_ino = xfs_dir2_sf_put_parent_ino, + + .data_entsize = xfs_dir3_data_entsize, + .data_get_ftype = xfs_dir3_data_get_ftype, + .data_put_ftype = xfs_dir3_data_put_ftype, + .data_entry_tag_p = xfs_dir3_data_entry_tag_p, + + .data_dot_offset = xfs_dir3_data_dot_offset, + .data_dotdot_offset = xfs_dir3_data_dotdot_offset, + .data_first_offset = xfs_dir3_data_first_offset, + .data_dot_entry_p = xfs_dir3_data_dot_entry_p, + .data_dotdot_entry_p = xfs_dir3_data_dotdot_entry_p, + .data_first_entry_p = xfs_dir3_data_first_entry_p, };
fs/xfs/xfs_da_format.h +0 -123
135 lines not on this page · raw message
fs/xfs/xfs_dir2.h +19 -3
@@ -50,6 +50,22 @@ struct xfs_dir_ops {xfs_ino_t (*sf_get_parent_ino)(struct xfs_dir2_sf_hdr *hdr);void (*sf_put_parent_ino)(struct xfs_dir2_sf_hdr *hdr,xfs_ino_t ino); + +int (*data_entsize)(int len); +__uint8_t (*data_get_ftype)(struct xfs_dir2_data_entry *dep); +void (*data_put_ftype)(struct xfs_dir2_data_entry *dep, +__uint8_t ftype); +__be16 * (*data_entry_tag_p)(struct xfs_dir2_data_entry *dep); + +xfs_dir2_data_aoff_t (*data_dot_offset)(void); +xfs_dir2_data_aoff_t (*data_dotdot_offset)(void); +xfs_dir2_data_aoff_t (*data_first_offset)(void); +struct xfs_dir2_data_entry * + (*data_dot_entry_p)(struct xfs_dir2_data_hdr *hdr); +struct xfs_dir2_data_entry * + (*data_dotdot_entry_p)(struct xfs_dir2_data_hdr *hdr); +struct xfs_dir2_data_entry * + (*data_first_entry_p)(struct xfs_dir2_data_hdr *hdr); };extern const struct xfs_dir_ops xfs_dir2_ops;
@@ -95,10 +111,10 @@ extern int xfs_dir2_isleaf(struct xfs_trans *tp, struct xfs_inode *dp, int *r);extern int xfs_dir2_shrink_inode (struct xfs_da_args *args,xfs_dir2_db_t db,struct xfs_buf *bp); -extern void xfs_dir2_data_freescan (struct xfs_mount *mp, +extern void xfs_dir2_data_freescan (struct xfs_inode *dp,struct xfs_dir2_data_hdr *hdr,int *loghead); -extern void xfs_dir2_data_log_entry (struct xfs_trans *tp,struct xfs_buf *bp, -struct xfs_dir2_data_entry *dep); +extern void xfs_dir2_data_log_entry (struct xfs_trans *tp,struct xfs_inode *dp, +struct xfs_buf *bp,struct xfs_dir2_data_entry *dep);extern void xfs_dir2_data_log_header (struct xfs_trans *tp,struct xfs_buf *bp); extern void xfs_dir2_data_log_unused(struct xfs_trans *tp, struct xfs_buf *bp,
fs/xfs/xfs_dir2_block.c +27 -27
159 lines not on this page · raw message
fs/xfs/xfs_dir2_data.c +26 -12
@@ -62,12 +62,26 @@ __xfs_dir3_data_check(char *p;/* current data position */ int stale;/* count of stale leaves */ struct xfs_name name; +const struct xfs_dir_ops *ops; mp = bp->b_target->bt_mount; hdr = bp->b_addr; bf =xfs_dir3_data_bestfree_p (hdr); p = (char *)xfs_dir3_data_entry_p (hdr); +/* +* we can be passed a null dp here froma verifier, so manually configure +* the ops here in that case. +*/ +if (dp) + ops = dp->d_ops; +else if (xfs_sb_version_hascrc (&mp->m_sb)) + ops = &xfs_dir3_ops; +else if (xfs_sb_version_hasftype (&mp->m_sb)) + ops = &xfs_dir2_ftype_ops; +else + ops = &xfs_dir2_ops; +switch (hdr->magic) {case cpu_to_be32 (XFS_DIR3_BLOCK_MAGIC ):case cpu_to_be32 (XFS_DIR2_BLOCK_MAGIC ):
@@ -146,10 +160,10 @@ __xfs_dir3_data_check(XFS_WANT_CORRUPTED_RETURN ( !xfs_dir_ino_validate (mp,be64_to_cpu (dep->inumber)));XFS_WANT_CORRUPTED_RETURN ( -be16_to_cpu (*xfs_dir3_data_entry_tag_p (mp, dep)) == +be16_to_cpu (*ops->data_entry_tag_p (dep)) == (char *)dep - (char *)hdr);XFS_WANT_CORRUPTED_RETURN ( -xfs_dir3_dirent_get_ftype (mp, dep) <XFS_DIR3_FT_MAX ); + ops->data_get_ftype (dep) <XFS_DIR3_FT_MAX ); count++; lastfree =0 ; if (hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC) ||
@@ -167,7 +181,7 @@ __xfs_dir3_data_check( }XFS_WANT_CORRUPTED_RETURN (i <be32_to_cpu (btp->count)); } - p +=xfs_dir3_data_entsize (mp, dep->namelen); + p += ops->data_entsize (dep->namelen); }/* * Need to have seen all the entries and all the bestfree slots.
@@ -485,9 +499,9 @@ xfs_dir2_data_freeremove(*/ void xfs_dir2_data_freescan ( -xfs_mount_t *mp,/* filesystem mount point */ -xfs_dir2_data_hdr_t *hdr,/* data block header */ -int *loghead)/* out: log data header */ +struct xfs_inode *dp, +struct xfs_dir2_data_hdr *hdr, +int *loghead) {xfs_dir2_block_tail_t *btp;/* block tail */ xfs_dir2_data_entry_t *dep;/* active data entry */
@@ -513,10 +527,10 @@ xfs_dir2_data_freescan( p = (char *)xfs_dir3_data_entry_p (hdr);if (hdr->magic ==cpu_to_be32 (XFS_DIR2_BLOCK_MAGIC ) || hdr->magic ==cpu_to_be32 (XFS_DIR3_BLOCK_MAGIC )) { - btp =xfs_dir2_block_tail_p (mp, hdr); + btp =xfs_dir2_block_tail_p (dp->i_mount, hdr); endp = (char *)xfs_dir2_block_leaf_p (btp); }else - endp = (char *)hdr + mp->m_dirblksize; + endp = (char *)hdr + dp->i_mount->m_dirblksize;/* * Loop over the block's entries. */
@@ -537,8 +551,8 @@ xfs_dir2_data_freescan(else { dep = (xfs_dir2_data_entry_t *)p;ASSERT ((char *)dep - (char *)hdr == -be16_to_cpu (*xfs_dir3_data_entry_tag_p (mp, dep))); - p +=xfs_dir3_data_entsize (mp, dep->namelen); +be16_to_cpu (*dp->d_ops->data_entry_tag_p (dep))); + p += dp->d_ops->data_entsize (dep->namelen); } } }
@@ -625,11 +639,11 @@ xfs_dir3_data_init(void xfs_dir2_data_log_entry (struct xfs_trans *tp, +struct xfs_inode *dp,struct xfs_buf *bp,xfs_dir2_data_entry_t *dep)/* data entry pointer */ {struct xfs_dir2_data_hdr *hdr = bp->b_addr; -struct xfs_mount *mp = tp->t_mountp; ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC) || hdr->magic == cpu_to_be32(XFS_DIR3_DATA_MAGIC) ||
@@ -637,7 +651,7 @@ xfs_dir2_data_log_entry( hdr->magic == cpu_to_be32(XFS_DIR3_BLOCK_MAGIC));xfs_trans_log_buf (tp, bp, (uint)((char *)dep - (char *)hdr), - (uint)((char *)(xfs_dir3_data_entry_tag_p (mp, dep) +1 ) - + (uint)((char *)(dp->d_ops->data_entry_tag_p (dep) +1 ) - (char *)hdr -1 )); }
fs/xfs/xfs_dir2_leaf.c +11 -11
@@ -500,7 +500,7 @@ xfs_dir2_block_to_leaf( hdr->magic =cpu_to_be32 (XFS_DIR3_DATA_MAGIC );if (needscan) -xfs_dir2_data_freescan (mp, hdr, &needlog); +xfs_dir2_data_freescan (dp, hdr, &needlog);/* * Set up leaf tail and bests table. */
@@ -700,7 +700,7 @@ xfs_dir2_leaf_addname( ents =xfs_dir3_leaf_ents_p (leaf);xfs_dir3_leaf_hdr_from_disk (&leafhdr, leaf); bestsp =xfs_dir2_leaf_bests_p (ltp); - length =xfs_dir3_data_entsize (mp, args->namelen); + length = dp->d_ops->data_entsize (args->namelen);/* * See if there are any entries with the same hash value
@@ -901,20 +901,20 @@ xfs_dir2_leaf_addname( dep->inumber =cpu_to_be64 (args->inumber); dep->namelen = args->namelen;memcpy (dep->name, args->name, dep->namelen); -xfs_dir3_dirent_put_ftype (mp, dep, args->filetype); - tagp =xfs_dir3_data_entry_tag_p (mp, dep); + dp->d_ops->data_put_ftype (dep, args->filetype); + tagp = dp->d_ops->data_entry_tag_p (dep); *tagp =cpu_to_be16 ((char *)dep - (char *)hdr);/* * Need to scan fix up the bestfree table. */ if (needscan) -xfs_dir2_data_freescan (mp, hdr, &needlog); +xfs_dir2_data_freescan (dp, hdr, &needlog);/* * Need to log the data block's header. */ if (needlog)xfs_dir2_data_log_header (tp, dbp); -xfs_dir2_data_log_entry (tp, dbp, dep); +xfs_dir2_data_log_entry (tp, dp, dbp, dep);/* * If the bests table needs to be changed, do it. * Log the change unless we've already done that.
@@ -1230,7 +1230,7 @@ xfs_dir2_leaf_lookup(* Return the found inode number & CI name if appropriate */ args->inumber =be64_to_cpu (dep->inumber); - args->filetype =xfs_dir3_dirent_get_ftype (dp->i_mount, dep); + args->filetype = dp->d_ops->data_get_ftype (dep); error =xfs_dir_cilookup_result (args, dep->name, dep->namelen);xfs_trans_brelse (tp, dbp);xfs_trans_brelse (tp, lbp);
@@ -1433,7 +1433,7 @@ xfs_dir2_leaf_removename(*/ xfs_dir2_data_make_free (tp, dbp, (xfs_dir2_data_aoff_t)((char *)dep - (char *)hdr), -xfs_dir3_data_entsize (mp, dep->namelen), &needlog, &needscan); + dp->d_ops->data_entsize (dep->namelen), &needlog, &needscan);/* * We just mark the leaf entry stale by putting a null in it. */
@@ -1449,7 +1449,7 @@ xfs_dir2_leaf_removename(* log the data block header if necessary. */ if (needscan) -xfs_dir2_data_freescan (mp, hdr, &needlog); +xfs_dir2_data_freescan (dp, hdr, &needlog);if (needlog)xfs_dir2_data_log_header (tp, dbp);/*
@@ -1561,9 +1561,9 @@ xfs_dir2_leaf_replace(* Put the new inode number in, log it. */ dep->inumber =cpu_to_be64 (args->inumber); -xfs_dir3_dirent_put_ftype (dp->i_mount, dep, args->filetype); + dp->d_ops->data_put_ftype (dep, args->filetype); tp = args->trans; -xfs_dir2_data_log_entry (tp, dbp, dep); +xfs_dir2_data_log_entry (tp, dp, dbp, dep);xfs_dir3_leaf_check (dp->i_mount, lbp);xfs_trans_brelse (tp, lbp);return 0 ;
fs/xfs/xfs_dir2_node.c +12 -11
@@ -604,7 +604,7 @@ xfs_dir2_leafn_lookup_for_addname(ASSERT (free->hdr.magic ==cpu_to_be32 (XFS_DIR2_FREE_MAGIC ) || free->hdr.magic ==cpu_to_be32 (XFS_DIR3_FREE_MAGIC )); } - length =xfs_dir3_data_entsize (mp, args->namelen); + length = dp->d_ops->data_entsize (args->namelen);/* * Loop over leaf entries with the right hash value. */
@@ -815,7 +815,7 @@ xfs_dir2_leafn_lookup_for_entry(xfs_trans_brelse (tp, state->extrablk.bp); args->cmpresult = cmp; args->inumber =be64_to_cpu (dep->inumber); - args->filetype =xfs_dir3_dirent_get_ftype (mp, dep); + args->filetype = dp->d_ops->data_get_ftype (dep); *indexp = index; state->extravalid =1 ; state->extrablk.bp = curbp;
@@ -1259,13 +1259,13 @@ xfs_dir2_leafn_remove( longest =be16_to_cpu (bf[0 ].length); needlog = needscan =0 ;xfs_dir2_data_make_free (tp, dbp, off, -xfs_dir3_data_entsize (mp, dep->namelen), &needlog, &needscan); + dp->d_ops->data_entsize (dep->namelen), &needlog, &needscan);/* * Rescan the data block freespaces for bestfree. * Log the data block header if needed. */ if (needscan) -xfs_dir2_data_freescan (mp, hdr, &needlog); +xfs_dir2_data_freescan (dp, hdr, &needlog);if (needlog)xfs_dir2_data_log_header (tp, dbp);xfs_dir3_data_check (dp, dbp);
@@ -1711,7 +1711,7 @@ xfs_dir2_node_addname_int( dp = args->dp; mp = dp->i_mount; tp = args->trans; - length =xfs_dir3_data_entsize (mp, args->namelen); + length = dp->d_ops->data_entsize (args->namelen);/* * If we came in with a freespace block that means that lookup * found an entry with our hash value. This is the freespace
@@ -2007,15 +2007,15 @@ xfs_dir2_node_addname_int( dep->inumber =cpu_to_be64 (args->inumber); dep->namelen = args->namelen;memcpy (dep->name, args->name, dep->namelen); -xfs_dir3_dirent_put_ftype (mp, dep, args->filetype); - tagp =xfs_dir3_data_entry_tag_p (mp, dep); + dp->d_ops->data_put_ftype (dep, args->filetype); + tagp = dp->d_ops->data_entry_tag_p (dep); *tagp =cpu_to_be16 ((char *)dep - (char *)hdr); -xfs_dir2_data_log_entry (tp, dbp, dep); +xfs_dir2_data_log_entry (tp, dp, dbp, dep);/* * Rescan the block for bestfree if needed. */ if (needscan) -xfs_dir2_data_freescan (mp, hdr, &needlog); +xfs_dir2_data_freescan (dp, hdr, &needlog);/* * Log the data block header if needed. */
@@ -2228,8 +2228,9 @@ xfs_dir2_node_replace(* Fill in the new inode number and log the entry. */ dep->inumber =cpu_to_be64 (inum); -xfs_dir3_dirent_put_ftype (state->mp, dep, args->filetype); -xfs_dir2_data_log_entry (args->trans, state->extrablk.bp, dep); + args->dp->d_ops->data_put_ftype (dep, args->filetype); +xfs_dir2_data_log_entry (args->trans, args->dp, + state->extrablk.bp, dep); rval =0 ; }/*
fs/xfs/xfs_dir2_readdir.c +7 -7
@@ -119,9 +119,9 @@ xfs_dir2_sf_getdents(* mp->m_dirdatablk. */ dot_offset =xfs_dir2_db_off_to_dataptr (mp, mp->m_dirdatablk, -xfs_dir3_data_dot_offset (mp)); + dp->d_ops->data_dot_offset ()); dotdot_offset =xfs_dir2_db_off_to_dataptr (mp, mp->m_dirdatablk, -xfs_dir3_data_dotdot_offset (mp)); + dp->d_ops->data_dotdot_offset ());/* * Put . entry unless we're starting past it.
@@ -237,7 +237,7 @@ xfs_dir2_block_getdents(/* * Bump pointer for the next iteration. */ - ptr +=xfs_dir3_data_entsize (mp, dep->namelen); + ptr += dp->d_ops->data_entsize (dep->namelen);/* * The entry is before the desired starting point, skip it. */
@@ -248,7 +248,7 @@ xfs_dir2_block_getdents( (char *)dep - (char *)hdr); ctx->pos = cook &0x7fffffff ; - filetype =xfs_dir3_dirent_get_ftype (mp, dep); + filetype = dp->d_ops->data_get_ftype (dep);/* * If it didn't fit, set the final offset to here & return. */
@@ -601,7 +601,7 @@ xfs_dir2_leaf_getdents( } dep = (xfs_dir2_data_entry_t *)ptr; length = -xfs_dir3_data_entsize (mp, dep->namelen); + dp->d_ops->data_entsize (dep->namelen); ptr += length; }/*
@@ -632,8 +632,8 @@ xfs_dir2_leaf_getdents( } dep = (xfs_dir2_data_entry_t *)ptr; - length =xfs_dir3_data_entsize (mp, dep->namelen); - filetype =xfs_dir3_dirent_get_ftype (mp, dep); + length = dp->d_ops->data_entsize (dep->namelen); + filetype = dp->d_ops->data_get_ftype (dep); ctx->pos =xfs_dir2_byte_to_dataptr (mp, curoff) &0x7fffffff ; if (!dir_emit(ctx, (char *)dep->name, dep->namelen,
fs/xfs/xfs_dir2_sf.c +10 -10
@@ -251,11 +251,11 @@ xfs_dir2_block_to_sf( dp->d_ops->sf_put_ino (sfp, sfep,be64_to_cpu (dep->inumber)); dp->d_ops->sf_put_ftype (sfep, -xfs_dir3_dirent_get_ftype (mp, dep)); + dp->d_ops->data_get_ftype (dep)); sfep = dp->d_ops->sf_nextentry (sfp, sfep); } - ptr +=xfs_dir3_data_entsize (mp, dep->namelen); + ptr += dp->d_ops->data_entsize (dep->namelen); }ASSERT ((char *)sfep - (char *)sfp == size);xfs_dir2_sf_check (args);
@@ -473,12 +473,12 @@ xfs_dir2_sf_addname_hard(* to insert the new entry. * If it's going to end up at the end then oldsfep will point there. */ -for (offset =xfs_dir3_data_first_offset (mp), +for (offset = dp->d_ops->data_first_offset (), oldsfep =xfs_dir2_sf_firstentry (oldsfp), - add_datasize =xfs_dir3_data_entsize (mp, args->namelen), + add_datasize = dp->d_ops->data_entsize (args->namelen), eof = (char *)oldsfep == &buf[old_isize]; !eof; - offset = new_offset +xfs_dir3_data_entsize (mp, oldsfep->namelen), + offset = new_offset + dp->d_ops->data_entsize (oldsfep->namelen), oldsfep = dp->d_ops->sf_nextentry (oldsfp, oldsfep), eof = (char *)oldsfep == &buf[old_isize]) { new_offset =xfs_dir2_sf_get_offset (oldsfep);
@@ -555,8 +555,8 @@ xfs_dir2_sf_addname_pick( mp = dp->i_mount; sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; - size =xfs_dir3_data_entsize (mp, args->namelen); - offset =xfs_dir3_data_first_offset (mp); + size = dp->d_ops->data_entsize (args->namelen); + offset = dp->d_ops->data_first_offset (); sfep =xfs_dir2_sf_firstentry (sfp); holefit =0 ;/*
@@ -568,7 +568,7 @@ xfs_dir2_sf_addname_pick(if (!holefit) holefit = offset + size <=xfs_dir2_sf_get_offset (sfep); offset =xfs_dir2_sf_get_offset (sfep) + -xfs_dir3_data_entsize (mp, sfep->namelen); + dp->d_ops->data_entsize (sfep->namelen); sfep = dp->d_ops->sf_nextentry (sfp, sfep); }/*
@@ -629,7 +629,7 @@ xfs_dir2_sf_check( mp = dp->i_mount; sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; - offset =xfs_dir3_data_first_offset (mp); + offset = dp->d_ops->data_first_offset (); ino = dp->d_ops->sf_get_parent_ino (sfp); i8count = ino >XFS_DIR2_MAX_SHORT_INUM ;
@@ -641,7 +641,7 @@ xfs_dir2_sf_check( i8count += ino >XFS_DIR2_MAX_SHORT_INUM ; offset =xfs_dir2_sf_get_offset (sfep) + -xfs_dir3_data_entsize (mp, sfep->namelen); + dp->d_ops->data_entsize (sfep->namelen);ASSERT (dp->d_ops->sf_get_ftype (sfep) <XFS_DIR3_FT_MAX ); }ASSERT (i8count == sfp->i8count);
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 12/19 xfs: vectorise remaining shortform dir2 ops
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Following from the initial patch to introduce the directory operations vector, convert the rest of the shortform directory operations to use vectored ops rather than superblock feature checks. This further reduces the size of the built binary:
text data bss dec hex filename
794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2
--- fs/xfs/xfs_da_format.c | 152 ++++++++++++++++++++++++++++++++++++++++++++++ fs/xfs/xfs_da_format.h | 47 -------------- fs/xfs/xfs_dir2.h | 20 +++--- fs/xfs/xfs_dir2_block.c | 6 +- fs/xfs/xfs_dir2_readdir.c | 6 +- fs/xfs/xfs_dir2_sf.c | 151 +++++++++------------------------------------ 6 files changed, 199 insertions(+), 183 deletions(-)
fs/xfs/xfs_da_format.c +152 -0
@@ -69,17 +69,169 @@ xfs_dir3_sf_nextentry( } +/* +* For filetype enabled shortform directories, the file type field is stored at +* the end of the name. Because it's only a single byte, endian conversion is +* not necessary. For non-filetype enable directories, the type is always +* unknown and we never store the value. +*/ +static __uint8_t +xfs_dir2_sfe_get_ftype ( +struct xfs_dir2_sf_entry *sfep) +{ +return XFS_DIR3_FT_UNKNOWN ; +} + +static void +xfs_dir2_sfe_put_ftype ( +struct xfs_dir2_sf_entry *sfep, +__uint8_t ftype) +{ +ASSERT (ftype <XFS_DIR3_FT_MAX ); +} + +static __uint8_t +xfs_dir3_sfe_get_ftype ( +struct xfs_dir2_sf_entry *sfep) +{ +__uint8_t ftype; + + ftype = sfep->name[sfep->namelen]; +if (ftype >=XFS_DIR3_FT_MAX ) +return XFS_DIR3_FT_UNKNOWN ; +return ftype; +} + +static void +xfs_dir3_sfe_put_ftype ( +struct xfs_dir2_sf_entry *sfep, +__uint8_t ftype) +{ +ASSERT (ftype <XFS_DIR3_FT_MAX ); + + sfep->name[sfep->namelen] = ftype; +} + +/* +* Inode numbers in short-form directories can come in two versions, +* either 4 bytes or 8 bytes wide. These helpers deal with the +* two forms transparently by looking at the headers i8count field. +* +* For 64-bit inode number the most significant byte must be zero. +*/ +static xfs_ino_t +xfs_dir2_sf_get_ino ( +struct xfs_dir2_sf_hdr *hdr, +xfs_dir2_inou_t *from) +{ +if (hdr->i8count) +return get_unaligned_be64 (&from->i8.i) &0x00ffffffffffffffULL ; +else +return get_unaligned_be32 (&from->i4.i); +} + +static void +xfs_dir2_sf_put_ino ( +struct xfs_dir2_sf_hdr *hdr, +xfs_dir2_inou_t *to, +xfs_ino_t ino) +{ +ASSERT ((ino &0xff00000000000000ULL ) ==0 ); + +if (hdr->i8count) +put_unaligned_be64 (ino, &to->i8.i); +else +put_unaligned_be32 (ino, &to->i4.i); +} + +static xfs_ino_t +xfs_dir2_sf_get_parent_ino ( +struct xfs_dir2_sf_hdr *hdr) +{ +return xfs_dir2_sf_get_ino (hdr, &hdr->parent); +} + +static void +xfs_dir2_sf_put_parent_ino ( +struct xfs_dir2_sf_hdr *hdr, +xfs_ino_t ino) +{ +xfs_dir2_sf_put_ino (hdr, &hdr->parent, ino); +} + +/* +* In short-form directory entries the inode numbers are stored at variable +* offset behind the entry name. If the entry stores a filetype value, then it +* sits between the name and the inode number. Hence the inode numbers may only +* be accessed through the helpers below. +*/ +static xfs_ino_t +xfs_dir2_sfe_get_ino ( +struct xfs_dir2_sf_hdr *hdr, +struct xfs_dir2_sf_entry *sfep) +{ +return xfs_dir2_sf_get_ino (hdr, + (xfs_dir2_inou_t *)&sfep->name[sfep->namelen]); +} + +static void +xfs_dir2_sfe_put_ino ( +struct xfs_dir2_sf_hdr *hdr, +struct xfs_dir2_sf_entry *sfep, +xfs_ino_t ino) +{ +xfs_dir2_sf_put_ino (hdr, + (xfs_dir2_inou_t *)&sfep->name[sfep->namelen], ino); +} + +static xfs_ino_t +xfs_dir3_sfe_get_ino ( +struct xfs_dir2_sf_hdr *hdr, +struct xfs_dir2_sf_entry *sfep) +{ +return xfs_dir2_sf_get_ino (hdr, + (xfs_dir2_inou_t *)&sfep->name[sfep->namelen +1 ]); +} + +static void +xfs_dir3_sfe_put_ino ( +struct xfs_dir2_sf_hdr *hdr, +struct xfs_dir2_sf_entry *sfep, +xfs_ino_t ino) +{ +xfs_dir2_sf_put_ino (hdr, + (xfs_dir2_inou_t *)&sfep->name[sfep->namelen +1 ], ino); +} +const struct xfs_dir_ops xfs_dir2_ops = { .sf_entsize = xfs_dir2_sf_entsize, .sf_nextentry = xfs_dir2_sf_nextentry, + .sf_get_ftype = xfs_dir2_sfe_get_ftype, + .sf_put_ftype = xfs_dir2_sfe_put_ftype, + .sf_get_ino = xfs_dir2_sfe_get_ino, + .sf_put_ino = xfs_dir2_sfe_put_ino, + .sf_get_parent_ino = xfs_dir2_sf_get_parent_ino, + .sf_put_parent_ino = xfs_dir2_sf_put_parent_ino, };const struct xfs_dir_ops xfs_dir2_ftype_ops = { .sf_entsize = xfs_dir3_sf_entsize, .sf_nextentry = xfs_dir3_sf_nextentry, + .sf_get_ftype = xfs_dir3_sfe_get_ftype, + .sf_put_ftype = xfs_dir3_sfe_put_ftype, + .sf_get_ino = xfs_dir3_sfe_get_ino, + .sf_put_ino = xfs_dir3_sfe_put_ino, + .sf_get_parent_ino = xfs_dir2_sf_get_parent_ino, + .sf_put_parent_ino = xfs_dir2_sf_put_parent_ino, };const struct xfs_dir_ops xfs_dir3_ops = { .sf_entsize = xfs_dir3_sf_entsize, .sf_nextentry = xfs_dir3_sf_nextentry, + .sf_get_ftype = xfs_dir3_sfe_get_ftype, + .sf_put_ftype = xfs_dir3_sfe_put_ftype, + .sf_get_ino = xfs_dir3_sfe_get_ino, + .sf_put_ino = xfs_dir3_sfe_put_ino, + .sf_get_parent_ino = xfs_dir2_sf_get_parent_ino, + .sf_put_parent_ino = xfs_dir2_sf_put_parent_ino, };
fs/xfs/xfs_da_format.h +0 -47
53 lines not on this page · raw message
fs/xfs/xfs_dir2.h +11 -9
@@ -39,6 +39,17 @@ struct xfs_dir_ops {struct xfs_dir2_sf_entry * (*sf_nextentry)(struct xfs_dir2_sf_hdr *hdr,struct xfs_dir2_sf_entry *sfep); +__uint8_t (*sf_get_ftype)(struct xfs_dir2_sf_entry *sfep); +void (*sf_put_ftype)(struct xfs_dir2_sf_entry *sfep, +__uint8_t ftype); +xfs_ino_t (*sf_get_ino)(struct xfs_dir2_sf_hdr *hdr, +struct xfs_dir2_sf_entry *sfep); +void (*sf_put_ino)(struct xfs_dir2_sf_hdr *hdr, +struct xfs_dir2_sf_entry *sfep, +xfs_ino_t ino); +xfs_ino_t (*sf_get_parent_ino)(struct xfs_dir2_sf_hdr *hdr); +void (*sf_put_parent_ino)(struct xfs_dir2_sf_hdr *hdr, +xfs_ino_t ino); };extern const struct xfs_dir_ops xfs_dir2_ops;
@@ -79,15 +90,6 @@ extern int xfs_dir2_sf_to_block(struct xfs_da_args *args);/* * Interface routines used by userspace utilities */ -extern xfs_ino_t xfs_dir2_sf_get_parent_ino (struct xfs_dir2_sf_hdr *sfp); -extern void xfs_dir2_sf_put_parent_ino (struct xfs_dir2_sf_hdr *sfp, -xfs_ino_t ino); -extern xfs_ino_t xfs_dir3_sfe_get_ino (struct xfs_mount *mp, -struct xfs_dir2_sf_hdr *sfp,struct xfs_dir2_sf_entry *sfep); -extern void xfs_dir3_sfe_put_ino (struct xfs_mount *mp, -struct xfs_dir2_sf_hdr *hdr,struct xfs_dir2_sf_entry *sfep, -xfs_ino_t ino); -extern int xfs_dir2_isblock (struct xfs_trans *tp,struct xfs_inode *dp,int *r);extern int xfs_dir2_isleaf (struct xfs_trans *tp,struct xfs_inode *dp,int *r); extern int xfs_dir2_shrink_inode(struct xfs_da_args *args, xfs_dir2_db_t db,
fs/xfs/xfs_dir2_block.c +3 -3
@@ -1173,7 +1173,7 @@ xfs_dir2_sf_to_block(* Create entry for .. */ dep =xfs_dir3_data_dotdot_entry_p (mp, hdr); - dep->inumber =cpu_to_be64 (xfs_dir2_sf_get_parent_ino (sfp)); + dep->inumber =cpu_to_be64 (dp->d_ops->sf_get_parent_ino (sfp)); dep->namelen =2 ; dep->name[0 ] = dep->name[1 ] ='.' ;xfs_dir3_dirent_put_ftype (mp, dep,XFS_DIR3_FT_DIR );
@@ -1222,10 +1222,10 @@ xfs_dir2_sf_to_block(* Copy a real entry. */ dep = (xfs_dir2_data_entry_t *)((char *)hdr + newoffset); - dep->inumber =cpu_to_be64 (xfs_dir3_sfe_get_ino (mp, sfp, sfep)); + dep->inumber =cpu_to_be64 (dp->d_ops->sf_get_ino (sfp, sfep)); dep->namelen = sfep->namelen;xfs_dir3_dirent_put_ftype (mp, dep, -xfs_dir3_sfe_get_ftype (mp, sfp, sfep)); + dp->d_ops->sf_get_ftype (sfep));memcpy (dep->name, sfep->name, dep->namelen); tagp =xfs_dir3_data_entry_tag_p (mp, dep); *tagp =cpu_to_be16 ((char *)dep - (char *)hdr);
fs/xfs/xfs_dir2_readdir.c +3 -3
@@ -136,7 +136,7 @@ xfs_dir2_sf_getdents(* Put .. entry unless we're starting past it. */ if (ctx->pos <= dotdot_offset) { - ino =xfs_dir2_sf_get_parent_ino (sfp); + ino = dp->d_ops->sf_get_parent_ino (sfp); ctx->pos = dotdot_offset &0x7fffffff ;if (!dir_emit (ctx,".." ,2 , ino,DT_DIR ))return 0 ;
@@ -157,8 +157,8 @@ xfs_dir2_sf_getdents(continue ; } - ino =xfs_dir3_sfe_get_ino (mp, sfp, sfep); - filetype =xfs_dir3_sfe_get_ftype (mp, sfp, sfep); + ino = dp->d_ops->sf_get_ino (sfp, sfep); + filetype = dp->d_ops->sf_get_ftype (sfep); ctx->pos = off &0x7fffffff ;if (!dir_emit (ctx, (char *)sfep->name, sfep->namelen, ino,xfs_dir3_get_dtype (mp, filetype)))
fs/xfs/xfs_dir2_sf.c +30 -121
267 lines not on this page · raw message
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 18/19 xfs: vectorise directory leaf operations
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Next step in the vectorisation process is the directory free block encode/decode operations. There are relatively few of these, though there are quite a numberof calls to them.
Binary sizes:
text data bss dec hex filename
794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2 789293 96802 1096 887191 d8997 fs/xfs/xfs.o.p3 789005 96802 1096 886903 d8997 fs/xfs/xfs.o.p4 789061 96802 1096 886959 d88af fs/xfs/xfs.o.p5 789733 96802 1096 887631 d8b4f fs/xfs/xfs.o.p6 791421 96802 1096 889319 d91e7 fs/xfs/xfs.o.p7 791701 96802 1096 889599 d92ff fs/xfs/xfs.o.p8
--- fs/xfs/xfs_da_format.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++ fs/xfs/xfs_da_format.h | 39 --------------------- fs/xfs/xfs_dir2.h | 5 +++ fs/xfs/xfs_dir2_leaf.c | 2 +- fs/xfs/xfs_dir2_node.c | 61 +++++++++++++++++---------------- 5 files changed, 129 insertions(+), 70 deletions(-)
fs/xfs/xfs_da_format.c +92 -0
@@ -629,6 +629,80 @@ xfs_da3_node_hdr_to_disk(/* * Directory free space block operations */ +static int +xfs_dir2_free_hdr_size (void ) +{ +return sizeof (struct xfs_dir2_free_hdr ); +} + +static int +xfs_dir2_free_max_bests (struct xfs_mount *mp) +{ +return (mp->m_dirblksize -xfs_dir2_free_hdr_size ()) / +sizeof (xfs_dir2_data_off_t); +} + +static __be16 * +xfs_dir2_free_bests_p (struct xfs_dir2_free *free) +{ +return (__be16 *)((char *)free +xfs_dir2_free_hdr_size ()); +} + +/* +* Convert data space db to the corresponding free db. +*/ +static xfs_dir2_db_t +xfs_dir2_db_to_fdb (struct xfs_mount *mp,xfs_dir2_db_t db) +{ +return XFS_DIR2_FREE_FIRSTDB (mp) + db /xfs_dir2_free_max_bests (mp); +} + +/* +* Convert data space db to the corresponding index in a free db. +*/ +static int +xfs_dir2_db_to_fdindex (struct xfs_mount *mp,xfs_dir2_db_t db) +{ +return db %xfs_dir2_free_max_bests (mp); +} + +static int +xfs_dir3_free_hdr_size (void ) +{ +return sizeof (struct xfs_dir3_free_hdr ); +} + +static int +xfs_dir3_free_max_bests (struct xfs_mount *mp) +{ +return (mp->m_dirblksize -xfs_dir3_free_hdr_size ()) / +sizeof (xfs_dir2_data_off_t); +} + +static __be16 * +xfs_dir3_free_bests_p (struct xfs_dir2_free *free) +{ +return (__be16 *)((char *)free +xfs_dir3_free_hdr_size ()); +} + +/* +* Convert data space db to the corresponding free db. +*/ +static xfs_dir2_db_t +xfs_dir3_db_to_fdb (struct xfs_mount *mp,xfs_dir2_db_t db) +{ +return XFS_DIR2_FREE_FIRSTDB (mp) + db /xfs_dir3_free_max_bests (mp); +} + +/* +* Convert data space db to the corresponding index in a free db. +*/ +static int +xfs_dir3_db_to_fdindex (struct xfs_mount *mp,xfs_dir2_db_t db) +{ +return db %xfs_dir3_free_max_bests (mp); +} + static void xfs_dir2_free_hdr_from_disk( struct xfs_dir3_icfree_hdr *to,
@@ -721,6 +795,14 @@ const struct xfs_dir_ops xfs_dir2_ops = { .node_hdr_to_disk = xfs_da2_node_hdr_to_disk, .node_hdr_from_disk = xfs_da2_node_hdr_from_disk, .node_tree_p = xfs_da2_node_tree_p, + + .free_hdr_size = xfs_dir2_free_hdr_size, + .free_hdr_to_disk = xfs_dir2_free_hdr_to_disk, + .free_hdr_from_disk = xfs_dir2_free_hdr_from_disk, + .free_max_bests = xfs_dir2_free_max_bests, + .free_bests_p = xfs_dir2_free_bests_p, + .db_to_fdb = xfs_dir2_db_to_fdb, + .db_to_fdindex = xfs_dir2_db_to_fdindex, };const struct xfs_dir_ops xfs_dir2_ftype_ops = {
@@ -761,8 +843,13 @@ const struct xfs_dir_ops xfs_dir2_ftype_ops = { .node_hdr_from_disk = xfs_da2_node_hdr_from_disk, .node_tree_p = xfs_da2_node_tree_p, + .free_hdr_size = xfs_dir2_free_hdr_size, .free_hdr_to_disk = xfs_dir2_free_hdr_to_disk, .free_hdr_from_disk = xfs_dir2_free_hdr_from_disk, + .free_max_bests = xfs_dir2_free_max_bests, + .free_bests_p = xfs_dir2_free_bests_p, + .db_to_fdb = xfs_dir2_db_to_fdb, + .db_to_fdindex = xfs_dir2_db_to_fdindex, };const struct xfs_dir_ops xfs_dir3_ops = {
@@ -803,8 +890,13 @@ const struct xfs_dir_ops xfs_dir3_ops = { .node_hdr_from_disk = xfs_da3_node_hdr_from_disk, .node_tree_p = xfs_da3_node_tree_p, + .free_hdr_size = xfs_dir3_free_hdr_size, .free_hdr_to_disk = xfs_dir3_free_hdr_to_disk, .free_hdr_from_disk = xfs_dir3_free_hdr_from_disk, + .free_max_bests = xfs_dir2_free_max_bests, + .free_bests_p = xfs_dir3_free_bests_p, + .db_to_fdb = xfs_dir3_db_to_fdb, + .db_to_fdindex = xfs_dir3_db_to_fdindex, };const struct xfs_dir_ops xfs_dir2_nondir_ops = {
fs/xfs/xfs_da_format.h +0 -39
@@ -704,45 +704,6 @@ struct xfs_dir3_icfree_hdr { }; -static inline int -xfs_dir3_free_hdr_size (struct xfs_mount *mp) -{ -if (xfs_sb_version_hascrc (&mp->m_sb)) -return sizeof (struct xfs_dir3_free_hdr ); -return sizeof (struct xfs_dir2_free_hdr ); -} - -static inline int -xfs_dir3_free_max_bests (struct xfs_mount *mp) -{ -return (mp->m_dirblksize -xfs_dir3_free_hdr_size (mp)) / -sizeof (xfs_dir2_data_off_t); -} - -static inline __be16 * -xfs_dir3_free_bests_p (struct xfs_mount *mp,struct xfs_dir2_free *free) -{ -return (__be16 *)((char *)free +xfs_dir3_free_hdr_size (mp)); -} - -/* -* Convert data space db to the corresponding free db. -*/ -static inline xfs_dir2_db_t -xfs_dir2_db_to_fdb (struct xfs_mount *mp,xfs_dir2_db_t db) -{ -return XFS_DIR2_FREE_FIRSTDB (mp) + db /xfs_dir3_free_max_bests (mp); -} - -/* -* Convert data space db to the corresponding index in a free db. -*/ -static inline int -xfs_dir2_db_to_fdindex (struct xfs_mount *mp,xfs_dir2_db_t db) -{ -return db %xfs_dir3_free_max_bests (mp); -} -/* * Single block format. *
fs/xfs/xfs_dir2.h +5 -0
@@ -92,10 +92,15 @@ struct xfs_dir_ops {struct xfs_da_node_entry * (*node_tree_p)(struct xfs_da_intnode *dap); +int (*free_hdr_size)(void );void (*free_hdr_to_disk)(struct xfs_dir2_free *to,struct xfs_dir3_icfree_hdr *from);void (*free_hdr_from_disk)(struct xfs_dir3_icfree_hdr *to,struct xfs_dir2_free *from); +int (*free_max_bests)(struct xfs_mount *mp); +__be16 * (*free_bests_p)(struct xfs_dir2_free *free); +xfs_dir2_db_t (*db_to_fdb)(struct xfs_mount *mp,xfs_dir2_db_t db); +int (*db_to_fdindex)(struct xfs_mount *mp,xfs_dir2_db_t db); }; extern const struct xfs_dir_ops *
fs/xfs/xfs_dir2_leaf.c +1 -1
@@ -1785,7 +1785,7 @@ xfs_dir2_node_to_leaf(/* * Set up the leaf bests table. */ -memcpy (xfs_dir2_leaf_bests_p (ltp),xfs_dir3_free_bests_p (mp, free), +memcpy (xfs_dir2_leaf_bests_p (ltp), dp->d_ops->free_bests_p (free), freehdr.nvalid *sizeof (xfs_dir2_data_off_t)); dp->d_ops->leaf_hdr_to_disk (leaf, &leafhdr);
fs/xfs/xfs_dir2_node.c +31 -30
231 lines not on this page · raw message
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 16/19 xfs: vectorise DA btree operations
In reply to Dave ChinnerThe remaining non-vectorised code for the directory structure is the node format blocks. This is shared with the attribute tree, and so is slightly more complex to vectorise.
Introduce a "non-directory" directory ops structure that is attached to all non-directory inodes so that attribute operations can be vectorised for all inodes.
Once we do this, we can vectorise all the da btree operations. Because this patch adds more infrastructure than it removes the binary size does not decrease:
text data bss dec hex filename
794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2 789293 96802 1096 887191 d8997 fs/xfs/xfs.o.p3 789005 96802 1096 886903 d8997 fs/xfs/xfs.o.p4 789061 96802 1096 886959 d88af fs/xfs/xfs.o.p5 789733 96802 1096 887631 d8b4f fs/xfs/xfs.o.p6
--- fs/xfs/xfs_attr_inactive.c | 3 +- fs/xfs/xfs_attr_leaf.c | 3 +- fs/xfs/xfs_attr_list.c | 11 ++--- fs/xfs/xfs_da_btree.c | 104 +++++++++++++++++++++++++-------------------- fs/xfs/xfs_da_format.c | 59 +++++++++++++++++++++++++ fs/xfs/xfs_da_format.h | 25 ----------- fs/xfs/xfs_dir2.c | 7 ++- fs/xfs/xfs_dir2.h | 6 +++ fs/xfs/xfs_iops.c | 1 + fs/xfs/xfs_mount.h | 1 + 10 files changed, 139 insertions(+), 81 deletions(-)
fs/xfs/xfs_attr_inactive.c +2 -1
@@ -40,6 +40,7 @@#include "xfs_quota.h" #include "xfs_trace.h" #include "xfs_dinode.h" +#include "xfs_dir2.h" /* * Look at all the extents for this logical region,
@@ -236,7 +237,7 @@ xfs_attr3_node_inactive(xfs_trans_brelse (*trans, bp);return 0 ; } - btree =xfs_da3_node_tree_p (node); + btree = dp->d_ops->node_tree_p (node); child_fsb =be32_to_cpu (btree[0 ].before);xfs_trans_brelse (*trans, bp);/* no locks for later trans */
fs/xfs/xfs_attr_leaf.c +2 -1
@@ -41,6 +41,7 @@#include "xfs_buf_item.h" #include "xfs_cksum.h" #include "xfs_dinode.h" +#include "xfs_dir2.h" /*
@@ -916,7 +917,7 @@ xfs_attr3_leaf_to_node( goto out; node = bp1->b_addr;xfs_da3_node_hdr_from_disk (&icnodehdr, node); - btree =xfs_da3_node_tree_p (node); + btree = dp->d_ops->node_tree_p (node); leaf = bp2->b_addr;xfs_attr3_leaf_hdr_from_disk (&icleafhdr, leaf);
fs/xfs/xfs_attr_list.c +6 -5
@@ -40,6 +40,7 @@#include "xfs_buf_item.h" #include "xfs_cksum.h" #include "xfs_dinode.h" +#include "xfs_dir2.h" STATIC intxfs_attr_shortform_compare (const void *a,const void *b)
@@ -226,6 +227,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)struct xfs_da_node_entry *btree;int error, i;struct xfs_buf *bp; +struct xfs_inode *dp = context->dp;trace_xfs_attr_node_list (context);
@@ -239,7 +241,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)*/ bp =NULL ;if (cursor->blkno >0 ) { - error =xfs_da3_node_read (NULL , context->dp, cursor->blkno,-1 , + error =xfs_da3_node_read (NULL , dp, cursor->blkno,-1 , &bp,XFS_ATTR_FORK );if ((error !=0 ) && (error !=EFSCORRUPTED ))return (error);
@@ -289,7 +291,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)for (;;) {__uint16_t magic; - error =xfs_da3_node_read (NULL , context->dp, + error =xfs_da3_node_read (NULL , dp, cursor->blkno,-1 , &bp,XFS_ATTR_FORK );if (error)
@@ -310,7 +312,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context) }xfs_da3_node_hdr_from_disk (&nodehdr, node); - btree =xfs_da3_node_tree_p (node); + btree = dp->d_ops->node_tree_p (node);for (i =0 ; i < nodehdr.count; btree++, i++) {if (cursor->hashval <=be32_to_cpu (btree->hashval)) {
@@ -346,8 +348,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)break ; cursor->blkno = leafhdr.forw;xfs_trans_brelse (NULL , bp); - error =xfs_attr3_leaf_read (NULL , context->dp, cursor->blkno,-1 , - &bp); + error =xfs_attr3_leaf_read (NULL , dp, cursor->blkno,-1 , &bp);if (error)return error; }
fs/xfs/xfs_da_btree.c +57 -47
392 lines not on this page · raw message
fs/xfs/xfs_da_format.c +59 -0
86 lines not on this page · raw message
fs/xfs/xfs_da_format.h +0 -25
@@ -127,31 +127,6 @@ extern void xfs_da3_node_hdr_from_disk(struct xfs_da3_icnode_hdr *to,extern void xfs_da3_node_hdr_to_disk (struct xfs_da_intnode *to,struct xfs_da3_icnode_hdr *from); -static inline int -__xfs_da3_node_hdr_size (bool v3) -{ -if (v3) -return sizeof (struct xfs_da3_node_hdr ); -return sizeof (struct xfs_da_node_hdr ); -} -static inline int -xfs_da3_node_hdr_size (struct xfs_da_intnode *dap) -{ -bool v3 = dap->hdr.info.magic ==cpu_to_be16 (XFS_DA3_NODE_MAGIC ); - -return __xfs_da3_node_hdr_size (v3); -} - -static inline struct xfs_da_node_entry * -xfs_da3_node_tree_p (struct xfs_da_intnode *dap) -{ -if (dap->hdr.info.magic ==cpu_to_be16 (XFS_DA3_NODE_MAGIC )) { -struct xfs_da3_intnode *dap3 = (struct xfs_da3_intnode *)dap; -return dap3->__btree; - } -return dap->__btree; -} -extern void xfs_da3_intnode_from_disk (struct xfs_da3_icnode_hdr *to,struct xfs_da_intnode *from); extern void xfs_da3_intnode_to_disk(struct xfs_da_intnode *to,
fs/xfs/xfs_dir2.c +5 -2
@@ -95,13 +95,17 @@ xfs_dir_mount(ASSERT (xfs_sb_version_hasdirv2 (&mp->m_sb));ASSERT ((1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog)) <=XFS_MAX_BLOCKSIZE ); + + mp->m_dir_inode_ops =xfs_dir_get_ops (mp,NULL ); + mp->m_nondir_inode_ops =xfs_nondir_get_ops (mp,NULL ); + mp->m_dirblksize =1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog); mp->m_dirblkfsbs =1 << mp->m_sb.sb_dirblklog; mp->m_dirdatablk =xfs_dir2_db_to_da (mp,XFS_DIR2_DATA_FIRSTDB (mp)); mp->m_dirleafblk =xfs_dir2_db_to_da (mp,XFS_DIR2_LEAF_FIRSTDB (mp)); mp->m_dirfreeblk =xfs_dir2_db_to_da (mp,XFS_DIR2_FREE_FIRSTDB (mp)); - nodehdr_size =__xfs_da3_node_hdr_size (xfs_sb_version_hascrc (&mp->m_sb)); + nodehdr_size = mp->m_dir_inode_ops->node_hdr_size (); mp->m_attr_node_ents = (mp->m_sb.sb_blocksize - nodehdr_size) / (uint )sizeof (xfs_da_node_entry_t); mp->m_dir_node_ents = (mp->m_dirblksize - nodehdr_size) /
@@ -113,7 +117,6 @@ xfs_dir_mount(else mp->m_dirnameops = &xfs_default_nameops; - mp->m_dir_inode_ops =xfs_dir_get_ops (mp,NULL ); }/*
fs/xfs/xfs_dir2.h +6 -0
@@ -79,10 +79,16 @@ struct xfs_dir_ops {int (*leaf_max_ents)(struct xfs_mount *mp);struct xfs_dir2_leaf_entry * (*leaf_ents_p)(struct xfs_dir2_leaf *lp); + +int (*node_hdr_size)(void ); +struct xfs_da_node_entry * + (*node_tree_p)(struct xfs_da_intnode *dap); };extern const struct xfs_dir_ops *xfs_dir_get_ops (struct xfs_mount *mp,struct xfs_inode *dp); +extern const struct xfs_dir_ops * +xfs_nondir_get_ops (struct xfs_mount *mp,struct xfs_inode *dp);/* * Generic directory interface routines
fs/xfs/xfs_iops.c +1 -0
@@ -1200,6 +1200,7 @@ xfs_setup_inode( inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec;xfs_diflags_to_iflags (inode, ip); + ip->d_ops = ip->i_mount->m_nondir_inode_ops;switch (inode->i_mode &S_IFMT ) {case S_IFREG : inode->i_op = &xfs_inode_operations;
fs/xfs/xfs_mount.h +1 -0
@@ -150,6 +150,7 @@ typedef struct xfs_mount {__uint8_t m_sectbb_log;/* sectlog - BBSHIFT */ const struct xfs_nameops *m_dirnameops;/* vector of dir name ops */ const struct xfs_dir_ops *m_dir_inode_ops;/* vector of dir inode ops */ +const struct xfs_dir_ops *m_nondir_inode_ops;/* !dir inode ops */ int m_dirblksize;/* directory block sz--bytes */ int m_dirblkfsbs;/* directory block sz--fsbs */ xfs_dablk_t m_dirdatablk;/* blockno of dir data v2 */
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 14/19 xfs: vectorise directory data operations part 2
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Convert the rest of the directory data block encode/decode operations to vector format.
This further reduces the size of the built binary:
text data bss dec hex filename
794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2 789293 96802 1096 887191 d8997 fs/xfs/xfs.o.p3 789005 96802 1096 886903 d8997 fs/xfs/xfs.o.p4
--- fs/xfs/xfs_da_format.c | 68 +++++++++++++++++++++++++++++ fs/xfs/xfs_da_format.h | 41 ------------------ fs/xfs/xfs_dir2.h | 22 +++++++--- fs/xfs/xfs_dir2_block.c | 33 ++++++++------- fs/xfs/xfs_dir2_data.c | 106 +++++++++++++++++++++++++--------------------- fs/xfs/xfs_dir2_leaf.c | 26 ++++++------ fs/xfs/xfs_dir2_node.c | 16 +++---- fs/xfs/xfs_dir2_priv.h | 3 +- fs/xfs/xfs_dir2_readdir.c | 6 +-- fs/xfs/xfs_dir2_sf.c | 2 +- 10 files changed, 186 insertions(+), 137 deletions(-)
fs/xfs/xfs_da_format.c +68 -0
@@ -383,6 +383,58 @@ xfs_dir3_data_first_entry_p( ((char *)hdr +xfs_dir3_data_first_offset ()); } +static struct xfs_dir2_data_free * +xfs_dir2_data_bestfree_p (struct xfs_dir2_data_hdr *hdr) +{ +return hdr->bestfree; +} + +static struct xfs_dir2_data_free * +xfs_dir3_data_bestfree_p (struct xfs_dir2_data_hdr *hdr) +{ +return ((struct xfs_dir3_data_hdr *)hdr)->best_free; +} + +static size_t +xfs_dir2_data_entry_offset (void ) +{ +return sizeof (struct xfs_dir2_data_hdr ); +} + +static struct xfs_dir2_data_entry * +xfs_dir2_data_entry_p (struct xfs_dir2_data_hdr *hdr) +{ +return (struct xfs_dir2_data_entry *) + ((char *)hdr +xfs_dir2_data_entry_offset ()); +} + +static struct xfs_dir2_data_unused * +xfs_dir2_data_unused_p (struct xfs_dir2_data_hdr *hdr) +{ +return (struct xfs_dir2_data_unused *) + ((char *)hdr +xfs_dir2_data_entry_offset ()); +} + +static size_t +xfs_dir3_data_entry_offset (void ) +{ +return sizeof (struct xfs_dir3_data_hdr ); +} + +static struct xfs_dir2_data_entry * +xfs_dir3_data_entry_p (struct xfs_dir2_data_hdr *hdr) +{ +return (struct xfs_dir2_data_entry *) + ((char *)hdr +xfs_dir3_data_entry_offset ()); +} + +static struct xfs_dir2_data_unused * +xfs_dir3_data_unused_p (struct xfs_dir2_data_hdr *hdr) +{ +return (struct xfs_dir2_data_unused *) + ((char *)hdr +xfs_dir3_data_entry_offset ()); +} +const struct xfs_dir_ops xfs_dir2_ops = { .sf_entsize = xfs_dir2_sf_entsize, .sf_nextentry = xfs_dir2_sf_nextentry,
@@ -397,13 +449,19 @@ const struct xfs_dir_ops xfs_dir2_ops = { .data_get_ftype = xfs_dir2_data_get_ftype, .data_put_ftype = xfs_dir2_data_put_ftype, .data_entry_tag_p = xfs_dir2_data_entry_tag_p, + .data_bestfree_p = xfs_dir2_data_bestfree_p, .data_dot_offset = xfs_dir2_data_dot_offset, .data_dotdot_offset = xfs_dir2_data_dotdot_offset, .data_first_offset = xfs_dir2_data_first_offset, + .data_entry_offset = xfs_dir2_data_entry_offset, + .data_dot_entry_p = xfs_dir2_data_dot_entry_p, .data_dotdot_entry_p = xfs_dir2_data_dotdot_entry_p, .data_first_entry_p = xfs_dir2_data_first_entry_p, + .data_entry_p = xfs_dir2_data_entry_p, + .data_unused_p = xfs_dir2_data_unused_p, + };const struct xfs_dir_ops xfs_dir2_ftype_ops = {
@@ -420,13 +478,18 @@ const struct xfs_dir_ops xfs_dir2_ftype_ops = { .data_get_ftype = xfs_dir3_data_get_ftype, .data_put_ftype = xfs_dir3_data_put_ftype, .data_entry_tag_p = xfs_dir3_data_entry_tag_p, + .data_bestfree_p = xfs_dir2_data_bestfree_p, .data_dot_offset = xfs_dir2_data_dot_offset, .data_dotdot_offset = xfs_dir2_data_dotdot_offset, .data_first_offset = xfs_dir2_data_first_offset, + .data_entry_offset = xfs_dir2_data_entry_offset, + .data_dot_entry_p = xfs_dir2_data_dot_entry_p, .data_dotdot_entry_p = xfs_dir2_data_dotdot_entry_p, .data_first_entry_p = xfs_dir2_data_first_entry_p, + .data_entry_p = xfs_dir2_data_entry_p, + .data_unused_p = xfs_dir2_data_unused_p, };const struct xfs_dir_ops xfs_dir3_ops = {
@@ -443,11 +506,16 @@ const struct xfs_dir_ops xfs_dir3_ops = { .data_get_ftype = xfs_dir3_data_get_ftype, .data_put_ftype = xfs_dir3_data_put_ftype, .data_entry_tag_p = xfs_dir3_data_entry_tag_p, + .data_bestfree_p = xfs_dir3_data_bestfree_p, .data_dot_offset = xfs_dir3_data_dot_offset, .data_dotdot_offset = xfs_dir3_data_dotdot_offset, .data_first_offset = xfs_dir3_data_first_offset, + .data_entry_offset = xfs_dir3_data_entry_offset, + .data_dot_entry_p = xfs_dir3_data_dot_entry_p, .data_dotdot_entry_p = xfs_dir3_data_dotdot_entry_p, .data_first_entry_p = xfs_dir3_data_first_entry_p, + .data_entry_p = xfs_dir3_data_entry_p, + .data_unused_p = xfs_dir3_data_unused_p, };
fs/xfs/xfs_da_format.h +0 -41
53 lines not on this page · raw message
fs/xfs/xfs_dir2.h +16 -6
@@ -56,16 +56,24 @@ struct xfs_dir_ops {void (*data_put_ftype)(struct xfs_dir2_data_entry *dep,__uint8_t ftype);__be16 * (*data_entry_tag_p)(struct xfs_dir2_data_entry *dep); +struct xfs_dir2_data_free * + (*data_bestfree_p)(struct xfs_dir2_data_hdr *hdr);xfs_dir2_data_aoff_t (*data_dot_offset)(void);xfs_dir2_data_aoff_t (*data_dotdot_offset)(void);xfs_dir2_data_aoff_t (*data_first_offset)(void); +size_t (*data_entry_offset)(void ); +struct xfs_dir2_data_entry * (*data_dot_entry_p)(struct xfs_dir2_data_hdr *hdr);struct xfs_dir2_data_entry * (*data_dotdot_entry_p)(struct xfs_dir2_data_hdr *hdr);struct xfs_dir2_data_entry * (*data_first_entry_p)(struct xfs_dir2_data_hdr *hdr); +struct xfs_dir2_data_entry * + (*data_entry_p)(struct xfs_dir2_data_hdr *hdr); +struct xfs_dir2_data_unused * + (*data_unused_p)(struct xfs_dir2_data_hdr *hdr); };extern const struct xfs_dir_ops xfs_dir2_ops;
@@ -115,19 +123,21 @@ extern void xfs_dir2_data_freescan(struct xfs_inode *dp, struct xfs_dir2_data_hdr *hdr, int *loghead);extern void xfs_dir2_data_log_entry (struct xfs_trans *tp,struct xfs_inode *dp,struct xfs_buf *bp,struct xfs_dir2_data_entry *dep); -extern void xfs_dir2_data_log_header (struct xfs_trans *tp, +extern void xfs_dir2_data_log_header (struct xfs_trans *tp,struct xfs_inode *dp,struct xfs_buf *bp);extern void xfs_dir2_data_log_unused (struct xfs_trans *tp,struct xfs_buf *bp,struct xfs_dir2_data_unused *dup); -extern void xfs_dir2_data_make_free (struct xfs_trans *tp,struct xfs_buf *bp, +extern void xfs_dir2_data_make_free (struct xfs_trans *tp,struct xfs_inode *dp, +struct xfs_buf *bp,xfs_dir2_data_aoff_t offset, +xfs_dir2_data_aoff_t len,int *needlogp,int *needscanp); +extern void xfs_dir2_data_use_free (struct xfs_trans *tp,struct xfs_inode *dp, +struct xfs_buf *bp,struct xfs_dir2_data_unused *dup,xfs_dir2_data_aoff_t offset,xfs_dir2_data_aoff_t len,int *needlogp,int *needscanp); -extern void xfs_dir2_data_use_free (struct xfs_trans *tp,struct xfs_buf *bp, -struct xfs_dir2_data_unused *dup,xfs_dir2_data_aoff_t offset, -xfs_dir2_data_aoff_t len,int *needlogp,int *needscanp);extern struct xfs_dir2_data_free *xfs_dir2_data_freefind ( -struct xfs_dir2_data_hdr *hdr,struct xfs_dir2_data_unused *dup); +struct xfs_dir2_data_hdr *hdr,struct xfs_dir2_data_free *bf, +struct xfs_dir2_data_unused *dup);extern const struct xfs_buf_ops xfs_dir3_block_buf_ops;extern const struct xfs_buf_ops xfs_dir3_leafn_buf_ops;
fs/xfs/xfs_dir2_block.c +18 -15
@@ -168,6 +168,7 @@ xfs_dir3_block_init( static void xfs_dir2_block_need_space( + struct xfs_inode *dp, struct xfs_dir2_data_hdr *hdr, struct xfs_dir2_block_tail *btp, struct xfs_dir2_leaf_entry *blp,
@@ -183,7 +184,7 @@ xfs_dir2_block_need_space(struct xfs_dir2_data_unused *enddup =NULL ; *compact =0 ; - bf =xfs_dir3_data_bestfree_p (hdr); + bf = dp->d_ops->data_bestfree_p (hdr);/* * If there are stale entries we'll use one for the leaf.
@@ -313,7 +314,7 @@ xfs_dir2_block_compact( *lfloglow = toidx +1 - (be32_to_cpu (btp->stale) -1 ); *lfloghigh -=be32_to_cpu (btp->stale) -1 ;be32_add_cpu (&btp->count, -(be32_to_cpu (btp->stale) -1 )); -xfs_dir2_data_make_free (tp, bp, +xfs_dir2_data_make_free (tp, dp, bp, (xfs_dir2_data_aoff_t)((char *)blp - (char *)hdr), (xfs_dir2_data_aoff_t)((be32_to_cpu (btp->stale) -1 ) *sizeof (*blp)), needlog, &needscan);
@@ -383,7 +384,7 @@ xfs_dir2_block_addname(* Find out if we can reuse stale entries or whether we need extra * space for entry and new leaf. */ -xfs_dir2_block_need_space (hdr, btp, blp, &tagp, &dup, +xfs_dir2_block_need_space (dp, hdr, btp, blp, &tagp, &dup, &enddup, &compact, len);/*
@@ -454,7 +455,7 @@ xfs_dir2_block_addname(/* * Mark the space needed for the new leaf entry, now in use. */ - xfs_dir2_data_use_free(tp, bp, enddup, + xfs_dir2_data_use_free(tp, dp, bp, enddup, (xfs_dir2_data_aoff_t) ((char *)enddup - (char *)hdr + be16_to_cpu(enddup->length) - sizeof(*blp)),
@@ -541,7 +542,7 @@ xfs_dir2_block_addname(/* * Mark space for the data entry used. */ -xfs_dir2_data_use_free (tp, bp, dup, +xfs_dir2_data_use_free (tp, dp, bp, dup, (xfs_dir2_data_aoff_t)((char *)dup - (char *)hdr), (xfs_dir2_data_aoff_t )len, &needlog, &needscan);/*
@@ -559,7 +560,7 @@ xfs_dir2_block_addname(if (needscan)xfs_dir2_data_freescan (dp, hdr, &needlog);if (needlog) -xfs_dir2_data_log_header (tp, bp); +xfs_dir2_data_log_header (tp, dp, bp);xfs_dir2_block_log_tail (tp, bp);xfs_dir2_data_log_entry (tp, dp, bp, dep);xfs_dir3_data_check (dp, bp);
@@ -800,7 +801,7 @@ xfs_dir2_block_removename(* Mark the data entry's space free. */ needlog = needscan =0 ; -xfs_dir2_data_make_free (tp, bp, +xfs_dir2_data_make_free (tp, dp, bp, (xfs_dir2_data_aoff_t)((char *)dep - (char *)hdr), dp->d_ops->data_entsize (dep->namelen), &needlog, &needscan);/*
@@ -819,7 +820,7 @@ xfs_dir2_block_removename(if (needscan)xfs_dir2_data_freescan (dp, hdr, &needlog);if (needlog) -xfs_dir2_data_log_header (tp, bp); +xfs_dir2_data_log_header (tp, dp, bp);xfs_dir3_data_check (dp, bp);/* * See if the size as a shortform is good enough.
@@ -950,7 +951,7 @@ xfs_dir2_leaf_to_block(while (dp->i_d.di_size > mp->m_dirblksize) {int hdrsz; - hdrsz =xfs_dir3_data_hdr_size (xfs_sb_version_hascrc (&mp->m_sb)); + hdrsz = dp->d_ops->data_entry_offset (); bestsp =xfs_dir2_leaf_bests_p (ltp);if (be16_to_cpu (bestsp[be32_to_cpu (ltp->bestcount) -1 ]) == mp->m_dirblksize - hdrsz) {
@@ -1000,7 +1001,7 @@ xfs_dir2_leaf_to_block(/* * Use up the space at the end of the block (blp/btp). */ -xfs_dir2_data_use_free (tp, dbp, dup, mp->m_dirblksize - size, size, +xfs_dir2_data_use_free (tp, dp, dbp, dup, mp->m_dirblksize - size, size, &needlog, &needscan);/* * Initialize the block tail.
@@ -1026,7 +1027,7 @@ xfs_dir2_leaf_to_block(if (needscan)xfs_dir2_data_freescan (dp, hdr, &needlog);if (needlog) -xfs_dir2_data_log_header (tp, dbp); +xfs_dir2_data_log_header (tp, dp, dbp);/* * Pitch the old leaf block. */
@@ -1137,9 +1138,9 @@ xfs_dir2_sf_to_block(* The whole thing is initialized to free by the init routine. * Say we're using the leaf and tail area. */ - dup =xfs_dir3_data_unused_p (hdr); + dup = dp->d_ops->data_unused_p (hdr); needlog = needscan =0 ; -xfs_dir2_data_use_free (tp, bp, dup, mp->m_dirblksize - i, i, &needlog, +xfs_dir2_data_use_free (tp, dp, bp, dup, mp->m_dirblksize - i, i, &needlog, &needscan);ASSERT (needscan ==0 );/*
@@ -1153,7 +1154,7 @@ xfs_dir2_sf_to_block(/* * Remove the freespace, we'll manage it. */ -xfs_dir2_data_use_free (tp, bp, dup, +xfs_dir2_data_use_free (tp, dp, bp, dup, (xfs_dir2_data_aoff_t)((char *)dup - (char *)hdr),be16_to_cpu (dup->length), &needlog, &needscan);/*
@@ -1215,7 +1216,9 @@ xfs_dir2_sf_to_block( *xfs_dir2_data_unused_tag_p (dup) =cpu_to_be16 ( ((char *)dup - (char *)hdr));xfs_dir2_data_log_unused (tp, bp, dup); -xfs_dir2_data_freeinsert (hdr, dup, &dummy); +xfs_dir2_data_freeinsert (hdr, + dp->d_ops->data_bestfree_p (hdr), + dup, &dummy); offset +=be16_to_cpu (dup->length);continue ; }
fs/xfs/xfs_dir2_data.c +57 -49
318 lines not on this page · raw message
fs/xfs/xfs_dir2_leaf.c +13 -13
@@ -460,7 +460,7 @@ xfs_dir2_block_to_leaf(xfs_dir3_data_check (dp, dbp); btp =xfs_dir2_block_tail_p (mp, hdr); blp =xfs_dir2_block_leaf_p (btp); - bf =xfs_dir3_data_bestfree_p (hdr); + bf = dp->d_ops->data_bestfree_p (hdr); ents =xfs_dir3_leaf_ents_p (leaf);/*
@@ -484,7 +484,7 @@ xfs_dir2_block_to_leaf(* Make the space formerly occupied by the leaf entries and block * tail be free. */ - xfs_dir2_data_make_free(tp, dbp, + xfs_dir2_data_make_free(tp, dp, dbp, (xfs_dir2_data_aoff_t)((char *)blp - (char *)hdr), (xfs_dir2_data_aoff_t)((char *)hdr + mp->m_dirblksize - (char *)blp),
@@ -512,7 +512,7 @@ xfs_dir2_block_to_leaf(* Log the data header and leaf bests table. */ if (needlog) -xfs_dir2_data_log_header (tp, dbp); +xfs_dir2_data_log_header (tp, dp, dbp);xfs_dir3_leaf_check (mp, lbp);xfs_dir3_data_check (dp, dbp);xfs_dir3_leaf_log_bests (tp, lbp,0 ,0 );
@@ -862,7 +862,7 @@ xfs_dir2_leaf_addname(else xfs_dir3_leaf_log_bests (tp, lbp, use_block, use_block); hdr = dbp->b_addr; - bf =xfs_dir3_data_bestfree_p (hdr); + bf = dp->d_ops->data_bestfree_p (hdr); bestsp[use_block] = bf[0 ].length; grown =1 ; }else {
@@ -878,7 +878,7 @@ xfs_dir2_leaf_addname(return error; } hdr = dbp->b_addr; - bf =xfs_dir3_data_bestfree_p (hdr); + bf = dp->d_ops->data_bestfree_p (hdr); grown =0 ; }/*
@@ -891,7 +891,7 @@ xfs_dir2_leaf_addname(/* * Mark the initial part of our freespace in use for the new entry. */ -xfs_dir2_data_use_free (tp, dbp, dup, +xfs_dir2_data_use_free (tp, dp, dbp, dup, (xfs_dir2_data_aoff_t)((char *)dup - (char *)hdr), length, &needlog, &needscan);/*
@@ -913,7 +913,7 @@ xfs_dir2_leaf_addname(* Need to log the data block's header. */ if (needlog) -xfs_dir2_data_log_header (tp, dbp); +xfs_dir2_data_log_header (tp, dp, dbp);xfs_dir2_data_log_entry (tp, dp, dbp, dep);/* * If the bests table needs to be changed, do it.
@@ -1413,7 +1413,7 @@ xfs_dir2_leaf_removename( leaf = lbp->b_addr; hdr = dbp->b_addr;xfs_dir3_data_check (dp, dbp); - bf =xfs_dir3_data_bestfree_p (hdr); + bf = dp->d_ops->data_bestfree_p (hdr);xfs_dir3_leaf_hdr_from_disk (&leafhdr, leaf); ents =xfs_dir3_leaf_ents_p (leaf);/*
@@ -1431,7 +1431,7 @@ xfs_dir2_leaf_removename(/* * Mark the former data entry unused. */ -xfs_dir2_data_make_free (tp, dbp, +xfs_dir2_data_make_free (tp, dp, dbp, (xfs_dir2_data_aoff_t)((char *)dep - (char *)hdr), dp->d_ops->data_entsize (dep->namelen), &needlog, &needscan);/*
@@ -1451,7 +1451,7 @@ xfs_dir2_leaf_removename(if (needscan)xfs_dir2_data_freescan (dp, hdr, &needlog);if (needlog) -xfs_dir2_data_log_header (tp, dbp); +xfs_dir2_data_log_header (tp, dp, dbp);/* * If the longest freespace in the data block has changed, * put the new value in the bests table and log that.
@@ -1465,7 +1465,7 @@ xfs_dir2_leaf_removename(* If the data block is now empty then get rid of the data block. */ if (be16_to_cpu (bf[0 ].length) == - mp->m_dirblksize -xfs_dir3_data_entry_offset (hdr)) { + mp->m_dirblksize - dp->d_ops->data_entry_offset ()) {ASSERT (db != mp->m_dirdatablk);if ((error =xfs_dir2_shrink_inode (args, db, dbp))) {/*
@@ -1659,12 +1659,12 @@ xfs_dir2_leaf_trim_data(#ifdef DEBUG {struct xfs_dir2_data_hdr *hdr = dbp->b_addr; -struct xfs_dir2_data_free *bf =xfs_dir3_data_bestfree_p (hdr); +struct xfs_dir2_data_free *bf = dp->d_ops->data_bestfree_p (hdr);ASSERT (hdr->magic ==cpu_to_be32 (XFS_DIR2_DATA_MAGIC ) || hdr->magic ==cpu_to_be32 (XFS_DIR3_DATA_MAGIC ));ASSERT (be16_to_cpu (bf[0 ].length) == - mp->m_dirblksize -xfs_dir3_data_entry_offset (hdr)); + mp->m_dirblksize - dp->d_ops->data_entry_offset ());ASSERT (db ==be32_to_cpu (ltp->bestcount) -1 ); }#endif
fs/xfs/xfs_dir2_node.c +8 -8
@@ -1255,10 +1255,10 @@ xfs_dir2_leafn_remove( dbp = dblk->bp; hdr = dbp->b_addr; dep = (xfs_dir2_data_entry_t *)((char *)hdr + off); - bf =xfs_dir3_data_bestfree_p (hdr); + bf = dp->d_ops->data_bestfree_p (hdr); longest =be16_to_cpu (bf[0 ].length); needlog = needscan =0 ; -xfs_dir2_data_make_free (tp, dbp, off, +xfs_dir2_data_make_free (tp, dp, dbp, off, dp->d_ops->data_entsize (dep->namelen), &needlog, &needscan);/* * Rescan the data block freespaces for bestfree.
@@ -1267,7 +1267,7 @@ xfs_dir2_leafn_remove(if (needscan)xfs_dir2_data_freescan (dp, hdr, &needlog);if (needlog) -xfs_dir2_data_log_header (tp, dbp); +xfs_dir2_data_log_header (tp, dp, dbp);xfs_dir3_data_check (dp, dbp);/* * If the longest data block freespace changes, need to update
@@ -1308,7 +1308,7 @@ xfs_dir2_leafn_remove(* (usually). */ if (longest == mp->m_dirblksize - -xfs_dir3_data_entry_offset (hdr)) { + dp->d_ops->data_entry_offset ()) {/* * Try to punch out the data block. */
@@ -1962,7 +1962,7 @@ xfs_dir2_node_addname_int(* change again. */ hdr = dbp->b_addr; - bf =xfs_dir3_data_bestfree_p (hdr); + bf = dp->d_ops->data_bestfree_p (hdr); bests[findex] = bf[0 ].length; logfree =1 ; }
@@ -1984,7 +1984,7 @@ xfs_dir2_node_addname_int(if (error)return error; hdr = dbp->b_addr; - bf =xfs_dir3_data_bestfree_p (hdr); + bf = dp->d_ops->data_bestfree_p (hdr); logfree =0 ; }ASSERT (be16_to_cpu (bf[0 ].length) >= length);
@@ -1997,7 +1997,7 @@ xfs_dir2_node_addname_int(/* * Mark the first part of the unused space, inuse for us. */ -xfs_dir2_data_use_free (tp, dbp, dup, +xfs_dir2_data_use_free (tp, dp, dbp, dup, (xfs_dir2_data_aoff_t)((char *)dup - (char *)hdr), length, &needlog, &needscan);/*
@@ -2020,7 +2020,7 @@ xfs_dir2_node_addname_int(* Log the data block header if needed. */ if (needlog) -xfs_dir2_data_log_header (tp, dbp); +xfs_dir2_data_log_header (tp, dp, dbp);/* * If the freespace entry is now wrong, update it. */
fs/xfs/xfs_dir2_priv.h +2 -1
@@ -59,7 +59,8 @@ extern int xfs_dir3_data_readahead(struct xfs_trans *tp, struct xfs_inode *dp,extern struct xfs_dir2_data_free *xfs_dir2_data_freeinsert (struct xfs_dir2_data_hdr *hdr, -struct xfs_dir2_data_unused *dup,int *loghead); +struct xfs_dir2_data_free *bf,struct xfs_dir2_data_unused *dup, +int *loghead);extern int xfs_dir3_data_init (struct xfs_da_args *args,xfs_dir2_db_t blkno,struct xfs_buf **bpp);
fs/xfs/xfs_dir2_readdir.c +3 -3
@@ -213,7 +213,7 @@ xfs_dir2_block_getdents(* Set up values for the loop. */ btp =xfs_dir2_block_tail_p (mp, hdr); - ptr = (char *)xfs_dir3_data_entry_p (hdr); + ptr = (char *)dp->d_ops->data_entry_p (hdr); endptr = (char *)xfs_dir2_block_leaf_p (btp);/*
@@ -578,13 +578,13 @@ xfs_dir2_leaf_getdents(/* * Find our position in the block. */ - ptr = (char *)xfs_dir3_data_entry_p (hdr); + ptr = (char *)dp->d_ops->data_entry_p (hdr); byteoff =xfs_dir2_byte_to_off (mp, curoff);/* * Skip past the header. */ if (byteoff ==0 ) - curoff +=xfs_dir3_data_entry_offset (hdr); + curoff += dp->d_ops->data_entry_offset ();/* * Skip past entries until we reach our offset. */
fs/xfs/xfs_dir2_sf.c +1 -1
@@ -210,7 +210,7 @@ xfs_dir2_block_to_sf(* Set up to loop over the block's entries. */ btp =xfs_dir2_block_tail_p (mp, hdr); - ptr = (char *)xfs_dir3_data_entry_p (hdr); + ptr = (char *)dp->d_ops->data_entry_p (hdr); endptr = (char *)xfs_dir2_block_leaf_p (btp); sfep =xfs_dir2_sf_firstentry (sfp);/*
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 17/19 xfs: vectorise encoding/decoding directory headers
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Conversion from on-disk structures to in-core header structures currently relies on magic number checks. If the magic number is wrong, but one of the supported values, we do the wrong thing with the encode/decode operation. Split these functions so that there are discrete operations for the specific directory format we are handling.
In doing this, move all the header encode/decode functions to xfs_da_format.c as they are directly manipulating the on-disk format. It should be noted that all the growth in binary size is from xfs_da_format.c - the rest of the code actaully shrinks.
text data bss dec hex filename
794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2 789293 96802 1096 887191 d8997 fs/xfs/xfs.o.p3 789005 96802 1096 886903 d8997 fs/xfs/xfs.o.p4 789061 96802 1096 886959 d88af fs/xfs/xfs.o.p5 789733 96802 1096 887631 d8b4f fs/xfs/xfs.o.p6 791421 96802 1096 889319 d91e7 fs/xfs/xfs.o.p7
--- fs/xfs/xfs_attr_inactive.c | 2 +- fs/xfs/xfs_attr_leaf.c | 4 +- fs/xfs/xfs_attr_list.c | 2 +- fs/xfs/xfs_da_btree.c | 141 +++++++++++-------------------- fs/xfs/xfs_da_format.c | 206 ++++++++++++++++++++++++++++++++++++++++++++- fs/xfs/xfs_da_format.h | 16 ---- fs/xfs/xfs_dir2.h | 13 +++ fs/xfs/xfs_dir2_block.c | 2 +- fs/xfs/xfs_dir2_leaf.c | 100 ++++++---------------- fs/xfs/xfs_dir2_node.c | 126 +++++++++------------------ fs/xfs/xfs_dir2_priv.h | 4 - 11 files changed, 335 insertions(+), 281 deletions(-)
fs/xfs/xfs_attr_inactive.c +1 -1
@@ -231,7 +231,7 @@ xfs_attr3_node_inactive( } node = bp->b_addr; -xfs_da3_node_hdr_from_disk (&ichdr, node); + dp->d_ops->node_hdr_from_disk (&ichdr, node); parent_blkno = bp->b_bn;if (!ichdr.count) {xfs_trans_brelse (*trans, bp);
fs/xfs/xfs_attr_leaf.c +2 -2
@@ -916,7 +916,7 @@ xfs_attr3_leaf_to_node(if (error) goto out; node = bp1->b_addr; -xfs_da3_node_hdr_from_disk (&icnodehdr, node); + dp->d_ops->node_hdr_from_disk (&icnodehdr, node); btree = dp->d_ops->node_tree_p (node); leaf = bp2->b_addr;
@@ -927,7 +927,7 @@ xfs_attr3_leaf_to_node( btree[0 ].hashval = entries[icleafhdr.count -1 ].hashval; btree[0 ].before =cpu_to_be32 (blkno); icnodehdr.count =1 ; -xfs_da3_node_hdr_to_disk (node, &icnodehdr); + dp->d_ops->node_hdr_to_disk (node, &icnodehdr);xfs_trans_log_buf (args->trans, bp1,0 ,XFS_LBSIZE (mp) -1 ); error =0 ; out:
fs/xfs/xfs_attr_list.c +1 -1
@@ -311,7 +311,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)return XFS_ERROR (EFSCORRUPTED ); } -xfs_da3_node_hdr_from_disk (&nodehdr, node); + dp->d_ops->node_hdr_from_disk (&nodehdr, node); btree = dp->d_ops->node_tree_p (node);for (i =0 ; i < nodehdr.count; btree++, i++) { if (cursor->hashval
fs/xfs/xfs_da_btree.c +49 -92
379 lines not on this page · raw message
fs/xfs/xfs_da_format.c +204 -2
270 lines not on this page · raw message
fs/xfs/xfs_da_format.h +0 -16
@@ -122,16 +122,6 @@ struct xfs_da3_icnode_hdr {__uint16_t level; }; -extern void xfs_da3_node_hdr_from_disk (struct xfs_da3_icnode_hdr *to, -struct xfs_da_intnode *from); -extern void xfs_da3_node_hdr_to_disk (struct xfs_da_intnode *to, -struct xfs_da3_icnode_hdr *from); - -extern void xfs_da3_intnode_from_disk (struct xfs_da3_icnode_hdr *to, -struct xfs_da_intnode *from); -extern void xfs_da3_intnode_to_disk (struct xfs_da_intnode *to, -struct xfs_da3_icnode_hdr *from); -#define XFS_LBSIZE (mp) (mp)->m_sb.sb_blocksize/*
@@ -523,9 +513,6 @@ struct xfs_dir3_leaf {#define XFS_DIR3_LEAF_CRC_OFF offsetof(struct xfs_dir3_leaf_hdr, info.crc) -extern void xfs_dir3_leaf_hdr_from_disk (struct xfs_dir3_icleaf_hdr *to, -struct xfs_dir2_leaf *from); -/* * Get address of the bestcount field in the single-leaf block. */
@@ -717,9 +704,6 @@ struct xfs_dir3_icfree_hdr { }; -void xfs_dir3_free_hdr_from_disk (struct xfs_dir3_icfree_hdr *to, -struct xfs_dir2_free *from); -static inline int xfs_dir3_free_hdr_size (struct xfs_mount *mp) {
fs/xfs/xfs_dir2.h +13 -0
@@ -76,13 +76,26 @@ struct xfs_dir_ops { (*data_unused_p)(struct xfs_dir2_data_hdr *hdr);int (*leaf_hdr_size)(void ); +void (*leaf_hdr_to_disk)(struct xfs_dir2_leaf *to, +struct xfs_dir3_icleaf_hdr *from); +void (*leaf_hdr_from_disk)(struct xfs_dir3_icleaf_hdr *to, +struct xfs_dir2_leaf *from);int (*leaf_max_ents)(struct xfs_mount *mp);struct xfs_dir2_leaf_entry * (*leaf_ents_p)(struct xfs_dir2_leaf *lp);int (*node_hdr_size)(void ); +void (*node_hdr_to_disk)(struct xfs_da_intnode *to, +struct xfs_da3_icnode_hdr *from); +void (*node_hdr_from_disk)(struct xfs_da3_icnode_hdr *to, +struct xfs_da_intnode *from);struct xfs_da_node_entry * (*node_tree_p)(struct xfs_da_intnode *dap); + +void (*free_hdr_to_disk)(struct xfs_dir2_free *to, +struct xfs_dir3_icfree_hdr *from); +void (*free_hdr_from_disk)(struct xfs_dir3_icfree_hdr *to, +struct xfs_dir2_free *from); }; extern const struct xfs_dir_ops *
fs/xfs/xfs_dir2_block.c +1 -1
@@ -936,7 +936,7 @@ xfs_dir2_leaf_to_block( tp = args->trans; mp = dp->i_mount; leaf = lbp->b_addr; -xfs_dir3_leaf_hdr_from_disk (&leafhdr, leaf); + dp->d_ops->leaf_hdr_from_disk (&leafhdr, leaf); ents = dp->d_ops->leaf_ents_p (leaf); ltp =xfs_dir2_leaf_tail_p (mp, leaf);
fs/xfs/xfs_dir2_leaf.c +24 -76
217 lines not on this page · raw message
fs/xfs/xfs_dir2_node.c +40 -86
317 lines not on this page · raw message
fs/xfs/xfs_dir2_priv.h +0 -4
@@ -94,10 +94,6 @@ xfs_dir3_leaf_find_entry(struct xfs_dir3_icleaf_hdr *leafhdr, int lowstale, int highstale, int *lfloglow, int *lfloghigh);extern int xfs_dir2_node_to_leaf (struct xfs_da_state *state); -extern void xfs_dir3_leaf_hdr_from_disk (struct xfs_dir3_icleaf_hdr *to, -struct xfs_dir2_leaf *from); -extern void xfs_dir3_leaf_hdr_to_disk (struct xfs_dir2_leaf *to, -struct xfs_dir3_icleaf_hdr *from);extern bool xfs_dir3_leaf_check_int (struct xfs_mount *mp,struct xfs_inode *dp,struct xfs_dir3_icleaf_hdr *hdr,struct xfs_dir2_leaf *leaf);
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 10/19 xfs: split xfs_rtalloc.c for userspace sanity
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
xfs_rtalloc.c is partially shared with userspace. Split the file up into two parts - one that is kernel private and the other which is wholly shared with userspace.
--- fs/xfs/Makefile | 6 +- fs/xfs/xfs_rtalloc.c | 1845 ++++++++++++------------------------------------- fs/xfs/xfs_rtalloc.h | 24 + fs/xfs/xfs_rtbitmap.c | 973 ++++++++++++++++++++++++++ 4 files changed, 1446 insertions(+), 1402 deletions(-) create mode 100644 fs/xfs/xfs_rtbitmap.c
fs/xfs/Makefile +5 -1
@@ -104,7 +104,11 @@ xfs-$(CONFIG_XFS_QUOTA) += xfs_dquot.o \ xfs_qm_bhv.o \ xfs_qm.o \ xfs_quotaops.o -xfs-$(CONFIG_XFS_RT) += xfs_rtalloc.o + +# xfs_rtbitmap is shared with libxfs +xfs-$(CONFIG_XFS_RT) += xfs_rtalloc.o \ + xfs_rtbitmap.o + xfs-$(CONFIG_XFS_POSIX_ACL) += xfs_acl.o xfs-$(CONFIG_PROC_FS) += xfs_stats.o xfs-$(CONFIG_SYSCTL) += xfs_sysctl.o
fs/xfs/xfs_rtalloc.c +444 -1401
1,948 lines not on this page · raw message
fs/xfs/xfs_rtalloc.h +24 -0
@@ -95,6 +95,30 @@ xfs_growfs_rt(struct xfs_mount *mp,/* file system mount structure */ xfs_growfs_rt_t *in); /* user supplied growfs struct */ +/* +* From xfs_rtbitmap.c +*/ +int xfs_rtbuf_get (struct xfs_mount *mp,struct xfs_trans *tp, +xfs_rtblock_t block,int issum,struct xfs_buf **bpp); +int xfs_rtcheck_range (struct xfs_mount *mp,struct xfs_trans *tp, +xfs_rtblock_t start,xfs_extlen_t len,int val, +xfs_rtblock_t *new,int *stat); +int xfs_rtfind_back (struct xfs_mount *mp,struct xfs_trans *tp, +xfs_rtblock_t start,xfs_rtblock_t limit, +xfs_rtblock_t *rtblock); +int xfs_rtfind_forw (struct xfs_mount *mp,struct xfs_trans *tp, +xfs_rtblock_t start,xfs_rtblock_t limit, +xfs_rtblock_t *rtblock); +int xfs_rtmodify_range (struct xfs_mount *mp,struct xfs_trans *tp, +xfs_rtblock_t start,xfs_extlen_t len,int val); +int xfs_rtmodify_summary (struct xfs_mount *mp,struct xfs_trans *tp,int log, +xfs_rtblock_t bbno,int delta,xfs_buf_t **rbpp, +xfs_fsblock_t *rsb); +int xfs_rtfree_range (struct xfs_mount *mp,struct xfs_trans *tp, +xfs_rtblock_t start,xfs_extlen_t len, +struct xfs_buf **rbpp,xfs_fsblock_t *rsb); + +#else # define xfs_rtallocate_extent (t,b,min,max,l,a,f,p,rb) (ENOSYS)# define xfs_rtfree_extent (t,b,l) (ENOSYS)
fs/xfs/xfs_rtbitmap.c new file +973 -0
973 lines not on this page · raw message
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 6/19 xfs: split dquot buffer operations out
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Parts of userspace want to be able to read and modify dquot buffers (e.g. xfs_db) so we need to split out the reading and writing of these buffers so it is easy to shared code with libxfs in userspace.
--- fs/xfs/Makefile | 1 + fs/xfs/xfs_dquot.c | 117 +------------------ fs/xfs/xfs_dquot_buf.c | 288 +++++++++++++++++++++++++++++++++++++++++++++++ fs/xfs/xfs_log_recover.c | 133 +--------------------- fs/xfs/xfs_qm.c | 22 +--- fs/xfs/xfs_qm.h | 2 - fs/xfs/xfs_quota.h | 2 - fs/xfs/xfs_quota_defs.h | 4 + 8 files changed, 303 insertions(+), 266 deletions(-) create mode 100644 fs/xfs/xfs_dquot_buf.c
fs/xfs/Makefile +1 -0
@@ -72,6 +72,7 @@ xfs-y += xfs_alloc.o \ xfs_dir2_leaf.o \ xfs_dir2_node.o \ xfs_dir2_sf.o \ + xfs_dquot_buf.o \ xfs_ialloc.o \ xfs_ialloc_btree.o \ xfs_icreate_item.o \
fs/xfs/xfs_dquot.c +3 -114
141 lines not on this page · raw message
fs/xfs/xfs_dquot_buf.c new file +288 -0
288 lines not on this page · raw message
fs/xfs/xfs_log_recover.c +3 -130
157 lines not on this page · raw message
fs/xfs/xfs_qm.c +4 -18
@@ -665,20 +665,6 @@ xfs_qm_dqdetach( } } -int -xfs_qm_calc_dquots_per_chunk ( -struct xfs_mount *mp, -unsigned int nbblks)/* basic block units */ -{ -unsigned int ndquots; - -ASSERT (nbblks >0 ); - ndquots =BBTOB (nbblks); -do_div (ndquots,sizeof (xfs_dqblk_t)); - -return ndquots; -} -struct xfs_qm_isolate {struct list_head buffers;struct list_head dispose;
@@ -859,7 +845,7 @@ xfs_qm_init_quotainfo(/* Precalc some constants */ qinf->qi_dqchunklen =XFS_FSB_TO_BB (mp,XFS_DQUOT_CLUSTER_SIZE_FSB ); - qinf->qi_dqperchunk =xfs_qm_calc_dquots_per_chunk (mp, + qinf->qi_dqperchunk =xfs_calc_dquots_per_chunk (mp, qinf->qi_dqchunklen); mp->m_qflags |= (mp->m_sb.sb_qflags &XFS_ALL_QUOTA_CHKD );
@@ -1093,10 +1079,10 @@ xfs_qm_reset_dqcounts(/* * Do a sanity check, and if needed, repair the dqblk. Don't * output any warnings because it's perfectly possible to -* find uninitialised dquot blks. See comment in xfs_qm_dqcheck. +* find uninitialised dquot blks. See comment in xfs_dqcheck. */ - (void )xfs_qm_dqcheck (mp, ddq, id+j, type,XFS_QMOPT_DQREPAIR , -"xfs_quotacheck" ); +xfs_dqcheck (mp, ddq, id+j, type,XFS_QMOPT_DQREPAIR , +"xfs_quotacheck" ); ddq->d_bcount =0 ; ddq->d_icount =0 ; ddq->d_rtbcount =0 ;
fs/xfs/xfs_qm.h +0 -2
@@ -103,8 +103,6 @@ xfs_dq_to_quota_inode(struct xfs_dquot *dqp)return NULL ; } -extern int xfs_qm_calc_dquots_per_chunk (struct xfs_mount *mp, -unsigned int nbblks);extern void xfs_trans_mod_dquot (struct xfs_trans *,struct xfs_dquot *,uint ,long ); extern int xfs_trans_reserve_quota_bydquots(struct xfs_trans *,
fs/xfs/xfs_quota.h +0 -2
@@ -150,8 +150,6 @@ static inline int xfs_trans_reserve_quota_bydquots(struct xfs_trans *tp,xfs_trans_reserve_quota_bydquots (tp, mp, ud, gd, pd, nb, ni, \ f | XFS_QMOPT_RES_REGBLKS) -extern int xfs_qm_dqcheck (struct xfs_mount *,xfs_disk_dquot_t *, -xfs_dqid_t ,uint ,uint ,char *);extern int xfs_mount_reset_sbqflags (struct xfs_mount *);#endif /* __XFS_QUOTA_H__ */
fs/xfs/xfs_quota_defs.h +4 -0
@@ -154,4 +154,8 @@ typedef __uint16_t xfs_qwarncnt_t; (XFS_QMOPT_UQUOTA | XFS_QMOPT_PQUOTA | XFS_QMOPT_GQUOTA)#define XFS_QMOPT_RESBLK_MASK (XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_RES_RTBLKS) +extern int xfs_dqcheck (struct xfs_mount *mp,xfs_disk_dquot_t *ddq, +xfs_dqid_t id,uint type,uint flags,char *str); +extern int xfs_calc_dquots_per_chunk (struct xfs_mount *mp,unsigned int nbblks); +#endif /* __XFS_QUOTA_H__ */
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 11/19 xfs: abstract the differences in dir2/dir3 via an ops vector
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Lots of the dir code now goes through switches to determine what is the correct on-disk format to parse. It generally involves a "xfs_sbversion_hasfoo" check, deferencing the superblock version and feature fields and hence touching several cache lines per operation in the process. Some operations do multiple checks because they nest conditional operations and they don't pass the information in a direct fashion between each other.
Hence, add an ops vector to the xfs_inode structure that is configured when the inode is initialised to point to all the correct decode and encoding operations. This will significantly reduce the branchiness and cacheline footprint of the directory object decoding and encoding.
This is the first patch in a series of conversion patches. It will introduce the ops structure, the setup of it and add the first operation to the vector. Subsequent patches will convert directory ops one at a time to keep the changes simple and obvious.
Just this patch shows the benefit of such an approach on code size. Just converting the two shortform dir operations as this patch does decreases the built binary size by ~1500 bytes:
$ size fs/xfs/xfs.o.orig fs/xfs/xfs.o.p1 text data bss dec hex filename 794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 $
That's a significant decrease in the instruction cache footprint of the directory code for such a simple change, and indicates that this approach is definitely worth pursuing further.
--- fs/xfs/Makefile | 1 + fs/xfs/xfs_da_btree.h | 1 + fs/xfs/xfs_da_format.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++ fs/xfs/xfs_da_format.h | 26 --------------- fs/xfs/xfs_dir2.c | 7 ++++ fs/xfs/xfs_dir2.h | 14 ++++++++ fs/xfs/xfs_dir2_block.c | 2 +- fs/xfs/xfs_dir2_readdir.c | 4 +-- fs/xfs/xfs_dir2_sf.c | 31 +++++++++-------- fs/xfs/xfs_inode.h | 3 ++ fs/xfs/xfs_iops.c | 1 + fs/xfs/xfs_mount.h | 2 ++ 12 files changed, 132 insertions(+), 45 deletions(-) create mode 100644 fs/xfs/xfs_da_format.c
fs/xfs/Makefile +1 -0
@@ -66,6 +66,7 @@ xfs-y += xfs_alloc.o \ xfs_bmap_btree.o \ xfs_btree.o \ xfs_da_btree.o \ + xfs_da_format.o \ xfs_dir2.o \ xfs_dir2_block.o \ xfs_dir2_data.o \
fs/xfs/xfs_da_btree.h +1 -0
@@ -23,6 +23,7 @@ struct xfs_bmap_free;struct xfs_inode ;struct xfs_trans ;struct zone ; +struct xfs_dir_ops ;/*======================================================================== * Btree searching and modification structure definitions.
fs/xfs/xfs_da_format.c new file +85 -0
85 lines not on this page · raw message
fs/xfs/xfs_da_format.h +0 -26
@@ -329,32 +329,6 @@ xfs_dir2_sf_firstentry(struct xfs_dir2_sf_hdr *hdr) ((char *)hdr +xfs_dir2_sf_hdr_size (hdr->i8count)); } -static inline int -xfs_dir3_sf_entsize ( -struct xfs_mount *mp, -struct xfs_dir2_sf_hdr *hdr, -int len) -{ -int count =sizeof (struct xfs_dir2_sf_entry );/* namelen + offset */ - - count += len;/* name */ - count += hdr->i8count ?sizeof (xfs_dir2_ino8_t) : -sizeof (xfs_dir2_ino4_t);/* ino # */ -if (xfs_sb_version_hasftype (&mp->m_sb)) - count +=sizeof (__uint8_t);/* file type */ -return count; -} - -static inline struct xfs_dir2_sf_entry * -xfs_dir3_sf_nextentry ( -struct xfs_mount *mp, -struct xfs_dir2_sf_hdr *hdr, -struct xfs_dir2_sf_entry *sfep) -{ -return (struct xfs_dir2_sf_entry *) - ((char *)sfep +xfs_dir3_sf_entsize (mp, hdr, sfep->namelen)); -} -/* * in dir3 shortform directories, the file type field is stored at a variable * offset after the inode number. Because it's only a single byte, endian
fs/xfs/xfs_dir2.c +7 -0
@@ -112,6 +112,13 @@ xfs_dir_mount( mp->m_dirnameops = &xfs_ascii_ci_nameops; else mp->m_dirnameops = &xfs_default_nameops; + +if (xfs_sb_version_hascrc (&mp->m_sb)) + mp->m_dir_inode_ops = &xfs_dir3_ops; +else if (xfs_sb_version_hasftype (&mp->m_sb)) + mp->m_dir_inode_ops = &xfs_dir2_ftype_ops; +else + mp->m_dir_inode_ops = &xfs_dir2_ops; }/*
fs/xfs/xfs_dir2.h +14 -0
@@ -32,6 +32,20 @@ struct xfs_dir2_data_unused;extern struct xfs_name xfs_name_dotdot;/* +* directory operations vector for encode/decode routines +*/ +struct xfs_dir_ops { +int (*sf_entsize)(struct xfs_dir2_sf_hdr *hdr,int len); +struct xfs_dir2_sf_entry * + (*sf_nextentry)(struct xfs_dir2_sf_hdr *hdr, +struct xfs_dir2_sf_entry *sfep); +}; + +extern const struct xfs_dir_ops xfs_dir2_ops; +extern const struct xfs_dir_ops xfs_dir2_ftype_ops; +extern const struct xfs_dir_ops xfs_dir3_ops; + +/* * Generic directory interface routines */ extern void xfs_dir_startup (void );
fs/xfs/xfs_dir2_block.c +1 -1
@@ -1240,7 +1240,7 @@ xfs_dir2_sf_to_block(if (++i == sfp->count) sfep =NULL ;else - sfep =xfs_dir3_sf_nextentry (mp, sfp, sfep); + sfep = dp->d_ops->sf_nextentry (sfp, sfep); }/* Done with the temporary buffer */ kmem_free (sfp);
fs/xfs/xfs_dir2_readdir.c +2 -2
@@ -153,7 +153,7 @@ xfs_dir2_sf_getdents( xfs_dir2_sf_get_offset(sfep));if (ctx->pos > off) { - sfep =xfs_dir3_sf_nextentry (mp, sfp, sfep); + sfep = dp->d_ops->sf_nextentry (sfp, sfep);continue ; }
@@ -163,7 +163,7 @@ xfs_dir2_sf_getdents(if (!dir_emit (ctx, (char *)sfep->name, sfep->namelen, ino,xfs_dir3_get_dtype (mp, filetype)))return 0 ; - sfep =xfs_dir3_sf_nextentry (mp, sfp, sfep); + sfep = dp->d_ops->sf_nextentry (sfp, sfep); } ctx->pos = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0) &
fs/xfs/xfs_dir2_sf.c +15 -16
@@ -336,7 +336,7 @@ xfs_dir2_block_to_sf(xfs_dir3_sfe_put_ftype (mp, sfp, sfep,xfs_dir3_dirent_get_ftype (mp, dep)); - sfep =xfs_dir3_sf_nextentry (mp, sfp, sfep); + sfep = dp->d_ops->sf_nextentry (sfp, sfep); } ptr +=xfs_dir3_data_entsize (mp, dep->namelen); }
@@ -389,7 +389,7 @@ xfs_dir2_sf_addname(/* * Compute entry (and change in) size. */ - add_entsize =xfs_dir3_sf_entsize (dp->i_mount, sfp, args->namelen); + add_entsize = dp->d_ops->sf_entsize (sfp, args->namelen); incr_isize = add_entsize; objchange =0 ;#if XFS_BIG_INUMS
@@ -483,8 +483,7 @@ xfs_dir2_sf_addname_easy(/* * Grow the in-inode space. */ -xfs_idata_realloc (dp, -xfs_dir3_sf_entsize (dp->i_mount, sfp, args->namelen), +xfs_idata_realloc (dp, dp->d_ops->sf_entsize (sfp, args->namelen),XFS_DATA_FORK );/* * Need to set up again due to realloc of the inode data.
@@ -563,7 +562,7 @@ xfs_dir2_sf_addname_hard( eof = (char *)oldsfep == &buf[old_isize]; !eof; offset = new_offset + xfs_dir3_data_entsize(mp, oldsfep->namelen), - oldsfep = xfs_dir3_sf_nextentry(mp, oldsfp, oldsfep), + oldsfep = dp->d_ops->sf_nextentry(oldsfp, oldsfep), eof = (char *)oldsfep == &buf[old_isize]) { new_offset =xfs_dir2_sf_get_offset (oldsfep);if (offset + add_datasize <= new_offset)
@@ -603,7 +602,7 @@ xfs_dir2_sf_addname_hard(* If there's more left to copy, do that. */ if (!eof) { - sfep =xfs_dir3_sf_nextentry (mp, sfp, sfep); + sfep = dp->d_ops->sf_nextentry (sfp, sfep);memcpy (sfep, oldsfep, old_isize - nbytes); }kmem_free (buf);
@@ -653,7 +652,7 @@ xfs_dir2_sf_addname_pick( holefit = offset + size <=xfs_dir2_sf_get_offset (sfep); offset =xfs_dir2_sf_get_offset (sfep) +xfs_dir3_data_entsize (mp, sfep->namelen); - sfep =xfs_dir3_sf_nextentry (mp, sfp, sfep); + sfep = dp->d_ops->sf_nextentry (sfp, sfep); }/* * Calculate data bytes used excluding the new entry, if this
@@ -719,7 +718,7 @@ xfs_dir2_sf_check(for (i =0 , sfep =xfs_dir2_sf_firstentry (sfp); i < sfp->count; - i++, sfep =xfs_dir3_sf_nextentry (mp, sfp, sfep)) { + i++, sfep = dp->d_ops->sf_nextentry (sfp, sfep)) {ASSERT (xfs_dir2_sf_get_offset (sfep) >= offset); ino =xfs_dir3_sfe_get_ino (mp, sfp, sfep); i8count += ino >XFS_DIR2_MAX_SHORT_INUM ;
@@ -848,7 +847,7 @@ xfs_dir2_sf_lookup(*/ ci_sfep =NULL ;for (i =0 , sfep =xfs_dir2_sf_firstentry (sfp); i < sfp->count; - i++, sfep =xfs_dir3_sf_nextentry (dp->i_mount, sfp, sfep)) { + i++, sfep = dp->d_ops->sf_nextentry (sfp, sfep)) {/* * Compare name and if it's an exact match, return the inode * number. If it's the first case-insensitive match, store the
@@ -917,7 +916,7 @@ xfs_dir2_sf_removename(* Find the one we're deleting. */ for (i =0 , sfep =xfs_dir2_sf_firstentry (sfp); i < sfp->count; - i++, sfep =xfs_dir3_sf_nextentry (dp->i_mount, sfp, sfep)) { + i++, sfep = dp->d_ops->sf_nextentry (sfp, sfep)) {if (xfs_da_compname (args, sfep->name, sfep->namelen) ==XFS_CMP_EXACT ) { ASSERT(xfs_dir3_sfe_get_ino(dp->i_mount, sfp, sfep) ==
@@ -934,7 +933,7 @@ xfs_dir2_sf_removename(* Calculate sizes. */ byteoff = (int )((char *)sfep - (char *)sfp); - entsize =xfs_dir3_sf_entsize (dp->i_mount, sfp, args->namelen); + entsize = dp->d_ops->sf_entsize (sfp, args->namelen); newsize = oldsize - entsize;/* * Copy the part if any after the removed entry, sliding it down.
@@ -1051,7 +1050,7 @@ xfs_dir2_sf_replace(*/ else {for (i =0 , sfep =xfs_dir2_sf_firstentry (sfp); i < sfp->count; - i++, sfep =xfs_dir3_sf_nextentry (dp->i_mount, sfp, sfep)) { + i++, sfep = dp->d_ops->sf_nextentry (sfp, sfep)) {if (xfs_da_compname (args, sfep->name, sfep->namelen) ==XFS_CMP_EXACT ) {#if XFS_BIG_INUMS || defined(DEBUG )
@@ -1172,8 +1171,8 @@ xfs_dir2_sf_toino4(for (i =0 , sfep =xfs_dir2_sf_firstentry (sfp), oldsfep =xfs_dir2_sf_firstentry (oldsfp); i < sfp->count; - i++, sfep =xfs_dir3_sf_nextentry (mp, sfp, sfep), - oldsfep =xfs_dir3_sf_nextentry (mp, oldsfp, oldsfep)) { + i++, sfep = dp->d_ops->sf_nextentry (sfp, sfep), + oldsfep = dp->d_ops->sf_nextentry (oldsfp, oldsfep)) { sfep->namelen = oldsfep->namelen; sfep->offset = oldsfep->offset;memcpy (sfep->name, oldsfep->name, sfep->namelen);
@@ -1251,8 +1250,8 @@ xfs_dir2_sf_toino8(for (i =0 , sfep =xfs_dir2_sf_firstentry (sfp), oldsfep =xfs_dir2_sf_firstentry (oldsfp); i < sfp->count; - i++, sfep =xfs_dir3_sf_nextentry (mp, sfp, sfep), - oldsfep =xfs_dir3_sf_nextentry (mp, oldsfp, oldsfep)) { + i++, sfep = dp->d_ops->sf_nextentry (sfp, sfep), + oldsfep = dp->d_ops->sf_nextentry (oldsfp, oldsfep)) { sfep->namelen = oldsfep->namelen; sfep->offset = oldsfep->offset;memcpy (sfep->name, oldsfep->name, sfep->namelen);
fs/xfs/xfs_inode.h +3 -0
@@ -49,6 +49,9 @@ typedef struct xfs_inode {xfs_ifork_t *i_afp;/* attribute fork pointer */ xfs_ifork_t i_df;/* data fork */ +/* operations vectors */ +const struct xfs_dir_ops *d_ops;/* directory ops vector */ +/* Transaction and locking information. */ struct xfs_inode_log_item *i_itemp;/* logging information */ mrlock_t i_lock;/* inode lock */
fs/xfs/xfs_iops.c +1 -0
@@ -1212,6 +1212,7 @@ xfs_setup_inode(else inode->i_op = &xfs_dir_inode_operations; inode->i_fop = &xfs_dir_file_operations; + ip->d_ops = ip->i_mount->m_dir_inode_ops;break ;case S_IFLNK : inode->i_op = &xfs_symlink_inode_operations;
fs/xfs/xfs_mount.h +2 -0
@@ -26,6 +26,7 @@ struct xfs_mru_cache;struct xfs_nameops ;struct xfs_ail ;struct xfs_quotainfo ; +struct xfs_dir_ops ;#ifdef HAVE_PERCPU_SB
@@ -148,6 +149,7 @@ typedef struct xfs_mount {int m_dir_magicpct;/* 37% of the dir blocksize */ __uint8_t m_sectbb_log;/* sectlog - BBSHIFT */ const struct xfs_nameops *m_dirnameops;/* vector of dir name ops */ +const struct xfs_dir_ops *m_dir_inode_ops;/* vector of dir inode ops */ int m_dirblksize;/* directory block sz--bytes */ int m_dirblkfsbs;/* directory block sz--fsbs */ xfs_dablk_t m_dirdatablk;/* blockno of dir data v2 */
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 15/19 xfs: vectorise directory leaf operations
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Next step in the vectorisation process is the leaf block encode/decode operations. Most of the operations on leaves are handled by the data block vectors, so there are relatively few of them here.
Because of all the shuffling of code and having to pass more state to some functions, this patch doesn't directly reduce the size of the binary. It does open up many more opportunities for factoring and optimisation, however.
text data bss dec hex filename
794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2 789293 96802 1096 887191 d8997 fs/xfs/xfs.o.p3 789005 96802 1096 886903 d8997 fs/xfs/xfs.o.p4 789061 96802 1096 886959 d88af fs/xfs/xfs.o.p5
--- fs/xfs/xfs_da_btree.c | 19 ++++---- fs/xfs/xfs_da_format.c | 75 +++++++++++++++++++++++++++++++ fs/xfs/xfs_da_format.h | 30 ------------- fs/xfs/xfs_dir2.c | 7 +-- fs/xfs/xfs_dir2.h | 10 +++-- fs/xfs/xfs_dir2_block.c | 2 +- fs/xfs/xfs_dir2_data.c | 13 ++---- fs/xfs/xfs_dir2_leaf.c | 91 +++++++++++++++++++++----------------- fs/xfs/xfs_dir2_node.c | 115 ++++++++++++++++++++++++++---------------------- fs/xfs/xfs_dir2_priv.h | 13 +++--- 10 files changed, 217 insertions(+), 158 deletions(-)
fs/xfs/xfs_da_btree.c +10 -9
@@ -605,7 +605,7 @@ xfs_da3_root_split( leaf = (xfs_dir2_leaf_t *)oldroot;xfs_dir3_leaf_hdr_from_disk (&leafhdr, leaf); - ents =xfs_dir3_leaf_ents_p (leaf); + ents = dp->d_ops->leaf_ents_p (leaf);ASSERT (leafhdr.magic ==XFS_DIR2_LEAFN_MAGIC || leafhdr.magic ==XFS_DIR3_LEAFN_MAGIC );
@@ -1319,7 +1319,8 @@ xfs_da3_fixhashpath(return ;break ;case XFS_DIR2_LEAFN_MAGIC : - lasthash =xfs_dir2_leafn_lasthash (blk->bp, &count); + lasthash =xfs_dir2_leafn_lasthash (state->args->dp, + blk->bp, &count);if (count ==0 )return ;break ;
@@ -1536,7 +1537,8 @@ xfs_da3_node_lookup_int(if (blk->magic ==XFS_DIR2_LEAFN_MAGIC || blk->magic ==XFS_DIR3_LEAFN_MAGIC ) { blk->magic =XFS_DIR2_LEAFN_MAGIC ; - blk->hashval =xfs_dir2_leafn_lasthash (blk->bp,NULL ); + blk->hashval =xfs_dir2_leafn_lasthash (args->dp, + blk->bp,NULL );break ; }
@@ -1702,7 +1704,7 @@ xfs_da3_blk_link( before =xfs_attr_leaf_order (old_blk->bp, new_blk->bp);break ;case XFS_DIR2_LEAFN_MAGIC : - before =xfs_dir2_leafn_order (old_blk->bp, new_blk->bp); + before =xfs_dir2_leafn_order (args->dp, old_blk->bp, new_blk->bp);break ;case XFS_DA_NODE_MAGIC : before =xfs_da3_node_order (old_blk->bp, new_blk->bp);
@@ -1947,16 +1949,15 @@ xfs_da3_path_shift( blk->magic =XFS_ATTR_LEAF_MAGIC ;ASSERT (level == path->active-1 ); blk->index =0 ; - blk->hashval =xfs_attr_leaf_lasthash (blk->bp, -NULL ); + blk->hashval =xfs_attr_leaf_lasthash (blk->bp,NULL );break ;case XFS_DIR2_LEAFN_MAGIC :case XFS_DIR3_LEAFN_MAGIC : blk->magic =XFS_DIR2_LEAFN_MAGIC ;ASSERT (level == path->active-1 ); blk->index =0 ; - blk->hashval =xfs_dir2_leafn_lasthash (blk->bp, -NULL ); + blk->hashval =xfs_dir2_leafn_lasthash (args->dp, + blk->bp,NULL );break ;default :ASSERT (0 );
@@ -2223,7 +2224,7 @@ xfs_da3_swap_lastblock( dead_leaf2 = (xfs_dir2_leaf_t *)dead_info;xfs_dir3_leaf_hdr_from_disk (&leafhdr, dead_leaf2); - ents =xfs_dir3_leaf_ents_p (dead_leaf2); + ents = ip->d_ops->leaf_ents_p (dead_leaf2); dead_level =0 ; dead_hash =be32_to_cpu (ents[leafhdr.count -1 ].hashval); }else {
fs/xfs/xfs_da_format.c +75 -0
97 lines not on this page · raw message
fs/xfs/xfs_da_format.h +0 -30
@@ -551,36 +551,6 @@ struct xfs_dir3_leaf {extern void xfs_dir3_leaf_hdr_from_disk (struct xfs_dir3_icleaf_hdr *to,struct xfs_dir2_leaf *from); -static inline int -xfs_dir3_leaf_hdr_size (struct xfs_dir2_leaf *lp) -{ -if (lp->hdr.info.magic ==cpu_to_be16 (XFS_DIR3_LEAF1_MAGIC ) || - lp->hdr.info.magic ==cpu_to_be16 (XFS_DIR3_LEAFN_MAGIC )) -return sizeof (struct xfs_dir3_leaf_hdr ); -return sizeof (struct xfs_dir2_leaf_hdr ); -} - -static inline int -xfs_dir3_max_leaf_ents (struct xfs_mount *mp,struct xfs_dir2_leaf *lp) -{ -return (mp->m_dirblksize -xfs_dir3_leaf_hdr_size (lp)) / - (uint )sizeof (struct xfs_dir2_leaf_entry ); -} - -/* -* Get address of the bestcount field in the single-leaf block. -*/ -static inline struct xfs_dir2_leaf_entry * -xfs_dir3_leaf_ents_p (struct xfs_dir2_leaf *lp) -{ -if (lp->hdr.info.magic ==cpu_to_be16 (XFS_DIR3_LEAF1_MAGIC ) || - lp->hdr.info.magic ==cpu_to_be16 (XFS_DIR3_LEAFN_MAGIC )) { -struct xfs_dir3_leaf *lp3 = (struct xfs_dir3_leaf *)lp; -return lp3->__ents; - } -return lp->__ents; -} -/* * Get address of the bestcount field in the single-leaf block. */
fs/xfs/xfs_dir2.c +1 -6
@@ -113,12 +113,7 @@ xfs_dir_mount(else mp->m_dirnameops = &xfs_default_nameops; -if (xfs_sb_version_hascrc (&mp->m_sb)) - mp->m_dir_inode_ops = &xfs_dir3_ops; -else if (xfs_sb_version_hasftype (&mp->m_sb)) - mp->m_dir_inode_ops = &xfs_dir2_ftype_ops; -else - mp->m_dir_inode_ops = &xfs_dir2_ops; + mp->m_dir_inode_ops =xfs_dir_get_ops (mp,NULL ); }/*
fs/xfs/xfs_dir2.h +7 -3
@@ -74,11 +74,15 @@ struct xfs_dir_ops { (*data_entry_p)(struct xfs_dir2_data_hdr *hdr);struct xfs_dir2_data_unused * (*data_unused_p)(struct xfs_dir2_data_hdr *hdr); + +int (*leaf_hdr_size)(void ); +int (*leaf_max_ents)(struct xfs_mount *mp); +struct xfs_dir2_leaf_entry * + (*leaf_ents_p)(struct xfs_dir2_leaf *lp); }; -extern const struct xfs_dir_ops xfs_dir2_ops; -extern const struct xfs_dir_ops xfs_dir2_ftype_ops; -extern const struct xfs_dir_ops xfs_dir3_ops; +extern const struct xfs_dir_ops * +xfs_dir_get_ops (struct xfs_mount *mp,struct xfs_inode *dp);/* * Generic directory interface routines
fs/xfs/xfs_dir2_block.c +1 -1
@@ -937,7 +937,7 @@ xfs_dir2_leaf_to_block( mp = dp->i_mount; leaf = lbp->b_addr;xfs_dir3_leaf_hdr_from_disk (&leafhdr, leaf); - ents =xfs_dir3_leaf_ents_p (leaf); + ents = dp->d_ops->leaf_ents_p (leaf); ltp =xfs_dir2_leaf_tail_p (mp, leaf); ASSERT(leafhdr.magic == XFS_DIR2_LEAF1_MAGIC ||
fs/xfs/xfs_dir2_data.c +3 -10
@@ -68,17 +68,10 @@ __xfs_dir3_data_check( hdr = bp->b_addr;/* -* we can be passed a null dp here froma verifier, so manually configure -* the ops here in that case. +* we can be passed a null dp here from a verifier, so we need to go the +* hard way to get them. */ -if (dp) - ops = dp->d_ops; -else if (xfs_sb_version_hascrc (&mp->m_sb)) - ops = &xfs_dir3_ops; -else if (xfs_sb_version_hasftype (&mp->m_sb)) - ops = &xfs_dir2_ftype_ops; -else - ops = &xfs_dir2_ops; + ops =xfs_dir_get_ops (mp, dp);switch (hdr->magic) {case cpu_to_be32 (XFS_DIR3_BLOCK_MAGIC ):
fs/xfs/xfs_dir2_leaf.c +51 -40
280 lines not on this page · raw message
fs/xfs/xfs_dir2_node.c +62 -53
343 lines not on this page · raw message
fs/xfs/xfs_dir2_priv.h +7 -6
@@ -77,9 +77,9 @@ extern void xfs_dir3_leaf_compact_x1(struct xfs_dir3_icleaf_hdr *leafhdr, int *lowstalep, int *highstalep, int *lowlogp, int *highlogp);extern int xfs_dir3_leaf_get_buf (struct xfs_da_args *args,xfs_dir2_db_t bno,struct xfs_buf **bpp,__uint16_t magic); -extern void xfs_dir3_leaf_log_ents (struct xfs_trans *tp,struct xfs_buf *bp, -int first,int last); -extern void xfs_dir3_leaf_log_header (struct xfs_trans *tp, +extern void xfs_dir3_leaf_log_ents (struct xfs_trans *tp,struct xfs_inode *dp, +struct xfs_buf *bp,int first,int last); +extern void xfs_dir3_leaf_log_header (struct xfs_trans *tp,struct xfs_inode *dp,struct xfs_buf *bp);extern int xfs_dir2_leaf_lookup (struct xfs_da_args *args);extern int xfs_dir2_leaf_removename (struct xfs_da_args *args);
@@ -98,17 +98,18 @@ extern void xfs_dir3_leaf_hdr_from_disk(struct xfs_dir3_icleaf_hdr *to, struct xfs_dir2_leaf *from);extern void xfs_dir3_leaf_hdr_to_disk (struct xfs_dir2_leaf *to,struct xfs_dir3_icleaf_hdr *from); -extern bool xfs_dir3_leaf_check_int (struct xfs_mount *mp, +extern bool xfs_dir3_leaf_check_int (struct xfs_mount *mp,struct xfs_inode *dp,struct xfs_dir3_icleaf_hdr *hdr,struct xfs_dir2_leaf *leaf);/* xfs_dir2_node.c */ extern int xfs_dir2_leaf_to_node (struct xfs_da_args *args,struct xfs_buf *lbp); -extern xfs_dahash_t xfs_dir2_leafn_lasthash (struct xfs_buf *bp,int *count); +extern xfs_dahash_t xfs_dir2_leafn_lasthash (struct xfs_inode *dp, +struct xfs_buf *bp,int *count);extern int xfs_dir2_leafn_lookup_int (struct xfs_buf *bp,struct xfs_da_args *args,int *indexp,struct xfs_da_state *state); -extern int xfs_dir2_leafn_order (struct xfs_buf *leaf1_bp, +extern int xfs_dir2_leafn_order (struct xfs_inode *dp,struct xfs_buf *leaf1_bp,struct xfs_buf *leaf2_bp);extern int xfs_dir2_leafn_split (struct xfs_da_state *state,struct xfs_da_state_blk *oldblk,struct xfs_da_state_blk *newblk);
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 5/19 xfs: unify directory/attribute format definitions
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
The on-disk format definitions for the directory and attribute structures are spread across 3 header files right now, only one of which is dedicated to defining on-disk structures and their manipulation (xfs_dir2_format.h). Pull all the format definitions into a single header file - xfs_da_format.h - and switch all the code over to point at that.
--- fs/xfs/xfs_attr.c | 1 + fs/xfs/xfs_attr_inactive.c | 1 + fs/xfs/xfs_attr_leaf.c | 1 + fs/xfs/xfs_attr_leaf.h | 230 -------- fs/xfs/xfs_attr_list.c | 1 + fs/xfs/xfs_attr_remote.c | 1 + fs/xfs/xfs_attr_remote.h | 27 - fs/xfs/xfs_bmap.c | 2 +- fs/xfs/xfs_bmap_util.c | 2 +- fs/xfs/xfs_da_btree.c | 2 +- fs/xfs/xfs_da_btree.h | 140 ----- fs/xfs/xfs_da_format.h | 1362 ++++++++++++++++++++++++++++++++++++++++++++ fs/xfs/xfs_dir2.c | 2 +- fs/xfs/xfs_dir2_block.c | 2 +- fs/xfs/xfs_dir2_data.c | 2 +- fs/xfs/xfs_dir2_format.h | 964 ------------------------------- fs/xfs/xfs_dir2_leaf.c | 2 +- fs/xfs/xfs_dir2_node.c | 2 +- fs/xfs/xfs_dir2_readdir.c | 2 +- fs/xfs/xfs_dir2_sf.c | 2 +- fs/xfs/xfs_export.c | 3 +- fs/xfs/xfs_file.c | 4 +- fs/xfs/xfs_inode.c | 2 +- fs/xfs/xfs_iops.c | 2 +- fs/xfs/xfs_log_recover.c | 2 +- fs/xfs/xfs_log_rlimit.c | 1 + fs/xfs/xfs_mount.c | 3 +- fs/xfs/xfs_sb.c | 2 +- fs/xfs/xfs_super.c | 2 +- fs/xfs/xfs_symlink.c | 3 +- fs/xfs/xfs_trace.c | 3 +- fs/xfs/xfs_trans.c | 2 +- fs/xfs/xfs_trans_resv.c | 1 + fs/xfs/xfs_xattr.c | 7 +- 34 files changed, 1398 insertions(+), 1387 deletions(-) create mode 100644 fs/xfs/xfs_da_format.h delete mode 100644 fs/xfs/xfs_dir2_format.h
fs/xfs/xfs_attr.c +1 -0
@@ -26,6 +26,7 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_da_btree.h" #include "xfs_bmap_btree.h" #include "xfs_attr_sf.h"
fs/xfs/xfs_attr_inactive.c +1 -0
@@ -26,6 +26,7 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_da_btree.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h"
fs/xfs/xfs_attr_leaf.c +1 -0
@@ -26,6 +26,7 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_da_btree.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h"
fs/xfs/xfs_attr_leaf.h +0 -230
242 lines not on this page · raw message
fs/xfs/xfs_attr_list.c +1 -0
@@ -25,6 +25,7 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_da_btree.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h"
fs/xfs/xfs_attr_remote.c +1 -0
@@ -26,6 +26,7 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_error.h" #include "xfs_da_btree.h" #include "xfs_bmap_btree.h"
fs/xfs/xfs_attr_remote.h +0 -27
@@ -18,33 +18,6 @@#ifndef __XFS_ATTR_REMOTE_H__#define __XFS_ATTR_REMOTE_H__ -#define XFS_ATTR3_RMT_MAGIC 0x5841524d/* XARM */ - -/* -* There is one of these headers per filesystem block in a remote attribute. -* This is done to ensure there is a 1:1 mapping between the attribute value -* length and the number of blocks needed to store the attribute. This makes the -* verification of a buffer a little more complex, but greatly simplifies the -* allocation, reading and writing of these attributes as we don't have to guess -* the number of blocks needed to store the attribute data. -*/ -struct xfs_attr3_rmt_hdr { -__be32 rm_magic; -__be32 rm_offset; -__be32 rm_bytes; -__be32 rm_crc; -uuid_t rm_uuid; -__be64 rm_owner; -__be64 rm_blkno; -__be64 rm_lsn; -}; - -#define XFS_ATTR3_RMT_CRC_OFF offsetof(struct xfs_attr3_rmt_hdr, rm_crc) - -#define XFS_ATTR3_RMT_BUF_SPACE (mp, bufsize) \ - ((bufsize) - (xfs_sb_version_hascrc(&(mp)->m_sb) ? \ - sizeof(struct xfs_attr3_rmt_hdr) : 0)) -int xfs_attr3_rmt_blocks (struct xfs_mount *mp,int attrlen);int xfs_attr_rmtval_get (struct xfs_da_args *args);
fs/xfs/xfs_bmap.c +1 -1
@@ -26,8 +26,8 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_dir2_format.h" #include "xfs_dir2.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h"
fs/xfs/xfs_bmap_util.c +1 -1
@@ -27,7 +27,7 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_da_btree.h" +#include "xfs_da_format.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h"
fs/xfs/xfs_da_btree.c +1 -1
@@ -26,9 +26,9 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_da_btree.h" #include "xfs_bmap_btree.h" -#include "xfs_dir2_format.h" #include "xfs_dir2.h" #include "xfs_dir2_priv.h" #include "xfs_dinode.h"
fs/xfs/xfs_da_btree.h +0 -140
146 lines not on this page · raw message
fs/xfs/xfs_da_format.h new file +1362 -0
1,362 lines not on this page · raw message
fs/xfs/xfs_dir2.c +1 -1
@@ -24,6 +24,7 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_da_btree.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h"
@@ -31,7 +32,6 @@#include "xfs_inode.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" -#include "xfs_dir2_format.h" #include "xfs_dir2.h" #include "xfs_dir2_priv.h" #include "xfs_error.h"
fs/xfs/xfs_dir2_block.c +1 -1
@@ -24,6 +24,7 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_da_btree.h" #include "xfs_bmap_btree.h" #include "xfs_dinode.h"
@@ -31,7 +32,6 @@#include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_buf_item.h" -#include "xfs_dir2_format.h" #include "xfs_dir2.h" #include "xfs_dir2_priv.h" #include "xfs_error.h"
fs/xfs/xfs_dir2_data.c +1 -1
@@ -24,11 +24,11 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_da_btree.h" #include "xfs_bmap_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" -#include "xfs_dir2_format.h" #include "xfs_dir2.h" #include "xfs_dir2_priv.h" #include "xfs_error.h"
fs/xfs/xfs_dir2_format.h deleted +0 -964
964 lines not on this page · raw message
fs/xfs/xfs_dir2_leaf.c +1 -1
@@ -25,12 +25,12 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_da_btree.h" #include "xfs_bmap_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_bmap.h" -#include "xfs_dir2_format.h" #include "xfs_dir2.h" #include "xfs_dir2_priv.h" #include "xfs_error.h"
fs/xfs/xfs_dir2_node.c +1 -1
@@ -24,12 +24,12 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_da_btree.h" #include "xfs_bmap_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_bmap.h" -#include "xfs_dir2_format.h" #include "xfs_dir2.h" #include "xfs_dir2_priv.h" #include "xfs_error.h"
fs/xfs/xfs_dir2_readdir.c +1 -1
@@ -25,11 +25,11 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_da_btree.h" #include "xfs_bmap_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" -#include "xfs_dir2_format.h" #include "xfs_dir2.h" #include "xfs_dir2_priv.h" #include "xfs_error.h"
fs/xfs/xfs_dir2_sf.c +1 -1
@@ -23,13 +23,13 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_da_btree.h" #include "xfs_bmap_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_inode_item.h" #include "xfs_error.h" -#include "xfs_dir2_format.h" #include "xfs_dir2.h" #include "xfs_dir2_priv.h" #include "xfs_trace.h"
fs/xfs/xfs_export.c +1 -2
@@ -22,8 +22,7 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_da_btree.h" -#include "xfs_dir2_format.h" +#include "xfs_da_format.h" #include "xfs_dir2.h" #include "xfs_export.h" #include "xfs_bmap_btree.h"
fs/xfs/xfs_file.c +2 -2
@@ -22,6 +22,8 @@#include "xfs_ag.h" #include "xfs_trans.h" #include "xfs_mount.h" +#include "xfs_da_format.h" +#include "xfs_da_btree.h" #include "xfs_bmap_btree.h" #include "xfs_alloc.h" #include "xfs_dinode.h"
@@ -30,8 +32,6 @@#include "xfs_bmap.h" #include "xfs_bmap_util.h" #include "xfs_error.h" -#include "xfs_da_btree.h" -#include "xfs_dir2_format.h" #include "xfs_dir2.h" #include "xfs_dir2_priv.h" #include "xfs_ioctl.h"
fs/xfs/xfs_inode.c +1 -1
@@ -29,8 +29,8 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_dir2_format.h" #include "xfs_dir2.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h"
fs/xfs/xfs_iops.c +1 -1
@@ -27,6 +27,7 @@#include "xfs_alloc.h" #include "xfs_quota.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_bmap_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h"
@@ -42,7 +43,6 @@#include "xfs_icache.h" #include "xfs_symlink.h" #include "xfs_da_btree.h" -#include "xfs_dir2_format.h" #include "xfs_dir2_priv.h" #include <linux/capability.h>
fs/xfs/xfs_log_recover.c +1 -1
@@ -26,6 +26,7 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_error.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h"
@@ -50,7 +51,6 @@/* Need all the magic numbers and buffer ops structures from these headers */ #include "xfs_symlink.h" #include "xfs_da_btree.h" -#include "xfs_dir2_format.h" #include "xfs_dir2.h" #include "xfs_attr_leaf.h" #include "xfs_attr_remote.h"
fs/xfs/xfs_log_rlimit.c +1 -0
@@ -23,6 +23,7 @@#include "xfs_ag.h" #include "xfs_sb.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_trans_space.h" #include "xfs_bmap_btree.h" #include "xfs_inode.h"
fs/xfs/xfs_mount.c +1 -2
@@ -27,8 +27,7 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_da_btree.h" -#include "xfs_dir2_format.h" +#include "xfs_da_format.h" #include "xfs_dir2.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h"
fs/xfs/xfs_sb.c +1 -1
@@ -26,8 +26,8 @@#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_da_btree.h" -#include "xfs_dir2_format.h" #include "xfs_dir2.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h"
fs/xfs/xfs_super.c +1 -1
@@ -27,6 +27,7 @@#include "xfs_alloc.h" #include "xfs_quota.h" #include "xfs_mount.h" +#include "xfs_da_format.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h"
@@ -45,7 +46,6 @@#include "xfs_trans_priv.h" #include "xfs_filestream.h" #include "xfs_da_btree.h" -#include "xfs_dir2_format.h" #include "xfs_dir2.h"
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 6 lines
1.8.4.rc3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Part of the diff is not shown here. View the raw message.
Re: [PATCH 19/19] xfs: convert directory vector functions to constants
In reply to Dave ChinnerQuoted 20 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Many of the vectorised function calls now take no parameters and return a constant value. There is no reason for these to be vectored functions, so convert them to constants
Binary sizes:
text data bss dec hex filename
794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2 789293 96802 1096 887191 d8997 fs/xfs/xfs.o.p3 789005 96802 1096 886903 d8997 fs/xfs/xfs.o.p4 789061 96802 1096 886959 d88af fs/xfs/xfs.o.p5 789733 96802 1096 887631 d8b4f fs/xfs/xfs.o.p6 791421 96802 1096 889319 d91e7 fs/xfs/xfs.o.p7 791701 96802 1096 889599 d92ff fs/xfs/xfs.o.p8 791205 96802 1096 889103 d91cf fs/xfs/xfs.o.p9
Quoted 1 line
Signed-off-by Dave Chinner <[email protected]>
Hmmm. This one doesn't seem to apply. Maybe it's just me.
-Ben
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 19/19] xfs: convert directory vector functions to constants
Quoted 21 lines · Ben Myers
Quoted 20 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Many of the vectorised function calls now take no parameters and return a constant value. There is no reason for these to be vectored functions, so convert them to constants
Binary sizes:
text data bss dec hex filename
794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2 789293 96802 1096 887191 d8997 fs/xfs/xfs.o.p3 789005 96802 1096 886903 d8997 fs/xfs/xfs.o.p4 789061 96802 1096 886959 d88af fs/xfs/xfs.o.p5 789733 96802 1096 887631 d8b4f fs/xfs/xfs.o.p6 791421 96802 1096 889319 d91e7 fs/xfs/xfs.o.p7 791701 96802 1096 889599 d92ff fs/xfs/xfs.o.p8 791205 96802 1096 889103 d91cf fs/xfs/xfs.o.p9
Quoted 3 lines
Quoted 1 line
Signed-off-by Dave Chinner <[email protected]>Hmmm. This one doesn't seem to apply. Maybe it's just me.
Applies without mismatch here on an 3.12-rc5 + oss-xfs/master tree here. What's the reject that you get?
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 19/19] xfs: convert directory vector functions to constants
Quoted 22 lines · Dave Chinner
Quoted 21 lines · Ben Myers
Quoted 20 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Many of the vectorised function calls now take no parameters and return a constant value. There is no reason for these to be vectored functions, so convert them to constants
Binary sizes:
text data bss dec hex filename
794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2 789293 96802 1096 887191 d8997 fs/xfs/xfs.o.p3 789005 96802 1096 886903 d8997 fs/xfs/xfs.o.p4 789061 96802 1096 886959 d88af fs/xfs/xfs.o.p5 789733 96802 1096 887631 d8b4f fs/xfs/xfs.o.p6 791421 96802 1096 889319 d91e7 fs/xfs/xfs.o.p7 791701 96802 1096 889599 d92ff fs/xfs/xfs.o.p8 791205 96802 1096 889103 d91cf fs/xfs/xfs.o.p9
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Dave Chinner <[email protected]>Hmmm. This one doesn't seem to apply. Maybe it's just me.
Applies without mismatch here on an 3.12-rc5 + oss-xfs/master tree here. What's the reject that you get?
Like so:
$ q pu Applying patch xfs-convert-directory-vector-functions-to-constants.patch patching file fs/xfs/xfs_da_btree.c patching file fs/xfs/xfs_da_format.c Hunk #13 FAILED at 571. Hunk #14 FAILED at 608. Hunk #15 succeeded at 641 (offset -74 lines). Hunk #16 FAILED at 729. Hunk #17 succeeded at 683 (offset -82 lines). Hunk #18 FAILED at 779. Hunk #19 succeeded at 728 (offset -87 lines). Hunk #20 FAILED at 829. 5 out of 20 hunks FAILED -- rejects in file fs/xfs/xfs_da_format.c patching file fs/xfs/xfs_dir2.c patching file fs/xfs/xfs_dir2.h Hunk #4 FAILED at 92. 1 out of 4 hunks FAILED -- rejects in file fs/xfs/xfs_dir2.h patching file fs/xfs/xfs_dir2_block.c patching file fs/xfs/xfs_dir2_data.c patching file fs/xfs/xfs_dir2_leaf.c patching file fs/xfs/xfs_dir2_node.c Hunk #1 FAILED at 274. Hunk #2 succeeded at 1267 (offset -1 lines). Hunk #3 succeeded at 1299 (offset -1 lines). Hunk #4 succeeded at 1408 (offset -1 lines). 1 out of 4 hunks FAILED -- rejects in file fs/xfs/xfs_dir2_node.c patching file fs/xfs/xfs_dir2_readdir.c patching file fs/xfs/xfs_dir2_sf.c Patch xfs-convert-directory-vector-functions-to-constants.patch does not apply (enforce with -f)
That's on 74564fb48.
Thanks,
Ben
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 19/19] xfs: convert directory vector functions to constants
Quoted 62 lines · Ben Myers
Quoted 22 lines · Dave Chinner
Quoted 21 lines · Ben Myers
Quoted 20 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Many of the vectorised function calls now take no parameters and return a constant value. There is no reason for these to be vectored functions, so convert them to constants
Binary sizes:
text data bss dec hex filename
794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2 789293 96802 1096 887191 d8997 fs/xfs/xfs.o.p3 789005 96802 1096 886903 d8997 fs/xfs/xfs.o.p4 789061 96802 1096 886959 d88af fs/xfs/xfs.o.p5 789733 96802 1096 887631 d8b4f fs/xfs/xfs.o.p6 791421 96802 1096 889319 d91e7 fs/xfs/xfs.o.p7 791701 96802 1096 889599 d92ff fs/xfs/xfs.o.p8 791205 96802 1096 889103 d91cf fs/xfs/xfs.o.p9Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Dave Chinner <[email protected]>Hmmm. This one doesn't seem to apply. Maybe it's just me.
Applies without mismatch here on an 3.12-rc5 + oss-xfs/master tree here. What's the reject that you get?
Like so:
$ q pu Applying patch xfs-convert-directory-vector-functions-to-constants.patch patching file fs/xfs/xfs_da_btree.c patching file fs/xfs/xfs_da_format.c Hunk #13 FAILED at 571. Hunk #14 FAILED at 608. Hunk #15 succeeded at 641 (offset -74 lines). Hunk #16 FAILED at 729. Hunk #17 succeeded at 683 (offset -82 lines). Hunk #18 FAILED at 779. Hunk #19 succeeded at 728 (offset -87 lines). Hunk #20 FAILED at 829. 5 out of 20 hunks FAILED -- rejects in file fs/xfs/xfs_da_format.c patching file fs/xfs/xfs_dir2.c patching file fs/xfs/xfs_dir2.h Hunk #4 FAILED at 92. 1 out of 4 hunks FAILED -- rejects in file fs/xfs/xfs_dir2.h patching file fs/xfs/xfs_dir2_block.c patching file fs/xfs/xfs_dir2_data.c patching file fs/xfs/xfs_dir2_leaf.c patching file fs/xfs/xfs_dir2_node.c Hunk #1 FAILED at 274. Hunk #2 succeeded at 1267 (offset -1 lines). Hunk #3 succeeded at 1299 (offset -1 lines). Hunk #4 succeeded at 1408 (offset -1 lines). 1 out of 4 hunks FAILED -- rejects in file fs/xfs/xfs_dir2_node.c patching file fs/xfs/xfs_dir2_readdir.c patching file fs/xfs/xfs_dir2_sf.c Patch xfs-convert-directory-vector-functions-to-constants.patch does not apply (enforce with -f)
Quoted 1 line
That's on
74564fb48.
To be more specific, these are the rejects. Maybe I missed a patch.
xfs/xfs_da_format.c +16 -28
@@ -571,22 +512,16 @@* Directory free space block operations */ static int -xfs_dir2_free_hdr_size (void ) -{ -return sizeof (struct xfs_dir2_free_hdr ); -} - -static int xfs_dir2_free_max_bests (struct xfs_mount *mp) { -return (mp->m_dirblksize -xfs_dir2_free_hdr_size ()) / +return (mp->m_dirblksize -sizeof (struct xfs_dir2_free_hdr )) /sizeof (xfs_dir2_data_off_t); }static __be16 *xfs_dir2_free_bests_p (struct xfs_dir2_free *free) { -return (__be16 *)((char *)free +xfs_dir2_free_hdr_size ()); +return (__be16 *)((char *)free +sizeof (struct xfs_dir2_free_hdr )); }/*
@@ -608,22 +543,16 @@ }static int -xfs_dir3_free_hdr_size (void ) -{ -return sizeof (struct xfs_dir3_free_hdr ); -} - -static int xfs_dir3_free_max_bests (struct xfs_mount *mp) { -return (mp->m_dirblksize -xfs_dir3_free_hdr_size ()) / +return (mp->m_dirblksize -sizeof (struct xfs_dir3_free_hdr )) /sizeof (xfs_dir2_data_off_t); }static __be16 *xfs_dir3_free_bests_p (struct xfs_dir2_free *free) { -return (__be16 *)((char *)free +xfs_dir3_free_hdr_size ()); +return (__be16 *)((char *)free +sizeof (struct xfs_dir3_free_hdr )); }/*
@@ -729,18 +661,18 @@ .data_entry_p = xfs_dir2_data_entry_p, .data_unused_p = xfs_dir2_data_unused_p, - .leaf_hdr_size = xfs_dir2_leaf_hdr_size, + .leaf_hdr_size = sizeof(struct xfs_dir2_leaf_hdr), .leaf_hdr_to_disk = xfs_dir2_leaf_hdr_to_disk, .leaf_hdr_from_disk = xfs_dir2_leaf_hdr_from_disk, .leaf_max_ents = xfs_dir2_max_leaf_ents, .leaf_ents_p = xfs_dir2_leaf_ents_p, - .node_hdr_size = xfs_da2_node_hdr_size, + .node_hdr_size = sizeof(struct xfs_da_node_hdr), .node_hdr_to_disk = xfs_da2_node_hdr_to_disk, .node_hdr_from_disk = xfs_da2_node_hdr_from_disk, .node_tree_p = xfs_da2_node_tree_p, - .free_hdr_size = xfs_dir2_free_hdr_size, + .free_hdr_size = sizeof(struct xfs_dir2_free_hdr), .free_hdr_to_disk = xfs_dir2_free_hdr_to_disk, .free_hdr_from_disk = xfs_dir2_free_hdr_from_disk, .free_max_bests = xfs_dir2_free_max_bests,
@@ -779,18 +714,18 @@ .data_entry_p = xfs_dir2_data_entry_p, .data_unused_p = xfs_dir2_data_unused_p, - .leaf_hdr_size = xfs_dir2_leaf_hdr_size, + .leaf_hdr_size = sizeof(struct xfs_dir2_leaf_hdr), .leaf_hdr_to_disk = xfs_dir2_leaf_hdr_to_disk, .leaf_hdr_from_disk = xfs_dir2_leaf_hdr_from_disk, .leaf_max_ents = xfs_dir2_max_leaf_ents, .leaf_ents_p = xfs_dir2_leaf_ents_p, - .node_hdr_size = xfs_da2_node_hdr_size, + .node_hdr_size = sizeof(struct xfs_da_node_hdr), .node_hdr_to_disk = xfs_da2_node_hdr_to_disk, .node_hdr_from_disk = xfs_da2_node_hdr_from_disk, .node_tree_p = xfs_da2_node_tree_p, - .free_hdr_size = xfs_dir2_free_hdr_size, + .free_hdr_size = sizeof(struct xfs_dir2_free_hdr), .free_hdr_to_disk = xfs_dir2_free_hdr_to_disk, .free_hdr_from_disk = xfs_dir2_free_hdr_from_disk, .free_max_bests = xfs_dir2_free_max_bests,
@@ -829,35 +767,35 @@ .data_entry_p = xfs_dir3_data_entry_p, .data_unused_p = xfs_dir3_data_unused_p, - .leaf_hdr_size = xfs_dir3_leaf_hdr_size, + .leaf_hdr_size = sizeof(struct xfs_dir3_leaf_hdr), .leaf_hdr_to_disk = xfs_dir3_leaf_hdr_to_disk, .leaf_hdr_from_disk = xfs_dir3_leaf_hdr_from_disk, .leaf_max_ents = xfs_dir3_max_leaf_ents, .leaf_ents_p = xfs_dir3_leaf_ents_p, - .node_hdr_size = xfs_da3_node_hdr_size, + .node_hdr_size = sizeof(struct xfs_da3_node_hdr), .node_hdr_to_disk = xfs_da3_node_hdr_to_disk, .node_hdr_from_disk = xfs_da3_node_hdr_from_disk, .node_tree_p = xfs_da3_node_tree_p, - .free_hdr_size = xfs_dir3_free_hdr_size, + .free_hdr_size = sizeof(struct xfs_dir3_free_hdr), .free_hdr_to_disk = xfs_dir3_free_hdr_to_disk, .free_hdr_from_disk = xfs_dir3_free_hdr_from_disk, - .free_max_bests = xfs_dir2_free_max_bests, + .free_max_bests = xfs_dir3_free_max_bests, .free_bests_p = xfs_dir3_free_bests_p, .db_to_fdb = xfs_dir3_db_to_fdb, .db_to_fdindex = xfs_dir3_db_to_fdindex, };const struct xfs_dir_ops xfs_dir2_nondir_ops = { - .node_hdr_size = xfs_da2_node_hdr_size, + .node_hdr_size =sizeof (struct xfs_da_node_hdr ), .node_hdr_to_disk = xfs_da2_node_hdr_to_disk, .node_hdr_from_disk = xfs_da2_node_hdr_from_disk, .node_tree_p = xfs_da2_node_tree_p, };const struct xfs_dir_ops xfs_dir3_nondir_ops = { - .node_hdr_size = xfs_da3_node_hdr_size, + .node_hdr_size =sizeof (struct xfs_da3_node_hdr ), .node_hdr_to_disk = xfs_da3_node_hdr_to_disk, .node_hdr_from_disk = xfs_da3_node_hdr_from_disk, .node_tree_p = xfs_da3_node_tree_p,
xfs/xfs_dir2.h +1 -1
@@ -92,7 +92,7 @@struct xfs_da_node_entry * (*node_tree_p)(struct xfs_da_intnode *dap); -int (*free_hdr_size)(void ); +int free_hdr_size;void (*free_hdr_to_disk)(struct xfs_dir2_free *to,struct xfs_dir3_icfree_hdr *from); void (*free_hdr_from_disk)(struct xfs_dir3_icfree_hdr *to,
xfs/xfs_dir2_node.c +1 -1
@@ -274,7 +274,7 @@ASSERT (free->hdr.magic ==cpu_to_be32 (XFS_DIR2_FREE_MAGIC ) || free->hdr.magic ==cpu_to_be32 (XFS_DIR3_FREE_MAGIC ));#endif -xfs_trans_log_buf (tp, bp,0 , dp->d_ops->free_hdr_size () -1 ); +xfs_trans_log_buf (tp, bp,0 , dp->d_ops->free_hdr_size -1 ); }/*
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 19/19] xfs: convert directory vector functions to constants
Quoted 63 lines · Ben Myers
Quoted 62 lines · Ben Myers
Quoted 22 lines · Dave Chinner
Quoted 21 lines · Ben Myers
Quoted 20 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Many of the vectorised function calls now take no parameters and return a constant value. There is no reason for these to be vectored functions, so convert them to constants
Binary sizes:
text data bss dec hex filename
794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2 789293 96802 1096 887191 d8997 fs/xfs/xfs.o.p3 789005 96802 1096 886903 d8997 fs/xfs/xfs.o.p4 789061 96802 1096 886959 d88af fs/xfs/xfs.o.p5 789733 96802 1096 887631 d8b4f fs/xfs/xfs.o.p6 791421 96802 1096 889319 d91e7 fs/xfs/xfs.o.p7 791701 96802 1096 889599 d92ff fs/xfs/xfs.o.p8 791205 96802 1096 889103 d91cf fs/xfs/xfs.o.p9Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Dave Chinner <[email protected]>Hmmm. This one doesn't seem to apply. Maybe it's just me.
Applies without mismatch here on an 3.12-rc5 + oss-xfs/master tree here. What's the reject that you get?
Like so:
$ q pu Applying patch xfs-convert-directory-vector-functions-to-constants.patch patching file fs/xfs/xfs_da_btree.c patching file fs/xfs/xfs_da_format.c Hunk #13 FAILED at 571. Hunk #14 FAILED at 608. Hunk #15 succeeded at 641 (offset -74 lines). Hunk #16 FAILED at 729. Hunk #17 succeeded at 683 (offset -82 lines). Hunk #18 FAILED at 779. Hunk #19 succeeded at 728 (offset -87 lines). Hunk #20 FAILED at 829. 5 out of 20 hunks FAILED -- rejects in file fs/xfs/xfs_da_format.c patching file fs/xfs/xfs_dir2.c patching file fs/xfs/xfs_dir2.h Hunk #4 FAILED at 92. 1 out of 4 hunks FAILED -- rejects in file fs/xfs/xfs_dir2.h patching file fs/xfs/xfs_dir2_block.c patching file fs/xfs/xfs_dir2_data.c patching file fs/xfs/xfs_dir2_leaf.c patching file fs/xfs/xfs_dir2_node.c Hunk #1 FAILED at 274. Hunk #2 succeeded at 1267 (offset -1 lines). Hunk #3 succeeded at 1299 (offset -1 lines). Hunk #4 succeeded at 1408 (offset -1 lines). 1 out of 4 hunks FAILED -- rejects in file fs/xfs/xfs_dir2_node.c patching file fs/xfs/xfs_dir2_readdir.c patching file fs/xfs/xfs_dir2_sf.c Patch xfs-convert-directory-vector-functions-to-constants.patch does not apply (enforce with -f)
Quoted 3 lines
Quoted 1 line
That's on
74564fb48.To be more specific, these are the rejects. Maybe I missed a patch.
Looks like you might be missing patch 18 as all the rejects are against hunks introduced by that patch.
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 03/19] xfs: prevent deadlock trying to cover an active log
In reply to Dave ChinnerQuoted 66 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Recent analysis of a deadlocked XFS filesystem from a kernel crash dump indicated that the filesystem was stuck waiting for log space. The short story of the hang on the RHEL6 kernel is this:
- the tail of the log is pinned by an inode
- the inode has been pushed by the xfsaild
- the inode has been flushed to it's backing buffer and is currently flush locked and hence waiting for backing buffer IO to complete and remove it from the AIL
- the backing buffer is marked for write - it is on the delayed write queue
- the inode buffer has been modified directly and logged recently due to unlinked inode list modification
- the backing buffer is pinned in memory as it is in the active CIL context.
- the xfsbufd won't start buffer writeback because it is pinned
- xfssyncd won't force the log because it sees the log as needing to be covered and hence wants to issue a dummy transaction to move the log covering state machine along.Hence there is no trigger to force the CIL to the log and hence unpin the inode buffer and therefore complete the inode IO, remove it from the AIL and hence move the tail of the log along, allowing transactions to start again.
Mainline kernels also have the same deadlock, though the signature is slightly different - the inode buffer never reaches the delayed write lists because
xfs_buf_item_push()sees that it is pinned and hence never adds it to the delayed write list that the xfsaild flushes.There are two possible solutions here. The first is to simply force the log before trying to cover the log and so ensure that the CIL is emptied before we try to reserve space for the dummy transaction in the
xfs_log_worker(). While this might work most of the time, it is still racy and is no guarantee that we don't get stuck inxfs_trans_reservewaiting for log space to come free. Hence it's not the best way to solve the problem.The second solution is to modify
xfs_log_need_covered()to be aware of the CIL. We only should be attempting to cover the log if there is no current activity in the log - covering the log is the process of ensuring that the head and tail in the log on disk are identical (i.e. the log is clean and at idle). Hence, by definition, if there are items in the CIL then the log is not at idle and so we don't need to attempt to cover it.When we don't need to cover the log because it is active or idle, we issue a log force from
xfs_log_worker()- if the log is idle, then this does nothing. However, if the log is active due to there being items in the CIL, it will force the items in the CIL to the log and unpin them.In the case of the above deadlock scenario, instead of
xfs_log_worker()getting stuck inxfs_trans_reserve()attempting to cover the log, it will instead force the log, thereby unpinning the inode buffer, allowing IO to be issued and complete and hence removing the inode that was pinning the tail of the log from the AIL. At that point, everything will start moving along again. i.e. thexfs_log_workerturns back into a watchdog that can alleviate deadlocks based around pinned items that prevent the tail of the log from being moved...
Quoted 1 line
Signed-off-by Dave Chinner <[email protected]>
Quoted 119 lines
--- fs/xfs/xfs_log.c | 48 +++++++++++++++++++++++++++++------------------- fs/xfs/xfs_log_cil.c | 14 ++++++++++++++ fs/xfs/xfs_log_priv.h | 10 ++++------ 3 files changed, 47 insertions(+), 25 deletions(-)fs/xfs/xfs_log.c +29
-19@@ -1000,27 +1000,34 @@ xfs_log_space_wake( }/* -* Determine if we have a transaction that has gone to disk -* that needs to be covered. To begin the transition to the idle state -* firstly the log needs to be idle (no AIL and nothing in the iclogs). -* If we are then in a state where covering is needed, the caller is informed -* that dummy transactions are required to move the log into the idle state. +* Determine if we have a transaction that has gone to disk that needs to be +* covered. To begin the transition to the idle state firstly the log needs to +* be idle. That means the CIL, the AIL and the iclogs needs to be empty before +* we start attempting to cover the log. * -* Because this is called as part of the sync process, we should also indicate -* that dummy transactions should be issued in anything but the covered or -* idle states. This ensures that the log tail is accurately reflected in -* the log at the end of the sync, hence if a crash occurrs avoids replay -* of transactions where the metadata is already on disk. +* Only if we are then in a state where covering is needed, the caller is +* informed that dummy transactions are required to move the log into the idle +* state. +* +* If there are any items in the AIl or CIL, then we do not want to attempt to +* cover the log as we may be in a situation where there isn't log space +* available to run a dummy transaction and this can lead to deadlocks when the +* tail of the log is pinned by an item that is modified in the CIL. Hence +* there's no point in running a dummy transaction at this point because we +* can't start trying to idle the log until both the CIL and AIL are empty. */ int xfs_log_need_covered (xfs_mount_t *mp) { -int needed =0 ;struct xlog *log = mp->m_log; +int needed =0 ;if (!xfs_fs_writable (mp))return 0 ; +if (!xlog_cil_empty (log)) +return 0 ; +spin_lock (&log->l_icloglock);switch (log->l_covered_state) {case XLOG_STATE_COVER_DONE :@@ -1029,14 +1036,17 @@ xfs_log_need_covered(xfs_mount_t *mp)break ;case XLOG_STATE_COVER_NEED :case XLOG_STATE_COVER_NEED2 : -if (!xfs_ail_min_lsn (log->l_ailp) && -xlog_iclogs_empty (log)) { -if (log->l_covered_state ==XLOG_STATE_COVER_NEED ) - log->l_covered_state =XLOG_STATE_COVER_DONE ; -else - log->l_covered_state =XLOG_STATE_COVER_DONE2 ; - } -/* FALLTHRU */ +if (xfs_ail_min_lsn (log->l_ailp)) +break ; +if (!xlog_iclogs_empty (log)) +break ; + + needed =1 ; +if (log->l_covered_state ==XLOG_STATE_COVER_NEED ) + log->l_covered_state =XLOG_STATE_COVER_DONE ; +else + log->l_covered_state =XLOG_STATE_COVER_DONE2 ; +break ;default : needed =1 ;break ;fs/xfs/xfs_log_cil.c +14
-0@@ -711,6 +711,20 @@ xlog_cil_push_foreground(xlog_cil_push (log); } +bool +xlog_cil_empty ( +struct xlog *log) +{ +struct xfs_cil *cil = log->l_cilp; +bool empty = false; + +spin_lock (&cil->xc_push_lock); +if (list_empty (&cil->xc_cil)) + empty = true; +spin_unlock (&cil->xc_push_lock); +return empty; +} +/* * Commit a transaction with the given vector to the Committed Item List. * fs/xfs/xfs_log_priv.h +0
-3@@ -514,12 +514,10 @@ xlog_assign_grant_head(atomic64_t *head, int cycle, int space)/* * Committed Item List interfaces */ -int -xlog_cil_init (struct xlog *log); -void
fs/xfs/xfs_log_priv.h xlog_assign_grant_head(atomic64_t *head, int cycle, int space) · line 523
Quoted 10 lines
fs/xfs/xfs_log_priv.h +4
-3-xlog_cil_init_post_recovery(struct xlog *log); -void -xlog_cil_destroy (struct xlog *log); +int xlog_cil_init (struct xlog *log); +void xlog_cil_init_post_recovery (struct xlog *log); +void xlog_cil_destroy (struct xlog *log); +bool xlog_cil_empty (struct xlog *log);/* * CIL force routines
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Ben Myers
AppliedRe: [PATCH 03/19] xfs: prevent deadlock trying to cover an active log
Quoted 67 lines · Eric Sandeen
Quoted 66 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Recent analysis of a deadlocked XFS filesystem from a kernel crash dump indicated that the filesystem was stuck waiting for log space. The short story of the hang on the RHEL6 kernel is this:
- the tail of the log is pinned by an inode
- the inode has been pushed by the xfsaild
- the inode has been flushed to it's backing buffer and is currently flush locked and hence waiting for backing buffer IO to complete and remove it from the AIL
- the backing buffer is marked for write - it is on the delayed write queue
- the inode buffer has been modified directly and logged recently due to unlinked inode list modification
- the backing buffer is pinned in memory as it is in the active CIL context.
- the xfsbufd won't start buffer writeback because it is pinned
- xfssyncd won't force the log because it sees the log as needing to be covered and hence wants to issue a dummy transaction to move the log covering state machine along.Hence there is no trigger to force the CIL to the log and hence unpin the inode buffer and therefore complete the inode IO, remove it from the AIL and hence move the tail of the log along, allowing transactions to start again.
Mainline kernels also have the same deadlock, though the signature is slightly different - the inode buffer never reaches the delayed write lists because
xfs_buf_item_push()sees that it is pinned and hence never adds it to the delayed write list that the xfsaild flushes.There are two possible solutions here. The first is to simply force the log before trying to cover the log and so ensure that the CIL is emptied before we try to reserve space for the dummy transaction in the
xfs_log_worker(). While this might work most of the time, it is still racy and is no guarantee that we don't get stuck inxfs_trans_reservewaiting for log space to come free. Hence it's not the best way to solve the problem.The second solution is to modify
xfs_log_need_covered()to be aware of the CIL. We only should be attempting to cover the log if there is no current activity in the log - covering the log is the process of ensuring that the head and tail in the log on disk are identical (i.e. the log is clean and at idle). Hence, by definition, if there are items in the CIL then the log is not at idle and so we don't need to attempt to cover it.When we don't need to cover the log because it is active or idle, we issue a log force from
xfs_log_worker()- if the log is idle, then this does nothing. However, if the log is active due to there being items in the CIL, it will force the items in the CIL to the log and unpin them.In the case of the above deadlock scenario, instead of
xfs_log_worker()getting stuck inxfs_trans_reserve()attempting to cover the log, it will instead force the log, thereby unpinning the inode buffer, allowing IO to be issued and complete and hence removing the inode that was pinning the tail of the log from the AIL. At that point, everything will start moving along again. i.e. thexfs_log_workerturns back into a watchdog that can alleviate deadlocks based around pinned items that prevent the tail of the log from being moved...
Quoted 3 lines
Quoted 1 line
Signed-off-by Dave Chinner <[email protected]>Reviewed-by Eric Sandeen <[email protected]>
Applied.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 15/19 xfs: vectorise directory leaf operations
In reply to Dave Chinnerxfs: vectorise directory leaf operations
From: Dave Chinner <[email protected]>
Next step in the vectorisation process is the leaf block encode/decode operations. Most of the operations on leaves are handled by the data block vectors, so there are relatively few of them here.
Because of all the shuffling of code and having to pass more state to some functions, this patch doesn't directly reduce the size of the binary. It does open up many more opportunities for factoring and optimisation, however.
text data bss dec hex filename
794490 96802 1096 892388 d9de4 fs/xfs/xfs.o.orig 792986 96802 1096 890884 d9804 fs/xfs/xfs.o.p1 792350 96802 1096 890248 d9588 fs/xfs/xfs.o.p2 789293 96802 1096 887191 d8997 fs/xfs/xfs.o.p3 789005 96802 1096 886903 d8997 fs/xfs/xfs.o.p4 789061 96802 1096 886959 d88af fs/xfs/xfs.o.p5
---
v2: rebase to fix rejected hunk due to "\n" removal from a log message in a conflicting hunk in xfs_dir2_leafn_rebalance() from 08e96e1 ("xfs: remove newlines from strings passed to __xfs_printk")
fs/xfs/xfs_da_btree.c | 19 ++++---- fs/xfs/xfs_da_format.c | 75 +++++++++++++++++++++++++++++++ fs/xfs/xfs_da_format.h | 30 ------------- fs/xfs/xfs_dir2.c | 7 +-- fs/xfs/xfs_dir2.h | 10 +++-- fs/xfs/xfs_dir2_block.c | 2 +- fs/xfs/xfs_dir2_data.c | 13 ++---- fs/xfs/xfs_dir2_leaf.c | 91 ++++++++++++++++++++----------------- fs/xfs/xfs_dir2_node.c | 117 ++++++++++++++++++++++++++---------------------- fs/xfs/xfs_dir2_priv.h | 13 +++--- 10 files changed, 218 insertions(+), 159 deletions(-)
fs/xfs/xfs_da_btree.c +10 -9
@@ -605,7 +605,7 @@ xfs_da3_root_split( leaf = (xfs_dir2_leaf_t *)oldroot;xfs_dir3_leaf_hdr_from_disk (&leafhdr, leaf); - ents =xfs_dir3_leaf_ents_p (leaf); + ents = dp->d_ops->leaf_ents_p (leaf);ASSERT (leafhdr.magic ==XFS_DIR2_LEAFN_MAGIC || leafhdr.magic ==XFS_DIR3_LEAFN_MAGIC );
@@ -1319,7 +1319,8 @@ xfs_da3_fixhashpath(return ;break ;case XFS_DIR2_LEAFN_MAGIC : - lasthash =xfs_dir2_leafn_lasthash (blk->bp, &count); + lasthash =xfs_dir2_leafn_lasthash (state->args->dp, + blk->bp, &count);if (count ==0 )return ;break ;
@@ -1536,7 +1537,8 @@ xfs_da3_node_lookup_int(if (blk->magic ==XFS_DIR2_LEAFN_MAGIC || blk->magic ==XFS_DIR3_LEAFN_MAGIC ) { blk->magic =XFS_DIR2_LEAFN_MAGIC ; - blk->hashval =xfs_dir2_leafn_lasthash (blk->bp,NULL ); + blk->hashval =xfs_dir2_leafn_lasthash (args->dp, + blk->bp,NULL );break ; }
@@ -1702,7 +1704,7 @@ xfs_da3_blk_link( before =xfs_attr_leaf_order (old_blk->bp, new_blk->bp);break ;case XFS_DIR2_LEAFN_MAGIC : - before =xfs_dir2_leafn_order (old_blk->bp, new_blk->bp); + before =xfs_dir2_leafn_order (args->dp, old_blk->bp, new_blk->bp);break ;case XFS_DA_NODE_MAGIC : before =xfs_da3_node_order (old_blk->bp, new_blk->bp);
@@ -1947,16 +1949,15 @@ xfs_da3_path_shift( blk->magic =XFS_ATTR_LEAF_MAGIC ;ASSERT (level == path->active-1 ); blk->index =0 ; - blk->hashval =xfs_attr_leaf_lasthash (blk->bp, -NULL ); + blk->hashval =xfs_attr_leaf_lasthash (blk->bp,NULL );break ;case XFS_DIR2_LEAFN_MAGIC :case XFS_DIR3_LEAFN_MAGIC : blk->magic =XFS_DIR2_LEAFN_MAGIC ;ASSERT (level == path->active-1 ); blk->index =0 ; - blk->hashval =xfs_dir2_leafn_lasthash (blk->bp, -NULL ); + blk->hashval =xfs_dir2_leafn_lasthash (args->dp, + blk->bp,NULL );break ;default :ASSERT (0 );
@@ -2223,7 +2224,7 @@ xfs_da3_swap_lastblock( dead_leaf2 = (xfs_dir2_leaf_t *)dead_info;xfs_dir3_leaf_hdr_from_disk (&leafhdr, dead_leaf2); - ents =xfs_dir3_leaf_ents_p (dead_leaf2); + ents = ip->d_ops->leaf_ents_p (dead_leaf2); dead_level =0 ; dead_hash =be32_to_cpu (ents[leafhdr.count -1 ].hashval); }else {
fs/xfs/xfs_da_format.c +75 -0
97 lines not on this page · raw message
fs/xfs/xfs_da_format.h +0 -30
@@ -551,36 +551,6 @@ struct xfs_dir3_leaf {extern void xfs_dir3_leaf_hdr_from_disk (struct xfs_dir3_icleaf_hdr *to,struct xfs_dir2_leaf *from); -static inline int -xfs_dir3_leaf_hdr_size (struct xfs_dir2_leaf *lp) -{ -if (lp->hdr.info.magic ==cpu_to_be16 (XFS_DIR3_LEAF1_MAGIC ) || - lp->hdr.info.magic ==cpu_to_be16 (XFS_DIR3_LEAFN_MAGIC )) -return sizeof (struct xfs_dir3_leaf_hdr ); -return sizeof (struct xfs_dir2_leaf_hdr ); -} - -static inline int -xfs_dir3_max_leaf_ents (struct xfs_mount *mp,struct xfs_dir2_leaf *lp) -{ -return (mp->m_dirblksize -xfs_dir3_leaf_hdr_size (lp)) / - (uint )sizeof (struct xfs_dir2_leaf_entry ); -} - -/* -* Get address of the bestcount field in the single-leaf block. -*/ -static inline struct xfs_dir2_leaf_entry * -xfs_dir3_leaf_ents_p (struct xfs_dir2_leaf *lp) -{ -if (lp->hdr.info.magic ==cpu_to_be16 (XFS_DIR3_LEAF1_MAGIC ) || - lp->hdr.info.magic ==cpu_to_be16 (XFS_DIR3_LEAFN_MAGIC )) { -struct xfs_dir3_leaf *lp3 = (struct xfs_dir3_leaf *)lp; -return lp3->__ents; - } -return lp->__ents; -} -/* * Get address of the bestcount field in the single-leaf block. */
fs/xfs/xfs_dir2.c +1 -6
@@ -113,12 +113,7 @@ xfs_dir_mount(else mp->m_dirnameops = &xfs_default_nameops; -if (xfs_sb_version_hascrc (&mp->m_sb)) - mp->m_dir_inode_ops = &xfs_dir3_ops; -else if (xfs_sb_version_hasftype (&mp->m_sb)) - mp->m_dir_inode_ops = &xfs_dir2_ftype_ops; -else - mp->m_dir_inode_ops = &xfs_dir2_ops; + mp->m_dir_inode_ops =xfs_dir_get_ops (mp,NULL ); }/*
fs/xfs/xfs_dir2.h +7 -3
@@ -74,11 +74,15 @@ struct xfs_dir_ops { (*data_entry_p)(struct xfs_dir2_data_hdr *hdr);struct xfs_dir2_data_unused * (*data_unused_p)(struct xfs_dir2_data_hdr *hdr); + +int (*leaf_hdr_size)(void ); +int (*leaf_max_ents)(struct xfs_mount *mp); +struct xfs_dir2_leaf_entry * + (*leaf_ents_p)(struct xfs_dir2_leaf *lp); }; -extern const struct xfs_dir_ops xfs_dir2_ops; -extern const struct xfs_dir_ops xfs_dir2_ftype_ops; -extern const struct xfs_dir_ops xfs_dir3_ops; +extern const struct xfs_dir_ops * +xfs_dir_get_ops (struct xfs_mount *mp,struct xfs_inode *dp);/* * Generic directory interface routines
fs/xfs/xfs_dir2_block.c +1 -1
@@ -937,7 +937,7 @@ xfs_dir2_leaf_to_block( mp = dp->i_mount; leaf = lbp->b_addr;xfs_dir3_leaf_hdr_from_disk (&leafhdr, leaf); - ents =xfs_dir3_leaf_ents_p (leaf); + ents = dp->d_ops->leaf_ents_p (leaf); ltp =xfs_dir2_leaf_tail_p (mp, leaf); ASSERT(leafhdr.magic == XFS_DIR2_LEAF1_MAGIC ||
fs/xfs/xfs_dir2_data.c +3 -10
@@ -68,17 +68,10 @@ __xfs_dir3_data_check( hdr = bp->b_addr;/* -* we can be passed a null dp here froma verifier, so manually configure -* the ops here in that case. +* we can be passed a null dp here from a verifier, so we need to go the +* hard way to get them. */ -if (dp) - ops = dp->d_ops; -else if (xfs_sb_version_hascrc (&mp->m_sb)) - ops = &xfs_dir3_ops; -else if (xfs_sb_version_hasftype (&mp->m_sb)) - ops = &xfs_dir2_ftype_ops; -else - ops = &xfs_dir2_ops; + ops =xfs_dir_get_ops (mp, dp);switch (hdr->magic) {case cpu_to_be32 (XFS_DIR3_BLOCK_MAGIC ):
fs/xfs/xfs_dir2_leaf.c +51 -40
280 lines not on this page · raw message
fs/xfs/xfs_dir2_node.c +63 -54
347 lines not on this page · raw message
fs/xfs/xfs_dir2_priv.h +7 -6
@@ -77,9 +77,9 @@ extern void xfs_dir3_leaf_compact_x1(struct xfs_dir3_icleaf_hdr *leafhdr, int *lowstalep, int *highstalep, int *lowlogp, int *highlogp);extern int xfs_dir3_leaf_get_buf (struct xfs_da_args *args,xfs_dir2_db_t bno,struct xfs_buf **bpp,__uint16_t magic); -extern void xfs_dir3_leaf_log_ents (struct xfs_trans *tp,struct xfs_buf *bp, -int first,int last); -extern void xfs_dir3_leaf_log_header (struct xfs_trans *tp, +extern void xfs_dir3_leaf_log_ents (struct xfs_trans *tp,struct xfs_inode *dp, +struct xfs_buf *bp,int first,int last); +extern void xfs_dir3_leaf_log_header (struct xfs_trans *tp,struct xfs_inode *dp,struct xfs_buf *bp);extern int xfs_dir2_leaf_lookup (struct xfs_da_args *args);extern int xfs_dir2_leaf_removename (struct xfs_da_args *args);
@@ -98,17 +98,18 @@ extern void xfs_dir3_leaf_hdr_from_disk(struct xfs_dir3_icleaf_hdr *to, struct xfs_dir2_leaf *from);extern void xfs_dir3_leaf_hdr_to_disk (struct xfs_dir2_leaf *to,struct xfs_dir3_icleaf_hdr *from); -extern bool xfs_dir3_leaf_check_int (struct xfs_mount *mp, +extern bool xfs_dir3_leaf_check_int (struct xfs_mount *mp,struct xfs_inode *dp,struct xfs_dir3_icleaf_hdr *hdr,struct xfs_dir2_leaf *leaf);/* xfs_dir2_node.c */ extern int xfs_dir2_leaf_to_node (struct xfs_da_args *args,struct xfs_buf *lbp); -extern xfs_dahash_t xfs_dir2_leafn_lasthash (struct xfs_buf *bp,int *count); +extern xfs_dahash_t xfs_dir2_leafn_lasthash (struct xfs_inode *dp, +struct xfs_buf *bp,int *count);extern int xfs_dir2_leafn_lookup_int (struct xfs_buf *bp,struct xfs_da_args *args,int *indexp,struct xfs_da_state *state); -extern int xfs_dir2_leafn_order (struct xfs_buf *leaf1_bp, +extern int xfs_dir2_leafn_order (struct xfs_inode *dp,struct xfs_buf *leaf1_bp,struct xfs_buf *leaf2_bp);extern int xfs_dir2_leafn_split (struct xfs_da_state *state,struct xfs_da_state_blk *oldblk,struct xfs_da_state_blk *newblk);
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 05/19] xfs: unify directory/attribute format definitions
In reply to Dave ChinnerQuoted 10 lines · Dave Chinner
From: Dave Chinner <[email protected]>
The on-disk format definitions for the directory and attribute structures are spread across 3 header files right now, only one of which is dedicated to defining on-disk structures and their manipulation (
xfs_dir2_format.h). Pull all the format definitions into a single header file -xfs_da_format.h- and switch all the code over to point at that.Signed-off-by Dave Chinner <[email protected]>
IIRC Christoph had some concerns with this one, but it wasn't very clear exactly what they were. This looks ok to me. Christoph did you have anything more to add?
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 05/19] xfs: unify directory/attribute format definitions
Quoted 10 lines · Ben Myers
Quoted 9 lines · Dave Chinner
From: Dave Chinner <[email protected]>
The on-disk format definitions for the directory and attribute structures are spread across 3 header files right now, only one of which is dedicated to defining on-disk structures and their manipulation (
xfs_dir2_format.h). Pull all the format definitions into a single header file -xfs_da_format.h- and switch all the code over to point at that.
Quoted 5 lines
Quoted 1 line
Signed-off-by Dave Chinner <[email protected]>IIRC Christoph had some concerns with this one, but it wasn't very clear exactly what they were. This looks ok to me. Christoph did you have anything more to add?
I pulled some of the btree specific definitions back into xfs_btree.h (key, ptr unions), but I left the bmbt_rec-host definitions in the header as I haven't worked out exactly how to relocate them without introducing new dependencies everywhere. Hence I've cleaned up most of what Christoph asked for, but I'm leaving the hard part for a separate patch(set) where it will be (hopefully) much clearer what is being moved and what dependencies it reintroduces.
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 07/19] xfs: remove unused transaction callback variables
In reply to Dave ChinnerQuoted 3 lines · Dave Chinner
From: Dave Chinner <[email protected]>
We don't do callbacks at transaction commit time, no do we have any
nor
Quoted 5 lines
infrastructure to set up or run such callbacks, so remove the variables and typedefs for these operations. If we ever need to add callbacks, we can reintroduce the variables at that time.
Signed-off-by Dave Chinner <[email protected]>
Looks fine.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 05/19] xfs: unify directory/attribute format definitions
In reply to Dave ChinnerQuoted 8 lines · Dave Chinner
I pulled some of the btree specific definitions back into
xfs_btree.h(key, ptr unions), but I left the bmbt_rec-host definitions in the header as I haven't worked out exactly how to relocate them without introducing new dependencies everywhere. Hence I've cleaned up most of what Christoph asked for, but I'm leaving the hard part for a separate patch(set) where it will be (hopefully) much clearer what is being moved and what dependencies it reintroduces.
Yes, please go ahead with merging it for now, we can sort out any minor issues later.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 08/19] xfs: decouple log and transaction headers
In reply to Dave ChinnerQuoted 13 lines · Dave Chinner
From: Dave Chinner <[email protected]>
xfs_trans.hhas a dependency onxfs_log.hfor a couple of structures. Most code that does transactions doesn't need to know anything about the log, bu this dependency means that they have to includexfs_log.h. Decouple thexfs_trans.handxfs_log.hheader files and clean up the includes to be in dependency order.In doing this, remove the direct include of
xfs_trans_reserve.hfromxfs_trans.hso that we remove the dependency betweenxfs_trans.handxfs_mount.h. Hence thexfs_trans.hinclude can be moved to the indicate the actual dependencies oher header files have on it.
Quoted 4 lines
Note that these are kernel only header files, so this does not translate to any userspace changes at all.
Signed-off-by Dave Chinner <[email protected]>
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 09/19] xfs: decouple inode and bmap btree header files
In reply to Dave ChinnerQuoted 12 lines · Dave Chinner
From: Dave Chinner <[email protected]>
Currently the
xfs_inode.hheader has a dependency on the definition of the BMAP btree records as the inode fork includes an array ofxfs_bmbt_rec_host_tobjects in it's definition.Move all the btree format definitions from
xfs_btree.h,xfs_bmap_btree.h,xfs_alloc_btree.handxfs_ialloc_btree.htoxfs_format.hto continue the process of centralising the on-disk format definitions. With this done, the xfs inode definitions are no longer dependent on btree header files.
Quoted 4 lines
The enables a massive culling of unnecessary includes, with close to 200 #include directives removed from the XFS kernel code base.
Signed-off-by Dave Chinner <[email protected]>
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 04/19] xfs: create a shared header file for format-related information
In reply to Dave ChinnerQuoted 6 lines · Dave Chinner
All of the buffer operations structures are needed to be exported for
xfs_db, so move them all to a common location rather than spreading them all over the place. They are verifying the on-disk format, so whilexfs_format.hmight be a good place, it is not part of the on disk format.
Quoted 8 lines
Hence we need to create a new header file that we centralise these related definitions. Start by moving the bffer operations structures, and then also move all the other definitions that have crept into
xfs_log_format.handxfs_format.has there was no other shared header file to put them in.Signed-off-by Dave Chinner <[email protected]>Reviewed-by Christoph Hellwig <[email protected]>
/root/xfs/fs/xfs/xfs_file.c/root/xfs/fs/xfs/xfs_file.c: In function ‘xfs_file_fallocate’:/root/xfs/fs/xfs/xfs_file.c:844: error: ‘XFS_TRANS_WRITEID’ undeclared (first use in this function) /root/xfs/fs/xfs/xfs_file.c:844: error: (Each undeclared identifier is reported only once /root/xfs/fs/xfs/xfs_file.c:844: error: for each function it appears in.) /root/xfs/fs/xfs/xfs_file.c:860: error: ‘XFS_ICHGTIME_MOD’ undeclared (first use in this function) /root/xfs/fs/xfs/xfs_file.c:860: error: ‘XFS_ICHGTIME_CHG’ undeclared (first use in this function) /root/xfs/fs/xfs/xfs_file.c:864: error: ‘XFS_TRANS_SYNC’ undeclared (first use in this function) make[1]: *** [/root/xfs/fs/xfs/xfs_file.o] Error 1
Gah. Maybe due to pulling in Christoph's series. I'll look into it more tomorrow.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 4/19 xfs: create a shared header file for format-related information
From: Dave Chinner <[email protected]>
All of the buffer operations structures are needed to be exported for xfs_db, so move them all to a common location rather than spreading them all over the place. They are verifying the on-disk format, so while xfs_format.h might be a good place, it is not part of the on disk format.
Hence we need to create a new header file that we centralise these related definitions. Start by moving the bffer operations structures, and then also move all the other definitions that have crept into xfs_log_format.h and xfs_format.h as there was no other shared header file to put them in.
---
V2: fix compile error caused by Christoph's fallocate rework which changed the #include dependencies of fs/xfs/xfs_file.c.
fs/xfs/xfs_ag.h | 4 - fs/xfs/xfs_alloc.c | 3 +- fs/xfs/xfs_alloc.h | 3 - fs/xfs/xfs_alloc_btree.h | 2 - fs/xfs/xfs_aops.c | 4 +- fs/xfs/xfs_attr.c | 1 + fs/xfs/xfs_attr_inactive.c | 1 + fs/xfs/xfs_attr_leaf.h | 2 - fs/xfs/xfs_attr_remote.h | 2 - fs/xfs/xfs_bmap.c | 1 + fs/xfs/xfs_bmap_btree.h | 2 - fs/xfs/xfs_bmap_util.c | 1 + fs/xfs/xfs_btree.c | 2 +- fs/xfs/xfs_da_btree.c | 3 +- fs/xfs/xfs_da_btree.h | 2 - fs/xfs/xfs_dquot.c | 1 + fs/xfs/xfs_dquot.h | 2 - fs/xfs/xfs_extent_busy.c | 3 +- fs/xfs/xfs_file.c | 1 + fs/xfs/xfs_format.h | 10 -- fs/xfs/xfs_fsops.c | 2 + fs/xfs/xfs_ialloc.c | 3 +- fs/xfs/xfs_ialloc.h | 2 - fs/xfs/xfs_ialloc_btree.h | 2 - fs/xfs/xfs_icreate_item.c | 2 +- fs/xfs/xfs_inode.c | 1 + fs/xfs/xfs_inode_buf.c | 1 + fs/xfs/xfs_inode_buf.h | 3 - fs/xfs/xfs_ioctl.c | 1 + fs/xfs/xfs_iomap.c | 1 + fs/xfs/xfs_iops.c | 1 + fs/xfs/xfs_itable.c | 2 +- fs/xfs/xfs_log.c | 2 +- fs/xfs/xfs_log_cil.c | 2 +- fs/xfs/xfs_log_format.h | 177 -------------------------------- fs/xfs/xfs_log_recover.c | 1 + fs/xfs/xfs_log_rlimit.c | 1 + fs/xfs/xfs_mount.c | 1 + fs/xfs/xfs_qm.c | 1 + fs/xfs/xfs_qm_syscalls.c | 1 + fs/xfs/xfs_quota.h | 2 - fs/xfs/xfs_rtalloc.c | 1 + fs/xfs/xfs_sb.h | 3 - fs/xfs/xfs_shared.h | 244 ++++++++++++++++++++++++++++++++++++++++++++ fs/xfs/xfs_super.c | 1 + fs/xfs/xfs_symlink.c | 1 + fs/xfs/xfs_symlink_remote.c | 1 + fs/xfs/xfs_trace.c | 2 +- fs/xfs/xfs_trans.c | 1 + fs/xfs/xfs_trans_buf.c | 2 +- fs/xfs/xfs_trans_dquot.c | 1 + fs/xfs/xfs_trans_extfree.c | 2 +- fs/xfs/xfs_trans_inode.c | 2 +- fs/xfs/xfs_trans_resv.c | 1 + 54 files changed, 289 insertions(+), 232 deletions(-)
fs/xfs/xfs_ag.h +0 -4
@@ -128,8 +128,6 @@ typedef struct xfs_agf {extern int xfs_read_agf (struct xfs_mount *mp,struct xfs_trans *tp,xfs_agnumber_t agno,int flags,struct xfs_buf **bpp); -extern const struct xfs_buf_ops xfs_agf_buf_ops; -/* * Size of the unlinked inode hash table in the agi. */
@@ -191,8 +189,6 @@ typedef struct xfs_agi {extern int xfs_read_agi (struct xfs_mount *mp,struct xfs_trans *tp,xfs_agnumber_t agno,struct xfs_buf **bpp); -extern const struct xfs_buf_ops xfs_agi_buf_ops; -/* * The third a.g. block contains the a.g. freelist, an array * of block pointers to blocks owned by the allocation btree code.
fs/xfs/xfs_alloc.c +2 -1
@@ -17,7 +17,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_alloc.h +0 -3
@@ -231,7 +231,4 @@ xfs_alloc_get_rec( xfs_extlen_t *len,/* output: length of extent */ int *stat); /* output: success/failure */ -extern const struct xfs_buf_ops xfs_agf_buf_ops; -extern const struct xfs_buf_ops xfs_agfl_buf_ops; -#endif /* __XFS_ALLOC_H__ */
fs/xfs/xfs_alloc_btree.h +0 -2
@@ -95,6 +95,4 @@ extern struct xfs_btree_cur *xfs_allocbt_init_cursor(struct xfs_mount *, xfs_agnumber_t, xfs_btnum_t);extern int xfs_allocbt_maxrecs (struct xfs_mount *,int ,int ); -extern const struct xfs_buf_ops xfs_allocbt_buf_ops; -#endif /* __XFS_ALLOC_BTREE_H__ */
fs/xfs/xfs_aops.c +3 -1
@@ -16,9 +16,11 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" -#include "xfs_log.h" +#include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_sb.h" #include "xfs_ag.h" +#include "xfs_log.h" #include "xfs_trans.h" #include "xfs_mount.h" #include "xfs_bmap_btree.h"
fs/xfs/xfs_attr.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_attr_inactive.c +1 -0
@@ -19,6 +19,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_attr_leaf.h +0 -2
@@ -336,6 +336,4 @@ void xfs_attr3_leaf_hdr_from_disk(struct xfs_attr3_icleaf_hdr *to,void xfs_attr3_leaf_hdr_to_disk (struct xfs_attr_leafblock *to,struct xfs_attr3_icleaf_hdr *from); -extern const struct xfs_buf_ops xfs_attr3_leaf_buf_ops; -#endif /* __XFS_ATTR_LEAF_H__ */
fs/xfs/xfs_attr_remote.h +0 -2
@@ -45,8 +45,6 @@ struct xfs_attr3_rmt_hdr { ((bufsize) - (xfs_sb_version_hascrc (&(mp)->m_sb) ? \ sizeof(struct xfs_attr3_rmt_hdr) : 0)) -extern const struct xfs_buf_ops xfs_attr3_rmt_buf_ops; -int xfs_attr3_rmt_blocks (struct xfs_mount *mp,int attrlen);int xfs_attr_rmtval_get (struct xfs_da_args *args);
fs/xfs/xfs_bmap.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_inum.h"
fs/xfs/xfs_bmap_btree.h +0 -2
@@ -243,6 +243,4 @@ extern int xfs_bmbt_change_owner(struct xfs_trans *tp, struct xfs_inode *ip,extern struct xfs_btree_cur *xfs_bmbt_init_cursor (struct xfs_mount *,struct xfs_trans *,struct xfs_inode *,int ); -extern const struct xfs_buf_ops xfs_bmbt_buf_ops; -#endif /* __XFS_BMAP_BTREE_H__ */
fs/xfs/xfs_bmap_util.c +1 -0
@@ -19,6 +19,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_inum.h"
fs/xfs/xfs_btree.c +1 -1
@@ -17,7 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_da_btree.c +2 -1
@@ -18,7 +18,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_da_btree.h +0 -2
@@ -309,8 +309,6 @@ int xfs_da3_node_read(struct xfs_trans *tp, struct xfs_inode *dp, xfs_dablk_t bno, xfs_daddr_t mappedbno, struct xfs_buf **bpp, int which_fork); -extern const struct xfs_buf_ops xfs_da3_node_buf_ops; -/* * Utility routines. */
fs/xfs/xfs_dquot.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_dquot.h +0 -2
@@ -172,6 +172,4 @@ static inline struct xfs_dquot *xfs_qm_dqhold(struct xfs_dquot *dqp) return dqp; } -extern const struct xfs_buf_ops xfs_dquot_buf_ops; -#endif /* __XFS_DQUOT_H__ */
fs/xfs/xfs_extent_busy.c +2 -1
@@ -19,7 +19,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_file.c +1 -0
@@ -17,6 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_sb.h" #include "xfs_ag.h"
fs/xfs/xfs_format.h +0 -10
@@ -156,14 +156,4 @@ struct xfs_dsymlink_hdr { ((bufsize) - (xfs_sb_version_hascrc (&(mp)->m_sb) ? \ sizeof(struct xfs_dsymlink_hdr) : 0)) -int xfs_symlink_blocks (struct xfs_mount *mp,int pathlen); -int xfs_symlink_hdr_set (struct xfs_mount *mp,xfs_ino_t ino,uint32_t offset, -uint32_t size,struct xfs_buf *bp); -bool xfs_symlink_hdr_ok (struct xfs_mount *mp,xfs_ino_t ino,uint32_t offset, -uint32_t size,struct xfs_buf *bp); -void xfs_symlink_local_to_remote (struct xfs_trans *tp,struct xfs_buf *bp, -struct xfs_inode *ip,struct xfs_ifork *ifp); - -extern const struct xfs_buf_ops xfs_symlink_buf_ops; -#endif /* __XFS_FORMAT_H__ */
fs/xfs/xfs_fsops.c +2 -0
@@ -18,6 +18,8 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_types.h" +#include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_ialloc.c +2 -1
@@ -17,7 +17,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_inum.h"
fs/xfs/xfs_ialloc.h +0 -2
@@ -158,6 +158,4 @@ int xfs_ialloc_inode_init(struct xfs_mount *mp, struct xfs_trans *tp, xfs_agnumber_t agno, xfs_agblock_t agbno, xfs_agblock_t length, unsigned int gen); -extern const struct xfs_buf_ops xfs_agi_buf_ops; -#endif /* __XFS_IALLOC_H__ */
fs/xfs/xfs_ialloc_btree.h +0 -2
@@ -110,6 +110,4 @@ extern struct xfs_btree_cur *xfs_inobt_init_cursor(struct xfs_mount *, struct xfs_trans *, struct xfs_buf *, xfs_agnumber_t);extern int xfs_inobt_maxrecs (struct xfs_mount *,int ,int ); -extern const struct xfs_buf_ops xfs_inobt_buf_ops; -#endif /* __XFS_IALLOC_BTREE_H__ */
fs/xfs/xfs_icreate_item.c +1 -1
@@ -17,7 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_inode.c +1 -0
@@ -20,6 +20,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_inum.h" #include "xfs_trans.h"
fs/xfs/xfs_inode_buf.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_inode_buf.h +0 -3
@@ -47,7 +47,4 @@ void xfs_inobp_check(struct xfs_mount *, struct xfs_buf *);#define xfs_inobp_check (mp, bp)#endif /* DEBUG */ -extern const struct xfs_buf_ops xfs_inode_buf_ops; -extern const struct xfs_buf_ops xfs_inode_buf_ra_ops; -#endif /* __XFS_INODE_BUF_H__ */
fs/xfs/xfs_ioctl.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_iomap.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_iops.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_acl.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_itable.c +1 -1
@@ -17,7 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_inum.h" #include "xfs_trans.h"
fs/xfs/xfs_log.c +1 -1
@@ -17,7 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_log_cil.c +1 -1
@@ -17,7 +17,7 @@#include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_trans_priv.h"
fs/xfs/xfs_log_format.h +0 -177
193 lines not on this page · raw message
fs/xfs/xfs_log_recover.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_inum.h"
fs/xfs/xfs_log_rlimit.c +1 -0
@@ -17,6 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_ag.h"
fs/xfs/xfs_mount.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_inum.h"
fs/xfs/xfs_qm.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_qm_syscalls.c +1 -0
@@ -21,6 +21,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_quota.h +0 -2
@@ -154,6 +154,4 @@ extern int xfs_qm_dqcheck(struct xfs_mount *, xfs_disk_dquot_t *, xfs_dqid_t, uint, uint, char *);extern int xfs_mount_reset_sbqflags (struct xfs_mount *); -extern const struct xfs_buf_ops xfs_dquot_buf_ops; -#endif /* __XFS_QUOTA_H__ */
fs/xfs/xfs_rtalloc.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_sb.h +0 -3
@@ -699,7 +699,4 @@ extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *);extern void xfs_sb_to_disk (struct xfs_dsb *,struct xfs_sb *,__int64_t );extern void xfs_sb_quota_from_disk (struct xfs_sb *sbp); -extern const struct xfs_buf_ops xfs_sb_buf_ops; -extern const struct xfs_buf_ops xfs_sb_quiet_buf_ops; -#endif /* __XFS_SB_H__ */
fs/xfs/xfs_shared.h new file +244 -0
244 lines not on this page · raw message
fs/xfs/xfs_super.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_inum.h" #include "xfs_trans.h"
fs/xfs/xfs_symlink.c +1 -0
@@ -19,6 +19,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_trans.h"
fs/xfs/xfs_symlink_remote.c +1 -0
@@ -19,6 +19,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_ag.h"
fs/xfs/xfs_trace.c +1 -1
@@ -17,8 +17,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_trans.c +1 -0
@@ -19,6 +19,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_trans_buf.c +1 -1
@@ -17,7 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_trans_dquot.c +1 -0
@@ -18,6 +18,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_trans_extfree.c +1 -1
@@ -17,7 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_trans_inode.c +1 -1
@@ -17,7 +17,7 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h"
fs/xfs/xfs_trans_resv.c +1 -0
@@ -19,6 +19,7 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_shared.h" #include "xfs_log.h" #include "xfs_trans_resv.h" #include "xfs_trans.h"
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 9/19 xfs: decouple inode and bmap btree header files
In reply to Ben MyersFrom: Dave Chinner <[email protected]>
xfs_trans.h has a dependency on xfs_log.h for a couple of structures. Most code that does transactions doesn't need to know anything about the log, bu this dependency means that they have to include xfs_log.h. Decouple the xfs_trans.h and xfs_log.h header files and clean up the includes to be in dependency order.
In doing this, remove the direct include of xfs_trans_reserve.h from xfs_trans.h so that we remove the dependency between xfs_trans.h and xfs_mount.h. Hence the xfs_trans.h include can be moved to the indicate the actual dependencies oher header files have on it.
Note that these are kernel only header files, so this does not translate to any userspace changes at all.
---
V2: rebase due to changed fs/xfs/xfs_file.c include files as a result of the fallocate rework.
fs/xfs/xfs_alloc.c | 6 ++++-- fs/xfs/xfs_alloc_btree.c | 6 +++--- fs/xfs/xfs_aops.c | 7 ++++--- fs/xfs/xfs_attr.c | 8 ++++---- fs/xfs/xfs_attr_inactive.c | 8 ++++---- fs/xfs/xfs_attr_leaf.c | 7 +++---- fs/xfs/xfs_attr_list.c | 6 +++--- fs/xfs/xfs_attr_remote.c | 7 +++---- fs/xfs/xfs_bit.c | 5 +---- fs/xfs/xfs_bmap.c | 7 ++++--- fs/xfs/xfs_bmap_btree.c | 5 +++-- fs/xfs/xfs_bmap_util.c | 9 +++++---- fs/xfs/xfs_btree.c | 5 +++-- fs/xfs/xfs_buf.c | 5 +++-- fs/xfs/xfs_buf_item.c | 7 ++++--- fs/xfs/xfs_da_btree.c | 7 ++++--- fs/xfs/xfs_dir2.c | 6 +++--- fs/xfs/xfs_dir2_block.c | 6 +++--- fs/xfs/xfs_dir2_data.c | 6 +++--- fs/xfs/xfs_dir2_leaf.c | 6 +++--- fs/xfs/xfs_dir2_node.c | 6 +++--- fs/xfs/xfs_dir2_readdir.c | 6 +++--- fs/xfs/xfs_dir2_sf.c | 6 +++--- fs/xfs/xfs_discard.c | 5 +++-- fs/xfs/xfs_dquot.c | 10 ++++++---- fs/xfs/xfs_dquot_buf.c | 5 +++-- fs/xfs/xfs_dquot_item.c | 6 ++++-- fs/xfs/xfs_error.c | 5 ++--- fs/xfs/xfs_export.c | 7 ++++--- fs/xfs/xfs_extent_busy.c | 6 ++++-- fs/xfs/xfs_extfree_item.c | 8 ++++---- fs/xfs/xfs_file.c | 6 ++++-- fs/xfs/xfs_filestream.c | 10 +++++----- fs/xfs/xfs_fsops.c | 9 +++++---- fs/xfs/xfs_ialloc.c | 7 ++++--- fs/xfs/xfs_ialloc_btree.c | 6 +++--- fs/xfs/xfs_icache.c | 9 ++++----- fs/xfs/xfs_icreate_item.c | 5 +++-- fs/xfs/xfs_inode.c | 12 +++++++----- fs/xfs/xfs_inode_buf.c | 7 ++++--- fs/xfs/xfs_inode_fork.c | 6 +++--- fs/xfs/xfs_inode_item.c | 8 ++++---- fs/xfs/xfs_ioctl.c | 7 ++++--- fs/xfs/xfs_ioctl32.c | 4 ++-- fs/xfs/xfs_iomap.c | 11 ++++++----- fs/xfs/xfs_iops.c | 13 +++++++------ fs/xfs/xfs_itable.c | 4 ++-- fs/xfs/xfs_log.c | 8 +++++--- fs/xfs/xfs_log.h | 10 ++-------- fs/xfs/xfs_log_cil.c | 10 ++++++---- fs/xfs/xfs_log_priv.h | 7 ++++--- fs/xfs/xfs_log_recover.c | 13 +++++-------- fs/xfs/xfs_log_rlimit.c | 4 ++-- fs/xfs/xfs_message.c | 5 ++--- fs/xfs/xfs_mount.c | 10 ++++++---- fs/xfs/xfs_qm.c | 9 +++++---- fs/xfs/xfs_qm_bhv.c | 5 +++-- fs/xfs/xfs_qm_syscalls.c | 7 ++++--- fs/xfs/xfs_quotaops.c | 2 +- fs/xfs/xfs_rtalloc.c | 7 ++++--- fs/xfs/xfs_sb.c | 7 ++++--- fs/xfs/xfs_super.c | 8 +++++--- fs/xfs/xfs_symlink.c | 8 +++++--- fs/xfs/xfs_symlink_remote.c | 5 +++-- fs/xfs/xfs_trace.c | 8 +++++--- fs/xfs/xfs_trans.c | 10 ++++++---- fs/xfs/xfs_trans.h | 10 +++++----- fs/xfs/xfs_trans_ail.c | 7 ++++--- fs/xfs/xfs_trans_buf.c | 5 +++-- fs/xfs/xfs_trans_dquot.c | 7 ++++--- fs/xfs/xfs_trans_extfree.c | 5 +++-- fs/xfs/xfs_trans_inode.c | 5 +++-- fs/xfs/xfs_trans_priv.h | 1 - fs/xfs/xfs_trans_resv.c | 6 +++--- fs/xfs/xfs_xattr.c | 3 +-- 75 files changed, 276 insertions(+), 239 deletions(-)
fs/xfs/xfs_alloc.c +4 -2
@@ -18,10 +18,10 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" #include "xfs_shared.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -36,7 +36,9 @@#include "xfs_error.h" #include "xfs_cksum.h" #include "xfs_trace.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" +#include "xfs_log.h" struct workqueue_struct *xfs_alloc_wq;
fs/xfs/xfs_alloc_btree.c +3 -3
@@ -17,9 +17,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -34,6 +33,7 @@#include "xfs_error.h" #include "xfs_trace.h" #include "xfs_cksum.h" +#include "xfs_trans.h" STATIC struct xfs_btree_cur *
fs/xfs/xfs_aops.c +4 -3
@@ -16,16 +16,17 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_mount.h" #include "xfs_bmap_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_alloc.h" #include "xfs_error.h"
fs/xfs/xfs_attr.c +4 -4
@@ -17,12 +17,11 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -33,6 +32,7 @@#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_alloc.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h"
fs/xfs/xfs_attr_inactive.c +4 -4
@@ -18,11 +18,11 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -36,6 +36,7 @@#include "xfs_attr_remote.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_attr.h"
@@ -43,7 +44,6 @@#include "xfs_error.h" #include "xfs_quota.h" #include "xfs_trace.h" -#include "xfs_trans_priv.h" /* * Look at all the extents for this logical region,
fs/xfs/xfs_attr_leaf.c +3 -4
@@ -18,11 +18,9 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -37,6 +35,7 @@#include "xfs_attr_remote.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_attr.h"
fs/xfs/xfs_attr_list.c +3 -3
@@ -18,10 +18,9 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -36,6 +35,7 @@#include "xfs_attr_remote.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_attr.h"
fs/xfs/xfs_attr_remote.c +3 -4
@@ -18,11 +18,9 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -33,6 +31,7 @@#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_alloc.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h"
fs/xfs/xfs_bit.c +1 -4
@@ -16,10 +16,7 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" -#include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" -#include "xfs_buf_item.h" +#include "xfs_log_format.h" /* * XFS bit manipulation routines, used in non-realtime code.
fs/xfs/xfs_bmap.c +4 -3
@@ -17,12 +17,12 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" #include "xfs_inum.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -37,6 +37,7 @@#include "xfs_btree.h" #include "xfs_mount.h" #include "xfs_itable.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_extfree_item.h" #include "xfs_alloc.h"
fs/xfs/xfs_bmap_btree.c +3 -2
@@ -18,9 +18,9 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -29,6 +29,7 @@#include "xfs_ialloc_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_alloc.h" #include "xfs_btree.h"
fs/xfs/xfs_bmap_util.c +5 -4
@@ -18,12 +18,11 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_inum.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -34,6 +33,7 @@#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_trans.h" #include "xfs_extfree_item.h" #include "xfs_alloc.h" #include "xfs_bmap.h"
@@ -44,6 +44,7 @@#include "xfs_trans_space.h" #include "xfs_trace.h" #include "xfs_icache.h" +#include "xfs_log.h" /* Kernel only BMAP related definitions and functions */
fs/xfs/xfs_btree.c +3 -2
@@ -18,9 +18,9 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -29,6 +29,7 @@#include "xfs_ialloc_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_buf_item.h" #include "xfs_btree.h"
fs/xfs/xfs_buf.c +3 -2
@@ -34,12 +34,13 @@#include <linux/backing-dev.h> #include <linux/freezer.h> -#include "xfs_sb.h" +#include "xfs_log_format.h" #include "xfs_trans_resv.h" -#include "xfs_log.h" +#include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_trace.h" +#include "xfs_log.h" static kmem_zone_t *xfs_buf_zone;
fs/xfs/xfs_buf_item.c +4 -3
@@ -17,17 +17,18 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_trans_priv.h" #include "xfs_error.h" #include "xfs_trace.h" +#include "xfs_log.h" kmem_zone_t *xfs_buf_item_zone;
fs/xfs/xfs_da_btree.c +4 -3
@@ -18,11 +18,11 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -33,6 +33,7 @@#include "xfs_dir2_priv.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_alloc.h" #include "xfs_bmap.h"
fs/xfs/xfs_dir2.c +3 -3
@@ -17,10 +17,9 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_inum.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -30,6 +29,7 @@#include "xfs_alloc_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_dir2.h"
fs/xfs/xfs_dir2_block.c +3 -3
@@ -18,9 +18,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -29,6 +28,7 @@#include "xfs_bmap_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_buf_item.h"
fs/xfs/xfs_dir2_data.c +3 -3
@@ -18,9 +18,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -32,6 +31,7 @@#include "xfs_dir2.h" #include "xfs_dir2_priv.h" #include "xfs_error.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_cksum.h"
fs/xfs/xfs_dir2_leaf.c +3 -3
@@ -18,10 +18,9 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -35,6 +34,7 @@#include "xfs_dir2_priv.h" #include "xfs_error.h" #include "xfs_trace.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_cksum.h"
fs/xfs/xfs_dir2_node.c +3 -3
@@ -18,9 +18,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -34,6 +33,7 @@#include "xfs_dir2_priv.h" #include "xfs_error.h" #include "xfs_trace.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_cksum.h"
fs/xfs/xfs_dir2_readdir.c +3 -3
@@ -18,10 +18,9 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -35,6 +34,7 @@#include "xfs_error.h" #include "xfs_trace.h" #include "xfs_bmap.h" +#include "xfs_trans.h" /* * Directory file type support functions
fs/xfs/xfs_dir2_sf.c +3 -3
@@ -17,9 +17,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -28,6 +27,7 @@#include "xfs_bmap_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_error.h" #include "xfs_dir2.h"
fs/xfs/xfs_discard.c +3 -2
@@ -17,8 +17,8 @@*/ #include "xfs.h" #include "xfs_format.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -33,6 +33,7 @@#include "xfs_extent_busy.h" #include "xfs_discard.h" #include "xfs_trace.h" +#include "xfs_log.h" STATIC int xfs_trim_extents(
fs/xfs/xfs_dquot.c +6 -4
@@ -18,29 +18,31 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" #include "xfs_shared.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_alloc.h" -#include "xfs_quota.h" #include "xfs_mount.h" #include "xfs_bmap_btree.h" #include "xfs_inode.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" +#include "xfs_alloc.h" +#include "xfs_quota.h" #include "xfs_rtalloc.h" #include "xfs_error.h" #include "xfs_itable.h" #include "xfs_attr.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_trans_space.h" #include "xfs_trans_priv.h" #include "xfs_qm.h" #include "xfs_cksum.h" #include "xfs_trace.h" +#include "xfs_log.h" /* * Lock order:
fs/xfs/xfs_dquot_buf.c +3 -2
@@ -19,15 +19,16 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_bmap_btree.h" #include "xfs_inode.h" #include "xfs_quota.h" +#include "xfs_trans.h" #include "xfs_qm.h" #include "xfs_error.h" #include "xfs_cksum.h"
fs/xfs/xfs_dquot_item.c +4 -2
@@ -18,8 +18,8 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_alloc.h"
@@ -32,9 +32,11 @@#include "xfs_error.h" #include "xfs_itable.h" #include "xfs_attr.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_trans_priv.h" #include "xfs_qm.h" +#include "xfs_log.h" static inline struct xfs_dq_logitem *DQUOT_ITEM (struct xfs_log_item *lip) {
fs/xfs/xfs_error.c +2 -3
@@ -17,9 +17,8 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
fs/xfs/xfs_export.c +4 -3
@@ -16,9 +16,8 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -27,9 +26,11 @@#include "xfs_export.h" #include "xfs_bmap_btree.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_trace.h" #include "xfs_icache.h" +#include "xfs_log.h" /* * Note that we only accept fileids which are long enough rather than allow
fs/xfs/xfs_extent_busy.c +4 -2
@@ -20,9 +20,9 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -31,6 +31,8 @@#include "xfs_inode.h" #include "xfs_extent_busy.h" #include "xfs_trace.h" +#include "xfs_trans.h" +#include "xfs_log.h" void xfs_extent_busy_insert(
fs/xfs/xfs_extfree_item.c +4 -4
@@ -17,14 +17,14 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" -#include "xfs_buf_item.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_trans.h" #include "xfs_trans_priv.h" +#include "xfs_buf_item.h" #include "xfs_extfree_item.h"
fs/xfs/xfs_file.c +4 -2
@@ -18,10 +18,10 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" -#include "xfs_log.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_trans.h" #include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_da_btree.h"
@@ -29,6 +29,7 @@#include "xfs_alloc.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h"
@@ -37,6 +38,7 @@#include "xfs_dir2_priv.h" #include "xfs_ioctl.h" #include "xfs_trace.h" +#include "xfs_log.h" #include <linux/aio.h> #include <linux/dcache.h>
fs/xfs/xfs_filestream.c +5 -5
@@ -16,15 +16,15 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" -#include "xfs_log.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" +#include "xfs_ag.h" +#include "xfs_sb.h" +#include "xfs_mount.h" #include "xfs_bmap_btree.h" #include "xfs_inum.h" #include "xfs_dinode.h" #include "xfs_inode.h" -#include "xfs_ag.h" -#include "xfs_trans.h" -#include "xfs_sb.h" -#include "xfs_mount.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" #include "xfs_alloc.h"
fs/xfs/xfs_fsops.c +5 -4
@@ -17,11 +17,10 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -30,6 +29,7 @@#include "xfs_ialloc_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_btree.h" #include "xfs_error.h"
@@ -41,6 +41,7 @@#include "xfs_rtalloc.h" #include "xfs_filestream.h" #include "xfs_trace.h" +#include "xfs_log.h" /* * File system operations
fs/xfs/xfs_ialloc.c +4 -3
@@ -17,12 +17,12 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" #include "xfs_inum.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -38,6 +38,7 @@#include "xfs_error.h" #include "xfs_bmap.h" #include "xfs_cksum.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_icreate_item.h" #include "xfs_icache.h"
fs/xfs/xfs_ialloc_btree.c +3 -3
@@ -17,10 +17,9 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -35,6 +34,7 @@#include "xfs_error.h" #include "xfs_trace.h" #include "xfs_cksum.h" +#include "xfs_trans.h" STATIC int
fs/xfs/xfs_icache.c +4 -5
@@ -18,12 +18,9 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_log_priv.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_inum.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -32,6 +29,8 @@#include "xfs_dinode.h" #include "xfs_error.h" #include "xfs_filestream.h" +#include "xfs_trans.h" +#include "xfs_trans_priv.h" #include "xfs_inode_item.h" #include "xfs_quota.h" #include "xfs_trace.h"
fs/xfs/xfs_icreate_item.c +3 -2
@@ -18,12 +18,13 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_trans.h" #include "xfs_trans_priv.h" #include "xfs_error.h" #include "xfs_icreate_item.h"
fs/xfs/xfs_inode.c +7 -5
@@ -19,13 +19,11 @@#include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_inum.h" -#include "xfs_trans.h" -#include "xfs_trans_space.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -39,6 +37,8 @@#include "xfs_attr.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans_space.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_inode_item.h" #include "xfs_btree.h"
@@ -53,6 +53,8 @@#include "xfs_trace.h" #include "xfs_icache.h" #include "xfs_symlink.h" +#include "xfs_trans_priv.h" +#include "xfs_log.h" kmem_zone_t *xfs_inode_zone;
fs/xfs/xfs_inode_buf.c +4 -3
@@ -17,10 +17,10 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -32,6 +32,7 @@#include "xfs_cksum.h" #include "xfs_icache.h" #include "xfs_ialloc.h" +#include "xfs_trans.h" /* * Check that none of the inode's in the buffer have a next
fs/xfs/xfs_inode_fork.c +3 -3
@@ -20,10 +20,9 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" -#include "xfs_log.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_inum.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -33,6 +32,7 @@#include "xfs_attr_sf.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_inode_item.h" #include "xfs_btree.h"
fs/xfs/xfs_inode_item.c +4 -4
@@ -17,19 +17,19 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_trans_priv.h" #include "xfs_bmap_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_error.h" #include "xfs_trace.h" +#include "xfs_trans_priv.h" kmem_zone_t *xfs_ili_zone;/* inode log item zone */
fs/xfs/xfs_ioctl.c +4 -3
@@ -17,10 +17,10 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_alloc.h"
@@ -35,6 +35,7 @@#include "xfs_attr.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_fsops.h" #include "xfs_discard.h"
fs/xfs/xfs_ioctl32.c +2 -2
@@ -22,8 +22,8 @@#include <asm/uaccess.h> #include "xfs.h" #include "xfs_fs.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
fs/xfs/xfs_iomap.c +6 -5
@@ -17,21 +17,22 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_alloc.h" -#include "xfs_quota.h" #include "xfs_mount.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" +#include "xfs_alloc.h" +#include "xfs_quota.h" #include "xfs_btree.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h"
fs/xfs/xfs_iops.c +7 -6
@@ -17,15 +17,12 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_acl.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_alloc.h" -#include "xfs_quota.h" #include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_bmap_btree.h"
@@ -33,10 +30,14 @@#include "xfs_inode.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h" +#include "xfs_acl.h" +#include "xfs_alloc.h" +#include "xfs_quota.h" #include "xfs_rtalloc.h" #include "xfs_error.h" #include "xfs_itable.h" #include "xfs_attr.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_inode_item.h" #include "xfs_trace.h"
fs/xfs/xfs_itable.c +2 -2
@@ -18,9 +18,9 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" -#include "xfs_log.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_inum.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
fs/xfs/xfs_log.c +5 -3
@@ -18,19 +18,21 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_error.h" +#include "xfs_trans.h" +#include "xfs_trans_priv.h" +#include "xfs_log.h" #include "xfs_log_priv.h" #include "xfs_buf_item.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" #include "xfs_log_recover.h" -#include "xfs_trans_priv.h" #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_trace.h"
fs/xfs/xfs_log.h +2 -8
@@ -18,8 +18,6 @@ #ifndef __XFS_LOG_H__ #define __XFS_LOG_H__ -#include "xfs_log_format.h" - struct xfs_log_vec { struct xfs_log_vec *lv_next; /* next lv in build list */ int lv_niovecs; /* number of iovecs in lv */
@@ -82,11 +80,7 @@ struct xlog_ticket;struct xfs_log_item ;struct xfs_item_ops ;struct xfs_trans ; - -void xfs_log_item_init (struct xfs_mount *mp, -struct xfs_log_item *item, -int type, -const struct xfs_item_ops *ops); +struct xfs_log_callback ; xfs_lsn_t xfs_log_done(struct xfs_mount *mp, struct xlog_ticket *ticket,
@@ -114,7 +108,7 @@ xfs_lsn_t xlog_assign_tail_lsn_locked(struct xfs_mount *mp);void xfs_log_space_wake (struct xfs_mount *mp);int xfs_log_notify (struct xfs_mount *mp,struct xlog_in_core *iclog, -xfs_log_callback_t *callback_entry); +struct xfs_log_callback *callback_entry);int xfs_log_release_iclog (struct xfs_mount *mp,struct xlog_in_core *iclog); int xfs_log_reserve(struct xfs_mount *mp,
fs/xfs/xfs_log_cil.c +6 -4
@@ -17,11 +17,9 @@#include "xfs.h" #include "xfs_fs.h" +#include "xfs_log_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" -#include "xfs_log_priv.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -29,6 +27,10 @@#include "xfs_alloc.h" #include "xfs_extent_busy.h" #include "xfs_discard.h" +#include "xfs_trans.h" +#include "xfs_trans_priv.h" +#include "xfs_log.h" +#include "xfs_log_priv.h" /* * Allocate a new ticket. Failing to get a new ticket makes it really hard to
fs/xfs/xfs_log_priv.h +4 -3
@@ -22,6 +22,7 @@ struct xfs_buf;struct xlog ;struct xlog_ticket ;struct xfs_mount ; +struct xfs_log_callback ;/* * Flags for log structure
@@ -227,8 +228,8 @@ typedef struct xlog_in_core {/* Callback structures need their own cacheline */ spinlock_t ic_callback_lock____cacheline_aligned_in_smp ; -xfs_log_callback_t *ic_callback; -xfs_log_callback_t **ic_callback_tail; +struct xfs_log_callback *ic_callback; +struct xfs_log_callback **ic_callback_tail;/* reference counts need their own cacheline */ atomic_t ic_refcnt____cacheline_aligned_in_smp ;
@@ -254,7 +255,7 @@ struct xfs_cil_ctx {int space_used;/* aggregate size of regions */ struct list_head busy_extents;/* busy extents in chkpt */ struct xfs_log_vec *lv_chain;/* logvecs being pushed */ -xfs_log_callback_t log_cb;/* completion callback hook. */ +struct xfs_log_callback log_cb;/* completion callback hook. */ struct list_head committing;/* ctx committing list */ };
fs/xfs/xfs_log_recover.c +5 -8
@@ -17,12 +17,12 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" #include "xfs_inum.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -34,11 +34,12 @@#include "xfs_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_alloc.h" #include "xfs_ialloc.h" +#include "xfs_log.h" #include "xfs_log_priv.h" -#include "xfs_buf_item.h" #include "xfs_log_recover.h" #include "xfs_extfree_item.h" #include "xfs_trans_priv.h"
@@ -46,14 +47,10 @@#include "xfs_cksum.h" #include "xfs_trace.h" #include "xfs_icache.h" -#include "xfs_icreate_item.h" /* Need all the magic numbers and buffer ops structures from these headers */ -#include "xfs_symlink.h" #include "xfs_da_btree.h" #include "xfs_dir2.h" -#include "xfs_attr_leaf.h" -#include "xfs_attr_remote.h" #define BLK_AVG (blk1, blk2) ((blk1+blk2) >> 1)
fs/xfs/xfs_log_rlimit.c +2 -2
@@ -18,8 +18,8 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_ag.h" #include "xfs_sb.h" #include "xfs_mount.h"
fs/xfs/xfs_message.c +2 -3
@@ -17,9 +17,8 @@#include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
fs/xfs/xfs_mount.c +6 -4
@@ -17,17 +17,19 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" #include "xfs_inum.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" #include "xfs_da_format.h" +#include "xfs_trans.h" +#include "xfs_trans_priv.h" +#include "xfs_log.h" #include "xfs_dir2.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h"
fs/xfs/xfs_qm.c +5 -4
@@ -18,14 +18,12 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" #include "xfs_shared.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" -#include "xfs_alloc.h" -#include "xfs_quota.h" #include "xfs_mount.h" #include "xfs_bmap_btree.h" #include "xfs_ialloc_btree.h"
@@ -33,10 +31,13 @@#include "xfs_inode.h" #include "xfs_ialloc.h" #include "xfs_itable.h" +#include "xfs_alloc.h" #include "xfs_rtalloc.h" +#include "xfs_quota.h" #include "xfs_error.h" #include "xfs_bmap.h" #include "xfs_attr.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_trans_space.h" #include "xfs_qm.h"
fs/xfs/xfs_qm_bhv.c +3 -2
@@ -18,8 +18,8 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_alloc.h"
@@ -32,6 +32,7 @@#include "xfs_rtalloc.h" #include "xfs_error.h" #include "xfs_attr.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_qm.h"
fs/xfs/xfs_qm_syscalls.c +4 -3
@@ -20,11 +20,11 @@#include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_alloc.h"
@@ -32,6 +32,7 @@#include "xfs_mount.h" #include "xfs_bmap_btree.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_itable.h" #include "xfs_bmap.h"
fs/xfs/xfs_quotaops.c +1 -1
@@ -17,8 +17,8 @@*/ #include "xfs.h" #include "xfs_format.h" +#include "xfs_log_format.h" #include "xfs_trans_resv.h" -#include "xfs_log.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
fs/xfs/xfs_rtalloc.c +4 -3
@@ -17,11 +17,11 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -34,6 +34,7 @@#include "xfs_rtalloc.h" #include "xfs_fsops.h" #include "xfs_error.h" +#include "xfs_trans.h" #include "xfs_inode_item.h" #include "xfs_trans_space.h" #include "xfs_trace.h"
fs/xfs/xfs_sb.c +4 -3
@@ -18,11 +18,10 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" #include "xfs_inum.h" -#include "xfs_trans.h" -#include "xfs_trans_priv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -44,6 +43,8 @@#include "xfs_fsops.h" #include "xfs_trace.h" #include "xfs_cksum.h" +#include "xfs_trans.h" +#include "xfs_trans_priv.h" #include "xfs_buf_item.h" /*
fs/xfs/xfs_super.c +5 -3
@@ -17,11 +17,11 @@*/ #include "xfs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_inum.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_alloc.h"
@@ -41,7 +41,9 @@#include "xfs_itable.h" #include "xfs_fsops.h" #include "xfs_attr.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" +#include "xfs_log.h" #include "xfs_log_priv.h" #include "xfs_trans_priv.h" #include "xfs_filestream.h"
fs/xfs/xfs_symlink.c +5 -3
@@ -17,12 +17,12 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xfs.h" +#include "xfs_shared.h" #include "xfs_fs.h" #include "xfs_format.h" -#include "xfs_shared.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_bit.h" -#include "xfs_log.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -41,7 +41,9 @@#include "xfs_trans_space.h" #include "xfs_trace.h" #include "xfs_symlink.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" +#include "xfs_log.h" /* ----- Kernel only functions below ----- */ STATIC int
fs/xfs/xfs_symlink_remote.c +3 -2
@@ -19,9 +19,9 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_format.h" +#include "xfs_log_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_trans_resv.h" #include "xfs_ag.h" #include "xfs_sb.h" #include "xfs_mount.h"
@@ -31,6 +31,7 @@#include "xfs_trace.h" #include "xfs_symlink.h" #include "xfs_cksum.h" +#include "xfs_trans.h" #include "xfs_buf_item.h"
fs/xfs/xfs_trace.c +5 -3
@@ -17,10 +17,10 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -38,6 +38,8 @@#include "xfs_bmap.h" #include "xfs_attr.h" #include "xfs_attr_leaf.h" +#include "xfs_trans.h" +#include "xfs_log.h" #include "xfs_log_priv.h" #include "xfs_buf_item.h" #include "xfs_quota.h"
fs/xfs/xfs_trans.c +6 -4
@@ -18,10 +18,10 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -38,10 +38,12 @@#include "xfs_extent_busy.h" #include "xfs_bmap.h" #include "xfs_quota.h" -#include "xfs_qm.h" +#include "xfs_trans.h" #include "xfs_trans_priv.h" #include "xfs_trans_space.h" +#include "xfs_qm.h" #include "xfs_inode_item.h" +#include "xfs_log.h" #include "xfs_log_priv.h" #include "xfs_buf_item.h" #include "xfs_trace.h"
fs/xfs/xfs_trans.h +5 -5
@@ -18,10 +18,6 @@#ifndef __XFS_TRANS_H__#define __XFS_TRANS_H__ -struct xfs_log_item ; - -#include "xfs_trans_resv.h" -/* kernel only transaction subsystem defines */ struct xfs_buf ;
@@ -77,6 +73,9 @@ struct xfs_item_ops {void (*iop_committing)(xfs_log_item_t *,xfs_lsn_t ); }; +void xfs_log_item_init (struct xfs_mount *mp,struct xfs_log_item *item, +int type,const struct xfs_item_ops *ops); +/* * Return values for the iop_push() routines. */
@@ -85,6 +84,7 @@ struct xfs_item_ops {#define XFS_ITEM_LOCKED 2#define XFS_ITEM_FLUSHING 3 +/* * This is the structure maintained for every active transaction. */
@@ -125,7 +125,6 @@ typedef struct xfs_trans {int64_t t_rextents_delta;/* superblocks rextents chg */ int64_t t_rextslog_delta;/* superblocks rextslog chg */ struct list_head t_items;/* log item descriptors */ -xfs_trans_header_t t_header;/* header for in-log trans */ struct list_head t_busy;/* list of busy extents */ unsigned long t_pflags;/* saved process flags state */ } xfs_trans_t;
@@ -230,6 +229,7 @@ void xfs_trans_log_efd_extent(xfs_trans_t *, xfs_fsblock_t, xfs_extlen_t);int xfs_trans_commit (xfs_trans_t *,uint flags); +int xfs_trans_roll (struct xfs_trans **,struct xfs_inode *);void xfs_trans_cancel (xfs_trans_t *,int );int xfs_trans_ail_init (struct xfs_mount *);void xfs_trans_ail_destroy (struct xfs_mount *);
fs/xfs/xfs_trans_ail.c +4 -3
@@ -18,15 +18,16 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_trans.h" #include "xfs_trans_priv.h" #include "xfs_trace.h" #include "xfs_error.h" +#include "xfs_log.h" #ifdef DEBUG /*
fs/xfs/xfs_trans_buf.c +3 -2
@@ -18,8 +18,8 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -28,6 +28,7 @@#include "xfs_ialloc_btree.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_trans_priv.h" #include "xfs_error.h"
fs/xfs/xfs_trans_dquot.c +4 -3
@@ -17,10 +17,10 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_format.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_alloc.h"
@@ -33,6 +33,7 @@#include "xfs_rtalloc.h" #include "xfs_error.h" #include "xfs_attr.h" +#include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_trans_priv.h" #include "xfs_qm.h"
fs/xfs/xfs_trans_extfree.c +3 -2
@@ -18,11 +18,12 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h" +#include "xfs_trans.h" #include "xfs_trans_priv.h" #include "xfs_extfree_item.h"
fs/xfs/xfs_trans_inode.c +3 -2
@@ -18,8 +18,8 @@#include "xfs.h" #include "xfs_fs.h" #include "xfs_shared.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_log_format.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -29,6 +29,7 @@#include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_trans.h" #include "xfs_trans_priv.h" #include "xfs_inode_item.h" #include "xfs_trace.h"
fs/xfs/xfs_trans_priv.h +0 -1
@@ -27,7 +27,6 @@ struct xfs_log_vec;void xfs_trans_init (struct xfs_mount *); -int xfs_trans_roll (struct xfs_trans **,struct xfs_inode *);void xfs_trans_add_item (struct xfs_trans *,struct xfs_log_item *);void xfs_trans_del_item (struct xfs_log_item *); void xfs_trans_free_items(struct xfs_trans *tp, xfs_lsn_t commit_lsn,
fs/xfs/xfs_trans_resv.c +3 -3
@@ -18,11 +18,10 @@*/ #include "xfs.h" #include "xfs_fs.h" -#include "xfs_format.h" #include "xfs_shared.h" -#include "xfs_log.h" +#include "xfs_format.h" +#include "xfs_log_format.h" #include "xfs_trans_resv.h" -#include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
@@ -41,6 +40,7 @@#include "xfs_bmap.h" #include "xfs_bmap_util.h" #include "xfs_quota.h" +#include "xfs_trans.h" #include "xfs_qm.h" #include "xfs_trans_space.h" #include "xfs_trace.h"
fs/xfs/xfs_xattr.c +1 -2
@@ -18,8 +18,7 @@#include "xfs.h" #include "xfs_log_format.h" -#include "xfs_log.h" -#include "xfs_trans.h" +#include "xfs_trans_resv.h" #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_mount.h"
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 09/19, V2] xfs: decouple inode and bmap btree header files
Quoted 13 lines · Dave Chinner
From: Dave Chinner <[email protected]>
xfs_trans.hhas a dependency onxfs_log.hfor a couple of structures. Most code that does transactions doesn't need to know anything about the log, bu this dependency means that they have to includexfs_log.h. Decouple thexfs_trans.handxfs_log.hheader files and clean up the includes to be in dependency order.In doing this, remove the direct include of
xfs_trans_reserve.hfromxfs_trans.hso that we remove the dependency betweenxfs_trans.handxfs_mount.h. Hence thexfs_trans.hinclude can be moved to the indicate the actual dependencies oher header files have on it.
Quoted 8 lines
Note that these are kernel only header files, so this does not translate to any userspace changes at all.
Signed-off-by Dave Chinner <[email protected]>Reviewed-by Ben Myers <[email protected]>---
V2: rebase due to changedfs/xfs/xfs_file.cinclude files as a result of the fallocate rework.
Ignore this patch - it's a rebase for 08/19, not 09/19. I'll send the rebase for this patch in a minute.
-Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs