[RFC,4/4] docs: tmpfs: Add casefold options
diff mbox series

Message ID 20210323195941.69720-5-andrealmeid@collabora.com
State New, archived
Headers show
Series
  • mm: shmem: Add case-insensitive support for tmpfs
Related show

Commit Message

André Almeida March 23, 2021, 7:59 p.m. UTC
Document mounting options to enable casefold support in tmpfs.

Signed-off-by: André Almeida <andrealmeid@collabora.com>
---
 Documentation/filesystems/tmpfs.rst | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

Comments

Randy Dunlap March 23, 2021, 9:58 p.m. UTC | #1
Hi--

On 3/23/21 12:59 PM, André Almeida wrote:
> Document mounting options to enable casefold support in tmpfs.
> 
> Signed-off-by: André Almeida <andrealmeid@collabora.com>
> ---
>  Documentation/filesystems/tmpfs.rst | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/Documentation/filesystems/tmpfs.rst b/Documentation/filesystems/tmpfs.rst
> index 0408c245785e..84c87c309bd7 100644
> --- a/Documentation/filesystems/tmpfs.rst
> +++ b/Documentation/filesystems/tmpfs.rst
> @@ -170,6 +170,32 @@ So 'mount -t tmpfs -o size=10G,nr_inodes=10k,mode=700 tmpfs /mytmpfs'
>  will give you tmpfs instance on /mytmpfs which can allocate 10GB
>  RAM/SWAP in 10240 inodes and it is only accessible by root.
>  
> +tmpfs has the following mounting options for case-insesitive lookups support:
> +
> +=========   ==============================================================
> +casefold    Enable casefold support at this mount point using the given
> +            argument as enconding. Currently only utf8 encondings are supported.

                           encoding.                      encodings

> +cf_strict   Enable strict casefolding at this mouting point (disabled by

                                                 mount

> +            default). This means that invalid strings should be reject by the

                                                                   rejected

> +            file system.
> +=========   ==============================================================
> +
> +Note that this option doesn't enable casefold by default, one needs to set

                                                    default; one needs to set the

> +casefold flag per directory, setting the +F attribute in an empty directory. New
> +directories within a casefolded one will inherit the flag.
Gabriel Krisman Bertazi March 23, 2021, 10:19 p.m. UTC | #2
André Almeida <andrealmeid@collabora.com> writes:

> Document mounting options to enable casefold support in tmpfs.
>
> Signed-off-by: André Almeida <andrealmeid@collabora.com>
> ---
>  Documentation/filesystems/tmpfs.rst | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/Documentation/filesystems/tmpfs.rst b/Documentation/filesystems/tmpfs.rst
> index 0408c245785e..84c87c309bd7 100644
> --- a/Documentation/filesystems/tmpfs.rst
> +++ b/Documentation/filesystems/tmpfs.rst
> @@ -170,6 +170,32 @@ So 'mount -t tmpfs -o size=10G,nr_inodes=10k,mode=700 tmpfs /mytmpfs'
>  will give you tmpfs instance on /mytmpfs which can allocate 10GB
>  RAM/SWAP in 10240 inodes and it is only accessible by root.
>  
> +tmpfs has the following mounting options for case-insesitive lookups support:
> +
> +=========   ==============================================================
> +casefold    Enable casefold support at this mount point using the given
> +            argument as enconding. Currently only utf8 encondings are supported.
> +cf_strict   Enable strict casefolding at this mouting point (disabled by
> +            default). This means that invalid strings should be reject by the
> +            file system.

strict mode refers to the encoding, not exactly casefold.  Maybe we
could have a parameter encoding_flags that accepts the flag 'strict'.
This would make it closer to the ext4 interface.  Alternatively, call
this option strict_encoding.

> +=========   ==============================================================
> +
> +Note that this option doesn't enable casefold by default, one needs to set
> +casefold flag per directory, setting the +F attribute in an empty directory. New
> +directories within a casefolded one will inherit the flag.
> +
> +Example::
> +
> +    $ mount -t tmpfs -o casefold=utf8-12.1.0,cf_strict tmpfs /mytmpfs
> +    $ cd /mytmpfs
> +    $ touch a; touch A
> +    $ ls
> +    A  a
> +    $ mkdir dir
> +    $ chattr +F dir
> +    $ touch dir/a; touch dir/A
> +    $ ls dir
> +    a
>  
>  :Author:
>     Christoph Rohland <cr@sap.com>, 1.12.01
André Almeida March 24, 2021, 8:47 p.m. UTC | #3
Hi Gabriel,

