~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to fs/namespace.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
934
934
        int res = 0;
935
935
 
936
936
        br_read_lock(vfsmount_lock);
937
 
        if (p->event != ns->event) {
938
 
                p->event = ns->event;
 
937
        if (p->m.poll_event != ns->event) {
 
938
                p->m.poll_event = ns->event;
939
939
                res = 1;
940
940
        }
941
941
        br_read_unlock(vfsmount_lock);
2501
2501
                __mnt_make_longterm(mnt);
2502
2502
                new_ns->root = mnt;
2503
2503
                list_add(&new_ns->list, &new_ns->root->mnt_list);
 
2504
        } else {
 
2505
                mntput(mnt);
2504
2506
        }
2505
2507
        return new_ns;
2506
2508
}
2507
2509
EXPORT_SYMBOL(create_mnt_ns);
2508
2510
 
 
2511
struct dentry *mount_subtree(struct vfsmount *mnt, const char *name)
 
2512
{
 
2513
        struct mnt_namespace *ns;
 
2514
        struct super_block *s;
 
2515
        struct path path;
 
2516
        int err;
 
2517
 
 
2518
        ns = create_mnt_ns(mnt);
 
2519
        if (IS_ERR(ns))
 
2520
                return ERR_CAST(ns);
 
2521
 
 
2522
        err = vfs_path_lookup(mnt->mnt_root, mnt,
 
2523
                        name, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT, &path);
 
2524
 
 
2525
        put_mnt_ns(ns);
 
2526
 
 
2527
        if (err)
 
2528
                return ERR_PTR(err);
 
2529
 
 
2530
        /* trade a vfsmount reference for active sb one */
 
2531
        s = path.mnt->mnt_sb;
 
2532
        atomic_inc(&s->s_active);
 
2533
        mntput(path.mnt);
 
2534
        /* lock the sucker */
 
2535
        down_write(&s->s_umount);
 
2536
        /* ... and return the root of (sub)tree on it */
 
2537
        return path.dentry;
 
2538
}
 
2539
EXPORT_SYMBOL(mount_subtree);
 
2540
 
2509
2541
SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name,
2510
2542
                char __user *, type, unsigned long, flags, void __user *, data)
2511
2543
{
2740
2772
 
2741
2773
struct vfsmount *kern_mount_data(struct file_system_type *type, void *data)
2742
2774
{
2743
 
        return vfs_kern_mount(type, MS_KERNMOUNT, type->name, data);
 
2775
        struct vfsmount *mnt;
 
2776
        mnt = vfs_kern_mount(type, MS_KERNMOUNT, type->name, data);
 
2777
        if (!IS_ERR(mnt)) {
 
2778
                /*
 
2779
                 * it is a longterm mount, don't release mnt until
 
2780
                 * we unmount before file sys is unregistered
 
2781
                */
 
2782
                mnt_make_longterm(mnt);
 
2783
        }
 
2784
        return mnt;
2744
2785
}
2745
2786
EXPORT_SYMBOL_GPL(kern_mount_data);
 
2787
 
 
2788
void kern_unmount(struct vfsmount *mnt)
 
2789
{
 
2790
        /* release long term mount so mount point can be released */
 
2791
        if (!IS_ERR_OR_NULL(mnt)) {
 
2792
                mnt_make_shortterm(mnt);
 
2793
                mntput(mnt);
 
2794
        }
 
2795
}
 
2796
EXPORT_SYMBOL(kern_unmount);