€•å<Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ1/translations/zh_CN/filesystems/automount-support”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/zh_TW/filesystems/automount-support”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/it_IT/filesystems/automount-support”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/ja_JP/filesystems/automount-support”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/ko_KR/filesystems/automount-support”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/sp_SP/filesystems/automount-support”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh£sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1h¡hhhžhhŸŒK/var/lib/git/docbuild/linux/Documentation/filesystems/automount-support.rst”h KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒAutomount Support”h]”hŒAutomount Support”…””}”(hh»hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hh¶hžhhŸh³h KubhŒ paragraph”“”)”}”(hX&Support is available for filesystems that wish to do automounting support (such as kAFS which can be found in fs/afs/ and NFS in fs/nfs/). This facility includes allowing in-kernel mounts to be performed and mountpoint degradation to be requested. The latter can also be requested by userspace.”h]”hX&Support is available for filesystems that wish to do automounting support (such as kAFS which can be found in fs/afs/ and NFS in fs/nfs/). This facility includes allowing in-kernel mounts to be performed and mountpoint degradation to be requested. The latter can also be requested by userspace.”…””}”(hhËhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khh¶hžhubhµ)”}”(hhh]”(hº)”}”(hŒIn-Kernel Automounting”h]”hŒIn-Kernel Automounting”…””}”(hhÜhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hhÙhžhhŸh³h KubhÊ)”}”(hŒBSee section "Mount Traps" of Documentation/filesystems/autofs.rst”h]”hŒFSee section “Mount Traps†of Documentation/filesystems/autofs.rst”…””}”(hhêhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KhhÙhžhubhÊ)”}”(hŒ5Then from userspace, you can just do something like::”h]”hŒ4Then from userspace, you can just do something like:”…””}”(hhøhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KhhÙhžhubhŒ literal_block”“”)”}”(hX[root@andromeda root]# mount -t afs \#root.afs. /afs [root@andromeda root]# ls /afs asd cambridge cambridge.redhat.com grand.central.org [root@andromeda root]# ls /afs/cambridge afsdoc [root@andromeda root]# ls /afs/cambridge/afsdoc/ ChangeLog html LICENSE pdf RELNOTES-1.2.2”h]”hX[root@andromeda root]# mount -t afs \#root.afs. /afs [root@andromeda root]# ls /afs asd cambridge cambridge.redhat.com grand.central.org [root@andromeda root]# ls /afs/cambridge afsdoc [root@andromeda root]# ls /afs/cambridge/afsdoc/ ChangeLog html LICENSE pdf RELNOTES-1.2.2”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jhŸh³h KhhÙhžhubhÊ)”}”(hŒMAnd then if you look in the mountpoint catalogue, you'll see something like::”h]”hŒNAnd then if you look in the mountpoint catalogue, you’ll see something like:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KhhÙhžhubj)”}”(hŒ¬[root@andromeda root]# cat /proc/mounts ... #root.afs. /afs afs rw 0 0 #root.cell. /afs/cambridge.redhat.com afs rw 0 0 #afsdoc. /afs/cambridge.redhat.com/afsdoc afs rw 0 0”h]”hŒ¬[root@andromeda root]# cat /proc/mounts ... #root.afs. /afs afs rw 0 0 #root.cell. /afs/cambridge.redhat.com afs rw 0 0 #afsdoc. /afs/cambridge.redhat.com/afsdoc afs rw 0 0”…””}”hj$sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jhŸh³h K hhÙhžhubeh}”(h]”Œin-kernel-automounting”ah ]”h"]”Œin-kernel automounting”ah$]”h&]”uh1h´hh¶hžhhŸh³h Kubhµ)”}”(hhh]”(hº)”}”(hŒAutomatic Mountpoint Expiry”h]”hŒAutomatic Mountpoint Expiry”…””}”(hj=hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj:hžhhŸh³h K(ubhÊ)”}”(hŒ”Automatic expiration of mountpoints is easy, provided you've mounted the mountpoint to be expired in the automounting procedure outlined separately.”h]”hŒ–Automatic expiration of mountpoints is easy, provided you’ve mounted the mountpoint to be expired in the automounting procedure outlined separately.”…””}”(hjKhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K*hj:hžhubhÊ)”}”(hŒ1To do expiration, you need to follow these steps:”h]”hŒ1To do expiration, you need to follow these steps:”…””}”(hjYhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K-hj:hžhubhŒ block_quote”“”)”}”(hX#(1) Create at least one list off which the vfsmounts to be expired can be hung. (2) When a new mountpoint is created in the ->d_automount method, add the mnt to the list using mnt_set_expiry():: mnt_set_expiry(newmnt, &afs_vfsmounts); (3) When you want mountpoints to be expired, call mark_mounts_for_expiry() with a pointer to this list. This will process the list, marking every vfsmount thereon for potential expiry on the next call. If a vfsmount was already flagged for expiry, and if its usage count is 1 (it's only referenced by its parent vfsmount), then it will be deleted from the namespace and thrown away (effectively unmounted). It may prove simplest to simply call this at regular intervals, using some sort of timed event to drive it. ”h]”hŒenumerated_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒLCreate at least one list off which the vfsmounts to be expired can be hung. ”h]”hÊ)”}”(hŒKCreate at least one list off which the vfsmounts to be expired can be hung.”h]”hŒKCreate at least one list off which the vfsmounts to be expired can be hung.”…””}”(hjxhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K/hjtubah}”(h]”h ]”h"]”h$]”h&]”uh1jrhjoubjs)”}”(hŒ When a new mountpoint is created in the ->d_automount method, add the mnt to the list using mnt_set_expiry():: mnt_set_expiry(newmnt, &afs_vfsmounts); ”h]”(hÊ)”}”(hŒnWhen a new mountpoint is created in the ->d_automount method, add the mnt to the list using mnt_set_expiry()::”h]”hŒmWhen a new mountpoint is created in the ->d_automount method, add the mnt to the list using mnt_set_expiry():”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K2hjŒubj)”}”(hŒ'mnt_set_expiry(newmnt, &afs_vfsmounts);”h]”hŒ'mnt_set_expiry(newmnt, &afs_vfsmounts);”…””}”hjžsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jhŸh³h K5hjŒubeh}”(h]”h ]”h"]”h$]”h&]”uh1jrhjoubjs)”}”(hXWhen you want mountpoints to be expired, call mark_mounts_for_expiry() with a pointer to this list. This will process the list, marking every vfsmount thereon for potential expiry on the next call. If a vfsmount was already flagged for expiry, and if its usage count is 1 (it's only referenced by its parent vfsmount), then it will be deleted from the namespace and thrown away (effectively unmounted). It may prove simplest to simply call this at regular intervals, using some sort of timed event to drive it. ”h]”(hÊ)”}”(hŒÅWhen you want mountpoints to be expired, call mark_mounts_for_expiry() with a pointer to this list. This will process the list, marking every vfsmount thereon for potential expiry on the next call.”h]”hŒÅWhen you want mountpoints to be expired, call mark_mounts_for_expiry() with a pointer to this list. This will process the list, marking every vfsmount thereon for potential expiry on the next call.”…””}”(hj¶hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K7hj²ubhÊ)”}”(hŒÌIf a vfsmount was already flagged for expiry, and if its usage count is 1 (it's only referenced by its parent vfsmount), then it will be deleted from the namespace and thrown away (effectively unmounted).”h]”hŒÎIf a vfsmount was already flagged for expiry, and if its usage count is 1 (it’s only referenced by its parent vfsmount), then it will be deleted from the namespace and thrown away (effectively unmounted).”…””}”(hjÄhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K;hj²ubhÊ)”}”(hŒkIt may prove simplest to simply call this at regular intervals, using some sort of timed event to drive it.”h]”hŒkIt may prove simplest to simply call this at regular intervals, using some sort of timed event to drive it.”…””}”(hjÒhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K?hj²ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jrhjoubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”Œ(”Œsuffix”Œ)”uh1jmhjiubah}”(h]”h ]”h"]”h$]”h&]”uh1jghŸh³h K/hj:hžhubhÊ)”}”(hŒ°The expiration flag is cleared by calls to mntput. This means that expiration will only happen on the second expiration request after the last time the mountpoint was accessed.”h]”hŒ°The expiration flag is cleared by calls to mntput. This means that expiration will only happen on the second expiration request after the last time the mountpoint was accessed.”…””}”(hjøhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KBhj:hžhubhÊ)”}”(hŒ»If a mountpoint is moved, it gets removed from the expiration list. If a bind mount is made on an expirable mount, the new vfsmount will not be on the expiration list and will not expire.”h]”hŒ»If a mountpoint is moved, it gets removed from the expiration list. If a bind mount is made on an expirable mount, the new vfsmount will not be on the expiration list and will not expire.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KFhj:hžhubhÊ)”}”(hŒ­If a namespace is copied, all mountpoints contained therein will be copied, and the copies of those that are on an expiration list will be added to the same expiration list.”h]”hŒ­If a namespace is copied, all mountpoints contained therein will be copied, and the copies of those that are on an expiration list will be added to the same expiration list.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KJhj:hžhubeh}”(h]”Œautomatic-mountpoint-expiry”ah ]”h"]”Œautomatic mountpoint expiry”ah$]”h&]”uh1h´hh¶hžhhŸh³h K(ubhµ)”}”(hhh]”(hº)”}”(hŒUserspace Driven Expiry”h]”hŒUserspace Driven Expiry”…””}”(hj-hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj*hžhhŸh³h KPubhÊ)”}”(hX'As an alternative, it is possible for userspace to request expiry of any mountpoint (though some will be rejected - the current process's idea of the rootfs for example). It does this by passing the MNT_EXPIRE flag to umount(). This flag is considered incompatible with MNT_FORCE and MNT_DETACH.”h]”hX)As an alternative, it is possible for userspace to request expiry of any mountpoint (though some will be rejected - the current process’s idea of the rootfs for example). It does this by passing the MNT_EXPIRE flag to umount(). This flag is considered incompatible with MNT_FORCE and MNT_DETACH.”…””}”(hj;hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KRhj*hžhubhÊ)”}”(hŒÌIf the mountpoint in question is in referenced by something other than umount() or its parent mountpoint, an EBUSY error will be returned and the mountpoint will not be marked for expiration or unmounted.”h]”hŒÌIf the mountpoint in question is in referenced by something other than umount() or its parent mountpoint, an EBUSY error will be returned and the mountpoint will not be marked for expiration or unmounted.”…””}”(hjIhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KWhj*hžhubhÊ)”}”(hŒzIf the mountpoint was not already marked for expiry at that time, an EAGAIN error will be given and it won't be unmounted.”h]”hŒ|If the mountpoint was not already marked for expiry at that time, an EAGAIN error will be given and it won’t be unmounted.”…””}”(hjWhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K[hj*hžhubhÊ)”}”(hŒaOtherwise if it was already marked and it wasn't referenced, unmounting will take place as usual.”h]”hŒcOtherwise if it was already marked and it wasn’t referenced, unmounting will take place as usual.”…””}”(hjehžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K^hj*hžhubhÊ)”}”(hŒdAgain, the expiration flag is cleared every time anything other than umount() looks at a mountpoint.”h]”hŒdAgain, the expiration flag is cleared every time anything other than umount() looks at a mountpoint.”…””}”(hjshžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Kahj*hžhubeh}”(h]”Œuserspace-driven-expiry”ah ]”h"]”Œuserspace driven expiry”ah$]”h&]”uh1h´hh¶hžhhŸh³h KPubeh}”(h]”Œautomount-support”ah ]”h"]”Œautomount support”ah$]”h&]”uh1h´hhhžhhŸh³h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h³uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¹NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j´Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h³Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jŽj‹j7j4j'j$j†jƒuŒ nametypes”}”(jމj7‰j'‰j†‰uh}”(j‹h¶j4hÙj$j:jƒj*uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.