€•_»Œ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/filesystems/seq_file”Œ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/filesystems/seq_file”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/it_IT/filesystems/seq_file”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/ja_JP/filesystems/seq_file”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/ko_KR/filesystems/seq_file”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/pt_BR/filesystems/seq_file”Œ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/filesystems/seq_file”Œ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³ŒB/var/lib/git/docbuild/linux/Documentation/filesystems/seq_file.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒThe seq_file Interface”h]”hŒThe seq_file Interface”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ block_quote”“”)”}”(hŒCopyright 2003 Jonathan Corbet This file is originally from the LWN.net Driver Porting series at https://lwn.net/Articles/driver-porting/ ”h]”(hŒ paragraph”“”)”}”(hŒ/Copyright 2003 Jonathan Corbet ”h]”(hŒ Copyright 2003 Jonathan Corbet <”…””}”(hhåh²hh³Nh´NubhŒ reference”“”)”}”(hŒcorbet@lwn.net”h]”hŒcorbet@lwn.net”…””}”(hhïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:corbet@lwn.net”uh1híhhåubhŒ>”…””}”(hhåh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khhßubhä)”}”(hŒjThis file is originally from the LWN.net Driver Porting series at https://lwn.net/Articles/driver-porting/”h]”(hŒBThis file is originally from the LWN.net Driver Porting series at ”…””}”(hj h²hh³Nh´Nubhî)”}”(hŒ(https://lwn.net/Articles/driver-porting/”h]”hŒ(https://lwn.net/Articles/driver-porting/”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”juh1híhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K hhßubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhä)”}”(hXÈThere are numerous ways for a device driver (or other kernel component) to provide information to the user or system administrator. One useful technique is the creation of virtual files, in debugfs, /proc or elsewhere. Virtual files can provide human-readable output that is easy to get at without any special utility programs; they can also make life easier for script writers. It is not surprising that the use of virtual files has grown over the years.”h]”hXÈThere are numerous ways for a device driver (or other kernel component) to provide information to the user or system administrator. One useful technique is the creation of virtual files, in debugfs, /proc or elsewhere. Virtual files can provide human-readable output that is easy to get at without any special utility programs; they can also make life easier for script writers. It is not surprising that the use of virtual files has grown over the years.”…””}”(hj,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K hhÊh²hubhä)”}”(hXCreating those files correctly has always been a bit of a challenge, however. It is not that hard to make a virtual file which returns a string. But life gets trickier if the output is long - anything greater than an application is likely to read in a single operation. Handling multiple reads (and seeks) requires careful attention to the reader's position within the virtual file - that position is, likely as not, in the middle of a line of output. The kernel has traditionally had a number of implementations that got this wrong.”h]”hXCreating those files correctly has always been a bit of a challenge, however. It is not that hard to make a virtual file which returns a string. But life gets trickier if the output is long - anything greater than an application is likely to read in a single operation. Handling multiple reads (and seeks) requires careful attention to the reader’s position within the virtual file - that position is, likely as not, in the middle of a line of output. The kernel has traditionally had a number of implementations that got this wrong.”…””}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KhhÊh²hubhä)”}”(hŒ˜The kernel now contains a set of functions (implemented by Alexander Viro) which are designed to make it easy for virtual file creators to get it right.”h]”hŒ˜The kernel now contains a set of functions (implemented by Alexander Viro) which are designed to make it easy for virtual file creators to get it right.”…””}”(hjHh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KhhÊh²hubhä)”}”(hŒ`The seq_file interface is available via . There are three aspects to seq_file:”h]”hŒ`The seq_file interface is available via . There are three aspects to seq_file:”…””}”(hjVh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K"hhÊh²hubhÞ)”}”(hXA* An iterator interface which lets a virtual file implementation step through the objects it is presenting. * Some utility functions for formatting objects for output without needing to worry about things like output buffers. * A set of canned file_operations which implement most operations on the virtual file. ”h]”hŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒjAn iterator interface which lets a virtual file implementation step through the objects it is presenting. ”h]”hä)”}”(hŒiAn iterator interface which lets a virtual file implementation step through the objects it is presenting.”h]”hŒiAn iterator interface which lets a virtual file implementation step through the objects it is presenting.”…””}”(hjsh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K%hjoubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjjubjn)”}”(hŒtSome utility functions for formatting objects for output without needing to worry about things like output buffers. ”h]”hä)”}”(hŒsSome utility functions for formatting objects for output without needing to worry about things like output buffers.”h]”hŒsSome utility functions for formatting objects for output without needing to worry about things like output buffers.”…””}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K(hj‡ubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjjubjn)”}”(hŒUA set of canned file_operations which implement most operations on the virtual file. ”h]”hä)”}”(hŒTA set of canned file_operations which implement most operations on the virtual file.”h]”hŒTA set of canned file_operations which implement most operations on the virtual file.”…””}”(hj£h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K+hjŸubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjjubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1jhh³hÇh´K%hjdubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K%hhÊh²hubhä)”}”(hX}We'll look at the seq_file interface via an extremely simple example: a loadable module which creates a file called /proc/sequence. The file, when read, simply produces a set of increasing integer values, one per line. The sequence will continue until the user loses patience and finds something better to do. The file is seekable, in that one can do something like the following::”h]”hX~We’ll look at the seq_file interface via an extremely simple example: a loadable module which creates a file called /proc/sequence. The file, when read, simply produces a set of increasing integer values, one per line. The sequence will continue until the user loses patience and finds something better to do. The file is seekable, in that one can do something like the following:”…””}”(hjÅh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K.hhÊh²hubhŒ literal_block”“”)”}”(hŒPdd if=/proc/sequence of=out1 count=1 dd if=/proc/sequence skip=1 of=out2 count=1”h]”hŒPdd if=/proc/sequence of=out1 count=1 dd if=/proc/sequence skip=1 of=out2 count=1”…””}”hjÕsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´K5hhÊh²hubhä)”}”(hX1Then concatenate the output files out1 and out2 and get the right result. Yes, it is a thoroughly useless module, but the point is to show how the mechanism works without getting lost in other details. (Those wanting to see the full source for this module can find it at https://lwn.net/Articles/22359/).”h]”(hXThen concatenate the output files out1 and out2 and get the right result. Yes, it is a thoroughly useless module, but the point is to show how the mechanism works without getting lost in other details. (Those wanting to see the full source for this module can find it at ”…””}”(hjãh²hh³Nh´Nubhî)”}”(hŒhttps://lwn.net/Articles/22359/”h]”hŒhttps://lwn.net/Articles/22359/”…””}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jíuh1híhjãubhŒ).”…””}”(hjãh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K8hhÊh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒDeprecated create_proc_entry”h]”hŒDeprecated create_proc_entry”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´K?ubhä)”}”(hŒ„Note that the above article uses create_proc_entry which was removed in kernel 3.10. Current versions require the following update::”h]”hŒƒNote that the above article uses create_proc_entry which was removed in kernel 3.10. Current versions require the following update:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KAhjh²hubjÔ)”}”(hŒ«- entry = create_proc_entry("sequence", 0, NULL); - if (entry) - entry->proc_fops = &ct_file_ops; + entry = proc_create("sequence", 0, NULL, &ct_file_ops);”h]”hŒ«- entry = create_proc_entry("sequence", 0, NULL); - if (entry) - entry->proc_fops = &ct_file_ops; + entry = proc_create("sequence", 0, NULL, &ct_file_ops);”…””}”hj#sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´KDhjh²hubeh}”(h]”Œdeprecated-create-proc-entry”ah ]”h"]”Œdeprecated create_proc_entry”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K?ubhÉ)”}”(hhh]”(hÎ)”}”(hŒThe iterator interface”h]”hŒThe iterator interface”…””}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj9h²hh³hÇh´KJubhä)”}”(hXwModules implementing a virtual file with seq_file must implement an iterator object that allows stepping through the data of interest during a "session" (roughly one read() system call). If the iterator is able to move to a specific position - like the file they implement, though with freedom to map the position number to a sequence location in whatever way is convenient - the iterator need only exist transiently during a session. If the iterator cannot easily find a numerical position but works well with a first/next interface, the iterator can be stored in the private data area and continue from one session to the next.”h]”hX{Modules implementing a virtual file with seq_file must implement an iterator object that allows stepping through the data of interest during a “session†(roughly one read() system call). If the iterator is able to move to a specific position - like the file they implement, though with freedom to map the position number to a sequence location in whatever way is convenient - the iterator need only exist transiently during a session. If the iterator cannot easily find a numerical position but works well with a first/next interface, the iterator can be stored in the private data area and continue from one session to the next.”…””}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KLhj9h²hubhä)”}”(hX‚A seq_file implementation that is formatting firewall rules from a table, for example, could provide a simple iterator that interprets position N as the Nth rule in the chain. A seq_file implementation that presents the content of a, potentially volatile, linked list might record a pointer into that list, providing that can be done without risk of the current location being removed.”h]”hX‚A seq_file implementation that is formatting firewall rules from a table, for example, could provide a simple iterator that interprets position N as the Nth rule in the chain. A seq_file implementation that presents the content of a, potentially volatile, linked list might record a pointer into that list, providing that can be done without risk of the current location being removed.”…””}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KWhj9h²hubhä)”}”(hXPositioning can thus be done in whatever way makes the most sense for the generator of the data, which need not be aware of how a position translates to an offset in the virtual file. The one obvious exception is that a position of zero should indicate the beginning of the file.”h]”hXPositioning can thus be done in whatever way makes the most sense for the generator of the data, which need not be aware of how a position translates to an offset in the virtual file. The one obvious exception is that a position of zero should indicate the beginning of the file.”…””}”(hjfh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K^hj9h²hubhä)”}”(hŒbThe /proc/sequence iterator just uses the count of the next number it will output as its position.”h]”hŒbThe /proc/sequence iterator just uses the count of the next number it will output as its position.”…””}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kchj9h²hubhä)”}”(hX;Four functions must be implemented to make the iterator work. The first, called start(), starts a session and takes a position as an argument, returning an iterator which will start reading at that position. The pos passed to start() will always be either zero, or the most recent pos used in the previous session.”h]”hX;Four functions must be implemented to make the iterator work. The first, called start(), starts a session and takes a position as an argument, returning an iterator which will start reading at that position. The pos passed to start() will always be either zero, or the most recent pos used in the previous session.”…””}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kfhj9h²hubhä)”}”(hŒBFor our simple sequence example, the start() function looks like::”h]”hŒAFor our simple sequence example, the start() function looks like:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Klhj9h²hubjÔ)”}”(hŒÖstatic void *ct_seq_start(struct seq_file *s, loff_t *pos) { loff_t *spos = kmalloc(sizeof(loff_t), GFP_KERNEL); if (! spos) return NULL; *spos = *pos; return spos; }”h]”hŒÖstatic void *ct_seq_start(struct seq_file *s, loff_t *pos) { loff_t *spos = kmalloc(sizeof(loff_t), GFP_KERNEL); if (! spos) return NULL; *spos = *pos; return spos; }”…””}”hjžsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´Kohj9h²hubhä)”}”(hXKThe entire data structure for this iterator is a single loff_t value holding the current position. There is no upper bound for the sequence iterator, but that will not be the case for most other seq_file implementations; in most cases the start() function should check for a "past end of file" condition and return NULL if need be.”h]”hXOThe entire data structure for this iterator is a single loff_t value holding the current position. There is no upper bound for the sequence iterator, but that will not be the case for most other seq_file implementations; in most cases the start() function should check for a “past end of file†condition and return NULL if need be.”…””}”(hj¬h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kxhj9h²hubhä)”}”(hXTFor more complicated applications, the private field of the seq_file structure can be used to hold state from session to session. There is also a special value which can be returned by the start() function called SEQ_START_TOKEN; it can be used if you wish to instruct your show() function (described below) to print a header at the top of the output. SEQ_START_TOKEN should only be used if the offset is zero, however. SEQ_START_TOKEN has no special meaning to the core seq_file code. It is provided as a convenience for a start() function to communicate with the next() and show() functions.”h]”hXTFor more complicated applications, the private field of the seq_file structure can be used to hold state from session to session. There is also a special value which can be returned by the start() function called SEQ_START_TOKEN; it can be used if you wish to instruct your show() function (described below) to print a header at the top of the output. SEQ_START_TOKEN should only be used if the offset is zero, however. SEQ_START_TOKEN has no special meaning to the core seq_file code. It is provided as a convenience for a start() function to communicate with the next() and show() functions.”…””}”(hjºh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K~hj9h²hubhä)”}”(hX†The next function to implement is called, amazingly, next(); its job is to move the iterator forward to the next position in the sequence. The example module can simply increment the position by one; more useful modules will do what is needed to step through some data structure. The next() function returns a new iterator, or NULL if the sequence is complete. Here's the example version::”h]”hX‡The next function to implement is called, amazingly, next(); its job is to move the iterator forward to the next position in the sequence. The example module can simply increment the position by one; more useful modules will do what is needed to step through some data structure. The next() function returns a new iterator, or NULL if the sequence is complete. Here’s the example version:”…””}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kˆhj9h²hubjÔ)”}”(hŒstatic void *ct_seq_next(struct seq_file *s, void *v, loff_t *pos) { loff_t *spos = v; *pos = ++*spos; return spos; }”h]”hŒstatic void *ct_seq_next(struct seq_file *s, void *v, loff_t *pos) { loff_t *spos = v; *pos = ++*spos; return spos; }”…””}”hjÖsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´Khj9h²hubhä)”}”(hXŽThe next() function should set ``*pos`` to a value that start() can use to find the new location in the sequence. When the iterator is being stored in the private data area, rather than being reinitialized on each start(), it might seem sufficient to simply set ``*pos`` to any non-zero value (zero always tells start() to restart the sequence). This is not sufficient due to historical problems.”h]”(hŒThe next() function should set ”…””}”(hjäh²hh³Nh´NubhŒliteral”“”)”}”(hŒ``*pos``”h]”hŒ*pos”…””}”(hjîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jìhjäubhŒà to a value that start() can use to find the new location in the sequence. When the iterator is being stored in the private data area, rather than being reinitialized on each start(), it might seem sufficient to simply set ”…””}”(hjäh²hh³Nh´Nubjí)”}”(hŒ``*pos``”h]”hŒ*pos”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jìhjäubhŒ to any non-zero value (zero always tells start() to restart the sequence). This is not sufficient due to historical problems.”…””}”(hjäh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K–hj9h²hubhä)”}”(hX Historically, many next() functions have *not* updated ``*pos`` at end-of-file. If the value is then used by start() to initialise the iterator, this can result in corner cases where the last entry in the sequence is reported twice in the file. In order to discourage this bug from being resurrected, the core seq_file code now produces a warning if a next() function does not change the value of ``*pos``. Consequently a next() function *must* change the value of ``*pos``, and of course must set it to a non-zero value.”h]”(hŒ)Historically, many next() functions have ”…””}”(hjh²hh³Nh´NubhŒemphasis”“”)”}”(hŒ*not*”h]”hŒnot”…””}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjubhŒ updated ”…””}”(hjh²hh³Nh´Nubjí)”}”(hŒ``*pos``”h]”hŒ*pos”…””}”(hj4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jìhjubhXP at end-of-file. If the value is then used by start() to initialise the iterator, this can result in corner cases where the last entry in the sequence is reported twice in the file. In order to discourage this bug from being resurrected, the core seq_file code now produces a warning if a next() function does not change the value of ”…””}”(hjh²hh³Nh´Nubjí)”}”(hŒ``*pos``”h]”hŒ*pos”…””}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jìhjubhŒ". Consequently a next() function ”…””}”(hjh²hh³Nh´Nubj!)”}”(hŒ*must*”h]”hŒmust”…””}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjubhŒ change the value of ”…””}”(hjh²hh³Nh´Nubjí)”}”(hŒ``*pos``”h]”hŒ*pos”…””}”(hjjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jìhjubhŒ0, and of course must set it to a non-zero value.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Khj9h²hubhä)”}”(hXÚThe stop() function closes a session; its job, of course, is to clean up. If dynamic memory is allocated for the iterator, stop() is the place to free it; if a lock was taken by start(), stop() must release that lock. The value that ``*pos`` was set to by the last next() call before stop() is remembered, and used for the first start() call of the next session unless lseek() has been called on the file; in that case next start() will be asked to start at position zero::”h]”(hŒêThe stop() function closes a session; its job, of course, is to clean up. If dynamic memory is allocated for the iterator, stop() is the place to free it; if a lock was taken by start(), stop() must release that lock. The value that ”…””}”(hj‚h²hh³Nh´Nubjí)”}”(hŒ``*pos``”h]”hŒ*pos”…””}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jìhj‚ubhŒç was set to by the last next() call before stop() is remembered, and used for the first start() call of the next session unless lseek() has been called on the file; in that case next start() will be asked to start at position zero:”…””}”(hj‚h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K¦hj9h²hubjÔ)”}”(hŒJstatic void ct_seq_stop(struct seq_file *s, void *v) { kfree(v); }”h]”hŒJstatic void ct_seq_stop(struct seq_file *s, void *v) { kfree(v); }”…””}”hj¢sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´K®hj9h²hubhä)”}”(hŒ‘Finally, the show() function should format the object currently pointed to by the iterator for output. The example module's show() function is::”h]”hŒ’Finally, the show() function should format the object currently pointed to by the iterator for output. The example module’s show() function is:”…””}”(hj°h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K³hj9h²hubjÔ)”}”(hŒ–static int ct_seq_show(struct seq_file *s, void *v) { loff_t *spos = v; seq_printf(s, "%lld\n", (long long)*spos); return 0; }”h]”hŒ–static int ct_seq_show(struct seq_file *s, void *v) { loff_t *spos = v; seq_printf(s, "%lld\n", (long long)*spos); return 0; }”…””}”hj¾sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´K¶hj9h²hubhä)”}”(hXoIf all is well, the show() function should return zero. A negative error code in the usual manner indicates that something went wrong; it will be passed back to user space. This function can also return SEQ_SKIP, which causes the current item to be skipped; if the show() function has already generated output before returning SEQ_SKIP, that output will be dropped.”h]”hXoIf all is well, the show() function should return zero. A negative error code in the usual manner indicates that something went wrong; it will be passed back to user space. This function can also return SEQ_SKIP, which causes the current item to be skipped; if the show() function has already generated output before returning SEQ_SKIP, that output will be dropped.”…””}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´K½hj9h²hubhä)”}”(hŒ¾We will look at seq_printf() in a moment. But first, the definition of the seq_file iterator is finished by creating a seq_operations structure with the four functions we have just defined::”h]”hŒ½We will look at seq_printf() in a moment. But first, the definition of the seq_file iterator is finished by creating a seq_operations structure with the four functions we have just defined:”…””}”(hjÚh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KÃhj9h²hubjÔ)”}”(hŒ¬static const struct seq_operations ct_seq_ops = { .start = ct_seq_start, .next = ct_seq_next, .stop = ct_seq_stop, .show = ct_seq_show };”h]”hŒ¬static const struct seq_operations ct_seq_ops = { .start = ct_seq_start, .next = ct_seq_next, .stop = ct_seq_stop, .show = ct_seq_show };”…””}”hjèsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´KÇhj9h²hubhä)”}”(hŒTThis structure will be needed to tie our iterator to the /proc file in a little bit.”h]”hŒTThis structure will be needed to tie our iterator to the /proc file in a little bit.”…””}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KÎhj9h²hubhä)”}”(hXµIt's worth noting that the iterator value returned by start() and manipulated by the other functions is considered to be completely opaque by the seq_file code. It can thus be anything that is useful in stepping through the data to be output. Counters can be useful, but it could also be a direct pointer into an array or linked list. Anything goes, as long as the programmer is aware that things can happen between calls to the iterator function. However, the seq_file code (by design) will not sleep between the calls to start() and stop(), so holding a lock during that time is a reasonable thing to do. The seq_file code will also avoid taking any other locks while the iterator is active.”h]”hX·It’s worth noting that the iterator value returned by start() and manipulated by the other functions is considered to be completely opaque by the seq_file code. It can thus be anything that is useful in stepping through the data to be output. Counters can be useful, but it could also be a direct pointer into an array or linked list. Anything goes, as long as the programmer is aware that things can happen between calls to the iterator function. However, the seq_file code (by design) will not sleep between the calls to start() and stop(), so holding a lock during that time is a reasonable thing to do. The seq_file code will also avoid taking any other locks while the iterator is active.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KÑhj9h²hubhä)”}”(hX*The iterator value returned by start() or next() is guaranteed to be passed to a subsequent next() or stop() call. This allows resources such as locks that were taken to be reliably released. There is *no* guarantee that the iterator will be passed to show(), though in practice it often will be.”h]”(hŒËThe iterator value returned by start() or next() is guaranteed to be passed to a subsequent next() or stop() call. This allows resources such as locks that were taken to be reliably released. There is ”…””}”(hjh²hh³Nh´Nubj!)”}”(hŒ*no*”h]”hŒno”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjubhŒ[ guarantee that the iterator will be passed to show(), though in practice it often will be.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´KÜhj9h²hubeh}”(h]”Œthe-iterator-interface”ah ]”h"]”Œthe iterator interface”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KJubhÉ)”}”(hhh]”(hÎ)”}”(hŒFormatted output”h]”hŒFormatted output”…””}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj:h²hh³hÇh´Käubhä)”}”(hXThe seq_file code manages positioning within the output created by the iterator and getting it into the user's buffer. But, for that to work, that output must be passed to the seq_file code. Some utility functions have been defined which make this task easy.”h]”hXThe seq_file code manages positioning within the output created by the iterator and getting it into the user’s buffer. But, for that to work, that output must be passed to the seq_file code. Some utility functions have been defined which make this task easy.”…””}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kæhj:h²hubhä)”}”(hŒ†Most code will simply use seq_printf(), which works pretty much like printk(), but which requires the seq_file pointer as an argument.”h]”hŒ†Most code will simply use seq_printf(), which works pretty much like printk(), but which requires the seq_file pointer as an argument.”…””}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Këhj:h²hubhä)”}”(hŒDFor straight character output, the following functions may be used::”h]”hŒCFor straight character output, the following functions may be used:”…””}”(hjgh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kîhj:h²hubjÔ)”}”(hŒ’seq_putc(struct seq_file *m, char c); seq_puts(struct seq_file *m, const char *s); seq_escape(struct seq_file *m, const char *s, const char *esc);”h]”hŒ’seq_putc(struct seq_file *m, char c); seq_puts(struct seq_file *m, const char *s); seq_escape(struct seq_file *m, const char *s, const char *esc);”…””}”hjusbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´Kðhj:h²hubhä)”}”(hŒÝThe first two output a single character and a string, just like one would expect. seq_escape() is like seq_puts(), except that any character in s which is in the string esc will be represented in octal form in the output.”h]”hŒÝThe first two output a single character and a string, just like one would expect. seq_escape() is like seq_puts(), except that any character in s which is in the string esc will be represented in octal form in the output.”…””}”(hjƒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kôhj:h²hubhä)”}”(hŒ;There are also a pair of functions for printing filenames::”h]”hŒ:There are also a pair of functions for printing filenames:”…””}”(hj‘h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Køhj:h²hubjÔ)”}”(hŒÓint seq_path(struct seq_file *m, const struct path *path, const char *esc); int seq_path_root(struct seq_file *m, const struct path *path, const struct path *root, const char *esc)”h]”hŒÓint seq_path(struct seq_file *m, const struct path *path, const char *esc); int seq_path_root(struct seq_file *m, const struct path *path, const struct path *root, const char *esc)”…””}”hjŸsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´Kúhj:h²hubhä)”}”(hXnHere, path indicates the file of interest, and esc is a set of characters which should be escaped in the output. A call to seq_path() will output the path relative to the current process's filesystem root. If a different root is desired, it can be used with seq_path_root(). If it turns out that path cannot be reached from root, seq_path_root() returns SEQ_SKIP.”h]”hXpHere, path indicates the file of interest, and esc is a set of characters which should be escaped in the output. A call to seq_path() will output the path relative to the current process’s filesystem root. If a different root is desired, it can be used with seq_path_root(). If it turns out that path cannot be reached from root, seq_path_root() returns SEQ_SKIP.”…””}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Kÿhj:h²hubhä)”}”(hŒ;A function producing complicated output may want to check::”h]”hŒ:A function producing complicated output may want to check:”…””}”(hj»h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mhj:h²hubjÔ)”}”(hŒ,bool seq_has_overflowed(struct seq_file *m);”h]”hŒ,bool seq_has_overflowed(struct seq_file *m);”…””}”hjÉsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´Mhj:h²hubhä)”}”(hŒ9and avoid further seq_ calls if true is returned.”h]”hŒ9and avoid further seq_ calls if true is returned.”…””}”(hj×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´M hj:h²hubhä)”}”(hŒ­A true return from seq_has_overflowed means that the seq_file buffer will be discarded and the seq_show function will attempt to allocate a larger buffer and retry printing.”h]”hŒ­A true return from seq_has_overflowed means that the seq_file buffer will be discarded and the seq_show function will attempt to allocate a larger buffer and retry printing.”…””}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´M hj:h²hubeh}”(h]”Œformatted-output”ah ]”h"]”Œformatted output”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KäubhÉ)”}”(hhh]”(hÎ)”}”(hŒMaking it all work”h]”hŒMaking it all work”…””}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjûh²hh³hÇh´Mubhä)”}”(hX%So far, we have a nice set of functions which can produce output within the seq_file system, but we have not yet turned them into a file that a user can see. Creating a file within the kernel requires, of course, the creation of a set of file_operations which implement the operations on that file. The seq_file interface provides a set of canned operations which do most of the work. The virtual file author still must implement the open() method, however, to hook everything up. The open function is often a single line, as in the example module::”h]”hX$So far, we have a nice set of functions which can produce output within the seq_file system, but we have not yet turned them into a file that a user can see. Creating a file within the kernel requires, of course, the creation of a set of file_operations which implement the operations on that file. The seq_file interface provides a set of canned operations which do most of the work. The virtual file author still must implement the open() method, however, to hook everything up. The open function is often a single line, as in the example module:”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mhjûh²hubjÔ)”}”(hŒjstatic int ct_open(struct inode *inode, struct file *file) { return seq_open(file, &ct_seq_ops); }”h]”hŒjstatic int ct_open(struct inode *inode, struct file *file) { return seq_open(file, &ct_seq_ops); }”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´Mhjûh²hubhä)”}”(hŒ‡Here, the call to seq_open() takes the seq_operations structure we created before, and gets set up to iterate through the virtual file.”h]”hŒ‡Here, the call to seq_open() takes the seq_operations structure we created before, and gets set up to iterate through the virtual file.”…””}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´M!hjûh²hubhä)”}”(hX@On a successful open, seq_open() stores the struct seq_file pointer in file->private_data. If you have an application where the same iterator can be used for more than one file, you can store an arbitrary pointer in the private field of the seq_file structure; that value can then be retrieved by the iterator functions.”h]”hX@On a successful open, seq_open() stores the struct seq_file pointer in file->private_data. If you have an application where the same iterator can be used for more than one file, you can store an arbitrary pointer in the private field of the seq_file structure; that value can then be retrieved by the iterator functions.”…””}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´M$hjûh²hubhä)”}”(hXThere is also a wrapper function to seq_open() called seq_open_private(). It kmallocs a zero filled block of memory and stores a pointer to it in the private field of the seq_file structure, returning 0 on success. The block size is specified in a third parameter to the function, e.g.::”h]”hXThere is also a wrapper function to seq_open() called seq_open_private(). It kmallocs a zero filled block of memory and stores a pointer to it in the private field of the seq_file structure, returning 0 on success. The block size is specified in a third parameter to the function, e.g.:”…””}”(hjDh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´M*hjûh²hubjÔ)”}”(hŒ«static int ct_open(struct inode *inode, struct file *file) { return seq_open_private(file, &ct_seq_ops, sizeof(struct mystruct)); }”h]”hŒ«static int ct_open(struct inode *inode, struct file *file) { return seq_open_private(file, &ct_seq_ops, sizeof(struct mystruct)); }”…””}”hjRsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´M/hjûh²hubhä)”}”(hŒÐThere is also a variant function, __seq_open_private(), which is functionally identical except that, if successful, it returns the pointer to the allocated memory block, allowing further initialisation e.g.::”h]”hŒÏThere is also a variant function, __seq_open_private(), which is functionally identical except that, if successful, it returns the pointer to the allocated memory block, allowing further initialisation e.g.:”…””}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´M5hjûh²hubjÔ)”}”(hX>static int ct_open(struct inode *inode, struct file *file) { struct mystruct *p = __seq_open_private(file, &ct_seq_ops, sizeof(*p)); if (!p) return -ENOMEM; p->foo = bar; /* initialize my stuff */ ... p->baz = true; return 0; }”h]”hX>static int ct_open(struct inode *inode, struct file *file) { struct mystruct *p = __seq_open_private(file, &ct_seq_ops, sizeof(*p)); if (!p) return -ENOMEM; p->foo = bar; /* initialize my stuff */ ... p->baz = true; return 0; }”…””}”hjnsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´M9hjûh²hubhä)”}”(hŒ~A corresponding close function, seq_release_private() is available which frees the memory allocated in the corresponding open.”h]”hŒ~A corresponding close function, seq_release_private() is available which frees the memory allocated in the corresponding open.”…””}”(hj|h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´MHhjûh²hubhä)”}”(hŒ´The other operations of interest - read(), llseek(), and release() - are all implemented by the seq_file code itself. So a virtual file's file_operations structure will look like::”h]”hŒµThe other operations of interest - read(), llseek(), and release() - are all implemented by the seq_file code itself. So a virtual file’s file_operations structure will look like:”…””}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´MKhjûh²hubjÔ)”}”(hŒÌstatic const struct file_operations ct_file_ops = { .owner = THIS_MODULE, .open = ct_open, .read = seq_read, .llseek = seq_lseek, .release = seq_release };”h]”hŒÌstatic const struct file_operations ct_file_ops = { .owner = THIS_MODULE, .open = ct_open, .read = seq_read, .llseek = seq_lseek, .release = seq_release };”…””}”hj˜sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´MOhjûh²hubhä)”}”(hŒˆThere is also a seq_release_private() which passes the contents of the seq_file private field to kfree() before releasing the structure.”h]”hŒˆThere is also a seq_release_private() which passes the contents of the seq_file private field to kfree() before releasing the structure.”…””}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´MWhjûh²hubhä)”}”(hŒˆThe final step is the creation of the /proc file itself. In the example code, that is done in the initialization code in the usual way::”h]”hŒ‡The final step is the creation of the /proc file itself. In the example code, that is done in the initialization code in the usual way:”…””}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´MZhjûh²hubjÔ)”}”(hŒ¤static int ct_init(void) { struct proc_dir_entry *entry; proc_create("sequence", 0, NULL, &ct_file_ops); return 0; } module_init(ct_init);”h]”hŒ¤static int ct_init(void) { struct proc_dir_entry *entry; proc_create("sequence", 0, NULL, &ct_file_ops); return 0; } module_init(ct_init);”…””}”hjÂsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´M]hjûh²hubhä)”}”(hŒAnd that is pretty much it.”h]”hŒAnd that is pretty much it.”…””}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mghjûh²hubeh}”(h]”Œmaking-it-all-work”ah ]”h"]”Œmaking it all work”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´MubhÉ)”}”(hhh]”(hÎ)”}”(hŒseq_list”h]”hŒseq_list”…””}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjæh²hh³hÇh´Mkubhä)”}”(hŒZIf your file will be iterating through a linked list, you may find these routines useful::”h]”hŒYIf your file will be iterating through a linked list, you may find these routines useful:”…””}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mmhjæh²hubjÔ)”}”(hXGstruct list_head *seq_list_start(struct list_head *head, loff_t pos); struct list_head *seq_list_start_head(struct list_head *head, loff_t pos); struct list_head *seq_list_next(void *v, struct list_head *head, loff_t *ppos);”h]”hXGstruct list_head *seq_list_start(struct list_head *head, loff_t pos); struct list_head *seq_list_start_head(struct list_head *head, loff_t pos); struct list_head *seq_list_next(void *v, struct list_head *head, loff_t *ppos);”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´Mphjæh²hubhä)”}”(hŒÝThese helpers will interpret pos as a position within the list and iterate accordingly. Your start() and next() functions need only invoke the ``seq_list_*`` helpers with a pointer to the appropriate list_head structure.”h]”(hŒThese helpers will interpret pos as a position within the list and iterate accordingly. Your start() and next() functions need only invoke the ”…””}”(hjh²hh³Nh´Nubjí)”}”(hŒ``seq_list_*``”h]”hŒ seq_list_*”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jìhjubhŒ? helpers with a pointer to the appropriate list_head structure.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mwhjæh²hubeh}”(h]”Œseq-list”ah ]”h"]”Œseq_list”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´MkubhÉ)”}”(hhh]”(hÎ)”}”(hŒThe extra-simple version”h]”hŒThe extra-simple version”…””}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj;h²hh³hÇh´M}ubhä)”}”(hŒâFor extremely simple virtual files, there is an even easier interface. A module can define only the show() function, which should create all the output that the virtual file will contain. The file's open() method then calls::”h]”hŒãFor extremely simple virtual files, there is an even easier interface. A module can define only the show() function, which should create all the output that the virtual file will contain. The file’s open() method then calls:”…””}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mhj;h²hubjÔ)”}”(hŒyint single_open(struct file *file, int (*show)(struct seq_file *m, void *p), void *data);”h]”hŒyint single_open(struct file *file, int (*show)(struct seq_file *m, void *p), void *data);”…””}”hjZsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jÓh³hÇh´M„hj;h²hubhä)”}”(hX:When output time comes, the show() function will be called once. The data value given to single_open() can be found in the private field of the seq_file structure. When using single_open(), the programmer should use single_release() instead of seq_release() in the file_operations structure to avoid a memory leak.”h]”hX:When output time comes, the show() function will be called once. The data value given to single_open() can be found in the private field of the seq_file structure. When using single_open(), the programmer should use single_release() instead of seq_release() in the file_operations structure to avoid a memory leak.”…””}”(hjhh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hãh³hÇh´Mˆhj;h²hubeh}”(h]”Œthe-extra-simple-version”ah ]”h"]”Œthe extra-simple version”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´M}ubeh}”(h]”Œthe-seq-file-interface”ah ]”h"]”Œthe seq_file interface”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€j6j3j7j4jøjõjãjàj8j5j{jxuŒ nametypes”}”(jƒ‰j6‰j7‰jø‰jã‰j8‰j{‰uh}”(j€hÊj3jj4j9jõj:jàjûj5jæjxj;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.