Re: [RFC PATCH 03/19] samples: rust: add initial ro file system sample

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 28 Oct 2023 at 13:17, Alice Ryhl <alice@xxxxxxx> wrote:
>
> On 10/18/23 14:25, Wedson Almeida Filho wrote:> +kernel::module_fs! {
> > +    type: RoFs,
> > +    name: "rust_rofs",
> > +    author: "Rust for Linux Contributors",
> > +    description: "Rust read-only file system sample",
> > +    license: "GPL",
> > +}
> > +
> > +struct RoFs;
> > +impl fs::FileSystem for RoFs {
> > +    const NAME: &'static CStr = c_str!("rust-fs");
> > +}
>
> Why use two different names here?

I actually wanted the same name, but the string in the module macros
don't accept dashes (they need to be identifiers).

I discussed this with Miguel a couple of years ago but we decided to
wait and see before doing anything. Since then I noticed that Rust
automatically converts dashes to underscores in crate names so that
they can be used as identifiers in the language. So I guess there's a
precedent if we decide to do something similar.

For now I'll change rust-fs to rust_rofs as the fs name.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux