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

« back to all changes in this revision

Viewing changes to fs/ceph/export.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:
86
86
static struct dentry *__fh_to_dentry(struct super_block *sb,
87
87
                                     struct ceph_nfs_fh *fh)
88
88
{
 
89
        struct ceph_mds_client *mdsc = ceph_sb_to_client(sb)->mdsc;
89
90
        struct inode *inode;
90
91
        struct dentry *dentry;
91
92
        struct ceph_vino vino;
95
96
        vino.ino = fh->ino;
96
97
        vino.snap = CEPH_NOSNAP;
97
98
        inode = ceph_find_inode(sb, vino);
98
 
        if (!inode)
99
 
                return ERR_PTR(-ESTALE);
 
99
        if (!inode) {
 
100
                struct ceph_mds_request *req;
 
101
 
 
102
                req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_LOOKUPINO,
 
103
                                               USE_ANY_MDS);
 
104
                if (IS_ERR(req))
 
105
                        return ERR_CAST(req);
 
106
 
 
107
                req->r_ino1 = vino;
 
108
                req->r_num_caps = 1;
 
109
                err = ceph_mdsc_do_request(mdsc, NULL, req);
 
110
                inode = req->r_target_inode;
 
111
                if (inode)
 
112
                        ihold(inode);
 
113
                ceph_mdsc_put_request(req);
 
114
                if (!inode)
 
115
                        return ERR_PTR(-ESTALE);
 
116
        }
100
117
 
101
118
        dentry = d_obtain_alias(inode);
102
119
        if (IS_ERR(dentry)) {
148
165
                snprintf(req->r_path2, 16, "%d", cfh->parent_name_hash);
149
166
                req->r_num_caps = 1;
150
167
                err = ceph_mdsc_do_request(mdsc, NULL, req);
 
168
                inode = req->r_target_inode;
 
169
                if (inode)
 
170
                        ihold(inode);
151
171
                ceph_mdsc_put_request(req);
152
 
                inode = ceph_find_inode(sb, vino);
153
172
                if (!inode)
154
173
                        return ERR_PTR(err ? err : -ESTALE);
155
174
        }