Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28889
b: refs/heads/master
c: 454e239
h: refs/heads/master
i:
  28887: fdaf316
v: v3
  • Loading branch information
David Howells authored and Linus Torvalds committed Jun 23, 2006
1 parent 34b1108 commit a4ce7e8
Show file tree
Hide file tree
Showing 84 changed files with 483 additions and 432 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ad5544098a69d7dc1fa508cbb17e13a7a952fd8
refs/heads/master: 454e2398be9b9fa30433fccc548db34d19aa9958
7 changes: 4 additions & 3 deletions trunk/Documentation/filesystems/Locking
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,16 @@ see also dquot_operations section.

--------------------------- file_system_type ---------------------------
prototypes:
struct super_block *(*get_sb) (struct file_system_type *, int,
const char *, void *);
struct int (*get_sb) (struct file_system_type *, int,
const char *, void *, struct vfsmount *);
void (*kill_sb) (struct super_block *);
locking rules:
may block BKL
get_sb yes yes
kill_sb yes yes

->get_sb() returns error or a locked superblock (exclusive on ->s_umount).
->get_sb() returns error or 0 with locked superblock attached to the vfsmount
(exclusive on ->s_umount).
->kill_sb() takes a write-locked superblock, does all shutdown work on it,
unlocks and drops the reference.

Expand Down
7 changes: 4 additions & 3 deletions trunk/Documentation/filesystems/porting
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ Turn your foo_read_super() into a function that would return 0 in case of
success and negative number in case of error (-EINVAL unless you have more
informative error value to report). Call it foo_fill_super(). Now declare

struct super_block foo_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
int foo_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, ext2_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, foo_fill_super,
mnt);
}

(or similar with s/bdev/nodev/ or s/bdev/single/, depending on the kind of
Expand Down
4 changes: 2 additions & 2 deletions trunk/Documentation/filesystems/vfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ members are defined:
struct file_system_type {
const char *name;
int fs_flags;
struct super_block *(*get_sb) (struct file_system_type *, int,
const char *, void *);
struct int (*get_sb) (struct file_system_type *, int,
const char *, void *, struct vfsmount *);
void (*kill_sb) (struct super_block *);
struct module *owner;
struct file_system_type * next;
Expand Down
7 changes: 4 additions & 3 deletions trunk/arch/ia64/kernel/perfmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,11 @@ pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
}


static struct super_block *
pfmfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data)
static int
pfmfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data,
struct vfsmount *mnt)
{
return get_sb_pseudo(fs_type, "pfm:", NULL, PFMFS_MAGIC);
return get_sb_pseudo(fs_type, "pfm:", NULL, PFMFS_MAGIC, mnt);
}

static struct file_system_type pfm_fs_type = {
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/powerpc/platforms/cell/spufs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,11 @@ spufs_fill_super(struct super_block *sb, void *data, int silent)
return spufs_create_root(sb, data);
}

static struct super_block *
static int
spufs_get_sb(struct file_system_type *fstype, int flags,
const char *name, void *data)
const char *name, void *data, struct vfsmount *mnt)
{
return get_sb_single(fstype, flags, data, spufs_fill_super);
return get_sb_single(fstype, flags, data, spufs_fill_super, mnt);
}

static struct file_system_type spufs_type = {
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/infiniband/core/uverbs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,11 +821,12 @@ static void ib_uverbs_remove_one(struct ib_device *device)
kref_put(&uverbs_dev->ref, ib_uverbs_release_dev);
}

static struct super_block *uverbs_event_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data)
static int uverbs_event_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data,
struct vfsmount *mnt)
{
return get_sb_pseudo(fs_type, "infinibandevent:", NULL,
INFINIBANDEVENTFS_MAGIC);
INFINIBANDEVENTFS_MAGIC, mnt);
}

