diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/blkdev.h | 2 | ||||
| -rw-r--r-- | include/linux/compat.h | 13 | ||||
| -rw-r--r-- | include/linux/hugetlb.h | 1 | ||||
| -rw-r--r-- | include/linux/init.h | 2 | ||||
| -rw-r--r-- | include/linux/quota.h | 2 | ||||
| -rw-r--r-- | include/linux/reiserfs_acl.h | 91 | ||||
| -rw-r--r-- | include/linux/reiserfs_fs.h | 49 | ||||
| -rw-r--r-- | include/linux/reiserfs_fs_i.h | 8 | ||||
| -rw-r--r-- | include/linux/reiserfs_fs_sb.h | 13 | ||||
| -rw-r--r-- | include/linux/reiserfs_xattr.h | 132 | ||||
| -rw-r--r-- | include/linux/sched.h | 133 | ||||
| -rw-r--r-- | include/linux/serial_core.h | 3 | ||||
| -rw-r--r-- | include/linux/spinlock.h | 4 | ||||
| -rw-r--r-- | include/linux/sysctl.h | 1 | ||||
| -rw-r--r-- | include/linux/times.h | 18 | ||||
| -rw-r--r-- | include/linux/tty.h | 1 |
16 files changed, 437 insertions, 36 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 0fa0011d0a8f..e38d901a6526 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -334,6 +334,8 @@ struct request_queue * queue settings */ unsigned long nr_requests; /* Max # of requests */ + unsigned int nr_congestion_on; + unsigned int nr_congestion_off; unsigned short max_sectors; unsigned short max_phys_segments; diff --git a/include/linux/compat.h b/include/linux/compat.h index 796204f59bd9..c32eeabf5d1b 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -117,5 +117,18 @@ long compat_sys_shmat(int first, int second, compat_uptr_t third, int version, long compat_sys_shmctl(int first, int second, void __user *uptr); long compat_sys_semtimedop(int semid, struct sembuf __user *tsems, unsigned nsems, const struct compat_timespec __user *timeout); + +asmlinkage ssize_t compat_sys_readv(unsigned long fd, + const struct compat_iovec __user *vec, unsigned long vlen); +asmlinkage ssize_t compat_sys_writev(unsigned long fd, + const struct compat_iovec __user *vec, unsigned long vlen); + +int compat_do_execve(char * filename, compat_uptr_t __user *argv, + compat_uptr_t __user *envp, struct pt_regs * regs); + +asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, + compat_ulong_t __user *outp, compat_ulong_t __user *exp, + struct compat_timeval __user *tvp); + #endif /* CONFIG_COMPAT */ #endif /* _LINUX_COMPAT_H */ diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 894127b192c4..deb4fe9b202b 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -30,6 +30,7 @@ void free_huge_page(struct page *); extern unsigned long max_huge_pages; extern const unsigned long hugetlb_zero, hugetlb_infinity; +extern int sysctl_hugetlb_shm_group; static inline void mark_mm_hugetlb(struct mm_struct *mm, struct vm_area_struct *vma) diff --git a/include/linux/init.h b/include/linux/init.h index c6842477243c..45069e275b3d 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -46,8 +46,6 @@ #define __exitdata __attribute__ ((__section__(".exit.data"))) #define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit"))) -#define __sched __attribute__((__section__(".sched.text"))) - #ifdef MODULE #define __exit __attribute__ ((__section__(".exit.text"))) #else diff --git a/include/linux/quota.h b/include/linux/quota.h index bbd9134abaf3..506d52452e98 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h @@ -250,6 +250,8 @@ struct dquot_operations { int (*free_inode) (const struct inode *, unsigned long); int (*transfer) (struct inode *, struct iattr *); int (*write_dquot) (struct dquot *); /* Ordinary dquot write */ + int (*acquire_dquot) (struct dquot *); /* Quota is going to be created on disk */ + int (*release_dquot) (struct dquot *); /* Quota is going to be deleted from disk */ int (*mark_dirty) (struct dquot *); /* Dquot is marked dirty */ int (*write_info) (struct super_block *, int); /* Write of quota "superblock" */ }; diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h new file mode 100644 index 000000000000..acfde2d1d152 --- /dev/null +++ b/include/linux/reiserfs_acl.h @@ -0,0 +1,91 @@ +#include <linux/init.h> +#include <linux/posix_acl.h> +#include <linux/xattr_acl.h> + +#define REISERFS_ACL_VERSION 0x0001 + +typedef struct { + __u16 e_tag; + __u16 e_perm; + __u32 e_id; +} reiserfs_acl_entry; + +typedef struct { + __u16 e_tag; + __u16 e_perm; +} reiserfs_acl_entry_short; + +typedef struct { + __u32 a_version; +} reiserfs_acl_header; + +static inline size_t reiserfs_acl_size(int count) +{ + if (count <= 4) { + return sizeof(reiserfs_acl_header) + + count * sizeof(reiserfs_acl_entry_short); + } else { + return sizeof(reiserfs_acl_header) + + 4 * sizeof(reiserfs_acl_entry_short) + + (count - 4) * sizeof(reiserfs_acl_entry); + } +} + +static inline int reiserfs_acl_count(size_t size) +{ + ssize_t s; + size -= sizeof(reiserfs_acl_header); + s = size - 4 * sizeof(reiserfs_acl_entry_short); + if (s < 0) { + if (size % sizeof(reiserfs_acl_entry_short)) + return -1; + return size / sizeof(reiserfs_acl_entry_short); + } else { + if (s % sizeof(reiserfs_acl_entry)) + return -1; + return s / sizeof(reiserfs_acl_entry) + 4; + } +} + + +#ifdef CONFIG_REISERFS_FS_POSIX_ACL +struct posix_acl * reiserfs_get_acl(struct inode *inode, int type); +int reiserfs_set_acl(struct inode *inode, int type, struct posix_acl *acl); +int reiserfs_acl_chmod (struct inode *inode); +int reiserfs_inherit_default_acl (struct inode *dir, struct dentry *dentry, struct inode *inode); +int reiserfs_cache_default_acl (struct inode *dir); +extern int reiserfs_xattr_posix_acl_init (void) __init; +extern int reiserfs_xattr_posix_acl_exit (void); +extern struct reiserfs_xattr_handler posix_acl_default_handler; +extern struct reiserfs_xattr_handler posix_acl_access_handler; +#else + +#define reiserfs_set_acl NULL +#define reiserfs_get_acl NULL +#define reiserfs_cache_default_acl(inode) 0 + +static inline int +reiserfs_xattr_posix_acl_init (void) +{ + return 0; +} + +static inline int +reiserfs_xattr_posix_acl_exit (void) +{ + return 0; +} + +static inline int +reiserfs_acl_chmod (struct inode *inode) +{ + return 0; +} + +static inline int +reiserfs_inherit_default_acl (const struct inode *dir, struct dentry *dentry, struct inode *inode) +{ + return 0; +} + +#endif diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index dfb46b513712..8132a6ec9eb1 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h @@ -75,6 +75,7 @@ */ #define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */ +void reiserfs_warning (struct super_block *s, const char * fmt, ...); /* assertions handling */ /** always check a condition and panic if it's false. */ @@ -268,6 +269,7 @@ int is_reiserfs_jr (struct reiserfs_super_block * rs); #define NO_DISK_SPACE -3 #define NO_BALANCING_NEEDED (-4) #define NO_MORE_UNUSED_CONTIGUOUS_BLOCKS (-5) +#define QUOTA_EXCEEDED -6 typedef __u32 b_blocknr_t; typedef __u32 unp_t; @@ -287,7 +289,7 @@ struct unfm_nodeinfo { #define STAT_DATA_V2 1 -static inline struct reiserfs_inode_info *REISERFS_I(struct inode *inode) +static inline struct reiserfs_inode_info *REISERFS_I(const struct inode *inode) { return container_of(inode, struct reiserfs_inode_info, vfs_inode); } @@ -561,9 +563,6 @@ struct item_head #define V1_DIRENTRY_UNIQUENESS 500 #define V1_ANY_UNIQUENESS 555 // FIXME: comment is required -extern void reiserfs_warning (const char * fmt, ...); -/* __attribute__( ( format ( printf, 1, 2 ) ) ); */ - // // here are conversion routines // @@ -576,7 +575,8 @@ static inline int uniqueness2type (__u32 uniqueness) case V1_DIRECT_UNIQUENESS: return TYPE_DIRECT; case V1_DIRENTRY_UNIQUENESS: return TYPE_DIRENTRY; default: - reiserfs_warning( "vs-500: unknown uniqueness %d\n", uniqueness); + reiserfs_warning (NULL, "vs-500: unknown uniqueness %d", + uniqueness); case V1_ANY_UNIQUENESS: return TYPE_ANY; } @@ -591,7 +591,7 @@ static inline __u32 type2uniqueness (int type) case TYPE_DIRECT: return V1_DIRECT_UNIQUENESS; case TYPE_DIRENTRY: return V1_DIRENTRY_UNIQUENESS; default: - reiserfs_warning( "vs-501: unknown type %d\n", type); + reiserfs_warning (NULL, "vs-501: unknown type %d", type); case TYPE_ANY: return V1_ANY_UNIQUENESS; } @@ -1238,7 +1238,6 @@ excessive effort to avoid disturbing the precious VFS code.:-( The gods only know how we are going to SMP the code that uses them. znodes are the way! */ - struct path { int path_length; /* Length of the array above. */ struct path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */ @@ -1771,7 +1770,7 @@ void reiserfs_update_inode_transaction(struct inode *) ; void reiserfs_wait_on_write_block(struct super_block *s) ; void reiserfs_block_writes(struct reiserfs_transaction_handle *th) ; void reiserfs_allow_writes(struct super_block *s) ; -void reiserfs_check_lock_depth(char *caller) ; +void reiserfs_check_lock_depth(struct super_block *s, char *caller) ; int reiserfs_prepare_for_journal(struct super_block *, struct buffer_head *bh, int wait) ; void reiserfs_restore_prepared_buffer(struct super_block *, struct buffer_head *bh) ; int journal_init(struct super_block *, const char * j_dev_name, int old_format, unsigned int) ; @@ -1889,11 +1888,13 @@ void pathrelse_and_restore (struct super_block *s, struct path * p_s_search_path int reiserfs_insert_item (struct reiserfs_transaction_handle *th, struct path * path, const struct cpu_key * key, - struct item_head * ih, const char * body); + struct item_head * ih, + struct inode *inode, const char * body); int reiserfs_paste_into_item (struct reiserfs_transaction_handle *th, struct path * path, const struct cpu_key * key, + struct inode *inode, const char * body, int paste_size); int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th, @@ -1910,7 +1911,7 @@ int reiserfs_delete_item (struct reiserfs_transaction_handle *th, struct buffer_head * p_s_un_bh); void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th, - struct key * key); + struct inode *inode, struct key * key); void reiserfs_delete_object (struct reiserfs_transaction_handle *th, struct inode * p_s_inode); void reiserfs_do_truncate (struct reiserfs_transaction_handle *th, struct inode * p_s_inode, struct page *, @@ -1955,11 +1956,22 @@ int reiserfs_new_inode (struct reiserfs_transaction_handle *th, struct inode * dir, int mode, const char * symname, loff_t i_size, struct dentry *dentry, struct inode *inode); -int reiserfs_sync_inode (struct reiserfs_transaction_handle *th, struct inode * inode); -void reiserfs_update_sd (struct reiserfs_transaction_handle *th, struct inode * inode); + +int reiserfs_sync_inode (struct reiserfs_transaction_handle *th, + struct inode * inode); + +void reiserfs_update_sd_size (struct reiserfs_transaction_handle *th, + struct inode * inode, loff_t size); + +static inline void reiserfs_update_sd(struct reiserfs_transaction_handle *th, + struct inode *inode) +{ + reiserfs_update_sd_size(th, inode, inode->i_size) ; +} void sd_attrs_to_i_attrs( __u16 sd_attrs, struct inode *inode ); void i_attrs_to_sd_attrs( struct inode *inode, __u16 *sd_attrs ); +int reiserfs_setattr(struct dentry *dentry, struct iattr *attr); /* namei.c */ void set_de_name_and_namelen (struct reiserfs_dir_entry * de); @@ -2010,6 +2022,8 @@ int reiserfs_global_version_in_proc( char *buffer, char **start, off_t offset, /* dir.c */ extern struct inode_operations reiserfs_dir_inode_operations; +extern struct inode_operations reiserfs_symlink_inode_operations; +extern struct inode_operations reiserfs_special_inode_operations; extern struct file_operations reiserfs_dir_operations; /* tail_conversion.c */ @@ -2048,10 +2062,10 @@ void free_buffers_in_tb (struct tree_balance * p_s_tb); /* prints.c */ -void reiserfs_panic (struct super_block * s, const char * fmt, ...) -__attribute__ ( ( noreturn ) );/* __attribute__( ( format ( printf, 2, 3 ) ) ) */ +void reiserfs_panic (struct super_block * s, const char * fmt, ...) __attribute__ ( ( noreturn ) ); +void reiserfs_info (struct super_block *s, const char * fmt, ...); +void reiserfs_printk (const char * fmt, ...); void reiserfs_debug (struct super_block *s, int level, const char * fmt, ...); -/* __attribute__( ( format ( printf, 3, 4 ) ) ); */ void print_virtual_node (struct virtual_node * vn); void print_indirect_item (struct buffer_head * bh, int item_num); void store_print_tb (struct tree_balance * tb); @@ -2136,7 +2150,7 @@ typedef struct __reiserfs_blocknr_hint reiserfs_blocknr_hint_t; int reiserfs_parse_alloc_options (struct super_block *, char *); int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value); -void reiserfs_free_block (struct reiserfs_transaction_handle *th, b_blocknr_t); +void reiserfs_free_block (struct reiserfs_transaction_handle *th, struct inode *, b_blocknr_t, int for_unformatted); int reiserfs_allocate_blocknrs(reiserfs_blocknr_hint_t *, b_blocknr_t * , int, int); extern inline int reiserfs_new_form_blocknrs (struct tree_balance * tb, b_blocknr_t *new_blocknrs, int amount_needed) @@ -2237,6 +2251,9 @@ int reiserfs_unpack (struct inode * inode, struct file * filp); #define reiserfs_write_lock( sb ) lock_kernel() #define reiserfs_write_unlock( sb ) unlock_kernel() +/* xattr stuff */ +#define REISERFS_XATTR_DIR_SEM(s) (REISERFS_SB(s)->xattr_dir_sem) + #endif /* _LINUX_REISER_FS_H */ diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h index e689a12bcb9b..57eeaf7ed6bd 100644 --- a/include/linux/reiserfs_fs_i.h +++ b/include/linux/reiserfs_fs_i.h @@ -22,7 +22,9 @@ typedef enum { truncate or unlink. Safe link is used to avoid leakage of disk space on crash with some files open, but unlinked. */ i_link_saved_unlink_mask = 0x0010, - i_link_saved_truncate_mask = 0x0020 + i_link_saved_truncate_mask = 0x0020, + i_priv_object = 0x0080, + i_has_xattr_dir = 0x0100, } reiserfs_inode_flags; @@ -51,6 +53,10 @@ struct reiserfs_inode_info { ** flushed */ unsigned long i_trans_id ; struct reiserfs_journal_list *i_jl; + + struct posix_acl *i_acl_access; + struct posix_acl *i_acl_default; + struct rw_semaphore xattr_sem; struct inode vfs_inode; }; diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 9fa2813c2e69..38708778dd5e 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h @@ -6,6 +6,7 @@ #ifdef __KERNEL__ #include <linux/workqueue.h> +#include <linux/rwsem.h> #endif typedef enum { @@ -251,7 +252,6 @@ struct reiserfs_journal { #define JOURNAL_DESC_MAGIC "ReIsErLB" /* ick. magic string to find desc blocks in the journal */ - typedef __u32 (*hashf_t) (const signed char *, int); struct reiserfs_bitmap_info @@ -395,6 +395,10 @@ struct reiserfs_sb_info struct proc_dir_entry *procdir; int reserved_blocks; /* amount of blocks reserved for further allocations */ spinlock_t bitmap_lock; /* this lock on now only used to protect reserved_blocks variable */ + struct dentry *priv_root; /* root of /.reiserfs_priv */ + struct dentry *xattr_root; /* root of /.reiserfs_priv/.xa */ + struct rw_semaphore xattr_dir_sem; + }; /* Definitions of reiserfs on-disk properties: */ @@ -437,6 +441,9 @@ enum reiserfs_mount_options { REISERFS_NO_UNHASHED_RELOCATION, REISERFS_HASHED_RELOCATION, REISERFS_ATTRS, + REISERFS_XATTRS, + REISERFS_XATTRS_USER, + REISERFS_POSIXACL, REISERFS_TEST1, REISERFS_TEST2, @@ -462,6 +469,10 @@ enum reiserfs_mount_options { #define reiserfs_data_log(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_LOG)) #define reiserfs_data_ordered(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_ORDERED)) #define reiserfs_data_writeback(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_WRITEBACK)) +#define reiserfs_xattrs(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_XATTRS)) +#define reiserfs_xattrs_user(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_XATTRS_USER)) +#define reiserfs_posixacl(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_POSIXACL)) +#define reiserfs_xattrs_optional(s) (reiserfs_xattrs_user(s) || reiserfs_posixacl(s)) void reiserfs_file_buffer (struct buffer_head * bh, int list); extern struct file_system_type reiserfs_fs_type; diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h new file mode 100644 index 000000000000..9c40c4e9ba03 --- /dev/null +++ b/include/linux/reiserfs_xattr.h @@ -0,0 +1,132 @@ +/* + File: linux/reiserfs_xattr.h +*/ + +#include <linux/config.h> +#include <linux/init.h> +#include <linux/xattr.h> + +/* Magic value in header */ +#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */ + +struct reiserfs_xattr_header { + __u32 h_magic; /* magic number for identification */ + __u32 h_hash; /* hash of the value */ +}; + +#ifdef __KERNEL__ + +struct reiserfs_xattr_handler { + char *prefix; + int (*init)(void); + void (*exit)(void); + int (*get)(struct inode *inode, const char *name, void *buffer, + size_t size); + int (*set)(struct inode *inode, const char *name, const void *buffer, + size_t size, int flags); + int (*del)(struct inode *inode, const char *name); + int (*list)(struct inode *inode, const char *name, int namelen, char *out); + struct list_head handlers; +}; + + +#ifdef CONFIG_REISERFS_FS_XATTR +#define is_reiserfs_priv_object(inode) (REISERFS_I(inode)->i_flags & i_priv_object) +#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) +ssize_t reiserfs_getxattr (struct dentry *dentry, const char *name, + void *buffer, size_t size); +int reiserfs_setxattr (struct dentry *dentry, const char *name, + const void *value, size_t size, int flags); +ssize_t reiserfs_listxattr (struct dentry *dentry, char *buffer, size_t size); +int reiserfs_removexattr (struct dentry *dentry, const char *name); +int reiserfs_delete_xattrs (struct inode *inode); +int reiserfs_chown_xattrs (struct inode *inode, struct iattr *attrs); +int reiserfs_xattr_init (struct super_block *sb, int mount_flags); +int reiserfs_permission (struct inode *inode, int mask, struct nameidata *nd); +int reiserfs_permission_locked (struct inode *inode, int mask, struct nameidata *nd); + +int reiserfs_xattr_del (struct inode *, const char *); +int reiserfs_xattr_get (const struct inode *, const char *, void *, size_t); +int reiserfs_xattr_set (struct inode *, const char *, const void *, + size_t, int); + +extern struct reiserfs_xattr_handler user_handler; +extern struct reiserfs_xattr_handler trusted_handler; +#ifdef CONFIG_REISERFS_FS_SECURITY +extern struct reiserfs_xattr_handler security_handler; +#endif + +int reiserfs_xattr_register_handlers (void) __init; +void reiserfs_xattr_unregister_handlers (void); + +static inline void +reiserfs_write_lock_xattrs(struct super_block *sb) +{ + down_write (&REISERFS_XATTR_DIR_SEM(sb)); +} +static inline void +reiserfs_write_unlock_xattrs(struct super_block *sb) +{ + up_write (&REISERFS_XATTR_DIR_SEM(sb)); +} +static inline void +reiserfs_read_lock_xattrs(struct super_block *sb) +{ + down_read (&REISERFS_XATTR_DIR_SEM(sb)); +} + +static inline void +reiserfs_read_unlock_xattrs(struct super_block *sb) +{ + up_read (&REISERFS_XATTR_DIR_SEM(sb)); +} + +static inline void +reiserfs_write_lock_xattr_i(struct inode *inode) +{ + down_write (&REISERFS_I(inode)->xattr_sem); +} +static inline void +reiserfs_write_unlock_xattr_i(struct inode *inode) +{ + up_write (&REISERFS_I(inode)->xattr_sem); +} +static inline void +reiserfs_read_lock_xattr_i(struct inode *inode) +{ + down_read (&REISERFS_I(inode)->xattr_sem); +} + +static inline void +reiserfs_read_unlock_xattr_i(struct inode *inode) +{ + up_read (&REISERFS_I(inode)->xattr_sem); +} + +#else + +#define is_reiserfs_priv_object(inode) 0 +#define reiserfs_getxattr NULL +#define reiserfs_setxattr NULL +#define reiserfs_listxattr NULL +#define reiserfs_removexattr NULL +#define reiserfs_write_lock_xattrs(sb) +#define reiserfs_write_unlock_xattrs(sb) +#define reiserfs_read_lock_xattrs(sb) +#define reiserfs_read_unlock_xattrs(sb) + +#define reiserfs_permission NULL + +#define reiserfs_xattr_register_handlers() 0 +#define reiserfs_xattr_unregister_handlers() + +static inline int reiserfs_delete_xattrs (struct inode *inode) { return 0; }; +static inline int reiserfs_chown_xattrs (struct inode *inode, struct iattr *attrs) { return 0; }; +static inline int reiserfs_xattr_init (struct super_block *sb, int mount_flags) +{ + sb->s_flags = (sb->s_flags & ~MS_POSIXACL); /* to be sure */ + return 0; +}; +#endif + +#endif /* __KERNEL__ */ diff --git a/include/linux/sched.h b/include/linux/sched.h index 73d7127e3f28..9de4c32a81dd 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -147,6 +147,7 @@ extern spinlock_t mmlist_lock; typedef struct task_struct task_t; extern void sched_init(void); +extern void sched_init_smp(void); extern void init_idle(task_t *idle, int cpu); extern cpumask_t idle_cpu_mask; @@ -171,9 +172,11 @@ extern void update_one_process(struct task_struct *p, unsigned long user, unsigned long system, int cpu); extern void scheduler_tick(int user_tick, int system); extern unsigned long cache_decay_ticks; -extern const unsigned long scheduling_functions_start_here; -extern const unsigned long scheduling_functions_end_here; +/* Attach to any functions which should be ignored in wchan output. */ +#define __sched __attribute__((__section__(".sched.text"))) +/* Is this address in the __sched functions? */ +extern int in_sched_functions(unsigned long addr); #define MAX_SCHEDULE_TIMEOUT LONG_MAX extern signed long FASTCALL(schedule_timeout(signed long timeout)); @@ -542,6 +545,118 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0) #define PF_SYNCWRITE 0x00200000 /* I am doing a sync write */ #ifdef CONFIG_SMP +#define SCHED_LOAD_SCALE 128UL /* increase resolution of load */ + +#define SD_BALANCE_NEWIDLE 1 /* Balance when about to become idle */ +#define SD_BALANCE_EXEC 2 /* Balance on exec */ +#define SD_BALANCE_CLONE 4 /* Balance on clone */ +#define SD_WAKE_IDLE 8 /* Wake to idle CPU on task wakeup */ +#define SD_WAKE_AFFINE 16 /* Wake task to waking CPU */ +#define SD_WAKE_BALANCE 32 /* Perform balancing at task wakeup */ +#define SD_SHARE_CPUPOWER 64 /* Domain members share cpu power */ + +struct sched_group { + struct sched_group *next; /* Must be a circular list */ + cpumask_t cpumask; + + /* + * CPU power of this group, SCHED_LOAD_SCALE being max power for a + * single CPU. This should be read only (except for setup). Although + * it will need to be written to at cpu hot(un)plug time, perhaps the + * cpucontrol semaphore will provide enough exclusion? + */ + unsigned long cpu_power; +}; + +struct sched_domain { + /* These fields must be setup */ + struct sched_domain *parent; /* top domain must be null terminated */ + struct sched_group *groups; /* the balancing groups of the domain */ + cpumask_t span; /* span of all CPUs in this domain */ + unsigned long min_interval; /* Minimum balance interval ms */ + unsigned long max_interval; /* Maximum balance interval ms */ + unsigned int busy_factor; /* less balancing by factor if busy */ + unsigned int imbalance_pct; /* No balance until over watermark */ + unsigned long long cache_hot_time; /* Task considered cache hot (ns) */ + unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */ + unsigned int per_cpu_gain; /* CPU % gained by adding domain cpus */ + int flags; /* See SD_* */ + + /* Runtime fields. */ + unsigned long last_balance; /* init to jiffies. units in jiffies */ + unsigned int balance_interval; /* initialise to 1. units in ms. */ + unsigned int nr_balance_failed; /* initialise to 0 */ +}; + +/* Common values for SMT siblings */ +#define SD_SIBLING_INIT (struct sched_domain) { \ + .span = CPU_MASK_NONE, \ + .parent = NULL, \ + .groups = NULL, \ + .min_interval = 1, \ + .max_interval = 2, \ + .busy_factor = 8, \ + .imbalance_pct = 110, \ + .cache_hot_time = 0, \ + .cache_nice_tries = 0, \ + .per_cpu_gain = 15, \ + .flags = SD_BALANCE_NEWIDLE \ + | SD_BALANCE_EXEC \ + | SD_BALANCE_CLONE \ + | SD_WAKE_AFFINE \ + | SD_WAKE_IDLE \ + | SD_SHARE_CPUPOWER, \ + .last_balance = jiffies, \ + .balance_interval = 1, \ + .nr_balance_failed = 0, \ +} + +/* Common values for CPUs */ +#define SD_CPU_INIT (struct sched_domain) { \ + .span = CPU_MASK_NONE, \ + .parent = NULL, \ + .groups = NULL, \ + .min_interval = 1, \ + .max_interval = 4, \ + .busy_factor = 64, \ + .imbalance_pct = 125, \ + .cache_hot_time = (5*1000000/2), \ + .cache_nice_tries = 1, \ + .per_cpu_gain = 100, \ + .flags = SD_BALANCE_NEWIDLE \ + | SD_BALANCE_EXEC \ + | SD_BALANCE_CLONE \ + | SD_WAKE_AFFINE \ + | SD_WAKE_BALANCE, \ + .last_balance = jiffies, \ + .balance_interval = 1, \ + .nr_balance_failed = 0, \ +} + +#ifdef CONFIG_NUMA +/* Common values for NUMA nodes */ +#define SD_NODE_INIT (struct sched_domain) { \ + .span = CPU_MASK_NONE, \ + .parent = NULL, \ + .groups = NULL, \ + .min_interval = 8, \ + .max_interval = 256*fls(num_online_cpus()),\ + .busy_factor = 32, \ + .imbalance_pct = 125, \ + .cache_hot_time = (10*1000000), \ + .cache_nice_tries = 1, \ + .per_cpu_gain = 100, \ + .flags = SD_BALANCE_EXEC \ + | SD_BALANCE_CLONE \ + | SD_WAKE_BALANCE, \ + .last_balance = jiffies, \ + .balance_interval = 1, \ + .nr_balance_failed = 0, \ +} +#endif + +extern void cpu_attach_domain(struct sched_domain *sd, int cpu); + extern int set_cpus_allowed(task_t *p, cpumask_t new_mask); #else static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask) @@ -552,16 +667,13 @@ static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask) extern unsigned long long sched_clock(void); -#ifdef CONFIG_NUMA +#ifdef CONFIG_SMP extern void sched_balance_exec(void); -extern void node_nr_running_init(void); #else #define sched_balance_exec() {} -#define node_nr_running_init() {} #endif -/* Move tasks off this (offline) CPU onto another. */ -extern void migrate_all_tasks(void); +extern void sched_idle_next(void); extern void set_user_nice(task_t *p, long nice); extern int task_prio(task_t *p); extern int task_nice(task_t *p); @@ -612,12 +724,17 @@ extern void do_timer(struct pt_regs *); extern int FASTCALL(wake_up_state(struct task_struct * tsk, unsigned int state)); extern int FASTCALL(wake_up_process(struct task_struct * tsk)); +extern void FASTCALL(wake_up_forked_process(struct task_struct * tsk)); #ifdef CONFIG_SMP extern void kick_process(struct task_struct *tsk); + extern void FASTCALL(wake_up_forked_thread(struct task_struct * tsk)); #else static inline void kick_process(struct task_struct *tsk) { } + static inline void wake_up_forked_thread(struct task_struct * tsk) + { + return wake_up_forked_process(tsk); + } #endif -extern void FASTCALL(wake_up_forked_process(struct task_struct * tsk)); extern void FASTCALL(sched_fork(task_t * p)); extern void FASTCALL(sched_exit(task_t * p)); diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 4d7dd853874b..00c4b081ff42 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -85,6 +85,9 @@ /* Samsung S3C2410 SoC and derivatives thereof */ #define PORT_S3C2410 55 +/* SGI IP22 aka Indy / Challenge S / Indigo 2 */ +#define PORT_IP22ZILOG 56 + #ifdef __KERNEL__ #include <linux/config.h> diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 148ea9d43873..de381ec1ea13 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -40,6 +40,8 @@ #else +#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock) + #if !defined(CONFIG_PREEMPT) && !defined(CONFIG_DEBUG_SPINLOCK) # define atomic_dec_and_lock(atomic,lock) atomic_dec_and_test(atomic) # define ATOMIC_DEC_AND_LOCK @@ -257,7 +259,7 @@ do { \ do { \ local_irq_save(flags); \ preempt_disable(); \ - _raw_spin_lock(lock); \ + _raw_spin_lock_flags(lock, flags); \ } while (0) #define spin_lock_irq(lock) \ diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index d8929c6713d1..530911c3a186 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -163,6 +163,7 @@ enum VM_MAX_MAP_COUNT=22, /* int: Maximum number of mmaps/address-space */ VM_LAPTOP_MODE=23, /* vm laptop mode */ VM_BLOCK_DUMP=24, /* block dump mode */ + VM_HUGETLB_GROUP=25, /* permitted hugetlb group */ }; diff --git a/include/linux/times.h b/include/linux/times.h index a682537f812e..ff00f334ffaa 100644 --- a/include/linux/times.h +++ b/include/linux/times.h @@ -2,15 +2,21 @@ #define _LINUX_TIMES_H #ifdef __KERNEL__ +#include <linux/timex.h> #include <asm/div64.h> #include <asm/types.h> #include <asm/param.h> -#if (HZ % USER_HZ)==0 -# define jiffies_to_clock_t(x) ((x) / (HZ / USER_HZ)) +static inline clock_t jiffies_to_clock_t(long x) +{ +#if (TICK_NSEC % (NSEC_PER_SEC / USER_HZ)) == 0 + return x / (HZ / USER_HZ); #else -# define jiffies_to_clock_t(x) ((clock_t) jiffies_64_to_clock_t((u64) x)) + u64 tmp = (u64)x * TICK_NSEC; + do_div(tmp, (NSEC_PER_SEC / USER_HZ)); + return (long)tmp; #endif +} static inline unsigned long clock_t_to_jiffies(unsigned long x) { @@ -34,7 +40,7 @@ static inline unsigned long clock_t_to_jiffies(unsigned long x) static inline u64 jiffies_64_to_clock_t(u64 x) { -#if (HZ % USER_HZ)==0 +#if (TICK_NSEC % (NSEC_PER_SEC / USER_HZ)) == 0 do_div(x, HZ / USER_HZ); #else /* @@ -42,8 +48,8 @@ static inline u64 jiffies_64_to_clock_t(u64 x) * but even this doesn't overflow in hundreds of years * in 64 bits, so.. */ - x *= USER_HZ; - do_div(x, HZ); + x *= TICK_NSEC; + do_div(x, (NSEC_PER_SEC / USER_HZ)); #endif return x; } diff --git a/include/linux/tty.h b/include/linux/tty.h index 6e61f3b27157..7481d70fbf41 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -97,7 +97,6 @@ extern struct screen_info screen_info; #define VIDEO_TYPE_PICA_S3 0x30 /* ACER PICA-61 local S3 video */ #define VIDEO_TYPE_MIPS_G364 0x31 /* MIPS Magnum 4000 G364 video */ -#define VIDEO_TYPE_SNI_RM 0x32 /* SNI RM200 PCI video */ #define VIDEO_TYPE_SGI 0x33 /* Various SGI graphics hardware */ #define VIDEO_TYPE_TGAC 0x40 /* DEC TGA */ |
