From: Fabian Frederick <fabf@skynet.be>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: akpm <akpm@linux-foundation.org>, Viro <viro@zeniv.linux.org.uk>
Subject: [PATCH 1/1] affs: AFFS_NO_TRUNCATE added to Kconfig
Date: Mon, 3 Mar 2014 18:22:18 +0800 [thread overview]
Message-ID: <20140303182218.bc1de22e2c404dd1e07553b4@skynet.be> (raw)
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
next reply other threads:[~2014-03-03 18:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-03 10:22 Fabian Frederick [this message]
2014-03-03 19:43 ` Dave Jones
2014-03-03 12:56 ` Fabian Frederick
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140303182218.bc1de22e2c404dd1e07553b4@skynet.be \
--to=fabf@skynet.be \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®