Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106366
b: refs/heads/master
c: 88b3878
h: refs/heads/master
v: v3
  • Loading branch information
Li Zefan authored and Al Viro committed Jul 27, 2008
1 parent 3e5be41 commit dd1d824
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 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: 672b16b2f66c149888bd876a4f92342112205fe1
refs/heads/master: 88b387824fdaecb6ba0f471acf0aadf7d24739fd
24 changes: 13 additions & 11 deletions trunk/fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,13 @@ struct vfsmount *alloc_vfsmnt(const char *name)
int err;

err = mnt_alloc_id(mnt);
if (err) {
kmem_cache_free(mnt_cache, mnt);
return NULL;
if (err)
goto out_free_cache;

if (name) {
mnt->mnt_devname = kstrdup(name, GFP_KERNEL);
if (!mnt->mnt_devname)
goto out_free_id;
}

atomic_set(&mnt->mnt_count, 1);
Expand All @@ -127,16 +131,14 @@ struct vfsmount *alloc_vfsmnt(const char *name)
INIT_LIST_HEAD(&mnt->mnt_slave_list);
INIT_LIST_HEAD(&mnt->mnt_slave);
atomic_set(&mnt->__mnt_writers, 0);
if (name) {
int size = strlen(name) + 1;
char *newname = kmalloc(size, GFP_KERNEL);
if (newname) {
memcpy(newname, name, size);
mnt->mnt_devname = newname;
}
}
}
return mnt;

out_free_id:
mnt_free_id(mnt);
out_free_cache:
kmem_cache_free(mnt_cache, mnt);
return NULL;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/mount.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct vfsmount {
struct list_head mnt_child; /* and going through their mnt_child */
int mnt_flags;
/* 4 bytes hole on 64bits arches */
char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
const char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
struct list_head mnt_list;
struct list_head mnt_expire; /* link in fs-specific expiry list */
struct list_head mnt_share; /* circular list of shared mounts */
Expand Down

0 comments on commit dd1d824

Please sign in to comment.