configfs changes for v7.0

-----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCgA0FiEEEsH5R1a/fCoV1sAS4bgaPnkoY3cFAmmMPp0WHGEuaGluZGJv
 cmdAa2VybmVsLm9yZwAKCRDhuBo+eShjdx9+D/4hz5pC/L0w21231hz00CLJqHps
 Mv4uPhy3vd0QqQ8/S25gQNesCirjGuC57NSQ4K1O3+UBJKaPNEnGJYS6nlc8/vsI
 4heTR+F7QPu34RD/kgzeUu03/VhQyhQzHx10+e3qiQBEn6lwKqfZaKHnsUD5M2Zk
 eL8LydI87rXoC9TL5ASPEq33jB7d7ec8uH2fgPhUbysTmiFTIJkaOvIv6ukRo0y7
 skdSJemXRjlknXqrhLtAxe5Bt7Ycq1BzEaPYc3xRGXT1B/jp/fJxhfK9AHc5ej+T
 7A/Ewjdf9IEHZYKGnUDappXC/7SWsZw47BDrqljj/6a+aODYXlt+E4q1kNBBnA4L
 I8oVMf485BaZhLbpWdtVTztlLzO6DQg5MvN5KWxdhbz4JSn54eumLmvSjvvPfi0S
 FhRfR0+/vAvY7nSzZ2FXLQWt3Yg34mUUQUkJWb09TcNSts7WpdwcJP7gEwQSSVif
 wtEL65CNGoJlKH+KmImHFh4hINrwac53Jl5+qCbj+sfXmCRehb2XPSOZCHa+ivXq
 +0p9hneOgaPOfFZ67GSU6OAGtnT5X0tL69PiK3gvVD3P/t9W7/Qr8KF4E1Ksc00H
 CRxzhk2GkRgLaNR00xIY2L0vaeLO6R1Dsg+HFVJGMCM+8fm/Swsy3Mt0/LpG7Rl7
 8EOqsbwRIBWySEz6og==
 =eFAh
 -----END PGP SIGNATURE-----

Merge tag 'configfs-for-v7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/a.hindborg/linux

Pull configfs updates from Andreas Hindborg:

 - Switch the configfs rust bindings to use c string literals provided
   by the compiler, rather than a macro

 - A follow up on constifying `configfs_item_operations`, applying the
   change to the configfs sample

* tag 'configfs-for-v7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/a.hindborg/linux:
  samples: configfs: Constify struct configfs_item_operations and configfs_group_operations
  rust: configfs: replace `kernel::c_str!` with C-Strings
This commit is contained in:
Linus Torvalds 2026-02-12 14:01:38 -08:00
commit 8c0901b6f9
4 changed files with 11 additions and 12 deletions

View file

@ -158,7 +158,7 @@ static void simple_child_release(struct config_item *item)
kfree(to_simple_child(item));
}
static struct configfs_item_operations simple_child_item_ops = {
static const struct configfs_item_operations simple_child_item_ops = {
.release = simple_child_release,
};
@ -215,7 +215,7 @@ static void simple_children_release(struct config_item *item)
kfree(to_simple_children(item));
}
static struct configfs_item_operations simple_children_item_ops = {
static const struct configfs_item_operations simple_children_item_ops = {
.release = simple_children_release,
};
@ -223,7 +223,7 @@ static struct configfs_item_operations simple_children_item_ops = {
* Note that, since no extra work is required on ->drop_item(),
* no ->drop_item() is provided.
*/
static struct configfs_group_operations simple_children_group_ops = {
static const struct configfs_group_operations simple_children_group_ops = {
.make_item = simple_children_make_item,
};
@ -292,7 +292,7 @@ static struct configfs_attribute *group_children_attrs[] = {
* Note that, since no extra work is required on ->drop_item(),
* no ->drop_item() is provided.
*/
static struct configfs_group_operations group_children_group_ops = {
static const struct configfs_group_operations group_children_group_ops = {
.make_group = group_children_make_group,
};

View file

@ -3,7 +3,6 @@
//! Rust configfs sample.
use kernel::alloc::flags;
use kernel::c_str;
use kernel::configfs;
use kernel::configfs::configfs_attrs;
use kernel::new_mutex;
@ -35,7 +34,7 @@ struct Configuration {
impl Configuration {
fn new() -> impl PinInit<Self, Error> {
try_pin_init!(Self {
message: c_str!("Hello World\n"),
message: c"Hello World\n",
bar <- new_mutex!((KBox::new([0; PAGE_SIZE], flags::GFP_KERNEL)?, 0)),
})
}
@ -61,7 +60,7 @@ impl kernel::InPlaceModule for RustConfigfs {
try_pin_init!(Self {
config <- configfs::Subsystem::new(
c_str!("rust_configfs"), item_type, Configuration::new()
c"rust_configfs", item_type, Configuration::new()
),
})
}