~ubuntu-branches/ubuntu/natty/linux-ti-omap/natty

« back to all changes in this revision

Viewing changes to ubuntu/aufs/inode.h

  • Committer: Bazaar Package Importer
  • Author(s): Andy Whitcroft, Amit Kucheria, Imre Deak, Upstream Kernel Changes
  • Date: 2010-03-31 21:50:49 UTC
  • Revision ID: james.westby@ubuntu.com-20100331215049-8sypya8mpk81gun6
Tags: 2.6.33-500.4
[ Amit Kucheria ]

* [Config] Compile-in display subsystem
* Merge the DSS2 stack from 2.6.34-rc2 mainline tree
* SAUCE: Upgrade aufs2 to latest version for 2.6.33
  - LP: #548924
* [Config] Update configuration for new aufs2
* [Config] Fix d-i modules
* [Config] USB_STORAGE and ATA drivers can be a modules
* [Upstream] DSS2 support for Beagleboard
* [Config] Configure DSS2 based on beagle defconfig
* [Config] Enable USB OTG mode
* [Config] Enable various ethernet drivers

[ Imre Deak ]

* SAUCE: ARM: VFP: add support to sync the VFP state of the current
  thread
  - LP: #507503
* SAUCE: ARM: VFP: preserve the HW context when calling signal handlers
  - LP: #507503

[ Upstream Kernel Changes ]

* OMAP: DSS2: Add Sharp LQ043T1DG01 panel driver
* OMAP: DSS2: add Toppoly TDO35S panel
* OMAP: DSS: add TPO TD043MTEA1 panel
* OMAP: DSS2: Improve Kconfig help texts
* OMAP: DSS2: enable VDDS_DSI when using DPI
* OMAP: 3430SDP: remove vdvi regulator
* OMAP: DSS: Taal: fix error returns in taal_probe()
* OMAP: DSS2: OMAPFB: implement OMAPFB_GET_DISPLAY_INFO
* OMAP: DSS2: fix irq-stats compilation
* OMAP: DSS2: OMAPFB: Add omapfb_update_window prototype
* OMAP: DSS2: improve DSS clk src selection
* OMAP: DSS2: DSI: add dsi_bus_is_locked()
* OMAP: DSS2: DSI: add helpers for DCS read/write
* OMAP: DSS2: DSI: export dsi_vc_enable_hs()
* OMAP: DSS2: DSI: configure all DSI VCs
* OMAP: DSS2: DSI: remove dsi_vc_print_status()
* OMAP: DSS2: Check ctx loss count only when starting the first clock
* OMAP: DSS2: remove sub-panel system
* OMAP: DSS2: fix driver probe error handling
* OMAP: DSS2: OMAPFB: fix dssdev cleanup on error
* OMAP: DSS2: OMAPFB: fix cleanup on dssdev enable error
* OMAP: DSS2: fix get_dsi/dispc_clk_source() usage
* OMAP: DSS2: DSI: change DSI bus_lock to semaphore
* OMAP: DSS2: DSI: remove auto-update perf measurement
* OMAP: DSS2: move run_test()
* OMAP: DSS2: move memory_read()
* OMAP: DSS2: move set/get_mirror()
* OMAP: DSS2: move get/set_rotate()
* OMAP: DSS2: move wait_vsync()
* OMAP: DSS2: move enable/disable_channel to overlay manager
* OMAP: DSS2: move get_resolution()
* OMAP: DSS2: move get_recommended_bpp()
* OMAP: DSS2: move enable/get_te()
* OMAP: DSS2: move set/get_update_mode()
* OMAP: DSS2: move update() and sync()
* OMAP: DSS2: move enable/disable/suspend/resume
* OMAP: DSS2: move set/get_wss()
* OMAP: DSS2: move timing functions
* OMAP: DSS2: DSI: remove external TE support
* OMAP: DSS2: OMAPFB: Remove FB_OMAP2_FORCE_AUTO_UPDATE
* OMAP: DSS2: DSI: add dsi_vc_dcs_read_2() helper
* OMAP: DSS2: TPO-TD03MTEA1: fix function names
* OMAP: DSS2: DSI: add error prints
* OMAP: DSS2: OMAPFB: Constify some function parameters
* OMAP: DSS2: Taal: Fix ESD check
* OMAP: DSS2: Taal: Fix TE when resuming
* OMAP: DSS2: VRAM: Fix early_param for vram
* OMAP: DSS2: initialize dss clk sources properly
* OMAP: DSS2: panel-generic: re-implement mode changing

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2005-2009 Junjiro R. Okajima
 
