<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/samples/vfs/mountinfo.c, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-01-20T11:50:35+00:00</updated>
<entry>
<title>samples/vfs: use shared header</title>
<updated>2025-01-20T11:50:35+00:00</updated>
<author>
<name>Christian Brauner</name>
<email>brauner@kernel.org</email>
</author>
<published>2025-01-20T11:41:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f9d94f78a8749e15de8aeb2e281898aa980e62d9'/>
<id>urn:sha1:f9d94f78a8749e15de8aeb2e281898aa980e62d9</id>
<content type='text'>
Share some infrastructure between sample programs and fix a build
failure that was reported.

Reported-by: Sasha Levin &lt;sashal@kernel.org&gt;
Link: https://lore.kernel.org/r/Z42UkSXx0MS9qZ9w@lappy
Link: https://qa-reports.linaro.org/lkft/sashal-linus-next/build/v6.13-rc7-511-g109a8e0fa9d6/testrun/26809210/suite/build/test/gcc-8-allyesconfig/log
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>samples/vfs/mountinfo: Use __u64 instead of uint64_t</title>
<updated>2025-01-10T11:08:27+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2025-01-06T13:48:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f79e6eb84d4d2bff99e3ca6c1f140b2af827e904'/>
<id>urn:sha1:f79e6eb84d4d2bff99e3ca6c1f140b2af827e904</id>
<content type='text'>
On 32-bit (e.g. arm32, m68k):

    samples/vfs/mountinfo.c: In function ‘dump_mountinfo’:
    samples/vfs/mountinfo.c:145:29: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
      145 |                 printf("0x%lx 0x%lx 0x%llx ", mnt_ns_id, mnt_id, buf-&gt;mnt_parent_id);
	  |                           ~~^                 ~~~~~~~~~
	  |                             |                 |
	  |                             long unsigned int uint64_t {aka long long unsigned int}
	  |                           %llx
    samples/vfs/mountinfo.c:145:35: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
      145 |                 printf("0x%lx 0x%lx 0x%llx ", mnt_ns_id, mnt_id, buf-&gt;mnt_parent_id);
	  |                                 ~~^                      ~~~~~~
	  |                                   |                      |
	  |                                   long unsigned int      uint64_t {aka long long unsigned int}
	  |                                 %llx

Just using "%llx" instead of "%lx" is not sufficient, as uint64_t is
"long unsigned int" on some 64-bit platforms like arm64.  Hence also
replace "uint64_t" by "__u64", which matches what most other samples
are already using.

Fixes: d95e49bf8bcdc7c1 ("samples: add a mountinfo program to demonstrate statmount()/listmount()")
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Link: https://lore.kernel.org/r/20250106134802.1019911-1-geert+renesas@glider.be
Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>samples: add a mountinfo program to demonstrate statmount()/listmount()</title>
<updated>2025-01-09T15:58:50+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@kernel.org</email>
</author>
<published>2024-11-15T15:35:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c6640d46dc5a31ee7363545530836c10b9ddb9de'/>
<id>urn:sha1:c6640d46dc5a31ee7363545530836c10b9ddb9de</id>
<content type='text'>
Add a new "mountinfo" sample userland program that demonstrates how to
use statmount() and listmount() to get at the same info that
/proc/pid/mountinfo provides.

The output of the program tries to mimic the mountinfo procfile
contents. With the -p flag, it can be pointed at an arbitrary pid to
print out info about its mount namespace. With the -r flag it will
attempt to walk all of the namespaces under the pid's mount namespace
and dump out mount info from all of them.

Signed-off-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Link: https://lore.kernel.org/r/20241115-statmount-v2-1-cd29aeff9cbb@kernel.org
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
</feed>
