summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/bus.c
AgeCommit message (Expand)Author
2011-05-29ACPI: Add D3 cold stateLin Ming
2011-03-15PM: Drop pm_flags that is not necessaryRafael J. Wysocki
2011-03-15PM / ACPI: Remove references to pm_flags from bus.cRafael J. Wysocki
2011-01-12ACPI / PM: Drop acpi_power_nocheckRafael J. Wysocki
2011-01-12ACPI / PM: Drop acpi_bus_get_power()Rafael J. Wysocki
2011-01-12ACPI / Fan: Rework the handling of power resourcesRafael J. Wysocki
2011-01-12ACPI / PM: Register acpi_power_driver earlyRafael J. Wysocki
2011-01-12ACPI / PM: Add function for updating device power state consistentlyRafael J. Wysocki
2011-01-12ACPI / PM: Add function for device power state initializationRafael J. Wysocki
2011-01-12ACPI / PM: Introduce __acpi_bus_get_power()Rafael J. Wysocki
2011-01-12ACPI / PM: Prevent acpi_power_get_inferred_state() from making changesRafael J. Wysocki
2010-10-26ACPI: install ACPI table handler before any dynamic tables being loadedZhang Rui
2010-09-29Merge branches 'apei', 'battery-mwh-fix', 'bugzilla-10807', 'bugzilla-14736',...Len Brown
2010-09-29ACPI: invoke DSDT corruption workaround on all Toshiba SatelliteLen Brown
2010-09-28ACPI: Fix typosLucas De Marchi
2010-08-15ACPI: remove deprecated ACPI procfs I/FZhang Rui
2010-08-15ACPI: introduce drivers/acpi/sysfs.cZhang Rui
2010-08-14ACPI: introduce drivers/acpi/debugfs.cZhang Rui
2010-05-25drivers: acpi: don't use own implementation of hex_to_bin()Andy Shevchenko
2010-05-20Merge branch 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/l...Linus Torvalds
2010-05-19ACPI: fix early DSDT dmi check warnings on ia64Lin Ming
2010-04-27ACPI: silence kmemcheck false positiveDan Carpenter
2010-04-20ACPI: add boot option acpi=copy_dsdt to fix corrupt DSDTLin Ming
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking imp...Tejun Heo
2010-03-14Merge branches 'battery-2.6.34', 'bugzilla-10805', 'bugzilla-14668', 'bugzill...Len Brown
2010-01-15ACPI: Advertise to BIOS in _OSC: _OST on _PPC changesZhao Yakui
2009-12-28ACPI: Disable explicit power state retrieval on fansZhang Rui
2009-12-24Merge branches 'bugzilla-14446', 'bugzilla-14753' and 'bugzilla-14824' into r...Len Brown
2009-12-23ACPI: fix OSC regression that caused aer and pciehp not to loadShaohua Li
2009-12-22ACPI: processor: call _PDC earlyAlex Chiang
2009-12-16ACPI: Add platform-wide _OSC support.Shaohua Li
2009-12-16ACPI: Add a generic API for _OSC -v2Shaohua Li
2009-09-25ACPI: add acpi_bus_get_status_handle()Bjorn Helgaas
2009-09-19Merge branch 'misc-2.6.32' into releaseLen Brown
2009-09-19ACPI: linux/acpi.h should not include linux/dmi.hLen Brown
2009-08-27ACPICA: Fix several acpi_attach_data problemsBob Moore
2009-06-18ACPI: use handle, not device, in system notification pathBjorn Helgaas
2009-06-18ACPI: remove unused return values from Bus Check & Device Check handlingBjorn Helgaas
2009-06-18ACPI: remove unused "status_changed" return value from Check Device handlingBjorn Helgaas
2009-06-18ACPI: simplify notification debug messagesBjorn Helgaas
2009-06-18ACPI: allow drivers to request both device and system notify eventsBjorn Helgaas
2009-05-08ACPI: power: update error messageLen Brown
2009-04-05Merge branch 'bjorn-initcall-cleanup' into releaseLen Brown
2009-03-27ACPI: call acpi_wakeup_device_init() explicitly rather than as initcallBjorn Helgaas
2009-03-27ACPI: call acpi_sleep_proc_init() explicitly rather than as initcallBjorn Helgaas
2009-03-27ACPI: call init_acpi_device_notify() explicitly rather than as initcallBjorn Helgaas
2009-03-27ACPI: call acpi_debug_init() explicitly rather than as initcallBjorn Helgaas
2009-03-27ACPI: call acpi_system_init() explicitly rather than as initcallBjorn Helgaas
2009-03-27ACPI: call acpi_power_init() explicitly rather than as initcallBjorn Helgaas
2009-03-27ACPI: call acpi_ec_init() explicitly rather than as initcallBjorn Helgaas
.8/standard/qemuppc'>v5.8/standard/qemuppc Yocto Linux Embedded kernelGrokmirror user
summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_quota.h
blob: 5376dd406ba2c099e23230014b1b23cbb832f6ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
 * All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it would be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write the Free Software Foundation,
 * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