2
 * Copyright (C) 2005-2010 Junjiro R. Okajima
3
3
 *
4
4
 * This program, aufs is free software; you can redistribute it and/or modify
5
5
 * it under the terms of the GNU General Public License as published by
26
26
#ifdef __KERNEL__
27
27
 
28
28
#include <linux/fs.h>
29
 
#include <linux/inotify.h>
 
29
#include <linux/fsnotify.h>
30
30
#include <linux/aufs_type.h>
31
31
#include "rwsem.h"
32
32
 
33
33
struct vfsmount;
34
34
 
35
 
struct au_hinotify {
36
 
#ifdef CONFIG_AUFS_HINOTIFY
37
 
        struct inotify_watch    hin_watch;
38
 
        struct inode            *hin_aufs_inode;        /* no get/put */
 
35
struct au_hnotify {
 
36
#ifdef CONFIG_AUFS_HNOTIFY
 
37
#ifdef CONFIG_AUFS_HFSNOTIFY
 
38
        struct fsnotify_mark_entry      hn_entry;
 
39
#else
 
40
        struct inotify_watch            hn_watch;
 
41
#endif
 
42
        struct inode                    *hn_aufs_inode; /* no get/put */
39
43
#endif
40
44
};
41
45
 
42
46
struct au_hinode {
43
47
        struct inode            *hi_inode;
44
48
        aufs_bindex_t           hi_id;
45
 
#ifdef CONFIG_AUFS_HINOTIFY
46
 
