diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-10-10 16:43:13 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-12 20:15:10 -0400 |
commit | 7950e3852ab86826b7349a535d2e8b0000340d7f (patch) | |
tree | b07bcf28bf0fc3bdc610595287250c3c3a3d974a /include/linux/fs.h | |
parent | adb5c2473d3f91526c79db972aafb20a56d3fbb3 (diff) | |
download | op-kernel-dev-7950e3852ab86826b7349a535d2e8b0000340d7f.zip op-kernel-dev-7950e3852ab86826b7349a535d2e8b0000340d7f.tar.gz |
vfs: embed struct filename inside of names_cache allocation if possible
In the common case where a name is much smaller than PATH_MAX, an extra
allocation for struct filename is unnecessary. Before allocating a
separate one, try to embed the struct filename inside the buffer first. If
it turns out that that's not long enough, then fall back to allocating a
separate struct filename and redoing the copy.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 4aa7160..65fbf57 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2201,6 +2201,7 @@ struct filename { const char *name; /* pointer to actual string */ const __user char *uptr; /* original userland pointer */ struct audit_names *aname; + bool separate; /* should "name" be freed? */ }; extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, |