forked from luck/tmp_suning_uos_patched
71e330b593
The delayed logging code only changes in-memory structures and as such can be enabled and disabled with a mount option. Add the mount option and emit a warning that this is an experimental feature that should not be used in production yet. We also need infrastructure to track committed items that have not yet been written to the log. This is what the Committed Item List (CIL) is for. The log item also needs to be extended to track the current log vector, the associated memory buffer and it's location in the Commit Item List. Extend the log item and log vector structures to enable this tracking. To maintain the current log format for transactions with delayed logging, we need to introduce a checkpoint transaction and a context for tracking each checkpoint from initiation to transaction completion. This includes adding a log ticket for tracking space log required/used by the context checkpoint. To track all the changes we need an io vector array per log item, rather than a single array for the entire transaction. Using the new log vector structure for this requires two passes - the first to allocate the log vector structures and chain them together, and the second to fill them out. This log vector chain can then be passed to the CIL for formatting, pinning and insertion into the CIL. Formatting of the log vector chain is relatively simple - it's just a loop over the iovecs on each log vector, but it is made slightly more complex because we re-write the iovec after the copy to point back at the memory buffer we just copied into. This code also needs to pin log items. If the log item is not already tracked in this checkpoint context, then it needs to be pinned. Otherwise it is already pinned and we don't need to pin it again. The only other complexity is calculating the amount of new log space the formatting has consumed. This needs to be accounted to the transaction in progress, and the accounting is made more complex becase we need also to steal space from it for log metadata in the checkpoint transaction. Calculate all this at insert time and update all the tickets, counters, etc correctly. Once we've formatted all the log items in the transaction, attach the busy extents to the checkpoint context so the busy extents live until checkpoint completion and can be processed at that point in time. Transactions can then be freed at this point in time. Now we need to issue checkpoints - we are tracking the amount of log space used by the items in the CIL, so we can trigger background checkpoints when the space usage gets to a certain threshold. Otherwise, checkpoints need ot be triggered when a log synchronisation point is reached - a log force event. Because the log write code already handles chained log vectors, writing the transaction is trivial, too. Construct a transaction header, add it to the head of the chain and write it into the log, then issue a commit record write. Then we can release the checkpoint log ticket and attach the context to the log buffer so it can be called during Io completion to complete the checkpoint. We also need to allow for synchronising multiple in-flight checkpoints. This is needed for two things - the first is to ensure that checkpoint commit records appear in the log in the correct sequence order (so they are replayed in the correct order). The second is so that xfs_log_force_lsn() operates correctly and only flushes and/or waits for the specific sequence it was provided with. To do this we need a wait variable and a list tracking the checkpoint commits in progress. We can walk this list and wait for the checkpoints to change state or complete easily, an this provides the necessary synchronisation for correct operation in both cases. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
117 lines
2.9 KiB
Makefile
117 lines
2.9 KiB
Makefile
#
|
|
# Copyright (c) 2000-2005 Silicon Graphics, Inc.
|
|
# All Rights Reserved.
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU General Public License as
|
|
# published by the Free Software Foundation.
|
|
#
|
|
# This program is distributed in the hope that it would be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write the Free Software Foundation,
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
#
|
|
|
|
EXTRA_CFLAGS += -I$(src) -I$(src)/linux-2.6
|
|
|
|
XFS_LINUX := linux-2.6
|
|
|
|
ifeq ($(CONFIG_XFS_DEBUG),y)
|
|
EXTRA_CFLAGS += -g
|
|
endif
|
|
|
|
obj-$(CONFIG_XFS_FS) += xfs.o
|
|
|
|
xfs-y += linux-2.6/xfs_trace.o
|
|
|
|
xfs-$(CONFIG_XFS_QUOTA) += $(addprefix quota/, \
|
|
xfs_dquot.o \
|
|
xfs_dquot_item.o \
|
|
xfs_trans_dquot.o \
|
|
xfs_qm_syscalls.o \
|
|
xfs_qm_bhv.o \
|
|
xfs_qm.o)
|
|
xfs-$(CONFIG_XFS_QUOTA) += linux-2.6/xfs_quotaops.o
|
|
|
|
ifeq ($(CONFIG_XFS_QUOTA),y)
|
|
xfs-$(CONFIG_PROC_FS) += quota/xfs_qm_stats.o
|
|
endif
|
|
|
|
xfs-$(CONFIG_XFS_RT) += xfs_rtalloc.o
|
|
xfs-$(CONFIG_XFS_POSIX_ACL) += $(XFS_LINUX)/xfs_acl.o
|
|
xfs-$(CONFIG_PROC_FS) += $(XFS_LINUX)/xfs_stats.o
|
|
xfs-$(CONFIG_SYSCTL) += $(XFS_LINUX)/xfs_sysctl.o
|
|
xfs-$(CONFIG_COMPAT) += $(XFS_LINUX)/xfs_ioctl32.o
|
|
|
|
|
|
xfs-y += xfs_alloc.o \
|
|
xfs_alloc_btree.o \
|
|
xfs_attr.o \
|
|
xfs_attr_leaf.o \
|
|
xfs_bit.o \
|
|
xfs_bmap.o \
|
|
xfs_bmap_btree.o \
|
|
xfs_btree.o \
|
|
xfs_buf_item.o \
|
|
xfs_da_btree.o \
|
|
xfs_dir2.o \
|
|
xfs_dir2_block.o \
|
|
xfs_dir2_data.o \
|
|
xfs_dir2_leaf.o \
|
|
xfs_dir2_node.o \
|
|
xfs_dir2_sf.o \
|
|
xfs_error.o \
|
|
xfs_extfree_item.o \
|
|
xfs_filestream.o \
|
|
xfs_fsops.o \
|
|
xfs_ialloc.o \
|
|
xfs_ialloc_btree.o \
|
|
xfs_iget.o \
|
|
xfs_inode.o \
|
|
xfs_inode_item.o \
|
|
xfs_iomap.o \
|
|
xfs_itable.o \
|
|
xfs_dfrag.o \
|
|
xfs_log.o \
|
|
xfs_log_cil.o \
|
|
xfs_log_recover.o \
|
|
xfs_mount.o \
|
|
xfs_mru_cache.o \
|
|
xfs_rename.o \
|
|
xfs_trans.o \
|
|
xfs_trans_ail.o \
|
|
xfs_trans_buf.o \
|
|
xfs_trans_extfree.o \
|
|
xfs_trans_inode.o \
|
|
xfs_trans_item.o \
|
|
xfs_utils.o \
|
|
xfs_vnodeops.o \
|
|
xfs_rw.o \
|
|
xfs_dmops.o
|
|
|
|
xfs-$(CONFIG_XFS_TRACE) += xfs_btree_trace.o
|
|
|
|
# Objects in linux/
|
|
xfs-y += $(addprefix $(XFS_LINUX)/, \
|
|
kmem.o \
|
|
xfs_aops.o \
|
|
xfs_buf.o \
|
|
xfs_export.o \
|
|
xfs_file.o \
|
|
xfs_fs_subr.o \
|
|
xfs_globals.o \
|
|
xfs_ioctl.o \
|
|
xfs_iops.o \
|
|
xfs_super.o \
|
|
xfs_sync.o \
|
|
xfs_xattr.o)
|
|
|
|
# Objects in support/
|
|
xfs-y += $(addprefix support/, \
|
|
debug.o \
|
|
uuid.o)
|