€•ó_Œ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”Œ./translations/zh_CN/core-api/symbol-namespaces”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/zh_TW/core-api/symbol-namespaces”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/it_IT/core-api/symbol-namespaces”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/ja_JP/core-api/symbol-namespaces”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/ko_KR/core-api/symbol-namespaces”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/sp_SP/core-api/symbol-namespaces”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒSymbol Namespaces”h]”hŒSymbol Namespaces”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒH/var/lib/git/docbuild/linux/Documentation/core-api/symbol-namespaces.rst”h KubhŒ paragraph”“”)”}”(hŒ©The following document describes how to use Symbol Namespaces to structure the export surface of in-kernel symbols exported through the family of EXPORT_SYMBOL() macros.”h]”hŒ©The following document describes how to use Symbol Namespaces to structure the export surface of in-kernel symbols exported through the family of EXPORT_SYMBOL() macros.”…””}”(hh¹hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¢)”}”(hhh]”(h§)”}”(hŒ Introduction”h]”hŒ Introduction”…””}”(hhÊhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hhÇhžhhŸh¶h K ubh¸)”}”(hX^Symbol Namespaces have been introduced as a means to structure the export surface of the in-kernel API. It allows subsystem maintainers to partition their exported symbols into separate namespaces. That is useful for documentation purposes (think of the SUBSYSTEM_DEBUG namespace) as well as for limiting the availability of a set of symbols for use in other parts of the kernel. As of today, modules that make use of symbols exported into namespaces, are required to import the namespace. Otherwise the kernel will, depending on its configuration, reject loading the module or warn about a missing import.”h]”hX^Symbol Namespaces have been introduced as a means to structure the export surface of the in-kernel API. It allows subsystem maintainers to partition their exported symbols into separate namespaces. That is useful for documentation purposes (think of the SUBSYSTEM_DEBUG namespace) as well as for limiting the availability of a set of symbols for use in other parts of the kernel. As of today, modules that make use of symbols exported into namespaces, are required to import the namespace. Otherwise the kernel will, depending on its configuration, reject loading the module or warn about a missing import.”…””}”(hhØhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K hhÇhžhubh¸)”}”(hŒ†Additionally, it is possible to put symbols into a module namespace, strictly limiting which modules are allowed to use these symbols.”h]”hŒ†Additionally, it is possible to put symbols into a module namespace, strictly limiting which modules are allowed to use these symbols.”…””}”(hhæhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KhhÇhžhubeh}”(h]”Œ introduction”ah ]”h"]”Œ introduction”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K ubh¢)”}”(hhh]”(h§)”}”(hŒHow to define Symbol Namespaces”h]”hŒHow to define Symbol Namespaces”…””}”(hhÿhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hhühžhhŸh¶h Kubh¸)”}”(hŒ¦Symbols can be exported into namespace using different methods. All of them are changing the way EXPORT_SYMBOL and friends are instrumented to create ksymtab entries.”h]”hŒ¦Symbols can be exported into namespace using different methods. All of them are changing the way EXPORT_SYMBOL and friends are instrumented to create ksymtab entries.”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khhühžhubh¢)”}”(hhh]”(h§)”}”(hŒUsing the EXPORT_SYMBOL macros”h]”hŒUsing the EXPORT_SYMBOL macros”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjhžhhŸh¶h K ubh¸)”}”(hXÔIn addition to the macros EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL(), that allow exporting of kernel symbols to the kernel symbol table, variants of these are available to export symbols into a certain namespace: EXPORT_SYMBOL_NS() and EXPORT_SYMBOL_NS_GPL(). They take one additional argument: the namespace as a string constant. Note that this string must not contain whitespaces. E.g. to export the symbol ``usb_stor_suspend`` into the namespace ``USB_STORAGE``, use::”h]”(hX–In addition to the macros EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL(), that allow exporting of kernel symbols to the kernel symbol table, variants of these are available to export symbols into a certain namespace: EXPORT_SYMBOL_NS() and EXPORT_SYMBOL_NS_GPL(). They take one additional argument: the namespace as a string constant. Note that this string must not contain whitespaces. E.g. to export the symbol ”…””}”(hj,hžhhŸNh NubhŒliteral”“”)”}”(hŒ``usb_stor_suspend``”h]”hŒusb_stor_suspend”…””}”(hj6hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j4hj,ubhŒ into the namespace ”…””}”(hj,hžhhŸNh Nubj5)”}”(hŒ``USB_STORAGE``”h]”hŒ USB_STORAGE”…””}”(hjHhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j4hj,ubhŒ, use:”…””}”(hj,hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K"hjhžhubhŒ literal_block”“”)”}”(hŒ2EXPORT_SYMBOL_NS(usb_stor_suspend, "USB_STORAGE");”h]”hŒ2EXPORT_SYMBOL_NS(usb_stor_suspend, "USB_STORAGE");”…””}”hjbsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1j`hŸh¶h K*hjhžhubh¸)”}”(hXQThe corresponding ksymtab entry struct ``kernel_symbol`` will have the member ``namespace`` set accordingly. A symbol that is exported without a namespace will refer to ``NULL``. There is no default namespace if none is defined. ``modpost`` and kernel/module/main.c make use the namespace at build time or module load time, respectively.”h]”(hŒ'The corresponding ksymtab entry struct ”…””}”(hjrhžhhŸNh Nubj5)”}”(hŒ``kernel_symbol``”h]”hŒ kernel_symbol”…””}”(hjzhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j4hjrubhŒ will have the member ”…””}”(hjrhžhhŸNh Nubj5)”}”(hŒ ``namespace``”h]”hŒ namespace”…””}”(hjŒhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j4hjrubhŒN set accordingly. A symbol that is exported without a namespace will refer to ”…””}”(hjrhžhhŸNh Nubj5)”}”(hŒ``NULL``”h]”hŒNULL”…””}”(hjžhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j4hjrubhŒ4. There is no default namespace if none is defined. ”…””}”(hjrhžhhŸNh Nubj5)”}”(hŒ ``modpost``”h]”hŒmodpost”…””}”(hj°hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j4hjrubhŒa and kernel/module/main.c make use the namespace at build time or module load time, respectively.”…””}”(hjrhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K,hjhžhubeh}”(h]”Œusing-the-export-symbol-macros”ah ]”h"]”Œusing the export_symbol macros”ah$]”h&]”uh1h¡hhühžhhŸh¶h K ubh¢)”}”(hhh]”(h§)”}”(hŒ)Using the DEFAULT_SYMBOL_NAMESPACE define”h]”hŒ)Using the DEFAULT_SYMBOL_NAMESPACE define”…””}”(hjÓhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjÐhžhhŸh¶h K3ubh¸)”}”(hX7Defining namespaces for all symbols of a subsystem can be very verbose and may become hard to maintain. Therefore a default define (DEFAULT_SYMBOL_NAMESPACE) is been provided, that, if set, will become the default for all EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL() macro expansions that do not specify a namespace.”h]”hX7Defining namespaces for all symbols of a subsystem can be very verbose and may become hard to maintain. Therefore a default define (DEFAULT_SYMBOL_NAMESPACE) is been provided, that, if set, will become the default for all EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL() macro expansions that do not specify a namespace.”…””}”(hjáhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K5hjÐhžhubh¸)”}”(hXdThere are multiple ways of specifying this define and it depends on the subsystem and the maintainer's preference, which one to use. The first option is to define the default namespace in the ``Makefile`` of the subsystem. E.g. to export all symbols defined in usb-common into the namespace USB_COMMON, add a line like this to drivers/usb/common/Makefile::”h]”(hŒÂThere are multiple ways of specifying this define and it depends on the subsystem and the maintainer’s preference, which one to use. The first option is to define the default namespace in the ”…””}”(hjïhžhhŸNh Nubj5)”}”(hŒ ``Makefile``”h]”hŒMakefile”…””}”(hj÷hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j4hjïubhŒ— of the subsystem. E.g. to export all symbols defined in usb-common into the namespace USB_COMMON, add a line like this to drivers/usb/common/Makefile:”…””}”(hjïhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K:hjÐhžhubja)”}”(hŒ6ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE='"USB_COMMON"'”h]”hŒ6ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE='"USB_COMMON"'”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jpjquh1j`hŸh¶h K@hjÐhžhubh¸)”}”(hX(That will affect all EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL() statements. A symbol exported with EXPORT_SYMBOL_NS() while this definition is present, will still be exported into the namespace that is passed as the namespace argument as this argument has preference over a default symbol namespace.”h]”hX(That will affect all EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL() statements. A symbol exported with EXPORT_SYMBOL_NS() while this definition is present, will still be exported into the namespace that is passed as the namespace argument as this argument has preference over a default symbol namespace.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KBhjÐhžhubh¸)”}”(hŒ’A second option to define the default namespace is directly in the compilation unit as preprocessor statement. The above example would then read::”h]”hŒ‘A second option to define the default namespace is directly in the compilation unit as preprocessor statement. The above example would then read:”…””}”(hj+hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KGhjÐhžhubja)”}”(hŒ-#define DEFAULT_SYMBOL_NAMESPACE "USB_COMMON"”h]”hŒ-#define DEFAULT_SYMBOL_NAMESPACE "USB_COMMON"”…””}”hj9sbah}”(h]”h ]”h"]”h$]”h&]”jpjquh1j`hŸh¶h KJhjÐhžhubh¸)”}”(hŒŽwithin the corresponding compilation unit before the #include for . Typically it's placed before the first #include statement.”h]”hŒwithin the corresponding compilation unit before the #include for . Typically it’s placed before the first #include statement.”…””}”(hjGhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KLhjÐhžhubeh}”(h]”Œ)using-the-default-symbol-namespace-define”ah ]”h"]”Œ)using the default_symbol_namespace define”ah$]”h&]”uh1h¡hhühžhhŸh¶h K3ubh¢)”}”(hhh]”(h§)”}”(hŒ/Using the EXPORT_SYMBOL_GPL_FOR_MODULES() macro”h]”hŒ/Using the EXPORT_SYMBOL_GPL_FOR_MODULES() macro”…””}”(hj`hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj]hžhhŸh¶h KPubh¸)”}”(hŒeSymbols exported using this macro are put into a module namespace. This namespace cannot be imported.”h]”hŒeSymbols exported using this macro are put into a module namespace. This namespace cannot be imported.”…””}”(hjnhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KRhj]hžhubh¸)”}”(hŒ‹The macro takes a comma separated list of module names, allowing only those modules to access this symbol. Simple tail-globs are supported.”h]”hŒ‹The macro takes a comma separated list of module names, allowing only those modules to access this symbol. Simple tail-globs are supported.”…””}”(hj|hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KUhj]hžhubh¸)”}”(hŒ For example::”h]”hŒ For example:”…””}”(hjŠhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KXhj]hžhubja)”}”(hŒ@EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-*")”h]”hŒ@EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-*")”…””}”hj˜sbah}”(h]”h ]”h"]”h$]”h&]”jpjquh1j`hŸh¶h KZhj]hžhubh¸)”}”(hŒQwill limit usage of this symbol to modules whoes name matches the given patterns.”h]”hŒQwill limit usage of this symbol to modules whoes name matches the given patterns.”…””}”(hj¦hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K\hj]hžhubeh}”(h]”Œ-using-the-export-symbol-gpl-for-modules-macro”ah ]”h"]”Œ/using the export_symbol_gpl_for_modules() macro”ah$]”h&]”uh1h¡hhühžhhŸh¶h KPubeh}”(h]”Œhow-to-define-symbol-namespaces”ah ]”h"]”Œhow to define symbol namespaces”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒ)How to use Symbols exported in Namespaces”h]”hŒ)How to use Symbols exported in Namespaces”…””}”(hjÇhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjÄhžhhŸh¶h K`ubh¸)”}”(hX‘In order to use symbols that are exported into namespaces, kernel modules need to explicitly import these namespaces. Otherwise the kernel might reject to load the module. The module code is required to use the macro MODULE_IMPORT_NS for the namespaces it uses symbols from. E.g. a module using the usb_stor_suspend symbol from above, needs to import the namespace USB_STORAGE using a statement like::”h]”hXIn order to use symbols that are exported into namespaces, kernel modules need to explicitly import these namespaces. Otherwise the kernel might reject to load the module. The module code is required to use the macro MODULE_IMPORT_NS for the namespaces it uses symbols from. E.g. a module using the usb_stor_suspend symbol from above, needs to import the namespace USB_STORAGE using a statement like:”…””}”(hjÕhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KbhjÄhžhubja)”}”(hŒ MODULE_IMPORT_NS("USB_STORAGE");”h]”hŒ MODULE_IMPORT_NS("USB_STORAGE");”…””}”hjãsbah}”(h]”h ]”h"]”h$]”h&]”jpjquh1j`hŸh¶h KihjÄhžhubh¸)”}”(hŒ°This will create a ``modinfo`` tag in the module for each imported namespace. This has the side effect, that the imported namespaces of a module can be inspected with modinfo::”h]”(hŒThis will create a ”…””}”(hjñhžhhŸNh Nubj5)”}”(hŒ ``modinfo``”h]”hŒmodinfo”…””}”(hjùhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j4hjñubhŒ‘ tag in the module for each imported namespace. This has the side effect, that the imported namespaces of a module can be inspected with modinfo:”…””}”(hjñhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KkhjÄhžhubja)”}”(hŒR$ modinfo drivers/usb/storage/ums-karma.ko [...] import_ns: USB_STORAGE [...]”h]”hŒR$ modinfo drivers/usb/storage/ums-karma.ko [...] import_ns: USB_STORAGE [...]”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jpjquh1j`hŸh¶h KohjÄhžhubh¸)”}”(hŒŒIt is advisable to add the MODULE_IMPORT_NS() statement close to other module metadata definitions like MODULE_AUTHOR() or MODULE_LICENSE().”h]”hŒŒIt is advisable to add the MODULE_IMPORT_NS() statement close to other module metadata definitions like MODULE_AUTHOR() or MODULE_LICENSE().”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KuhjÄhžhubeh}”(h]”Œ)how-to-use-symbols-exported-in-namespaces”ah ]”h"]”Œ)how to use symbols exported in namespaces”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K`ubh¢)”}”(hhh]”(h§)”}”(hŒ+Loading Modules that use namespaced Symbols”h]”hŒ+Loading Modules that use namespaced Symbols”…””}”(hj8hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj5hžhhŸh¶h Kyubh¸)”}”(hXPAt module loading time (e.g. ``insmod``), the kernel will check each symbol referenced from the module for its availability and whether the namespace it might be exported to has been imported by the module. The default behaviour of the kernel is to reject loading modules that don't specify sufficient imports. An error will be logged and loading will be failed with EINVAL. In order to allow loading of modules that don't satisfy this precondition, a configuration option is available: Setting MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS=y will enable loading regardless, but will emit a warning.”h]”(hŒAt module loading time (e.g. ”…””}”(hjFhžhhŸNh Nubj5)”}”(hŒ ``insmod``”h]”hŒinsmod”…””}”(hjNhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j4hjFubhX-), the kernel will check each symbol referenced from the module for its availability and whether the namespace it might be exported to has been imported by the module. The default behaviour of the kernel is to reject loading modules that don’t specify sufficient imports. An error will be logged and loading will be failed with EINVAL. In order to allow loading of modules that don’t satisfy this precondition, a configuration option is available: Setting MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS=y will enable loading regardless, but will emit a warning.”…””}”(hjFhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K{hj5hžhubeh}”(h]”Œ+loading-modules-that-use-namespaced-symbols”ah ]”h"]”Œ+loading modules that use namespaced symbols”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kyubh¢)”}”(hhh]”(h§)”}”(hŒ2Automatically creating MODULE_IMPORT_NS statements”h]”hŒ2Automatically creating MODULE_IMPORT_NS statements”…””}”(hjqhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjnhžhhŸh¶h K…ubh¸)”}”(hXÇMissing namespaces imports can easily be detected at build time. In fact, modpost will emit a warning if a module uses a symbol from a namespace without importing it. MODULE_IMPORT_NS() statements will usually be added at a definite location (along with other module meta data). To make the life of module authors (and subsystem maintainers) easier, a script and make target is available to fixup missing imports. Fixing missing imports can be done with::”h]”hXÆMissing namespaces imports can easily be detected at build time. In fact, modpost will emit a warning if a module uses a symbol from a namespace without importing it. MODULE_IMPORT_NS() statements will usually be added at a definite location (along with other module meta data). To make the life of module authors (and subsystem maintainers) easier, a script and make target is available to fixup missing imports. Fixing missing imports can be done with:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K‡hjnhžhubja)”}”(hŒ $ make nsdeps”h]”hŒ $ make nsdeps”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jpjquh1j`hŸh¶h Khjnhžhubh¸)”}”(hŒ0A typical scenario for module authors would be::”h]”hŒ/A typical scenario for module authors would be:”…””}”(hj›hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K‘hjnhžhubja)”}”(hŒÒ- write code that depends on a symbol from a not imported namespace - ``make`` - notice the warning of modpost telling about a missing import - run ``make nsdeps`` to add the import to the correct code location”h]”hŒÒ- write code that depends on a symbol from a not imported namespace - ``make`` - notice the warning of modpost telling about a missing import - run ``make nsdeps`` to add the import to the correct code location”…””}”hj©sbah}”(h]”h ]”h"]”h$]”h&]”jpjquh1j`hŸh¶h K“hjnhžhubh¸)”}”(hŒ­For subsystem maintainers introducing a namespace, the steps are very similar. Again, ``make nsdeps`` will eventually add the missing namespace imports for in-tree modules::”h]”(hŒVFor subsystem maintainers introducing a namespace, the steps are very similar. Again, ”…””}”(hj·hžhhŸNh Nubj5)”}”(hŒ``make nsdeps``”h]”hŒ make nsdeps”…””}”(hj¿hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j4hj·ubhŒG will eventually add the missing namespace imports for in-tree modules:”…””}”(hj·hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K˜hjnhžhubja)”}”(hX- move or add symbols to a namespace (e.g. with EXPORT_SYMBOL_NS()) - ``make`` (preferably with an allmodconfig to cover all in-kernel modules) - notice the warning of modpost telling about a missing import - run ``make nsdeps`` to add the import to the correct code location”h]”hX- move or add symbols to a namespace (e.g. with EXPORT_SYMBOL_NS()) - ``make`` (preferably with an allmodconfig to cover all in-kernel modules) - notice the warning of modpost telling about a missing import - run ``make nsdeps`` to add the import to the correct code location”…””}”hj×sbah}”(h]”h ]”h"]”h$]”h&]”jpjquh1j`hŸh¶h Kœhjnhžhubh¸)”}”(hŒHYou can also run nsdeps for external module builds. A typical usage is::”h]”hŒGYou can also run nsdeps for external module builds. A typical usage is:”…””}”(hjåhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K¢hjnhžhubja)”}”(hŒ,$ make -C M=$PWD nsdeps”h]”hŒ,$ make -C M=$PWD nsdeps”…””}”hjósbah}”(h]”h ]”h"]”h$]”h&]”jpjquh1j`hŸh¶h K¤hjnhžhubh¸)”}”(hŒŠNote: it will happily generate an import statement for the module namespace; which will not work and generates build and runtime failures.”h]”hŒŠNote: it will happily generate an import statement for the module namespace; which will not work and generates build and runtime failures.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K¦hjnhžhubeh}”(h]”Œ2automatically-creating-module-import-ns-statements”ah ]”h"]”Œ2automatically creating module_import_ns statements”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K…ubeh}”(h]”Œsymbol-namespaces”ah ]”h"]”Œsymbol namespaces”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”jBŒ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”}”(jjhùhöjÁj¾jÍjÊjZjWj¹j¶j2j/jkjhjjuŒ nametypes”}”(j‰hù‰jÁ‰j͉jZ‰j¹‰j2‰jk‰j‰uh}”(jh£höhÇj¾hüjÊjjWjÐj¶j]j/jÄjhj5jjnuŒ 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.