aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2011-07-15 14:49:20 +0200
committerJohn Rigby <john.rigby@linaro.org>2011-09-23 08:54:06 -0600
commitfd5a8f26b4f47d47161c704d1392539a08070886 (patch)
tree8d2afc47a8900945faba7e56ba32cb527abb7468 /fs
parent7210c35b7859fd9c694a1b42eeca168c686a1602 (diff)
UBUNTU: ubuntu: overlayfs -- ovl: improve stack use of lookup and readdir
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Andy Whitcroft <apw@canonical.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/overlayfs/dir.c11
-rw-r--r--fs/overlayfs/overlayfs.h3
-rw-r--r--fs/overlayfs/readdir.c6
-rw-r--r--fs/overlayfs/super.c15
4 files changed, 18 insertions, 17 deletions
diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
index 966db6bad86..834bed88c9b 100644
--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -15,17 +15,6 @@
static const char *ovl_whiteout_symlink = "(overlay-whiteout)";
-static struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
- struct nameidata *nd)
-{
- int err = ovl_do_lookup(dentry);
-
- if (err)
- return ERR_PTR(err);
-
- return NULL;
-}
-
static int ovl_whiteout(struct dentry *upperdir, struct dentry *dentry)
{
int err;
diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
index 10c4c3697b1..bf45bd42e9a 100644
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@ -33,7 +33,8 @@ bool ovl_dentry_is_opaque(struct dentry *dentry);
void ovl_dentry_set_opaque(struct dentry *dentry, bool opaque);
bool ovl_is_whiteout(struct dentry *dentry);
void ovl_dentry_update(struct dentry *dentry, struct dentry *upperdentry);
-int ovl_do_lookup(struct dentry *dentry);
+struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
+ struct nameidata *nd);
struct dentry *ovl_upper_create(struct dentry *upperdir, struct dentry *dentry,
struct kstat *stat, const char *link);
diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c
index 4f0a51c39c3..48e35a83116 100644
--- a/fs/overlayfs/readdir.c
+++ b/fs/overlayfs/readdir.c
@@ -165,8 +165,8 @@ static int ovl_fill_upper(void *buf, const char *name, int namelen,
return ovl_cache_entry_add_rb(rdd, name, namelen, ino, d_type);
}
-static int ovl_dir_read(struct path *realpath, struct ovl_readdir_data *rdd,
- filldir_t filler)
+static inline int ovl_dir_read(struct path *realpath,
+ struct ovl_readdir_data *rdd, filldir_t filler)
{
struct file *realfile;
int err;
@@ -246,7 +246,7 @@ static int ovl_dir_mark_whiteouts(struct ovl_readdir_data *rdd)
return 0;
}
-static int ovl_dir_read_merged(struct path *upperpath, struct path *lowerpath,
+static inline int ovl_dir_read_merged(struct path *upperpath, struct path *lowerpath,
struct ovl_readdir_data *rdd)
{
int err;
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index c741b17835a..427bb555020 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -248,7 +248,7 @@ static struct ovl_entry *ovl_alloc_entry(void)
return kzalloc(sizeof(struct ovl_entry), GFP_KERNEL);
}
-static struct dentry *ovl_lookup_real(struct dentry *dir, struct qstr *name)
+static inline struct dentry *ovl_lookup_real(struct dentry *dir, struct qstr *name)
{
struct dentry *dentry;
@@ -266,7 +266,7 @@ static struct dentry *ovl_lookup_real(struct dentry *dir, struct qstr *name)
return dentry;
}
-int ovl_do_lookup(struct dentry *dentry)
+static int ovl_do_lookup(struct dentry *dentry)
{
struct ovl_entry *oe;
struct dentry *upperdir;
@@ -363,6 +363,17 @@ out:
return err;
}
+struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
+ struct nameidata *nd)
+{
+ int err = ovl_do_lookup(dentry);
+
+ if (err)
+ return ERR_PTR(err);
+
+ return NULL;
+}
+
static void ovl_put_super(struct super_block *sb)
{
struct ovl_fs *ufs = sb->s_fs_info;