#ifndef __XFS_QUOTA_H__
#define __XFS_QUOTA_H__

#include "xfs_quota_defs.h"

/*
 * Kernel only quota definitions and functions
 */

struct xfs_trans;

/*
 * This check is done typically without holding the inode lock;
 * that may seem racy, but it is harmless in the context that it is used.
 * The inode cannot go inactive as long a reference is kept, and
 * therefore if dquot(s) were attached, they'll stay consistent.
 * If, for example, the ownership of the inode changes while
 * we didn't have the inode locked, the appropriate dquot(s) will be
 * attached atomically.
 */
#define XFS_NOT_DQATTACHED(mp, ip) \
	((XFS_IS_UQUOTA_ON(mp) && (ip)->i_udquot == NULL) || \
	 (XFS_IS_GQUOTA_ON(mp) && (ip)->i_gdquot == NULL) || \
	 (XFS_IS_PQUOTA_ON(mp) && (ip)->i_pdquot == NULL))

#define XFS_QM_NEED_QUOTACHECK(mp) \
	((XFS_IS_UQUOTA_ON(mp) && \
		(mp->m_sb.sb_qflags & XFS_UQUOTA_CHKD) == 0) || \
	 (XFS_IS_GQUOTA_ON(mp) && \
		(mp->m_sb.sb_qflags & XFS_GQUOTA_CHKD) == 0) || \
	 (XFS_IS_PQUOTA_ON(mp) && \
		(mp->m_sb.sb_qflags & XFS_PQUOTA_CHKD) == 0))

/*
 * The structure kept inside the xfs_trans_t keep track of dquot changes
 * within a transaction and apply them later.
 */
typedef struct xfs_dqtrx {
	struct xfs_dquot *qt_dquot;	  /* the dquot this refers to */
	ulong		qt_blk_res;	  /* blks reserved on a dquot */
	ulong		qt_blk_res_used;  /* blks used from the reservation */
	ulong		qt_ino_res;	  /* inode reserved on a dquot */
	ulong		qt_ino_res_used;  /* inodes used from the reservation */
	long		qt_bcount_delta;  /* dquot blk count changes */
	long		qt_delbcnt_delta; /* delayed dquot blk count changes */
	long		qt_icount_delta;  /* dquot inode count changes */
	ulong		qt_rtblk_res;	  /* # blks reserved on a dquot */
	ulong		qt_rtblk_res_used;/* # blks used from reservation */
	long		qt_rtbcount_delta;/* dquot realtime blk changes */
	long		qt_delrtb_delta;  /* delayed RT blk count changes */
} xfs_dqtrx_t;

#ifdef CONFIG_XFS_QUOTA
extern void xfs_trans_dup_dqinfo(struct xfs_trans *, struct xfs_trans *);
extern void xfs_trans_free_dqinfo(struct xfs_trans *);
extern void xfs_trans_mod_dquot_byino(struct xfs_trans *, struct xfs_inode *,
		uint, long);
extern void xfs_trans_apply_dquot_deltas(struct xfs_trans *);
extern void xfs_trans_unreserve_and_mod_dquots(struct xfs_trans *);
extern int xfs_trans_reserve_quota_nblks(struct xfs_trans *,
		struct xfs_inode *, long, long, uint);
extern int xfs_trans_reserve_quota_bydquots(struct xfs_trans *,
		struct xfs_mount *, struct xfs_dquot *,
		struct xfs_dquot *, struct xfs_dquot *, long, long, uint);

