diff options
Diffstat (limited to 'include/linux')
29 files changed, 424 insertions, 10 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 94cc04a143f..bcd01f269f6 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild @@ -140,7 +140,6 @@ header-y += snmp.h header-y += sockios.h header-y += som.h header-y += sound.h -header-y += synclink.h header-y += taskstats.h header-y += telephony.h header-y += termios.h @@ -191,6 +190,7 @@ unifdef-y += errno.h unifdef-y += errqueue.h unifdef-y += ethtool.h unifdef-y += eventpoll.h +unifdef-y += signalfd.h unifdef-y += ext2_fs.h unifdef-y += ext3_fs.h unifdef-y += fb.h @@ -320,6 +320,7 @@ unifdef-y += sonypi.h unifdef-y += soundcard.h unifdef-y += stat.h unifdef-y += stddef.h +unifdef-y += synclink.h unifdef-y += sysctl.h unifdef-y += tcp.h unifdef-y += time.h diff --git a/include/linux/aio.h b/include/linux/aio.h index 43dc2ebfaa0..b903fc02bdb 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h @@ -119,6 +119,12 @@ struct kiocb { struct list_head ki_list; /* the aio core uses this * for cancellation */ + + /* + * If the aio_resfd field of the userspace iocb is not zero, + * this is the underlying file* to deliver event to. + */ + struct file *ki_eventfd; }; #define is_sync_kiocb(iocb) ((iocb)->ki_key == KIOCB_SYNC_KEY) diff --git a/include/linux/aio_abi.h b/include/linux/aio_abi.h index e3ca0a485cc..9e017293131 100644 --- a/include/linux/aio_abi.h +++ b/include/linux/aio_abi.h @@ -45,6 +45,14 @@ enum { IOCB_CMD_PWRITEV = 8, }; +/* + * Valid flags for the "aio_flags" member of the "struct iocb". + * + * IOCB_FLAG_RESFD - Set if the "aio_resfd" member of the "struct iocb" + * is valid. + */ +#define IOCB_FLAG_RESFD (1 << 0) + /* read() from /dev/aio returns these structures. */ struct io_event { __u64 data; /* the data field from the iocb */ @@ -84,7 +92,15 @@ struct iocb { /* extra parameters */ __u64 aio_reserved2; /* TODO: use this for a (struct sigevent *) */ - __u64 aio_reserved3; + + /* flags for the "struct iocb" */ + __u32 aio_flags; + + /* + * if the IOCB_FLAG_RESFD flag of "aio_flags" is set, this is an + * eventfd to signal AIO readiness to + */ + __u32 aio_resfd; }; /* 64 bytes */ #undef IFBIG diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h new file mode 100644 index 00000000000..b2e1ba325b9 --- /dev/null +++ b/include/linux/anon_inodes.h @@ -0,0 +1,16 @@ +/* + * include/linux/anon_inodes.h + * + * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org> + * + */ + +#ifndef _LINUX_ANON_INODES_H +#define _LINUX_ANON_INODES_H + +int anon_inode_getfd(int *pfd, struct inode **pinode, struct file **pfile, + const char *name, const struct file_operations *fops, + void *priv); + +#endif /* _LINUX_ANON_INODES_H */ + diff --git a/include/linux/compat.h b/include/linux/compat.h index 70a157a130b..636502c0273 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -225,6 +225,11 @@ static inline int compat_timespec_compare(struct compat_timespec *lhs, return lhs->tv_nsec - rhs->tv_nsec; } +extern int get_compat_itimerspec(struct itimerspec *dst, + const struct compat_itimerspec __user *src); +extern int put_compat_itimerspec(struct compat_itimerspec __user *dst, + const struct itimerspec *src); + asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); extern int compat_printk(const char *fmt, ...); diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h new file mode 100644 index 00000000000..0d6ecc60b94 --- /dev/null +++ b/include/linux/eventfd.h @@ -0,0 +1,29 @@ +/* + * include/linux/eventfd.h + * + * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org> + * + */ + +#ifndef _LINUX_EVENTFD_H +#define _LINUX_EVENTFD_H + + +#ifdef __KERNEL__ + +#ifdef CONFIG_EVENTFD + +struct file *eventfd_fget(int fd); +int eventfd_signal(struct file *file, int n); + +#else /* CONFIG_EVENTFD */ + +#define eventfd_fget(fd) ERR_PTR(-ENOSYS) +#define eventfd_signal(f, n) 0 + +#endif /* CONFIG_EVENTFD */ + +#endif /* __KERNEL__ */ + +#endif /* _LINUX_EVENTFD_H */ + diff --git a/include/linux/hid.h b/include/linux/hid.h index 37076b116ed..827ee748fd4 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -275,6 +275,7 @@ struct hid_item { #define HID_QUIRK_LOGITECH_DESCRIPTOR 0x00100000 #define HID_QUIRK_DUPLICATE_USAGES 0x00200000 #define HID_QUIRK_RESET_LEDS 0x00400000 +#define HID_QUIRK_SWAPPED_MIN_MAX 0x00800000 /* * This is the global environment of the parser. This information is diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 45170b2fa25..276ccaa2670 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -65,9 +65,9 @@ .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ .rlim = INIT_RLIMITS, \ - .pgrp = 1, \ + .pgrp = 0, \ .tty_old_pgrp = NULL, \ - { .__session = 1}, \ + { .__session = 0}, \ } extern struct nsproxy init_nsproxy; @@ -84,10 +84,33 @@ extern struct nsproxy init_nsproxy; .count = ATOMIC_INIT(1), \ .action = { { { .sa_handler = NULL, } }, }, \ .siglock = __SPIN_LOCK_UNLOCKED(sighand.siglock), \ + .signalfd_list = LIST_HEAD_INIT(sighand.signalfd_list), \ } extern struct group_info init_groups; +#define INIT_STRUCT_PID { \ + .count = ATOMIC_INIT(1), \ + .nr = 0, \ + /* Don't put this struct pid in pid_hash */ \ + .pid_chain = { .next = NULL, .pprev = NULL }, \ + .tasks = { \ + { .first = &init_task.pids[PIDTYPE_PID].node }, \ + { .first = &init_task.pids[PIDTYPE_PGID].node }, \ + { .first = &init_task.pids[PIDTYPE_SID].node }, \ + }, \ + .rcu = RCU_HEAD_INIT, \ +} + +#define INIT_PID_LINK(type) \ +{ \ + .node = { \ + .next = NULL, \ + .pprev = &init_struct_pid.tasks[type].first, \ + }, \ + .pid = &init_struct_pid, \ +} + /* * INIT_TASK is used to set up the first task table, touch at * your own risk!. Base=0, limit=0x1fffff (=2MB) @@ -139,6 +162,11 @@ extern struct group_info init_groups; .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ .fs_excl = ATOMIC_INIT(0), \ .pi_lock = __SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ + .pids = { \ + [PIDTYPE_PID] = INIT_PID_LINK(PIDTYPE_PID), \ + [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \ + [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ + }, \ INIT_TRACE_IRQFLAGS \ INIT_LOCKDEP \ } diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index f7b01b9a35b..5323f627585 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -241,6 +241,16 @@ static inline void __deprecated save_and_cli(unsigned long *x) #define save_and_cli(x) save_and_cli(&x) #endif /* CONFIG_SMP */ +/* Some architectures might implement lazy enabling/disabling of + * interrupts. In some cases, such as stop_machine, we might want + * to ensure that after a local_irq_disable(), interrupts have + * really been disabled in hardware. Such architectures need to + * implement the following hook. + */ +#ifndef hard_irq_disable +#define hard_irq_disable() do { } while(0) +#endif + /* PLEASE, avoid to allocate new softirqs, if you need not _really_ high frequency threaded job scheduling. For almost all the purposes tasklets are more than enough. F.e. all serial device BHs et diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 8645181fca0..eec0d13169a 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -213,6 +213,17 @@ extern enum system_states { extern void dump_stack(void); +enum { + DUMP_PREFIX_NONE, + DUMP_PREFIX_ADDRESS, + DUMP_PREFIX_OFFSET +}; +extern void hex_dump_to_buffer(const void *buf, size_t len, char *linebuf, + size_t linebuflen); +extern void print_hex_dump(const char *level, int prefix_type, + void *buf, size_t len); +#define hex_asc(x) "0123456789abcdef"[x] + #ifdef DEBUG /* If you are writing a driver, please use dev_dbg instead */ #define pr_debug(fmt,arg...) \ diff --git a/include/linux/magic.h b/include/linux/magic.h index a9c6567fe70..9d713c03e3d 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h @@ -14,6 +14,7 @@ #define ISOFS_SUPER_MAGIC 0x9660 #define JFFS2_SUPER_MAGIC 0x72b6 #define KVMFS_SUPER_MAGIC 0x19700426 +#define ANON_INODE_FS_MAGIC 0x09041934 #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ diff --git a/include/linux/module.h b/include/linux/module.h index 792d483c9af..e6e0f86ef5f 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -124,7 +124,7 @@ extern struct module __this_module; */ #define MODULE_LICENSE(_license) MODULE_INFO(license, _license) -/* Author, ideally of form NAME <EMAIL>[, NAME <EMAIL>]*[ and NAME <EMAIL>] */ +/* Author, ideally of form NAME[, NAME]*[ and NAME] */ #define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) /* What your module does. */ diff --git a/include/linux/mpage.h b/include/linux/mpage.h index cc5fb75af78..068a0c9946a 100644 --- a/include/linux/mpage.h +++ b/include/linux/mpage.h @@ -12,7 +12,6 @@ #ifdef CONFIG_BLOCK struct writeback_control; -typedef int (writepage_t)(struct page *page, struct writeback_control *wbc); int mpage_readpages(struct address_space *mapping, struct list_head *pages, unsigned nr_pages, get_block_t get_block); diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 30446222b39..f671cd2f133 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -467,6 +467,8 @@ struct net_device /* device index hash chain */ struct hlist_node index_hlist; + struct net_device *link_watch_next; + /* register/unregister state machine */ enum { NETREG_UNINITIALIZED=0, NETREG_REGISTERED, /* completed register_netdevice */ diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 022edfa97ed..7e733a6ba4f 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h @@ -54,6 +54,14 @@ struct xt_entry_target unsigned char data[0]; }; +#define XT_TARGET_INIT(__name, __size) \ +{ \ + .target.u.user = { \ + .target_size = XT_ALIGN(__size), \ + .name = __name, \ + }, \ +} + struct xt_standard_target { struct xt_entry_target target; diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index 24c8786d12e..584cd1b18f1 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h @@ -238,6 +238,47 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e */ #ifdef __KERNEL__ +/* Standard entry. */ +struct arpt_standard +{ + struct arpt_entry entry; + struct arpt_standard_target target; +}; + +struct arpt_error_target +{ + struct arpt_entry_target target; + char errorname[ARPT_FUNCTION_MAXNAMELEN]; +}; + +struct arpt_error +{ + struct arpt_entry entry; + struct arpt_error_target target; +}; + +#define ARPT_ENTRY_INIT(__size) \ +{ \ + .target_offset = sizeof(struct arpt_entry), \ + .next_offset = (__size), \ +} + +#define ARPT_STANDARD_INIT(__verdict) \ +{ \ + .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_standard)), \ + .target = XT_TARGET_INIT(ARPT_STANDARD_TARGET, \ + sizeof(struct arpt_standard_target)), \ + .target.verdict = -(__verdict) - 1, \ +} + +#define ARPT_ERROR_INIT \ +{ \ + .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_error)), \ + .target = XT_TARGET_INIT(ARPT_ERROR_TARGET, \ + sizeof(struct arpt_error_target)), \ + .target.errorname = "ERROR", \ +} + #define arpt_register_target(tgt) \ ({ (tgt)->family = NF_ARP; \ xt_register_target(tgt); }) diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 9527296595c..2f46dd728ee 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h @@ -295,6 +295,28 @@ struct ipt_error struct ipt_error_target target; }; +#define IPT_ENTRY_INIT(__size) \ +{ \ + .target_offset = sizeof(struct ipt_entry), \ + .next_offset = (__size), \ +} + +#define IPT_STANDARD_INIT(__verdict) \ +{ \ + .entry = IPT_ENTRY_INIT(sizeof(struct ipt_standard)), \ + .target = XT_TARGET_INIT(IPT_STANDARD_TARGET, \ + sizeof(struct xt_standard_target)), \ + .target.verdict = -(__verdict) - 1, \ +} + +#define IPT_ERROR_INIT \ +{ \ + .entry = IPT_ENTRY_INIT(sizeof(struct ipt_error)), \ + .target = XT_TARGET_INIT(IPT_ERROR_TARGET, \ + sizeof(struct ipt_error_target)), \ + .target.errorname = "ERROR", \ +} + extern unsigned int ipt_do_table(struct sk_buff **pskb, unsigned int hook, const struct net_device *in, diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index 61aa10412fc..4686f8342cb 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h @@ -123,6 +123,28 @@ struct ip6t_error struct ip6t_error_target target; }; +#define IP6T_ENTRY_INIT(__size) \ +{ \ + .target_offset = sizeof(struct ip6t_entry), \ + .next_offset = (__size), \ +} + +#define IP6T_STANDARD_INIT(__verdict) \ +{ \ + .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_standard)), \ + .target = XT_TARGET_INIT(IP6T_STANDARD_TARGET, \ + sizeof(struct ip6t_standard_target)), \ + .target.verdict = -(__verdict) - 1, \ +} + +#define IP6T_ERROR_INIT \ +{ \ + .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_error)), \ + .target = XT_TARGET_INIT(IP6T_ERROR_TARGET, \ + sizeof(struct ip6t_error_target)), \ + .target.errorname = "ERROR", \ +} + /* * New IP firewall options for [gs]etsockopt at the RAW IP level. * Unlike BSD Linux inherits IP options so you don't have to use diff --git a/include/linux/pid.h b/include/linux/pid.h index 2ac27f9997d..1e0e4e3423a 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h @@ -51,6 +51,8 @@ struct pid struct rcu_head rcu; }; +extern struct pid init_struct_pid; + struct pid_link { struct hlist_node node; @@ -76,8 +78,7 @@ extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type); * write-held. */ extern int FASTCALL(attach_pid(struct task_struct *task, - enum pid_type type, int nr)); - + enum pid_type type, struct pid *pid)); extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type)); extern void FASTCALL(transfer_pid(struct task_struct *old, struct task_struct *new, enum pid_type)); diff --git a/include/linux/sched.h b/include/linux/sched.h index 17b72d88c4c..97c0c7da58e 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -391,6 +391,7 @@ struct sighand_struct { atomic_t count; struct k_sigaction action[_NSIG]; spinlock_t siglock; + struct list_head signalfd_list; }; struct pacct_struct { @@ -469,6 +470,7 @@ struct signal_struct { cputime_t utime, stime, cutime, cstime; unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; + unsigned long inblock, oublock, cinblock, coublock; /* * Cumulative ns of scheduled CPU time for dead threads in the diff --git a/include/linux/signal.h b/include/linux/signal.h index 3fa0fab4a04..9a5eac508e5 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -233,6 +233,7 @@ static inline int valid_signal(unsigned long sig) return sig <= _NSIG ? 1 : 0; } +extern int next_signal(struct sigpending *pending, sigset_t *mask); extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); extern long do_sigpending(void __user *, unsigned long); diff --git a/include/linux/signalfd.h b/include/linux/signalfd.h new file mode 100644 index 00000000000..51042949569 --- /dev/null +++ b/include/linux/signalfd.h @@ -0,0 +1,97 @@ +/* + * include/linux/signalfd.h + * + * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org> + * + */ + +#ifndef _LINUX_SIGNALFD_H +#define _LINUX_SIGNALFD_H + + +struct signalfd_siginfo { + __u32 signo; + __s32 err; + __s32 code; + __u32 pid; + __u32 uid; + __s32 fd; + __u32 tid; + __u32 band; + __u32 overrun; + __u32 trapno; + __s32 status; + __s32 svint; + __u64 svptr; + __u64 utime; + __u64 stime; + __u64 addr; + + /* + * Pad strcture to 128 bytes. Remember to update the + * pad size when you add new memebers. We use a fixed + * size structure to avoid compatibility problems with + * future versions, and we leave extra space for additional + * members. We use fixed size members because this strcture + * comes out of a read(2) and we really don't want to have + * a compat on read(2). + */ + __u8 __pad[48]; +}; + + +#ifdef __KERNEL__ + +#ifdef CONFIG_SIGNALFD + +/* + * Deliver the signal to listening signalfd. This must be called + * with the sighand lock held. Same are the following that end up + * calling signalfd_deliver(). + */ +void signalfd_deliver(struct task_struct *tsk, int sig); + +/* + * No need to fall inside signalfd_deliver() if no signal listeners + * are available. + */ +static inline void signalfd_notify(struct task_struct *tsk, int sig) +{ + if (unlikely(!list_empty(&tsk->sighand->signalfd_list))) + signalfd_deliver(tsk, sig); +} + +/* + * The signal -1 is used to notify the signalfd that the sighand + * is on its way to be detached. + */ +static inline void signalfd_detach_locked(struct task_struct *tsk) +{ + if (unlikely(!list_empty(&tsk->sighand->signalfd_list))) + signalfd_deliver(tsk, -1); +} + +static inline void signalfd_detach(struct task_struct *tsk) +{ + struct sighand_struct *sighand = tsk->sighand; + + if (unlikely(!list_empty(&sighand->signalfd_list))) { + spin_lock_irq(&sighand->siglock); + signalfd_deliver(tsk, -1); + spin_unlock_irq(&sighand->siglock); + } +} + +#else /* CONFIG_SIGNALFD */ + +#define signalfd_deliver(t, s) do { } while (0) +#define signalfd_notify(t, s) do { } while (0) +#define signalfd_detach_locked(t) do { } while (0) +#define signalfd_detach(t) do { } while (0) + +#endif /* CONFIG_SIGNALFD */ + +#endif /* __KERNEL__ */ + +#endif /* _LINUX_SIGNALFD_H */ + diff --git a/include/linux/synclink.h b/include/linux/synclink.h index c8b042667af..5562fbf7209 100644 --- a/include/linux/synclink.h +++ b/include/linux/synclink.h @@ -291,4 +291,28 @@ struct gpio_desc { #define MGSL_IOCGGPIO _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc) #define MGSL_IOCWAITGPIO _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc) +#ifdef __KERNEL__ +/* provide 32 bit ioctl compatibility on 64 bit systems */ +#ifdef CONFIG_COMPAT +#include <linux/compat.h> +struct MGSL_PARAMS32 { + compat_ulong_t mode; + unsigned char loopback; + unsigned short flags; + unsigned char encoding; + compat_ulong_t clock_speed; + unsigned char addr_filter; + unsigned short crc_type; + unsigned char preamble_length; + unsigned char preamble; + compat_ulong_t data_rate; + unsigned char data_bits; + unsigned char stop_bits; + unsigned char parity; +}; +#define MGSL_IOCSPARAMS32 _IOW(MGSL_MAGIC_IOC,0,struct MGSL_PARAMS32) +#define MGSL_IOCGPARAMS32 _IOR(MGSL_MAGIC_IOC,1,struct MGSL_PARAMS32) +#endif +#endif + #endif /* _SYNCLINK_H_ */ diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 3139f441229..b02070eac42 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -604,6 +604,10 @@ asmlinkage long sys_get_robust_list(int pid, asmlinkage long sys_set_robust_list(struct robust_list_head __user *head, size_t len); asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); +asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemask); +asmlinkage long sys_timerfd(int ufd, int clockid, int flags, + const struct itimerspec __user *utmr); +asmlinkage long sys_eventfd(unsigned int count); int kernel_execve(const char *filename, char *const argv[], char *const envp[]); diff --git a/include/linux/task_io_accounting_ops.h b/include/linux/task_io_accounting_ops.h index df2a319106b..1218733ec6b 100644 --- a/include/linux/task_io_accounting_ops.h +++ b/include/linux/task_io_accounting_ops.h @@ -10,11 +10,29 @@ static inline void task_io_account_read(size_t bytes) current->ioac.read_bytes += bytes; } +/* + * We approximate number of blocks, because we account bytes only. + * A 'block' is 512 bytes + */ +static inline unsigned long task_io_get_inblock(const struct task_struct *p) +{ + return p->ioac.read_bytes >> 9; +} + static inline void task_io_account_write(size_t bytes) { current->ioac.write_bytes += bytes; } +/* + * We approximate number of blocks, because we account bytes only. + * A 'block' is 512 bytes + */ +static inline unsigned long task_io_get_oublock(const struct task_struct *p) +{ + return p->ioac.write_bytes >> 9; +} + static inline void task_io_account_cancelled_write(size_t bytes) { current->ioac.cancelled_write_bytes += bytes; @@ -31,10 +49,20 @@ static inline void task_io_account_read(size_t bytes) { } +static inline unsigned long task_io_get_inblock(const struct task_struct *p) +{ + return 0; +} + static inline void task_io_account_write(size_t bytes) { } +static inline unsigned long task_io_get_oublock(const struct task_struct *p) +{ + return 0; +} + static inline void task_io_account_cancelled_write(size_t bytes) { } diff --git a/include/linux/timerfd.h b/include/linux/timerfd.h new file mode 100644 index 00000000000..cf2b10d7573 --- /dev/null +++ b/include/linux/timerfd.h @@ -0,0 +1,17 @@ +/* + * include/linux/timerfd.h + * + * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org> + * + */ + +#ifndef _LINUX_TIMERFD_H +#define _LINUX_TIMERFD_H + + +#define TFD_TIMER_ABSTIME (1 << 0) + + + +#endif /* _LINUX_TIMERFD_H */ + diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 659487e3ebe..85c95cd39bc 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h @@ -52,6 +52,11 @@ * This routine allows the tty driver to implement * device-specific ioctl's. If the ioctl number passed in cmd * is not recognized by the driver, it should return ENOIOCTLCMD. + * + * long (*compat_ioctl)(struct tty_struct *tty, struct file * file, + * unsigned int cmd, unsigned long arg); + * + * implement ioctl processing for 32 bit process on 64 bit system * * void (*set_termios)(struct tty_struct *tty, struct ktermios * old); * @@ -132,6 +137,8 @@ struct tty_operations { int (*chars_in_buffer)(struct tty_struct *tty); int (*ioctl)(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg); + long (*compat_ioctl)(struct tty_struct *tty, struct file * file, + unsigned int cmd, unsigned long arg); void (*set_termios)(struct tty_struct *tty, struct ktermios * old); void (*throttle)(struct tty_struct * tty); void (*unthrottle)(struct tty_struct * tty); @@ -193,6 +200,8 @@ struct tty_driver { int (*chars_in_buffer)(struct tty_struct *tty); int (*ioctl)(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg); + long (*compat_ioctl)(struct tty_struct *tty, struct file * file, + unsigned int cmd, unsigned long arg); void (*set_termios)(struct tty_struct *tty, struct ktermios * old); void (*throttle)(struct tty_struct * tty); void (*unthrottle)(struct tty_struct * tty); diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index d75932e2771..6226504d910 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h @@ -59,6 +59,11 @@ * low-level driver can "grab" an ioctl request before the line * discpline has a chance to see it. * + * long (*compat_ioctl)(struct tty_struct * tty, struct file * file, + * unsigned int cmd, unsigned long arg); + * + * Process ioctl calls from 32-bit process on 64-bit system + * * void (*set_termios)(struct tty_struct *tty, struct ktermios * old); * * This function notifies the line discpline that a change has @@ -118,6 +123,8 @@ struct tty_ldisc { const unsigned char * buf, size_t nr); int (*ioctl)(struct tty_struct * tty, struct file * file, unsigned int cmd, unsigned long arg); + long (*compat_ioctl)(struct tty_struct * tty, struct file * file, + unsigned int cmd, unsigned long arg); void (*set_termios)(struct tty_struct *tty, struct ktermios * old); unsigned int (*poll)(struct tty_struct *, struct file *, struct poll_table_struct *); diff --git a/include/linux/writeback.h b/include/linux/writeback.h index daa6c125f66..050915b5957 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h @@ -111,9 +111,15 @@ balance_dirty_pages_ratelimited(struct address_space *mapping) balance_dirty_pages_ratelimited_nr(mapping, 1); } +typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc, + void *data); + int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); -extern int generic_writepages(struct address_space *mapping, - struct writeback_control *wbc); +int generic_writepages(struct address_space *mapping, + struct writeback_control *wbc); +int write_cache_pages(struct address_space *mapping, + struct writeback_control *wbc, writepage_t writepage, + void *data); int do_writepages(struct address_space *mapping, struct writeback_control *wbc); int sync_page_range(struct inode *inode, struct address_space *mapping, loff_t pos, loff_t count); |