static struct file_system_type uverbs_event_fs = {
Expand Down
13 changes: 7 additions & 6 deletions trunk/drivers/infiniband/hw/ipath/ipath_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,13 +542,14 @@ static int ipathfs_fill_super(struct super_block *sb, void *data,
return ret;
}

static struct super_block *ipathfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data)
static int ipathfs_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data, struct vfsmount *mnt)
{
ipath_super = get_sb_single(fs_type, flags, data,
ipathfs_fill_super);
return ipath_super;
int ret = get_sb_single(fs_type, flags, data,
ipathfs_fill_super, mnt);
if (ret >= 0)
ipath_super = mnt->mnt_sb;
return ret;
}

static void ipathfs_kill_super(struct super_block *s)
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/isdn/capi/capifs.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ capifs_fill_super(struct super_block *s, void *data, int silent)
return -ENOMEM;
}

static struct super_block *capifs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int capifs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_single(fs_type, flags, data, capifs_fill_super);
return get_sb_single(fs_type, flags, data, capifs_fill_super, mnt);
}

static struct file_system_type capifs_fs_type = {
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/misc/ibmasm/ibmasmfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ static void ibmasmfs_create_files (struct super_block *sb, struct dentry *root);
static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent);


static struct super_block *ibmasmfs_get_super(struct file_system_type *fst,
int flags, const char *name, void *data)
static int ibmasmfs_get_super(struct file_system_type *fst,
int flags, const char *name, void *data,
struct vfsmount *mnt)
{
return get_sb_single(fst, flags, data, ibmasmfs_fill_super);
return get_sb_single(fst, flags, data, ibmasmfs_fill_super, mnt);
}

static struct super_operations ibmasmfs_s_ops = {
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/oprofile/oprofilefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ static int oprofilefs_fill_super(struct super_block * sb, void * data, int silen
}


static struct super_block *oprofilefs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int oprofilefs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_single(fs_type, flags, data, oprofilefs_fill_super);
return get_sb_single(fs_type, flags, data, oprofilefs_fill_super, mnt);
}


Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/usb/core/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,10 @@ static void fs_remove_file (struct dentry *dentry)

/* --------------------------------------------------------------------- */

static struct super_block *usb_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int usb_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_single(fs_type, flags, data, usbfs_fill_super);
return get_sb_single(fs_type, flags, data, usbfs_fill_super, mnt);
}

static struct file_system_type usb_fs_type = {
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/usb/gadget/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2070,11 +2070,11 @@ gadgetfs_fill_super (struct super_block *sb, void *opts, int silent)
}

/* "mount -t gadgetfs path /dev/gadget" ends up here */
static struct super_block *
static int
gadgetfs_get_sb (struct file_system_type *t, int flags,
const char *path, void *opts)
const char *path, void *opts, struct vfsmount *mnt)
{
return get_sb_single (t, flags, opts, gadgetfs_fill_super);
return get_sb_single (t, flags, opts, gadgetfs_fill_super, mnt);
}

static void
Expand Down
21 changes: 12 additions & 9 deletions trunk/fs/9p/vfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,13 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses,
* @flags: mount flags
* @dev_name: device name that was mounted
* @data: mount options
* @mnt: mountpoint record to be instantiated
*
*/

static struct super_block *v9fs_get_sb(struct file_system_type
*fs_type, int flags,
const char *dev_name, void *data)
static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data,
struct vfsmount *mnt)
{
struct super_block *sb = NULL;
struct v9fs_fcall *fcall = NULL;
Expand All @@ -123,17 +124,19 @@ static struct super_block *v9fs_get_sb(struct file_system_type

v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL);
if (!v9ses)
return ERR_PTR(-ENOMEM);
return -ENOMEM;

if ((newfid = v9fs_session_init(v9ses, dev_name, data)) < 0) {
dprintk(DEBUG_ERROR, "problem initiating session\n");
sb = ERR_PTR(newfid);
retval = newfid;
goto out_free_session;
}

sb = sget(fs_type, NULL, v9fs_set_super, v9ses);
if (IS_ERR(sb))
if (IS_ERR(sb)) {
retval = PTR_ERR(sb);
goto out_close_session;
}
v9fs_fill_super(sb, v9ses, flags);

inode = v9fs_get_inode(sb, S_IFDIR | mode);
Expand Down Expand Up @@ -184,19 +187,19 @@ static struct super_block *v9fs_get_sb(struct file_system_type
goto put_back_sb;
}

return sb;
return simple_set_mnt(mnt, sb);

out_close_session:
v9fs_session_close(v9ses);
out_free_session:
kfree(v9ses);
return sb;
return retval;

put_back_sb:
/* deactivate_super calls v9fs_kill_super which will frees the rest */
up_write(&sb->s_umount);
deactivate_super(sb);
return ERR_PTR(retval);
return retval;
}

