diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/Kbuild | 4 | ||||
-rw-r--r-- | include/linux/audit.h | 98 | ||||
-rw-r--r-- | include/linux/blockgroup_lock.h | 7 | ||||
-rw-r--r-- | include/linux/cpufreq.h | 1 | ||||
-rw-r--r-- | include/linux/dma_remapping.h | 8 | ||||
-rw-r--r-- | include/linux/dqblk_qtree.h | 56 | ||||
-rw-r--r-- | include/linux/dqblk_v1.h | 7 | ||||
-rw-r--r-- | include/linux/dqblk_v2.h | 22 | ||||
-rw-r--r-- | include/linux/ext2_fs_sb.h | 6 | ||||
-rw-r--r-- | include/linux/ext3_fs_sb.h | 6 | ||||
-rw-r--r-- | include/linux/fs.h | 10 | ||||
-rw-r--r-- | include/linux/hid.h | 16 | ||||
-rw-r--r-- | include/linux/hidraw.h | 2 | ||||
-rw-r--r-- | include/linux/jbd2.h | 32 | ||||
-rw-r--r-- | include/linux/journal-head.h | 8 | ||||
-rw-r--r-- | include/linux/netdevice.h | 16 | ||||
-rw-r--r-- | include/linux/pagemap.h | 3 | ||||
-rw-r--r-- | include/linux/quota.h | 108 | ||||
-rw-r--r-- | include/linux/quotaio_v1.h | 33 | ||||
-rw-r--r-- | include/linux/quotaio_v2.h | 79 | ||||
-rw-r--r-- | include/linux/quotaops.h | 96 | ||||
-rw-r--r-- | include/linux/radix-tree.h | 2 | ||||
-rw-r--r-- | include/linux/rtc.h | 8 | ||||
-rw-r--r-- | include/linux/spi/spi.h | 2 | ||||
-rw-r--r-- | include/linux/syscalls.h | 2 | ||||
-rw-r--r-- | include/net/ndisc.h | 4 |
26 files changed, 374 insertions, 262 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 95ac82340c3b..39da666067b9 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -56,8 +56,6 @@ header-y += dlm_device.h | |||
56 | header-y += dlm_netlink.h | 56 | header-y += dlm_netlink.h |
57 | header-y += dm-ioctl.h | 57 | header-y += dm-ioctl.h |
58 | header-y += dn.h | 58 | header-y += dn.h |
59 | header-y += dqblk_v1.h | ||
60 | header-y += dqblk_v2.h | ||
61 | header-y += dqblk_xfs.h | 59 | header-y += dqblk_xfs.h |
62 | header-y += efs_fs_sb.h | 60 | header-y += efs_fs_sb.h |
63 | header-y += elf-fdpic.h | 61 | header-y += elf-fdpic.h |
@@ -134,8 +132,6 @@ header-y += posix_types.h | |||
134 | header-y += ppdev.h | 132 | header-y += ppdev.h |
135 | header-y += prctl.h | 133 | header-y += prctl.h |
136 | header-y += qnxtypes.h | 134 | header-y += qnxtypes.h |
137 | header-y += quotaio_v1.h | ||
138 | header-y += quotaio_v2.h | ||
139 | header-y += radeonfb.h | 135 | header-y += radeonfb.h |
140 | header-y += raw.h | 136 | header-y += raw.h |
141 | header-y += resource.h | 137 | header-y += resource.h |
diff --git a/include/linux/audit.h b/include/linux/audit.h index 26c4f6f65a46..67e5dbfc2961 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -247,6 +247,18 @@ | |||
247 | #define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL) | 247 | #define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL) |
248 | #define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK) | 248 | #define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK) |
249 | 249 | ||
250 | enum { | ||
251 | Audit_equal, | ||
252 | Audit_not_equal, | ||
253 | Audit_bitmask, | ||
254 | Audit_bittest, | ||
255 | Audit_lt, | ||
256 | Audit_gt, | ||
257 | Audit_le, | ||
258 | Audit_ge, | ||
259 | Audit_bad | ||
260 | }; | ||
261 | |||
250 | /* Status symbols */ | 262 | /* Status symbols */ |
251 | /* Mask values */ | 263 | /* Mask values */ |
252 | #define AUDIT_STATUS_ENABLED 0x0001 | 264 | #define AUDIT_STATUS_ENABLED 0x0001 |
@@ -373,6 +385,8 @@ struct audit_krule { | |||
373 | struct audit_watch *watch; /* associated watch */ | 385 | struct audit_watch *watch; /* associated watch */ |
374 | struct audit_tree *tree; /* associated watched tree */ | 386 | struct audit_tree *tree; /* associated watched tree */ |
375 | struct list_head rlist; /* entry in audit_{watch,tree}.rules list */ | 387 | struct list_head rlist; /* entry in audit_{watch,tree}.rules list */ |
388 | struct list_head list; /* for AUDIT_LIST* purposes only */ | ||
389 | u64 prio; | ||
376 | }; | 390 | }; |
377 | 391 | ||
378 | struct audit_field { | 392 | struct audit_field { |
@@ -443,70 +457,56 @@ extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); | |||
443 | #define audit_get_loginuid(t) ((t)->loginuid) | 457 | #define audit_get_loginuid(t) ((t)->loginuid) |
444 | #define audit_get_sessionid(t) ((t)->sessionid) | 458 | #define audit_get_sessionid(t) ((t)->sessionid) |
445 | extern void audit_log_task_context(struct audit_buffer *ab); | 459 | extern void audit_log_task_context(struct audit_buffer *ab); |
446 | extern int __audit_ipc_obj(struct kern_ipc_perm *ipcp); | 460 | extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); |
447 | extern int __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); | 461 | extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); |
448 | extern int audit_bprm(struct linux_binprm *bprm); | 462 | extern int audit_bprm(struct linux_binprm *bprm); |
449 | extern int audit_socketcall(int nargs, unsigned long *args); | 463 | extern void audit_socketcall(int nargs, unsigned long *args); |
450 | extern int audit_sockaddr(int len, void *addr); | 464 | extern int audit_sockaddr(int len, void *addr); |
451 | extern int __audit_fd_pair(int fd1, int fd2); | 465 | extern void __audit_fd_pair(int fd1, int fd2); |
452 | extern int audit_set_macxattr(const char *name); | 466 | extern int audit_set_macxattr(const char *name); |
453 | extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr); | 467 | extern void __audit_mq_open(int oflag, mode_t mode, struct mq_attr *attr); |
454 | extern int __audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout); | 468 | extern void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout); |
455 | extern int __audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout); | 469 | extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification); |
456 | extern int __audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification); | 470 | extern void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat); |
457 | extern int __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat); | ||
458 | extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, | 471 | extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, |
459 | const struct cred *new, | 472 | const struct cred *new, |
460 | const struct cred *old); | 473 | const struct cred *old); |
461 | extern int __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old); | 474 | extern void __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old); |
462 | 475 | ||
463 | static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp) | 476 | static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) |
464 | { | 477 | { |
465 | if (unlikely(!audit_dummy_context())) | 478 | if (unlikely(!audit_dummy_context())) |
466 | return __audit_ipc_obj(ipcp); | 479 | __audit_ipc_obj(ipcp); |
467 | return 0; | ||
468 | } | ||
469 | static inline int audit_fd_pair(int fd1, int fd2) | ||
470 | { | ||
471 | if (unlikely(!audit_dummy_context())) | ||
472 | return __audit_fd_pair(fd1, fd2); | ||
473 | return 0; | ||
474 | } | 480 | } |
475 | static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) | 481 | static inline void audit_fd_pair(int fd1, int fd2) |
476 | { | 482 | { |
477 | if (unlikely(!audit_dummy_context())) | 483 | if (unlikely(!audit_dummy_context())) |
478 | return __audit_ipc_set_perm(qbytes, uid, gid, mode); | 484 | __audit_fd_pair(fd1, fd2); |
479 | return 0; | ||
480 | } | 485 | } |
481 | static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr) | 486 | static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) |
482 | { | 487 | { |
483 | if (unlikely(!audit_dummy_context())) | 488 | if (unlikely(!audit_dummy_context())) |
484 | return __audit_mq_open(oflag, mode, u_attr); | 489 | __audit_ipc_set_perm(qbytes, uid, gid, mode); |
485 | return 0; | ||
486 | } | 490 | } |
487 | static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout) | 491 | static inline void audit_mq_open(int oflag, mode_t mode, struct mq_attr *attr) |
488 | { | 492 | { |
489 | if (unlikely(!audit_dummy_context())) | 493 | if (unlikely(!audit_dummy_context())) |
490 | return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout); | 494 | __audit_mq_open(oflag, mode, attr); |
491 | return 0; | ||
492 | } | 495 | } |
493 | static inline int audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout) | 496 | static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout) |
494 | { | 497 | { |
495 | if (unlikely(!audit_dummy_context())) | 498 | if (unlikely(!audit_dummy_context())) |
496 | return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout); | 499 | __audit_mq_sendrecv(mqdes, msg_len, msg_prio, abs_timeout); |
497 | return 0; | ||
498 | } | 500 | } |
499 | static inline int audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification) | 501 | static inline void audit_mq_notify(mqd_t mqdes, const struct sigevent *notification) |
500 | { | 502 | { |
501 | if (unlikely(!audit_dummy_context())) | 503 | if (unlikely(!audit_dummy_context())) |
502 | return __audit_mq_notify(mqdes, u_notification); | 504 | __audit_mq_notify(mqdes, notification); |
503 | return 0; | ||
504 | } | 505 | } |
505 | static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat) | 506 | static inline void audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat) |
506 | { | 507 | { |
507 | if (unlikely(!audit_dummy_context())) | 508 | if (unlikely(!audit_dummy_context())) |
508 | return __audit_mq_getsetattr(mqdes, mqstat); | 509 | __audit_mq_getsetattr(mqdes, mqstat); |
509 | return 0; | ||
510 | } | 510 | } |
511 | 511 | ||
512 | static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, | 512 | static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, |
@@ -518,12 +518,11 @@ static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, | |||
518 | return 0; | 518 | return 0; |
519 | } | 519 | } |
520 | 520 | ||
521 | static inline int audit_log_capset(pid_t pid, const struct cred *new, | 521 | static inline void audit_log_capset(pid_t pid, const struct cred *new, |
522 | const struct cred *old) | 522 | const struct cred *old) |
523 | { | 523 | { |
524 | if (unlikely(!audit_dummy_context())) | 524 | if (unlikely(!audit_dummy_context())) |
525 | return __audit_log_capset(pid, new, old); | 525 | __audit_log_capset(pid, new, old); |
526 | return 0; | ||
527 | } | 526 | } |
528 | 527 | ||
529 | extern int audit_n_rules; | 528 | extern int audit_n_rules; |
@@ -546,20 +545,19 @@ extern int audit_signals; | |||
546 | #define audit_get_loginuid(t) (-1) | 545 | #define audit_get_loginuid(t) (-1) |
547 | #define audit_get_sessionid(t) (-1) | 546 | #define audit_get_sessionid(t) (-1) |
548 | #define audit_log_task_context(b) do { ; } while (0) | 547 | #define audit_log_task_context(b) do { ; } while (0) |
549 | #define audit_ipc_obj(i) ({ 0; }) | 548 | #define audit_ipc_obj(i) ((void)0) |
550 | #define audit_ipc_set_perm(q,u,g,m) ({ 0; }) | 549 | #define audit_ipc_set_perm(q,u,g,m) ((void)0) |
551 | #define audit_bprm(p) ({ 0; }) | 550 | #define audit_bprm(p) ({ 0; }) |
552 | #define audit_socketcall(n,a) ({ 0; }) | 551 | #define audit_socketcall(n,a) ((void)0) |
553 | #define audit_fd_pair(n,a) ({ 0; }) | 552 | #define audit_fd_pair(n,a) ((void)0) |
554 | #define audit_sockaddr(len, addr) ({ 0; }) | 553 | #define audit_sockaddr(len, addr) ({ 0; }) |
555 | #define audit_set_macxattr(n) do { ; } while (0) | 554 | #define audit_set_macxattr(n) do { ; } while (0) |
556 | #define audit_mq_open(o,m,a) ({ 0; }) | 555 | #define audit_mq_open(o,m,a) ((void)0) |
557 | #define audit_mq_timedsend(d,l,p,t) ({ 0; }) | 556 | #define audit_mq_sendrecv(d,l,p,t) ((void)0) |
558 | #define audit_mq_timedreceive(d,l,p,t) ({ 0; }) | 557 | #define audit_mq_notify(d,n) ((void)0) |
559 | #define audit_mq_notify(d,n) ({ 0; }) | 558 | #define audit_mq_getsetattr(d,s) ((void)0) |
560 | #define audit_mq_getsetattr(d,s) ({ 0; }) | ||
561 | #define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; }) | 559 | #define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; }) |
562 | #define audit_log_capset(pid, ncr, ocr) ({ 0; }) | 560 | #define audit_log_capset(pid, ncr, ocr) ((void)0) |
563 | #define audit_ptrace(t) ((void)0) | 561 | #define audit_ptrace(t) ((void)0) |
564 | #define audit_n_rules 0 | 562 | #define audit_n_rules 0 |
565 | #define audit_signals 0 | 563 | #define audit_signals 0 |
diff --git a/include/linux/blockgroup_lock.h b/include/linux/blockgroup_lock.h index 8607312983bd..e44b88ba552b 100644 --- a/include/linux/blockgroup_lock.h +++ b/include/linux/blockgroup_lock.h | |||
@@ -53,7 +53,10 @@ static inline void bgl_lock_init(struct blockgroup_lock *bgl) | |||
53 | * The accessor is a macro so we can embed a blockgroup_lock into different | 53 | * The accessor is a macro so we can embed a blockgroup_lock into different |
54 | * superblock types | 54 | * superblock types |
55 | */ | 55 | */ |
56 | #define sb_bgl_lock(sb, block_group) \ | 56 | static inline spinlock_t * |
57 | (&(sb)->s_blockgroup_lock.locks[(block_group) & (NR_BG_LOCKS-1)].lock) | 57 | bgl_lock_ptr(struct blockgroup_lock *bgl, unsigned int block_group) |
58 | { | ||
59 | return &bgl->locks[(block_group) & (NR_BG_LOCKS-1)].lock; | ||
60 | } | ||
58 | 61 | ||
59 | #endif | 62 | #endif |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 1ee608fd7b77..484b3abf61bb 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -234,6 +234,7 @@ struct cpufreq_driver { | |||
234 | int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); | 234 | int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); |
235 | int (*resume) (struct cpufreq_policy *policy); | 235 | int (*resume) (struct cpufreq_policy *policy); |
236 | struct freq_attr **attr; | 236 | struct freq_attr **attr; |
237 | bool hide_interface; | ||
237 | }; | 238 | }; |
238 | 239 | ||
239 | /* flags */ | 240 | /* flags */ |
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h index 136f170cecc2..af1dab41674b 100644 --- a/include/linux/dma_remapping.h +++ b/include/linux/dma_remapping.h | |||
@@ -17,7 +17,15 @@ struct dmar_domain; | |||
17 | struct root_entry; | 17 | struct root_entry; |
18 | 18 | ||
19 | extern void free_dmar_iommu(struct intel_iommu *iommu); | 19 | extern void free_dmar_iommu(struct intel_iommu *iommu); |
20 | |||
21 | #ifdef CONFIG_DMAR | ||
20 | extern int iommu_calculate_agaw(struct intel_iommu *iommu); | 22 | extern int iommu_calculate_agaw(struct intel_iommu *iommu); |
23 | #else | ||
24 | static inline int iommu_calculate_agaw(struct intel_iommu *iommu) | ||
25 | { | ||
26 | return 0; | ||
27 | } | ||
28 | #endif | ||
21 | 29 | ||
22 | extern int dmar_disabled; | 30 | extern int dmar_disabled; |
23 | 31 | ||
diff --git a/include/linux/dqblk_qtree.h b/include/linux/dqblk_qtree.h new file mode 100644 index 000000000000..82a16527b367 --- /dev/null +++ b/include/linux/dqblk_qtree.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Definitions of structures and functions for quota formats using trie | ||
3 | */ | ||
4 | |||
5 | #ifndef _LINUX_DQBLK_QTREE_H | ||
6 | #define _LINUX_DQBLK_QTREE_H | ||
7 | |||
8 | #include <linux/types.h> | ||
9 | |||
10 | /* Numbers of blocks needed for updates - we count with the smallest | ||
11 | * possible block size (1024) */ | ||
12 | #define QTREE_INIT_ALLOC 4 | ||
13 | #define QTREE_INIT_REWRITE 2 | ||
14 | #define QTREE_DEL_ALLOC 0 | ||
15 | #define QTREE_DEL_REWRITE 6 | ||
16 | |||
17 | struct dquot; | ||
18 | |||
19 | /* Operations */ | ||
20 | struct qtree_fmt_operations { | ||
21 | void (*mem2disk_dqblk)(void *disk, struct dquot *dquot); /* Convert given entry from in memory format to disk one */ | ||
22 | void (*disk2mem_dqblk)(struct dquot *dquot, void *disk); /* Convert given entry from disk format to in memory one */ | ||
23 | int (*is_id)(void *disk, struct dquot *dquot); /* Is this structure for given id? */ | ||
24 | }; | ||
25 | |||
26 | /* Inmemory copy of version specific information */ | ||
27 | struct qtree_mem_dqinfo { | ||
28 | struct super_block *dqi_sb; /* Sb quota is on */ | ||
29 | int dqi_type; /* Quota type */ | ||
30 | unsigned int dqi_blocks; /* # of blocks in quota file */ | ||
31 | unsigned int dqi_free_blk; /* First block in list of free blocks */ | ||
32 | unsigned int dqi_free_entry; /* First block with free entry */ | ||
33 | unsigned int dqi_blocksize_bits; /* Block size of quota file */ | ||
34 | unsigned int dqi_entry_size; /* Size of quota entry in quota file */ | ||
35 | unsigned int dqi_usable_bs; /* Space usable in block for quota data */ | ||
36 | unsigned int dqi_qtree_depth; /* Precomputed depth of quota tree */ | ||
37 | struct qtree_fmt_operations *dqi_ops; /* Operations for entry manipulation */ | ||
38 | }; | ||
39 | |||
40 | int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); | ||
41 | int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); | ||
42 | int qtree_delete_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); | ||
43 | int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); | ||
44 | int qtree_entry_unused(struct qtree_mem_dqinfo *info, char *disk); | ||
45 | static inline int qtree_depth(struct qtree_mem_dqinfo *info) | ||
46 | { | ||
47 | unsigned int epb = info->dqi_usable_bs >> 2; | ||
48 | unsigned long long entries = epb; | ||
49 | int i; | ||
50 | |||
51 | for (i = 1; entries < (1ULL << 32); i++) | ||
52 | entries *= epb; | ||
53 | return i; | ||
54 | } | ||
55 | |||
56 | #endif /* _LINUX_DQBLK_QTREE_H */ | ||
diff --git a/include/linux/dqblk_v1.h b/include/linux/dqblk_v1.h index 57f1250d5a52..3713a7232dd8 100644 --- a/include/linux/dqblk_v1.h +++ b/include/linux/dqblk_v1.h | |||
@@ -5,9 +5,6 @@ | |||
5 | #ifndef _LINUX_DQBLK_V1_H | 5 | #ifndef _LINUX_DQBLK_V1_H |
6 | #define _LINUX_DQBLK_V1_H | 6 | #define _LINUX_DQBLK_V1_H |
7 | 7 | ||
8 | /* Id of quota format */ | ||
9 | #define QFMT_VFS_OLD 1 | ||
10 | |||
11 | /* Root squash turned on */ | 8 | /* Root squash turned on */ |
12 | #define V1_DQF_RSQUASH 1 | 9 | #define V1_DQF_RSQUASH 1 |
13 | 10 | ||
@@ -17,8 +14,4 @@ | |||
17 | #define V1_DEL_ALLOC 0 | 14 | #define V1_DEL_ALLOC 0 |
18 | #define V1_DEL_REWRITE 2 | 15 | #define V1_DEL_REWRITE 2 |
19 | 16 | ||
20 | /* Special information about quotafile */ | ||
21 | struct v1_mem_dqinfo { | ||
22 | }; | ||
23 | |||
24 | #endif /* _LINUX_DQBLK_V1_H */ | 17 | #endif /* _LINUX_DQBLK_V1_H */ |
diff --git a/include/linux/dqblk_v2.h b/include/linux/dqblk_v2.h index 4f853322cb7f..18000a542677 100644 --- a/include/linux/dqblk_v2.h +++ b/include/linux/dqblk_v2.h | |||
@@ -1,26 +1,16 @@ | |||
1 | /* | 1 | /* |
2 | * Definitions of structures for vfsv0 quota format | 2 | * Definitions for vfsv0 quota format |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #ifndef _LINUX_DQBLK_V2_H | 5 | #ifndef _LINUX_DQBLK_V2_H |
6 | #define _LINUX_DQBLK_V2_H | 6 | #define _LINUX_DQBLK_V2_H |
7 | 7 | ||
8 | #include <linux/types.h> | 8 | #include <linux/dqblk_qtree.h> |
9 | |||
10 | /* id numbers of quota format */ | ||
11 | #define QFMT_VFS_V0 2 | ||
12 | 9 | ||
13 | /* Numbers of blocks needed for updates */ | 10 | /* Numbers of blocks needed for updates */ |
14 | #define V2_INIT_ALLOC 4 | 11 | #define V2_INIT_ALLOC QTREE_INIT_ALLOC |
15 | #define V2_INIT_REWRITE 2 | 12 | #define V2_INIT_REWRITE QTREE_INIT_REWRITE |
16 | #define V2_DEL_ALLOC 0 | 13 | #define V2_DEL_ALLOC QTREE_DEL_ALLOC |
17 | #define V2_DEL_REWRITE 6 | 14 | #define V2_DEL_REWRITE QTREE_DEL_REWRITE |
18 | |||
19 | /* Inmemory copy of version specific information */ | ||
20 | struct v2_mem_dqinfo { | ||
21 | unsigned int dqi_blocks; | ||
22 | unsigned int dqi_free_blk; | ||
23 | unsigned int dqi_free_entry; | ||
24 | }; | ||
25 | 15 | ||
26 | #endif /* _LINUX_DQBLK_V2_H */ | 16 | #endif /* _LINUX_DQBLK_V2_H */ |
diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h index f273415ab6f1..dc541f3653d1 100644 --- a/include/linux/ext2_fs_sb.h +++ b/include/linux/ext2_fs_sb.h | |||
@@ -108,4 +108,10 @@ struct ext2_sb_info { | |||
108 | struct ext2_reserve_window_node s_rsv_window_head; | 108 | struct ext2_reserve_window_node s_rsv_window_head; |
109 | }; | 109 | }; |
110 | 110 | ||
111 | static inline spinlock_t * | ||
112 | sb_bgl_lock(struct ext2_sb_info *sbi, unsigned int block_group) | ||
113 | { | ||
114 | return bgl_lock_ptr(&sbi->s_blockgroup_lock, block_group); | ||
115 | } | ||
116 | |||
111 | #endif /* _LINUX_EXT2_FS_SB */ | 117 | #endif /* _LINUX_EXT2_FS_SB */ |
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h index b65f0288b842..e024e38248ff 100644 --- a/include/linux/ext3_fs_sb.h +++ b/include/linux/ext3_fs_sb.h | |||
@@ -83,4 +83,10 @@ struct ext3_sb_info { | |||
83 | #endif | 83 | #endif |
84 | }; | 84 | }; |
85 | 85 | ||
86 | static inline spinlock_t * | ||
87 | sb_bgl_lock(struct ext3_sb_info *sbi, unsigned int block_group) | ||
88 | { | ||
89 | return bgl_lock_ptr(&sbi->s_blockgroup_lock, block_group); | ||
90 | } | ||
91 | |||
86 | #endif /* _LINUX_EXT3_FS_SB */ | 92 | #endif /* _LINUX_EXT3_FS_SB */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index e2170ee21e18..fb59673c60b1 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -423,6 +423,9 @@ enum positive_aop_returns { | |||
423 | 423 | ||
424 | #define AOP_FLAG_UNINTERRUPTIBLE 0x0001 /* will not do a short write */ | 424 | #define AOP_FLAG_UNINTERRUPTIBLE 0x0001 /* will not do a short write */ |
425 | #define AOP_FLAG_CONT_EXPAND 0x0002 /* called from cont_expand */ | 425 | #define AOP_FLAG_CONT_EXPAND 0x0002 /* called from cont_expand */ |
426 | #define AOP_FLAG_NOFS 0x0004 /* used by filesystem to direct | ||
427 | * helper code (eg buffer layer) | ||
428 | * to clear GFP_FS from alloc */ | ||
426 | 429 | ||
427 | /* | 430 | /* |
428 | * oh the beauties of C type declarations. | 431 | * oh the beauties of C type declarations. |
@@ -1827,7 +1830,7 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping, | |||
1827 | extern int filemap_fdatawrite_range(struct address_space *mapping, | 1830 | extern int filemap_fdatawrite_range(struct address_space *mapping, |
1828 | loff_t start, loff_t end); | 1831 | loff_t start, loff_t end); |
1829 | 1832 | ||
1830 | extern long do_fsync(struct file *file, int datasync); | 1833 | extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync); |
1831 | extern void sync_supers(void); | 1834 | extern void sync_supers(void); |
1832 | extern void sync_filesystems(int wait); | 1835 | extern void sync_filesystems(int wait); |
1833 | extern void __fsync_super(struct super_block *sb); | 1836 | extern void __fsync_super(struct super_block *sb); |
@@ -2035,7 +2038,7 @@ extern int page_readlink(struct dentry *, char __user *, int); | |||
2035 | extern void *page_follow_link_light(struct dentry *, struct nameidata *); | 2038 | extern void *page_follow_link_light(struct dentry *, struct nameidata *); |
2036 | extern void page_put_link(struct dentry *, struct nameidata *, void *); | 2039 | extern void page_put_link(struct dentry *, struct nameidata *, void *); |
2037 | extern int __page_symlink(struct inode *inode, const char *symname, int len, | 2040 | extern int __page_symlink(struct inode *inode, const char *symname, int len, |
2038 | gfp_t gfp_mask); | 2041 | int nofs); |
2039 | extern int page_symlink(struct inode *inode, const char *symname, int len); | 2042 | extern int page_symlink(struct inode *inode, const char *symname, int len); |
2040 | extern const struct inode_operations page_symlink_inode_operations; | 2043 | extern const struct inode_operations page_symlink_inode_operations; |
2041 | extern int generic_readlink(struct dentry *, char __user *, int); | 2044 | extern int generic_readlink(struct dentry *, char __user *, int); |
@@ -2056,6 +2059,9 @@ extern int vfs_fstat(unsigned int, struct kstat *); | |||
2056 | 2059 | ||
2057 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | 2060 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, |
2058 | unsigned long arg); | 2061 | unsigned long arg); |
2062 | extern int __generic_block_fiemap(struct inode *inode, | ||
2063 | struct fiemap_extent_info *fieinfo, u64 start, | ||
2064 | u64 len, get_block_t *get_block); | ||
2059 | extern int generic_block_fiemap(struct inode *inode, | 2065 | extern int generic_block_fiemap(struct inode *inode, |
2060 | struct fiemap_extent_info *fieinfo, u64 start, | 2066 | struct fiemap_extent_info *fieinfo, u64 start, |
2061 | u64 len, get_block_t *get_block); | 2067 | u64 len, get_block_t *get_block); |
diff --git a/include/linux/hid.h b/include/linux/hid.h index e5780f8c934a..81aa84d60c6b 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -403,15 +403,6 @@ struct hid_output_fifo { | |||
403 | #define HID_STAT_ADDED 1 | 403 | #define HID_STAT_ADDED 1 |
404 | #define HID_STAT_PARSED 2 | 404 | #define HID_STAT_PARSED 2 |
405 | 405 | ||
406 | #define HID_CTRL_RUNNING 1 | ||
407 | #define HID_OUT_RUNNING 2 | ||
408 | #define HID_IN_RUNNING 3 | ||
409 | #define HID_RESET_PENDING 4 | ||
410 | #define HID_SUSPENDED 5 | ||
411 | #define HID_CLEAR_HALT 6 | ||
412 | #define HID_DISCONNECTED 7 | ||
413 | #define HID_STARTED 8 | ||
414 | |||
415 | struct hid_input { | 406 | struct hid_input { |
416 | struct list_head list; | 407 | struct list_head list; |
417 | struct hid_report *report; | 408 | struct hid_report *report; |
@@ -540,6 +531,8 @@ struct hid_usage_id { | |||
540 | * @name: driver name (e.g. "Footech_bar-wheel") | 531 | * @name: driver name (e.g. "Footech_bar-wheel") |
541 | * @id_table: which devices is this driver for (must be non-NULL for probe | 532 | * @id_table: which devices is this driver for (must be non-NULL for probe |
542 | * to be called) | 533 | * to be called) |
534 | * @dyn_list: list of dynamically added device ids | ||
535 | * @dyn_lock: lock protecting @dyn_list | ||
543 | * @probe: new device inserted | 536 | * @probe: new device inserted |
544 | * @remove: device removed (NULL if not a hot-plug capable driver) | 537 | * @remove: device removed (NULL if not a hot-plug capable driver) |
545 | * @report_table: on which reports to call raw_event (NULL means all) | 538 | * @report_table: on which reports to call raw_event (NULL means all) |
@@ -567,6 +560,9 @@ struct hid_driver { | |||
567 | char *name; | 560 | char *name; |
568 | const struct hid_device_id *id_table; | 561 | const struct hid_device_id *id_table; |
569 | 562 | ||
563 | struct list_head dyn_list; | ||
564 | spinlock_t dyn_lock; | ||
565 | |||
570 | int (*probe)(struct hid_device *dev, const struct hid_device_id *id); | 566 | int (*probe)(struct hid_device *dev, const struct hid_device_id *id); |
571 | void (*remove)(struct hid_device *dev); | 567 | void (*remove)(struct hid_device *dev); |
572 | 568 | ||
@@ -797,6 +793,8 @@ dbg_hid(const char *fmt, ...) | |||
797 | 793 | ||
798 | #ifdef CONFIG_HID_COMPAT | 794 | #ifdef CONFIG_HID_COMPAT |
799 | #define HID_COMPAT_LOAD_DRIVER(name) \ | 795 | #define HID_COMPAT_LOAD_DRIVER(name) \ |
796 | /* prototype to avoid sparse warning */ \ | ||
797 | extern void hid_compat_##name(void); \ | ||
800 | void hid_compat_##name(void) { } \ | 798 | void hid_compat_##name(void) { } \ |
801 | EXPORT_SYMBOL(hid_compat_##name) | 799 | EXPORT_SYMBOL(hid_compat_##name) |
802 | #else | 800 | #else |
diff --git a/include/linux/hidraw.h b/include/linux/hidraw.h index dbb5c8c374f0..dd8d69269176 100644 --- a/include/linux/hidraw.h +++ b/include/linux/hidraw.h | |||
@@ -33,6 +33,8 @@ struct hidraw_devinfo { | |||
33 | #define HIDIOCGRDESCSIZE _IOR('H', 0x01, int) | 33 | #define HIDIOCGRDESCSIZE _IOR('H', 0x01, int) |
34 | #define HIDIOCGRDESC _IOR('H', 0x02, struct hidraw_report_descriptor) | 34 | #define HIDIOCGRDESC _IOR('H', 0x02, struct hidraw_report_descriptor) |
35 | #define HIDIOCGRAWINFO _IOR('H', 0x03, struct hidraw_devinfo) | 35 | #define HIDIOCGRAWINFO _IOR('H', 0x03, struct hidraw_devinfo) |
36 | #define HIDIOCGRAWNAME(len) _IOC(_IOC_READ, 'H', 0x04, len) | ||
37 | #define HIDIOCGRAWPHYS(len) _IOC(_IOC_READ, 'H', 0x05, len) | ||
36 | 38 | ||
37 | #define HIDRAW_FIRST_MINOR 0 | 39 | #define HIDRAW_FIRST_MINOR 0 |
38 | #define HIDRAW_MAX_DEVICES 64 | 40 | #define HIDRAW_MAX_DEVICES 64 |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index c7d106ef22e2..34456476e761 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -329,6 +329,7 @@ enum jbd_state_bits { | |||
329 | BH_State, /* Pins most journal_head state */ | 329 | BH_State, /* Pins most journal_head state */ |
330 | BH_JournalHead, /* Pins bh->b_private and jh->b_bh */ | 330 | BH_JournalHead, /* Pins bh->b_private and jh->b_bh */ |
331 | BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */ | 331 | BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */ |
332 | BH_JBDPrivateStart, /* First bit available for private use by FS */ | ||
332 | }; | 333 | }; |
333 | 334 | ||
334 | BUFFER_FNS(JBD, jbd) | 335 | BUFFER_FNS(JBD, jbd) |
@@ -1007,6 +1008,35 @@ int __jbd2_journal_clean_checkpoint_list(journal_t *journal); | |||
1007 | int __jbd2_journal_remove_checkpoint(struct journal_head *); | 1008 | int __jbd2_journal_remove_checkpoint(struct journal_head *); |
1008 | void __jbd2_journal_insert_checkpoint(struct journal_head *, transaction_t *); | 1009 | void __jbd2_journal_insert_checkpoint(struct journal_head *, transaction_t *); |
1009 | 1010 | ||
1011 | |||
1012 | /* | ||
1013 | * Triggers | ||
1014 | */ | ||
1015 | |||
1016 | struct jbd2_buffer_trigger_type { | ||
1017 | /* | ||
1018 | * Fired just before a buffer is written to the journal. | ||
1019 | * mapped_data is a mapped buffer that is the frozen data for | ||
1020 | * commit. | ||
1021 | */ | ||
1022 | void (*t_commit)(struct jbd2_buffer_trigger_type *type, | ||
1023 | struct buffer_head *bh, void *mapped_data, | ||
1024 | size_t size); | ||
1025 | |||
1026 | /* | ||
1027 | * Fired during journal abort for dirty buffers that will not be | ||
1028 | * committed. | ||
1029 | */ | ||
1030 | void (*t_abort)(struct jbd2_buffer_trigger_type *type, | ||
1031 | struct buffer_head *bh); | ||
1032 | }; | ||
1033 | |||
1034 | extern void jbd2_buffer_commit_trigger(struct journal_head *jh, | ||
1035 | void *mapped_data, | ||
1036 | struct jbd2_buffer_trigger_type *triggers); | ||
1037 | extern void jbd2_buffer_abort_trigger(struct journal_head *jh, | ||
1038 | struct jbd2_buffer_trigger_type *triggers); | ||
1039 | |||
1010 | /* Buffer IO */ | 1040 | /* Buffer IO */ |
1011 | extern int | 1041 | extern int |
1012 | jbd2_journal_write_metadata_buffer(transaction_t *transaction, | 1042 | jbd2_journal_write_metadata_buffer(transaction_t *transaction, |
@@ -1045,6 +1075,8 @@ extern int jbd2_journal_extend (handle_t *, int nblocks); | |||
1045 | extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); | 1075 | extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); |
1046 | extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); | 1076 | extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); |
1047 | extern int jbd2_journal_get_undo_access(handle_t *, struct buffer_head *); | 1077 | extern int jbd2_journal_get_undo_access(handle_t *, struct buffer_head *); |
1078 | void jbd2_journal_set_triggers(struct buffer_head *, | ||
1079 | struct jbd2_buffer_trigger_type *type); | ||
1048 | extern int jbd2_journal_dirty_metadata (handle_t *, struct buffer_head *); | 1080 | extern int jbd2_journal_dirty_metadata (handle_t *, struct buffer_head *); |
1049 | extern void jbd2_journal_release_buffer (handle_t *, struct buffer_head *); | 1081 | extern void jbd2_journal_release_buffer (handle_t *, struct buffer_head *); |
1050 | extern int jbd2_journal_forget (handle_t *, struct buffer_head *); | 1082 | extern int jbd2_journal_forget (handle_t *, struct buffer_head *); |
diff --git a/include/linux/journal-head.h b/include/linux/journal-head.h index bb70ebb6a2d5..525aac3c97df 100644 --- a/include/linux/journal-head.h +++ b/include/linux/journal-head.h | |||
@@ -12,6 +12,8 @@ | |||
12 | 12 | ||
13 | typedef unsigned int tid_t; /* Unique transaction ID */ | 13 | typedef unsigned int tid_t; /* Unique transaction ID */ |
14 | typedef struct transaction_s transaction_t; /* Compound transaction type */ | 14 | typedef struct transaction_s transaction_t; /* Compound transaction type */ |
15 | |||
16 | |||
15 | struct buffer_head; | 17 | struct buffer_head; |
16 | 18 | ||
17 | struct journal_head { | 19 | struct journal_head { |
@@ -87,6 +89,12 @@ struct journal_head { | |||
87 | * [j_list_lock] | 89 | * [j_list_lock] |
88 | */ | 90 | */ |
89 | struct journal_head *b_cpnext, *b_cpprev; | 91 | struct journal_head *b_cpnext, *b_cpprev; |
92 | |||
93 | /* Trigger type */ | ||
94 | struct jbd2_buffer_trigger_type *b_triggers; | ||
95 | |||
96 | /* Trigger type for the committing transaction's frozen data */ | ||
97 | struct jbd2_buffer_trigger_type *b_frozen_triggers; | ||
90 | }; | 98 | }; |
91 | 99 | ||
92 | #endif /* JOURNAL_HEAD_H_INCLUDED */ | 100 | #endif /* JOURNAL_HEAD_H_INCLUDED */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 41e1224651cf..c28bbba3c23d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -313,10 +313,11 @@ struct napi_struct { | |||
313 | #ifdef CONFIG_NETPOLL | 313 | #ifdef CONFIG_NETPOLL |
314 | spinlock_t poll_lock; | 314 | spinlock_t poll_lock; |
315 | int poll_owner; | 315 | int poll_owner; |
316 | struct net_device *dev; | ||
317 | #endif | 316 | #endif |
317 | struct net_device *dev; | ||
318 | struct list_head dev_list; | 318 | struct list_head dev_list; |
319 | struct sk_buff *gro_list; | 319 | struct sk_buff *gro_list; |
320 | struct sk_buff *skb; | ||
320 | }; | 321 | }; |
321 | 322 | ||
322 | enum | 323 | enum |
@@ -990,6 +991,9 @@ struct napi_gro_cb { | |||
990 | 991 | ||
991 | /* Number of segments aggregated. */ | 992 | /* Number of segments aggregated. */ |
992 | int count; | 993 | int count; |
994 | |||
995 | /* Free the skb? */ | ||
996 | int free; | ||
993 | }; | 997 | }; |
994 | 998 | ||
995 | #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) | 999 | #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) |
@@ -1011,6 +1015,14 @@ struct packet_type { | |||
1011 | struct list_head list; | 1015 | struct list_head list; |
1012 | }; | 1016 | }; |
1013 | 1017 | ||
1018 | struct napi_gro_fraginfo { | ||
1019 | skb_frag_t frags[MAX_SKB_FRAGS]; | ||
1020 | unsigned int nr_frags; | ||
1021 | unsigned int ip_summed; | ||
1022 | unsigned int len; | ||
1023 | __wsum csum; | ||
1024 | }; | ||
1025 | |||
1014 | #include <linux/interrupt.h> | 1026 | #include <linux/interrupt.h> |
1015 | #include <linux/notifier.h> | 1027 | #include <linux/notifier.h> |
1016 | 1028 | ||
@@ -1363,6 +1375,8 @@ extern int netif_receive_skb(struct sk_buff *skb); | |||
1363 | extern void napi_gro_flush(struct napi_struct *napi); | 1375 | extern void napi_gro_flush(struct napi_struct *napi); |
1364 | extern int napi_gro_receive(struct napi_struct *napi, | 1376 | extern int napi_gro_receive(struct napi_struct *napi, |
1365 | struct sk_buff *skb); | 1377 | struct sk_buff *skb); |
1378 | extern int napi_gro_frags(struct napi_struct *napi, | ||
1379 | struct napi_gro_fraginfo *info); | ||
1366 | extern void netif_nit_deliver(struct sk_buff *skb); | 1380 | extern void netif_nit_deliver(struct sk_buff *skb); |
1367 | extern int dev_valid_name(const char *name); | 1381 | extern int dev_valid_name(const char *name); |
1368 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); | 1382 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 709742be02f0..01ca0856caff 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -241,7 +241,8 @@ unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start, | |||
241 | unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, | 241 | unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, |
242 | int tag, unsigned int nr_pages, struct page **pages); | 242 | int tag, unsigned int nr_pages, struct page **pages); |
243 | 243 | ||
244 | struct page *__grab_cache_page(struct address_space *mapping, pgoff_t index); | 244 | struct page *grab_cache_page_write_begin(struct address_space *mapping, |
245 | pgoff_t index, unsigned flags); | ||
245 | 246 | ||
246 | /* | 247 | /* |
247 | * Returns locked page at given index in given cache, creating it if needed. | 248 | * Returns locked page at given index in given cache, creating it if needed. |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 40401b554484..d72d5d84fde5 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -36,17 +36,7 @@ | |||
36 | #include <linux/errno.h> | 36 | #include <linux/errno.h> |
37 | #include <linux/types.h> | 37 | #include <linux/types.h> |
38 | 38 | ||
39 | #define __DQUOT_VERSION__ "dquot_6.5.1" | 39 | #define __DQUOT_VERSION__ "dquot_6.5.2" |
40 | #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 | ||
41 | |||
42 | /* Size of blocks in which are counted size limits */ | ||
43 | #define QUOTABLOCK_BITS 10 | ||
44 | #define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS) | ||
45 | |||
46 | /* Conversion routines from and to quota blocks */ | ||
47 | #define qb2kb(x) ((x) << (QUOTABLOCK_BITS-10)) | ||
48 | #define kb2qb(x) ((x) >> (QUOTABLOCK_BITS-10)) | ||
49 | #define toqb(x) (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS) | ||
50 | 40 | ||
51 | #define MAXQUOTAS 2 | 41 | #define MAXQUOTAS 2 |
52 | #define USRQUOTA 0 /* element used for user quotas */ | 42 | #define USRQUOTA 0 /* element used for user quotas */ |
@@ -80,16 +70,34 @@ | |||
80 | #define Q_GETQUOTA 0x800007 /* get user quota structure */ | 70 | #define Q_GETQUOTA 0x800007 /* get user quota structure */ |
81 | #define Q_SETQUOTA 0x800008 /* set user quota structure */ | 71 | #define Q_SETQUOTA 0x800008 /* set user quota structure */ |
82 | 72 | ||
73 | /* Quota format type IDs */ | ||
74 | #define QFMT_VFS_OLD 1 | ||
75 | #define QFMT_VFS_V0 2 | ||
76 | |||
77 | /* Size of block in which space limits are passed through the quota | ||
78 | * interface */ | ||
79 | #define QIF_DQBLKSIZE_BITS 10 | ||
80 | #define QIF_DQBLKSIZE (1 << QIF_DQBLKSIZE_BITS) | ||
81 | |||
83 | /* | 82 | /* |
84 | * Quota structure used for communication with userspace via quotactl | 83 | * Quota structure used for communication with userspace via quotactl |
85 | * Following flags are used to specify which fields are valid | 84 | * Following flags are used to specify which fields are valid |
86 | */ | 85 | */ |
87 | #define QIF_BLIMITS 1 | 86 | enum { |
88 | #define QIF_SPACE 2 | 87 | QIF_BLIMITS_B = 0, |
89 | #define QIF_ILIMITS 4 | 88 | QIF_SPACE_B, |
90 | #define QIF_INODES 8 | 89 | QIF_ILIMITS_B, |
91 | #define QIF_BTIME 16 | 90 | QIF_INODES_B, |
92 | #define QIF_ITIME 32 | 91 | QIF_BTIME_B, |
92 | QIF_ITIME_B, | ||
93 | }; | ||
94 | |||
95 | #define QIF_BLIMITS (1 << QIF_BLIMITS_B) | ||
96 | #define QIF_SPACE (1 << QIF_SPACE_B) | ||
97 | #define QIF_ILIMITS (1 << QIF_ILIMITS_B) | ||
98 | #define QIF_INODES (1 << QIF_INODES_B) | ||
99 | #define QIF_BTIME (1 << QIF_BTIME_B) | ||
100 | #define QIF_ITIME (1 << QIF_ITIME_B) | ||
93 | #define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS) | 101 | #define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS) |
94 | #define QIF_USAGE (QIF_SPACE | QIF_INODES) | 102 | #define QIF_USAGE (QIF_SPACE | QIF_INODES) |
95 | #define QIF_TIMES (QIF_BTIME | QIF_ITIME) | 103 | #define QIF_TIMES (QIF_BTIME | QIF_ITIME) |
@@ -172,7 +180,7 @@ enum { | |||
172 | #include <asm/atomic.h> | 180 | #include <asm/atomic.h> |
173 | 181 | ||
174 | typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ | 182 | typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ |
175 | typedef __u64 qsize_t; /* Type in which we store sizes */ | 183 | typedef long long qsize_t; /* Type in which we store sizes */ |
176 | 184 | ||
177 | extern spinlock_t dq_data_lock; | 185 | extern spinlock_t dq_data_lock; |
178 | 186 | ||
@@ -187,12 +195,12 @@ extern spinlock_t dq_data_lock; | |||
187 | * Data for one user/group kept in memory | 195 | * Data for one user/group kept in memory |
188 | */ | 196 | */ |
189 | struct mem_dqblk { | 197 | struct mem_dqblk { |
190 | __u32 dqb_bhardlimit; /* absolute limit on disk blks alloc */ | 198 | qsize_t dqb_bhardlimit; /* absolute limit on disk blks alloc */ |
191 | __u32 dqb_bsoftlimit; /* preferred limit on disk blks */ | 199 | qsize_t dqb_bsoftlimit; /* preferred limit on disk blks */ |
192 | qsize_t dqb_curspace; /* current used space */ | 200 | qsize_t dqb_curspace; /* current used space */ |
193 | __u32 dqb_ihardlimit; /* absolute limit on allocated inodes */ | 201 | qsize_t dqb_ihardlimit; /* absolute limit on allocated inodes */ |
194 | __u32 dqb_isoftlimit; /* preferred inode limit */ | 202 | qsize_t dqb_isoftlimit; /* preferred inode limit */ |
195 | __u32 dqb_curinodes; /* current # allocated inodes */ | 203 | qsize_t dqb_curinodes; /* current # allocated inodes */ |
196 | time_t dqb_btime; /* time limit for excessive disk use */ | 204 | time_t dqb_btime; /* time limit for excessive disk use */ |
197 | time_t dqb_itime; /* time limit for excessive inode use */ | 205 | time_t dqb_itime; /* time limit for excessive inode use */ |
198 | }; | 206 | }; |
@@ -212,10 +220,7 @@ struct mem_dqinfo { | |||
212 | unsigned int dqi_igrace; | 220 | unsigned int dqi_igrace; |
213 | qsize_t dqi_maxblimit; | 221 | qsize_t dqi_maxblimit; |
214 | qsize_t dqi_maxilimit; | 222 | qsize_t dqi_maxilimit; |
215 | union { | 223 | void *dqi_priv; |
216 | struct v1_mem_dqinfo v1_i; | ||
217 | struct v2_mem_dqinfo v2_i; | ||
218 | } u; | ||
219 | }; | 224 | }; |
220 | 225 | ||
221 | struct super_block; | 226 | struct super_block; |
@@ -249,6 +254,11 @@ extern struct dqstats dqstats; | |||
249 | #define DQ_FAKE_B 3 /* no limits only usage */ | 254 | #define DQ_FAKE_B 3 /* no limits only usage */ |
250 | #define DQ_READ_B 4 /* dquot was read into memory */ | 255 | #define DQ_READ_B 4 /* dquot was read into memory */ |
251 | #define DQ_ACTIVE_B 5 /* dquot is active (dquot_release not called) */ | 256 | #define DQ_ACTIVE_B 5 /* dquot is active (dquot_release not called) */ |
257 | #define DQ_LASTSET_B 6 /* Following 6 bits (see QIF_) are reserved\ | ||
258 | * for the mask of entries set via SETQUOTA\ | ||
259 | * quotactl. They are set under dq_data_lock\ | ||
260 | * and the quota format handling dquot can\ | ||
261 | * clear them when it sees fit. */ | ||
252 | 262 | ||
253 | struct dquot { | 263 | struct dquot { |
254 | struct hlist_node dq_hash; /* Hash list in memory */ | 264 | struct hlist_node dq_hash; /* Hash list in memory */ |
@@ -287,11 +297,13 @@ struct dquot_operations { | |||
287 | int (*initialize) (struct inode *, int); | 297 | int (*initialize) (struct inode *, int); |
288 | int (*drop) (struct inode *); | 298 | int (*drop) (struct inode *); |
289 | int (*alloc_space) (struct inode *, qsize_t, int); | 299 | int (*alloc_space) (struct inode *, qsize_t, int); |
290 | int (*alloc_inode) (const struct inode *, unsigned long); | 300 | int (*alloc_inode) (const struct inode *, qsize_t); |
291 | int (*free_space) (struct inode *, qsize_t); | 301 | int (*free_space) (struct inode *, qsize_t); |
292 | int (*free_inode) (const struct inode *, unsigned long); | 302 | int (*free_inode) (const struct inode *, qsize_t); |
293 | int (*transfer) (struct inode *, struct iattr *); | 303 | int (*transfer) (struct inode *, struct iattr *); |
294 | int (*write_dquot) (struct dquot *); /* Ordinary dquot write */ | 304 | int (*write_dquot) (struct dquot *); /* Ordinary dquot write */ |
305 | struct dquot *(*alloc_dquot)(struct super_block *, int); /* Allocate memory for new dquot */ | ||
306 | void (*destroy_dquot)(struct dquot *); /* Free memory for dquot */ | ||
295 | int (*acquire_dquot) (struct dquot *); /* Quota is going to be created on disk */ | 307 | int (*acquire_dquot) (struct dquot *); /* Quota is going to be created on disk */ |
296 | int (*release_dquot) (struct dquot *); /* Quota is going to be deleted from disk */ | 308 | int (*release_dquot) (struct dquot *); /* Quota is going to be deleted from disk */ |
297 | int (*mark_dirty) (struct dquot *); /* Dquot is marked dirty */ | 309 | int (*mark_dirty) (struct dquot *); /* Dquot is marked dirty */ |
@@ -320,12 +332,42 @@ struct quota_format_type { | |||
320 | struct quota_format_type *qf_next; | 332 | struct quota_format_type *qf_next; |
321 | }; | 333 | }; |
322 | 334 | ||
323 | #define DQUOT_USR_ENABLED 0x01 /* User diskquotas enabled */ | 335 | /* Quota state flags - they actually come in two flavors - for users and groups */ |
324 | #define DQUOT_GRP_ENABLED 0x02 /* Group diskquotas enabled */ | 336 | enum { |
325 | #define DQUOT_USR_SUSPENDED 0x04 /* User diskquotas are off, but | 337 | _DQUOT_USAGE_ENABLED = 0, /* Track disk usage for users */ |
338 | _DQUOT_LIMITS_ENABLED, /* Enforce quota limits for users */ | ||
339 | _DQUOT_SUSPENDED, /* User diskquotas are off, but | ||
326 | * we have necessary info in | 340 | * we have necessary info in |
327 | * memory to turn them on */ | 341 | * memory to turn them on */ |
328 | #define DQUOT_GRP_SUSPENDED 0x08 /* The same for group quotas */ | 342 | _DQUOT_STATE_FLAGS |
343 | }; | ||
344 | #define DQUOT_USAGE_ENABLED (1 << _DQUOT_USAGE_ENABLED) | ||
345 | #define DQUOT_LIMITS_ENABLED (1 << _DQUOT_LIMITS_ENABLED) | ||
346 | #define DQUOT_SUSPENDED (1 << _DQUOT_SUSPENDED) | ||
347 | #define DQUOT_STATE_FLAGS (DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED | \ | ||
348 | DQUOT_SUSPENDED) | ||
349 | /* Other quota flags */ | ||
350 | #define DQUOT_QUOTA_SYS_FILE (1 << 6) /* Quota file is a special | ||
351 | * system file and user cannot | ||
352 | * touch it. Filesystem is | ||
353 | * responsible for setting | ||
354 | * S_NOQUOTA, S_NOATIME flags | ||
355 | */ | ||
356 | #define DQUOT_NEGATIVE_USAGE (1 << 7) /* Allow negative quota usage */ | ||
357 | |||
358 | static inline unsigned int dquot_state_flag(unsigned int flags, int type) | ||
359 | { | ||
360 | if (type == USRQUOTA) | ||
361 | return flags; | ||
362 | return flags << _DQUOT_STATE_FLAGS; | ||
363 | } | ||
364 | |||
365 | static inline unsigned int dquot_generic_flag(unsigned int flags, int type) | ||
366 | { | ||
367 | if (type == USRQUOTA) | ||
368 | return flags; | ||
369 | return flags >> _DQUOT_STATE_FLAGS; | ||
370 | } | ||
329 | 371 | ||
330 | struct quota_info { | 372 | struct quota_info { |
331 | unsigned int flags; /* Flags for diskquotas on this device */ | 373 | unsigned int flags; /* Flags for diskquotas on this device */ |
diff --git a/include/linux/quotaio_v1.h b/include/linux/quotaio_v1.h deleted file mode 100644 index 746654b5de70..000000000000 --- a/include/linux/quotaio_v1.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | #ifndef _LINUX_QUOTAIO_V1_H | ||
2 | #define _LINUX_QUOTAIO_V1_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* | ||
7 | * The following constants define the amount of time given a user | ||
8 | * before the soft limits are treated as hard limits (usually resulting | ||
9 | * in an allocation failure). The timer is started when the user crosses | ||
10 | * their soft limit, it is reset when they go below their soft limit. | ||
11 | */ | ||
12 | #define MAX_IQ_TIME 604800 /* (7*24*60*60) 1 week */ | ||
13 | #define MAX_DQ_TIME 604800 /* (7*24*60*60) 1 week */ | ||
14 | |||
15 | /* | ||
16 | * The following structure defines the format of the disk quota file | ||
17 | * (as it appears on disk) - the file is an array of these structures | ||
18 | * indexed by user or group number. | ||
19 | */ | ||
20 | struct v1_disk_dqblk { | ||
21 | __u32 dqb_bhardlimit; /* absolute limit on disk blks alloc */ | ||
22 | __u32 dqb_bsoftlimit; /* preferred limit on disk blks */ | ||
23 | __u32 dqb_curblocks; /* current block count */ | ||
24 | __u32 dqb_ihardlimit; /* absolute limit on allocated inodes */ | ||
25 | __u32 dqb_isoftlimit; /* preferred inode limit */ | ||
26 | __u32 dqb_curinodes; /* current # allocated inodes */ | ||
27 | time_t dqb_btime; /* time limit for excessive disk use */ | ||
28 | time_t dqb_itime; /* time limit for excessive inode use */ | ||
29 | }; | ||
30 | |||
31 | #define v1_dqoff(UID) ((loff_t)((UID) * sizeof (struct v1_disk_dqblk))) | ||
32 | |||
33 | #endif /* _LINUX_QUOTAIO_V1_H */ | ||
diff --git a/include/linux/quotaio_v2.h b/include/linux/quotaio_v2.h deleted file mode 100644 index 303d7cbe30d4..000000000000 --- a/include/linux/quotaio_v2.h +++ /dev/null | |||
@@ -1,79 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions of structures for vfsv0 quota format | ||
3 | */ | ||
4 | |||
5 | #ifndef _LINUX_QUOTAIO_V2_H | ||
6 | #define _LINUX_QUOTAIO_V2_H | ||
7 | |||
8 | #include <linux/types.h> | ||
9 | #include <linux/quota.h> | ||
10 | |||
11 | /* | ||
12 | * Definitions of magics and versions of current quota files | ||
13 | */ | ||
14 | #define V2_INITQMAGICS {\ | ||
15 | 0xd9c01f11, /* USRQUOTA */\ | ||
16 | 0xd9c01927 /* GRPQUOTA */\ | ||
17 | } | ||
18 | |||
19 | #define V2_INITQVERSIONS {\ | ||
20 | 0, /* USRQUOTA */\ | ||
21 | 0 /* GRPQUOTA */\ | ||
22 | } | ||
23 | |||
24 | /* | ||
25 | * The following structure defines the format of the disk quota file | ||
26 | * (as it appears on disk) - the file is a radix tree whose leaves point | ||
27 | * to blocks of these structures. | ||
28 | */ | ||
29 | struct v2_disk_dqblk { | ||
30 | __le32 dqb_id; /* id this quota applies to */ | ||
31 | __le32 dqb_ihardlimit; /* absolute limit on allocated inodes */ | ||
32 | __le32 dqb_isoftlimit; /* preferred inode limit */ | ||
33 | __le32 dqb_curinodes; /* current # allocated inodes */ | ||
34 | __le32 dqb_bhardlimit; /* absolute limit on disk space (in QUOTABLOCK_SIZE) */ | ||
35 | __le32 dqb_bsoftlimit; /* preferred limit on disk space (in QUOTABLOCK_SIZE) */ | ||
36 | __le64 dqb_curspace; /* current space occupied (in bytes) */ | ||
37 | __le64 dqb_btime; /* time limit for excessive disk use */ | ||
38 | __le64 dqb_itime; /* time limit for excessive inode use */ | ||
39 | }; | ||
40 | |||
41 | /* | ||
42 | * Here are header structures as written on disk and their in-memory copies | ||
43 | */ | ||
44 | /* First generic header */ | ||
45 | struct v2_disk_dqheader { | ||
46 | __le32 dqh_magic; /* Magic number identifying file */ | ||
47 | __le32 dqh_version; /* File version */ | ||
48 | }; | ||
49 | |||
50 | /* Header with type and version specific information */ | ||
51 | struct v2_disk_dqinfo { | ||
52 | __le32 dqi_bgrace; /* Time before block soft limit becomes hard limit */ | ||
53 | __le32 dqi_igrace; /* Time before inode soft limit becomes hard limit */ | ||
54 | __le32 dqi_flags; /* Flags for quotafile (DQF_*) */ | ||
55 | __le32 dqi_blocks; /* Number of blocks in file */ | ||
56 | __le32 dqi_free_blk; /* Number of first free block in the list */ | ||
57 | __le32 dqi_free_entry; /* Number of block with at least one free entry */ | ||
58 | }; | ||
59 | |||
60 | /* | ||
61 | * Structure of header of block with quota structures. It is padded to 16 bytes so | ||
62 | * there will be space for exactly 21 quota-entries in a block | ||
63 | */ | ||
64 | struct v2_disk_dqdbheader { | ||
65 | __le32 dqdh_next_free; /* Number of next block with free entry */ | ||
66 | __le32 dqdh_prev_free; /* Number of previous block with free entry */ | ||
67 | __le16 dqdh_entries; /* Number of valid entries in block */ | ||
68 | __le16 dqdh_pad1; | ||
69 | __le32 dqdh_pad2; | ||
70 | }; | ||
71 | |||
72 | #define V2_DQINFOOFF sizeof(struct v2_disk_dqheader) /* Offset of info header in file */ | ||
73 | #define V2_DQBLKSIZE_BITS 10 | ||
74 | #define V2_DQBLKSIZE (1 << V2_DQBLKSIZE_BITS) /* Size of block with quota structures */ | ||
75 | #define V2_DQTREEOFF 1 /* Offset of tree in file in blocks */ | ||
76 | #define V2_DQTREEDEPTH 4 /* Depth of quota tree */ | ||
77 | #define V2_DQSTRINBLK ((V2_DQBLKSIZE - sizeof(struct v2_disk_dqdbheader)) / sizeof(struct v2_disk_dqblk)) /* Number of entries in one blocks */ | ||
78 | |||
79 | #endif /* _LINUX_QUOTAIO_V2_H */ | ||
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index a558a4c1d35a..21b781a3350f 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -24,12 +24,21 @@ void sync_dquots(struct super_block *sb, int type); | |||
24 | 24 | ||
25 | int dquot_initialize(struct inode *inode, int type); | 25 | int dquot_initialize(struct inode *inode, int type); |
26 | int dquot_drop(struct inode *inode); | 26 | int dquot_drop(struct inode *inode); |
27 | int dquot_drop_locked(struct inode *inode); | ||
28 | struct dquot *dqget(struct super_block *sb, unsigned int id, int type); | ||
29 | void dqput(struct dquot *dquot); | ||
30 | int dquot_is_cached(struct super_block *sb, unsigned int id, int type); | ||
31 | int dquot_scan_active(struct super_block *sb, | ||
32 | int (*fn)(struct dquot *dquot, unsigned long priv), | ||
33 | unsigned long priv); | ||
34 | struct dquot *dquot_alloc(struct super_block *sb, int type); | ||
35 | void dquot_destroy(struct dquot *dquot); | ||
27 | 36 | ||
28 | int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc); | 37 | int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc); |
29 | int dquot_alloc_inode(const struct inode *inode, unsigned long number); | 38 | int dquot_alloc_inode(const struct inode *inode, qsize_t number); |
30 | 39 | ||
31 | int dquot_free_space(struct inode *inode, qsize_t number); | 40 | int dquot_free_space(struct inode *inode, qsize_t number); |
32 | int dquot_free_inode(const struct inode *inode, unsigned long number); | 41 | int dquot_free_inode(const struct inode *inode, qsize_t number); |
33 | 42 | ||
34 | int dquot_transfer(struct inode *inode, struct iattr *iattr); | 43 | int dquot_transfer(struct inode *inode, struct iattr *iattr); |
35 | int dquot_commit(struct dquot *dquot); | 44 | int dquot_commit(struct dquot *dquot); |
@@ -40,11 +49,14 @@ int dquot_mark_dquot_dirty(struct dquot *dquot); | |||
40 | 49 | ||
41 | int vfs_quota_on(struct super_block *sb, int type, int format_id, | 50 | int vfs_quota_on(struct super_block *sb, int type, int format_id, |
42 | char *path, int remount); | 51 | char *path, int remount); |
52 | int vfs_quota_enable(struct inode *inode, int type, int format_id, | ||
53 | unsigned int flags); | ||
43 | int vfs_quota_on_path(struct super_block *sb, int type, int format_id, | 54 | int vfs_quota_on_path(struct super_block *sb, int type, int format_id, |
44 | struct path *path); | 55 | struct path *path); |
45 | int vfs_quota_on_mount(struct super_block *sb, char *qf_name, | 56 | int vfs_quota_on_mount(struct super_block *sb, char *qf_name, |
46 | int format_id, int type); | 57 | int format_id, int type); |
47 | int vfs_quota_off(struct super_block *sb, int type, int remount); | 58 | int vfs_quota_off(struct super_block *sb, int type, int remount); |
59 | int vfs_quota_disable(struct super_block *sb, int type, unsigned int flags); | ||
48 | int vfs_quota_sync(struct super_block *sb, int type); | 60 | int vfs_quota_sync(struct super_block *sb, int type); |
49 | int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); | 61 | int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); |
50 | int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); | 62 | int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); |
@@ -64,24 +76,22 @@ static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type) | |||
64 | * Functions for checking status of quota | 76 | * Functions for checking status of quota |
65 | */ | 77 | */ |
66 | 78 | ||
67 | static inline int sb_has_quota_enabled(struct super_block *sb, int type) | 79 | static inline int sb_has_quota_usage_enabled(struct super_block *sb, int type) |
68 | { | 80 | { |
69 | if (type == USRQUOTA) | 81 | return sb_dqopt(sb)->flags & |
70 | return sb_dqopt(sb)->flags & DQUOT_USR_ENABLED; | 82 | dquot_state_flag(DQUOT_USAGE_ENABLED, type); |
71 | return sb_dqopt(sb)->flags & DQUOT_GRP_ENABLED; | ||
72 | } | 83 | } |
73 | 84 | ||
74 | static inline int sb_any_quota_enabled(struct super_block *sb) | 85 | static inline int sb_has_quota_limits_enabled(struct super_block *sb, int type) |
75 | { | 86 | { |
76 | return sb_has_quota_enabled(sb, USRQUOTA) || | 87 | return sb_dqopt(sb)->flags & |
77 | sb_has_quota_enabled(sb, GRPQUOTA); | 88 | dquot_state_flag(DQUOT_LIMITS_ENABLED, type); |
78 | } | 89 | } |
79 | 90 | ||
80 | static inline int sb_has_quota_suspended(struct super_block *sb, int type) | 91 | static inline int sb_has_quota_suspended(struct super_block *sb, int type) |
81 | { | 92 | { |
82 | if (type == USRQUOTA) | 93 | return sb_dqopt(sb)->flags & |
83 | return sb_dqopt(sb)->flags & DQUOT_USR_SUSPENDED; | 94 | dquot_state_flag(DQUOT_SUSPENDED, type); |
84 | return sb_dqopt(sb)->flags & DQUOT_GRP_SUSPENDED; | ||
85 | } | 95 | } |
86 | 96 | ||
87 | static inline int sb_any_quota_suspended(struct super_block *sb) | 97 | static inline int sb_any_quota_suspended(struct super_block *sb) |
@@ -90,6 +100,31 @@ static inline int sb_any_quota_suspended(struct super_block *sb) | |||
90 | sb_has_quota_suspended(sb, GRPQUOTA); | 100 | sb_has_quota_suspended(sb, GRPQUOTA); |
91 | } | 101 | } |
92 | 102 | ||
103 | /* Does kernel know about any quota information for given sb + type? */ | ||
104 | static inline int sb_has_quota_loaded(struct super_block *sb, int type) | ||
105 | { | ||
106 | /* Currently if anything is on, then quota usage is on as well */ | ||
107 | return sb_has_quota_usage_enabled(sb, type); | ||
108 | } | ||
109 | |||
110 | static inline int sb_any_quota_loaded(struct super_block *sb) | ||
111 | { | ||
112 | return sb_has_quota_loaded(sb, USRQUOTA) || | ||
113 | sb_has_quota_loaded(sb, GRPQUOTA); | ||
114 | } | ||
115 | |||
116 | static inline int sb_has_quota_active(struct super_block *sb, int type) | ||
117 | { | ||
118 | return sb_has_quota_loaded(sb, type) && | ||
119 | !sb_has_quota_suspended(sb, type); | ||
120 | } | ||
121 | |||
122 | static inline int sb_any_quota_active(struct super_block *sb) | ||
123 | { | ||
124 | return sb_has_quota_active(sb, USRQUOTA) || | ||
125 | sb_has_quota_active(sb, GRPQUOTA); | ||
126 | } | ||
127 | |||
93 | /* | 128 | /* |
94 | * Operations supported for diskquotas. | 129 | * Operations supported for diskquotas. |
95 | */ | 130 | */ |
@@ -104,7 +139,7 @@ extern struct quotactl_ops vfs_quotactl_ops; | |||
104 | static inline void vfs_dq_init(struct inode *inode) | 139 | static inline void vfs_dq_init(struct inode *inode) |
105 | { | 140 | { |
106 | BUG_ON(!inode->i_sb); | 141 | BUG_ON(!inode->i_sb); |
107 | if (sb_any_quota_enabled(inode->i_sb) && !IS_NOQUOTA(inode)) | 142 | if (sb_any_quota_active(inode->i_sb) && !IS_NOQUOTA(inode)) |
108 | inode->i_sb->dq_op->initialize(inode, -1); | 143 | inode->i_sb->dq_op->initialize(inode, -1); |
109 | } | 144 | } |
110 | 145 | ||
@@ -112,7 +147,7 @@ static inline void vfs_dq_init(struct inode *inode) | |||
112 | * a transaction (deadlocks possible otherwise) */ | 147 | * a transaction (deadlocks possible otherwise) */ |
113 | static inline int vfs_dq_prealloc_space_nodirty(struct inode *inode, qsize_t nr) | 148 | static inline int vfs_dq_prealloc_space_nodirty(struct inode *inode, qsize_t nr) |
114 | { | 149 | { |
115 | if (sb_any_quota_enabled(inode->i_sb)) { | 150 | if (sb_any_quota_active(inode->i_sb)) { |
116 | /* Used space is updated in alloc_space() */ | 151 | /* Used space is updated in alloc_space() */ |
117 | if (inode->i_sb->dq_op->alloc_space(inode, nr, 1) == NO_QUOTA) | 152 | if (inode->i_sb->dq_op->alloc_space(inode, nr, 1) == NO_QUOTA) |
118 | return 1; | 153 | return 1; |
@@ -132,7 +167,7 @@ static inline int vfs_dq_prealloc_space(struct inode *inode, qsize_t nr) | |||
132 | 167 | ||
133 | static inline int vfs_dq_alloc_space_nodirty(struct inode *inode, qsize_t nr) | 168 | static inline int vfs_dq_alloc_space_nodirty(struct inode *inode, qsize_t nr) |
134 | { | 169 | { |
135 | if (sb_any_quota_enabled(inode->i_sb)) { | 170 | if (sb_any_quota_active(inode->i_sb)) { |
136 | /* Used space is updated in alloc_space() */ | 171 | /* Used space is updated in alloc_space() */ |
137 | if (inode->i_sb->dq_op->alloc_space(inode, nr, 0) == NO_QUOTA) | 172 | if (inode->i_sb->dq_op->alloc_space(inode, nr, 0) == NO_QUOTA) |
138 | return 1; | 173 | return 1; |
@@ -152,7 +187,7 @@ static inline int vfs_dq_alloc_space(struct inode *inode, qsize_t nr) | |||
152 | 187 | ||
153 | static inline int vfs_dq_alloc_inode(struct inode *inode) | 188 | static inline int vfs_dq_alloc_inode(struct inode *inode) |
154 | { | 189 | { |
155 | if (sb_any_quota_enabled(inode->i_sb)) { | 190 | if (sb_any_quota_active(inode->i_sb)) { |
156 | vfs_dq_init(inode); | 191 | vfs_dq_init(inode); |
157 | if (inode->i_sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA) | 192 | if (inode->i_sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA) |
158 | return 1; | 193 | return 1; |
@@ -162,7 +197,7 @@ static inline int vfs_dq_alloc_inode(struct inode *inode) | |||
162 | 197 | ||
163 | static inline void vfs_dq_free_space_nodirty(struct inode *inode, qsize_t nr) | 198 | static inline void vfs_dq_free_space_nodirty(struct inode *inode, qsize_t nr) |
164 | { | 199 | { |
165 | if (sb_any_quota_enabled(inode->i_sb)) | 200 | if (sb_any_quota_active(inode->i_sb)) |
166 | inode->i_sb->dq_op->free_space(inode, nr); | 201 | inode->i_sb->dq_op->free_space(inode, nr); |
167 | else | 202 | else |
168 | inode_sub_bytes(inode, nr); | 203 | inode_sub_bytes(inode, nr); |
@@ -176,7 +211,7 @@ static inline void vfs_dq_free_space(struct inode *inode, qsize_t nr) | |||
176 | 211 | ||
177 | static inline void vfs_dq_free_inode(struct inode *inode) | 212 | static inline void vfs_dq_free_inode(struct inode *inode) |
178 | { | 213 | { |
179 | if (sb_any_quota_enabled(inode->i_sb)) | 214 | if (sb_any_quota_active(inode->i_sb)) |
180 | inode->i_sb->dq_op->free_inode(inode, 1); | 215 | inode->i_sb->dq_op->free_inode(inode, 1); |
181 | } | 216 | } |
182 | 217 | ||
@@ -197,12 +232,12 @@ static inline int vfs_dq_off(struct super_block *sb, int remount) | |||
197 | 232 | ||
198 | #else | 233 | #else |
199 | 234 | ||
200 | static inline int sb_has_quota_enabled(struct super_block *sb, int type) | 235 | static inline int sb_has_quota_usage_enabled(struct super_block *sb, int type) |
201 | { | 236 | { |
202 | return 0; | 237 | return 0; |
203 | } | 238 | } |
204 | 239 | ||
205 | static inline int sb_any_quota_enabled(struct super_block *sb) | 240 | static inline int sb_has_quota_limits_enabled(struct super_block *sb, int type) |
206 | { | 241 | { |
207 | return 0; | 242 | return 0; |
208 | } | 243 | } |
@@ -217,6 +252,27 @@ static inline int sb_any_quota_suspended(struct super_block *sb) | |||
217 | return 0; | 252 | return 0; |
218 | } | 253 | } |
219 | 254 | ||
255 | /* Does kernel know about any quota information for given sb + type? */ | ||
256 | static inline int sb_has_quota_loaded(struct super_block *sb, int type) | ||
257 | { | ||
258 | return 0; | ||
259 | } | ||
260 | |||
261 | static inline int sb_any_quota_loaded(struct super_block *sb) | ||
262 | { | ||
263 | return 0; | ||
264 | } | ||
265 | |||
266 | static inline int sb_has_quota_active(struct super_block *sb, int type) | ||
267 | { | ||
268 | return 0; | ||
269 | } | ||
270 | |||
271 | static inline int sb_any_quota_active(struct super_block *sb) | ||
272 | { | ||
273 | return 0; | ||
274 | } | ||
275 | |||
220 | /* | 276 | /* |
221 | * NO-OP when quota not configured. | 277 | * NO-OP when quota not configured. |
222 | */ | 278 | */ |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index a916c6660dfa..355f6e80db0d 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -136,7 +136,7 @@ do { \ | |||
136 | */ | 136 | */ |
137 | static inline void *radix_tree_deref_slot(void **pslot) | 137 | static inline void *radix_tree_deref_slot(void **pslot) |
138 | { | 138 | { |
139 | void *ret = *pslot; | 139 | void *ret = rcu_dereference(*pslot); |
140 | if (unlikely(radix_tree_is_indirect_ptr(ret))) | 140 | if (unlikely(radix_tree_is_indirect_ptr(ret))) |
141 | ret = RADIX_TREE_RETRY; | 141 | ret = RADIX_TREE_RETRY; |
142 | return ret; | 142 | return ret; |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 91f597ad6acc..4046b75563c1 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -145,6 +145,8 @@ struct rtc_class_ops { | |||
145 | int (*irq_set_state)(struct device *, int enabled); | 145 | int (*irq_set_state)(struct device *, int enabled); |
146 | int (*irq_set_freq)(struct device *, int freq); | 146 | int (*irq_set_freq)(struct device *, int freq); |
147 | int (*read_callback)(struct device *, int data); | 147 | int (*read_callback)(struct device *, int data); |
148 | int (*alarm_irq_enable)(struct device *, unsigned int enabled); | ||
149 | int (*update_irq_enable)(struct device *, unsigned int enabled); | ||
148 | }; | 150 | }; |
149 | 151 | ||
150 | #define RTC_DEVICE_NAME_SIZE 20 | 152 | #define RTC_DEVICE_NAME_SIZE 20 |
@@ -181,7 +183,7 @@ struct rtc_device | |||
181 | struct timer_list uie_timer; | 183 | struct timer_list uie_timer; |
182 | /* Those fields are protected by rtc->irq_lock */ | 184 | /* Those fields are protected by rtc->irq_lock */ |
183 | unsigned int oldsecs; | 185 | unsigned int oldsecs; |
184 | unsigned int irq_active:1; | 186 | unsigned int uie_irq_active:1; |
185 | unsigned int stop_uie_polling:1; | 187 | unsigned int stop_uie_polling:1; |
186 | unsigned int uie_task_active:1; | 188 | unsigned int uie_task_active:1; |
187 | unsigned int uie_timer_active:1; | 189 | unsigned int uie_timer_active:1; |
@@ -216,6 +218,10 @@ extern int rtc_irq_set_state(struct rtc_device *rtc, | |||
216 | struct rtc_task *task, int enabled); | 218 | struct rtc_task *task, int enabled); |
217 | extern int rtc_irq_set_freq(struct rtc_device *rtc, | 219 | extern int rtc_irq_set_freq(struct rtc_device *rtc, |
218 | struct rtc_task *task, int freq); | 220 | struct rtc_task *task, int freq); |
221 | extern int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled); | ||
222 | extern int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled); | ||
223 | extern int rtc_dev_update_irq_enable_emul(struct rtc_device *rtc, | ||
224 | unsigned int enabled); | ||
219 | 225 | ||
220 | typedef struct rtc_task { | 226 | typedef struct rtc_task { |
221 | void (*func)(void *private_data); | 227 | void (*func)(void *private_data); |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 4be01bb44377..82229317753d 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -19,6 +19,8 @@ | |||
19 | #ifndef __LINUX_SPI_H | 19 | #ifndef __LINUX_SPI_H |
20 | #define __LINUX_SPI_H | 20 | #define __LINUX_SPI_H |
21 | 21 | ||
22 | #include <linux/device.h> | ||
23 | |||
22 | /* | 24 | /* |
23 | * INTERFACES between SPI master-side drivers and SPI infrastructure. | 25 | * INTERFACES between SPI master-side drivers and SPI infrastructure. |
24 | * (There's no SPI slave support for Linux yet...) | 26 | * (There's no SPI slave support for Linux yet...) |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 04fb47bfb920..18d0a243a7b3 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -549,7 +549,7 @@ asmlinkage long sys_inotify_init(void); | |||
549 | asmlinkage long sys_inotify_init1(int flags); | 549 | asmlinkage long sys_inotify_init1(int flags); |
550 | asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, | 550 | asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, |
551 | u32 mask); | 551 | u32 mask); |
552 | asmlinkage long sys_inotify_rm_watch(int fd, u32 wd); | 552 | asmlinkage long sys_inotify_rm_watch(int fd, __s32 wd); |
553 | 553 | ||
554 | asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, | 554 | asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, |
555 | __u32 __user *ustatus); | 555 | __u32 __user *ustatus); |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index ce532f2222ce..1459ed3e2697 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -155,9 +155,9 @@ static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const s | |||
155 | { | 155 | { |
156 | 156 | ||
157 | if (dev) | 157 | if (dev) |
158 | return __neigh_lookup(&nd_tbl, addr, dev, 1); | 158 | return __neigh_lookup_errno(&nd_tbl, addr, dev); |
159 | 159 | ||
160 | return NULL; | 160 | return ERR_PTR(-ENODEV); |
161 | } | 161 | } |
162 | 162 | ||
163 | 163 | ||