Às 19:19 de 23/03/21, Gabriel Krisman Bertazi escreveu:
> André Almeida <andrealmeid@collabora.com> writes:
> 
>> Document mounting options to enable casefold support in tmpfs.
>>
>> Signed-off-by: André Almeida <andrealmeid@collabora.com>
>> ---
>>   Documentation/filesystems/tmpfs.rst | 26 ++++++++++++++++++++++++++
>>   1 file changed, 26 insertions(+)
>>
>> diff --git a/Documentation/filesystems/tmpfs.rst b/Documentation/filesystems/tmpfs.rst
>> index 0408c245785e..84c87c309bd7 100644
>> --- a/Documentation/filesystems/tmpfs.rst
>> +++ b/Documentation/filesystems/tmpfs.rst
>> @@ -170,6 +170,32 @@ So 'mount -t tmpfs -o size=10G,nr_inodes=10k,mode=700 tmpfs /mytmpfs'
>>   will give you tmpfs instance on /mytmpfs which can allocate 10GB
>>   RAM/SWAP in 10240 inodes and it is only accessible by root.
>>   
>> +tmpfs has the following mounting options for case-insesitive lookups support:
>> +
>> +=========   ==============================================================
>> +casefold    Enable casefold support at this mount point using the given
>> +            argument as enconding. Currently only utf8 encondings are supported.
>> +cf_strict   Enable strict casefolding at this mouting point (disabled by
>> +            default). This means that invalid strings should be reject by the
>> +            file system.
> 
> strict mode refers to the encoding, not exactly casefold.  Maybe we
> could have a parameter encoding_flags that accepts the flag 'strict'.
> This would make it closer to the ext4 interface.

What are the other enconding flags? Or is this more about having a 
properly extensible interface?

> Alternatively, call this option strict_encoding.
> 

Thanks,
	André
André Almeida March 25, 2021, 2:27 p.m. UTC | #4
Às 18:58 de 23/03/21, Randy Dunlap escreveu:
> Hi--
> 
> On 3/23/21 12:59 PM, André Almeida wrote:
>> Document mounting options to enable casefold support in tmpfs.
>>
>> Signed-off-by: André Almeida <andrealmeid@collabora.com>
>> ---
>>   Documentation/filesystems/tmpfs.rst | 26 ++++++++++++++++++++++++++
>>   1 file changed, 26 insertions(+)
>>
>> diff --git a/Documentation/filesystems/tmpfs.rst b/Documentation/filesystems/tmpfs.rst
>> index 0408c245785e..84c87c309bd7 100644
>> --- a/Documentation/filesystems/tmpfs.rst
>> +++ b/Documentation/filesystems/tmpfs.rst
>> @@ -170,6 +170,32 @@ So 'mount -t tmpfs -o size=10G,nr_inodes=10k,mode=700 tmpfs /mytmpfs'
>>   will give you tmpfs instance on /mytmpfs which can allocate 10GB
>>   RAM/SWAP in 10240 inodes and it is only accessible by root.
>>   
>> +tmpfs has the following mounting options for case-insesitive lookups support:
>> +
>> +=========   ==============================================================
>> +casefold    Enable casefold support at this mount point using the given
>> +            argument as enconding. Currently only utf8 encondings are supported.
> 
>                             encoding.                      encodings
> 
>> +cf_strict   Enable strict casefolding at this mouting point (disabled by
> 
>                                                   mount
> 
>> +            default). This means that invalid strings should be reject by the
> 
>                                                                     rejected
> 
>> +            file system.
>> +=========   ==============================================================
>> +
>> +Note that this option doesn't enable casefold by default, one needs to set
> 
>                                                      default; one needs to set the
> 
>> +casefold flag per directory, setting the +F attribute in an empty directory. New
>> +directories within a casefolded one will inherit the flag.
> 
> 

Thanks for the feedback Randy, all changes applied.

Patch
diff mbox series

diff --git a/Documentation/filesystems/tmpfs.rst b/Documentation/filesystems/tmpfs.rst
index 0408c245785e..84c87c309bd7 100644
--- a/Documentation/filesystems/tmpfs.rst
+++ b/Documentation/filesystems/tmpfs.rst
@@ -170,6 +170,32 @@  So 'mount -t tmpfs -o size=10G,nr_inodes=10k,mode=700 tmpfs /mytmpfs'
 will give you tmpfs instance on /mytmpfs which can allocate 10GB
 RAM/SWAP in 10240 inodes and it is only accessible by root.
 
+tmpfs has the following mounting options for case-insesitive lookups support:
+
+=========   ==============================================================
+casefold    Enable casefold support at this mount point using the given
+            argument as enconding. Currently only utf8 encondings are supported.
+cf_strict   Enable strict casefolding at this mouting point (disabled by
+            default). This means that invalid strings should be reject by the
+            file system.
+=========   ==============================================================
+
+Note that this option doesn't enable casefold by default, one needs to set
+casefold flag per directory, setting the +F attribute in an empty directory. New
+directories within a casefolded one will inherit the flag.
+
+Example::
+
+    $ mount -t tmpfs -o casefold=utf8-12.1.0,cf_strict tmpfs /mytmpfs
+    $ cd /mytmpfs
+    $ touch a; touch A
+    $ ls
+    A  a
+    $ mkdir dir
+    $ chattr +F dir
+    $ touch dir/a; touch dir/A
+    $ ls dir
+    a
 
 :Author:
    Christoph Rohland <cr@sap.com>, 1.12.01