summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2014-03-02 23:22:03 +0100
committerTony Lindgren <tony@atomide.com>2014-03-02 23:22:03 +0100
commitf777ba1780584b100ab9664cc06d04f3bb273a84 (patch)
tree865813eb0078530ca3b036c0c3eee6ce33f9315f /fs/namei.c
parentARM: dts: am43xx: add support for parallel NAND flash (diff)
parentARM: dts: omap4+: Add DMM bindings (diff)
downloadlinux-f777ba1780584b100ab9664cc06d04f3bb273a84.tar.xz
linux-f777ba1780584b100ab9664cc06d04f3bb273a84.zip
Merge tag 'for_3.15/dts_signed' of git://git.kernel.org/pub/scm/linux/kernel/git/bcousson/linux-omap-dt into omap-for-v3.15/dt
Add craneboard devices Add more N900 devices Add am43x-epos-evm and am437x-gp-evm devices Add OMAP4 DMM devices Conflicts: arch/arm/boot/dts/am43x-epos-evm.dts arch/arm/boot/dts/dra7.dtsi
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c
index d580df2e6804..385f7817bfcc 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -196,6 +196,7 @@ recopy:
goto error;
result->uptr = filename;
+ result->aname = NULL;
audit_getname(result);
return result;
@@ -210,6 +211,35 @@ getname(const char __user * filename)
return getname_flags(filename, 0, NULL);
}
+/*
+ * The "getname_kernel()" interface doesn't do pathnames longer
+ * than EMBEDDED_NAME_MAX. Deal with it - you're a kernel user.
+ */
+struct filename *
+getname_kernel(const char * filename)
+{
+ struct filename *result;
+ char *kname;
+ int len;
+
+ len = strlen(filename);
+ if (len >= EMBEDDED_NAME_MAX)
+ return ERR_PTR(-ENAMETOOLONG);
+
+ result = __getname();
+ if (unlikely(!result))
+ return ERR_PTR(-ENOMEM);
+
+ kname = (char *)result + sizeof(*result);
+ result->name = kname;
+ result->uptr = NULL;
+ result->aname = NULL;
+ result->separate = false;
+
+ strlcpy(kname, filename, EMBEDDED_NAME_MAX);
+ return result;
+}
+
#ifdef CONFIG_AUDITSYSCALL
void putname(struct filename *name)
{