All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] affs: AFFS_NO_TRUNCATE added to Kconfig
@ 2014-03-03 10:22 Fabian Frederick
  2014-03-03 19:43 ` Dave Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Fabian Frederick @ 2014-03-03 10:22 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, Viro

Filename truncate process is defined in affs.h.

This patch exports current define to Kconfig and removes
AFFS_MAX_PREALLOC which is never used.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/affs/Kconfig    | 12 ++++++++++++
 fs/affs/affs.h     |  9 ---------
 fs/affs/amigaffs.c |  2 +-
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/fs/affs/Kconfig b/fs/affs/Kconfig
index a04d9e8..4db24d9 100644
--- a/fs/affs/Kconfig
+++ b/fs/affs/Kconfig
@@ -19,3 +19,15 @@ config AFFS_FS
 
 	  To compile this file system support as a module, choose M here: the
 	  module will be called affs.  If unsure, say N.
+
+config AFFS_NO_TRUNCATE
+	bool "Amiga FFS no filename truncate"
+	depends on AFFS_FS
+	default n
+	help
+	  If you say Y here, creating filesystem objects with longer names than
+	  30 characters (standard limit) will result in an error (ENAMETOOLONG).
+
+	  By default this option is disabled and filenames are automatically
+	  truncated.
+
diff --git a/fs/affs/affs.h b/fs/affs/affs.h
index 3952121..128ae5d 100644
--- a/fs/affs/affs.h
+++ b/fs/affs/affs.h
@@ -5,14 +5,6 @@
 #include <linux/mutex.h>
 #include <linux/workqueue.h>
 
-/* AmigaOS allows file names with up to 30 characters length.
- * Names longer than that will be silently truncated. If you
- * want to disallow this, comment out the following #define.
- * Creating filesystem objects with longer names will then
- * result in an error (ENAMETOOLONG).
- */
-/*#define AFFS_NO_TRUNCATE */
-
 /* Ugly macros make the code more pretty. */
 
 #define GET_END_PTR(st,p,sz)		 ((st *)((char *)(p)+((sz)-sizeof(st))))
@@ -28,7 +20,6 @@
 
 #define AFFS_CACHE_SIZE		PAGE_SIZE
 
-#define AFFS_MAX_PREALLOC	32
 #define AFFS_LC_SIZE		(AFFS_CACHE_SIZE/sizeof(u32)/2)
 #define AFFS_AC_SIZE		(AFFS_CACHE_SIZE/sizeof(struct affs_ext_key)/2)
 #define AFFS_AC_MASK		(AFFS_AC_SIZE-1)
diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c
index d9a4367..6e7b4cd 100644
--- a/fs/affs/amigaffs.c
+++ b/fs/affs/amigaffs.c
@@ -479,7 +479,7 @@ affs_check_name(const unsigned char *name, int len)
 	int	 i;
 
 	if (len > 30)
-#ifdef AFFS_NO_TRUNCATE
+#ifdef CONFIG_AFFS_NO_TRUNCATE
 		return -ENAMETOOLONG;
 #else
 		len = 30;
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] affs: AFFS_NO_TRUNCATE added to Kconfig
  2014-03-03 19:43 ` Dave Jones
@ 2014-03-03 12:56   ` Fabian Frederick
  0 siblings, 0 replies; 3+ messages in thread
From: Fabian Frederick @ 2014-03-03 12:56 UTC (permalink / raw)
  To: Dave Jones; +Cc: linux-kernel, akpm, Viro

On Mon, 3 Mar 2014 14:43:27 -0500
Dave Jones <davej@redhat.com> wrote:

> On Mon, Mar 03, 2014 at 06:22:18PM +0800, Fabian Frederick wrote:
>  > Filename truncate process is defined in affs.h.
>  > 
>  > This patch exports current define to Kconfig and removes
>  > AFFS_MAX_PREALLOC which is never used.
>  > +
>  > +config AFFS_NO_TRUNCATE
>  > +	bool "Amiga FFS no filename truncate"
>  > +	depends on AFFS_FS
>  > +	default n
>  > +	help
>  > +	  If you say Y here, creating filesystem objects with longer names than
>  > +	  30 characters (standard limit) will result in an error (ENAMETOOLONG).
>  > +
>  > +	  By default this option is disabled and filenames are automatically
>  > +	  truncated.
> 
> I get the feeling this would be better as a mount option than a config option.
> Then again, the number of people still caring about AFFS is probably in
> single digits these days, so I doubt anyone would complain if this was set
> one way or the other in a distribution kernel.

Good idea but I guess this would need passing sbi->s_flags to affs_check_name which would require some more updates ...

Fabian

> 
> 	Dave
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] affs: AFFS_NO_TRUNCATE added to Kconfig
  2014-03-03 10:22 [PATCH 1/1] affs: AFFS_NO_TRUNCATE added to Kconfig Fabian Frederick
@ 2014-03-03 19:43 ` Dave Jones
  2014-03-03 12:56   ` Fabian Frederick
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Jones @ 2014-03-03 19:43 UTC (permalink / raw)
  To: Fabian Frederick; +Cc: linux-kernel, akpm, Viro

On Mon, Mar 03, 2014 at 06:22:18PM +0800, Fabian Frederick wrote:
 > Filename truncate process is defined in affs.h.
 > 
 > This patch exports current define to Kconfig and removes
 > AFFS_MAX_PREALLOC which is never used.
 > +
 > +config AFFS_NO_TRUNCATE
 > +	bool "Amiga FFS no filename truncate"
 > +	depends on AFFS_FS
 > +	default n
 > +	help
 > +	  If you say Y here, creating filesystem objects with longer names than
 > +	  30 characters (standard limit) will result in an error (ENAMETOOLONG).
 > +
 > +	  By default this option is disabled and filenames are automatically
 > +	  truncated.

I get the feeling this would be better as a mount option than a config option.
Then again, the number of people still caring about AFFS is probably in
single digits these days, so I doubt anyone would complain if this was set
one way or the other in a distribution kernel.

	Dave


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-03 20:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-03 10:22 [PATCH 1/1] affs: AFFS_NO_TRUNCATE added to Kconfig Fabian Frederick
2014-03-03 19:43 ` Dave Jones
2014-03-03 12:56   ` Fabian Frederick

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.