summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-03-12 21:44:14 +0100
committerChristoph Hellwig <hch@lst.de>2010-03-12 21:44:14 +0100
commitb952d49e09f2383f077c40b0ff0d3d40b934aa79 (patch)
tree2286553185ae3cb285d1281d4db6162c5d67bcd1
parent589a79b861c242552fe6981bae934074e1a97599 (diff)
downloadxfsdocs-xml-dev-b952d49e09f2383f077c40b0ff0d3d40b934aa79.tar.gz
update xfs internals document to match current codebase
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r--XFS_User_Guide/en-US/XFS-internals.xml145
1 files changed, 18 insertions, 127 deletions
diff --git a/XFS_User_Guide/en-US/XFS-internals.xml b/XFS_User_Guide/en-US/XFS-internals.xml
index 97ed8db..96e1eb3 100644
--- a/XFS_User_Guide/en-US/XFS-internals.xml
+++ b/XFS_User_Guide/en-US/XFS-internals.xml
@@ -10,52 +10,6 @@
<para>How these differences are implemented</para>
</section>
<section>
- <title>xfs_vnodeops</title>
- <para>VFS interfaces are mapped to an IRIX-like vnode operations table</para>
- <itemizedlist>
- <listitem><para>fs/xfs/xfs_vnodeops.c</para></listitem>
- </itemizedlist>
- <para>xfs_vnodeops {</para>
- <itemizedlist>
- <listitem><para>open, close, fid, read, write, sendfile, splice, fsync
- <itemizedlist>
- <listitem><para>file descriptors</para></listitem>
- </itemizedlist>
- </para></listitem>
- <listitem><para>getattr, setattr
- <itemizedlist>
- <listitem><para>inode attributes - stat(2)</para></listitem>
- </itemizedlist>
- </para></listitem>
- <listitem><para>attr_get, attr_set, attr_list, attr_remove
- <itemizedlist>
- <listitem><para>extended attributes</para></listitem>
- </itemizedlist>
- </para></listitem>
- <listitem><para>access, lookup
- <itemizedlist>
- <listitem><para>inode permissions/existence</para></listitem>
- </itemizedlist>
- </para></listitem>
- <listitem><para>create, remove, symlink, readlink
- <itemizedlist>
- <listitem><para>regular files, special files</para></listitem>
- </itemizedlist>
- </para></listitem>
- <listitem><para>readdir, mkdir, rmdir, link, rename
- <itemizedlist>
- <listitem><para>directories</para></listitem>
- </itemizedlist>
- </para></listitem>
- <listitem><para>reclaim, release, inactive, iflush, bmap, flush_pages, flush_inval_pages, toss_pages
- <itemizedlist>
- <listitem><para>inode / page cache state and/or lifecycle</para></listitem>
- </itemizedlist>
- </para></listitem>
- </itemizedlist>
- <para>}</para>
- </section>
- <section>
<title>xfs_ioctl</title>
<para>XFS specific system calls (xfsctl()) are dispatched by xfs_ioctl()</para>
<itemizedlist>
@@ -252,10 +206,6 @@ XFS_PTAG_SHUTDOWN_LOGERROR 0x00000040</programlisting></para>
<itemizedlist>
<listitem><para>Setting this to "1" clears accumulated XFS statistics in /proc/fs/xfs/stat. It then immediately resets to "0".</para></listitem>
</itemizedlist>
- <para>fs.xfs.restrict_chown (Min: 0 Default: 1 Max: 1)</para>
- <itemizedlist>
- <listitem><para>Controls whether unprivileged users can use chown to "give away“ a file to another user.</para></listitem>
- </itemizedlist>
<para>fs.xfs.rotorstep (Min: 1 Default: 1 Max: 256)</para>
<itemizedlist>
<listitem><para>In "inode32" allocation mode, this option determines how many files the allocator attempts to allocate in the same allocation group before moving to the next allocation group. The intent is to control the rate at which the allocator moves between allocation groups when allocating extents for new files.</para></listitem>
@@ -286,98 +236,39 @@ XFS_PTAG_SHUTDOWN_LOGERROR 0x00000040</programlisting></para>
</itemizedlist>
</section>
<section>
- <title>Behaviours</title>
- <para>A behaviour chain is a way to chain different operations.</para>
- <para>The filesystem call stack typically</para>
- <itemizedlist>
- <listitem><para>enter the linux vfs level</para></listitem>
- <listitem><para>calls the xfs equivalents which do little work</para></listitem>
- <listitem><para>they call the behaviour VOP</para></listitem>
- </itemizedlist>
- <para>Each operation can choose to call the next operation in the chain or return</para>
- <itemizedlist>
- <listitem><para>it is not strictly a stack</para></listitem>
- </itemizedlist>
- <para>Each behaviour has an index which is where it wants to sit in the chain.</para>
- <para>CXFS, dmapi and quotas use this to "intercept" requests.</para>
- <para>New XFS features may add additional behaviours</para>
- </section>
- <section>
- <title>Behaviours</title>
- <mediaobject><imageobject>
- <imagedata fileref="images/XFS-behaviors.png" />
- </imageobject></mediaobject>
- </section>
- <section>
<title>Mount Path</title>
<para>Mounting an XFS filesystem has several steps</para>
<itemizedlist>
- <listitem><para>xfs_fs_fill_superinxfs_super.c</para></listitem>
+ <listitem><para>xfs_fs_fill_super in xfs_super.c:</para></listitem>
</itemizedlist>
<orderedlist>
- <listitem><para>Allocate a bhv_vfs struct (vfs_allocate)</para></listitem>
- <listitem><para>Setup initial behaviour module chain (bhv_insert_all_vfsops)</para></listitem>
- <listitem><para>Parse mount options (bhv_vfs_parseargs)</para></listitem>
- <listitem><para>Perform mount(bhv_vfs_mount)</para></listitem>
+ <listitem><para>Allocate a xfs_mount structure</para></listitem>
+ <listitem><para>Parse mount options (xfs_parseargs)</para></listitem>
+ <listitem><para>Open up the log and realtime device
+ <itemizedlist>
+ <listitem><para>xfs_alloc_buftarg starts a kernel thread for delayed write buffers for each device</para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>Call xfs_readsb to read the super block</para></listitem>
+ <listitem><para>Call xfs_finish_flags the mount options to what was in the super block</para></listitem>
+ <listitem><para>Tell the buffers what the sector size is going to be with xfs_setsize_buftarg</para></listitem>
+ <listitem><para>Check to see if this device supports write barriers</para></listitem>
+ <listitem><para>Then we call xfs_mountfs to complete the mount</para></listitem>
+ <listitem><para>Finally we read the root inode and start the sync daemon
+ (xfssyncd)</para></listitem>
</orderedlist>
</section>
<section>
- <title>Mount – Setup Behaviour Chain</title>
- <para>See bhv_insert_all_vfsops in xfs_vfs.c</para>
- <para>CXFS, DMAPI and Quotas can register with XFS so that their vfsops are loaded into the behaviour chain</para>
- <para>This does module loading and reference counting</para>
- <para>Each behaviour can also have custom operations that need to be loaded</para>
- <itemizedlist>
- <listitem><para>Specialised callouts in XFS to specific behaviour modules, if loaded</para></listitem>
- <listitem><para>These are loaded in xfs_mount once we know module will be used</para></listitem>
- </itemizedlist>
- </section>
- <section>
- <title>Mount – Parse Mount Options</title>
- <para>Each behaviour can grab options that are used by that behaviour module</para>
- <itemizedlist>
- <listitem><para>XFS does not need to know or understand additional mount options</para></listitem>
- </itemizedlist>
- <para>Behaviours may then remove themselves from the chain if they are not</para>
- <itemizedlist>
- <listitem><para>no dmi option so no need for dmapi</para></listitem>
- <listitem><para>no quota options so no need for quotas</para></listitem>
- <listitem><para>see bhv_remove_vfsops</para></listitem>
- </itemizedlist>
- </section>
- <section>
- <title>Mount – Actual Filesystem Mount</title>
- <para>Implemented in xfs_mount in xfs_vfsops.c</para>
- <para>Loads specialised behaviour operations for those modules in use</para>
- <para>Opens up the log and realtime device</para>
- <para>xfs_alloc_buftarg starts a kernel thread for delayed write buffers for each device</para>
- <para>XFS then call xfs_start_flags that starts setting up the xfs_mount_t structure, everything we can do before doing I/O from the mount options</para>
- <para>Then call xfs_readsb to read the super block and then xfs_finish_flags to compare the second part of the mount options to what was in the super block</para>
- </section>
- <section>
- <title>Mount – Actual Filesystem Mount</title>
- <para>Tell the buffers what the sector size is going to be with
-xfs_setsize_buftarg</para>
- <para>Check to see if this device supports write barriers</para>
- <para>Finally we call xfs_ioinit, which is a behaviour custom operation</para>
- <itemizedlist>
- <listitem><para>this one will call into CXFS if loaded for this filesystem</para></listitem>
- </itemizedlist>
- <para>xfs_ioinit calls xfs_mountfs to complete the mount</para>
- </section>
- <section>
<title>Mount - xfs_mountfs</title>
<para>Calls xfs_mount_common sets up additional mount_t fields from superbock</para>
<para>Check the end of the filesystem really does exist for each device</para>
<para>Initialise various data structures</para>
<itemizedlist>
- <listitem><para>Number of read ahead buffers based on physical memory</para></listitem>
<listitem><para>inode and stripe alignment</para></listitem>
- <listitem><para>allocate and initialise inode hash for this filesystem</para></listitem>
+ <listitem><para>allocate and initialise inode tree for this filesystem</para></listitem>
</itemizedlist>
- <para>Validate root inode and link into super block</para>
<para>Set up the transactions and log, and do log recovery</para>
- <para>Call out to quota custom ops to do the quota check</para>
+ <para>Call out to the quota manager to do the quota check</para>
</section>
<section>
<title>Transactions</title>
@@ -397,7 +288,7 @@ xfs_setsize_buftarg</para>
<para><programlisting>tp = xfs_trans_alloc(type);</programlisting></para>
<para>Reserve space for the transaction, quick lookup in mount_t structure</para>
<itemizedlist>
- <listitem><para>can return ENOSPACE</para></listitem>
+ <listitem><para>can return ENOSPC</para></listitem>
<listitem><para>reserved space can be large to cater for large ondisk structure changes</para></listitem>
<listitem><para>exceeding the reservation will cause XFS to dump a lot of diagnotistics before shutting down</para></listitem>
</itemizedlist>