€•Å=Œ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ŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/pt_BR/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:”…””}”(hj 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:”…””}”(hj*h²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”…””}”hj8sbah}”(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”…””}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjNh²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.”…””}”(hj_h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K*hjNh²hubhÞ)”}”(hŒ1To do expiration, you need to follow these steps:”h]”hŒ1To do expiration, you need to follow these steps:”…””}”(hjmh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K-hjNh²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.”…””}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K/hjˆubah}”(h]”h ]”h"]”h$]”h&]”uh1j†hjƒubj‡)”}”(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():”…””}”(hj¤h²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&]”uh1j†hjƒubj‡)”}”(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&]”uh1j†hjƒubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”Œ(”Œsuffix”Œ)”uh1jhj}ubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´K/hjNh²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´KBhjNh²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´KFhjNh²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.”…””}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KJhjNh²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”…””}”(hjAh²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.”…””}”(hjOh²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.”…””}”(hj]h²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.”…””}”(hjkh²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.”…””}”(hjyh²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.”…””}”(hj‡h²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ŸjKjHj;j8jšj—uŒ nametypes”}”(j¢‰jK‰j;‰jš‰uh}”(jŸhÊjHhíj8jNj—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.