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

« back to all changes in this revision

Viewing changes to fs/nfs/callback_proc.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:
139
139
        spin_lock(&ino->i_lock);
140
140
        if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags) ||
141
141
            mark_matching_lsegs_invalid(lo, &free_me_list,
142
 
                                        args->cbl_range.iomode))
 
142
                                        &args->cbl_range))
143
143
                rv = NFS4ERR_DELAY;
144
144
        else
145
145
                rv = NFS4ERR_NOMATCHING_LAYOUT;
184
184
                ino = lo->plh_inode;
185
185
                spin_lock(&ino->i_lock);
186
186
                set_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags);
187
 
                if (mark_matching_lsegs_invalid(lo, &free_me_list, range.iomode))
 
187
                if (mark_matching_lsegs_invalid(lo, &free_me_list, &range))
188
188
                        rv = NFS4ERR_DELAY;
189
189
                list_del_init(&lo->plh_bulk_recall);
190
190
                spin_unlock(&ino->i_lock);
 
191
                pnfs_free_lseg_list(&free_me_list);
191
192
                put_layout_hdr(lo);
192
193
                iput(ino);
193
194
        }
194
 
        pnfs_free_lseg_list(&free_me_list);
195
195
        return rv;
196
196
}
197
197
 
241
241
        do_callback_layoutrecall(clp, &args);
242
242
}
243
243
 
 
244
__be32 nfs4_callback_devicenotify(struct cb_devicenotifyargs *args,
 
245
                                  void *dummy, struct cb_process_state *cps)
 
246
{
 
247
        int i;
 
248
        __be32 res = 0;
 
249
        struct nfs_client *clp = cps->clp;
 
250
        struct nfs_server *server = NULL;
 
251
 
 
252
        dprintk("%s: -->\n", __func__);
 
253
 
 
254
        if (!clp) {
 
255
                res = cpu_to_be32(NFS4ERR_OP_NOT_IN_SESSION);
 
256
                goto out;
 
257
        }
 
258
 
 
259
        for (i = 0; i < args->ndevs; i++) {
 
260
                struct cb_devicenotifyitem *dev = &args->devs[i];
 
261
 
 
262
                if (!server ||
 
263
                    server->pnfs_curr_ld->id != dev->cbd_layout_type) {
 
264
                        rcu_read_lock();
 
265
                        list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link)
 
266
                                if (server->pnfs_curr_ld &&
 
267
                                    server->pnfs_curr_ld->id == dev->cbd_layout_type) {
 
268
                                        rcu_read_unlock();
 
269
                                        goto found;
 
270
                                }
 
271
                        rcu_read_unlock();
 
272
                        dprintk("%s: layout type %u not found\n",
 
273
                                __func__, dev->cbd_layout_type);
 
274
                        continue;
 
275
                }
 
276
 
 
277
        found:
 
278
                if (dev->cbd_notify_type == NOTIFY_DEVICEID4_CHANGE)
 
279
                        dprintk("%s: NOTIFY_DEVICEID4_CHANGE not supported, "
 
280
                                "deleting instead\n", __func__);
 
281
                nfs4_delete_deviceid(server->pnfs_curr_ld, clp, &dev->cbd_dev_id);
 
282
        }
 
283
 
 
284
out:
 
285
        kfree(args->devs);
 
286
        dprintk("%s: exit with status = %u\n",
 
287
                __func__, be32_to_cpu(res));
 
288
        return res;
 
289
}
 
290
 
244
291
int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation, const nfs4_stateid *stateid)
245
292
{
246
293
        if (delegation == NULL)