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

« back to all changes in this revision

Viewing changes to fs/nfsctl.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
static struct file *do_open(char *name, int flags)
24
24
{
25
 
        struct nameidata nd;
26
25
        struct vfsmount *mnt;
27
 
        int error;
 
26
        struct file *file;
28
27
 
29
28
        mnt = do_kern_mount("nfsd", 0, "nfsd", NULL);
30
29
        if (IS_ERR(mnt))
31
30
                return (struct file *)mnt;
32
31
 
33
 
        error = vfs_path_lookup(mnt->mnt_root, mnt, name, 0, &nd);
 
32
        file = file_open_root(mnt->mnt_root, mnt, name, flags);
 
33
 
34
34
        mntput(mnt);    /* drop do_kern_mount reference */
35
 
        if (error)
36
 
                return ERR_PTR(error);
37
 
 
38
 
        if (flags == O_RDWR)
39
 
                error = may_open(&nd.path, MAY_READ|MAY_WRITE, flags);
40
 
        else
41
 
                error = may_open(&nd.path, MAY_WRITE, flags);
42
 
 
43
 
        if (!error)
44
 
                return dentry_open(nd.path.dentry, nd.path.mnt, flags,
45
 
                                   current_cred());
46
 
 
47
 
        path_put(&nd.path);
48
 
        return ERR_PTR(error);
 
35
        return file;
49
36
}
50
37
 
51
38
static struct {