aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorLeann Ogasawara <leann.ogasawara@canonical.com>2011-08-15 13:04:41 -0700
committerJohn Rigby <john.rigby@linaro.org>2011-11-16 14:25:30 -0700
commit5f718c0521611e42a1aa9ab7eb7a24209014485e (patch)
tree19514f867a0fbf172b92b19ffc9dd7e9693da0a7 /fs
parent4020c2347fc20d53cb91dc4e3619ddeb8831ccd6 (diff)
downloadlinux-linaro-precise-5f718c0521611e42a1aa9ab7eb7a24209014485e.tar.gz
Revert "UBUNTU: ubuntu: overlayfs -- overlayfs: implement show_options"
This reverts commit 09bcd22c8c6f8a67a38702cf44febd52554ca543.
Diffstat (limited to 'fs')
-rw-r--r--fs/overlayfs/super.c63
1 files changed, 20 insertions, 43 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 7109b45a171..c9db954b136 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -15,27 +15,17 @@
#include <linux/slab.h>
#include <linux/parser.h>
#include <linux/module.h>
-#include <linux/seq_file.h>
#include "overlayfs.h"
MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>");
MODULE_DESCRIPTION("Overlay filesystem");
MODULE_LICENSE("GPL");
-struct ovl_config {
- char *lowerdir;
- char *upperdir;
-};
-
-/* private information held for overlayfs's superblock */
struct ovl_fs {
struct vfsmount *upper_mnt;
struct vfsmount *lower_mnt;
- /* pathnames of lower and upper dirs, for show_options */
- struct ovl_config config;
};
-/* private information held for every overlayfs dentry */
struct ovl_entry {
/*
* Keep "double reference" on upper dentries, so that
@@ -373,8 +363,6 @@ static void ovl_put_super(struct super_block *sb)
mntput(ufs->upper_mnt);
mntput(ufs->lower_mnt);
- kfree(ufs->config.lowerdir);
- kfree(ufs->config.upperdir);
kfree(ufs);
}
@@ -416,27 +404,15 @@ static int ovl_statfs(struct dentry *dentry, struct kstatfs *buf)
return path.dentry->d_sb->s_op->statfs(path.dentry, buf);
}
-/**
- * ovl_show_options
- *
- * Prints the mount options for a given superblock.
- * Returns zero; does not fail.
- */
-static int ovl_show_options(struct seq_file *m, struct vfsmount *mnt)
-{
- struct super_block *sb = mnt->mnt_sb;
- struct ovl_fs *ufs = sb->s_fs_info;
-
- seq_printf(m, ",lowerdir=%s", ufs->config.lowerdir);
- seq_printf(m, ",upperdir=%s", ufs->config.upperdir);
- return 0;
-}
-
static const struct super_operations ovl_super_operations = {
.put_super = ovl_put_super,
.remount_fs = ovl_remount_fs,
.statfs = ovl_statfs,
- .show_options = ovl_show_options,
+};
+
+struct ovl_config {
+ char *lowerdir;
+ char *upperdir;
};
enum {
@@ -496,36 +472,37 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
struct dentry *root_dentry;
struct ovl_entry *oe;
struct ovl_fs *ufs;
+ struct ovl_config config;
int err;
- err = -ENOMEM;
- ufs = kmalloc(sizeof(struct ovl_fs), GFP_KERNEL);
- if (!ufs)
- goto out;
-
- err = ovl_parse_opt((char *) data, &ufs->config);
+ err = ovl_parse_opt((char *) data, &config);
if (err)
- goto out_free_ufs;
+ goto out;
err = -EINVAL;
- if (!ufs->config.upperdir || !ufs->config.lowerdir) {
+ if (!config.upperdir || !config.lowerdir) {
printk(KERN_ERR "overlayfs: missing upperdir or lowerdir\n");
goto out_free_config;
}
+ err = -ENOMEM;
+ ufs = kmalloc(sizeof(struct ovl_fs), GFP_KERNEL);
+ if (!ufs)
+ goto out_free_config;
+
oe = ovl_alloc_entry();
if (oe == NULL)
- goto out_free_config;
+ goto out_free_ufs;
root_inode = ovl_new_inode(sb, S_IFDIR, oe);
if (!root_inode)
goto out_free_oe;
- err = kern_path(ufs->config.upperdir, LOOKUP_FOLLOW, &upperpath);
+ err = kern_path(config.upperdir, LOOKUP_FOLLOW, &upperpath);
if (err)
goto out_put_root;
- err = kern_path(ufs->config.lowerdir, LOOKUP_FOLLOW, &lowerpath);
+ err = kern_path(config.lowerdir, LOOKUP_FOLLOW, &lowerpath);
if (err)
goto out_put_upperpath;
@@ -589,11 +566,11 @@ out_put_root:
iput(root_inode);
out_free_oe:
kfree(oe);
-out_free_config:
- kfree(ufs->config.lowerdir);
- kfree(ufs->config.upperdir);
out_free_ufs:
kfree(ufs);
+out_free_config:
+ kfree(config.lowerdir);
+ kfree(config.upperdir);
out:
return err;
}