~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal-proposed

« back to all changes in this revision

Viewing changes to ubuntu/aufs/hfsnotify.c

  • Committer: Package Import Robot
  • Author(s): Andy Whitcroft, Andy Whitcroft, Ubuntu: 3.5.0-8.8
  • Date: 2012-08-06 10:01:03 UTC
  • Revision ID: package-import@ubuntu.com-20120806100103-fy2yfj838x8zqvkp
Tags: 3.5.0-8.7
[ Andy Whitcroft ]

* [Config] add update-from-master script
* rebase to Ubuntu-3.5.0-8.8

[ Ubuntu: 3.5.0-8.8 ]

* ubuntu: AUFS -- add BOM and automated update script
* ubuntu: AUFS -- include the aufs_types.h file in linux-libc-headers
  - LP: #684666
* ubuntu: AUFS -- update aufs-update to track new locations of headers
* ubuntu: AUFS -- clean up the aufs updater and BOM
* ubuntu: AUFS -- documentation on updating aufs2
* ubuntu: AUFS -- fix undefined __devcgroup_inode_permission
* ubuntu: AUFS -- update to 4cf5db36bcd9748e8e7270022f295f84d1fc2245
* ubuntu: AUFS -- updateconfigs following update
* ubuntu: AUFS -- suppress benign plink warning messages
  - LP: #621195
* ubuntu: AUFS -- enable in config and makefile
* ubuntu: AUFS -- disable in favor of overlayfs
* ubuntu: AUFS -- adapt to the new changelog handling
* ubuntu: AUFS -- sort out the relative header paths
* ubuntu: AUFS -- update to d266b0c5d0693d6383976ee54b9e2c0fa9a3f5b0
* ubuntu: AUFS -- aufs3-base.patch
* ubuntu: AUFS -- aufs3-standalone.patch
* ubuntu: AUFS -- update to 4a5e660ed7f5c1d0467c81c535d0fedcfe62d15f
* ubuntu: AUFS -- reenable
* [Config] Add cifs support to the nfs-modules list
  - LP: #1031398
* (pre-stable) iwlwifi: Check BSS ctx active before call mac80211
  - LP: #1021086
* SAUCE: Update aufs for build failure caused by apparmor backport
* SAUCE: firmware: Remove ess files duplicated in linux-firmware
* SAUCE: firmware: Remove kaweth files duplicated in linux-firmware
* SAUCE: firmware: Remove obsolete Chelsio cxgb3 firmware
* SAUCE: firmware: Remove cxgb3 files duplicated in linux-firmware
* SAUCE: firmware: Remove edgeport files duplicated in linux-firmware
* SAUCE: firmware: Remove ti_usb_3410_5052 duplicated in linux-firmware
* SAUCE: firmware: Remove adaptec files duplicated in linux-firmware
* SAUCE: firmware: Remove advansys files duplicated in linux-firmware
* SAUCE: firmware: Remove ambassador files duplicated in linux-firmware
* SAUCE: firmware: Remove av7110 files duplicated in linux-firmware
* SAUCE: cpia2: Declare MODULE_FIRMWARE usage
* SAUCE: firmware: Remove cpia2 files duplicated in linux-firmware
* SAUCE: firmware: Remove korg files duplicated in linux-firmware
* SAUCE: firmware: Remove matrox files duplicated in linux-firmware
* SAUCE: firmware: Remove r128 files duplicated in linux-firmware
* SAUCE: firmware: Remove radeon files duplicated in linux-firmware
* intel_idle: initial IVB support
* KVM: x86: change PT_FIRST_AVAIL_BITS_SHIFT to avoid conflict with EPT
  Dirty bit
* KVM: VMX: Use EPT Access bit in response to memory notifiers
* KVM: VMX: Enable EPT A/D bits if supported by turning on relevant bit
  in EPTP
* KVM: VMX: Add parameter to control A/D bits support, default is on
* KVM: VMX: Add EPT A/D bits definitions
* KVM: VMX: Implement PCID/INVPCID for guests with EPT
* xhci: Export Latency Tolerance Messaging capabilities.
* USB: Fix LPM disable/enable during device reset.
* usb: convert port_owners type from void * to struct dev_state *
* USB: Disable LPM while the device is unconfigured.
* USB: Fix LPM disable count mismatch on driver unbind.
* USB: Enable Latency Tolerance Messaging (LTM).
* drm/i915: enable parity error interrupts
* drm/i915: Dynamic Parity Detection handling
* drm/i915: l3 parity sysfs interface
* drm/i915: remap l3 on hw init
* drm/i915: initialize the parity work only once
* drm/i915: ivybridge_handle_parity_error should be static

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
static const __u32 AuHfsnMask = (FS_MOVED_TO | FS_MOVED_FROM | FS_DELETE
27
27
                                 | FS_CREATE | FS_EVENT_ON_CHILD);
