~n-muench/ubuntu/oneiric/open-vm-tools/open-vm-tools-august.merge

« back to all changes in this revision

Viewing changes to modules/linux/vmhgfs/transport.c

  • Committer: Bazaar Package Importer
  • Author(s): Nate Muench
  • Date: 2010-09-06 21:06:01 UTC
  • mfrom: (2.4.19 sid)
  • Revision ID: james.westby@ubuntu.com-20100906210601-gxxy30e5roil4srt
Tags: 2010.06.16-268169-3ubuntu1
* Merge from Debian testing (LP: #632101), remaining changes:
  - Recommend open-vm-toolbox in open-vm-tools.
  - Rediffing vsock.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
#include <linux/timer.h>
45
45
/* Must be included after sched.h. */
46
46
#include <linux/smp_lock.h>
 
47
#include <linux/interrupt.h> /* for spin_lock_bh */
 
48
 
47
49
 
48
50
#include "hgfsDevLinux.h"
49
51
#include "hgfsProto.h"
215
217
{
216
218
   ASSERT(req);
217
219
 
218
 
   spin_lock(&hgfsRepQueueLock);
 
220
   spin_lock_bh(&hgfsRepQueueLock);
219
221
   list_add_tail(&req->list, &hgfsRepPending);
220
 
   spin_unlock(&hgfsRepQueueLock);
 
222
   spin_unlock_bh(&hgfsRepQueueLock);
221
223
}
222
224
 
223
225
 
237
239
 *----------------------------------------------------------------------
238
240
 */
239
241
 
240
 
static void
 
242
void
241
243
HgfsTransportRemovePendingRequest(HgfsReq *req)   // IN: Request to dequeue
242
244
{
243
245
   ASSERT(req);
244
246
 
245
 
   spin_lock(&hgfsRepQueueLock);
 
247
   spin_lock_bh(&hgfsRepQueueLock);
246
248
   list_del_init(&req->list);
247
 
   spin_unlock(&hgfsRepQueueLock);
 
249
   spin_unlock_bh(&hgfsRepQueueLock);
248
250
}
249
251
 
250
252
 
270
272
{
271
273
   struct HgfsReq *req;
272
274
 
273
 
   spin_lock(&hgfsRepQueueLock);
 
275
   spin_lock_bh(&hgfsRepQueueLock);
274
276
 
275
277
   list_for_each_entry(req, &hgfsRepPending, list) {
276
278
      if (req->state == HGFS_REQ_STATE_SUBMITTED) {
280
282
      }
281
283
   }
282
284
 
283
 
   spin_unlock(&hgfsRepQueueLock);
 
285
   spin_unlock_bh(&hgfsRepQueueLock);
284
286
}
285
287
 
286
288
/*
306
308
{
307
309
   HgfsReq *cur, *req = NULL;
308
310
 
309
 
   spin_lock(&hgfsRepQueueLock);
 
311
   spin_lock_bh(&hgfsRepQueueLock);
310
312
 
311
313
   list_for_each_entry(cur, &hgfsRepPending, list) {
312
314
      if (cur->id == id) {
316
318
      }
317
319
   }
318
320
 
319
 
   spin_unlock(&hgfsRepQueueLock);
 
321
   spin_unlock_bh(&hgfsRepQueueLock);
320
322
 
321
323
   return req;
322
324
}
478
480
   compat_mutex_unlock(&hgfsChannelLock);
479
481
 
480
482
   if (likely(ret == 0)) {
481
 
      /* Send succeeded, wait for the reply */
482
 
      if (wait_event_interruptible(req->queue,
483
 
                                   req->state == HGFS_REQ_STATE_COMPLETED)) {
484
 
         ret = -EINTR; /* Interrupted by some signal. */
485
 
      }
 
483
      /*
 
484
       * Send succeeded, wait for the reply.
 
485
       * Right now, we cannot cancel request once they
 
486
       * are dispatched to the host.
 
487
       */
 
488
      wait_event(req->queue,
 
489
                 req->state == HGFS_REQ_STATE_COMPLETED);
486
490
   }
487
491
 
488
492
   HgfsTransportRemovePendingRequest(req);