/**
Expand Down
7 changes: 4 additions & 3 deletions trunk/fs/adfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,11 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
return -EINVAL;
}

static struct super_block *adfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int adfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, adfs_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, adfs_fill_super,
mnt);
}

static struct file_system_type adfs_fs_type = {
Expand Down
7 changes: 4 additions & 3 deletions trunk/fs/affs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,11 @@ affs_statfs(struct super_block *sb, struct kstatfs *buf)
return 0;
}

static struct super_block *affs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int affs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, affs_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, affs_fill_super,
mnt);
}

static struct file_system_type affs_fs_type = {
Expand Down
24 changes: 13 additions & 11 deletions trunk/fs/afs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ struct afs_mount_params {
static void afs_i_init_once(void *foo, kmem_cache_t *cachep,
unsigned long flags);

static struct super_block *afs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data);
static int afs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data, struct vfsmount *mnt);

static struct inode *afs_alloc_inode(struct super_block *sb);

Expand Down Expand Up @@ -294,10 +294,11 @@ static int afs_fill_super(struct super_block *sb, void *data, int silent)
* get an AFS superblock
* - TODO: don't use get_sb_nodev(), but rather call sget() directly
*/
static struct super_block *afs_get_sb(struct file_system_type *fs_type,
int flags,
const char *dev_name,
void *options)
static int afs_get_sb(struct file_system_type *fs_type,
int flags,
const char *dev_name,
void *options,
struct vfsmount *mnt)
{
struct afs_mount_params params;
struct super_block *sb;
Expand All @@ -311,7 +312,7 @@ static struct super_block *afs_get_sb(struct file_system_type *fs_type,
ret = afscm_start();
if (ret < 0) {
_leave(" = %d", ret);
return ERR_PTR(ret);
return ret;
}

/* parse the options */
Expand Down Expand Up @@ -348,18 +349,19 @@ static struct super_block *afs_get_sb(struct file_system_type *fs_type,
goto error;
}
sb->s_flags |= MS_ACTIVE;
simple_set_mnt(mnt, sb);

afs_put_volume(params.volume);
afs_put_cell(params.default_cell);
_leave(" = %p", sb);
return sb;
_leave(" = 0 [%p]", 0, sb);
return 0;

error:
afs_put_volume(params.volume);
afs_put_cell(params.default_cell);
afscm_stop();
_leave(" = %d", ret);
return ERR_PTR(ret);
return ret;
} /* end afs_get_sb() */

/*****************************************************************************/
Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/autofs/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
#include <linux/init.h>
#include "autofs_i.h"

static struct super_block *autofs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int autofs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_nodev(fs_type, flags, data, autofs_fill_super);
return get_sb_nodev(fs_type, flags, data, autofs_fill_super, mnt);
}

static struct file_system_type autofs_fs_type = {
Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/autofs4/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
#include <linux/init.h>
#include "autofs_i.h"

static struct super_block *autofs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int autofs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_nodev(fs_type, flags, data, autofs4_fill_super);
return get_sb_nodev(fs_type, flags, data, autofs4_fill_super, mnt);
}

static struct file_system_type autofs_fs_type = {
Expand Down
7 changes: 4 additions & 3 deletions trunk/fs/befs/linuxvfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -899,11 +899,12 @@ befs_statfs(struct super_block *sb, struct kstatfs *buf)
return 0;
}

static struct super_block *
static int
befs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name,
void *data)
void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, befs_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, befs_fill_super,
mnt);
}

static struct file_system_type befs_fs_type = {
Expand Down
Loading

0 comments on commit a4ce7e8

Please sign in to comment.