| 1 | Upstream status: Being tested; not yet presented upstream.
|
| 2 |
|
| 3 | From 6f9b9584f43d9d6058e10048dd0dfc5d0eff88c4 Mon Sep 17 00:00:00 2001
|
| 4 | From: Janneke Nieuwenhuizen <[email protected]>
|
| 5 | Date: Fri, 15 May 2026 10:12:30 +0200
|
| 6 | Subject: [PATCH] shmem: support xattr gnu.* namespace for the Hurd
|
| 7 |
|
| 8 | The Hurd gained[0] support for moving the translator and author
|
| 9 | fields out of the inode and into the "gnu.*" xattr namespace.
|
| 10 |
|
| 11 | In anticipation of that, an xattr INDEX was reserved[1]. The Hurd has
|
| 12 | now been brought into compliance[2] with that, and so has ext4[3].
|
| 13 |
|
| 14 | This patch adds support for reading and writing such attributes from
|
| 15 | a Linux tmpfs; you can now do something like
|
| 16 |
|
| 17 | mkdir -p hurd-root
|
| 18 | mount -t tmpfs -o size=2M tmpfs hurd-root
|
| 19 | mkdir -p hurd-root/servers/socket
|
| 20 | touch hurd-root/servers/socket/1
|
| 21 | setfattr --name=gnu.translator --value='"/hurd/pflocal\0"' \
|
| 22 | hurd-root/servers/socket/1
|
| 23 | getfattr --name=gnu.translator hurd-root/servers/socket/1
|
| 24 | # file: 1
|
| 25 | gnu.translator="/hurd/pflocal"
|
| 26 |
|
| 27 | to setup a pipe translator, which is being used to create an
|
| 28 | initial file-system image for the Hurd from GNU Guix[4].
|
| 29 |
|
| 30 | [0] https://summerofcode.withgoogle.com/projects/#5869799859027968
|
| 31 | [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3980bd3b406addb327d858aebd19e229ea340b9a
|
| 32 | [2] https://git.savannah.gnu.org/cgit/hurd/hurd.git/commit/?id=a04c7bf83172faa7cb080fbe3b6c04a8415ca645
|
| 33 | [3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=88ee9d571b6d8ed345f877e05f685814412e359b
|
| 34 | [4] https://git.savannah.gnu.org/cgit/guix.git/log/?h=wip-hurd-vm
|
| 35 | ---
|
| 36 | mm/shmem.c | 8 ++++++++
|
| 37 | 1 file changed, 8 insertions(+)
|
| 38 |
|
| 39 | diff --git a/mm/shmem.c b/mm/shmem.c
|
| 40 | index 3b5dc21b323c..5d60aa4dba92 100644
|
| 41 | |
| 42 | |
| 43 | @@ -15,6 +15,7 @@
|
| 44 | * Extended attribute support for tmpfs:
|
| 45 | * Copyright (c) 2004, Luke Kenneth Casson Leighton <[email protected]>
|
| 46 | * Copyright (c) 2004 Red Hat, Inc., James Morris <[email protected]>
|
| 47 | + * Copyright (C) 2026 Janneke Nieuwenhuizen <[email protected]>
|
| 48 | *
|
| 49 | * tiny-shmem:
|
| 50 | * Copyright (c) 2004, 2008 Matt Mackall <[email protected]>
|
| 51 | @@ -4371,10 +4372,17 @@ static const struct xattr_handler shmem_user_xattr_handler = {
|
| 52 | .set = shmem_xattr_handler_set,
|
| 53 | };
|
| 54 |
|
| 55 | +static const struct xattr_handler shmem_hurd_xattr_handler = {
|
| 56 | + .prefix = XATTR_HURD_PREFIX,
|
| 57 | + .get = shmem_xattr_handler_get,
|
| 58 | + .set = shmem_xattr_handler_set,
|
| 59 | +};
|
| 60 | +
|
| 61 | static const struct xattr_handler * const shmem_xattr_handlers[] = {
|
| 62 | &shmem_security_xattr_handler,
|
| 63 | &shmem_trusted_xattr_handler,
|
| 64 | &shmem_user_xattr_handler,
|
| 65 | + &shmem_hurd_xattr_handler,
|
| 66 | NULL
|
| 67 | };
|
| 68 |
|
| 69 | --
|
| 70 | 2.54.0
|
| 71 |
|