        struct au_hinotify      *hi_notify;
 
49
#ifdef CONFIG_AUFS_HNOTIFY
 
50
        struct au_hnotify       *hi_notify;
47
51
#endif
48
52
 
49
53
        /* reference to the copied-up whiteout with get/put */
182
186
 
183
187
/* hinode flags */
184
188
#define AuHi_XINO       1
185
 
#define AuHi_HINOTIFY   (1 << 1)
 
189
#define AuHi_HNOTIFY    (1 << 1)
186
190
#define au_ftest_hi(flags, name)        ((flags) & AuHi_##name)
187
191
#define au_fset_hi(flags, name)         { (flags) |= AuHi_##name; }
188
192
#define au_fclr_hi(flags, name)         { (flags) &= ~AuHi_##name; }
189
193
 
190
 
#ifndef CONFIG_AUFS_HINOTIFY
191
 
#undef AuHi_HINOTIFY
192
 
#define AuHi_HINOTIFY   0
 
194
#ifndef CONFIG_AUFS_HNOTIFY
 
195
#undef AuHi_HNOTIFY
 
196
#define AuHi_HNOTIFY    0
193
197
#endif
194
198
 
195
199
void au_set_h_iptr(struct inode *inode, aufs_bindex_t bindex,
203
207
int au_ii_realloc(struct au_iinfo *iinfo, int nbr);
204
208
 
205
209
/* plink.c */
206
 
void au_plink_block_maintain(struct super_block *sb);
 
210
void au_plink_maint_block(struct super_block *sb);
 
211
void au_plink_maint_leave(struct file *file);
207
212
#ifdef CONFIG_AUFS_DEBUG
208
213
void au_plink_list(struct super_block *sb);
209
214
#else
210
 
static inline void au_plink_list(struct super_block *sb)
211
 
{
212
 
        /* nothing */
213
 
}
 
215
AuStubVoid(au_plink_list, struct super_block *sb)
214
216
#endif
215
217
int au_plink_test(struct inode *inode);
216
218
struct dentry *au_plink_lkup(struct inode *inode, aufs_bindex_t bindex);
225
227
/* lock subclass for iinfo */
226
228
enum {
227
229
        AuLsc_II_CHILD,         /* child first */
228
 
        AuLsc_II_CHILD2,        /* rename(2), link(2), and cpup at hinotify */
 
230
        AuLsc_II_CHILD2,        /* rename(2), link(2), and cpup at hnotify */
229
231
        AuLsc_II_CHILD3,        /* copyup dirs */
230
232
        AuLsc_II_PARENT,        /* see AuLsc_I_PARENT in vfsub.h */
231
233
        AuLsc_II_PARENT2,
298
300
                 && iinfo->ii_higen == h_inode->i_generation);
299
301
}
300
302
 
 
303
static inline void au_iigen_dec(struct inode *inode)
 
304
{
 
305
#ifdef CONFIG_AUFS_HNOTIFY
 
306
        atomic_dec_return(&au_ii(inode)->ii_generation);
 
307
#endif
 
308
}
 
309
 
301
310
/* ---------------------------------------------------------------------- */
302
311
 
303
312
static inline aufs_bindex_t au_ii_br_id(struct inode *inode,
401
410
 
402
411
/* ---------------------------------------------------------------------- */
403
412
 
404
 
#ifdef CONFIG_AUFS_HINOTIFY
 
413
#ifdef CONFIG_AUFS_HNOTIFY
 
414
struct au_hnotify_op {
 
415
        void (*ctl)(struct au_hinode *hinode, int do_set);
 
416
        int (*alloc)(struct au_hnotify *hn, struct inode *h_inode);
 
417
        void (*free)(struct au_hnotify *hn);
 
418
 
 
419
        void (*fin)(void);
 
420
        int (*init)(void);
 
421
};
 
422
 
 
423
/* hnotify.c */
 
424
int au_hn_alloc(struct au_hinode *hinode, struct inode *inode,
 
425
                struct inode *h_inode);
 
426
void au_hn_free(struct au_hinode *hinode);
 
427
void au_hn_ctl(struct au_hinode *hinode, int do_set);
 
428
void au_hn_reset(struct inode *inode, unsigned int flags);
 
429
int au_hnotify(struct inode *h_dir, struct au_hnotify *hnotify, u32 mask,
 
430
               struct qstr *h_child_qstr, struct inode *h_child_inode);
 
431
int __init au_hnotify_init(void);
 
432
void au_hnotify_fin(void);
 
433
 
405
434
/* hinotify.c */
406
 
int au_hin_alloc(struct au_hinode *hinode, struct inode *inode,
407
 
                 struct inode *h_inode);
408
 
void au_hin_free(struct au_hinode *hinode);
409
 
void au_hin_ctl(struct au_hinode *hinode, int do_set);
410
 
void au_reset_hinotify(struct inode *inode, unsigned int flags);
411
 
 
412
 
int __init au_hinotify_init(void);
413
 
void au_hinotify_fin(void);
 
435
extern const struct au_hnotify_op au_hnotify_op;
414
436
 
415
437
static inline
416
 
void au_hin_init(struct au_hinode *hinode, struct au_hinotify *val)
417
 
{
418
 
        hinode->hi_notify = val;
419
 
}
420
 
 
421
 
static inline void au_iigen_dec(struct inode *inode)
422
 
{
423
 
        atomic_dec_return(&au_ii(inode)->ii_generation);
 
438
void au_hn_init(struct au_hinode *hinode)
 
439
{
 
440
        hinode->hi_notify = NULL;
424
441
}
425
442
 
426
443
#else
427
444
static inline
428
 
int au_hin_alloc(struct au_hinode *hinode __maybe_unused,
429
 
                 struct inode *inode __maybe_unused,
430
 
                 struct inode *h_inode __maybe_unused)
 
445
int au_hn_alloc(struct au_hinode *hinode __maybe_unused,
 
446
                struct inode *inode __maybe_unused,
 
447
                struct inode *h_inode __maybe_unused)
431
448
{
432
449
        return -EOPNOTSUPP;
433
450
}
434
451
 
435
 
static inline void au_hin_free(struct au_hinode *hinode __maybe_unused)
436
 
{
437
 
        /* nothing */
438
 
}
439
 
 
440
 
static inline void au_hin_ctl(struct au_hinode *hinode __maybe_unused,
441
 
                              int do_set __maybe_unused)
442
 
{
443
 
        /* nothing */
444
 
}
445
 
 
446
 
static inline void au_reset_hinotify(struct inode *inode __maybe_unused,
447
 
                                     unsigned int flags __maybe_unused)
448
 
{
449
 
        /* nothing */
450
 
}
451
 
 
452
 
static inline int au_hinotify_init(void)
453
 
{
454
 
        return 0;
455
 
}
456
 
 
457
 
#define au_hinotify_fin()       do {} while (0)
458
 
 
459
 
static inline
460
 
void au_hin_init(struct au_hinode *hinode __maybe_unused,
461
 
                 struct au_hinotify *val __maybe_unused)
462
 
{
463
 
        /* empty */
464
 
}
465
 
#endif /* CONFIG_AUFS_HINOTIFY */
466
 
 
467
 
static inline void au_hin_suspend(struct au_hinode *hdir)
468
 
{
469
 
        au_hin_ctl(hdir, /*do_set*/0);
470
 
}
471
 
 
472
 
static inline void au_hin_resume(struct au_hinode *hdir)
473
 
{
474
 
        au_hin_ctl(hdir, /*do_set*/1);
475
 
}
476
 
 
477
 
static inline void au_hin_imtx_lock(struct au_hinode *hdir)
 
452
AuStubVoid(au_hn_free, struct au_hinode *hinode __maybe_unused)
 
453
AuStubVoid(au_hn_ctl, struct au_hinode *hinode __maybe_unused,
 
454
           int do_set __maybe_unused)
 
455
AuStubVoid(au_hn_reset, struct inode *inode __maybe_unused,
 
456
           unsigned int flags __maybe_unused)
 
457
AuStubInt0(__init au_hnotify_init, void)
 
458
AuStubVoid(au_hnotify_fin, void)
 
459
AuStubVoid(au_hn_init, struct au_hinode *hinode __maybe_unused)
 
460
#endif /* CONFIG_AUFS_HNOTIFY */
 
461
 
 
462
static inline void au_hn_suspend(struct au_hinode *hdir)
 
463
{
 
464
        au_hn_ctl(hdir, /*do_set*/0);
 
465
}
 
466
 
 
467
static inline void au_hn_resume(struct au_hinode *hdir)
 
468
{
 
469
        au_hn_ctl(hdir, /*do_set*/1);
 
470
}
 
471
 
 
472
static inline void au_hn_imtx_lock(struct au_hinode *hdir)
478
473
{
479
474
        mutex_lock(&hdir->hi_inode->i_mutex);
480
 
        au_hin_suspend(hdir);
 
475
        au_hn_suspend(hdir);
481
476
}
482
477
 
483
 
static inline void au_hin_imtx_lock_nested(struct au_hinode *hdir,
484
 
                                           unsigned int sc __maybe_unused)
 
478
static inline void au_hn_imtx_lock_nested(struct au_hinode *hdir,
 
479
                                          unsigned int sc __maybe_unused)
485
480
{
486
481
        mutex_lock_nested(&hdir->hi_inode->i_mutex, sc);
487
 
        au_hin_suspend(hdir);
 
482
        au_hn_suspend(hdir);
488
483
}
489
484
 
490
 
static inline void au_hin_imtx_unlock(struct au_hinode *hdir)
 
485
static inline void au_hn_imtx_unlock(struct au_hinode *hdir)
491
486
{
492
 
        au_hin_resume(hdir);
 
487
        au_hn_resume(hdir);
493
488
        mutex_unlock(&hdir->hi_inode->i_mutex);
494
489
}
495
490