extern int xfs_qm_vop_dqalloc(struct xfs_inode *, xfs_dqid_t, xfs_dqid_t,
		prid_t, uint, struct xfs_dquot **, struct xfs_dquot **,
		struct xfs_dquot **);
extern void xfs_qm_vop_create_dqattach(struct xfs_trans *, struct xfs_inode *,
		struct xfs_dquot *, struct xfs_dquot *, struct xfs_dquot *);
extern int xfs_qm_vop_rename_dqattach(struct xfs_inode **);
extern struct xfs_dquot *xfs_qm_vop_chown(struct xfs_trans *,
		struct xfs_inode *, struct xfs_dquot **, struct xfs_dquot *);
extern int xfs_qm_vop_chown_reserve(struct xfs_trans *, struct xfs_inode *,
		struct xfs_dquot *, struct xfs_dquot *,
		struct xfs_dquot *, uint);
extern int xfs_qm_dqattach(struct xfs_inode *, uint);
extern int xfs_qm_dqattach_locked(struct xfs_inode *, uint);
extern void xfs_qm_dqdetach(struct xfs_inode *);
extern void xfs_qm_dqrele(struct xfs_dquot *);
extern void xfs_qm_statvfs(struct xfs_inode *, struct kstatfs *);
extern int xfs_qm_newmount(struct xfs_mount *, uint *, uint *);
extern void xfs_qm_mount_quotas(struct xfs_mount *);
extern void xfs_qm_unmount(struct xfs_mount *);
extern void xfs_qm_unmount_quotas(struct xfs_mount *);

#else
static inline int
xfs_qm_vop_dqalloc(struct xfs_inode *ip, xfs_dqid_t uid, xfs_dqid_t gid,
		prid_t prid, uint flags, struct xfs_dquot **udqp,
		struct xfs_dquot **gdqp, struct xfs_dquot **pdqp)
{
	*udqp = NULL;
	*gdqp = NULL;
	*pdqp = NULL;
	return 0;
}
#define xfs_trans_dup_dqinfo(tp, tp2)
#define xfs_trans_free_dqinfo(tp)
#define xfs_trans_mod_dquot_byino(tp, ip, fields, delta)
#define xfs_trans_apply_dquot_deltas(tp)
#define xfs_trans_unreserve_and_mod_dquots(tp)
static inline int xfs_trans_reserve_quota_nblks(struct xfs_trans *tp,
		struct xfs_inode *ip, long nblks, long ninos, uint flags)
{
	return 0;
}
static inline int xfs_trans_reserve_quota_bydquots(struct xfs_trans *tp,
		struct xfs_mount *mp, struct xfs_dquot *udqp,
		struct xfs_dquot *gdqp, struct xfs_dquot *pdqp,
		long nblks, long nions, uint flags)
{
	return 0;
}
#define xfs_qm_vop_create_dqattach(tp, ip, u, g, p)
#define xfs_qm_vop_rename_dqattach(it)					(0)
#define xfs_qm_vop_chown(tp, ip, old, new)				(NULL)
#define xfs_qm_vop_chown_reserve(tp, ip, u, g, p, fl)			(0)
#define xfs_qm_dqattach(ip, fl)						(0)
#define xfs_qm_dqattach_locked(ip, fl)					(0)
#define xfs_qm_dqdetach(ip)
#define xfs_qm_dqrele(d)
#define xfs_qm_statvfs(ip, s)
#define xfs_qm_newmount(mp, a, b)					(0)
#define xfs_qm_mount_quotas(mp)
#define xfs_qm_unmount(mp)
#define xfs_qm_unmount_quotas(mp)
#endif /* CONFIG_XFS_QUOTA */

#define xfs_trans_unreserve_quota_nblks(tp, ip, nblks, ninos, flags) \
	xfs_trans_reserve_quota_nblks(tp, ip, -(nblks), -(ninos), flags)
#define xfs_trans_reserve_quota(tp, mp, ud, gd, pd, nb, ni, f) \
	xfs_trans_reserve_quota_bydquots(tp, mp, ud, gd, pd, nb, ni, \
				f | XFS_QMOPT_RES_REGBLKS)

extern int xfs_mount_reset_sbqflags(struct xfs_mount *);

#endif	/* __XFS_QUOTA_H__ */