28
28
static DECLARE_WAIT_QUEUE_HEAD(au_hfsn_wq);
 
29
static __cacheline_aligned_in_smp atomic64_t au_hfsn_ifree = ATOMIC64_INIT(0);
29
30
 
30
31
static void au_hfsn_free_mark(struct fsnotify_mark *mark)
31
32
{
32
33
        struct au_hnotify *hn = container_of(mark, struct au_hnotify,
33
34
                                             hn_mark);
34
35
        AuDbg("here\n");
35
 
        hn->hn_mark_dead = 1;
36
 
        smp_mb();
37
 
        wake_up_all(&au_hfsn_wq);
 
36
        au_cache_free_hnotify(hn);
 
37
        smp_mb__before_atomic_dec();
 
38
        atomic64_dec(&au_hfsn_ifree);
 
39
        wake_up(&au_hfsn_wq);
38
40
}
39
41
 
40
42
static int au_hfsn_alloc(struct au_hinode *hinode)
49
51
        sb = hn->hn_aufs_inode->i_sb;
50
52
        bindex = au_br_index(sb, hinode->hi_id);
51
53
        br = au_sbr(sb, bindex);
52
 
        hn->hn_mark_dead = 0;
53
54
        mark = &hn->hn_mark;
54
55
        fsnotify_init_mark(mark, au_hfsn_free_mark);
55
56
        mark->mask = AuHfsnMask;
61
62
                                 /*mnt*/NULL, /*allow_dups*/1);
62
63
}
63
64
 
64
 
static void au_hfsn_free(struct au_hinode *hinode)
 
65
static int au_hfsn_free(struct au_hinode *hinode, struct au_hnotify *hn)
65
66
{
66
 
        struct au_hnotify *hn;
67
67
        struct fsnotify_mark *mark;
68
 
 
69
 
        hn = hinode->hi_notify;
 
68
        unsigned long long ull;
 
69
 
 
70
        ull = atomic64_inc_return(&au_hfsn_ifree);
 
71
        BUG_ON(!ull);
 
72
 
70
73
        mark = &hn->hn_mark;
71
74
        fsnotify_destroy_mark(mark);
72
75
        fsnotify_put_mark(mark);
73
76
 
74
 
        /* TODO: bad approach */
75
 
        wait_event(au_hfsn_wq, hn->hn_mark_dead);
 
77
        /* free hn by myself */
 
78
        return 0;
76
79
}
77
80
 
78
81
/* ---------------------------------------------------------------------- */
140
143
        struct au_hnotify *hnotify;
141
144
        struct inode *h_dir, *h_inode;
142
145
        __u32 mask;
143
 
        struct qstr h_child_qstr = {
144
 
                .name   = event->file_name,
145
 
                .len    = event->name_len
146
 
        };
 
146
        struct qstr h_child_qstr = QSTR_INIT(event->file_name, event->name_len);
147
147
 
148
148
        AuDebugOn(event->data_type != FSNOTIFY_EVENT_INODE);
149
149
 
236
236
        return err;
237
237
}
238
238
 
 
239
/* ---------------------------------------------------------------------- */
 
240
 
 
241
static void au_hfsn_fin(void)
 
242
{
 
243
        AuDbg("au_hfsn_ifree %lld\n", (long long)atomic64_read(&au_hfsn_ifree));
 
244
        wait_event(au_hfsn_wq, !atomic64_read(&au_hfsn_ifree));
 
245
}
 
246
 
239
247
const struct au_hnotify_op au_hnotify_op = {
240
248
        .ctl            = au_hfsn_ctl,
241
249
        .alloc          = au_hfsn_alloc,
242
250
        .free           = au_hfsn_free,
243
251
 
 
252
        .fin            = au_hfsn_fin,
 
253
 
244
254
        .reset_br       = au_hfsn_reset_br,
245
255
        .fin_br         = au_hfsn_fin_br,
246
256
        .init_br        = au_hfsn_init_br