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

« back to all changes in this revision

Viewing changes to include/linux/genhd.h

  • 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:
109
109
        int make_it_fail;
110
110
#endif
111
111
        unsigned long stamp;
112
 
        int in_flight[2];
 
112
        atomic_t in_flight[2];
113
113
#ifdef  CONFIG_SMP
114
114
        struct disk_stats __percpu *dkstats;
115
115
#else
127
127
#define GENHD_FL_SUPPRESS_PARTITION_INFO        32
128
128
#define GENHD_FL_EXT_DEVT                       64 /* allow extended devt */
129
129
#define GENHD_FL_NATIVE_CAPACITY                128
 
130
#define GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE     256
130
131
 
131
132
enum {
132
133
        DISK_EVENT_MEDIA_CHANGE                 = 1 << 0, /* media changed */
370
371
 
371
372
static inline void part_inc_in_flight(struct hd_struct *part, int rw)
372
373
{
373
 
        part->in_flight[rw]++;
 
374
        atomic_inc(&part->in_flight[rw]);
374
375
        if (part->partno)
375
 
                part_to_disk(part)->part0.in_flight[rw]++;
 
376
                atomic_inc(&part_to_disk(part)->part0.in_flight[rw]);
376
377
}
377
378
 
378
379
static inline void part_dec_in_flight(struct hd_struct *part, int rw)
379
380
{
380
 
        part->in_flight[rw]--;
 
381
        atomic_dec(&part->in_flight[rw]);
381
382
        if (part->partno)
382
 
                part_to_disk(part)->part0.in_flight[rw]--;
 
383
                atomic_dec(&part_to_disk(part)->part0.in_flight[rw]);
383
384
}
384
385
 
385
386
static inline int part_in_flight(struct hd_struct *part)
386
387
{
387
 
        return part->in_flight[0] + part->in_flight[1];
 
388
        return atomic_read(&part->in_flight[0]) + atomic_read(&part->in_flight[1]);
388
389
}
389
390
 
390
391
static inline struct partition_meta_info *alloc_part_info(struct gendisk *disk)