extern void __VERIFIER_error() __attribute__ ((__noreturn__)); typedef signed char __s8; typedef unsigned char __u8; typedef short __s16; typedef unsigned short __u16; typedef int __s32; typedef unsigned int __u32; typedef long long __s64; typedef unsigned long long __u64; typedef unsigned char u8; typedef unsigned short u16; typedef int s32; typedef unsigned int u32; typedef long long s64; typedef unsigned long long u64; typedef unsigned short umode_t; typedef unsigned int __kernel_mode_t; typedef unsigned long __kernel_nlink_t; typedef long __kernel_off_t; typedef int __kernel_pid_t; typedef unsigned int __kernel_uid_t; typedef unsigned int __kernel_gid_t; typedef unsigned long __kernel_size_t; typedef long __kernel_ssize_t; typedef long __kernel_time_t; typedef long __kernel_clock_t; typedef int __kernel_timer_t; typedef int __kernel_clockid_t; typedef long long __kernel_loff_t; typedef __kernel_uid_t __kernel_uid32_t; typedef __kernel_gid_t __kernel_gid32_t; typedef __u32 __kernel_dev_t; typedef __kernel_dev_t dev_t; typedef __kernel_mode_t mode_t; typedef __kernel_nlink_t nlink_t; typedef __kernel_off_t off_t; typedef __kernel_pid_t pid_t; typedef __kernel_clockid_t clockid_t; typedef _Bool bool; typedef __kernel_uid32_t uid_t; typedef __kernel_gid32_t gid_t; typedef __kernel_loff_t loff_t; typedef __kernel_size_t size_t; typedef __kernel_ssize_t ssize_t; typedef __kernel_time_t time_t; typedef __s32 int32_t; typedef __u32 uint32_t; typedef unsigned long sector_t; typedef unsigned long blkcnt_t; typedef u64 dma_addr_t; typedef __u16 __be16; typedef __u32 __be32; typedef __u32 __wsum; typedef unsigned int gfp_t; typedef unsigned int fmode_t; struct __anonstruct_atomic_t_6 { int counter ; }; typedef struct __anonstruct_atomic_t_6 atomic_t; struct __anonstruct_atomic64_t_7 { long counter ; }; typedef struct __anonstruct_atomic64_t_7 atomic64_t; struct list_head { struct list_head *next ; struct list_head *prev ; }; struct hlist_node; struct hlist_head { struct hlist_node *first ; }; struct hlist_node { struct hlist_node *next ; struct hlist_node **pprev ; }; struct module; typedef void (*ctor_fn_t)(void); struct _ddebug { char const *modname ; char const *function ; char const *filename ; char const *format ; unsigned int lineno : 24 ; unsigned char flags ; char enabled ; }; struct bug_entry { int bug_addr_disp ; int file_disp ; unsigned short line ; unsigned short flags ; }; struct completion; struct pt_regs; struct pid; struct timespec; struct compat_timespec; struct __anonstruct_futex_9 { u32 *uaddr ; u32 val ; u32 flags ; u32 bitset ; u64 time ; u32 *uaddr2 ; }; struct __anonstruct_nanosleep_10 { clockid_t clockid ; struct timespec *rmtp ; struct compat_timespec *compat_rmtp ; u64 expires ; }; struct pollfd; struct __anonstruct_poll_11 { struct pollfd *ufds ; int nfds ; int has_timeout ; unsigned long tv_sec ; unsigned long tv_nsec ; }; union __anonunion_ldv_2052_8 { struct __anonstruct_futex_9 futex ; struct __anonstruct_nanosleep_10 nanosleep ; struct __anonstruct_poll_11 poll ; }; struct restart_block { long (*fn)(struct restart_block * ) ; union __anonunion_ldv_2052_8 ldv_2052 ; }; struct page; struct task_struct; struct exec_domain; struct mm_struct; struct pt_regs { unsigned long r15 ; unsigned long r14 ; unsigned long r13 ; unsigned long r12 ; unsigned long bp ; unsigned long bx ; unsigned long r11 ; unsigned long r10 ; unsigned long r9 ; unsigned long r8 ; unsigned long ax ; unsigned long cx ; unsigned long dx ; unsigned long si ; unsigned long di ; unsigned long orig_ax ; unsigned long ip ; unsigned long cs ; unsigned long flags ; unsigned long sp ; unsigned long ss ; }; struct kernel_vm86_regs { struct pt_regs pt ; unsigned short es ; unsigned short __esh ; unsigned short ds ; unsigned short __dsh ; unsigned short fs ; unsigned short __fsh ; unsigned short gs ; unsigned short __gsh ; }; union __anonunion_ldv_2292_12 { struct pt_regs *regs ; struct kernel_vm86_regs *vm86 ; }; struct math_emu_info { long ___orig_eip ; union __anonunion_ldv_2292_12 ldv_2292 ; }; typedef unsigned long pgdval_t; typedef unsigned long pgprotval_t; struct pgprot { pgprotval_t pgprot ; }; typedef struct pgprot pgprot_t; struct __anonstruct_pgd_t_15 { pgdval_t pgd ; }; typedef struct __anonstruct_pgd_t_15 pgd_t; typedef struct page *pgtable_t; struct file; struct seq_file; struct __anonstruct_ldv_2526_19 { unsigned int a ; unsigned int b ; }; struct __anonstruct_ldv_2541_20 { u16 limit0 ; u16 base0 ; unsigned char base1 ; unsigned char type : 4 ; unsigned char s : 1 ; unsigned char dpl : 2 ; unsigned char p : 1 ; unsigned char limit : 4 ; unsigned char avl : 1 ; unsigned char l : 1 ; unsigned char d : 1 ; unsigned char g : 1 ; unsigned char base2 ; }; union __anonunion_ldv_2542_18 { struct __anonstruct_ldv_2526_19 ldv_2526 ; struct __anonstruct_ldv_2541_20 ldv_2541 ; }; struct desc_struct { union __anonunion_ldv_2542_18 ldv_2542 ; }; enum km_type { KM_BOUNCE_READ = 0, KM_SKB_SUNRPC_DATA = 1, KM_SKB_DATA_SOFTIRQ = 2, KM_USER0 = 3, KM_USER1 = 4, KM_BIO_SRC_IRQ = 5, KM_BIO_DST_IRQ = 6, KM_PTE0 = 7, KM_PTE1 = 8, KM_IRQ0 = 9, KM_IRQ1 = 10, KM_SOFTIRQ0 = 11, KM_SOFTIRQ1 = 12, KM_SYNC_ICACHE = 13, KM_SYNC_DCACHE = 14, KM_UML_USERCOPY = 15, KM_IRQ_PTE = 16, KM_NMI = 17, KM_NMI_PTE = 18, KM_KDB = 19, KM_TYPE_NR = 20 } ; struct thread_struct; struct cpumask; struct arch_spinlock; struct cpumask { unsigned long bits[64U] ; }; typedef struct cpumask cpumask_t; typedef struct cpumask *cpumask_var_t; struct map_segment; struct exec_domain { char const *name ; void (*handler)(int , struct pt_regs * ) ; unsigned char pers_low ; unsigned char pers_high ; unsigned long *signal_map ; unsigned long *signal_invmap ; struct map_segment *err_map ; struct map_segment *socktype_map ; struct map_segment *sockopt_map ; struct map_segment *af_map ; struct module *module ; struct exec_domain *next ; }; struct seq_operations; struct i387_fsave_struct { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u32 status ; }; struct __anonstruct_ldv_5171_24 { u64 rip ; u64 rdp ; }; struct __anonstruct_ldv_5177_25 { u32 fip ; u32 fcs ; u32 foo ; u32 fos ; }; union __anonunion_ldv_5178_23 { struct __anonstruct_ldv_5171_24 ldv_5171 ; struct __anonstruct_ldv_5177_25 ldv_5177 ; }; union __anonunion_ldv_5187_26 { u32 padding1[12U] ; u32 sw_reserved[12U] ; }; struct i387_fxsave_struct { u16 cwd ; u16 swd ; u16 twd ; u16 fop ; union __anonunion_ldv_5178_23 ldv_5178 ; u32 mxcsr ; u32 mxcsr_mask ; u32 st_space[32U] ; u32 xmm_space[64U] ; u32 padding[12U] ; union __anonunion_ldv_5187_26 ldv_5187 ; }; struct i387_soft_struct { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u8 ftop ; u8 changed ; u8 lookahead ; u8 no_update ; u8 rm ; u8 alimit ; struct math_emu_info *info ; u32 entry_eip ; }; struct ymmh_struct { u32 ymmh_space[64U] ; }; struct xsave_hdr_struct { u64 xstate_bv ; u64 reserved1[2U] ; u64 reserved2[5U] ; }; struct xsave_struct { struct i387_fxsave_struct i387 ; struct xsave_hdr_struct xsave_hdr ; struct ymmh_struct ymmh ; }; union thread_xstate { struct i387_fsave_struct fsave ; struct i387_fxsave_struct fxsave ; struct i387_soft_struct soft ; struct xsave_struct xsave ; }; struct fpu { union thread_xstate *state ; }; struct kmem_cache; struct perf_event; struct thread_struct { struct desc_struct tls_array[3U] ; unsigned long sp0 ; unsigned long sp ; unsigned long usersp ; unsigned short es ; unsigned short ds ; unsigned short fsindex ; unsigned short gsindex ; unsigned long fs ; unsigned long gs ; struct perf_event *ptrace_bps[4U] ; unsigned long debugreg6 ; unsigned long ptrace_dr7 ; unsigned long cr2 ; unsigned long trap_no ; unsigned long error_code ; struct fpu fpu ; unsigned long *io_bitmap_ptr ; unsigned long iopl ; unsigned int io_bitmap_max ; }; struct __anonstruct_mm_segment_t_28 { unsigned long seg ; }; typedef struct __anonstruct_mm_segment_t_28 mm_segment_t; typedef atomic64_t atomic_long_t; struct thread_info { struct task_struct *task ; struct exec_domain *exec_domain ; __u32 flags ; __u32 status ; __u32 cpu ; int preempt_count ; mm_segment_t addr_limit ; struct restart_block restart_block ; void *sysenter_return ; int uaccess_err ; }; struct arch_spinlock { unsigned int slock ; }; typedef struct arch_spinlock arch_spinlock_t; struct __anonstruct_arch_rwlock_t_29 { unsigned int lock ; }; typedef struct __anonstruct_arch_rwlock_t_29 arch_rwlock_t; struct lockdep_map; struct stack_trace { unsigned int nr_entries ; unsigned int max_entries ; unsigned long *entries ; int skip ; }; struct lockdep_subclass_key { char __one_byte ; }; struct lock_class_key { struct lockdep_subclass_key subkeys[8U] ; }; struct lock_class { struct list_head hash_entry ; struct list_head lock_entry ; struct lockdep_subclass_key *key ; unsigned int subclass ; unsigned int dep_gen_id ; unsigned long usage_mask ; struct stack_trace usage_traces[13U] ; struct list_head locks_after ; struct list_head locks_before ; unsigned int version ; unsigned long ops ; char const *name ; int name_version ; unsigned long contention_point[4U] ; unsigned long contending_point[4U] ; }; struct lockdep_map { struct lock_class_key *key ; struct lock_class *class_cache[2U] ; char const *name ; int cpu ; unsigned long ip ; }; struct held_lock { u64 prev_chain_key ; unsigned long acquire_ip ; struct lockdep_map *instance ; struct lockdep_map *nest_lock ; u64 waittime_stamp ; u64 holdtime_stamp ; unsigned short class_idx : 13 ; unsigned char irq_context : 2 ; unsigned char trylock : 1 ; unsigned char read : 2 ; unsigned char check : 2 ; unsigned char hardirqs_off : 1 ; unsigned short references : 11 ; }; struct raw_spinlock { arch_spinlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct raw_spinlock raw_spinlock_t; struct __anonstruct_ldv_6059_31 { u8 __padding[24U] ; struct lockdep_map dep_map ; }; union __anonunion_ldv_6060_30 { struct raw_spinlock rlock ; struct __anonstruct_ldv_6059_31 ldv_6059 ; }; struct spinlock { union __anonunion_ldv_6060_30 ldv_6060 ; }; typedef struct spinlock spinlock_t; struct __anonstruct_rwlock_t_32 { arch_rwlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_rwlock_t_32 rwlock_t; struct __anonstruct_seqlock_t_33 { unsigned int sequence ; spinlock_t lock ; }; typedef struct __anonstruct_seqlock_t_33 seqlock_t; struct seqcount { unsigned int sequence ; }; typedef struct seqcount seqcount_t; struct timespec { __kernel_time_t tv_sec ; long tv_nsec ; }; struct kstat { u64 ino ; dev_t dev ; umode_t mode ; unsigned int nlink ; uid_t uid ; gid_t gid ; dev_t rdev ; loff_t size ; struct timespec atime ; struct timespec mtime ; struct timespec ctime ; unsigned long blksize ; unsigned long long blocks ; }; struct __wait_queue; typedef struct __wait_queue wait_queue_t; struct __wait_queue { unsigned int flags ; void *private ; int (*func)(wait_queue_t * , unsigned int , int , void * ) ; struct list_head task_list ; }; struct __wait_queue_head { spinlock_t lock ; struct list_head task_list ; }; typedef struct __wait_queue_head wait_queue_head_t; struct __anonstruct_nodemask_t_34 { unsigned long bits[16U] ; }; typedef struct __anonstruct_nodemask_t_34 nodemask_t; struct mutex { atomic_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct task_struct *owner ; char const *name ; void *magic ; struct lockdep_map dep_map ; }; struct mutex_waiter { struct list_head list ; struct task_struct *task ; void *magic ; }; struct rw_semaphore; struct rw_semaphore { long count ; spinlock_t wait_lock ; struct list_head wait_list ; struct lockdep_map dep_map ; }; struct ctl_table; struct device; union ktime { s64 tv64 ; }; typedef union ktime ktime_t; struct tvec_base; struct timer_list { struct list_head entry ; unsigned long expires ; struct tvec_base *base ; void (*function)(unsigned long ) ; unsigned long data ; int slack ; int start_pid ; void *start_site ; char start_comm[16U] ; struct lockdep_map lockdep_map ; }; struct hrtimer; enum hrtimer_restart; enum hrtimer_restart; struct work_struct; struct work_struct { atomic_long_t data ; struct list_head entry ; void (*func)(struct work_struct * ) ; struct lockdep_map lockdep_map ; }; struct delayed_work { struct work_struct work ; struct timer_list timer ; }; struct completion { unsigned int done ; wait_queue_head_t wait ; }; struct pm_message { int event ; }; typedef struct pm_message pm_message_t; struct dev_pm_ops { int (*prepare)(struct device * ) ; void (*complete)(struct device * ) ; int (*suspend)(struct device * ) ; int (*resume)(struct device * ) ; int (*freeze)(struct device * ) ; int (*thaw)(struct device * ) ; int (*poweroff)(struct device * ) ; int (*restore)(struct device * ) ; int (*suspend_noirq)(struct device * ) ; int (*resume_noirq)(struct device * ) ; int (*freeze_noirq)(struct device * ) ; int (*thaw_noirq)(struct device * ) ; int (*poweroff_noirq)(struct device * ) ; int (*restore_noirq)(struct device * ) ; int (*runtime_suspend)(struct device * ) ; int (*runtime_resume)(struct device * ) ; int (*runtime_idle)(struct device * ) ; }; enum rpm_status { RPM_ACTIVE = 0, RPM_RESUMING = 1, RPM_SUSPENDED = 2, RPM_SUSPENDING = 3 } ; enum rpm_request { RPM_REQ_NONE = 0, RPM_REQ_IDLE = 1, RPM_REQ_SUSPEND = 2, RPM_REQ_AUTOSUSPEND = 3, RPM_REQ_RESUME = 4 } ; struct wakeup_source; struct dev_pm_info { pm_message_t power_state ; unsigned char can_wakeup : 1 ; unsigned char async_suspend : 1 ; bool is_prepared ; bool is_suspended ; spinlock_t lock ; struct list_head entry ; struct completion completion ; struct wakeup_source *wakeup ; struct timer_list suspend_timer ; unsigned long timer_expires ; struct work_struct work ; wait_queue_head_t wait_queue ; atomic_t usage_count ; atomic_t child_count ; unsigned char disable_depth : 3 ; unsigned char ignore_children : 1 ; unsigned char idle_notification : 1 ; unsigned char request_pending : 1 ; unsigned char deferred_resume : 1 ; unsigned char run_wake : 1 ; unsigned char runtime_auto : 1 ; unsigned char no_callbacks : 1 ; unsigned char irq_safe : 1 ; unsigned char use_autosuspend : 1 ; unsigned char timer_autosuspends : 1 ; enum rpm_request request ; enum rpm_status runtime_status ; int runtime_error ; int autosuspend_delay ; unsigned long last_busy ; unsigned long active_jiffies ; unsigned long suspended_jiffies ; unsigned long accounting_timestamp ; void *subsys_data ; }; struct dev_power_domain { struct dev_pm_ops ops ; }; struct __anonstruct_mm_context_t_99 { void *ldt ; int size ; unsigned short ia32_compat ; struct mutex lock ; void *vdso ; }; typedef struct __anonstruct_mm_context_t_99 mm_context_t; struct vm_area_struct; struct bio_vec; struct call_single_data { struct list_head list ; void (*func)(void * ) ; void *info ; u16 flags ; u16 priv ; }; struct rcu_head { struct rcu_head *next ; void (*func)(struct rcu_head * ) ; }; struct nsproxy; struct ctl_table_root; struct ctl_table_set { struct list_head list ; struct ctl_table_set *parent ; int (*is_seen)(struct ctl_table_set * ) ; }; struct ctl_table_header; typedef int proc_handler(struct ctl_table * , int , void * , size_t * , loff_t * ); struct ctl_table { char const *procname ; void *data ; int maxlen ; mode_t mode ; struct ctl_table *child ; struct ctl_table *parent ; proc_handler *proc_handler ; void *extra1 ; void *extra2 ; }; struct ctl_table_root { struct list_head root_list ; struct ctl_table_set default_set ; struct ctl_table_set *(*lookup)(struct ctl_table_root * , struct nsproxy * ) ; int (*permissions)(struct ctl_table_root * , struct nsproxy * , struct ctl_table * ) ; }; struct __anonstruct_ldv_12193_124 { struct ctl_table *ctl_table ; struct list_head ctl_entry ; int used ; int count ; }; union __anonunion_ldv_12195_123 { struct __anonstruct_ldv_12193_124 ldv_12193 ; struct rcu_head rcu ; }; struct ctl_table_header { union __anonunion_ldv_12195_123 ldv_12195 ; struct completion *unregistering ; struct ctl_table *ctl_table_arg ; struct ctl_table_root *root ; struct ctl_table_set *set ; struct ctl_table *attached_by ; struct ctl_table *attached_to ; struct ctl_table_header *parent ; }; struct cred; struct linux_binprm; typedef __u64 Elf64_Addr; typedef __u16 Elf64_Half; typedef __u32 Elf64_Word; typedef __u64 Elf64_Xword; struct elf64_sym { Elf64_Word st_name ; unsigned char st_info ; unsigned char st_other ; Elf64_Half st_shndx ; Elf64_Addr st_value ; Elf64_Xword st_size ; }; typedef struct elf64_sym Elf64_Sym; struct sock; struct kobject; enum kobj_ns_type { KOBJ_NS_TYPE_NONE = 0, KOBJ_NS_TYPE_NET = 1, KOBJ_NS_TYPES = 2 } ; struct kobj_ns_type_operations { enum kobj_ns_type type ; void *(*grab_current_ns)(void) ; void const *(*netlink_ns)(struct sock * ) ; void const *(*initial_ns)(void) ; void (*drop_ns)(void * ) ; }; struct attribute { char const *name ; mode_t mode ; struct lock_class_key *key ; struct lock_class_key skey ; }; struct attribute_group { char const *name ; mode_t (*is_visible)(struct kobject * , struct attribute * , int ) ; struct attribute **attrs ; }; struct bin_attribute { struct attribute attr ; size_t size ; void *private ; ssize_t (*read)(struct file * , struct kobject * , struct bin_attribute * , char * , loff_t , size_t ) ; ssize_t (*write)(struct file * , struct kobject * , struct bin_attribute * , char * , loff_t , size_t ) ; int (*mmap)(struct file * , struct kobject * , struct bin_attribute * , struct vm_area_struct * ) ; }; struct sysfs_ops { ssize_t (*show)(struct kobject * , struct attribute * , char * ) ; ssize_t (*store)(struct kobject * , struct attribute * , char const * , size_t ) ; }; struct sysfs_dirent; struct kref { atomic_t refcount ; }; struct kset; struct kobj_type; struct kobject { char const *name ; struct list_head entry ; struct kobject *parent ; struct kset *kset ; struct kobj_type *ktype ; struct sysfs_dirent *sd ; struct kref kref ; unsigned char state_initialized : 1 ; unsigned char state_in_sysfs : 1 ; unsigned char state_add_uevent_sent : 1 ; unsigned char state_remove_uevent_sent : 1 ; unsigned char uevent_suppress : 1 ; }; struct kobj_type { void (*release)(struct kobject * ) ; struct sysfs_ops const *sysfs_ops ; struct attribute **default_attrs ; struct kobj_ns_type_operations const *(*child_ns_type)(struct kobject * ) ; void const *(*namespace)(struct kobject * ) ; }; struct kobj_uevent_env { char *envp[32U] ; int envp_idx ; char buf[2048U] ; int buflen ; }; struct kset_uevent_ops { int (* const filter)(struct kset * , struct kobject * ) ; char const *(* const name)(struct kset * , struct kobject * ) ; int (* const uevent)(struct kset * , struct kobject * , struct kobj_uevent_env * ) ; }; struct kset { struct list_head list ; spinlock_t list_lock ; struct kobject kobj ; struct kset_uevent_ops const *uevent_ops ; }; struct kernel_param; struct kernel_param_ops { int (*set)(char const * , struct kernel_param const * ) ; int (*get)(char * , struct kernel_param const * ) ; void (*free)(void * ) ; }; struct kparam_string; struct kparam_array; union __anonunion_ldv_12924_129 { void *arg ; struct kparam_string const *str ; struct kparam_array const *arr ; }; struct kernel_param { char const *name ; struct kernel_param_ops const *ops ; u16 perm ; u16 flags ; union __anonunion_ldv_12924_129 ldv_12924 ; }; struct kparam_string { unsigned int maxlen ; char *string ; }; struct kparam_array { unsigned int max ; unsigned int elemsize ; unsigned int *num ; struct kernel_param_ops const *ops ; void *elem ; }; struct jump_label_key { atomic_t enabled ; }; struct tracepoint; struct tracepoint_func { void *func ; void *data ; }; struct tracepoint { char const *name ; struct jump_label_key key ; void (*regfunc)(void) ; void (*unregfunc)(void) ; struct tracepoint_func *funcs ; }; struct mod_arch_specific { }; struct kernel_symbol { unsigned long value ; char const *name ; }; struct module_attribute { struct attribute attr ; ssize_t (*show)(struct module_attribute * , struct module * , char * ) ; ssize_t (*store)(struct module_attribute * , struct module * , char const * , size_t ) ; void (*setup)(struct module * , char const * ) ; int (*test)(struct module * ) ; void (*free)(struct module * ) ; }; struct module_param_attrs; struct module_kobject { struct kobject kobj ; struct module *mod ; struct kobject *drivers_dir ; struct module_param_attrs *mp ; }; struct exception_table_entry; enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2 } ; struct module_ref { unsigned int incs ; unsigned int decs ; }; struct module_sect_attrs; struct module_notes_attrs; struct ftrace_event_call; struct module { enum module_state state ; struct list_head list ; char name[56U] ; struct module_kobject mkobj ; struct module_attribute *modinfo_attrs ; char const *version ; char const *srcversion ; struct kobject *holders_dir ; struct kernel_symbol const *syms ; unsigned long const *crcs ; unsigned int num_syms ; struct kernel_param *kp ; unsigned int num_kp ; unsigned int num_gpl_syms ; struct kernel_symbol const *gpl_syms ; unsigned long const *gpl_crcs ; struct kernel_symbol const *unused_syms ; unsigned long const *unused_crcs ; unsigned int num_unused_syms ; unsigned int num_unused_gpl_syms ; struct kernel_symbol const *unused_gpl_syms ; unsigned long const *unused_gpl_crcs ; struct kernel_symbol const *gpl_future_syms ; unsigned long const *gpl_future_crcs ; unsigned int num_gpl_future_syms ; unsigned int num_exentries ; struct exception_table_entry *extable ; int (*init)(void) ; void *module_init ; void *module_core ; unsigned int init_size ; unsigned int core_size ; unsigned int init_text_size ; unsigned int core_text_size ; unsigned int init_ro_size ; unsigned int core_ro_size ; struct mod_arch_specific arch ; unsigned int taints ; unsigned int num_bugs ; struct list_head bug_list ; struct bug_entry *bug_table ; Elf64_Sym *symtab ; Elf64_Sym *core_symtab ; unsigned int num_symtab ; unsigned int core_num_syms ; char *strtab ; char *core_strtab ; struct module_sect_attrs *sect_attrs ; struct module_notes_attrs *notes_attrs ; char *args ; void *percpu ; unsigned int percpu_size ; unsigned int num_tracepoints ; struct tracepoint * const *tracepoints_ptrs ; unsigned int num_trace_bprintk_fmt ; char const **trace_bprintk_fmt_start ; struct ftrace_event_call **trace_events ; unsigned int num_trace_events ; unsigned int num_ftrace_callsites ; unsigned long *ftrace_callsites ; struct list_head source_list ; struct list_head target_list ; struct task_struct *waiter ; void (*exit)(void) ; struct module_ref *refptr ; ctor_fn_t (**ctors)(void) ; unsigned int num_ctors ; }; struct hlist_nulls_node; struct hlist_nulls_head { struct hlist_nulls_node *first ; }; struct hlist_nulls_node { struct hlist_nulls_node *next ; struct hlist_nulls_node **pprev ; }; struct iovec { void *iov_base ; __kernel_size_t iov_len ; }; typedef unsigned short sa_family_t; struct sockaddr { sa_family_t sa_family ; char sa_data[14U] ; }; struct msghdr { void *msg_name ; int msg_namelen ; struct iovec *msg_iov ; __kernel_size_t msg_iovlen ; void *msg_control ; __kernel_size_t msg_controllen ; unsigned int msg_flags ; }; struct __anonstruct_sync_serial_settings_130 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; }; typedef struct __anonstruct_sync_serial_settings_130 sync_serial_settings; struct __anonstruct_te1_settings_131 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; unsigned int slot_map ; }; typedef struct __anonstruct_te1_settings_131 te1_settings; struct __anonstruct_raw_hdlc_proto_132 { unsigned short encoding ; unsigned short parity ; }; typedef struct __anonstruct_raw_hdlc_proto_132 raw_hdlc_proto; struct __anonstruct_fr_proto_133 { unsigned int t391 ; unsigned int t392 ; unsigned int n391 ; unsigned int n392 ; unsigned int n393 ; unsigned short lmi ; unsigned short dce ; }; typedef struct __anonstruct_fr_proto_133 fr_proto; struct __anonstruct_fr_proto_pvc_134 { unsigned int dlci ; }; typedef struct __anonstruct_fr_proto_pvc_134 fr_proto_pvc; struct __anonstruct_fr_proto_pvc_info_135 { unsigned int dlci ; char master[16U] ; }; typedef struct __anonstruct_fr_proto_pvc_info_135 fr_proto_pvc_info; struct __anonstruct_cisco_proto_136 { unsigned int interval ; unsigned int timeout ; }; typedef struct __anonstruct_cisco_proto_136 cisco_proto; struct ifmap { unsigned long mem_start ; unsigned long mem_end ; unsigned short base_addr ; unsigned char irq ; unsigned char dma ; unsigned char port ; }; union __anonunion_ifs_ifsu_137 { raw_hdlc_proto *raw_hdlc ; cisco_proto *cisco ; fr_proto *fr ; fr_proto_pvc *fr_pvc ; fr_proto_pvc_info *fr_pvc_info ; sync_serial_settings *sync ; te1_settings *te1 ; }; struct if_settings { unsigned int type ; unsigned int size ; union __anonunion_ifs_ifsu_137 ifs_ifsu ; }; union __anonunion_ifr_ifrn_138 { char ifrn_name[16U] ; }; union __anonunion_ifr_ifru_139 { struct sockaddr ifru_addr ; struct sockaddr ifru_dstaddr ; struct sockaddr ifru_broadaddr ; struct sockaddr ifru_netmask ; struct sockaddr ifru_hwaddr ; short ifru_flags ; int ifru_ivalue ; int ifru_mtu ; struct ifmap ifru_map ; char ifru_slave[16U] ; char ifru_newname[16U] ; void *ifru_data ; struct if_settings ifru_settings ; }; struct ifreq { union __anonunion_ifr_ifrn_138 ifr_ifrn ; union __anonunion_ifr_ifru_139 ifr_ifru ; }; struct ethhdr { unsigned char h_dest[6U] ; unsigned char h_source[6U] ; __be16 h_proto ; }; struct prio_tree_node; struct raw_prio_tree_node { struct prio_tree_node *left ; struct prio_tree_node *right ; struct prio_tree_node *parent ; }; struct prio_tree_node { struct prio_tree_node *left ; struct prio_tree_node *right ; struct prio_tree_node *parent ; unsigned long start ; unsigned long last ; }; struct prio_tree_root { struct prio_tree_node *prio_tree_node ; unsigned short index_bits ; unsigned short raw ; }; struct rb_node { unsigned long rb_parent_color ; struct rb_node *rb_right ; struct rb_node *rb_left ; }; struct rb_root { struct rb_node *rb_node ; }; struct address_space; struct __anonstruct_ldv_14023_142 { u16 inuse ; u16 objects ; }; union __anonunion_ldv_14024_141 { atomic_t _mapcount ; struct __anonstruct_ldv_14023_142 ldv_14023 ; }; struct __anonstruct_ldv_14029_144 { unsigned long private ; struct address_space *mapping ; }; union __anonunion_ldv_14032_143 { struct __anonstruct_ldv_14029_144 ldv_14029 ; struct kmem_cache *slab ; struct page *first_page ; }; union __anonunion_ldv_14036_145 { unsigned long index ; void *freelist ; }; struct page { unsigned long flags ; atomic_t _count ; union __anonunion_ldv_14024_141 ldv_14024 ; union __anonunion_ldv_14032_143 ldv_14032 ; union __anonunion_ldv_14036_145 ldv_14036 ; struct list_head lru ; }; struct __anonstruct_vm_set_147 { struct list_head list ; void *parent ; struct vm_area_struct *head ; }; union __anonunion_shared_146 { struct __anonstruct_vm_set_147 vm_set ; struct raw_prio_tree_node prio_tree_node ; }; struct anon_vma; struct vm_operations_struct; struct mempolicy; struct vm_area_struct { struct mm_struct *vm_mm ; unsigned long vm_start ; unsigned long vm_end ; struct vm_area_struct *vm_next ; struct vm_area_struct *vm_prev ; pgprot_t vm_page_prot ; unsigned long vm_flags ; struct rb_node vm_rb ; union __anonunion_shared_146 shared ; struct list_head anon_vma_chain ; struct anon_vma *anon_vma ; struct vm_operations_struct const *vm_ops ; unsigned long vm_pgoff ; struct file *vm_file ; void *vm_private_data ; struct mempolicy *vm_policy ; }; struct core_thread { struct task_struct *task ; struct core_thread *next ; }; struct core_state { atomic_t nr_threads ; struct core_thread dumper ; struct completion startup ; }; struct mm_rss_stat { atomic_long_t count[3U] ; }; struct linux_binfmt; struct mmu_notifier_mm; struct mm_struct { struct vm_area_struct *mmap ; struct rb_root mm_rb ; struct vm_area_struct *mmap_cache ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; void (*unmap_area)(struct mm_struct * , unsigned long ) ; unsigned long mmap_base ; unsigned long task_size ; unsigned long cached_hole_size ; unsigned long free_area_cache ; pgd_t *pgd ; atomic_t mm_users ; atomic_t mm_count ; int map_count ; spinlock_t page_table_lock ; struct rw_semaphore mmap_sem ; struct list_head mmlist ; unsigned long hiwater_rss ; unsigned long hiwater_vm ; unsigned long total_vm ; unsigned long locked_vm ; unsigned long shared_vm ; unsigned long exec_vm ; unsigned long stack_vm ; unsigned long reserved_vm ; unsigned long def_flags ; unsigned long nr_ptes ; unsigned long start_code ; unsigned long end_code ; unsigned long start_data ; unsigned long end_data ; unsigned long start_brk ; unsigned long brk ; unsigned long start_stack ; unsigned long arg_start ; unsigned long arg_end ; unsigned long env_start ; unsigned long env_end ; unsigned long saved_auxv[44U] ; struct mm_rss_stat rss_stat ; struct linux_binfmt *binfmt ; cpumask_var_t cpu_vm_mask_var ; mm_context_t context ; unsigned int faultstamp ; unsigned int token_priority ; unsigned int last_interval ; atomic_t oom_disable_count ; unsigned long flags ; struct core_state *core_state ; spinlock_t ioctx_lock ; struct hlist_head ioctx_list ; struct task_struct *owner ; struct file *exe_file ; unsigned long num_exe_file_vmas ; struct mmu_notifier_mm *mmu_notifier_mm ; pgtable_t pmd_huge_pte ; struct cpumask cpumask_allocation ; }; enum ldv_13718 { SS_FREE = 0, SS_UNCONNECTED = 1, SS_CONNECTING = 2, SS_CONNECTED = 3, SS_DISCONNECTING = 4 } ; typedef enum ldv_13718 socket_state; struct poll_table_struct; struct pipe_inode_info; struct inode; struct net; struct fasync_struct; struct socket_wq { wait_queue_head_t wait ; struct fasync_struct *fasync_list ; struct rcu_head rcu ; }; struct proto_ops; struct socket { socket_state state ; short type ; unsigned long flags ; struct socket_wq *wq ; struct file *file ; struct sock *sk ; struct proto_ops const *ops ; }; struct kiocb; struct proto_ops { int family ; struct module *owner ; int (*release)(struct socket * ) ; int (*bind)(struct socket * , struct sockaddr * , int ) ; int (*connect)(struct socket * , struct sockaddr * , int , int ) ; int (*socketpair)(struct socket * , struct socket * ) ; int (*accept)(struct socket * , struct socket * , int ) ; int (*getname)(struct socket * , struct sockaddr * , int * , int ) ; unsigned int (*poll)(struct file * , struct socket * , struct poll_table_struct * ) ; int (*ioctl)(struct socket * , unsigned int , unsigned long ) ; int (*compat_ioctl)(struct socket * , unsigned int , unsigned long ) ; int (*listen)(struct socket * , int ) ; int (*shutdown)(struct socket * , int ) ; int (*setsockopt)(struct socket * , int , int , char * , unsigned int ) ; int (*getsockopt)(struct socket * , int , int , char * , int * ) ; int (*compat_setsockopt)(struct socket * , int , int , char * , unsigned int ) ; int (*compat_getsockopt)(struct socket * , int , int , char * , int * ) ; int (*sendmsg)(struct kiocb * , struct socket * , struct msghdr * , size_t ) ; int (*recvmsg)(struct kiocb * , struct socket * , struct msghdr * , size_t , int ) ; int (*mmap)(struct file * , struct socket * , struct vm_area_struct * ) ; ssize_t (*sendpage)(struct socket * , struct page * , int , size_t , int ) ; ssize_t (*splice_read)(struct socket * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ) ; }; struct kmem_cache_cpu { void **freelist ; unsigned long tid ; struct page *page ; int node ; unsigned int stat[19U] ; }; struct kmem_cache_node { spinlock_t list_lock ; unsigned long nr_partial ; struct list_head partial ; atomic_long_t nr_slabs ; atomic_long_t total_objects ; struct list_head full ; }; struct kmem_cache_order_objects { unsigned long x ; }; struct kmem_cache { struct kmem_cache_cpu *cpu_slab ; unsigned long flags ; unsigned long min_partial ; int size ; int objsize ; int offset ; struct kmem_cache_order_objects oo ; struct kmem_cache_order_objects max ; struct kmem_cache_order_objects min ; gfp_t allocflags ; int refcount ; void (*ctor)(void * ) ; int inuse ; int align ; int reserved ; char const *name ; struct list_head list ; struct kobject kobj ; int remote_node_defrag_ratio ; struct kmem_cache_node *node[1024U] ; }; struct exception_table_entry { unsigned long insn ; unsigned long fixup ; }; struct in6_addr; struct sk_buff; struct klist_node; struct klist_node { void *n_klist ; struct list_head n_node ; struct kref n_ref ; }; struct dma_map_ops; struct dev_archdata { void *acpi_handle ; struct dma_map_ops *dma_ops ; void *iommu ; }; struct device_private; struct device_driver; struct driver_private; struct class; struct subsys_private; struct bus_type; struct device_node; struct bus_attribute { struct attribute attr ; ssize_t (*show)(struct bus_type * , char * ) ; ssize_t (*store)(struct bus_type * , char const * , size_t ) ; }; struct device_attribute; struct driver_attribute; struct bus_type { char const *name ; struct bus_attribute *bus_attrs ; struct device_attribute *dev_attrs ; struct driver_attribute *drv_attrs ; int (*match)(struct device * , struct device_driver * ) ; int (*uevent)(struct device * , struct kobj_uevent_env * ) ; int (*probe)(struct device * ) ; int (*remove)(struct device * ) ; void (*shutdown)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct dev_pm_ops const *pm ; struct subsys_private *p ; }; struct of_device_id; struct device_driver { char const *name ; struct bus_type *bus ; struct module *owner ; char const *mod_name ; bool suppress_bind_attrs ; struct of_device_id const *of_match_table ; int (*probe)(struct device * ) ; int (*remove)(struct device * ) ; void (*shutdown)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct attribute_group const **groups ; struct dev_pm_ops const *pm ; struct driver_private *p ; }; struct driver_attribute { struct attribute attr ; ssize_t (*show)(struct device_driver * , char * ) ; ssize_t (*store)(struct device_driver * , char const * , size_t ) ; }; struct class_attribute; struct class { char const *name ; struct module *owner ; struct class_attribute *class_attrs ; struct device_attribute *dev_attrs ; struct bin_attribute *dev_bin_attrs ; struct kobject *dev_kobj ; int (*dev_uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , mode_t * ) ; void (*class_release)(struct class * ) ; void (*dev_release)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct kobj_ns_type_operations const *ns_type ; void const *(*namespace)(struct device * ) ; struct dev_pm_ops const *pm ; struct subsys_private *p ; }; struct device_type; struct class_attribute { struct attribute attr ; ssize_t (*show)(struct class * , struct class_attribute * , char * ) ; ssize_t (*store)(struct class * , struct class_attribute * , char const * , size_t ) ; }; struct device_type { char const *name ; struct attribute_group const **groups ; int (*uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , mode_t * ) ; void (*release)(struct device * ) ; struct dev_pm_ops const *pm ; }; struct device_attribute { struct attribute attr ; ssize_t (*show)(struct device * , struct device_attribute * , char * ) ; ssize_t (*store)(struct device * , struct device_attribute * , char const * , size_t ) ; }; struct device_dma_parameters { unsigned int max_segment_size ; unsigned long segment_boundary_mask ; }; struct dma_coherent_mem; struct device { struct device *parent ; struct device_private *p ; struct kobject kobj ; char const *init_name ; struct device_type const *type ; struct mutex mutex ; struct bus_type *bus ; struct device_driver *driver ; void *platform_data ; struct dev_pm_info power ; struct dev_power_domain *pwr_domain ; int numa_node ; u64 *dma_mask ; u64 coherent_dma_mask ; struct device_dma_parameters *dma_parms ; struct list_head dma_pools ; struct dma_coherent_mem *dma_mem ; struct dev_archdata archdata ; struct device_node *of_node ; dev_t devt ; spinlock_t devres_lock ; struct list_head devres_head ; struct klist_node knode_class ; struct class *class ; struct attribute_group const **groups ; void (*release)(struct device * ) ; }; struct wakeup_source { char *name ; struct list_head entry ; spinlock_t lock ; struct timer_list timer ; unsigned long timer_expires ; ktime_t total_time ; ktime_t max_time ; ktime_t last_time ; unsigned long event_count ; unsigned long active_count ; unsigned long relax_count ; unsigned long hit_count ; unsigned char active : 1 ; }; struct dma_attrs { unsigned long flags[1U] ; }; struct scatterlist { unsigned long sg_magic ; unsigned long page_link ; unsigned int offset ; unsigned int length ; dma_addr_t dma_address ; unsigned int dma_length ; }; struct file_ra_state; struct user_struct; struct writeback_control; struct vm_fault { unsigned int flags ; unsigned long pgoff ; void *virtual_address ; struct page *page ; }; struct vm_operations_struct { void (*open)(struct vm_area_struct * ) ; void (*close)(struct vm_area_struct * ) ; int (*fault)(struct vm_area_struct * , struct vm_fault * ) ; int (*page_mkwrite)(struct vm_area_struct * , struct vm_fault * ) ; int (*access)(struct vm_area_struct * , unsigned long , void * , int , int ) ; int (*set_policy)(struct vm_area_struct * , struct mempolicy * ) ; struct mempolicy *(*get_policy)(struct vm_area_struct * , unsigned long ) ; int (*migrate)(struct vm_area_struct * , nodemask_t const * , nodemask_t const * , unsigned long ) ; }; enum dma_data_direction { DMA_BIDIRECTIONAL = 0, DMA_TO_DEVICE = 1, DMA_FROM_DEVICE = 2, DMA_NONE = 3 } ; struct dma_map_ops { void *(*alloc_coherent)(struct device * , size_t , dma_addr_t * , gfp_t ) ; void (*free_coherent)(struct device * , size_t , void * , dma_addr_t ) ; dma_addr_t (*map_page)(struct device * , struct page * , unsigned long , size_t , enum dma_data_direction , struct dma_attrs * ) ; void (*unmap_page)(struct device * , dma_addr_t , size_t , enum dma_data_direction , struct dma_attrs * ) ; int (*map_sg)(struct device * , struct scatterlist * , int , enum dma_data_direction , struct dma_attrs * ) ; void (*unmap_sg)(struct device * , struct scatterlist * , int , enum dma_data_direction , struct dma_attrs * ) ; void (*sync_single_for_cpu)(struct device * , dma_addr_t , size_t , enum dma_data_direction ) ; void (*sync_single_for_device)(struct device * , dma_addr_t , size_t , enum dma_data_direction ) ; void (*sync_sg_for_cpu)(struct device * , struct scatterlist * , int , enum dma_data_direction ) ; void (*sync_sg_for_device)(struct device * , struct scatterlist * , int , enum dma_data_direction ) ; int (*mapping_error)(struct device * , dma_addr_t ) ; int (*dma_supported)(struct device * , u64 ) ; int (*set_dma_mask)(struct device * , u64 ) ; int is_phys ; }; typedef s32 dma_cookie_t; struct timerqueue_node { struct rb_node node ; ktime_t expires ; }; struct timerqueue_head { struct rb_root head ; struct timerqueue_node *next ; }; struct hrtimer_clock_base; struct hrtimer_cpu_base; enum hrtimer_restart { HRTIMER_NORESTART = 0, HRTIMER_RESTART = 1 } ; struct hrtimer { struct timerqueue_node node ; ktime_t _softexpires ; enum hrtimer_restart (*function)(struct hrtimer * ) ; struct hrtimer_clock_base *base ; unsigned long state ; int start_pid ; void *start_site ; char start_comm[16U] ; }; struct hrtimer_clock_base { struct hrtimer_cpu_base *cpu_base ; int index ; clockid_t clockid ; struct timerqueue_head active ; ktime_t resolution ; ktime_t (*get_time)(void) ; ktime_t softirq_time ; ktime_t offset ; }; struct hrtimer_cpu_base { raw_spinlock_t lock ; unsigned long active_bases ; ktime_t expires_next ; int hres_active ; int hang_detected ; unsigned long nr_events ; unsigned long nr_retries ; unsigned long nr_hangs ; ktime_t max_hang_time ; struct hrtimer_clock_base clock_base[3U] ; }; struct net_device; struct nf_conntrack { atomic_t use ; }; struct nf_bridge_info { atomic_t use ; struct net_device *physindev ; struct net_device *physoutdev ; unsigned int mask ; unsigned long data[4U] ; }; struct sk_buff_head { struct sk_buff *next ; struct sk_buff *prev ; __u32 qlen ; spinlock_t lock ; }; typedef unsigned int sk_buff_data_t; struct sec_path; struct __anonstruct_ldv_19611_150 { __u16 csum_start ; __u16 csum_offset ; }; union __anonunion_ldv_19612_149 { __wsum csum ; struct __anonstruct_ldv_19611_150 ldv_19611 ; }; union __anonunion_ldv_19642_151 { __u32 mark ; __u32 dropcount ; }; struct sk_buff { struct sk_buff *next ; struct sk_buff *prev ; ktime_t tstamp ; struct sock *sk ; struct net_device *dev ; char cb[48U] ; unsigned long _skb_refdst ; struct sec_path *sp ; unsigned int len ; unsigned int data_len ; __u16 mac_len ; __u16 hdr_len ; union __anonunion_ldv_19612_149 ldv_19612 ; __u32 priority ; unsigned char local_df : 1 ; unsigned char cloned : 1 ; unsigned char ip_summed : 2 ; unsigned char nohdr : 1 ; unsigned char nfctinfo : 3 ; unsigned char pkt_type : 3 ; unsigned char fclone : 2 ; unsigned char ipvs_property : 1 ; unsigned char peeked : 1 ; unsigned char nf_trace : 1 ; __be16 protocol ; void (*destructor)(struct sk_buff * ) ; struct nf_conntrack *nfct ; struct sk_buff *nfct_reasm ; struct nf_bridge_info *nf_bridge ; int skb_iif ; __u16 tc_index ; __u16 tc_verd ; __u32 rxhash ; __u16 queue_mapping ; unsigned char ndisc_nodetype : 2 ; unsigned char ooo_okay : 1 ; dma_cookie_t dma_cookie ; __u32 secmark ; union __anonunion_ldv_19642_151 ldv_19642 ; __u16 vlan_tci ; sk_buff_data_t transport_header ; sk_buff_data_t network_header ; sk_buff_data_t mac_header ; sk_buff_data_t tail ; sk_buff_data_t end ; unsigned char *head ; unsigned char *data ; unsigned int truesize ; atomic_t users ; }; struct dst_entry; struct rtable; struct nlattr { __u16 nla_len ; __u16 nla_type ; }; struct kernel_cap_struct { __u32 cap[2U] ; }; typedef struct kernel_cap_struct kernel_cap_t; struct dentry; struct user_namespace; struct rtnl_link_stats64 { __u64 rx_packets ; __u64 tx_packets ; __u64 rx_bytes ; __u64 tx_bytes ; __u64 rx_errors ; __u64 tx_errors ; __u64 rx_dropped ; __u64 tx_dropped ; __u64 multicast ; __u64 collisions ; __u64 rx_length_errors ; __u64 rx_over_errors ; __u64 rx_crc_errors ; __u64 rx_frame_errors ; __u64 rx_fifo_errors ; __u64 rx_missed_errors ; __u64 tx_aborted_errors ; __u64 tx_carrier_errors ; __u64 tx_fifo_errors ; __u64 tx_heartbeat_errors ; __u64 tx_window_errors ; __u64 rx_compressed ; __u64 tx_compressed ; }; struct ifla_vf_info { __u32 vf ; __u8 mac[32U] ; __u32 vlan ; __u32 qos ; __u32 tx_rate ; }; struct plist_head { struct list_head node_list ; raw_spinlock_t *rawlock ; spinlock_t *spinlock ; }; struct plist_node { int prio ; struct list_head prio_list ; struct list_head node_list ; }; struct file_operations; struct pm_qos_request_list { struct plist_node list ; int pm_qos_class ; }; struct sem_undo_list; struct sem_undo_list { atomic_t refcnt ; spinlock_t lock ; struct list_head list_proc ; }; struct sysv_sem { struct sem_undo_list *undo_list ; }; struct bio; struct bio_integrity_payload; struct block_device; typedef void bio_end_io_t(struct bio * , int ); typedef void bio_destructor_t(struct bio * ); struct bio_vec { struct page *bv_page ; unsigned int bv_len ; unsigned int bv_offset ; }; struct bio { sector_t bi_sector ; struct bio *bi_next ; struct block_device *bi_bdev ; unsigned long bi_flags ; unsigned long bi_rw ; unsigned short bi_vcnt ; unsigned short bi_idx ; unsigned int bi_phys_segments ; unsigned int bi_size ; unsigned int bi_seg_front_size ; unsigned int bi_seg_back_size ; unsigned int bi_max_vecs ; unsigned int bi_comp_cpu ; atomic_t bi_cnt ; struct bio_vec *bi_io_vec ; bio_end_io_t *bi_end_io ; void *bi_private ; struct bio_integrity_payload *bi_integrity ; bio_destructor_t *bi_destructor ; struct bio_vec bi_inline_vecs[0U] ; }; struct hlist_bl_node; struct hlist_bl_head { struct hlist_bl_node *first ; }; struct hlist_bl_node { struct hlist_bl_node *next ; struct hlist_bl_node **pprev ; }; struct nameidata; struct path; struct vfsmount; struct qstr { unsigned int hash ; unsigned int len ; unsigned char const *name ; }; struct dentry_operations; struct super_block; union __anonunion_d_u_153 { struct list_head d_child ; struct rcu_head d_rcu ; }; struct dentry { unsigned int d_flags ; seqcount_t d_seq ; struct hlist_bl_node d_hash ; struct dentry *d_parent ; struct qstr d_name ; struct inode *d_inode ; unsigned char d_iname[32U] ; unsigned int d_count ; spinlock_t d_lock ; struct dentry_operations const *d_op ; struct super_block *d_sb ; unsigned long d_time ; void *d_fsdata ; struct list_head d_lru ; union __anonunion_d_u_153 d_u ; struct list_head d_subdirs ; struct list_head d_alias ; }; struct dentry_operations { int (*d_revalidate)(struct dentry * , struct nameidata * ) ; int (*d_hash)(struct dentry const * , struct inode const * , struct qstr * ) ; int (*d_compare)(struct dentry const * , struct inode const * , struct dentry const * , struct inode const * , unsigned int , char const * , struct qstr const * ) ; int (*d_delete)(struct dentry const * ) ; void (*d_release)(struct dentry * ) ; void (*d_iput)(struct dentry * , struct inode * ) ; char *(*d_dname)(struct dentry * , char * , int ) ; struct vfsmount *(*d_automount)(struct path * ) ; int (*d_manage)(struct dentry * , bool ) ; }; struct path { struct vfsmount *mnt ; struct dentry *dentry ; }; struct radix_tree_node; struct radix_tree_root { unsigned int height ; gfp_t gfp_mask ; struct radix_tree_node *rnode ; }; enum pid_type { PIDTYPE_PID = 0, PIDTYPE_PGID = 1, PIDTYPE_SID = 2, PIDTYPE_MAX = 3 } ; struct pid_namespace; struct upid { int nr ; struct pid_namespace *ns ; struct hlist_node pid_chain ; }; struct pid { atomic_t count ; unsigned int level ; struct hlist_head tasks[3U] ; struct rcu_head rcu ; struct upid numbers[1U] ; }; struct pid_link { struct hlist_node node ; struct pid *pid ; }; struct semaphore { spinlock_t lock ; unsigned int count ; struct list_head wait_list ; }; struct fiemap_extent { __u64 fe_logical ; __u64 fe_physical ; __u64 fe_length ; __u64 fe_reserved64[2U] ; __u32 fe_flags ; __u32 fe_reserved[3U] ; }; struct export_operations; struct hd_geometry; struct kstatfs; struct iattr { unsigned int ia_valid ; umode_t ia_mode ; uid_t ia_uid ; gid_t ia_gid ; loff_t ia_size ; struct timespec ia_atime ; struct timespec ia_mtime ; struct timespec ia_ctime ; struct file *ia_file ; }; struct if_dqinfo { __u64 dqi_bgrace ; __u64 dqi_igrace ; __u32 dqi_flags ; __u32 dqi_valid ; }; struct percpu_counter { spinlock_t lock ; s64 count ; struct list_head list ; s32 *counters ; }; struct fs_disk_quota { __s8 d_version ; __s8 d_flags ; __u16 d_fieldmask ; __u32 d_id ; __u64 d_blk_hardlimit ; __u64 d_blk_softlimit ; __u64 d_ino_hardlimit ; __u64 d_ino_softlimit ; __u64 d_bcount ; __u64 d_icount ; __s32 d_itimer ; __s32 d_btimer ; __u16 d_iwarns ; __u16 d_bwarns ; __s32 d_padding2 ; __u64 d_rtb_hardlimit ; __u64 d_rtb_softlimit ; __u64 d_rtbcount ; __s32 d_rtbtimer ; __u16 d_rtbwarns ; __s16 d_padding3 ; char d_padding4[8U] ; }; struct fs_qfilestat { __u64 qfs_ino ; __u64 qfs_nblks ; __u32 qfs_nextents ; }; typedef struct fs_qfilestat fs_qfilestat_t; struct fs_quota_stat { __s8 qs_version ; __u16 qs_flags ; __s8 qs_pad ; fs_qfilestat_t qs_uquota ; fs_qfilestat_t qs_gquota ; __u32 qs_incoredqs ; __s32 qs_btimelimit ; __s32 qs_itimelimit ; __s32 qs_rtbtimelimit ; __u16 qs_bwarnlimit ; __u16 qs_iwarnlimit ; }; struct dquot; typedef __kernel_uid32_t qid_t; typedef long long qsize_t; struct mem_dqblk { qsize_t dqb_bhardlimit ; qsize_t dqb_bsoftlimit ; qsize_t dqb_curspace ; qsize_t dqb_rsvspace ; qsize_t dqb_ihardlimit ; qsize_t dqb_isoftlimit ; qsize_t dqb_curinodes ; time_t dqb_btime ; time_t dqb_itime ; }; struct quota_format_type; struct mem_dqinfo { struct quota_format_type *dqi_format ; int dqi_fmt_id ; struct list_head dqi_dirty_list ; unsigned long dqi_flags ; unsigned int dqi_bgrace ; unsigned int dqi_igrace ; qsize_t dqi_maxblimit ; qsize_t dqi_maxilimit ; void *dqi_priv ; }; struct dquot { struct hlist_node dq_hash ; struct list_head dq_inuse ; struct list_head dq_free ; struct list_head dq_dirty ; struct mutex dq_lock ; atomic_t dq_count ; wait_queue_head_t dq_wait_unused ; struct super_block *dq_sb ; unsigned int dq_id ; loff_t dq_off ; unsigned long dq_flags ; short dq_type ; struct mem_dqblk dq_dqb ; }; struct quota_format_ops { int (*check_quota_file)(struct super_block * , int ) ; int (*read_file_info)(struct super_block * , int ) ; int (*write_file_info)(struct super_block * , int ) ; int (*free_file_info)(struct super_block * , int ) ; int (*read_dqblk)(struct dquot * ) ; int (*commit_dqblk)(struct dquot * ) ; int (*release_dqblk)(struct dquot * ) ; }; struct dquot_operations { int (*write_dquot)(struct dquot * ) ; struct dquot *(*alloc_dquot)(struct super_block * , int ) ; void (*destroy_dquot)(struct dquot * ) ; int (*acquire_dquot)(struct dquot * ) ; int (*release_dquot)(struct dquot * ) ; int (*mark_dirty)(struct dquot * ) ; int (*write_info)(struct super_block * , int ) ; qsize_t *(*get_reserved_space)(struct inode * ) ; }; struct quotactl_ops { int (*quota_on)(struct super_block * , int , int , struct path * ) ; int (*quota_on_meta)(struct super_block * , int , int ) ; int (*quota_off)(struct super_block * , int ) ; int (*quota_sync)(struct super_block * , int , int ) ; int (*get_info)(struct super_block * , int , struct if_dqinfo * ) ; int (*set_info)(struct super_block * , int , struct if_dqinfo * ) ; int (*get_dqblk)(struct super_block * , int , qid_t , struct fs_disk_quota * ) ; int (*set_dqblk)(struct super_block * , int , qid_t , struct fs_disk_quota * ) ; int (*get_xstate)(struct super_block * , struct fs_quota_stat * ) ; int (*set_xstate)(struct super_block * , unsigned int , int ) ; }; struct quota_format_type { int qf_fmt_id ; struct quota_format_ops const *qf_ops ; struct module *qf_owner ; struct quota_format_type *qf_next ; }; struct quota_info { unsigned int flags ; struct mutex dqio_mutex ; struct mutex dqonoff_mutex ; struct rw_semaphore dqptr_sem ; struct inode *files[2U] ; struct mem_dqinfo info[2U] ; struct quota_format_ops const *ops[2U] ; }; union __anonunion_arg_155 { char *buf ; void *data ; }; struct __anonstruct_read_descriptor_t_154 { size_t written ; size_t count ; union __anonunion_arg_155 arg ; int error ; }; typedef struct __anonstruct_read_descriptor_t_154 read_descriptor_t; struct address_space_operations { int (*writepage)(struct page * , struct writeback_control * ) ; int (*readpage)(struct file * , struct page * ) ; int (*writepages)(struct address_space * , struct writeback_control * ) ; int (*set_page_dirty)(struct page * ) ; int (*readpages)(struct file * , struct address_space * , struct list_head * , unsigned int ) ; int (*write_begin)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page ** , void ** ) ; int (*write_end)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page * , void * ) ; sector_t (*bmap)(struct address_space * , sector_t ) ; void (*invalidatepage)(struct page * , unsigned long ) ; int (*releasepage)(struct page * , gfp_t ) ; void (*freepage)(struct page * ) ; ssize_t (*direct_IO)(int , struct kiocb * , struct iovec const * , loff_t , unsigned long ) ; int (*get_xip_mem)(struct address_space * , unsigned long , int , void ** , unsigned long * ) ; int (*migratepage)(struct address_space * , struct page * , struct page * ) ; int (*launder_page)(struct page * ) ; int (*is_partially_uptodate)(struct page * , read_descriptor_t * , unsigned long ) ; int (*error_remove_page)(struct address_space * , struct page * ) ; }; struct backing_dev_info; struct address_space { struct inode *host ; struct radix_tree_root page_tree ; spinlock_t tree_lock ; unsigned int i_mmap_writable ; struct prio_tree_root i_mmap ; struct list_head i_mmap_nonlinear ; struct mutex i_mmap_mutex ; unsigned long nrpages ; unsigned long writeback_index ; struct address_space_operations const *a_ops ; unsigned long flags ; struct backing_dev_info *backing_dev_info ; spinlock_t private_lock ; struct list_head private_list ; struct address_space *assoc_mapping ; }; struct hd_struct; struct gendisk; struct block_device { dev_t bd_dev ; int bd_openers ; struct inode *bd_inode ; struct super_block *bd_super ; struct mutex bd_mutex ; struct list_head bd_inodes ; void *bd_claiming ; void *bd_holder ; int bd_holders ; bool bd_write_holder ; struct list_head bd_holder_disks ; struct block_device *bd_contains ; unsigned int bd_block_size ; struct hd_struct *bd_part ; unsigned int bd_part_count ; int bd_invalidated ; struct gendisk *bd_disk ; struct list_head bd_list ; unsigned long bd_private ; int bd_fsfreeze_count ; struct mutex bd_fsfreeze_mutex ; }; struct posix_acl; struct inode_operations; union __anonunion_ldv_22586_156 { struct list_head i_dentry ; struct rcu_head i_rcu ; }; struct file_lock; struct cdev; union __anonunion_ldv_22612_157 { struct pipe_inode_info *i_pipe ; struct block_device *i_bdev ; struct cdev *i_cdev ; }; struct inode { umode_t i_mode ; uid_t i_uid ; gid_t i_gid ; struct inode_operations const *i_op ; struct super_block *i_sb ; spinlock_t i_lock ; unsigned int i_flags ; unsigned long i_state ; void *i_security ; struct mutex i_mutex ; unsigned long dirtied_when ; struct hlist_node i_hash ; struct list_head i_wb_list ; struct list_head i_lru ; struct list_head i_sb_list ; union __anonunion_ldv_22586_156 ldv_22586 ; unsigned long i_ino ; atomic_t i_count ; unsigned int i_nlink ; dev_t i_rdev ; unsigned int i_blkbits ; u64 i_version ; loff_t i_size ; struct timespec i_atime ; struct timespec i_mtime ; struct timespec i_ctime ; blkcnt_t i_blocks ; unsigned short i_bytes ; struct rw_semaphore i_alloc_sem ; struct file_operations const *i_fop ; struct file_lock *i_flock ; struct address_space *i_mapping ; struct address_space i_data ; struct dquot *i_dquot[2U] ; struct list_head i_devices ; union __anonunion_ldv_22612_157 ldv_22612 ; __u32 i_generation ; __u32 i_fsnotify_mask ; struct hlist_head i_fsnotify_marks ; atomic_t i_readcount ; atomic_t i_writecount ; struct posix_acl *i_acl ; struct posix_acl *i_default_acl ; void *i_private ; }; struct fown_struct { rwlock_t lock ; struct pid *pid ; enum pid_type pid_type ; uid_t uid ; uid_t euid ; int signum ; }; struct file_ra_state { unsigned long start ; unsigned int size ; unsigned int async_size ; unsigned int ra_pages ; unsigned int mmap_miss ; loff_t prev_pos ; }; union __anonunion_f_u_158 { struct list_head fu_list ; struct rcu_head fu_rcuhead ; }; struct file { union __anonunion_f_u_158 f_u ; struct path f_path ; struct file_operations const *f_op ; spinlock_t f_lock ; int f_sb_list_cpu ; atomic_long_t f_count ; unsigned int f_flags ; fmode_t f_mode ; loff_t f_pos ; struct fown_struct f_owner ; struct cred const *f_cred ; struct file_ra_state f_ra ; u64 f_version ; void *f_security ; void *private_data ; struct list_head f_ep_links ; struct address_space *f_mapping ; unsigned long f_mnt_write_state ; }; struct files_struct; typedef struct files_struct *fl_owner_t; struct file_lock_operations { void (*fl_copy_lock)(struct file_lock * , struct file_lock * ) ; void (*fl_release_private)(struct file_lock * ) ; }; struct lock_manager_operations { int (*fl_compare_owner)(struct file_lock * , struct file_lock * ) ; void (*fl_notify)(struct file_lock * ) ; int (*fl_grant)(struct file_lock * , struct file_lock * , int ) ; void (*fl_release_private)(struct file_lock * ) ; void (*fl_break)(struct file_lock * ) ; int (*fl_change)(struct file_lock ** , int ) ; }; struct nlm_lockowner; struct nfs_lock_info { u32 state ; struct nlm_lockowner *owner ; struct list_head list ; }; struct nfs4_lock_state; struct nfs4_lock_info { struct nfs4_lock_state *owner ; }; struct __anonstruct_afs_160 { struct list_head link ; int state ; }; union __anonunion_fl_u_159 { struct nfs_lock_info nfs_fl ; struct nfs4_lock_info nfs4_fl ; struct __anonstruct_afs_160 afs ; }; struct file_lock { struct file_lock *fl_next ; struct list_head fl_link ; struct list_head fl_block ; fl_owner_t fl_owner ; unsigned char fl_flags ; unsigned char fl_type ; unsigned int fl_pid ; struct pid *fl_nspid ; wait_queue_head_t fl_wait ; struct file *fl_file ; loff_t fl_start ; loff_t fl_end ; struct fasync_struct *fl_fasync ; unsigned long fl_break_time ; struct file_lock_operations const *fl_ops ; struct lock_manager_operations const *fl_lmops ; union __anonunion_fl_u_159 fl_u ; }; struct fasync_struct { spinlock_t fa_lock ; int magic ; int fa_fd ; struct fasync_struct *fa_next ; struct file *fa_file ; struct rcu_head fa_rcu ; }; struct file_system_type; struct super_operations; struct xattr_handler; struct mtd_info; struct super_block { struct list_head s_list ; dev_t s_dev ; unsigned char s_dirt ; unsigned char s_blocksize_bits ; unsigned long s_blocksize ; loff_t s_maxbytes ; struct file_system_type *s_type ; struct super_operations const *s_op ; struct dquot_operations const *dq_op ; struct quotactl_ops const *s_qcop ; struct export_operations const *s_export_op ; unsigned long s_flags ; unsigned long s_magic ; struct dentry *s_root ; struct rw_semaphore s_umount ; struct mutex s_lock ; int s_count ; atomic_t s_active ; void *s_security ; struct xattr_handler const **s_xattr ; struct list_head s_inodes ; struct hlist_bl_head s_anon ; struct list_head *s_files ; struct list_head s_dentry_lru ; int s_nr_dentry_unused ; struct block_device *s_bdev ; struct backing_dev_info *s_bdi ; struct mtd_info *s_mtd ; struct list_head s_instances ; struct quota_info s_dquot ; int s_frozen ; wait_queue_head_t s_wait_unfrozen ; char s_id[32U] ; u8 s_uuid[16U] ; void *s_fs_info ; fmode_t s_mode ; u32 s_time_gran ; struct mutex s_vfs_rename_mutex ; char *s_subtype ; char *s_options ; struct dentry_operations const *s_d_op ; int cleancache_poolid ; }; struct fiemap_extent_info { unsigned int fi_flags ; unsigned int fi_extents_mapped ; unsigned int fi_extents_max ; struct fiemap_extent *fi_extents_start ; }; struct block_device_operations; struct file_operations { struct module *owner ; loff_t (*llseek)(struct file * , loff_t , int ) ; ssize_t (*read)(struct file * , char * , size_t , loff_t * ) ; ssize_t (*write)(struct file * , char const * , size_t , loff_t * ) ; ssize_t (*aio_read)(struct kiocb * , struct iovec const * , unsigned long , loff_t ) ; ssize_t (*aio_write)(struct kiocb * , struct iovec const * , unsigned long , loff_t ) ; int (*readdir)(struct file * , void * , int (*)(void * , char const * , int , loff_t , u64 , unsigned int ) ) ; unsigned int (*poll)(struct file * , struct poll_table_struct * ) ; long (*unlocked_ioctl)(struct file * , unsigned int , unsigned long ) ; long (*compat_ioctl)(struct file * , unsigned int , unsigned long ) ; int (*mmap)(struct file * , struct vm_area_struct * ) ; int (*open)(struct inode * , struct file * ) ; int (*flush)(struct file * , fl_owner_t ) ; int (*release)(struct inode * , struct file * ) ; int (*fsync)(struct file * , int ) ; int (*aio_fsync)(struct kiocb * , int ) ; int (*fasync)(int , struct file * , int ) ; int (*lock)(struct file * , int , struct file_lock * ) ; ssize_t (*sendpage)(struct file * , struct page * , int , size_t , loff_t * , int ) ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; int (*check_flags)(int ) ; int (*flock)(struct file * , int , struct file_lock * ) ; ssize_t (*splice_write)(struct pipe_inode_info * , struct file * , loff_t * , size_t , unsigned int ) ; ssize_t (*splice_read)(struct file * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ) ; int (*setlease)(struct file * , long , struct file_lock ** ) ; long (*fallocate)(struct file * , int , loff_t , loff_t ) ; }; struct inode_operations { struct dentry *(*lookup)(struct inode * , struct dentry * , struct nameidata * ) ; void *(*follow_link)(struct dentry * , struct nameidata * ) ; int (*permission)(struct inode * , int , unsigned int ) ; int (*check_acl)(struct inode * , int , unsigned int ) ; int (*readlink)(struct dentry * , char * , int ) ; void (*put_link)(struct dentry * , struct nameidata * , void * ) ; int (*create)(struct inode * , struct dentry * , int , struct nameidata * ) ; int (*link)(struct dentry * , struct inode * , struct dentry * ) ; int (*unlink)(struct inode * , struct dentry * ) ; int (*symlink)(struct inode * , struct dentry * , char const * ) ; int (*mkdir)(struct inode * , struct dentry * , int ) ; int (*rmdir)(struct inode * , struct dentry * ) ; int (*mknod)(struct inode * , struct dentry * , int , dev_t ) ; int (*rename)(struct inode * , struct dentry * , struct inode * , struct dentry * ) ; void (*truncate)(struct inode * ) ; int (*setattr)(struct dentry * , struct iattr * ) ; int (*getattr)(struct vfsmount * , struct dentry * , struct kstat * ) ; int (*setxattr)(struct dentry * , char const * , void const * , size_t , int ) ; ssize_t (*getxattr)(struct dentry * , char const * , void * , size_t ) ; ssize_t (*listxattr)(struct dentry * , char * , size_t ) ; int (*removexattr)(struct dentry * , char const * ) ; void (*truncate_range)(struct inode * , loff_t , loff_t ) ; int (*fiemap)(struct inode * , struct fiemap_extent_info * , u64 , u64 ) ; }; struct super_operations { struct inode *(*alloc_inode)(struct super_block * ) ; void (*destroy_inode)(struct inode * ) ; void (*dirty_inode)(struct inode * , int ) ; int (*write_inode)(struct inode * , struct writeback_control * ) ; int (*drop_inode)(struct inode * ) ; void (*evict_inode)(struct inode * ) ; void (*put_super)(struct super_block * ) ; void (*write_super)(struct super_block * ) ; int (*sync_fs)(struct super_block * , int ) ; int (*freeze_fs)(struct super_block * ) ; int (*unfreeze_fs)(struct super_block * ) ; int (*statfs)(struct dentry * , struct kstatfs * ) ; int (*remount_fs)(struct super_block * , int * , char * ) ; void (*umount_begin)(struct super_block * ) ; int (*show_options)(struct seq_file * , struct vfsmount * ) ; int (*show_devname)(struct seq_file * , struct vfsmount * ) ; int (*show_path)(struct seq_file * , struct vfsmount * ) ; int (*show_stats)(struct seq_file * , struct vfsmount * ) ; ssize_t (*quota_read)(struct super_block * , int , char * , size_t , loff_t ) ; ssize_t (*quota_write)(struct super_block * , int , char const * , size_t , loff_t ) ; int (*bdev_try_to_free_page)(struct super_block * , struct page * , gfp_t ) ; }; struct file_system_type { char const *name ; int fs_flags ; struct dentry *(*mount)(struct file_system_type * , int , char const * , void * ) ; void (*kill_sb)(struct super_block * ) ; struct module *owner ; struct file_system_type *next ; struct list_head fs_supers ; struct lock_class_key s_lock_key ; struct lock_class_key s_umount_key ; struct lock_class_key s_vfs_rename_key ; struct lock_class_key i_lock_key ; struct lock_class_key i_mutex_key ; struct lock_class_key i_mutex_dir_key ; struct lock_class_key i_alloc_sem_key ; }; struct io_event { __u64 data ; __u64 obj ; __s64 res ; __s64 res2 ; }; typedef unsigned long cputime_t; struct siginfo; struct __anonstruct_sigset_t_161 { unsigned long sig[1U] ; }; typedef struct __anonstruct_sigset_t_161 sigset_t; typedef void __signalfn_t(int ); typedef __signalfn_t *__sighandler_t; typedef void __restorefn_t(void); typedef __restorefn_t *__sigrestore_t; struct sigaction { __sighandler_t sa_handler ; unsigned long sa_flags ; __sigrestore_t sa_restorer ; sigset_t sa_mask ; }; struct k_sigaction { struct sigaction sa ; }; union sigval { int sival_int ; void *sival_ptr ; }; typedef union sigval sigval_t; struct __anonstruct__kill_163 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; }; struct __anonstruct__timer_164 { __kernel_timer_t _tid ; int _overrun ; char _pad[0U] ; sigval_t _sigval ; int _sys_private ; }; struct __anonstruct__rt_165 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; sigval_t _sigval ; }; struct __anonstruct__sigchld_166 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; int _status ; __kernel_clock_t _utime ; __kernel_clock_t _stime ; }; struct __anonstruct__sigfault_167 { void *_addr ; short _addr_lsb ; }; struct __anonstruct__sigpoll_168 { long _band ; int _fd ; }; union __anonunion__sifields_162 { int _pad[28U] ; struct __anonstruct__kill_163 _kill ; struct __anonstruct__timer_164 _timer ; struct __anonstruct__rt_165 _rt ; struct __anonstruct__sigchld_166 _sigchld ; struct __anonstruct__sigfault_167 _sigfault ; struct __anonstruct__sigpoll_168 _sigpoll ; }; struct siginfo { int si_signo ; int si_errno ; int si_code ; union __anonunion__sifields_162 _sifields ; }; typedef struct siginfo siginfo_t; struct sigpending { struct list_head list ; sigset_t signal ; }; struct prop_local_percpu { struct percpu_counter events ; int shift ; unsigned long period ; spinlock_t lock ; }; struct prop_local_single { unsigned long events ; unsigned long period ; int shift ; spinlock_t lock ; }; struct __anonstruct_seccomp_t_171 { int mode ; }; typedef struct __anonstruct_seccomp_t_171 seccomp_t; struct rt_mutex_waiter; struct rlimit { unsigned long rlim_cur ; unsigned long rlim_max ; }; struct task_io_accounting { u64 rchar ; u64 wchar ; u64 syscr ; u64 syscw ; u64 read_bytes ; u64 write_bytes ; u64 cancelled_write_bytes ; }; struct latency_record { unsigned long backtrace[12U] ; unsigned int count ; unsigned long time ; unsigned long max ; }; typedef int32_t key_serial_t; typedef uint32_t key_perm_t; struct key; struct signal_struct; struct key_type; struct keyring_list; struct key_user; union __anonunion_ldv_25166_172 { time_t expiry ; time_t revoked_at ; }; union __anonunion_type_data_173 { struct list_head link ; unsigned long x[2U] ; void *p[2U] ; int reject_error ; }; union __anonunion_payload_174 { unsigned long value ; void *rcudata ; void *data ; struct keyring_list *subscriptions ; }; struct key { atomic_t usage ; key_serial_t serial ; struct rb_node serial_node ; struct key_type *type ; struct rw_semaphore sem ; struct key_user *user ; void *security ; union __anonunion_ldv_25166_172 ldv_25166 ; uid_t uid ; gid_t gid ; key_perm_t perm ; unsigned short quotalen ; unsigned short datalen ; unsigned long flags ; char *description ; union __anonunion_type_data_173 type_data ; union __anonunion_payload_174 payload ; }; struct audit_context; struct group_info { atomic_t usage ; int ngroups ; int nblocks ; gid_t small_block[32U] ; gid_t *blocks[0U] ; }; struct thread_group_cred { atomic_t usage ; pid_t tgid ; spinlock_t lock ; struct key *session_keyring ; struct key *process_keyring ; struct rcu_head rcu ; }; struct cred { atomic_t usage ; atomic_t subscribers ; void *put_addr ; unsigned int magic ; uid_t uid ; gid_t gid ; uid_t suid ; gid_t sgid ; uid_t euid ; gid_t egid ; uid_t fsuid ; gid_t fsgid ; unsigned int securebits ; kernel_cap_t cap_inheritable ; kernel_cap_t cap_permitted ; kernel_cap_t cap_effective ; kernel_cap_t cap_bset ; unsigned char jit_keyring ; struct key *thread_keyring ; struct key *request_key_auth ; struct thread_group_cred *tgcred ; void *security ; struct user_struct *user ; struct user_namespace *user_ns ; struct group_info *group_info ; struct rcu_head rcu ; }; struct futex_pi_state; struct robust_list_head; struct bio_list; struct fs_struct; struct perf_event_context; struct blk_plug; struct cfs_rq; struct kioctx; union __anonunion_ki_obj_175 { void *user ; struct task_struct *tsk ; }; struct eventfd_ctx; struct kiocb { struct list_head ki_run_list ; unsigned long ki_flags ; int ki_users ; unsigned int ki_key ; struct file *ki_filp ; struct kioctx *ki_ctx ; int (*ki_cancel)(struct kiocb * , struct io_event * ) ; ssize_t (*ki_retry)(struct kiocb * ) ; void (*ki_dtor)(struct kiocb * ) ; union __anonunion_ki_obj_175 ki_obj ; __u64 ki_user_data ; loff_t ki_pos ; void *private ; unsigned short ki_opcode ; size_t ki_nbytes ; char *ki_buf ; size_t ki_left ; struct iovec ki_inline_vec ; struct iovec *ki_iovec ; unsigned long ki_nr_segs ; unsigned long ki_cur_seg ; struct list_head ki_list ; struct eventfd_ctx *ki_eventfd ; }; struct aio_ring_info { unsigned long mmap_base ; unsigned long mmap_size ; struct page **ring_pages ; spinlock_t ring_lock ; long nr_pages ; unsigned int nr ; unsigned int tail ; struct page *internal_pages[8U] ; }; struct kioctx { atomic_t users ; int dead ; struct mm_struct *mm ; unsigned long user_id ; struct hlist_node list ; wait_queue_head_t wait ; spinlock_t ctx_lock ; int reqs_active ; struct list_head active_reqs ; struct list_head run_list ; unsigned int max_reqs ; struct aio_ring_info ring_info ; struct delayed_work wq ; struct rcu_head rcu_head ; }; struct sighand_struct { atomic_t count ; struct k_sigaction action[64U] ; spinlock_t siglock ; wait_queue_head_t signalfd_wqh ; }; struct pacct_struct { int ac_flag ; long ac_exitcode ; unsigned long ac_mem ; cputime_t ac_utime ; cputime_t ac_stime ; unsigned long ac_minflt ; unsigned long ac_majflt ; }; struct cpu_itimer { cputime_t expires ; cputime_t incr ; u32 error ; u32 incr_error ; }; struct task_cputime { cputime_t utime ; cputime_t stime ; unsigned long long sum_exec_runtime ; }; struct thread_group_cputimer { struct task_cputime cputime ; int running ; spinlock_t lock ; }; struct autogroup; struct tty_struct; struct taskstats; struct tty_audit_buf; struct signal_struct { atomic_t sigcnt ; atomic_t live ; int nr_threads ; wait_queue_head_t wait_chldexit ; struct task_struct *curr_target ; struct sigpending shared_pending ; int group_exit_code ; int notify_count ; struct task_struct *group_exit_task ; int group_stop_count ; unsigned int flags ; struct list_head posix_timers ; struct hrtimer real_timer ; struct pid *leader_pid ; ktime_t it_real_incr ; struct cpu_itimer it[2U] ; struct thread_group_cputimer cputimer ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct pid *tty_old_pgrp ; int leader ; struct tty_struct *tty ; struct autogroup *autogroup ; cputime_t utime ; cputime_t stime ; cputime_t cutime ; cputime_t cstime ; cputime_t gtime ; cputime_t cgtime ; cputime_t prev_utime ; cputime_t prev_stime ; unsigned long nvcsw ; unsigned long nivcsw ; unsigned long cnvcsw ; unsigned long cnivcsw ; unsigned long min_flt ; unsigned long maj_flt ; unsigned long cmin_flt ; unsigned long cmaj_flt ; unsigned long inblock ; unsigned long oublock ; unsigned long cinblock ; unsigned long coublock ; unsigned long maxrss ; unsigned long cmaxrss ; struct task_io_accounting ioac ; unsigned long long sum_sched_runtime ; struct rlimit rlim[16U] ; struct pacct_struct pacct ; struct taskstats *stats ; unsigned int audit_tty ; struct tty_audit_buf *tty_audit_buf ; struct rw_semaphore threadgroup_fork_lock ; int oom_adj ; int oom_score_adj ; int oom_score_adj_min ; struct mutex cred_guard_mutex ; }; struct user_struct { atomic_t __count ; atomic_t processes ; atomic_t files ; atomic_t sigpending ; atomic_t inotify_watches ; atomic_t inotify_devs ; atomic_t fanotify_listeners ; atomic_long_t epoll_watches ; unsigned long mq_bytes ; unsigned long locked_shm ; struct key *uid_keyring ; struct key *session_keyring ; struct hlist_node uidhash_node ; uid_t uid ; struct user_namespace *user_ns ; atomic_long_t locked_vm ; }; struct reclaim_state; struct sched_info { unsigned long pcount ; unsigned long long run_delay ; unsigned long long last_arrival ; unsigned long long last_queued ; }; struct task_delay_info { spinlock_t lock ; unsigned int flags ; struct timespec blkio_start ; struct timespec blkio_end ; u64 blkio_delay ; u64 swapin_delay ; u32 blkio_count ; u32 swapin_count ; struct timespec freepages_start ; struct timespec freepages_end ; u64 freepages_delay ; u32 freepages_count ; }; struct io_context; struct rq; struct sched_class { struct sched_class const *next ; void (*enqueue_task)(struct rq * , struct task_struct * , int ) ; void (*dequeue_task)(struct rq * , struct task_struct * , int ) ; void (*yield_task)(struct rq * ) ; bool (*yield_to_task)(struct rq * , struct task_struct * , bool ) ; void (*check_preempt_curr)(struct rq * , struct task_struct * , int ) ; struct task_struct *(*pick_next_task)(struct rq * ) ; void (*put_prev_task)(struct rq * , struct task_struct * ) ; int (*select_task_rq)(struct task_struct * , int , int ) ; void (*pre_schedule)(struct rq * , struct task_struct * ) ; void (*post_schedule)(struct rq * ) ; void (*task_waking)(struct task_struct * ) ; void (*task_woken)(struct rq * , struct task_struct * ) ; void (*set_cpus_allowed)(struct task_struct * , struct cpumask const * ) ; void (*rq_online)(struct rq * ) ; void (*rq_offline)(struct rq * ) ; void (*set_curr_task)(struct rq * ) ; void (*task_tick)(struct rq * , struct task_struct * , int ) ; void (*task_fork)(struct task_struct * ) ; void (*switched_from)(struct rq * , struct task_struct * ) ; void (*switched_to)(struct rq * , struct task_struct * ) ; void (*prio_changed)(struct rq * , struct task_struct * , int ) ; unsigned int (*get_rr_interval)(struct rq * , struct task_struct * ) ; void (*task_move_group)(struct task_struct * , int ) ; }; struct load_weight { unsigned long weight ; unsigned long inv_weight ; }; struct sched_statistics { u64 wait_start ; u64 wait_max ; u64 wait_count ; u64 wait_sum ; u64 iowait_count ; u64 iowait_sum ; u64 sleep_start ; u64 sleep_max ; s64 sum_sleep_runtime ; u64 block_start ; u64 block_max ; u64 exec_max ; u64 slice_max ; u64 nr_migrations_cold ; u64 nr_failed_migrations_affine ; u64 nr_failed_migrations_running ; u64 nr_failed_migrations_hot ; u64 nr_forced_migrations ; u64 nr_wakeups ; u64 nr_wakeups_sync ; u64 nr_wakeups_migrate ; u64 nr_wakeups_local ; u64 nr_wakeups_remote ; u64 nr_wakeups_affine ; u64 nr_wakeups_affine_attempts ; u64 nr_wakeups_passive ; u64 nr_wakeups_idle ; }; struct sched_entity { struct load_weight load ; struct rb_node run_node ; struct list_head group_node ; unsigned int on_rq ; u64 exec_start ; u64 sum_exec_runtime ; u64 vruntime ; u64 prev_sum_exec_runtime ; u64 nr_migrations ; struct sched_statistics statistics ; struct sched_entity *parent ; struct cfs_rq *cfs_rq ; struct cfs_rq *my_q ; }; struct rt_rq; struct sched_rt_entity { struct list_head run_list ; unsigned long timeout ; unsigned int time_slice ; int nr_cpus_allowed ; struct sched_rt_entity *back ; struct sched_rt_entity *parent ; struct rt_rq *rt_rq ; struct rt_rq *my_q ; }; struct mem_cgroup; struct memcg_batch_info { int do_batch ; struct mem_cgroup *memcg ; unsigned long nr_pages ; unsigned long memsw_nr_pages ; }; struct irqaction; struct css_set; struct compat_robust_list_head; struct ftrace_ret_stack; struct task_struct { long volatile state ; void *stack ; atomic_t usage ; unsigned int flags ; unsigned int ptrace ; struct task_struct *wake_entry ; int on_cpu ; int on_rq ; int prio ; int static_prio ; int normal_prio ; unsigned int rt_priority ; struct sched_class const *sched_class ; struct sched_entity se ; struct sched_rt_entity rt ; struct hlist_head preempt_notifiers ; unsigned char fpu_counter ; unsigned int btrace_seq ; unsigned int policy ; cpumask_t cpus_allowed ; struct sched_info sched_info ; struct list_head tasks ; struct plist_node pushable_tasks ; struct mm_struct *mm ; struct mm_struct *active_mm ; unsigned char brk_randomized : 1 ; int exit_state ; int exit_code ; int exit_signal ; int pdeath_signal ; unsigned int group_stop ; unsigned int personality ; unsigned char did_exec : 1 ; unsigned char in_execve : 1 ; unsigned char in_iowait : 1 ; unsigned char sched_reset_on_fork : 1 ; unsigned char sched_contributes_to_load : 1 ; pid_t pid ; pid_t tgid ; unsigned long stack_canary ; struct task_struct *real_parent ; struct task_struct *parent ; struct list_head children ; struct list_head sibling ; struct task_struct *group_leader ; struct list_head ptraced ; struct list_head ptrace_entry ; struct pid_link pids[3U] ; struct list_head thread_group ; struct completion *vfork_done ; int *set_child_tid ; int *clear_child_tid ; cputime_t utime ; cputime_t stime ; cputime_t utimescaled ; cputime_t stimescaled ; cputime_t gtime ; cputime_t prev_utime ; cputime_t prev_stime ; unsigned long nvcsw ; unsigned long nivcsw ; struct timespec start_time ; struct timespec real_start_time ; unsigned long min_flt ; unsigned long maj_flt ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct cred const *real_cred ; struct cred const *cred ; struct cred *replacement_session_keyring ; char comm[16U] ; int link_count ; int total_link_count ; struct sysv_sem sysvsem ; unsigned long last_switch_count ; struct thread_struct thread ; struct fs_struct *fs ; struct files_struct *files ; struct nsproxy *nsproxy ; struct signal_struct *signal ; struct sighand_struct *sighand ; sigset_t blocked ; sigset_t real_blocked ; sigset_t saved_sigmask ; struct sigpending pending ; unsigned long sas_ss_sp ; size_t sas_ss_size ; int (*notifier)(void * ) ; void *notifier_data ; sigset_t *notifier_mask ; struct audit_context *audit_context ; uid_t loginuid ; unsigned int sessionid ; seccomp_t seccomp ; u32 parent_exec_id ; u32 self_exec_id ; spinlock_t alloc_lock ; struct irqaction *irqaction ; raw_spinlock_t pi_lock ; struct plist_head pi_waiters ; struct rt_mutex_waiter *pi_blocked_on ; struct mutex_waiter *blocked_on ; unsigned int irq_events ; unsigned long hardirq_enable_ip ; unsigned long hardirq_disable_ip ; unsigned int hardirq_enable_event ; unsigned int hardirq_disable_event ; int hardirqs_enabled ; int hardirq_context ; unsigned long softirq_disable_ip ; unsigned long softirq_enable_ip ; unsigned int softirq_disable_event ; unsigned int softirq_enable_event ; int softirqs_enabled ; int softirq_context ; u64 curr_chain_key ; int lockdep_depth ; unsigned int lockdep_recursion ; struct held_lock held_locks[48U] ; gfp_t lockdep_reclaim_gfp ; void *journal_info ; struct bio_list *bio_list ; struct blk_plug *plug ; struct reclaim_state *reclaim_state ; struct backing_dev_info *backing_dev_info ; struct io_context *io_context ; unsigned long ptrace_message ; siginfo_t *last_siginfo ; struct task_io_accounting ioac ; u64 acct_rss_mem1 ; u64 acct_vm_mem1 ; cputime_t acct_timexpd ; nodemask_t mems_allowed ; int mems_allowed_change_disable ; int cpuset_mem_spread_rotor ; int cpuset_slab_spread_rotor ; struct css_set *cgroups ; struct list_head cg_list ; struct robust_list_head *robust_list ; struct compat_robust_list_head *compat_robust_list ; struct list_head pi_state_list ; struct futex_pi_state *pi_state_cache ; struct perf_event_context *perf_event_ctxp[2U] ; struct mutex perf_event_mutex ; struct list_head perf_event_list ; struct mempolicy *mempolicy ; short il_next ; short pref_node_fork ; atomic_t fs_excl ; struct rcu_head rcu ; struct pipe_inode_info *splice_pipe ; struct task_delay_info *delays ; int make_it_fail ; struct prop_local_single dirties ; int latency_record_count ; struct latency_record latency_record[32U] ; unsigned long timer_slack_ns ; unsigned long default_timer_slack_ns ; struct list_head *scm_work_list ; int curr_ret_stack ; struct ftrace_ret_stack *ret_stack ; unsigned long long ftrace_timestamp ; atomic_t trace_overrun ; atomic_t tracing_graph_pause ; unsigned long trace ; unsigned long trace_recursion ; struct memcg_batch_info memcg_batch ; atomic_t ptrace_bp_refcnt ; }; typedef s32 compat_time_t; typedef s32 compat_long_t; struct compat_timespec { compat_time_t tv_sec ; s32 tv_nsec ; }; typedef u32 compat_uptr_t; struct compat_robust_list { compat_uptr_t next ; }; struct compat_robust_list_head { struct compat_robust_list list ; compat_long_t futex_offset ; compat_uptr_t list_op_pending ; }; struct ethtool_cmd { __u32 cmd ; __u32 supported ; __u32 advertising ; __u16 speed ; __u8 duplex ; __u8 port ; __u8 phy_address ; __u8 transceiver ; __u8 autoneg ; __u8 mdio_support ; __u32 maxtxpkt ; __u32 maxrxpkt ; __u16 speed_hi ; __u8 eth_tp_mdix ; __u8 reserved2 ; __u32 lp_advertising ; __u32 reserved[2U] ; }; struct ethtool_drvinfo { __u32 cmd ; char driver[32U] ; char version[32U] ; char fw_version[32U] ; char bus_info[32U] ; char reserved1[32U] ; char reserved2[12U] ; __u32 n_priv_flags ; __u32 n_stats ; __u32 testinfo_len ; __u32 eedump_len ; __u32 regdump_len ; }; struct ethtool_wolinfo { __u32 cmd ; __u32 supported ; __u32 wolopts ; __u8 sopass[6U] ; }; struct ethtool_regs { __u32 cmd ; __u32 version ; __u32 len ; __u8 data[0U] ; }; struct ethtool_eeprom { __u32 cmd ; __u32 magic ; __u32 offset ; __u32 len ; __u8 data[0U] ; }; struct ethtool_coalesce { __u32 cmd ; __u32 rx_coalesce_usecs ; __u32 rx_max_coalesced_frames ; __u32 rx_coalesce_usecs_irq ; __u32 rx_max_coalesced_frames_irq ; __u32 tx_coalesce_usecs ; __u32 tx_max_coalesced_frames ; __u32 tx_coalesce_usecs_irq ; __u32 tx_max_coalesced_frames_irq ; __u32 stats_block_coalesce_usecs ; __u32 use_adaptive_rx_coalesce ; __u32 use_adaptive_tx_coalesce ; __u32 pkt_rate_low ; __u32 rx_coalesce_usecs_low ; __u32 rx_max_coalesced_frames_low ; __u32 tx_coalesce_usecs_low ; __u32 tx_max_coalesced_frames_low ; __u32 pkt_rate_high ; __u32 rx_coalesce_usecs_high ; __u32 rx_max_coalesced_frames_high ; __u32 tx_coalesce_usecs_high ; __u32 tx_max_coalesced_frames_high ; __u32 rate_sample_interval ; }; struct ethtool_ringparam { __u32 cmd ; __u32 rx_max_pending ; __u32 rx_mini_max_pending ; __u32 rx_jumbo_max_pending ; __u32 tx_max_pending ; __u32 rx_pending ; __u32 rx_mini_pending ; __u32 rx_jumbo_pending ; __u32 tx_pending ; }; struct ethtool_channels { __u32 cmd ; __u32 max_rx ; __u32 max_tx ; __u32 max_other ; __u32 max_combined ; __u32 rx_count ; __u32 tx_count ; __u32 other_count ; __u32 combined_count ; }; struct ethtool_pauseparam { __u32 cmd ; __u32 autoneg ; __u32 rx_pause ; __u32 tx_pause ; }; struct ethtool_test { __u32 cmd ; __u32 flags ; __u32 reserved ; __u32 len ; __u64 data[0U] ; }; struct ethtool_stats { __u32 cmd ; __u32 n_stats ; __u64 data[0U] ; }; struct ethtool_tcpip4_spec { __be32 ip4src ; __be32 ip4dst ; __be16 psrc ; __be16 pdst ; __u8 tos ; }; struct ethtool_ah_espip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 spi ; __u8 tos ; }; struct ethtool_usrip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 l4_4_bytes ; __u8 tos ; __u8 ip_ver ; __u8 proto ; }; union ethtool_flow_union { struct ethtool_tcpip4_spec tcp_ip4_spec ; struct ethtool_tcpip4_spec udp_ip4_spec ; struct ethtool_tcpip4_spec sctp_ip4_spec ; struct ethtool_ah_espip4_spec ah_ip4_spec ; struct ethtool_ah_espip4_spec esp_ip4_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; struct ethhdr ether_spec ; __u8 hdata[60U] ; }; struct ethtool_flow_ext { __be16 vlan_etype ; __be16 vlan_tci ; __be32 data[2U] ; }; struct ethtool_rx_flow_spec { __u32 flow_type ; union ethtool_flow_union h_u ; struct ethtool_flow_ext h_ext ; union ethtool_flow_union m_u ; struct ethtool_flow_ext m_ext ; __u64 ring_cookie ; __u32 location ; }; struct ethtool_rxnfc { __u32 cmd ; __u32 flow_type ; __u64 data ; struct ethtool_rx_flow_spec fs ; __u32 rule_cnt ; __u32 rule_locs[0U] ; }; struct ethtool_rxfh_indir { __u32 cmd ; __u32 size ; __u32 ring_index[0U] ; }; union __anonunion_h_u_182 { struct ethtool_tcpip4_spec tcp_ip4_spec ; struct ethtool_tcpip4_spec udp_ip4_spec ; struct ethtool_tcpip4_spec sctp_ip4_spec ; struct ethtool_ah_espip4_spec ah_ip4_spec ; struct ethtool_ah_espip4_spec esp_ip4_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; struct ethhdr ether_spec ; __u8 hdata[72U] ; }; union __anonunion_m_u_183 { struct ethtool_tcpip4_spec tcp_ip4_spec ; struct ethtool_tcpip4_spec udp_ip4_spec ; struct ethtool_tcpip4_spec sctp_ip4_spec ; struct ethtool_ah_espip4_spec ah_ip4_spec ; struct ethtool_ah_espip4_spec esp_ip4_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; struct ethhdr ether_spec ; __u8 hdata[72U] ; }; struct ethtool_rx_ntuple_flow_spec { __u32 flow_type ; union __anonunion_h_u_182 h_u ; union __anonunion_m_u_183 m_u ; __u16 vlan_tag ; __u16 vlan_tag_mask ; __u64 data ; __u64 data_mask ; __s32 action ; }; struct ethtool_rx_ntuple { __u32 cmd ; struct ethtool_rx_ntuple_flow_spec fs ; }; struct ethtool_flash { __u32 cmd ; __u32 region ; char data[128U] ; }; struct ethtool_dump { __u32 cmd ; __u32 version ; __u32 flag ; __u32 len ; __u8 data[0U] ; }; struct ethtool_rx_ntuple_list { struct list_head list ; unsigned int count ; }; enum ethtool_phys_id_state { ETHTOOL_ID_INACTIVE = 0, ETHTOOL_ID_ACTIVE = 1, ETHTOOL_ID_ON = 2, ETHTOOL_ID_OFF = 3 } ; struct ethtool_ops { int (*get_settings)(struct net_device * , struct ethtool_cmd * ) ; int (*set_settings)(struct net_device * , struct ethtool_cmd * ) ; void (*get_drvinfo)(struct net_device * , struct ethtool_drvinfo * ) ; int (*get_regs_len)(struct net_device * ) ; void (*get_regs)(struct net_device * , struct ethtool_regs * , void * ) ; void (*get_wol)(struct net_device * , struct ethtool_wolinfo * ) ; int (*set_wol)(struct net_device * , struct ethtool_wolinfo * ) ; u32 (*get_msglevel)(struct net_device * ) ; void (*set_msglevel)(struct net_device * , u32 ) ; int (*nway_reset)(struct net_device * ) ; u32 (*get_link)(struct net_device * ) ; int (*get_eeprom_len)(struct net_device * ) ; int (*get_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*set_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*get_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; int (*set_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; void (*get_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; int (*set_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; void (*get_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) ; int (*set_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) ; u32 (*get_rx_csum)(struct net_device * ) ; int (*set_rx_csum)(struct net_device * , u32 ) ; u32 (*get_tx_csum)(struct net_device * ) ; int (*set_tx_csum)(struct net_device * , u32 ) ; u32 (*get_sg)(struct net_device * ) ; int (*set_sg)(struct net_device * , u32 ) ; u32 (*get_tso)(struct net_device * ) ; int (*set_tso)(struct net_device * , u32 ) ; void (*self_test)(struct net_device * , struct ethtool_test * , u64 * ) ; void (*get_strings)(struct net_device * , u32 , u8 * ) ; int (*set_phys_id)(struct net_device * , enum ethtool_phys_id_state ) ; void (*get_ethtool_stats)(struct net_device * , struct ethtool_stats * , u64 * ) ; int (*begin)(struct net_device * ) ; void (*complete)(struct net_device * ) ; u32 (*get_ufo)(struct net_device * ) ; int (*set_ufo)(struct net_device * , u32 ) ; u32 (*get_flags)(struct net_device * ) ; int (*set_flags)(struct net_device * , u32 ) ; u32 (*get_priv_flags)(struct net_device * ) ; int (*set_priv_flags)(struct net_device * , u32 ) ; int (*get_sset_count)(struct net_device * , int ) ; int (*get_rxnfc)(struct net_device * , struct ethtool_rxnfc * , void * ) ; int (*set_rxnfc)(struct net_device * , struct ethtool_rxnfc * ) ; int (*flash_device)(struct net_device * , struct ethtool_flash * ) ; int (*reset)(struct net_device * , u32 * ) ; int (*set_rx_ntuple)(struct net_device * , struct ethtool_rx_ntuple * ) ; int (*get_rx_ntuple)(struct net_device * , u32 , void * ) ; int (*get_rxfh_indir)(struct net_device * , struct ethtool_rxfh_indir * ) ; int (*set_rxfh_indir)(struct net_device * , struct ethtool_rxfh_indir const * ) ; void (*get_channels)(struct net_device * , struct ethtool_channels * ) ; int (*set_channels)(struct net_device * , struct ethtool_channels * ) ; int (*get_dump_flag)(struct net_device * , struct ethtool_dump * ) ; int (*get_dump_data)(struct net_device * , struct ethtool_dump * , void * ) ; int (*set_dump)(struct net_device * , struct ethtool_dump * ) ; }; struct prot_inuse; struct netns_core { struct ctl_table_header *sysctl_hdr ; int sysctl_somaxconn ; struct prot_inuse *inuse ; }; struct u64_stats_sync { }; struct ipstats_mib { u64 mibs[31U] ; struct u64_stats_sync syncp ; }; struct icmp_mib { unsigned long mibs[27U] ; }; struct icmpmsg_mib { unsigned long mibs[512U] ; }; struct icmpv6_mib { unsigned long mibs[5U] ; }; struct icmpv6_mib_device { atomic_long_t mibs[5U] ; }; struct icmpv6msg_mib { unsigned long mibs[512U] ; }; struct icmpv6msg_mib_device { atomic_long_t mibs[512U] ; }; struct tcp_mib { unsigned long mibs[15U] ; }; struct udp_mib { unsigned long mibs[7U] ; }; struct linux_mib { unsigned long mibs[80U] ; }; struct linux_xfrm_mib { unsigned long mibs[27U] ; }; struct proc_dir_entry; struct netns_mib { struct tcp_mib *tcp_statistics[2U] ; struct ipstats_mib *ip_statistics[2U] ; struct linux_mib *net_statistics[2U] ; struct udp_mib *udp_statistics[2U] ; struct udp_mib *udplite_statistics[2U] ; struct icmp_mib *icmp_statistics[2U] ; struct icmpmsg_mib *icmpmsg_statistics[2U] ; struct proc_dir_entry *proc_net_devsnmp6 ; struct udp_mib *udp_stats_in6[2U] ; struct udp_mib *udplite_stats_in6[2U] ; struct ipstats_mib *ipv6_statistics[2U] ; struct icmpv6_mib *icmpv6_statistics[2U] ; struct icmpv6msg_mib *icmpv6msg_statistics[2U] ; struct linux_xfrm_mib *xfrm_statistics[2U] ; }; struct netns_unix { int sysctl_max_dgram_qlen ; struct ctl_table_header *ctl ; }; struct netns_packet { spinlock_t sklist_lock ; struct hlist_head sklist ; }; struct netns_frags { int nqueues ; atomic_t mem ; struct list_head lru_list ; int timeout ; int high_thresh ; int low_thresh ; }; struct ipv4_devconf; struct fib_rules_ops; struct xt_table; struct netns_ipv4 { struct ctl_table_header *forw_hdr ; struct ctl_table_header *frags_hdr ; struct ctl_table_header *ipv4_hdr ; struct ctl_table_header *route_hdr ; struct ipv4_devconf *devconf_all ; struct ipv4_devconf *devconf_dflt ; struct fib_rules_ops *rules_ops ; struct hlist_head *fib_table_hash ; struct sock *fibnl ; struct sock **icmp_sk ; struct sock *tcp_sock ; struct netns_frags frags ; struct xt_table *iptable_filter ; struct xt_table *iptable_mangle ; struct xt_table *iptable_raw ; struct xt_table *arptable_filter ; struct xt_table *iptable_security ; struct xt_table *nat_table ; struct hlist_head *nat_bysource ; unsigned int nat_htable_size ; int sysctl_icmp_echo_ignore_all ; int sysctl_icmp_echo_ignore_broadcasts ; int sysctl_icmp_ignore_bogus_error_responses ; int sysctl_icmp_ratelimit ; int sysctl_icmp_ratemask ; int sysctl_icmp_errors_use_inbound_ifaddr ; int sysctl_rt_cache_rebuild_count ; int current_rt_cache_rebuild_count ; unsigned int sysctl_ping_group_range[2U] ; atomic_t rt_genid ; atomic_t dev_addr_genid ; struct list_head mr_tables ; struct fib_rules_ops *mr_rules_ops ; }; struct dst_ops { unsigned short family ; __be16 protocol ; unsigned int gc_thresh ; int (*gc)(struct dst_ops * ) ; struct dst_entry *(*check)(struct dst_entry * , __u32 ) ; unsigned int (*default_advmss)(struct dst_entry const * ) ; unsigned int (*default_mtu)(struct dst_entry const * ) ; u32 *(*cow_metrics)(struct dst_entry * , unsigned long ) ; void (*destroy)(struct dst_entry * ) ; void (*ifdown)(struct dst_entry * , struct net_device * , int ) ; struct dst_entry *(*negative_advice)(struct dst_entry * ) ; void (*link_failure)(struct sk_buff * ) ; void (*update_pmtu)(struct dst_entry * , u32 ) ; int (*local_out)(struct sk_buff * ) ; struct kmem_cache *kmem_cachep ; struct percpu_counter pcpuc_entries ; }; struct netns_sysctl_ipv6 { struct ctl_table_header *table ; struct ctl_table_header *frags_hdr ; int bindv6only ; int flush_delay ; int ip6_rt_max_size ; int ip6_rt_gc_min_interval ; int ip6_rt_gc_timeout ; int ip6_rt_gc_interval ; int ip6_rt_gc_elasticity ; int ip6_rt_mtu_expires ; int ip6_rt_min_advmss ; int icmpv6_time ; }; struct ipv6_devconf; struct rt6_info; struct rt6_statistics; struct fib6_table; struct netns_ipv6 { struct netns_sysctl_ipv6 sysctl ; struct ipv6_devconf *devconf_all ; struct ipv6_devconf *devconf_dflt ; struct netns_frags frags ; struct xt_table *ip6table_filter ; struct xt_table *ip6table_mangle ; struct xt_table *ip6table_raw ; struct xt_table *ip6table_security ; struct rt6_info *ip6_null_entry ; struct rt6_statistics *rt6_stats ; struct timer_list ip6_fib_timer ; struct hlist_head *fib_table_hash ; struct fib6_table *fib6_main_tbl ; struct dst_ops ip6_dst_ops ; unsigned int ip6_rt_gc_expire ; unsigned long ip6_rt_last_gc ; struct rt6_info *ip6_prohibit_entry ; struct rt6_info *ip6_blk_hole_entry ; struct fib6_table *fib6_local_tbl ; struct fib_rules_ops *fib6_rules_ops ; struct sock **icmp_sk ; struct sock *ndisc_sk ; struct sock *tcp_sk ; struct sock *igmp_sk ; struct list_head mr6_tables ; struct fib_rules_ops *mr6_rules_ops ; }; struct netns_dccp { struct sock *v4_ctl_sk ; struct sock *v6_ctl_sk ; }; union __anonunion_in6_u_184 { __u8 u6_addr8[16U] ; __be16 u6_addr16[8U] ; __be32 u6_addr32[4U] ; }; struct in6_addr { union __anonunion_in6_u_184 in6_u ; }; typedef int read_proc_t(char * , char ** , off_t , int , int * , void * ); typedef int write_proc_t(struct file * , char const * , unsigned long , void * ); struct proc_dir_entry { unsigned int low_ino ; unsigned int namelen ; char const *name ; mode_t mode ; nlink_t nlink ; uid_t uid ; gid_t gid ; loff_t size ; struct inode_operations const *proc_iops ; struct file_operations const *proc_fops ; struct proc_dir_entry *next ; struct proc_dir_entry *parent ; struct proc_dir_entry *subdir ; void *data ; read_proc_t *read_proc ; write_proc_t *write_proc ; atomic_t count ; int pde_users ; spinlock_t pde_unload_lock ; struct completion *pde_unload_completion ; struct list_head pde_openers ; }; struct ebt_table; struct netns_xt { struct list_head tables[13U] ; struct ebt_table *broute_table ; struct ebt_table *frame_filter ; struct ebt_table *frame_nat ; }; struct ip_conntrack_stat; struct netns_ct { atomic_t count ; unsigned int expect_count ; unsigned int htable_size ; struct kmem_cache *nf_conntrack_cachep ; struct hlist_nulls_head *hash ; struct hlist_head *expect_hash ; struct hlist_nulls_head unconfirmed ; struct hlist_nulls_head dying ; struct ip_conntrack_stat *stat ; int sysctl_events ; unsigned int sysctl_events_retry_timeout ; int sysctl_acct ; int sysctl_tstamp ; int sysctl_checksum ; unsigned int sysctl_log_invalid ; struct ctl_table_header *sysctl_header ; struct ctl_table_header *acct_sysctl_header ; struct ctl_table_header *tstamp_sysctl_header ; struct ctl_table_header *event_sysctl_header ; char *slabname ; }; struct xfrm_policy_hash { struct hlist_head *table ; unsigned int hmask ; }; struct netns_xfrm { struct list_head state_all ; struct hlist_head *state_bydst ; struct hlist_head *state_bysrc ; struct hlist_head *state_byspi ; unsigned int state_hmask ; unsigned int state_num ; struct work_struct state_hash_work ; struct hlist_head state_gc_list ; struct work_struct state_gc_work ; wait_queue_head_t km_waitq ; struct list_head policy_all ; struct hlist_head *policy_byidx ; unsigned int policy_idx_hmask ; struct hlist_head policy_inexact[6U] ; struct xfrm_policy_hash policy_bydst[6U] ; unsigned int policy_count[6U] ; struct work_struct policy_hash_work ; struct sock *nlsk ; struct sock *nlsk_stash ; u32 sysctl_aevent_etime ; u32 sysctl_aevent_rseqth ; int sysctl_larval_drop ; u32 sysctl_acq_expires ; struct ctl_table_header *sysctl_hdr ; struct dst_ops xfrm4_dst_ops ; struct dst_ops xfrm6_dst_ops ; }; struct net_generic; struct netns_ipvs; struct net { atomic_t passive ; atomic_t count ; spinlock_t rules_mod_lock ; struct list_head list ; struct list_head cleanup_list ; struct list_head exit_list ; struct proc_dir_entry *proc_net ; struct proc_dir_entry *proc_net_stat ; struct ctl_table_set sysctls ; struct sock *rtnl ; struct sock *genl_sock ; struct list_head dev_base_head ; struct hlist_head *dev_name_head ; struct hlist_head *dev_index_head ; struct list_head rules_ops ; struct net_device *loopback_dev ; struct netns_core core ; struct netns_mib mib ; struct netns_packet packet ; struct netns_unix unx ; struct netns_ipv4 ipv4 ; struct netns_ipv6 ipv6 ; struct netns_dccp dccp ; struct netns_xt xt ; struct netns_ct ct ; struct sock *nfnl ; struct sock *nfnl_stash ; struct sk_buff_head wext_nlevents ; struct net_generic *gen ; struct netns_xfrm xfrm ; struct netns_ipvs *ipvs ; }; struct seq_file { char *buf ; size_t size ; size_t from ; size_t count ; loff_t index ; loff_t read_pos ; u64 version ; struct mutex lock ; struct seq_operations const *op ; void *private ; }; struct seq_operations { void *(*start)(struct seq_file * , loff_t * ) ; void (*stop)(struct seq_file * , void * ) ; void *(*next)(struct seq_file * , void * , loff_t * ) ; int (*show)(struct seq_file * , void * ) ; }; struct ieee_ets { __u8 willing ; __u8 ets_cap ; __u8 cbs ; __u8 tc_tx_bw[8U] ; __u8 tc_rx_bw[8U] ; __u8 tc_tsa[8U] ; __u8 prio_tc[8U] ; __u8 tc_reco_bw[8U] ; __u8 tc_reco_tsa[8U] ; __u8 reco_prio_tc[8U] ; }; struct ieee_pfc { __u8 pfc_cap ; __u8 pfc_en ; __u8 mbc ; __u16 delay ; __u64 requests[8U] ; __u64 indications[8U] ; }; struct cee_pg { __u8 willing ; __u8 error ; __u8 pg_en ; __u8 tcs_supported ; __u8 pg_bw[8U] ; __u8 prio_pg[8U] ; }; struct cee_pfc { __u8 willing ; __u8 error ; __u8 pfc_en ; __u8 tcs_supported ; }; struct dcb_app { __u8 selector ; __u8 priority ; __u16 protocol ; }; struct dcb_peer_app_info { __u8 willing ; __u8 error ; }; struct dcbnl_rtnl_ops { int (*ieee_getets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_setets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_getpfc)(struct net_device * , struct ieee_pfc * ) ; int (*ieee_setpfc)(struct net_device * , struct ieee_pfc * ) ; int (*ieee_getapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_setapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_peer_getets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_peer_getpfc)(struct net_device * , struct ieee_pfc * ) ; u8 (*getstate)(struct net_device * ) ; u8 (*setstate)(struct net_device * , u8 ) ; void (*getpermhwaddr)(struct net_device * , u8 * ) ; void (*setpgtccfgtx)(struct net_device * , int , u8 , u8 , u8 , u8 ) ; void (*setpgbwgcfgtx)(struct net_device * , int , u8 ) ; void (*setpgtccfgrx)(struct net_device * , int , u8 , u8 , u8 , u8 ) ; void (*setpgbwgcfgrx)(struct net_device * , int , u8 ) ; void (*getpgtccfgtx)(struct net_device * , int , u8 * , u8 * , u8 * , u8 * ) ; void (*getpgbwgcfgtx)(struct net_device * , int , u8 * ) ; void (*getpgtccfgrx)(struct net_device * , int , u8 * , u8 * , u8 * , u8 * ) ; void (*getpgbwgcfgrx)(struct net_device * , int , u8 * ) ; void (*setpfccfg)(struct net_device * , int , u8 ) ; void (*getpfccfg)(struct net_device * , int , u8 * ) ; u8 (*setall)(struct net_device * ) ; u8 (*getcap)(struct net_device * , int , u8 * ) ; u8 (*getnumtcs)(struct net_device * , int , u8 * ) ; u8 (*setnumtcs)(struct net_device * , int , u8 ) ; u8 (*getpfcstate)(struct net_device * ) ; void (*setpfcstate)(struct net_device * , u8 ) ; void (*getbcncfg)(struct net_device * , int , u32 * ) ; void (*setbcncfg)(struct net_device * , int , u32 ) ; void (*getbcnrp)(struct net_device * , int , u8 * ) ; void (*setbcnrp)(struct net_device * , int , u8 ) ; u8 (*setapp)(struct net_device * , u8 , u16 , u8 ) ; u8 (*getapp)(struct net_device * , u8 , u16 ) ; u8 (*getfeatcfg)(struct net_device * , int , u8 * ) ; u8 (*setfeatcfg)(struct net_device * , int , u8 ) ; u8 (*getdcbx)(struct net_device * ) ; u8 (*setdcbx)(struct net_device * , u8 ) ; int (*peer_getappinfo)(struct net_device * , struct dcb_peer_app_info * , u16 * ) ; int (*peer_getapptable)(struct net_device * , struct dcb_app * ) ; int (*cee_peer_getpg)(struct net_device * , struct cee_pg * ) ; int (*cee_peer_getpfc)(struct net_device * , struct cee_pfc * ) ; }; struct vlan_group; struct netpoll_info; struct phy_device; struct wireless_dev; enum netdev_tx { __NETDEV_TX_MIN = (-0x7FFFFFFF-1), NETDEV_TX_OK = 0, NETDEV_TX_BUSY = 16, NETDEV_TX_LOCKED = 32 } ; typedef enum netdev_tx netdev_tx_t; struct net_device_stats { unsigned long rx_packets ; unsigned long tx_packets ; unsigned long rx_bytes ; unsigned long tx_bytes ; unsigned long rx_errors ; unsigned long tx_errors ; unsigned long rx_dropped ; unsigned long tx_dropped ; unsigned long multicast ; unsigned long collisions ; unsigned long rx_length_errors ; unsigned long rx_over_errors ; unsigned long rx_crc_errors ; unsigned long rx_frame_errors ; unsigned long rx_fifo_errors ; unsigned long rx_missed_errors ; unsigned long tx_aborted_errors ; unsigned long tx_carrier_errors ; unsigned long tx_fifo_errors ; unsigned long tx_heartbeat_errors ; unsigned long tx_window_errors ; unsigned long rx_compressed ; unsigned long tx_compressed ; }; struct neighbour; struct neigh_parms; struct netdev_hw_addr_list { struct list_head list ; int count ; }; struct hh_cache { struct hh_cache *hh_next ; atomic_t hh_refcnt ; __be16 hh_type ; u16 hh_len ; int (*hh_output)(struct sk_buff * ) ; seqlock_t hh_lock ; unsigned long hh_data[16U] ; }; struct header_ops { int (*create)(struct sk_buff * , struct net_device * , unsigned short , void const * , void const * , unsigned int ) ; int (*parse)(struct sk_buff const * , unsigned char * ) ; int (*rebuild)(struct sk_buff * ) ; int (*cache)(struct neighbour const * , struct hh_cache * ) ; void (*cache_update)(struct hh_cache * , struct net_device const * , unsigned char const * ) ; }; enum rx_handler_result { RX_HANDLER_CONSUMED = 0, RX_HANDLER_ANOTHER = 1, RX_HANDLER_EXACT = 2, RX_HANDLER_PASS = 3 } ; typedef enum rx_handler_result rx_handler_result_t; typedef rx_handler_result_t rx_handler_func_t(struct sk_buff ** ); struct Qdisc; struct netdev_queue { struct net_device *dev ; struct Qdisc *qdisc ; unsigned long state ; struct Qdisc *qdisc_sleeping ; struct kobject kobj ; int numa_node ; spinlock_t _xmit_lock ; int xmit_lock_owner ; unsigned long trans_start ; }; struct rps_map { unsigned int len ; struct rcu_head rcu ; u16 cpus[0U] ; }; struct rps_dev_flow { u16 cpu ; u16 filter ; unsigned int last_qtail ; }; struct rps_dev_flow_table { unsigned int mask ; struct rcu_head rcu ; struct work_struct free_work ; struct rps_dev_flow flows[0U] ; }; struct netdev_rx_queue { struct rps_map *rps_map ; struct rps_dev_flow_table *rps_flow_table ; struct kobject kobj ; struct net_device *dev ; }; struct xps_map { unsigned int len ; unsigned int alloc_len ; struct rcu_head rcu ; u16 queues[0U] ; }; struct xps_dev_maps { struct rcu_head rcu ; struct xps_map *cpu_map[0U] ; }; struct netdev_tc_txq { u16 count ; u16 offset ; }; struct net_device_ops { int (*ndo_init)(struct net_device * ) ; void (*ndo_uninit)(struct net_device * ) ; int (*ndo_open)(struct net_device * ) ; int (*ndo_stop)(struct net_device * ) ; netdev_tx_t (*ndo_start_xmit)(struct sk_buff * , struct net_device * ) ; u16 (*ndo_select_queue)(struct net_device * , struct sk_buff * ) ; void (*ndo_change_rx_flags)(struct net_device * , int ) ; void (*ndo_set_rx_mode)(struct net_device * ) ; void (*ndo_set_multicast_list)(struct net_device * ) ; int (*ndo_set_mac_address)(struct net_device * , void * ) ; int (*ndo_validate_addr)(struct net_device * ) ; int (*ndo_do_ioctl)(struct net_device * , struct ifreq * , int ) ; int (*ndo_set_config)(struct net_device * , struct ifmap * ) ; int (*ndo_change_mtu)(struct net_device * , int ) ; int (*ndo_neigh_setup)(struct net_device * , struct neigh_parms * ) ; void (*ndo_tx_timeout)(struct net_device * ) ; struct rtnl_link_stats64 *(*ndo_get_stats64)(struct net_device * , struct rtnl_link_stats64 * ) ; struct net_device_stats *(*ndo_get_stats)(struct net_device * ) ; void (*ndo_vlan_rx_register)(struct net_device * , struct vlan_group * ) ; void (*ndo_vlan_rx_add_vid)(struct net_device * , unsigned short ) ; void (*ndo_vlan_rx_kill_vid)(struct net_device * , unsigned short ) ; void (*ndo_poll_controller)(struct net_device * ) ; int (*ndo_netpoll_setup)(struct net_device * , struct netpoll_info * ) ; void (*ndo_netpoll_cleanup)(struct net_device * ) ; int (*ndo_set_vf_mac)(struct net_device * , int , u8 * ) ; int (*ndo_set_vf_vlan)(struct net_device * , int , u16 , u8 ) ; int (*ndo_set_vf_tx_rate)(struct net_device * , int , int ) ; int (*ndo_get_vf_config)(struct net_device * , int , struct ifla_vf_info * ) ; int (*ndo_set_vf_port)(struct net_device * , int , struct nlattr ** ) ; int (*ndo_get_vf_port)(struct net_device * , int , struct sk_buff * ) ; int (*ndo_setup_tc)(struct net_device * , u8 ) ; int (*ndo_fcoe_enable)(struct net_device * ) ; int (*ndo_fcoe_disable)(struct net_device * ) ; int (*ndo_fcoe_ddp_setup)(struct net_device * , u16 , struct scatterlist * , unsigned int ) ; int (*ndo_fcoe_ddp_done)(struct net_device * , u16 ) ; int (*ndo_fcoe_ddp_target)(struct net_device * , u16 , struct scatterlist * , unsigned int ) ; int (*ndo_fcoe_get_wwn)(struct net_device * , u64 * , int ) ; int (*ndo_rx_flow_steer)(struct net_device * , struct sk_buff const * , u16 , u32 ) ; int (*ndo_add_slave)(struct net_device * , struct net_device * ) ; int (*ndo_del_slave)(struct net_device * , struct net_device * ) ; u32 (*ndo_fix_features)(struct net_device * , u32 ) ; int (*ndo_set_features)(struct net_device * , u32 ) ; }; struct iw_handler_def; struct iw_public_data; struct in_device; struct dn_dev; struct inet6_dev; struct cpu_rmap; struct pcpu_lstats; struct pcpu_tstats; struct pcpu_dstats; union __anonunion_ldv_30911_191 { void *ml_priv ; struct pcpu_lstats *lstats ; struct pcpu_tstats *tstats ; struct pcpu_dstats *dstats ; }; struct garp_port; struct rtnl_link_ops; struct net_device { char name[16U] ; struct pm_qos_request_list pm_qos_req ; struct hlist_node name_hlist ; char *ifalias ; unsigned long mem_end ; unsigned long mem_start ; unsigned long base_addr ; unsigned int irq ; unsigned long state ; struct list_head dev_list ; struct list_head napi_list ; struct list_head unreg_list ; u32 features ; u32 hw_features ; u32 wanted_features ; u32 vlan_features ; int ifindex ; int iflink ; struct net_device_stats stats ; atomic_long_t rx_dropped ; struct iw_handler_def const *wireless_handlers ; struct iw_public_data *wireless_data ; struct net_device_ops const *netdev_ops ; struct ethtool_ops const *ethtool_ops ; struct header_ops const *header_ops ; unsigned int flags ; unsigned int priv_flags ; unsigned short gflags ; unsigned short padded ; unsigned char operstate ; unsigned char link_mode ; unsigned char if_port ; unsigned char dma ; unsigned int mtu ; unsigned short type ; unsigned short hard_header_len ; unsigned short needed_headroom ; unsigned short needed_tailroom ; unsigned char perm_addr[32U] ; unsigned char addr_assign_type ; unsigned char addr_len ; unsigned short dev_id ; spinlock_t addr_list_lock ; struct netdev_hw_addr_list uc ; struct netdev_hw_addr_list mc ; int uc_promisc ; unsigned int promiscuity ; unsigned int allmulti ; struct vlan_group *vlgrp ; void *dsa_ptr ; void *atalk_ptr ; struct in_device *ip_ptr ; struct dn_dev *dn_ptr ; struct inet6_dev *ip6_ptr ; void *ec_ptr ; void *ax25_ptr ; struct wireless_dev *ieee80211_ptr ; unsigned long last_rx ; struct net_device *master ; unsigned char *dev_addr ; struct netdev_hw_addr_list dev_addrs ; unsigned char broadcast[32U] ; struct kset *queues_kset ; struct netdev_rx_queue *_rx ; unsigned int num_rx_queues ; unsigned int real_num_rx_queues ; struct cpu_rmap *rx_cpu_rmap ; rx_handler_func_t *rx_handler ; void *rx_handler_data ; struct netdev_queue *ingress_queue ; struct netdev_queue *_tx ; unsigned int num_tx_queues ; unsigned int real_num_tx_queues ; struct Qdisc *qdisc ; unsigned long tx_queue_len ; spinlock_t tx_global_lock ; struct xps_dev_maps *xps_maps ; unsigned long trans_start ; int watchdog_timeo ; struct timer_list watchdog_timer ; int *pcpu_refcnt ; struct list_head todo_list ; struct hlist_node index_hlist ; struct list_head link_watch_list ; unsigned char reg_state ; bool dismantle ; unsigned short rtnl_link_state ; void (*destructor)(struct net_device * ) ; struct netpoll_info *npinfo ; struct net *nd_net ; union __anonunion_ldv_30911_191 ldv_30911 ; struct garp_port *garp_port ; struct device dev ; struct attribute_group const *sysfs_groups[4U] ; struct rtnl_link_ops const *rtnl_link_ops ; unsigned int gso_max_size ; struct dcbnl_rtnl_ops const *dcbnl_ops ; u8 num_tc ; struct netdev_tc_txq tc_to_txq[16U] ; u8 prio_tc_map[16U] ; unsigned int fcoe_ddp_xid ; struct ethtool_rx_ntuple_list ethtool_ntuple_list ; struct phy_device *phydev ; int group ; }; enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED = 1, IRQ_WAKE_THREAD = 2 } ; typedef enum irqreturn irqreturn_t; struct timer_rand_state; struct irqaction { irqreturn_t (*handler)(int , void * ) ; unsigned long flags ; void *dev_id ; struct irqaction *next ; int irq ; irqreturn_t (*thread_fn)(int , void * ) ; struct task_struct *thread ; unsigned long thread_flags ; unsigned long thread_mask ; char const *name ; struct proc_dir_entry *dir ; }; struct linux_binprm { char buf[128U] ; struct vm_area_struct *vma ; unsigned long vma_pages ; struct mm_struct *mm ; unsigned long p ; unsigned char cred_prepared : 1 ; unsigned char cap_effective : 1 ; unsigned int recursion_depth ; struct file *file ; struct cred *cred ; int unsafe ; unsigned int per_clear ; int argc ; int envc ; char const *filename ; char const *interp ; unsigned int interp_flags ; unsigned int interp_data ; unsigned long loader ; unsigned long exec ; }; struct coredump_params { long signr ; struct pt_regs *regs ; struct file *file ; unsigned long limit ; unsigned long mm_flags ; }; struct linux_binfmt { struct list_head lh ; struct module *module ; int (*load_binary)(struct linux_binprm * , struct pt_regs * ) ; int (*load_shlib)(struct file * ) ; int (*core_dump)(struct coredump_params * ) ; unsigned long min_coredump ; }; struct xfrm_policy; struct xfrm_state; struct request_sock; struct sock_filter { __u16 code ; __u8 jt ; __u8 jf ; __u32 k ; }; struct sk_filter { atomic_t refcnt ; unsigned int len ; unsigned int (*bpf_func)(struct sk_buff const * , struct sock_filter const * ) ; struct rcu_head rcu ; struct sock_filter insns[0U] ; }; struct pollfd { int fd ; short events ; short revents ; }; struct poll_table_struct { void (*qproc)(struct file * , wait_queue_head_t * , struct poll_table_struct * ) ; unsigned long key ; }; struct nla_policy { u16 type ; u16 len ; }; struct rtnl_link_ops { struct list_head list ; char const *kind ; size_t priv_size ; void (*setup)(struct net_device * ) ; int maxtype ; struct nla_policy const *policy ; int (*validate)(struct nlattr ** , struct nlattr ** ) ; int (*newlink)(struct net * , struct net_device * , struct nlattr ** , struct nlattr ** ) ; int (*changelink)(struct net_device * , struct nlattr ** , struct nlattr ** ) ; void (*dellink)(struct net_device * , struct list_head * ) ; size_t (*get_size)(struct net_device const * ) ; int (*fill_info)(struct sk_buff * , struct net_device const * ) ; size_t (*get_xstats_size)(struct net_device const * ) ; int (*fill_xstats)(struct sk_buff * , struct net_device const * ) ; int (*get_tx_queues)(struct net * , struct nlattr ** , unsigned int * , unsigned int * ) ; }; struct neigh_table; struct neigh_parms { struct net *net ; struct net_device *dev ; struct neigh_parms *next ; int (*neigh_setup)(struct neighbour * ) ; void (*neigh_cleanup)(struct neighbour * ) ; struct neigh_table *tbl ; void *sysctl_table ; int dead ; atomic_t refcnt ; struct rcu_head rcu_head ; int base_reachable_time ; int retrans_time ; int gc_staletime ; int reachable_time ; int delay_probe_time ; int queue_len ; int ucast_probes ; int app_probes ; int mcast_probes ; int anycast_delay ; int proxy_delay ; int proxy_qlen ; int locktime ; }; struct neigh_statistics { unsigned long allocs ; unsigned long destroys ; unsigned long hash_grows ; unsigned long res_failed ; unsigned long lookups ; unsigned long hits ; unsigned long rcv_probes_mcast ; unsigned long rcv_probes_ucast ; unsigned long periodic_gc_runs ; unsigned long forced_gc_runs ; unsigned long unres_discards ; }; struct neigh_ops; struct neighbour { struct neighbour *next ; struct neigh_table *tbl ; struct neigh_parms *parms ; unsigned long confirmed ; unsigned long updated ; rwlock_t lock ; atomic_t refcnt ; struct sk_buff_head arp_queue ; struct timer_list timer ; unsigned long used ; atomic_t probes ; __u8 flags ; __u8 nud_state ; __u8 type ; __u8 dead ; seqlock_t ha_lock ; unsigned char ha[32U] ; struct hh_cache *hh ; int (*output)(struct sk_buff * ) ; struct neigh_ops const *ops ; struct rcu_head rcu ; struct net_device *dev ; u8 primary_key[0U] ; }; struct neigh_ops { int family ; void (*solicit)(struct neighbour * , struct sk_buff * ) ; void (*error_report)(struct neighbour * , struct sk_buff * ) ; int (*output)(struct sk_buff * ) ; int (*connected_output)(struct sk_buff * ) ; int (*hh_output)(struct sk_buff * ) ; int (*queue_xmit)(struct sk_buff * ) ; }; struct pneigh_entry { struct pneigh_entry *next ; struct net *net ; struct net_device *dev ; u8 flags ; u8 key[0U] ; }; struct neigh_hash_table { struct neighbour **hash_buckets ; unsigned int hash_mask ; __u32 hash_rnd ; struct rcu_head rcu ; }; struct neigh_table { struct neigh_table *next ; int family ; int entry_size ; int key_len ; __u32 (*hash)(void const * , struct net_device const * , __u32 ) ; int (*constructor)(struct neighbour * ) ; int (*pconstructor)(struct pneigh_entry * ) ; void (*pdestructor)(struct pneigh_entry * ) ; void (*proxy_redo)(struct sk_buff * ) ; char *id ; struct neigh_parms parms ; int gc_interval ; int gc_thresh1 ; int gc_thresh2 ; int gc_thresh3 ; unsigned long last_flush ; struct delayed_work gc_work ; struct timer_list proxy_timer ; struct sk_buff_head proxy_queue ; atomic_t entries ; rwlock_t lock ; unsigned long last_rand ; struct kmem_cache *kmem_cachep ; struct neigh_statistics *stats ; struct neigh_hash_table *nht ; struct pneigh_entry **phash_buckets ; }; struct dn_route; union __anonunion_ldv_36934_200 { struct dst_entry *next ; struct rtable *rt_next ; struct rt6_info *rt6_next ; struct dn_route *dn_next ; }; struct dst_entry { struct rcu_head rcu_head ; struct dst_entry *child ; struct net_device *dev ; struct dst_ops *ops ; unsigned long _metrics ; unsigned long expires ; struct dst_entry *path ; struct neighbour *neighbour ; struct hh_cache *hh ; struct xfrm_state *xfrm ; int (*input)(struct sk_buff * ) ; int (*output)(struct sk_buff * ) ; short error ; short obsolete ; unsigned short header_len ; unsigned short trailer_len ; __u32 tclassid ; long __pad_to_align_refcnt[1U] ; atomic_t __refcnt ; int __use ; unsigned long lastuse ; int flags ; union __anonunion_ldv_36934_200 ldv_36934 ; }; struct __anonstruct_socket_lock_t_201 { spinlock_t slock ; int owned ; wait_queue_head_t wq ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_socket_lock_t_201 socket_lock_t; struct proto; union __anonunion_ldv_37135_202 { unsigned int skc_hash ; __u16 skc_u16hashes[2U] ; }; union __anonunion_ldv_37143_203 { struct hlist_node skc_bind_node ; struct hlist_nulls_node skc_portaddr_node ; }; union __anonunion_ldv_37150_204 { struct hlist_node skc_node ; struct hlist_nulls_node skc_nulls_node ; }; struct sock_common { __be32 skc_daddr ; __be32 skc_rcv_saddr ; union __anonunion_ldv_37135_202 ldv_37135 ; unsigned short skc_family ; unsigned char volatile skc_state ; unsigned char skc_reuse ; int skc_bound_dev_if ; union __anonunion_ldv_37143_203 ldv_37143 ; struct proto *skc_prot ; struct net *skc_net ; int skc_dontcopy_begin[0U] ; union __anonunion_ldv_37150_204 ldv_37150 ; int skc_tx_queue_mapping ; atomic_t skc_refcnt ; int skc_dontcopy_end[0U] ; }; struct __anonstruct_sk_backlog_205 { atomic_t rmem_alloc ; int len ; struct sk_buff *head ; struct sk_buff *tail ; }; struct sock { struct sock_common __sk_common ; socket_lock_t sk_lock ; struct sk_buff_head sk_receive_queue ; struct __anonstruct_sk_backlog_205 sk_backlog ; int sk_forward_alloc ; __u32 sk_rxhash ; atomic_t sk_drops ; int sk_rcvbuf ; struct sk_filter *sk_filter ; struct socket_wq *sk_wq ; struct sk_buff_head sk_async_wait_queue ; struct xfrm_policy *sk_policy[2U] ; unsigned long sk_flags ; struct dst_entry *sk_dst_cache ; spinlock_t sk_dst_lock ; atomic_t sk_wmem_alloc ; atomic_t sk_omem_alloc ; int sk_sndbuf ; struct sk_buff_head sk_write_queue ; unsigned char sk_shutdown : 2 ; unsigned char sk_no_check : 2 ; unsigned char sk_userlocks : 4 ; unsigned char sk_protocol ; unsigned short sk_type ; int sk_wmem_queued ; gfp_t sk_allocation ; int sk_route_caps ; int sk_route_nocaps ; int sk_gso_type ; unsigned int sk_gso_max_size ; int sk_rcvlowat ; unsigned long sk_lingertime ; struct sk_buff_head sk_error_queue ; struct proto *sk_prot_creator ; rwlock_t sk_callback_lock ; int sk_err ; int sk_err_soft ; unsigned short sk_ack_backlog ; unsigned short sk_max_ack_backlog ; __u32 sk_priority ; struct pid *sk_peer_pid ; struct cred const *sk_peer_cred ; long sk_rcvtimeo ; long sk_sndtimeo ; void *sk_protinfo ; struct timer_list sk_timer ; ktime_t sk_stamp ; struct socket *sk_socket ; void *sk_user_data ; struct page *sk_sndmsg_page ; struct sk_buff *sk_send_head ; __u32 sk_sndmsg_off ; int sk_write_pending ; void *sk_security ; __u32 sk_mark ; u32 sk_classid ; void (*sk_state_change)(struct sock * ) ; void (*sk_data_ready)(struct sock * , int ) ; void (*sk_write_space)(struct sock * ) ; void (*sk_error_report)(struct sock * ) ; int (*sk_backlog_rcv)(struct sock * , struct sk_buff * ) ; void (*sk_destruct)(struct sock * ) ; }; struct request_sock_ops; struct timewait_sock_ops; struct inet_hashinfo; struct raw_hashinfo; struct udp_table; union __anonunion_h_206 { struct inet_hashinfo *hashinfo ; struct udp_table *udp_table ; struct raw_hashinfo *raw_hash ; }; struct proto { void (*close)(struct sock * , long ) ; int (*connect)(struct sock * , struct sockaddr * , int ) ; int (*disconnect)(struct sock * , int ) ; struct sock *(*accept)(struct sock * , int , int * ) ; int (*ioctl)(struct sock * , int , unsigned long ) ; int (*init)(struct sock * ) ; void (*destroy)(struct sock * ) ; void (*shutdown)(struct sock * , int ) ; int (*setsockopt)(struct sock * , int , int , char * , unsigned int ) ; int (*getsockopt)(struct sock * , int , int , char * , int * ) ; int (*compat_setsockopt)(struct sock * , int , int , char * , unsigned int ) ; int (*compat_getsockopt)(struct sock * , int , int , char * , int * ) ; int (*compat_ioctl)(struct sock * , unsigned int , unsigned long ) ; int (*sendmsg)(struct kiocb * , struct sock * , struct msghdr * , size_t ) ; int (*recvmsg)(struct kiocb * , struct sock * , struct msghdr * , size_t , int , int , int * ) ; int (*sendpage)(struct sock * , struct page * , int , size_t , int ) ; int (*bind)(struct sock * , struct sockaddr * , int ) ; int (*backlog_rcv)(struct sock * , struct sk_buff * ) ; void (*hash)(struct sock * ) ; void (*unhash)(struct sock * ) ; void (*rehash)(struct sock * ) ; int (*get_port)(struct sock * , unsigned short ) ; void (*clear_sk)(struct sock * , int ) ; unsigned int inuse_idx ; void (*enter_memory_pressure)(struct sock * ) ; atomic_long_t *memory_allocated ; struct percpu_counter *sockets_allocated ; int *memory_pressure ; long *sysctl_mem ; int *sysctl_wmem ; int *sysctl_rmem ; int max_header ; bool no_autobind ; struct kmem_cache *slab ; unsigned int obj_size ; int slab_flags ; struct percpu_counter *orphan_count ; struct request_sock_ops *rsk_prot ; struct timewait_sock_ops *twsk_prot ; union __anonunion_h_206 h ; struct module *owner ; char name[32U] ; struct list_head node ; }; enum drbd_disk_state { D_DISKLESS = 0, D_ATTACHING = 1, D_FAILED = 2, D_NEGOTIATING = 3, D_INCONSISTENT = 4, D_OUTDATED = 5, D_UNKNOWN = 6, D_CONSISTENT = 7, D_UP_TO_DATE = 8, D_MASK = 15 } ; struct __anonstruct_ldv_38339_207 { unsigned char role : 2 ; unsigned char peer : 2 ; unsigned char conn : 5 ; unsigned char disk : 4 ; unsigned char pdsk : 4 ; unsigned char susp : 1 ; unsigned char aftr_isp : 1 ; unsigned char peer_isp : 1 ; unsigned char user_isp : 1 ; unsigned char susp_nod : 1 ; unsigned char susp_fen : 1 ; unsigned short _pad : 9 ; }; union drbd_state { struct __anonstruct_ldv_38339_207 ldv_38339 ; unsigned int i ; }; enum drbd_state_rv { SS_CW_NO_NEED = 4, SS_CW_SUCCESS = 3, SS_NOTHING_TO_DO = 2, SS_SUCCESS = 1, SS_UNKNOWN_ERROR = 0, SS_TWO_PRIMARIES = -1, SS_NO_UP_TO_DATE_DISK = -2, SS_NO_LOCAL_DISK = -4, SS_NO_REMOTE_DISK = -5, SS_CONNECTED_OUTDATES = -6, SS_PRIMARY_NOP = -7, SS_RESYNC_RUNNING = -8, SS_ALREADY_STANDALONE = -9, SS_CW_FAILED_BY_PEER = -10, SS_IS_DISKLESS = -11, SS_DEVICE_IN_USE = -12, SS_NO_NET_CONFIG = -13, SS_NO_VERIFY_ALG = -14, SS_NEED_CONNECTION = -15, SS_LOWER_THAN_OUTDATED = -16, SS_NOT_SUPPORTED = -17, SS_IN_TRANSIENT_STATE = -18, SS_CONCURRENT_ST_CHG = -19, SS_AFTER_LAST_ERROR = -20 } ; struct crypto_ablkcipher; struct crypto_async_request; struct crypto_aead; struct crypto_blkcipher; struct crypto_hash; struct crypto_rng; struct crypto_tfm; struct crypto_type; struct aead_givcrypt_request; struct skcipher_givcrypt_request; struct crypto_async_request { struct list_head list ; void (*complete)(struct crypto_async_request * , int ) ; void *data ; struct crypto_tfm *tfm ; u32 flags ; }; struct ablkcipher_request { struct crypto_async_request base ; unsigned int nbytes ; void *info ; struct scatterlist *src ; struct scatterlist *dst ; void *__ctx[0U] ; }; struct aead_request { struct crypto_async_request base ; unsigned int assoclen ; unsigned int cryptlen ; u8 *iv ; struct scatterlist *assoc ; struct scatterlist *src ; struct scatterlist *dst ; void *__ctx[0U] ; }; struct blkcipher_desc { struct crypto_blkcipher *tfm ; void *info ; u32 flags ; }; struct hash_desc { struct crypto_hash *tfm ; u32 flags ; }; struct ablkcipher_alg { int (*setkey)(struct crypto_ablkcipher * , u8 const * , unsigned int ) ; int (*encrypt)(struct ablkcipher_request * ) ; int (*decrypt)(struct ablkcipher_request * ) ; int (*givencrypt)(struct skcipher_givcrypt_request * ) ; int (*givdecrypt)(struct skcipher_givcrypt_request * ) ; char const *geniv ; unsigned int min_keysize ; unsigned int max_keysize ; unsigned int ivsize ; }; struct aead_alg { int (*setkey)(struct crypto_aead * , u8 const * , unsigned int ) ; int (*setauthsize)(struct crypto_aead * , unsigned int ) ; int (*encrypt)(struct aead_request * ) ; int (*decrypt)(struct aead_request * ) ; int (*givencrypt)(struct aead_givcrypt_request * ) ; int (*givdecrypt)(struct aead_givcrypt_request * ) ; char const *geniv ; unsigned int ivsize ; unsigned int maxauthsize ; }; struct blkcipher_alg { int (*setkey)(struct crypto_tfm * , u8 const * , unsigned int ) ; int (*encrypt)(struct blkcipher_desc * , struct scatterlist * , struct scatterlist * , unsigned int ) ; int (*decrypt)(struct blkcipher_desc * , struct scatterlist * , struct scatterlist * , unsigned int ) ; char const *geniv ; unsigned int min_keysize ; unsigned int max_keysize ; unsigned int ivsize ; }; struct cipher_alg { unsigned int cia_min_keysize ; unsigned int cia_max_keysize ; int (*cia_setkey)(struct crypto_tfm * , u8 const * , unsigned int ) ; void (*cia_encrypt)(struct crypto_tfm * , u8 * , u8 const * ) ; void (*cia_decrypt)(struct crypto_tfm * , u8 * , u8 const * ) ; }; struct compress_alg { int (*coa_compress)(struct crypto_tfm * , u8 const * , unsigned int , u8 * , unsigned int * ) ; int (*coa_decompress)(struct crypto_tfm * , u8 const * , unsigned int , u8 * , unsigned int * ) ; }; struct rng_alg { int (*rng_make_random)(struct crypto_rng * , u8 * , unsigned int ) ; int (*rng_reset)(struct crypto_rng * , u8 * , unsigned int ) ; unsigned int seedsize ; }; union __anonunion_cra_u_208 { struct ablkcipher_alg ablkcipher ; struct aead_alg aead ; struct blkcipher_alg blkcipher ; struct cipher_alg cipher ; struct compress_alg compress ; struct rng_alg rng ; }; struct crypto_alg { struct list_head cra_list ; struct list_head cra_users ; u32 cra_flags ; unsigned int cra_blocksize ; unsigned int cra_ctxsize ; unsigned int cra_alignmask ; int cra_priority ; atomic_t cra_refcnt ; char cra_name[64U] ; char cra_driver_name[64U] ; struct crypto_type const *cra_type ; union __anonunion_cra_u_208 cra_u ; int (*cra_init)(struct crypto_tfm * ) ; void (*cra_exit)(struct crypto_tfm * ) ; void (*cra_destroy)(struct crypto_alg * ) ; struct module *cra_module ; }; struct ablkcipher_tfm { int (*setkey)(struct crypto_ablkcipher * , u8 const * , unsigned int ) ; int (*encrypt)(struct ablkcipher_request * ) ; int (*decrypt)(struct ablkcipher_request * ) ; int (*givencrypt)(struct skcipher_givcrypt_request * ) ; int (*givdecrypt)(struct skcipher_givcrypt_request * ) ; struct crypto_ablkcipher *base ; unsigned int ivsize ; unsigned int reqsize ; }; struct aead_tfm { int (*setkey)(struct crypto_aead * , u8 const * , unsigned int ) ; int (*encrypt)(struct aead_request * ) ; int (*decrypt)(struct aead_request * ) ; int (*givencrypt)(struct aead_givcrypt_request * ) ; int (*givdecrypt)(struct aead_givcrypt_request * ) ; struct crypto_aead *base ; unsigned int ivsize ; unsigned int authsize ; unsigned int reqsize ; }; struct blkcipher_tfm { void *iv ; int (*setkey)(struct crypto_tfm * , u8 const * , unsigned int ) ; int (*encrypt)(struct blkcipher_desc * , struct scatterlist * , struct scatterlist * , unsigned int ) ; int (*decrypt)(struct blkcipher_desc * , struct scatterlist * , struct scatterlist * , unsigned int ) ; }; struct cipher_tfm { int (*cit_setkey)(struct crypto_tfm * , u8 const * , unsigned int ) ; void (*cit_encrypt_one)(struct crypto_tfm * , u8 * , u8 const * ) ; void (*cit_decrypt_one)(struct crypto_tfm * , u8 * , u8 const * ) ; }; struct hash_tfm { int (*init)(struct hash_desc * ) ; int (*update)(struct hash_desc * , struct scatterlist * , unsigned int ) ; int (*final)(struct hash_desc * , u8 * ) ; int (*digest)(struct hash_desc * , struct scatterlist * , unsigned int , u8 * ) ; int (*setkey)(struct crypto_hash * , u8 const * , unsigned int ) ; unsigned int digestsize ; }; struct compress_tfm { int (*cot_compress)(struct crypto_tfm * , u8 const * , unsigned int , u8 * , unsigned int * ) ; int (*cot_decompress)(struct crypto_tfm * , u8 const * , unsigned int , u8 * , unsigned int * ) ; }; struct rng_tfm { int (*rng_gen_random)(struct crypto_rng * , u8 * , unsigned int ) ; int (*rng_reset)(struct crypto_rng * , u8 * , unsigned int ) ; }; union __anonunion_crt_u_209 { struct ablkcipher_tfm ablkcipher ; struct aead_tfm aead ; struct blkcipher_tfm blkcipher ; struct cipher_tfm cipher ; struct hash_tfm hash ; struct compress_tfm compress ; struct rng_tfm rng ; }; struct crypto_tfm { u32 crt_flags ; union __anonunion_crt_u_209 crt_u ; void (*exit)(struct crypto_tfm * ) ; struct crypto_alg *__crt_alg ; void *__crt_ctx[0U] ; }; struct crypto_ablkcipher { struct crypto_tfm base ; }; struct crypto_aead { struct crypto_tfm base ; }; struct crypto_blkcipher { struct crypto_tfm base ; }; struct crypto_hash { struct crypto_tfm base ; }; struct crypto_rng { struct crypto_tfm base ; }; struct ratelimit_state { spinlock_t lock ; int interval ; int burst ; int printed ; int missed ; unsigned long begin ; }; struct request_values { }; struct request_sock_ops { int family ; int obj_size ; struct kmem_cache *slab ; char *slab_name ; int (*rtx_syn_ack)(struct sock * , struct request_sock * , struct request_values * ) ; void (*send_ack)(struct sock * , struct sk_buff * , struct request_sock * ) ; void (*send_reset)(struct sock * , struct sk_buff * ) ; void (*destructor)(struct request_sock * ) ; void (*syn_ack_timeout)(struct sock * , struct request_sock * ) ; }; struct request_sock { struct request_sock *dl_next ; u16 mss ; u8 retrans ; u8 cookie_ts ; u32 window_clamp ; u32 rcv_wnd ; u32 ts_recent ; unsigned long expires ; struct request_sock_ops const *rsk_ops ; struct sock *sk ; u32 secid ; u32 peer_secid ; }; struct inet_peer; struct timewait_sock_ops { struct kmem_cache *twsk_slab ; char *twsk_slab_name ; unsigned int twsk_obj_size ; int (*twsk_unique)(struct sock * , struct sock * , void * ) ; void (*twsk_destructor)(struct sock * ) ; void *(*twsk_getpeer)(struct sock * ) ; }; struct disk_stats { unsigned long sectors[2U] ; unsigned long ios[2U] ; unsigned long merges[2U] ; unsigned long ticks[2U] ; unsigned long io_ticks ; unsigned long time_in_queue ; }; struct partition_meta_info { u8 uuid[16U] ; u8 volname[64U] ; }; struct hd_struct { sector_t start_sect ; sector_t nr_sects ; sector_t alignment_offset ; unsigned int discard_alignment ; struct device __dev ; struct kobject *holder_dir ; int policy ; int partno ; struct partition_meta_info *info ; int make_it_fail ; unsigned long stamp ; atomic_t in_flight[2U] ; struct disk_stats *dkstats ; atomic_t ref ; struct rcu_head rcu_head ; }; struct disk_part_tbl { struct rcu_head rcu_head ; int len ; struct hd_struct *last_lookup ; struct hd_struct *part[0U] ; }; struct disk_events; struct request_queue; struct blk_integrity; struct gendisk { int major ; int first_minor ; int minors ; char disk_name[32U] ; char *(*devnode)(struct gendisk * , mode_t * ) ; unsigned int events ; unsigned int async_events ; struct disk_part_tbl *part_tbl ; struct hd_struct part0 ; struct block_device_operations const *fops ; struct request_queue *queue ; void *private_data ; int flags ; struct device *driverfs_dev ; struct kobject *slave_dir ; struct timer_rand_state *random ; atomic_t sync_io ; struct disk_events *ev ; struct blk_integrity *integrity ; int node_id ; }; enum writeback_sync_modes { WB_SYNC_NONE = 0, WB_SYNC_ALL = 1 } ; struct writeback_control { enum writeback_sync_modes sync_mode ; unsigned long *older_than_this ; unsigned long wb_start ; long nr_to_write ; long pages_skipped ; loff_t range_start ; loff_t range_end ; unsigned char nonblocking : 1 ; unsigned char encountered_congestion : 1 ; unsigned char for_kupdate : 1 ; unsigned char for_background : 1 ; unsigned char for_reclaim : 1 ; unsigned char range_cyclic : 1 ; unsigned char more_io : 1 ; }; struct bdi_writeback; typedef int congested_fn(void * , int ); struct bdi_writeback { struct backing_dev_info *bdi ; unsigned int nr ; unsigned long last_old_flush ; unsigned long last_active ; struct task_struct *task ; struct timer_list wakeup_timer ; struct list_head b_dirty ; struct list_head b_io ; struct list_head b_more_io ; }; struct backing_dev_info { struct list_head bdi_list ; unsigned long ra_pages ; unsigned long state ; unsigned int capabilities ; congested_fn *congested_fn ; void *congested_data ; char *name ; struct percpu_counter bdi_stat[2U] ; struct prop_local_percpu completions ; int dirty_exceeded ; unsigned int min_ratio ; unsigned int max_ratio ; unsigned int max_prop_frac ; struct bdi_writeback wb ; spinlock_t wb_lock ; struct list_head work_list ; struct device *dev ; struct timer_list laptop_mode_wb_timer ; struct dentry *debug_dir ; struct dentry *debug_stats ; }; typedef void *mempool_alloc_t(gfp_t , void * ); typedef void mempool_free_t(void * , void * ); struct mempool_s { spinlock_t lock ; int min_nr ; int curr_nr ; void **elements ; void *pool_data ; mempool_alloc_t *alloc ; mempool_free_t *free ; wait_queue_head_t wait ; }; typedef struct mempool_s mempool_t; struct io_context { atomic_long_t refcount ; atomic_t nr_tasks ; spinlock_t lock ; unsigned short ioprio ; unsigned short ioprio_changed ; unsigned short cgroup_changed ; int nr_batch_requests ; unsigned long last_waited ; struct radix_tree_root radix_root ; struct hlist_head cic_list ; void *ioc_data ; }; struct bio_integrity_payload { struct bio *bip_bio ; sector_t bip_sector ; void *bip_buf ; bio_end_io_t *bip_end_io ; unsigned int bip_size ; unsigned short bip_slab ; unsigned short bip_vcnt ; unsigned short bip_idx ; struct work_struct bip_work ; struct bio_vec bip_vec[0U] ; }; struct bio_list { struct bio *head ; struct bio *tail ; }; struct bsg_class_device { struct device *class_dev ; struct device *parent ; int minor ; struct request_queue *queue ; struct kref ref ; void (*release)(struct device * ) ; }; struct elevator_queue; struct blk_trace; struct request; typedef void rq_end_io_fn(struct request * , int ); struct request_list { int count[2U] ; int starved[2U] ; int elvpriv ; mempool_t *rq_pool ; wait_queue_head_t wait[2U] ; }; enum rq_cmd_type_bits { REQ_TYPE_FS = 1, REQ_TYPE_BLOCK_PC = 2, REQ_TYPE_SENSE = 3, REQ_TYPE_PM_SUSPEND = 4, REQ_TYPE_PM_RESUME = 5, REQ_TYPE_PM_SHUTDOWN = 6, REQ_TYPE_SPECIAL = 7, REQ_TYPE_ATA_TASKFILE = 8, REQ_TYPE_ATA_PC = 9 } ; union __anonunion_ldv_41976_216 { struct rb_node rb_node ; void *completion_data ; }; struct __anonstruct_flush_218 { unsigned int seq ; struct list_head list ; }; union __anonunion_ldv_41983_217 { void *elevator_private[3U] ; struct __anonstruct_flush_218 flush ; }; struct request { struct list_head queuelist ; struct call_single_data csd ; struct request_queue *q ; unsigned int cmd_flags ; enum rq_cmd_type_bits cmd_type ; unsigned long atomic_flags ; int cpu ; unsigned int __data_len ; sector_t __sector ; struct bio *bio ; struct bio *biotail ; struct hlist_node hash ; union __anonunion_ldv_41976_216 ldv_41976 ; union __anonunion_ldv_41983_217 ldv_41983 ; struct gendisk *rq_disk ; struct hd_struct *part ; unsigned long start_time ; unsigned short nr_phys_segments ; unsigned short nr_integrity_segments ; unsigned short ioprio ; int ref_count ; void *special ; char *buffer ; int tag ; int errors ; unsigned char __cmd[16U] ; unsigned char *cmd ; unsigned short cmd_len ; unsigned int extra_len ; unsigned int sense_len ; unsigned int resid_len ; void *sense ; unsigned long deadline ; struct list_head timeout_list ; unsigned int timeout ; int retries ; rq_end_io_fn *end_io ; void *end_io_data ; struct request *next_rq ; }; typedef int elevator_merge_fn(struct request_queue * , struct request ** , struct bio * ); typedef void elevator_merge_req_fn(struct request_queue * , struct request * , struct request * ); typedef void elevator_merged_fn(struct request_queue * , struct request * , int ); typedef int elevator_allow_merge_fn(struct request_queue * , struct request * , struct bio * ); typedef void elevator_bio_merged_fn(struct request_queue * , struct request * , struct bio * ); typedef int elevator_dispatch_fn(struct request_queue * , int ); typedef void elevator_add_req_fn(struct request_queue * , struct request * ); typedef struct request *elevator_request_list_fn(struct request_queue * , struct request * ); typedef void elevator_completed_req_fn(struct request_queue * , struct request * ); typedef int elevator_may_queue_fn(struct request_queue * , int ); typedef int elevator_set_req_fn(struct request_queue * , struct request * , gfp_t ); typedef void elevator_put_req_fn(struct request * ); typedef void elevator_activate_req_fn(struct request_queue * , struct request * ); typedef void elevator_deactivate_req_fn(struct request_queue * , struct request * ); typedef void *elevator_init_fn(struct request_queue * ); typedef void elevator_exit_fn(struct elevator_queue * ); struct elevator_ops { elevator_merge_fn *elevator_merge_fn ; elevator_merged_fn *elevator_merged_fn ; elevator_merge_req_fn *elevator_merge_req_fn ; elevator_allow_merge_fn *elevator_allow_merge_fn ; elevator_bio_merged_fn *elevator_bio_merged_fn ; elevator_dispatch_fn *elevator_dispatch_fn ; elevator_add_req_fn *elevator_add_req_fn ; elevator_activate_req_fn *elevator_activate_req_fn ; elevator_deactivate_req_fn *elevator_deactivate_req_fn ; elevator_completed_req_fn *elevator_completed_req_fn ; elevator_request_list_fn *elevator_former_req_fn ; elevator_request_list_fn *elevator_latter_req_fn ; elevator_set_req_fn *elevator_set_req_fn ; elevator_put_req_fn *elevator_put_req_fn ; elevator_may_queue_fn *elevator_may_queue_fn ; elevator_init_fn *elevator_init_fn ; elevator_exit_fn *elevator_exit_fn ; void (*trim)(struct io_context * ) ; }; struct elv_fs_entry { struct attribute attr ; ssize_t (*show)(struct elevator_queue * , char * ) ; ssize_t (*store)(struct elevator_queue * , char const * , size_t ) ; }; struct elevator_type { struct list_head list ; struct elevator_ops ops ; struct elv_fs_entry *elevator_attrs ; char elevator_name[16U] ; struct module *elevator_owner ; }; struct elevator_queue { struct elevator_ops *ops ; void *elevator_data ; struct kobject kobj ; struct elevator_type *elevator_type ; struct mutex sysfs_lock ; struct hlist_head *hash ; unsigned char registered : 1 ; }; typedef void request_fn_proc(struct request_queue * ); typedef int make_request_fn(struct request_queue * , struct bio * ); typedef int prep_rq_fn(struct request_queue * , struct request * ); typedef void unprep_rq_fn(struct request_queue * , struct request * ); struct bvec_merge_data { struct block_device *bi_bdev ; sector_t bi_sector ; unsigned int bi_size ; unsigned long bi_rw ; }; typedef int merge_bvec_fn(struct request_queue * , struct bvec_merge_data * , struct bio_vec * ); typedef void softirq_done_fn(struct request * ); typedef int dma_drain_needed_fn(struct request * ); typedef int lld_busy_fn(struct request_queue * ); enum blk_eh_timer_return { BLK_EH_NOT_HANDLED = 0, BLK_EH_HANDLED = 1, BLK_EH_RESET_TIMER = 2 } ; typedef enum blk_eh_timer_return rq_timed_out_fn(struct request * ); struct blk_queue_tag { struct request **tag_index ; unsigned long *tag_map ; int busy ; int max_depth ; int real_max_depth ; atomic_t refcnt ; }; struct queue_limits { unsigned long bounce_pfn ; unsigned long seg_boundary_mask ; unsigned int max_hw_sectors ; unsigned int max_sectors ; unsigned int max_segment_size ; unsigned int physical_block_size ; unsigned int alignment_offset ; unsigned int io_min ; unsigned int io_opt ; unsigned int max_discard_sectors ; unsigned int discard_granularity ; unsigned int discard_alignment ; unsigned short logical_block_size ; unsigned short max_segments ; unsigned short max_integrity_segments ; unsigned char misaligned ; unsigned char discard_misaligned ; unsigned char cluster ; unsigned char discard_zeroes_data ; }; struct request_queue { struct list_head queue_head ; struct request *last_merge ; struct elevator_queue *elevator ; struct request_list rq ; request_fn_proc *request_fn ; make_request_fn *make_request_fn ; prep_rq_fn *prep_rq_fn ; unprep_rq_fn *unprep_rq_fn ; merge_bvec_fn *merge_bvec_fn ; softirq_done_fn *softirq_done_fn ; rq_timed_out_fn *rq_timed_out_fn ; dma_drain_needed_fn *dma_drain_needed ; lld_busy_fn *lld_busy_fn ; sector_t end_sector ; struct request *boundary_rq ; struct delayed_work delay_work ; struct backing_dev_info backing_dev_info ; void *queuedata ; gfp_t bounce_gfp ; unsigned long queue_flags ; spinlock_t __queue_lock ; spinlock_t *queue_lock ; struct kobject kobj ; unsigned long nr_requests ; unsigned int nr_congestion_on ; unsigned int nr_congestion_off ; unsigned int nr_batching ; void *dma_drain_buffer ; unsigned int dma_drain_size ; unsigned int dma_pad_mask ; unsigned int dma_alignment ; struct blk_queue_tag *queue_tags ; struct list_head tag_busy_list ; unsigned int nr_sorted ; unsigned int in_flight[2U] ; unsigned int rq_timeout ; struct timer_list timeout ; struct list_head timeout_list ; struct queue_limits limits ; unsigned int sg_timeout ; unsigned int sg_reserved_size ; int node ; struct blk_trace *blk_trace ; unsigned int flush_flags ; unsigned char flush_not_queueable : 1 ; unsigned char flush_queue_delayed : 1 ; unsigned char flush_pending_idx : 1 ; unsigned char flush_running_idx : 1 ; unsigned long flush_pending_since ; struct list_head flush_queue[2U] ; struct list_head flush_data_in_flight ; struct request flush_rq ; struct mutex sysfs_lock ; struct bsg_class_device bsg_dev ; }; struct blk_plug { unsigned long magic ; struct list_head list ; struct list_head cb_list ; unsigned int should_sort ; }; struct blk_integrity_exchg { void *prot_buf ; void *data_buf ; sector_t sector ; unsigned int data_size ; unsigned short sector_size ; char const *disk_name ; }; typedef void integrity_gen_fn(struct blk_integrity_exchg * ); typedef int integrity_vrfy_fn(struct blk_integrity_exchg * ); typedef void integrity_set_tag_fn(void * , void * , unsigned int ); typedef void integrity_get_tag_fn(void * , void * , unsigned int ); struct blk_integrity { integrity_gen_fn *generate_fn ; integrity_vrfy_fn *verify_fn ; integrity_set_tag_fn *set_tag_fn ; integrity_get_tag_fn *get_tag_fn ; unsigned short flags ; unsigned short tuple_size ; unsigned short sector_size ; unsigned short tag_size ; char const *name ; struct kobject kobj ; }; struct block_device_operations { int (*open)(struct block_device * , fmode_t ) ; int (*release)(struct gendisk * , fmode_t ) ; int (*ioctl)(struct block_device * , fmode_t , unsigned int , unsigned long ) ; int (*compat_ioctl)(struct block_device * , fmode_t , unsigned int , unsigned long ) ; int (*direct_access)(struct block_device * , sector_t , void ** , unsigned long * ) ; unsigned int (*check_events)(struct gendisk * , unsigned int ) ; int (*media_changed)(struct gendisk * ) ; void (*unlock_native_capacity)(struct gendisk * ) ; int (*revalidate_disk)(struct gendisk * ) ; int (*getgeo)(struct block_device * , struct hd_geometry * ) ; void (*swap_slot_free_notify)(struct block_device * , unsigned long ) ; struct module *owner ; }; struct ipv6_devconf { __s32 forwarding ; __s32 hop_limit ; __s32 mtu6 ; __s32 accept_ra ; __s32 accept_redirects ; __s32 autoconf ; __s32 dad_transmits ; __s32 rtr_solicits ; __s32 rtr_solicit_interval ; __s32 rtr_solicit_delay ; __s32 force_mld_version ; __s32 use_tempaddr ; __s32 temp_valid_lft ; __s32 temp_prefered_lft ; __s32 regen_max_retry ; __s32 max_desync_factor ; __s32 max_addresses ; __s32 accept_ra_defrtr ; __s32 accept_ra_pinfo ; __s32 accept_ra_rtr_pref ; __s32 rtr_probe_interval ; __s32 accept_ra_rt_info_max_plen ; __s32 proxy_ndp ; __s32 accept_source_route ; __s32 optimistic_dad ; __s32 mc_forwarding ; __s32 disable_ipv6 ; __s32 accept_dad ; __s32 force_tllao ; void *sysctl ; }; struct ip6_sf_list { struct ip6_sf_list *sf_next ; struct in6_addr sf_addr ; unsigned long sf_count[2U] ; unsigned char sf_gsresp ; unsigned char sf_oldin ; unsigned char sf_crcount ; }; struct ifmcaddr6 { struct in6_addr mca_addr ; struct inet6_dev *idev ; struct ifmcaddr6 *next ; struct ip6_sf_list *mca_sources ; struct ip6_sf_list *mca_tomb ; unsigned int mca_sfmode ; unsigned char mca_crcount ; unsigned long mca_sfcount[2U] ; struct timer_list mca_timer ; unsigned int mca_flags ; int mca_users ; atomic_t mca_refcnt ; spinlock_t mca_lock ; unsigned long mca_cstamp ; unsigned long mca_tstamp ; }; struct ifacaddr6 { struct in6_addr aca_addr ; struct inet6_dev *aca_idev ; struct rt6_info *aca_rt ; struct ifacaddr6 *aca_next ; int aca_users ; atomic_t aca_refcnt ; spinlock_t aca_lock ; unsigned long aca_cstamp ; unsigned long aca_tstamp ; }; struct ipv6_devstat { struct proc_dir_entry *proc_dir_entry ; struct ipstats_mib *ipv6[2U] ; struct icmpv6_mib_device *icmpv6dev ; struct icmpv6msg_mib_device *icmpv6msgdev ; }; struct inet6_dev { struct net_device *dev ; struct list_head addr_list ; struct ifmcaddr6 *mc_list ; struct ifmcaddr6 *mc_tomb ; spinlock_t mc_lock ; unsigned char mc_qrv ; unsigned char mc_gq_running ; unsigned char mc_ifc_count ; unsigned long mc_v1_seen ; unsigned long mc_maxdelay ; struct timer_list mc_gq_timer ; struct timer_list mc_ifc_timer ; struct ifacaddr6 *ac_list ; rwlock_t lock ; atomic_t refcnt ; __u32 if_flags ; int dead ; u8 rndid[8U] ; struct timer_list regen_timer ; struct list_head tempaddr_list ; struct neigh_parms *nd_parms ; struct inet6_dev *next ; struct ipv6_devconf cnf ; struct ipv6_devstat stats ; unsigned long tstamp ; struct rcu_head rcu ; }; union __anonunion_ldv_44138_224 { __be32 a4 ; __be32 a6[4U] ; }; struct inetpeer_addr_base { union __anonunion_ldv_44138_224 ldv_44138 ; }; struct inetpeer_addr { struct inetpeer_addr_base addr ; __u16 family ; }; struct __anonstruct_ldv_44162_226 { atomic_t rid ; atomic_t ip_id_count ; __u32 tcp_ts ; __u32 tcp_ts_stamp ; u32 metrics[14U] ; u32 rate_tokens ; unsigned long rate_last ; unsigned long pmtu_expires ; u32 pmtu_orig ; u32 pmtu_learned ; struct inetpeer_addr_base redirect_learned ; }; union __anonunion_ldv_44164_225 { struct __anonstruct_ldv_44162_226 ldv_44162 ; struct rcu_head rcu ; }; struct inet_peer { struct inet_peer *avl_left ; struct inet_peer *avl_right ; struct inetpeer_addr daddr ; __u32 avl_height ; struct list_head unused ; __u32 dtime ; atomic_t refcnt ; union __anonunion_ldv_44164_225 ldv_44164 ; }; struct fib_info; struct rtable { struct dst_entry dst ; __be32 rt_key_dst ; __be32 rt_key_src ; int rt_genid ; unsigned int rt_flags ; __u16 rt_type ; __u8 rt_key_tos ; __be32 rt_dst ; __be32 rt_src ; int rt_route_iif ; int rt_iif ; int rt_oif ; __u32 rt_mark ; __be32 rt_gateway ; __be32 rt_spec_dst ; u32 rt_peer_genid ; struct inet_peer *peer ; struct fib_info *fi ; }; struct inet_ehash_bucket { struct hlist_nulls_head chain ; struct hlist_nulls_head twchain ; }; struct inet_bind_hashbucket { spinlock_t lock ; struct hlist_head chain ; }; struct inet_listen_hashbucket { spinlock_t lock ; struct hlist_nulls_head head ; }; struct inet_hashinfo { struct inet_ehash_bucket *ehash ; spinlock_t *ehash_locks ; unsigned int ehash_mask ; unsigned int ehash_locks_mask ; struct inet_bind_hashbucket *bhash ; unsigned int bhash_size ; struct kmem_cache *bind_bucket_cachep ; struct inet_listen_hashbucket listening_hash[32U] ; atomic_t bsockets ; }; struct lc_element { struct hlist_node colision ; struct list_head list ; unsigned int refcnt ; unsigned int lc_index ; unsigned int lc_number ; }; struct lru_cache { struct list_head lru ; struct list_head free ; struct list_head in_use ; struct kmem_cache *lc_cache ; size_t element_size ; size_t element_off ; unsigned int nr_elements ; unsigned int used ; unsigned long hits ; unsigned long misses ; unsigned long starving ; unsigned long dirty ; unsigned long changed ; unsigned long flags ; unsigned int new_number ; struct lc_element *changing_element ; void *lc_private ; char const *name ; struct hlist_head *lc_slot ; struct lc_element **lc_element ; }; struct drbd_conf; struct p_header80 { u32 magic ; u16 command ; u16 length ; u8 payload[0U] ; }; struct p_header95 { u16 magic ; u16 command ; u32 length ; u8 payload[0U] ; }; union p_header { struct p_header80 h80 ; struct p_header95 h95 ; }; struct p_data { union p_header head ; u64 sector ; u64 block_id ; u32 seq_num ; u32 dp_flags ; }; struct p_block_ack { struct p_header80 head ; u64 sector ; u64 block_id ; u32 blksize ; u32 seq_num ; }; struct p_block_req { struct p_header80 head ; u64 sector ; u64 block_id ; u32 blksize ; u32 pad ; }; struct p_handshake { struct p_header80 head ; u32 protocol_min ; u32 feature_flags ; u32 protocol_max ; u32 _pad ; u64 reserverd[7U] ; }; struct p_barrier { struct p_header80 head ; u32 barrier ; u32 pad ; }; struct p_barrier_ack { struct p_header80 head ; u32 barrier ; u32 set_size ; }; struct p_rs_param_89 { struct p_header80 head ; u32 rate ; char verify_alg[64U] ; char csums_alg[64U] ; }; struct p_rs_param_95 { struct p_header80 head ; u32 rate ; char verify_alg[64U] ; char csums_alg[64U] ; u32 c_plan_ahead ; u32 c_delay_target ; u32 c_fill_target ; u32 c_max_rate ; }; struct p_protocol { struct p_header80 head ; u32 protocol ; u32 after_sb_0p ; u32 after_sb_1p ; u32 after_sb_2p ; u32 conn_flags ; u32 two_primaries ; char integrity_alg[0U] ; }; struct p_uuids { struct p_header80 head ; u64 uuid[6U] ; }; struct p_rs_uuid { struct p_header80 head ; u64 uuid ; }; struct p_sizes { struct p_header80 head ; u64 d_size ; u64 u_size ; u64 c_size ; u32 max_bio_size ; u16 queue_order_type ; u16 dds_flags ; }; struct p_state { struct p_header80 head ; u32 state ; }; struct p_req_state { struct p_header80 head ; u32 mask ; u32 val ; }; struct p_req_state_reply { struct p_header80 head ; u32 retcode ; }; struct p_block_desc { struct p_header80 head ; u64 sector ; u32 blksize ; u32 pad ; }; struct p_delay_probe93 { struct p_header80 head ; u32 seq_num ; u32 offset ; }; union p_polymorph { union p_header header ; struct p_handshake handshake ; struct p_data data ; struct p_block_ack block_ack ; struct p_barrier barrier ; struct p_barrier_ack barrier_ack ; struct p_rs_param_89 rs_param_89 ; struct p_rs_param_95 rs_param_95 ; struct p_protocol protocol ; struct p_sizes sizes ; struct p_uuids uuids ; struct p_state state ; struct p_req_state req_state ; struct p_req_state_reply req_state_reply ; struct p_block_req block_req ; struct p_delay_probe93 delay_probe93 ; struct p_rs_uuid rs_uuid ; struct p_block_desc block_desc ; }; enum drbd_thread_state { None = 0, Running = 1, Exiting = 2, Restarting = 3 } ; struct drbd_thread { spinlock_t t_lock ; struct task_struct *task ; struct completion stop ; enum drbd_thread_state t_state ; int (*function)(struct drbd_thread * ) ; struct drbd_conf *mdev ; int reset_cpu_mask ; }; struct drbd_work; struct drbd_work { struct list_head list ; int (*cb)(struct drbd_conf * , struct drbd_work * , int ) ; }; struct drbd_tl_epoch; struct drbd_tl_epoch { struct drbd_work w ; struct list_head requests ; struct drbd_tl_epoch *next ; unsigned int br_number ; int n_writes ; }; struct drbd_epoch { struct list_head list ; unsigned int barrier_nr ; atomic_t epoch_size ; atomic_t active ; unsigned long flags ; }; struct digest_info { int digest_size ; void *digest ; }; union __anonunion_ldv_46600_229 { u64 block_id ; struct digest_info *digest ; }; struct drbd_epoch_entry { struct drbd_work w ; struct hlist_node collision ; struct drbd_epoch *epoch ; struct drbd_conf *mdev ; struct page *pages ; atomic_t pending_bios ; unsigned int size ; unsigned long flags ; sector_t sector ; union __anonunion_ldv_46600_229 ldv_46600 ; }; struct drbd_bitmap; enum bm_flag { BM_P_VMALLOCED = 65536, BM_LOCKED_MASK = 7, BM_DONT_CLEAR = 1, BM_DONT_SET = 2, BM_DONT_TEST = 4, BM_LOCKED_TEST_ALLOWED = 3, BM_LOCKED_SET_ALLOWED = 1 } ; struct drbd_work_queue { struct list_head q ; struct semaphore s ; spinlock_t q_lock ; }; struct drbd_socket { struct drbd_work_queue work ; struct mutex mutex ; struct socket *socket ; union p_polymorph sbuf ; union p_polymorph rbuf ; }; struct drbd_md { u64 md_offset ; u64 la_size_sect ; u64 uuid[4U] ; u64 device_uuid ; u32 flags ; u32 md_size_sect ; s32 al_offset ; s32 bm_offset ; }; struct disk_conf { __u64 disk_size ; unsigned char backing_dev[128U] ; int backing_dev_len ; unsigned char meta_dev[128U] ; int meta_dev_len ; int meta_dev_idx ; int on_io_error ; int fencing ; unsigned char use_bmbv : 1 ; unsigned char no_disk_flush : 1 ; unsigned char no_md_flush : 1 ; int max_bio_bvecs ; unsigned char no_disk_barrier : 1 ; unsigned char no_disk_drain : 1 ; }; struct net_conf { unsigned char my_addr[128U] ; int my_addr_len ; unsigned char peer_addr[128U] ; int peer_addr_len ; unsigned char shared_secret[64U] ; int shared_secret_len ; unsigned char cram_hmac_alg[64U] ; int cram_hmac_alg_len ; unsigned char integrity_alg[64U] ; int integrity_alg_len ; int timeout ; int wire_protocol ; int try_connect_int ; int ping_int ; int max_epoch_size ; int max_buffers ; int unplug_watermark ; int sndbuf_size ; int ko_count ; int after_sb_0p ; int after_sb_1p ; int after_sb_2p ; int rr_conflict ; int ping_timeo ; int rcvbuf_size ; int on_congestion ; int cong_fill ; int cong_extents ; unsigned char mind_af : 1 ; unsigned char want_lose : 1 ; unsigned char two_primaries : 1 ; unsigned char always_asbp : 1 ; unsigned char no_cork : 1 ; unsigned char auto_sndbuf_size : 1 ; unsigned char dry_run : 1 ; }; struct syncer_conf { int rate ; int after ; int al_extents ; unsigned char verify_alg[64U] ; int verify_alg_len ; unsigned char cpu_mask[32U] ; int cpu_mask_len ; unsigned char csums_alg[64U] ; int csums_alg_len ; unsigned char use_rle : 1 ; int on_no_data ; int c_plan_ahead ; int c_delay_target ; int c_fill_target ; int c_max_rate ; int c_min_rate ; }; struct drbd_backing_dev { struct block_device *backing_bdev ; struct block_device *md_bdev ; struct drbd_md md ; struct disk_conf dc ; sector_t known_size ; }; struct bm_io_work { struct drbd_work w ; char *why ; enum bm_flag flags ; int (*io_fn)(struct drbd_conf * ) ; void (*done)(struct drbd_conf * , int ) ; }; enum write_ordering_e { WO_none = 0, WO_drain_io = 1, WO_bdev_flush = 2 } ; struct fifo_buffer { int *values ; unsigned int head_index ; unsigned int size ; }; struct drbd_conf { unsigned long flags ; struct net_conf *net_conf ; struct syncer_conf sync_conf ; struct drbd_backing_dev *ldev ; sector_t p_size ; struct request_queue *rq_queue ; struct block_device *this_bdev ; struct gendisk *vdisk ; struct drbd_socket data ; struct drbd_socket meta ; int agreed_pro_version ; unsigned long last_received ; unsigned int ko_count ; struct drbd_work resync_work ; struct drbd_work unplug_work ; struct drbd_work go_diskless ; struct drbd_work md_sync_work ; struct drbd_work start_resync_work ; struct timer_list resync_timer ; struct timer_list md_sync_timer ; struct timer_list start_resync_timer ; struct timer_list request_timer ; union drbd_state new_state_tmp ; union drbd_state state ; wait_queue_head_t misc_wait ; wait_queue_head_t state_wait ; wait_queue_head_t net_cnt_wait ; unsigned int send_cnt ; unsigned int recv_cnt ; unsigned int read_cnt ; unsigned int writ_cnt ; unsigned int al_writ_cnt ; unsigned int bm_writ_cnt ; atomic_t ap_bio_cnt ; atomic_t ap_pending_cnt ; atomic_t rs_pending_cnt ; atomic_t unacked_cnt ; atomic_t local_cnt ; atomic_t net_cnt ; spinlock_t req_lock ; struct drbd_tl_epoch *unused_spare_tle ; struct drbd_tl_epoch *newest_tle ; struct drbd_tl_epoch *oldest_tle ; struct list_head out_of_sequence_requests ; struct hlist_head *tl_hash ; unsigned int tl_hash_s ; unsigned long rs_total ; unsigned long rs_failed ; unsigned long rs_start ; unsigned long rs_paused ; unsigned long rs_same_csum ; unsigned long rs_mark_left[8U] ; unsigned long rs_mark_time[8U] ; int rs_last_mark ; sector_t ov_start_sector ; sector_t ov_position ; sector_t ov_last_oos_start ; sector_t ov_last_oos_size ; unsigned long ov_left ; struct crypto_hash *csums_tfm ; struct crypto_hash *verify_tfm ; struct drbd_thread receiver ; struct drbd_thread worker ; struct drbd_thread asender ; struct drbd_bitmap *bitmap ; unsigned long bm_resync_fo ; struct lru_cache *resync ; unsigned int resync_locked ; unsigned int resync_wenr ; int open_cnt ; u64 *p_uuid ; struct drbd_epoch *current_epoch ; spinlock_t epoch_lock ; unsigned int epochs ; enum write_ordering_e write_ordering ; struct list_head active_ee ; struct list_head sync_ee ; struct list_head done_ee ; struct list_head read_ee ; struct list_head net_ee ; struct hlist_head *ee_hash ; unsigned int ee_hash_s ; struct drbd_epoch_entry *last_write_w_barrier ; int next_barrier_nr ; struct hlist_head *app_reads_hash ; struct list_head resync_reads ; atomic_t pp_in_use ; atomic_t pp_in_use_by_net ; wait_queue_head_t ee_wait ; struct page *md_io_page ; struct page *md_io_tmpp ; struct mutex md_io_mutex ; spinlock_t al_lock ; wait_queue_head_t al_wait ; struct lru_cache *act_log ; unsigned int al_tr_number ; int al_tr_cycle ; int al_tr_pos ; struct crypto_hash *cram_hmac_tfm ; struct crypto_hash *integrity_w_tfm ; struct crypto_hash *integrity_r_tfm ; void *int_dig_out ; void *int_dig_in ; void *int_dig_vv ; wait_queue_head_t seq_wait ; atomic_t packet_seq ; unsigned int peer_seq ; spinlock_t peer_seq_lock ; unsigned int minor ; unsigned long comm_bm_set ; cpumask_var_t cpu_mask ; struct bm_io_work bm_io_work ; u64 ed_uuid ; struct mutex state_mutex ; char congestion_reason ; atomic_t rs_sect_in ; atomic_t rs_sect_ev ; int rs_last_sect_ev ; int rs_last_events ; int c_sync_rate ; struct fifo_buffer rs_plan_s ; int rs_in_flight ; int rs_planed ; atomic_t ap_in_flight ; int peer_max_bio_size ; int local_max_bio_size ; }; enum chg_state_flags { CS_HARD = 1, CS_VERBOSE = 2, CS_WAIT_COMPLETE = 4, CS_SERIALIZE = 8, CS_ORDERED = 12 } ; struct drbd_bitmap { struct page **bm_pages ; spinlock_t bm_lock ; unsigned long bm_set ; unsigned long bm_bits ; size_t bm_words ; size_t bm_number_of_pages ; sector_t bm_dev_capacity ; struct mutex bm_change ; wait_queue_head_t bm_io_wait ; enum bm_flag bm_flags ; char *bm_why ; struct task_struct *bm_task ; }; struct bm_aio_ctx { struct drbd_conf *mdev ; atomic_t in_flight ; struct completion done ; unsigned int flags ; int error ; }; enum hrtimer_restart; enum hrtimer_restart; struct proc_ns_operations { char const *name ; int type ; void *(*get)(struct task_struct * ) ; void (*put)(void * ) ; int (*install)(struct nsproxy * , void * ) ; }; union proc_op { int (*proc_get_link)(struct inode * , struct path * ) ; int (*proc_read)(struct task_struct * , char * ) ; int (*proc_show)(struct seq_file * , struct pid_namespace * , struct pid * , struct task_struct * ) ; }; struct proc_inode { struct pid *pid ; int fd ; union proc_op op ; struct proc_dir_entry *pde ; struct ctl_table_header *sysctl ; struct ctl_table *sysctl_entry ; void *ns ; struct proc_ns_operations const *ns_ops ; struct inode vfs_inode ; }; enum drbd_role { R_UNKNOWN = 0, R_PRIMARY = 1, R_SECONDARY = 2, R_MASK = 3 } ; enum drbd_conns { C_STANDALONE = 0, C_DISCONNECTING = 1, C_UNCONNECTED = 2, C_TIMEOUT = 3, C_BROKEN_PIPE = 4, C_NETWORK_FAILURE = 5, C_PROTOCOL_ERROR = 6, C_TEAR_DOWN = 7, C_WF_CONNECTION = 8, C_WF_REPORT_PARAMS = 9, C_CONNECTED = 10, C_STARTING_SYNC_S = 11, C_STARTING_SYNC_T = 12, C_WF_BITMAP_S = 13, C_WF_BITMAP_T = 14, C_WF_SYNC_UUID = 15, C_SYNC_SOURCE = 16, C_SYNC_TARGET = 17, C_VERIFY_S = 18, C_VERIFY_T = 19, C_PAUSED_SYNC_S = 20, C_PAUSED_SYNC_T = 21, C_AHEAD = 22, C_BEHIND = 23, C_MASK = 31 } ; struct bm_extent { int rs_left ; int rs_failed ; unsigned long flags ; struct lc_element lce ; }; enum hrtimer_restart; enum hrtimer_restart; struct taskstats { __u16 version ; __u32 ac_exitcode ; __u8 ac_flag ; __u8 ac_nice ; __u64 cpu_count ; __u64 cpu_delay_total ; __u64 blkio_count ; __u64 blkio_delay_total ; __u64 swapin_count ; __u64 swapin_delay_total ; __u64 cpu_run_real_total ; __u64 cpu_run_virtual_total ; char ac_comm[32U] ; __u8 ac_sched ; __u8 ac_pad[3U] ; __u32 ac_uid ; __u32 ac_gid ; __u32 ac_pid ; __u32 ac_ppid ; __u32 ac_btime ; __u64 ac_etime ; __u64 ac_utime ; __u64 ac_stime ; __u64 ac_minflt ; __u64 ac_majflt ; __u64 coremem ; __u64 virtmem ; __u64 hiwater_rss ; __u64 hiwater_vm ; __u64 read_char ; __u64 write_char ; __u64 read_syscalls ; __u64 write_syscalls ; __u64 read_bytes ; __u64 write_bytes ; __u64 cancelled_write_bytes ; __u64 nvcsw ; __u64 nivcsw ; __u64 ac_utimescaled ; __u64 ac_stimescaled ; __u64 cpu_scaled_run_real_total ; __u64 freepages_count ; __u64 freepages_delay_total ; }; struct cgroupfs_root; struct cgroup; struct css_id; struct cgroup_subsys_state { struct cgroup *cgroup ; atomic_t refcnt ; unsigned long flags ; struct css_id *id ; }; struct cgroup { unsigned long flags ; atomic_t count ; struct list_head sibling ; struct list_head children ; struct cgroup *parent ; struct dentry *dentry ; struct cgroup_subsys_state *subsys[64U] ; struct cgroupfs_root *root ; struct cgroup *top_cgroup ; struct list_head css_sets ; struct list_head release_list ; struct list_head pidlists ; struct mutex pidlist_mutex ; struct rcu_head rcu_head ; struct list_head event_list ; spinlock_t event_list_lock ; }; struct css_set { atomic_t refcount ; struct hlist_node hlist ; struct list_head tasks ; struct list_head cg_links ; struct cgroup_subsys_state *subsys[64U] ; struct rcu_head rcu_head ; }; enum drbd_packets { P_DATA = 0, P_DATA_REPLY = 1, P_RS_DATA_REPLY = 2, P_BARRIER = 3, P_BITMAP = 4, P_BECOME_SYNC_TARGET = 5, P_BECOME_SYNC_SOURCE = 6, P_UNPLUG_REMOTE = 7, P_DATA_REQUEST = 8, P_RS_DATA_REQUEST = 9, P_SYNC_PARAM = 10, P_PROTOCOL = 11, P_UUIDS = 12, P_SIZES = 13, P_STATE = 14, P_SYNC_UUID = 15, P_AUTH_CHALLENGE = 16, P_AUTH_RESPONSE = 17, P_STATE_CHG_REQ = 18, P_PING = 19, P_PING_ACK = 20, P_RECV_ACK = 21, P_WRITE_ACK = 22, P_RS_WRITE_ACK = 23, P_DISCARD_ACK = 24, P_NEG_ACK = 25, P_NEG_DREPLY = 26, P_NEG_RS_DREPLY = 27, P_BARRIER_ACK = 28, P_STATE_CHG_REPLY = 29, P_OV_REQUEST = 30, P_OV_REPLY = 31, P_OV_RESULT = 32, P_CSUM_RS_REQUEST = 33, P_RS_IS_IN_SYNC = 34, P_SYNC_PARAM89 = 35, P_COMPRESSED_BITMAP = 36, P_DELAY_PROBE = 39, P_OUT_OF_SYNC = 40, P_RS_CANCEL = 41, P_MAX_CMD = 42, P_MAY_IGNORE = 256, P_MAX_OPT_CMD = 257, P_HAND_SHAKE_M = 65521, P_HAND_SHAKE_S = 65522, P_HAND_SHAKE = 65534 } ; struct drbd_request { struct drbd_work w ; struct drbd_conf *mdev ; struct bio *private_bio ; struct hlist_node collision ; sector_t sector ; unsigned int size ; unsigned int epoch ; struct list_head tl_requests ; struct bio *master_bio ; unsigned long rq_state ; int seq_num ; unsigned long start_time ; }; struct drbd_wq_barrier { struct drbd_work w ; struct completion done ; }; struct drbd_md_io { struct drbd_conf *mdev ; struct completion event ; int error ; }; enum drbd_req_event { created = 0, to_be_send = 1, to_be_submitted = 2, queue_for_net_write = 3, queue_for_net_read = 4, queue_for_send_oos = 5, send_canceled = 6, send_failed = 7, handed_over_to_network = 8, oos_handed_to_network = 9, connection_lost_while_pending = 10, read_retry_remote_canceled = 11, recv_acked_by_peer = 12, write_acked_by_peer = 13, write_acked_by_peer_and_sis = 14, conflict_discarded_by_peer = 15, neg_acked = 16, barrier_acked = 17, data_received = 18, read_completed_with_error = 19, read_ahead_completed_with_error = 20, write_completed_with_error = 21, completed_ok = 22, resend = 23, fail_frozen_disk_io = 24, restart_frozen_disk_io = 25, nothing = 26 } ; struct bio_and_error { struct bio *bio ; int error ; }; enum hrtimer_restart; enum hrtimer_restart; struct kvec { void *iov_base ; size_t iov_len ; }; struct in_addr { __be32 s_addr ; }; struct sockaddr_in { sa_family_t sin_family ; __be16 sin_port ; struct in_addr sin_addr ; unsigned char __pad[8U] ; }; struct sockaddr_in6 { unsigned short sin6_family ; __be16 sin6_port ; __be32 sin6_flowinfo ; struct in6_addr sin6_addr ; __u32 sin6_scope_id ; }; enum drbd_fencing_p { FP_DONT_CARE = 0, FP_RESOURCE = 1, FP_STONITH = 2 } ; enum drbd_after_sb_p { ASB_DISCONNECT = 0, ASB_DISCARD_YOUNGER_PRI = 1, ASB_DISCARD_OLDER_PRI = 2, ASB_DISCARD_ZERO_CHG = 3, ASB_DISCARD_LEAST_CHG = 4, ASB_DISCARD_LOCAL = 5, ASB_DISCARD_REMOTE = 6, ASB_CONSENSUS = 7, ASB_DISCARD_SECONDARY = 8, ASB_CALL_HELPER = 9, ASB_VIOLENTLY = 10 } ; struct bm_xfer_ctx { unsigned long bm_bits ; unsigned long bm_words ; unsigned long bit_offset ; unsigned long word_offset ; unsigned int packets[2U] ; unsigned int bytes[2U] ; }; enum drbd_bitmap_code { RLE_VLI_Bits = 2 } ; struct p_compressed_bm { struct p_header80 head ; u8 encoding ; u8 code[0U] ; }; enum epoch_event { EV_PUT = 0, EV_GOT_BARRIER_NR = 1, EV_BECAME_LAST = 2, EV_CLEANUP = 32 } ; enum dds_flags { DDSF_FORCED = 1, DDSF_NO_RESYNC = 2 } ; enum determine_dev_size { dev_size_error = -1, unchanged = 0, shrunk = 1, grew = 2 } ; struct bitstream_cursor { u8 *b ; unsigned int bit ; }; struct bitstream { struct bitstream_cursor cur ; unsigned char *buf ; size_t buf_len ; unsigned int pad_bits ; }; enum finish_epoch { FE_STILL_LIVE = 0, FE_DESTROYED = 1, FE_RECYCLED = 2 } ; struct data_cmd { int expect_payload ; size_t pkt_size ; int (*function)(struct drbd_conf * , enum drbd_packets , unsigned int ) ; }; typedef struct drbd_request *req_validator_fn(struct drbd_conf * , u64 , sector_t ); struct asender_cmd { size_t pkt_size ; int (*process)(struct drbd_conf * , struct p_header80 * ) ; }; enum hrtimer_restart; enum hrtimer_restart; struct bio_pair { struct bio bio1 ; struct bio bio2 ; struct bio_vec bv1 ; struct bio_vec bv2 ; struct bio_integrity_payload bip1 ; struct bio_integrity_payload bip2 ; struct bio_vec iv1 ; struct bio_vec iv2 ; atomic_t cnt ; int error ; }; enum hrtimer_restart; enum hrtimer_restart; struct __anonstruct_updates_230 { u32 pos ; u32 extent ; }; struct al_transaction { u32 magic ; u32 tr_number ; struct __anonstruct_updates_230 updates[62U] ; u32 xor_sum ; }; struct update_odbm_work { struct drbd_work w ; unsigned int enr ; }; struct update_al_work { struct drbd_work w ; struct lc_element *al_ext ; struct completion event ; unsigned int enr ; unsigned int old_enr ; }; struct notifier_block { int (*notifier_call)(struct notifier_block * , unsigned long , void * ) ; struct notifier_block *next ; int priority ; }; enum hrtimer_restart; enum hrtimer_restart; enum sock_shutdown_cmd { SHUT_RD = 0, SHUT_WR = 1, SHUT_RDWR = 2 } ; enum drbd_io_error_p { EP_PASS_ON = 0, EP_CALL_HELPER = 1, EP_DETACH = 2 } ; struct after_state_chg_work { struct drbd_work w ; union drbd_state os ; union drbd_state ns ; enum chg_state_flags flags ; struct completion *done ; }; struct meta_data_on_disk { u64 la_size ; u64 uuid[4U] ; u64 device_uuid ; u64 reserved_u64_1 ; u32 flags ; u32 magic ; u32 md_size_sect ; u32 al_offset ; u32 al_nr_extents ; u32 bm_offset ; u32 bm_bytes_per_bit ; u32 la_peer_max_bio_size ; u32 reserved_u32[3U] ; }; struct fault_random_state { unsigned long state ; unsigned long count ; }; typedef __u16 __le16; typedef __u32 __le32; typedef __u64 __le64; enum hrtimer_restart; enum hrtimer_restart; enum umh_wait { UMH_NO_WAIT = -1, UMH_WAIT_EXEC = 0, UMH_WAIT_PROC = 1 } ; struct subprocess_info { struct work_struct work ; struct completion *complete ; char *path ; char **argv ; char **envp ; enum umh_wait wait ; int retval ; int (*init)(struct subprocess_info * , struct cred * ) ; void (*cleanup)(struct subprocess_info * ) ; void *data ; }; enum kobject_action { KOBJ_ADD = 0, KOBJ_REMOVE = 1, KOBJ_CHANGE = 2, KOBJ_MOVE = 3, KOBJ_ONLINE = 4, KOBJ_OFFLINE = 5, KOBJ_MAX = 6 } ; struct cb_id { __u32 idx ; __u32 val ; }; struct cn_msg { struct cb_id id ; __u32 seq ; __u32 ack ; __u16 len ; __u16 flags ; __u8 data[0U] ; }; struct ucred { __u32 pid ; __u32 uid ; __u32 gid ; }; struct netlink_skb_parms { struct ucred creds ; __u32 pid ; __u32 dst_group ; }; enum drbd_ret_code { ERR_CODE_BASE = 100, NO_ERROR = 101, ERR_LOCAL_ADDR = 102, ERR_PEER_ADDR = 103, ERR_OPEN_DISK = 104, ERR_OPEN_MD_DISK = 105, ERR_DISK_NOT_BDEV = 107, ERR_MD_NOT_BDEV = 108, ERR_DISK_TO_SMALL = 111, ERR_MD_DISK_TO_SMALL = 112, ERR_BDCLAIM_DISK = 114, ERR_BDCLAIM_MD_DISK = 115, ERR_MD_IDX_INVALID = 116, ERR_IO_MD_DISK = 118, ERR_MD_INVALID = 119, ERR_AUTH_ALG = 120, ERR_AUTH_ALG_ND = 121, ERR_NOMEM = 122, ERR_DISCARD = 123, ERR_DISK_CONFIGURED = 124, ERR_NET_CONFIGURED = 125, ERR_MANDATORY_TAG = 126, ERR_MINOR_INVALID = 127, ERR_INTR = 129, ERR_RESIZE_RESYNC = 130, ERR_NO_PRIMARY = 131, ERR_SYNC_AFTER = 132, ERR_SYNC_AFTER_CYCLE = 133, ERR_PAUSE_IS_SET = 134, ERR_PAUSE_IS_CLEAR = 135, ERR_PACKET_NR = 137, ERR_NO_DISK = 138, ERR_NOT_PROTO_C = 139, ERR_NOMEM_BITMAP = 140, ERR_INTEGRITY_ALG = 141, ERR_INTEGRITY_ALG_ND = 142, ERR_CPU_MASK_PARSE = 143, ERR_CSUMS_ALG = 144, ERR_CSUMS_ALG_ND = 145, ERR_VERIFY_ALG = 146, ERR_VERIFY_ALG_ND = 147, ERR_CSUMS_RESYNC_RUNNING = 148, ERR_VERIFY_RUNNING = 149, ERR_DATA_NOT_CURRENT = 150, ERR_CONNECTED = 151, ERR_PERM = 152, ERR_NEED_APV_93 = 153, ERR_STONITH_AND_PROT_A = 154, ERR_CONG_NOT_PROTO_A = 155, ERR_PIC_AFTER_DEP = 156, ERR_PIC_PEER_DEP = 157, AFTER_LAST_ERR_CODE = 158 } ; struct drbd_nl_cfg_req { int packet_type ; unsigned int drbd_minor ; int flags ; unsigned short tag_list[0U] ; }; struct drbd_nl_cfg_reply { int packet_type ; unsigned int minor ; int ret_code ; unsigned short tag_list[0U] ; }; struct primary { unsigned char primary_force : 1 ; }; struct disconnect { unsigned char force : 1 ; }; struct resize { __u64 resize_size ; unsigned char resize_force : 1 ; unsigned char no_resync : 1 ; }; struct get_state { int state_i ; }; struct start_ov { __u64 start_sector ; }; struct new_c_uuid { unsigned char clear_bm : 1 ; }; enum drbd_tags { T_primary_force = 32769, T_disk_size = 16386, T_backing_dev = 57347, T_meta_dev = 57348, T_meta_dev_idx = 8197, T_on_io_error = 6, T_fencing = 7, T_use_bmbv = 32805, T_no_disk_flush = 32821, T_no_md_flush = 32822, T_max_bio_bvecs = 56, T_no_disk_barrier = 32825, T_no_disk_drain = 32826, T_my_addr = 57352, T_peer_addr = 57353, T_shared_secret = 49162, T_cram_hmac_alg = 49163, T_integrity_alg = 49196, T_timeout = 14, T_wire_protocol = 8207, T_try_connect_int = 16, T_ping_int = 17, T_max_epoch_size = 18, T_max_buffers = 19, T_unplug_watermark = 20, T_sndbuf_size = 21, T_ko_count = 22, T_after_sb_0p = 24, T_after_sb_1p = 25, T_after_sb_2p = 26, T_rr_conflict = 39, T_ping_timeo = 40, T_rcvbuf_size = 67, T_on_congestion = 81, T_cong_fill = 82, T_cong_extents = 83, T_mind_af = 41020, T_want_lose = 32795, T_two_primaries = 32796, T_always_asbp = 32809, T_no_cork = 32829, T_auto_sndbuf_size = 41022, T_dry_run = 41030, T_force = 32852, T_resize_size = 16413, T_resize_force = 32836, T_no_resync = 41029, T_rate = 30, T_after = 31, T_al_extents = 32, T_verify_alg = 49204, T_cpu_mask = 49203, T_csums_alg = 49216, T_use_rle = 32833, T_on_no_data = 75, T_c_plan_ahead = 76, T_c_delay_target = 77, T_c_fill_target = 78, T_c_max_rate = 79, T_c_min_rate = 80, T_state_i = 33, T_uuids = 49186, T_uuids_flags = 35, T_use_degraded = 32804, T_helper = 49190, T_sync_progress = 43, T_dump_ee_reason = 49197, T_seen_digest = 49198, T_calc_digest = 49199, T_ee_sector = 16432, T_ee_block_id = 16433, T_ee_data = 49202, T_start_sector = 16450, T_clear_bm = 41023 } ; struct tag { char const *name ; int type_n_flags ; int max_len ; }; struct cn_handler_struct { int (*function)(struct drbd_conf * , struct drbd_nl_cfg_req * , struct drbd_nl_cfg_reply * ) ; int reply_body_size ; }; __inline static void set_bit(unsigned int nr , unsigned long volatile *addr ) { { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; bts %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return; } } __inline static void clear_bit(int nr , unsigned long volatile *addr ) { { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; btr %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr)); return; } } __inline static int test_and_set_bit(int nr , unsigned long volatile *addr ) { int oldbit ; { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; bts %2,%1\n\tsbb %0,%0": "=r" (oldbit), "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return (oldbit); } } __inline static int __test_and_set_bit(int nr , unsigned long volatile *addr ) { int oldbit ; { __asm__ ("bts %2,%1\n\tsbb %0,%0": "=r" (oldbit), "+m" (*((long volatile *)addr)): "Ir" (nr)); return (oldbit); } } __inline static int __test_and_clear_bit(int nr , unsigned long volatile *addr ) { int oldbit ; { __asm__ volatile ("btr %2,%1\n\tsbb %0,%0": "=r" (oldbit), "+m" (*((long volatile *)addr)): "Ir" (nr)); return (oldbit); } } __inline static int constant_test_bit(unsigned int nr , unsigned long const volatile *addr ) { { return ((int )((unsigned long )*(addr + (unsigned long )(nr / 64U)) >> ((int )nr & 63)) & 1); } } __inline static int variable_test_bit(int nr , unsigned long const volatile *addr ) { int oldbit ; { __asm__ volatile ("bt %2,%1\n\tsbb %0,%0": "=r" (oldbit): "m" (*((unsigned long *)addr)), "Ir" (nr)); return (oldbit); } } extern unsigned long find_next_bit(unsigned long const * , unsigned long , unsigned long ) ; extern unsigned long find_next_zero_bit(unsigned long const * , unsigned long , unsigned long ) ; __inline static unsigned long __arch_hweight64(__u64 w ) { unsigned long res ; { res = 0UL; __asm__ ("661:\n\tcall __sw_hweight64\n662:\n.section .altinstructions,\"a\"\n .balign 8 \n .quad 661b\n .quad 663f\n\t .word (4*32+23)\n\t .byte 662b-661b\n\t .byte 664f-663f\n.previous\n.section .discard,\"aw\",@progbits\n\t .byte 0xff + (664f-663f) - (662b-661b)\n.previous\n.section .altinstr_replacement, \"ax\"\n663:\n\t.byte 0xf3,0x48,0x0f,0xb8,0xc7\n664:\n.previous": "=a" (res): "D" (w)); return (res); } } __inline static unsigned long find_next_zero_bit_le(void const *addr , unsigned long size , unsigned long offset ) { unsigned long tmp ; { { tmp = find_next_zero_bit((unsigned long const *)addr, size, offset); } return (tmp); } } __inline static unsigned long find_next_bit_le(void const *addr , unsigned long size , unsigned long offset ) { unsigned long tmp ; { { tmp = find_next_bit((unsigned long const *)addr, size, offset); } return (tmp); } } __inline static int test_bit_le(int nr , void const *addr ) { int tmp ; { { tmp = variable_test_bit(nr, (unsigned long const volatile *)addr); } return (tmp); } } __inline static int __test_and_set_bit_le(int nr , void *addr ) { int tmp ; { { tmp = __test_and_set_bit(nr, (unsigned long volatile *)addr); } return (tmp); } } __inline static int __test_and_clear_bit_le(int nr , void *addr ) { int tmp ; { { tmp = __test_and_clear_bit(nr, (unsigned long volatile *)addr); } return (tmp); } } __inline static unsigned long hweight_long(unsigned long w ) { unsigned long tmp ; { { tmp = __arch_hweight64((__u64 )w); } return (tmp); } } extern int printk(char const * , ...) ; extern void warn_slowpath_null(char const * , int const ) ; extern void __might_sleep(char const * , int , int ) ; extern void __bad_percpu_size(void) ; extern struct task_struct *current_task ; __inline static struct task_struct *get_current(void) { struct task_struct *pfo_ret__ ; { if (1) { goto case_8; } else { goto switch_default; if (0) { __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& current_task)); goto ldv_2386; __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_2386; __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_2386; case_8: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_2386; switch_default: { __bad_percpu_size(); } } else { } } ldv_2386: ; return (pfo_ret__); } } extern void *__memcpy(void * , void const * , size_t ) ; extern void *memset(void * , int , size_t ) ; __inline static void atomic_add(int i , atomic_t *v ) { { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; addl %1,%0": "+m" (v->counter): "ir" (i)); return; } } __inline static void atomic_inc(atomic_t *v ) { { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; incl %0": "+m" (v->counter)); return; } } __inline static int atomic_dec_and_test(atomic_t *v ) { unsigned char c ; { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; decl %0; sete %1": "+m" (v->counter), "=qm" (c): : "memory"); return ((unsigned int )c != 0U); } } __inline static int atomic_add_return(int i , atomic_t *v ) { int __i ; { __i = i; __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; xaddl %0, %1": "+r" (i), "+m" (v->counter): : "memory"); return (i + __i); } } __inline static int atomic_sub_return(int i , atomic_t *v ) { int tmp ; { { tmp = atomic_add_return(- i, v); } return (tmp); } } extern unsigned long kernel_stack ; __inline static struct thread_info *current_thread_info(void) { struct thread_info *ti ; unsigned long pfo_ret__ ; { if (1) { goto case_8; } else { goto switch_default; if (0) { __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5782; __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5782; __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5782; case_8: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5782; switch_default: { __bad_percpu_size(); } } else { } } ldv_5782: ti = (struct thread_info *)(pfo_ret__ - 8152UL); return (ti); } } extern void __raw_spin_lock_init(raw_spinlock_t * , char const * , struct lock_class_key * ) ; extern void _raw_spin_lock_irq(raw_spinlock_t * ) ; extern unsigned long _raw_spin_lock_irqsave(raw_spinlock_t * ) ; extern void _raw_spin_unlock_irq(raw_spinlock_t * ) ; extern void _raw_spin_unlock_irqrestore(raw_spinlock_t * , unsigned long ) ; extern void _raw_read_lock(rwlock_t * ) ; extern void _raw_read_unlock(rwlock_t * ) ; __inline static raw_spinlock_t *spinlock_check(spinlock_t *lock ) { { return (& lock->ldv_6060.rlock); } } __inline static void spin_lock_irq(spinlock_t *lock ) { { { _raw_spin_lock_irq(& lock->ldv_6060.rlock); } return; } } __inline static void spin_unlock_irq(spinlock_t *lock ) { { { _raw_spin_unlock_irq(& lock->ldv_6060.rlock); } return; } } __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) { { { _raw_spin_unlock_irqrestore(& lock->ldv_6060.rlock, flags); } return; } } extern void __init_waitqueue_head(wait_queue_head_t * , struct lock_class_key * ) ; extern void __wake_up(wait_queue_head_t * , unsigned int , int , void * ) ; extern void prepare_to_wait(wait_queue_head_t * , wait_queue_t * , int ) ; extern void finish_wait(wait_queue_head_t * , wait_queue_t * ) ; extern int autoremove_wake_function(wait_queue_t * , unsigned int , int , void * ) ; extern void __mutex_init(struct mutex * , char const * , struct lock_class_key * ) ; extern void mutex_lock_nested(struct mutex * , unsigned int ) ; extern int mutex_trylock(struct mutex * ) ; extern void mutex_unlock(struct mutex * ) ; extern unsigned long volatile jiffies ; __inline static void init_completion(struct completion *x ) { struct lock_class_key __key ; { { x->done = 0U; __init_waitqueue_head(& x->wait, & __key); } return; } } extern void wait_for_completion(struct completion * ) ; extern void complete(struct completion * ) ; extern void *vmalloc(unsigned long ) ; extern void vfree(void const * ) ; extern struct page *alloc_pages_current(gfp_t , unsigned int ) ; __inline static struct page *alloc_pages(gfp_t gfp_mask , unsigned int order ) { struct page *tmp ; { { tmp = alloc_pages_current(gfp_mask, order); } return (tmp); } } extern void __free_pages(struct page * , unsigned int ) ; extern void kfree(void const * ) ; int ldv_try_module_get(struct module *module ) ; void ldv_module_get(struct module *module ) ; void ldv_module_put(struct module *module ) ; unsigned int ldv_module_refcount(void) ; void ldv_module_put_and_exit(void) ; extern void *__kmalloc(size_t , gfp_t ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) { void *tmp___2 ; { { tmp___2 = __kmalloc(size, flags); } return (tmp___2); } } __inline static void *kzalloc(size_t size , gfp_t flags ) { void *tmp ; { { tmp = kmalloc(size, flags | 32768U); } return (tmp); } } extern int dev_printk(char const * , struct device const * , char const * , ...) ; extern int dev_alert(struct device const * , char const * , ...) ; extern int dev_err(struct device const * , char const * , ...) ; extern int dev_warn(struct device const * , char const * , ...) ; extern int _dev_info(struct device const * , char const * , ...) ; extern void put_page(struct page * ) ; __inline static void *lowmem_page_address(struct page *page ) { { return ((void *)((unsigned long )((unsigned long long )(((long )page + 24189255811072L) / 56L) << 12) + 0x0fff880000000000UL)); } } extern void submit_bio(int , struct bio * ) ; extern void schedule(void) ; extern int _cond_resched(void) ; __inline static void pagefault_disable(void) { struct thread_info *tmp ; { { tmp = current_thread_info(); tmp->preempt_count = tmp->preempt_count + 1; __asm__ volatile ("": : : "memory"); } return; } } __inline static void pagefault_enable(void) { struct thread_info *tmp ; { { __asm__ volatile ("": : : "memory"); tmp = current_thread_info(); tmp->preempt_count = tmp->preempt_count + -1; __asm__ volatile ("": : : "memory"); } return; } } extern int ___ratelimit(struct ratelimit_state * , char const * ) ; __inline static void *__kmap_atomic(struct page *page ) { void *tmp ; { { pagefault_disable(); tmp = lowmem_page_address(page); } return (tmp); } } __inline static void __kunmap_atomic(void *addr ) { { { pagefault_enable(); } return; } } extern struct bio *bio_alloc(gfp_t , int ) ; extern void bio_put(struct bio * ) ; extern void bio_endio(struct bio * , int ) ; extern int bio_add_page(struct bio * , struct page * , unsigned int , unsigned int ) ; extern int blkdev_issue_flush(struct block_device * , gfp_t , sector_t * ) ; int enable_faults ; int fault_rate ; unsigned int _drbd_insert_fault(struct drbd_conf *mdev , unsigned int type ) ; __inline static int drbd_insert_fault(struct drbd_conf *mdev , unsigned int type ) { unsigned int tmp ; int tmp___0 ; { if (fault_rate != 0) { if ((enable_faults >> (int )type) & 1) { { tmp = _drbd_insert_fault(mdev, type); } if (tmp != 0U) { tmp___0 = 1; } else { tmp___0 = 0; } } else { tmp___0 = 0; } } else { tmp___0 = 0; } return (tmp___0); } } struct ratelimit_state drbd_ratelimit_state ; enum drbd_state_rv __drbd_set_state(struct drbd_conf *mdev , union drbd_state ns , enum chg_state_flags flags , struct completion *done ) ; void drbd_go_diskless(struct drbd_conf *mdev ) ; void drbd_ldev_destroy(struct drbd_conf *mdev ) ; int drbd_bm_init(struct drbd_conf *mdev ) ; int drbd_bm_resize(struct drbd_conf *mdev , sector_t capacity , int set_new_bits ) ; void drbd_bm_cleanup(struct drbd_conf *mdev ) ; void drbd_bm_set_all(struct drbd_conf *mdev ) ; void drbd_bm_clear_all(struct drbd_conf *mdev ) ; int drbd_bm_set_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) ; int drbd_bm_clear_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) ; int drbd_bm_count_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) ; void _drbd_bm_set_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) ; int drbd_bm_test_bit(struct drbd_conf *mdev , unsigned long const bitnr ) ; int drbd_bm_e_weight(struct drbd_conf *mdev , unsigned long enr ) ; int drbd_bm_write_page(struct drbd_conf *mdev , unsigned int idx ) ; int drbd_bm_read(struct drbd_conf *mdev ) ; int drbd_bm_write(struct drbd_conf *mdev ) ; unsigned long drbd_bm_ALe_set_all(struct drbd_conf *mdev , unsigned long al_enr ) ; size_t drbd_bm_words(struct drbd_conf *mdev ) ; unsigned long drbd_bm_bits(struct drbd_conf *mdev ) ; sector_t drbd_bm_capacity(struct drbd_conf *mdev ) ; unsigned long drbd_bm_find_next(struct drbd_conf *mdev , unsigned long bm_fo ) ; unsigned long _drbd_bm_find_next(struct drbd_conf *mdev , unsigned long bm_fo ) ; unsigned long _drbd_bm_find_next_zero(struct drbd_conf *mdev , unsigned long bm_fo ) ; unsigned long _drbd_bm_total_weight(struct drbd_conf *mdev ) ; unsigned long drbd_bm_total_weight(struct drbd_conf *mdev ) ; void drbd_bm_merge_lel(struct drbd_conf *mdev , size_t offset , size_t number , unsigned long *buffer ) ; void drbd_bm_get_lel(struct drbd_conf *mdev , size_t offset , size_t number , unsigned long *buffer ) ; void drbd_bm_lock(struct drbd_conf *mdev , char *why , enum bm_flag flags ) ; void drbd_bm_unlock(struct drbd_conf *mdev ) ; rwlock_t global_state_lock ; char *ppsize(char *buf , unsigned long long size ) ; __inline static enum drbd_state_rv _drbd_set_state(struct drbd_conf *mdev , union drbd_state ns , enum chg_state_flags flags , struct completion *done ) { enum drbd_state_rv rv ; { { _raw_read_lock(& global_state_lock); rv = __drbd_set_state(mdev, ns, flags, done); _raw_read_unlock(& global_state_lock); } return (rv); } } __inline static void __drbd_chk_io_error_(struct drbd_conf *mdev , int forcedetach , char const *where ) { int tmp ; union drbd_state __ns ; union drbd_state __ns___0 ; { if ((mdev->ldev)->dc.on_io_error == 0) { goto case_0; } else if ((mdev->ldev)->dc.on_io_error == 2) { goto case_2; } else if ((mdev->ldev)->dc.on_io_error == 1) { goto case_1; } else if (0) { case_0: ; if (forcedetach == 0) { { tmp = ___ratelimit(& drbd_ratelimit_state, "__drbd_chk_io_error_"); } if (tmp != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s.\n", where); } } else { } if ((int )mdev->state.ldv_38339.disk > 4) { { __ns.i = mdev->state.i; __ns.ldv_38339.disk = (unsigned char)4; _drbd_set_state(mdev, __ns, (enum chg_state_flags )1, (struct completion *)0); } } else { } goto ldv_47613; } else { } case_2: ; case_1: { set_bit(19U, (unsigned long volatile *)(& mdev->flags)); } if ((int )mdev->state.ldv_38339.disk > 2) { { __ns___0.i = mdev->state.i; __ns___0.ldv_38339.disk = (unsigned char)2; _drbd_set_state(mdev, __ns___0, (enum chg_state_flags )1, (struct completion *)0); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s. Detaching...\n", where); } } else { } goto ldv_47613; } else { } ldv_47613: ; return; } } __inline static void drbd_chk_io_error_(struct drbd_conf *mdev , int error , int forcedetach , char const *where ) { unsigned long flags ; raw_spinlock_t *tmp ; { if (error != 0) { { tmp = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp); __drbd_chk_io_error_(mdev, forcedetach, where); spin_unlock_irqrestore(& mdev->req_lock, flags); } } else { } return; } } __inline static sector_t drbd_md_last_sector(struct drbd_backing_dev *bdev ) { { if (bdev->dc.meta_dev_idx == -1) { goto case_neg_1; } else if (bdev->dc.meta_dev_idx == -3) { goto case_neg_3; } else if (bdev->dc.meta_dev_idx == -2) { goto case_neg_2; } else { goto switch_default; if (0) { case_neg_1: ; case_neg_3: ; return ((sector_t )(bdev->md.md_offset + 7ULL)); case_neg_2: ; switch_default: ; return ((sector_t )(bdev->md.md_offset + (u64 )bdev->md.md_size_sect)); } else { } } } } __inline static void put_ldev(struct drbd_conf *mdev ) { int i ; int tmp ; { { tmp = atomic_sub_return(1, & mdev->local_cnt); i = tmp; } if (i < 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( i >= 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/inst/current/envs/linux-3.0.1/linux-3.0.1/drivers/block/drbd/drbd_int.h", 2164); } } else { } if (i == 0) { if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 0U) { { drbd_ldev_destroy(mdev); } } else { } if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 4U) { { drbd_go_diskless(mdev); } } else { } { __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); } } else { } return; } } __inline static int _get_ldev_if_state(struct drbd_conf *mdev , enum drbd_disk_state mins ) { int io_allowed ; { if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 0U) { return (0); } else { } { atomic_inc(& mdev->local_cnt); io_allowed = (unsigned int )mdev->state.ldv_38339.disk >= (unsigned int )mins; } if (io_allowed == 0) { { put_ldev(mdev); } } else { } return (io_allowed); } } __inline static void drbd_md_flush(struct drbd_conf *mdev ) { int r ; int tmp ; { { tmp = constant_test_bit(14U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp != 0) { return; } else { } { r = blkdev_issue_flush((mdev->ldev)->md_bdev, 208U, (sector_t *)0); } if (r != 0) { { set_bit(14U, (unsigned long volatile *)(& mdev->flags)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "meta data flush failed with status %d, disabling md-flushes\n", r); } } else { } return; } } static void __bm_print_lock_info(struct drbd_conf *mdev , char const *func ) { struct drbd_bitmap *b ; int tmp ; char *tmp___0 ; char *tmp___1 ; char *tmp___2 ; char *tmp___3 ; struct task_struct *tmp___7 ; char *tmp___8 ; struct task_struct *tmp___9 ; char *tmp___10 ; struct task_struct *tmp___11 ; char *tmp___12 ; struct task_struct *tmp___13 ; { { b = mdev->bitmap; tmp = ___ratelimit(& drbd_ratelimit_state, "__bm_print_lock_info"); } if (tmp == 0) { return; } else { } if ((unsigned long )b->bm_task != (unsigned long )mdev->receiver.task) { if ((unsigned long )b->bm_task != (unsigned long )mdev->asender.task) { if ((unsigned long )b->bm_task == (unsigned long )mdev->worker.task) { tmp___0 = (char *)"worker"; } else { tmp___0 = (char *)"?"; } tmp___1 = tmp___0; } else { tmp___1 = (char *)"asender"; } tmp___2 = tmp___1; } else { tmp___2 = (char *)"receiver"; } if ((unsigned long )b->bm_why != (unsigned long )((char *)0)) { tmp___3 = b->bm_why; } else { tmp___3 = (char *)"?"; } { tmp___13 = get_current(); } if ((unsigned long )tmp___13 != (unsigned long )mdev->receiver.task) { { tmp___11 = get_current(); } if ((unsigned long )tmp___11 != (unsigned long )mdev->asender.task) { { tmp___9 = get_current(); } if ((unsigned long )tmp___9 != (unsigned long )mdev->worker.task) { { tmp___7 = get_current(); tmp___8 = (char *)(& tmp___7->comm); } } else { tmp___8 = (char *)"worker"; } tmp___10 = tmp___8; } else { tmp___10 = (char *)"asender"; } tmp___12 = tmp___10; } else { tmp___12 = (char *)"receiver"; } { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "FIXME %s in %s, bitmap locked for \'%s\' by %s\n", tmp___12, func, tmp___3, tmp___2); } return; } } void drbd_bm_lock(struct drbd_conf *mdev , char *why , enum bm_flag flags ) { struct drbd_bitmap *b ; int trylock_failed ; int tmp ; char *tmp___0 ; char *tmp___1 ; char *tmp___2 ; char *tmp___3 ; struct task_struct *tmp___7 ; char *tmp___8 ; struct task_struct *tmp___9 ; char *tmp___10 ; struct task_struct *tmp___11 ; char *tmp___12 ; struct task_struct *tmp___13 ; { b = mdev->bitmap; if ((unsigned long )b == (unsigned long )((struct drbd_bitmap *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "FIXME no bitmap in drbd_bm_lock!?\n"); } return; } else { } { tmp = mutex_trylock(& b->bm_change); trylock_failed = tmp == 0; } if (trylock_failed != 0) { if ((unsigned long )b->bm_task != (unsigned long )mdev->receiver.task) { if ((unsigned long )b->bm_task != (unsigned long )mdev->asender.task) { if ((unsigned long )b->bm_task == (unsigned long )mdev->worker.task) { tmp___0 = (char *)"worker"; } else { tmp___0 = (char *)"?"; } tmp___1 = tmp___0; } else { tmp___1 = (char *)"asender"; } tmp___2 = tmp___1; } else { tmp___2 = (char *)"receiver"; } if ((unsigned long )b->bm_why != (unsigned long )((char *)0)) { tmp___3 = b->bm_why; } else { tmp___3 = (char *)"?"; } { tmp___13 = get_current(); } if ((unsigned long )tmp___13 != (unsigned long )mdev->receiver.task) { { tmp___11 = get_current(); } if ((unsigned long )tmp___11 != (unsigned long )mdev->asender.task) { { tmp___9 = get_current(); } if ((unsigned long )tmp___9 != (unsigned long )mdev->worker.task) { { tmp___7 = get_current(); tmp___8 = (char *)(& tmp___7->comm); } } else { tmp___8 = (char *)"worker"; } tmp___10 = tmp___8; } else { tmp___10 = (char *)"asender"; } tmp___12 = tmp___10; } else { tmp___12 = (char *)"receiver"; } { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s going to \'%s\' but bitmap already locked for \'%s\' by %s\n", tmp___12, why, tmp___3, tmp___2); mutex_lock_nested(& b->bm_change, 0U); } } else { } if (((unsigned int )b->bm_flags & 7U) != 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "FIXME bitmap already locked in bm_lock\n"); } } else { } { b->bm_flags = (enum bm_flag )((unsigned int )b->bm_flags | ((unsigned int )flags & 7U)); b->bm_why = why; b->bm_task = get_current(); } return; } } void drbd_bm_unlock(struct drbd_conf *mdev ) { struct drbd_bitmap *b ; { b = mdev->bitmap; if ((unsigned long )b == (unsigned long )((struct drbd_bitmap *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "FIXME no bitmap in drbd_bm_unlock!?\n"); } return; } else { } if (((unsigned int )(mdev->bitmap)->bm_flags & 7U) == 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "FIXME bitmap not locked in bm_unlock\n"); } } else { } { b->bm_flags = (enum bm_flag )((unsigned int )b->bm_flags & 4294967288U); b->bm_why = (char *)0; b->bm_task = (struct task_struct *)0; mutex_unlock(& b->bm_change); } return; } } static void bm_store_page_idx(struct page *page , unsigned long idx ) { long tmp ; { { tmp = __builtin_expect((long )((idx & 0x0fffffffff000000UL) != 0UL), 0L); } if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p"), "i" (215), "i" (12UL)); ldv_47884: ; goto ldv_47884; } else { } page->ldv_14032.ldv_14029.private = page->ldv_14032.ldv_14029.private | idx; return; } } static unsigned long bm_page_to_idx(struct page *page ) { { return (page->ldv_14032.ldv_14029.private & 16777215UL); } } static void bm_page_lock_io(struct drbd_conf *mdev , int page_nr ) { struct drbd_bitmap *b ; void *addr ; int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; { { b = mdev->bitmap; addr = (void *)(& (*(b->bm_pages + (unsigned long )page_nr))->ldv_14032.ldv_14029.private); tmp = test_and_set_bit(31, (unsigned long volatile *)addr); } if (tmp == 0) { goto ldv_47894; } else { } { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_47897: { prepare_to_wait(& b->bm_io_wait, & __wait, 2); tmp___1 = test_and_set_bit(31, (unsigned long volatile *)addr); } if (tmp___1 == 0) { goto ldv_47896; } else { } { schedule(); } goto ldv_47897; ldv_47896: { finish_wait(& b->bm_io_wait, & __wait); } ldv_47894: ; return; } } static void bm_page_unlock_io(struct drbd_conf *mdev , int page_nr ) { struct drbd_bitmap *b ; void *addr ; { { b = mdev->bitmap; addr = (void *)(& (*(b->bm_pages + (unsigned long )page_nr))->ldv_14032.ldv_14029.private); clear_bit(31, (unsigned long volatile *)addr); __asm__ volatile ("": : : "memory"); __wake_up(& (mdev->bitmap)->bm_io_wait, 3U, 1, (void *)0); } return; } } static void bm_set_page_unchanged(struct page *page ) { { { clear_bit(29, (unsigned long volatile *)(& page->ldv_14032.ldv_14029.private)); clear_bit(28, (unsigned long volatile *)(& page->ldv_14032.ldv_14029.private)); } return; } } static void bm_set_page_need_writeout(struct page *page ) { { { set_bit(29U, (unsigned long volatile *)(& page->ldv_14032.ldv_14029.private)); } return; } } static int bm_test_page_unchanged(struct page *page ) { unsigned long const volatile *addr ; { addr = (unsigned long const volatile *)(& page->ldv_14032.ldv_14029.private); return (((unsigned long )*addr & 805306368UL) == 0UL); } } static void bm_set_page_io_err(struct page *page ) { { { set_bit(30U, (unsigned long volatile *)(& page->ldv_14032.ldv_14029.private)); } return; } } static void bm_clear_page_io_err(struct page *page ) { { { clear_bit(30, (unsigned long volatile *)(& page->ldv_14032.ldv_14029.private)); } return; } } static void bm_set_page_lazy_writeout(struct page *page ) { { { set_bit(28U, (unsigned long volatile *)(& page->ldv_14032.ldv_14029.private)); } return; } } static int bm_test_page_lazy_writeout(struct page *page ) { int tmp ; { { tmp = constant_test_bit(28U, (unsigned long const volatile *)(& page->ldv_14032.ldv_14029.private)); } return (tmp); } } static unsigned int bm_word_to_page_idx(struct drbd_bitmap *b , unsigned long long_nr ) { unsigned int page_nr ; long tmp ; { { page_nr = (unsigned int )(long_nr >> 9); tmp = __builtin_expect((long )((size_t )page_nr >= b->bm_number_of_pages), 0L); } if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p"), "i" (288), "i" (12UL)); ldv_47931: ; goto ldv_47931; } else { } return (page_nr); } } static unsigned int bm_bit_to_page_idx(struct drbd_bitmap *b , u64 bitnr ) { unsigned int page_nr ; long tmp ; { { page_nr = (unsigned int )(bitnr >> 15); tmp = __builtin_expect((long )((size_t )page_nr >= b->bm_number_of_pages), 0L); } if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p"), "i" (296), "i" (12UL)); ldv_47937: ; goto ldv_47937; } else { } return (page_nr); } } static unsigned long *__bm_map_pidx(struct drbd_bitmap *b , unsigned int idx , enum km_type const km ) { struct page *page ; void *tmp ; { { page = *(b->bm_pages + (unsigned long )idx); tmp = __kmap_atomic(page); } return ((unsigned long *)tmp); } } static unsigned long *bm_map_pidx(struct drbd_bitmap *b , unsigned int idx ) { unsigned long *tmp ; { { tmp = __bm_map_pidx(b, idx, (enum km_type const )10); } return (tmp); } } static void __bm_unmap(unsigned long *p_addr , enum km_type const km ) { { { __kunmap_atomic((void *)p_addr); } return; } } static void bm_unmap(unsigned long *p_addr ) { { return; } } static void bm_free_pages(struct page **pages , unsigned long number ) { unsigned long i ; { if ((unsigned long )pages == (unsigned long )((struct page **)0)) { return; } else { } i = 0UL; goto ldv_47962; ldv_47961: ; if ((unsigned long )*(pages + i) == (unsigned long )((struct page *)0)) { { printk("<1>drbd: bm_free_pages tried to free a NULL pointer; i=%lu n=%lu\n", i, number); } goto ldv_47960; } else { } { __free_pages(*(pages + i), 0U); *(pages + i) = (struct page *)0; } ldv_47960: i = i + 1UL; ldv_47962: ; if (i < number) { goto ldv_47961; } else { goto ldv_47963; } ldv_47963: ; return; } } static void bm_vk_free(void *ptr , int v ) { { if (v != 0) { { vfree((void const *)ptr); } } else { { kfree((void const *)ptr); } } return; } } static struct page **bm_realloc_pages(struct drbd_bitmap *b , unsigned long want ) { struct page **old_pages ; struct page **new_pages ; struct page *page ; unsigned int i ; unsigned int bytes ; unsigned int vmalloced ; unsigned long have ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; void *tmp___3 ; void *tmp___4 ; { { old_pages = b->bm_pages; vmalloced = 0U; have = b->bm_number_of_pages; tmp = __builtin_expect((long )(have == 0UL), 0L); } if (tmp != 0L) { { tmp___0 = __builtin_expect((long )((unsigned long )old_pages != (unsigned long )((struct page **)0)), 0L); } if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p"), "i" (377), "i" (12UL)); ldv_47979: ; goto ldv_47979; } else { } } else { } { tmp___1 = __builtin_expect((long )(have != 0UL), 0L); } if (tmp___1 != 0L) { { tmp___2 = __builtin_expect((long )((unsigned long )old_pages == (unsigned long )((struct page **)0)), 0L); } if (tmp___2 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p"), "i" (378), "i" (12UL)); ldv_47980: ; goto ldv_47980; } else { } } else { } if (have == want) { return (old_pages); } else { } { bytes = (unsigned int )want * 8U; tmp___3 = kmalloc((size_t )bytes, 208U); new_pages = (struct page **)tmp___3; } if ((unsigned long )new_pages == (unsigned long )((struct page **)0)) { { tmp___4 = vmalloc((unsigned long )bytes); new_pages = (struct page **)tmp___4; } if ((unsigned long )new_pages == (unsigned long )((struct page **)0)) { return ((struct page **)0); } else { } vmalloced = 1U; } else { } { memset((void *)new_pages, 0, (size_t )bytes); } if (want >= have) { i = 0U; goto ldv_47982; ldv_47981: *(new_pages + (unsigned long )i) = *(old_pages + (unsigned long )i); i = i + 1U; ldv_47982: ; if ((unsigned long )i < have) { goto ldv_47981; } else { goto ldv_47983; } ldv_47983: ; goto ldv_47985; ldv_47984: { page = alloc_pages(131282U, 0U); } if ((unsigned long )page == (unsigned long )((struct page *)0)) { { bm_free_pages(new_pages + have, (unsigned long )i - have); bm_vk_free((void *)new_pages, (int )vmalloced); } return ((struct page **)0); } else { } { bm_store_page_idx(page, (unsigned long )i); *(new_pages + (unsigned long )i) = page; i = i + 1U; } ldv_47985: ; if ((unsigned long )i < want) { goto ldv_47984; } else { goto ldv_47986; } ldv_47986: ; } else { i = 0U; goto ldv_47988; ldv_47987: *(new_pages + (unsigned long )i) = *(old_pages + (unsigned long )i); i = i + 1U; ldv_47988: ; if ((unsigned long )i < want) { goto ldv_47987; } else { goto ldv_47989; } ldv_47989: ; } if (vmalloced != 0U) { b->bm_flags = (enum bm_flag )((unsigned int )b->bm_flags | 65536U); } else { b->bm_flags = (enum bm_flag )((unsigned int )b->bm_flags & 4294901759U); } return (new_pages); } } int drbd_bm_init(struct drbd_conf *mdev ) { struct drbd_bitmap *b ; int __ret_warn_on ; long tmp ; void *tmp___0 ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; { { b = mdev->bitmap; __ret_warn_on = (unsigned long )b != (unsigned long )((struct drbd_bitmap *)0); tmp = __builtin_expect((long )(__ret_warn_on != 0), 0L); } if (tmp != 0L) { { warn_slowpath_null("/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", (int const )436); } } else { } { __builtin_expect((long )(__ret_warn_on != 0), 0L); tmp___0 = kzalloc(400UL, 208U); b = (struct drbd_bitmap *)tmp___0; } if ((unsigned long )b == (unsigned long )((struct drbd_bitmap *)0)) { return (-12); } else { } { spinlock_check(& b->bm_lock); __raw_spin_lock_init(& b->bm_lock.ldv_6060.rlock, "&(&b->bm_lock)->rlock", & __key); __mutex_init(& b->bm_change, "&b->bm_change", & __key___0); __init_waitqueue_head(& b->bm_io_wait, & __key___1); mdev->bitmap = b; } return (0); } } sector_t drbd_bm_capacity(struct drbd_conf *mdev ) { int _b ; { _b = (unsigned long )mdev->bitmap == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_capacity", (char *)"!mdev->bitmap", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 451); } } else { } if (_b != 0) { return (0UL); } else { } return ((mdev->bitmap)->bm_dev_capacity); } } void drbd_bm_cleanup(struct drbd_conf *mdev ) { int _b ; { _b = (unsigned long )mdev->bitmap == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_cleanup", (char *)"!mdev->bitmap", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 459); } } else { } if (_b != 0) { return; } else { } { bm_free_pages((mdev->bitmap)->bm_pages, (mdev->bitmap)->bm_number_of_pages); bm_vk_free((void *)(mdev->bitmap)->bm_pages, (int )(mdev->bitmap)->bm_flags & 65536); kfree((void const *)mdev->bitmap); mdev->bitmap = (struct drbd_bitmap *)0; } return; } } static int bm_clear_surplus(struct drbd_bitmap *b ) { unsigned long mask ; unsigned long *p_addr ; unsigned long *bm ; int tmp ; int cleared ; unsigned long tmp___0 ; { { cleared = 0; tmp = (int )b->bm_bits & 32767; mask = (1UL << (tmp & 63)) - 1UL; mask = mask; p_addr = bm_map_pidx(b, (unsigned int )b->bm_number_of_pages - 1U); bm = p_addr + (unsigned long )(tmp / 64); } if (mask != 0UL) { { tmp___0 = hweight_long(*bm & ~ mask); cleared = (int )tmp___0; *bm = *bm & mask; bm = bm + 1; } } else { } { bm_unmap(p_addr); } return (cleared); } } static void bm_set_surplus(struct drbd_bitmap *b ) { unsigned long mask ; unsigned long *p_addr ; unsigned long *bm ; int tmp ; { { tmp = (int )b->bm_bits & 32767; mask = (1UL << (tmp & 63)) - 1UL; mask = mask; p_addr = bm_map_pidx(b, (unsigned int )b->bm_number_of_pages - 1U); bm = p_addr + (unsigned long )(tmp / 64); } if (mask != 0UL) { *bm = *bm | ~ mask; bm = bm + 1; } else { } { bm_unmap(p_addr); } return; } } static unsigned long bm_count_bits(struct drbd_bitmap *b ) { unsigned long *p_addr ; unsigned long bits ; unsigned long mask ; int idx ; int i ; int last_word ; unsigned long tmp ; unsigned long tmp___0 ; unsigned long tmp___1 ; { bits = 0UL; mask = (1UL << ((int )b->bm_bits & 63)) - 1UL; idx = 0; goto ldv_48040; ldv_48039: { p_addr = __bm_map_pidx(b, (unsigned int )idx, (enum km_type const )3); i = 0; } goto ldv_48036; ldv_48035: { tmp = hweight_long(*(p_addr + (unsigned long )i)); bits = tmp + bits; i = i + 1; } ldv_48036: ; if ((unsigned int )i <= 511U) { goto ldv_48035; } else { goto ldv_48037; } ldv_48037: { __bm_unmap(p_addr, (enum km_type const )3); __might_sleep("/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 559, 0); _cond_resched(); idx = idx + 1; } ldv_48040: ; if ((size_t )idx < b->bm_number_of_pages - 1UL) { goto ldv_48039; } else { goto ldv_48041; } ldv_48041: { last_word = (int )(((b->bm_bits - 1UL) & 32767UL) >> 6); p_addr = __bm_map_pidx(b, (unsigned int )idx, (enum km_type const )3); i = 0; } goto ldv_48043; ldv_48042: { tmp___0 = hweight_long(*(p_addr + (unsigned long )i)); bits = tmp___0 + bits; i = i + 1; } ldv_48043: ; if (i < last_word) { goto ldv_48042; } else { goto ldv_48044; } ldv_48044: { *(p_addr + (unsigned long )last_word) = (unsigned long )((unsigned long long )*(p_addr + (unsigned long )last_word) & (unsigned long long )mask); tmp___1 = hweight_long(*(p_addr + (unsigned long )last_word)); bits = tmp___1 + bits; __bm_unmap(p_addr, (enum km_type const )3); } return (bits); } } static void bm_memset(struct drbd_bitmap *b , size_t offset , int c , size_t len ) { unsigned long *p_addr ; unsigned long *bm ; unsigned int idx ; size_t do_now ; size_t end ; size_t __min1 ; size_t __min2 ; size_t tmp ; { end = offset + len; if (b->bm_words < end) { { printk("<1>drbd: bm_memset end > bm_words\n"); } return; } else { } goto ldv_48060; ldv_48059: __min1 = (offset + 512UL) & 0x0ffffffffffffe00UL; __min2 = end; if (__min1 < __min2) { tmp = __min1; } else { tmp = __min2; } { do_now = tmp - offset; idx = bm_word_to_page_idx(b, offset); p_addr = bm_map_pidx(b, idx); bm = p_addr + (offset & 511UL); } if ((unsigned long )(bm + do_now) > (unsigned long )(p_addr + 512UL)) { { printk("<1>drbd: BUG BUG BUG! p_addr:%p bm:%p do_now:%d\n", p_addr, bm, (int )do_now); } } else { { memset((void *)bm, c, do_now * 8UL); } } { bm_unmap(p_addr); bm_set_page_need_writeout(*(b->bm_pages + (unsigned long )idx)); offset = offset + do_now; } ldv_48060: ; if (offset < end) { goto ldv_48059; } else { goto ldv_48061; } ldv_48061: ; return; } } int drbd_bm_resize(struct drbd_conf *mdev , sector_t capacity , int set_new_bits ) { struct drbd_bitmap *b ; unsigned long bits ; unsigned long words ; unsigned long owords ; unsigned long obits ; unsigned long want ; unsigned long have ; unsigned long onpages ; struct page **npages ; struct page **opages ; int err ; int growing ; int opages_vmalloced ; int _b ; unsigned long tmp ; unsigned long tmp___0 ; size_t tmp___1 ; sector_t tmp___2 ; u64 bits_on_disk ; int tmp___3 ; int tmp___4 ; { b = mdev->bitmap; opages = (struct page **)0; err = 0; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_resize", (char *)"!b", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 622); } } else { } if (_b != 0) { return (-12); } else { } { drbd_bm_lock(mdev, (char *)"resize", (enum bm_flag )7); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_bm_resize called with capacity == %llu\n", (unsigned long long )capacity); } if (b->bm_dev_capacity == capacity) { goto out; } else { } opages_vmalloced = (int )b->bm_flags & 65536; if (capacity == 0UL) { { spin_lock_irq(& b->bm_lock); opages = b->bm_pages; onpages = b->bm_number_of_pages; owords = b->bm_words; b->bm_pages = (struct page **)0; tmp___2 = 0UL; b->bm_dev_capacity = tmp___2; tmp___1 = tmp___2; b->bm_words = tmp___1; tmp___0 = tmp___1; b->bm_bits = tmp___0; tmp = tmp___0; b->bm_set = tmp; b->bm_number_of_pages = tmp; spin_unlock_irq(& b->bm_lock); bm_free_pages(opages, onpages); bm_vk_free((void *)opages, opages_vmalloced); } goto out; } else { } { bits = (capacity + 7UL) >> 3; words = (bits + 63UL) >> 6; tmp___3 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___3 != 0) { { bits_on_disk = ((unsigned long long )(mdev->ldev)->md.md_size_sect - 72ULL) << 12; put_ldev(mdev); } if ((unsigned long long )bits > bits_on_disk) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "bits = %lu\n", bits); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "bits_on_disk = %llu\n", bits_on_disk); err = -28; } goto out; } else { } } else { } want = (words * 8UL + 4095UL) >> 12; have = b->bm_number_of_pages; if (want == have) { if ((unsigned long )b->bm_pages == (unsigned long )((struct page **)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( b->bm_pages != NULL ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 673); } } else { } npages = b->bm_pages; } else { { tmp___4 = drbd_insert_fault(mdev, 7U); } if (tmp___4 != 0) { npages = (struct page **)0; } else { { npages = bm_realloc_pages(b, want); } } } if ((unsigned long )npages == (unsigned long )((struct page **)0)) { err = -12; goto out; } else { } { spin_lock_irq(& b->bm_lock); opages = b->bm_pages; owords = b->bm_words; obits = b->bm_bits; growing = bits > obits; } if ((unsigned long )opages != (unsigned long )((struct page **)0)) { if (growing != 0) { if (set_new_bits != 0) { { bm_set_surplus(b); } } else { } } else { } } else { } b->bm_pages = npages; b->bm_number_of_pages = want; b->bm_bits = bits; b->bm_words = words; b->bm_dev_capacity = capacity; if (growing != 0) { if (set_new_bits != 0) { { bm_memset(b, owords, 255, words - owords); b->bm_set = b->bm_set + (bits - obits); } } else { { bm_memset(b, owords, 0, words - owords); } } } else { } if (want < have) { { bm_free_pages(opages + want, have - want); } } else { } { bm_clear_surplus(b); spin_unlock_irq(& b->bm_lock); } if ((unsigned long )opages != (unsigned long )npages) { { bm_vk_free((void *)opages, opages_vmalloced); } } else { } if (growing == 0) { { b->bm_set = bm_count_bits(b); } } else { } { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "resync bitmap: bits=%lu words=%lu pages=%lu\n", bits, words, want); } out: { drbd_bm_unlock(mdev); } return (err); } } unsigned long _drbd_bm_total_weight(struct drbd_conf *mdev ) { struct drbd_bitmap *b ; unsigned long s ; unsigned long flags ; int _b ; int _b___0 ; raw_spinlock_t *tmp ; { b = mdev->bitmap; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "_drbd_bm_total_weight", (char *)"!b", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 744); } } else { } if (_b != 0) { return (0UL); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "_drbd_bm_total_weight", (char *)"!b->bm_pages", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 745); } } else { } if (_b___0 != 0) { return (0UL); } else { } { tmp = spinlock_check(& b->bm_lock); flags = _raw_spin_lock_irqsave(tmp); s = b->bm_set; spin_unlock_irqrestore(& b->bm_lock, flags); } return (s); } } unsigned long drbd_bm_total_weight(struct drbd_conf *mdev ) { unsigned long s ; int tmp ; { { tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )3); } if (tmp == 0) { return (0UL); } else { } { s = _drbd_bm_total_weight(mdev); put_ldev(mdev); } return (s); } } size_t drbd_bm_words(struct drbd_conf *mdev ) { struct drbd_bitmap *b ; int _b ; int _b___0 ; { b = mdev->bitmap; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_words", (char *)"!b", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 768); } } else { } if (_b != 0) { return (0UL); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_words", (char *)"!b->bm_pages", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 769); } } else { } if (_b___0 != 0) { return (0UL); } else { } return (b->bm_words); } } unsigned long drbd_bm_bits(struct drbd_conf *mdev ) { struct drbd_bitmap *b ; int _b ; { b = mdev->bitmap; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_bits", (char *)"!b", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 777); } } else { } if (_b != 0) { return (0UL); } else { } return (b->bm_bits); } } void drbd_bm_merge_lel(struct drbd_conf *mdev , size_t offset , size_t number , unsigned long *buffer ) { struct drbd_bitmap *b ; unsigned long *p_addr ; unsigned long *bm ; unsigned long word ; unsigned long bits ; unsigned int idx ; size_t end ; size_t do_now ; int _b ; int _b___0 ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; size_t __min1 ; size_t __min2 ; size_t tmp___1 ; unsigned long *tmp___2 ; unsigned long *tmp___3 ; unsigned long tmp___4 ; size_t tmp___5 ; int tmp___6 ; { b = mdev->bitmap; end = offset + number; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_merge_lel", (char *)"!b", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 798); } } else { } if (_b != 0) { return; } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_merge_lel", (char *)"!b->bm_pages", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 799); } } else { } if (_b___0 != 0) { return; } else { } if (number == 0UL) { return; } else { } { __ret_warn_on = b->bm_words <= offset; tmp = __builtin_expect((long )(__ret_warn_on != 0), 0L); } if (tmp != 0L) { { warn_slowpath_null("/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", (int const )802); } } else { } { __builtin_expect((long )(__ret_warn_on != 0), 0L); __ret_warn_on___0 = b->bm_words < end; tmp___0 = __builtin_expect((long )(__ret_warn_on___0 != 0), 0L); } if (tmp___0 != 0L) { { warn_slowpath_null("/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", (int const )803); } } else { } { __builtin_expect((long )(__ret_warn_on___0 != 0), 0L); spin_lock_irq(& b->bm_lock); } goto ldv_48149; ldv_48148: __min1 = (offset + 512UL) & 0x0ffffffffffffe00UL; __min2 = end; if (__min1 < __min2) { tmp___1 = __min1; } else { tmp___1 = __min2; } { do_now = tmp___1 - offset; idx = bm_word_to_page_idx(b, offset); p_addr = bm_map_pidx(b, idx); bm = p_addr + (offset & 511UL); offset = offset + do_now; } goto ldv_48146; ldv_48145: { bits = hweight_long(*bm); tmp___2 = buffer; buffer = buffer + 1; word = *bm | *tmp___2; tmp___3 = bm; bm = bm + 1; *tmp___3 = word; tmp___4 = hweight_long(word); b->bm_set = b->bm_set + (tmp___4 - bits); } ldv_48146: tmp___5 = do_now; do_now = do_now - 1UL; if (tmp___5 != 0UL) { goto ldv_48145; } else { goto ldv_48147; } ldv_48147: { bm_unmap(p_addr); bm_set_page_need_writeout(*(b->bm_pages + (unsigned long )idx)); } ldv_48149: ; if (offset < end) { goto ldv_48148; } else { goto ldv_48150; } ldv_48150: ; if (b->bm_words == end) { { tmp___6 = bm_clear_surplus(b); b->bm_set = b->bm_set - (unsigned long )tmp___6; } } else { } { spin_unlock_irq(& b->bm_lock); } return; } } void drbd_bm_get_lel(struct drbd_conf *mdev , size_t offset , size_t number , unsigned long *buffer ) { struct drbd_bitmap *b ; unsigned long *p_addr ; unsigned long *bm ; size_t end ; size_t do_now ; int _b ; int _b___0 ; size_t __min1 ; size_t __min2 ; size_t tmp ; unsigned int tmp___0 ; unsigned long *tmp___1 ; unsigned long *tmp___2 ; size_t tmp___3 ; { b = mdev->bitmap; end = offset + number; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_get_lel", (char *)"!b", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 843); } } else { } if (_b != 0) { return; } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_get_lel", (char *)"!b->bm_pages", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 844); } } else { } if (_b___0 != 0) { return; } else { } { spin_lock_irq(& b->bm_lock); } if (b->bm_words <= offset) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "offset=%lu number=%lu bm_words=%lu\n", offset, number, b->bm_words); } } else if (b->bm_words < end) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "offset=%lu number=%lu bm_words=%lu\n", offset, number, b->bm_words); } } else if (number == 0UL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "offset=%lu number=%lu bm_words=%lu\n", offset, number, b->bm_words); } } else { goto ldv_48174; ldv_48173: __min1 = (offset + 512UL) & 0x0ffffffffffffe00UL; __min2 = end; if (__min1 < __min2) { tmp = __min1; } else { tmp = __min2; } { do_now = tmp - offset; tmp___0 = bm_word_to_page_idx(b, offset); p_addr = bm_map_pidx(b, tmp___0); bm = p_addr + (offset & 511UL); offset = offset + do_now; } goto ldv_48171; ldv_48170: tmp___1 = buffer; buffer = buffer + 1; tmp___2 = bm; bm = bm + 1; *tmp___1 = *tmp___2; ldv_48171: tmp___3 = do_now; do_now = do_now - 1UL; if (tmp___3 != 0UL) { goto ldv_48170; } else { goto ldv_48172; } ldv_48172: { bm_unmap(p_addr); } ldv_48174: ; if (offset < end) { goto ldv_48173; } else { goto ldv_48175; } ldv_48175: ; } { spin_unlock_irq(& b->bm_lock); } return; } } void drbd_bm_set_all(struct drbd_conf *mdev ) { struct drbd_bitmap *b ; int _b ; int _b___0 ; { b = mdev->bitmap; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_set_all", (char *)"!b", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 872); } } else { } if (_b != 0) { return; } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_set_all", (char *)"!b->bm_pages", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 873); } } else { } if (_b___0 != 0) { return; } else { } { spin_lock_irq(& b->bm_lock); bm_memset(b, 0UL, 255, b->bm_words); bm_clear_surplus(b); b->bm_set = b->bm_bits; spin_unlock_irq(& b->bm_lock); } return; } } void drbd_bm_clear_all(struct drbd_conf *mdev ) { struct drbd_bitmap *b ; int _b ; int _b___0 ; { b = mdev->bitmap; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_clear_all", (char *)"!b", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 886); } } else { } if (_b != 0) { return; } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_clear_all", (char *)"!b->bm_pages", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 887); } } else { } if (_b___0 != 0) { return; } else { } { spin_lock_irq(& b->bm_lock); bm_memset(b, 0UL, 0, b->bm_words); b->bm_set = 0UL; spin_unlock_irq(& b->bm_lock); } return; } } static void bm_async_io_complete(struct bio *bio , int error ) { struct bm_aio_ctx *ctx ; struct drbd_conf *mdev ; struct drbd_bitmap *b ; unsigned int idx ; unsigned long tmp ; int uptodate ; int tmp___0 ; int tmp___1 ; struct _ddebug descriptor ; long tmp___2 ; int tmp___3 ; { { ctx = (struct bm_aio_ctx *)bio->bi_private; mdev = ctx->mdev; b = mdev->bitmap; tmp = bm_page_to_idx((bio->bi_io_vec)->bv_page); idx = (unsigned int )tmp; uptodate = (int )bio->bi_flags & 1; } if (error == 0) { if (uptodate == 0) { error = -5; } else { } } else { } if ((ctx->flags & 1U) == 0U) { { tmp___0 = bm_test_page_unchanged(*(b->bm_pages + (unsigned long )idx)); } if (tmp___0 == 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "bitmap page idx %u changed during IO!\n", idx); } } else { } } else { } if (error != 0) { { ctx->error = error; bm_set_page_io_err(*(b->bm_pages + (unsigned long )idx)); tmp___1 = ___ratelimit(& drbd_ratelimit_state, "bm_async_io_complete"); } if (tmp___1 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "IO ERROR %d on bitmap page idx %u\n", error, idx); } } else { } } else { { bm_clear_page_io_err(*(b->bm_pages + (unsigned long )idx)); descriptor.modname = "drbd"; descriptor.function = "bm_async_io_complete"; descriptor.filename = "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p"; descriptor.format = "bitmap page idx %u completed\n"; descriptor.lineno = 937U; descriptor.flags = (unsigned char)0; descriptor.enabled = (char)0; tmp___2 = __builtin_expect((long )((int )((signed char )descriptor.enabled) != 0), 0L); } if (tmp___2 != 0L) { { dev_printk("<7>", (struct device const *)(& (mdev->vdisk)->part0.__dev), "bitmap page idx %u completed\n", idx); } } else { } } { bm_page_unlock_io(mdev, (int )idx); } if ((int )ctx->flags & 1) { { put_page((bio->bi_io_vec)->bv_page); } } else { } { bio_put(bio); tmp___3 = atomic_dec_and_test(& ctx->in_flight); } if (tmp___3 != 0) { { complete(& ctx->done); } } else { } return; } } static void bm_page_io_async(struct bm_aio_ctx *ctx , int page_nr , int rw ) { struct bio *bio ; struct bio *tmp ; struct drbd_conf *mdev ; struct drbd_bitmap *b ; struct page *page ; unsigned int len ; sector_t on_disk_sector ; unsigned int __min1 ; unsigned int __min2 ; sector_t tmp___0 ; unsigned int tmp___1 ; void *src ; void *dest ; size_t __len ; void *__ret ; unsigned int tmp___2 ; int tmp___3 ; { { tmp = bio_alloc(208U, 1); bio = tmp; mdev = ctx->mdev; b = mdev->bitmap; on_disk_sector = (sector_t )((mdev->ldev)->md.md_offset + (u64 )(mdev->ldev)->md.bm_offset); on_disk_sector = ((unsigned long )page_nr << 3) + on_disk_sector; __min1 = 4096U; tmp___0 = drbd_md_last_sector(mdev->ldev); __min2 = (((unsigned int )tmp___0 - (unsigned int )on_disk_sector) + 1U) << 9U; } if (__min1 < __min2) { tmp___1 = __min1; } else { tmp___1 = __min2; } { len = tmp___1; bm_page_lock_io(mdev, page_nr); bm_set_page_unchanged(*(b->bm_pages + (unsigned long )page_nr)); } if ((int )ctx->flags & 1) { { page = alloc_pages(18U, 0U); dest = __kmap_atomic(page); src = __kmap_atomic(*(b->bm_pages + (unsigned long )page_nr)); __len = 4096UL; } if (__len > 63UL) { { __ret = __memcpy(dest, (void const *)src, __len); } } else { { __ret = __builtin_memcpy(dest, (void const *)src, __len); } } { __kunmap_atomic(src); __kunmap_atomic(dest); bm_store_page_idx(page, (unsigned long )page_nr); } } else { page = *(b->bm_pages + (unsigned long )page_nr); } { bio->bi_bdev = (mdev->ldev)->md_bdev; bio->bi_sector = on_disk_sector; bio_add_page(bio, page, len, 0U); bio->bi_private = (void *)ctx; bio->bi_end_io = & bm_async_io_complete; } if (rw & 1) { tmp___2 = 0U; } else { tmp___2 = 1U; } { tmp___3 = drbd_insert_fault(mdev, tmp___2); } if (tmp___3 != 0) { { bio->bi_rw = bio->bi_rw | (unsigned long )rw; bio_endio(bio, -5); } } else { { submit_bio(rw, bio); atomic_add((int )(len >> 9), & mdev->rs_sect_ev); } } return; } } static int bm_rw(struct drbd_conf *mdev , int rw , unsigned int lazy_writeout_upper_idx ) { struct bm_aio_ctx ctx ; struct drbd_bitmap *b ; int num_pages ; int i ; int count ; unsigned long now ; char ppb[10U] ; int err ; int __ret_warn_on ; long tmp ; struct _ddebug descriptor ; long tmp___0 ; int tmp___1 ; struct _ddebug descriptor___0 ; long tmp___2 ; int tmp___3 ; int tmp___4 ; char *tmp___5 ; char *tmp___6 ; { { init_completion(& ctx.done); ctx.mdev = mdev; ctx.in_flight.counter = 1; ctx.done = ctx.done; ctx.flags = (unsigned int )(lazy_writeout_upper_idx != 0U); ctx.error = 0; b = mdev->bitmap; count = 0; err = 0; } if (ctx.flags == 0U) { { __ret_warn_on = ((unsigned int )b->bm_flags & 7U) == 0U; tmp = __builtin_expect((long )(__ret_warn_on != 0), 0L); } if (tmp != 0L) { { warn_slowpath_null("/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", (int const )1034); } } else { } { __builtin_expect((long )(__ret_warn_on != 0), 0L); } } else { } num_pages = (int )b->bm_number_of_pages; now = (unsigned long )jiffies; i = 0; goto ldv_48253; ldv_48252: ; if (lazy_writeout_upper_idx != 0U) { if ((unsigned int )i == lazy_writeout_upper_idx) { goto ldv_48246; } else { } } else { } if (rw & 1) { { tmp___1 = bm_test_page_unchanged(*(b->bm_pages + (unsigned long )i)); } if (tmp___1 != 0) { { descriptor.modname = "drbd"; descriptor.function = "bm_rw"; descriptor.filename = "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p"; descriptor.format = "skipped bm write for idx %u\n"; descriptor.lineno = 1047U; descriptor.flags = (unsigned char)0; descriptor.enabled = (char)0; tmp___0 = __builtin_expect((long )((int )((signed char )descriptor.enabled) != 0), 0L); } if (tmp___0 != 0L) { { dev_printk("<7>", (struct device const *)(& (mdev->vdisk)->part0.__dev), "skipped bm write for idx %u\n", i); } } else { } goto ldv_48249; } else { } if (lazy_writeout_upper_idx != 0U) { { tmp___3 = bm_test_page_lazy_writeout(*(b->bm_pages + (unsigned long )i)); } if (tmp___3 == 0) { { descriptor___0.modname = "drbd"; descriptor___0.function = "bm_rw"; descriptor___0.filename = "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p"; descriptor___0.format = "skipped bm lazy write for idx %u\n"; descriptor___0.lineno = 1054U; descriptor___0.flags = (unsigned char)0; descriptor___0.enabled = (char)0; tmp___2 = __builtin_expect((long )((int )((signed char )descriptor___0.enabled) != 0), 0L); } if (tmp___2 != 0L) { { dev_printk("<7>", (struct device const *)(& (mdev->vdisk)->part0.__dev), "skipped bm lazy write for idx %u\n", i); } } else { } goto ldv_48249; } else { } } else { } } else { } { atomic_inc(& ctx.in_flight); bm_page_io_async(& ctx, i, rw); count = count + 1; __might_sleep("/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1061, 0); _cond_resched(); } ldv_48249: i = i + 1; ldv_48253: ; if (i < num_pages) { goto ldv_48252; } else { goto ldv_48246; } ldv_48246: { tmp___4 = atomic_dec_and_test(& ctx.in_flight); } if (tmp___4 == 0) { { wait_for_completion(& ctx.done); } } else { } if (rw == 1) { tmp___5 = (char *)"WRITE"; } else { tmp___5 = (char *)"READ"; } { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "bitmap %s of %u pages took %lu jiffies\n", tmp___5, count, (unsigned long )jiffies - now); } if (ctx.error != 0) { { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "we had at least one MD IO ERROR during bitmap IO\n"); drbd_chk_io_error_(mdev, 1, 1, "bm_rw"); err = -5; } } else { } now = (unsigned long )jiffies; if (rw == 1) { { drbd_md_flush(mdev); } } else { { b->bm_set = bm_count_bits(b); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "recounting of set bits took additional %lu jiffies\n", (unsigned long )jiffies - now); } } { now = b->bm_set; tmp___6 = ppsize((char *)(& ppb), (unsigned long long )(now << 2)); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s (%lu bits) marked out-of-sync by on disk bit-map.\n", tmp___6, now); } return (err); } } int drbd_bm_read(struct drbd_conf *mdev ) { int tmp ; { { tmp = bm_rw(mdev, 0, 0U); } return (tmp); } } int drbd_bm_write(struct drbd_conf *mdev ) { int tmp ; { { tmp = bm_rw(mdev, 1, 0U); } return (tmp); } } int drbd_bm_write_lazy(struct drbd_conf *mdev , unsigned int upper_idx ) { int tmp ; { { tmp = bm_rw(mdev, 1, upper_idx); } return (tmp); } } int drbd_bm_write_page(struct drbd_conf *mdev , unsigned int idx ) { struct bm_aio_ctx ctx ; struct _ddebug descriptor ; long tmp ; int tmp___0 ; { { init_completion(& ctx.done); ctx.mdev = mdev; ctx.in_flight.counter = 1; ctx.done = ctx.done; ctx.flags = 1U; ctx.error = 0; tmp___0 = bm_test_page_unchanged(*((mdev->bitmap)->bm_pages + (unsigned long )idx)); } if (tmp___0 != 0) { { descriptor.modname = "drbd"; descriptor.function = "drbd_bm_write_page"; descriptor.filename = "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p"; descriptor.format = "skipped bm page write for idx %u\n"; descriptor.lineno = 1150U; descriptor.flags = (unsigned char)0; descriptor.enabled = (char)0; tmp = __builtin_expect((long )((int )((signed char )descriptor.enabled) != 0), 0L); } if (tmp != 0L) { { dev_printk("<7>", (struct device const *)(& (mdev->vdisk)->part0.__dev), "skipped bm page write for idx %u\n", idx); } } else { } return (0); } else { } { bm_page_io_async(& ctx, (int )idx, 145); wait_for_completion(& ctx.done); } if (ctx.error != 0) { { drbd_chk_io_error_(mdev, 1, 1, "drbd_bm_write_page"); } } else { } mdev->bm_writ_cnt = mdev->bm_writ_cnt + 1U; return (ctx.error); } } static unsigned long __bm_find_next(struct drbd_conf *mdev , unsigned long bm_fo , int const find_zero_bit , enum km_type const km ) { struct drbd_bitmap *b ; unsigned long *p_addr ; unsigned long bit_offset ; unsigned int i ; unsigned int tmp ; unsigned long tmp___0 ; unsigned long tmp___1 ; { b = mdev->bitmap; if (b->bm_bits < bm_fo) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "bm_fo=%lu bm_bits=%lu\n", bm_fo, b->bm_bits); bm_fo = 0x0fffffffffffffffUL; } } else { goto ldv_48285; ldv_48284: { bit_offset = bm_fo & 0x0fffffffffff8000UL; tmp = bm_bit_to_page_idx(b, (u64 )bm_fo); p_addr = __bm_map_pidx(b, tmp, km); } if ((int )find_zero_bit != 0) { { tmp___0 = find_next_zero_bit_le((void const *)p_addr, 32768UL, bm_fo & 32767UL); i = (unsigned int )tmp___0; } } else { { tmp___1 = find_next_bit_le((void const *)p_addr, 32768UL, bm_fo & 32767UL); i = (unsigned int )tmp___1; } } { __bm_unmap(p_addr, km); } if (i <= 32767U) { bm_fo = (unsigned long )i + bit_offset; if (b->bm_bits <= bm_fo) { goto ldv_48282; } else { } goto found; } else { } bm_fo = bit_offset + 32768UL; ldv_48285: ; if (b->bm_bits > bm_fo) { goto ldv_48284; } else { goto ldv_48282; } ldv_48282: bm_fo = 0x0fffffffffffffffUL; } found: ; return (bm_fo); } } static unsigned long bm_find_next(struct drbd_conf *mdev , unsigned long bm_fo , int const find_zero_bit ) { struct drbd_bitmap *b ; unsigned long i ; int _b ; int _b___0 ; { b = mdev->bitmap; i = 0x0fffffffffffffffUL; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "bm_find_next", (char *)"!b", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1220); } } else { } if (_b != 0) { return (i); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "bm_find_next", (char *)"!b->bm_pages", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1221); } } else { } if (_b___0 != 0) { return (i); } else { } { spin_lock_irq(& b->bm_lock); } if (((unsigned int )b->bm_flags & 4U) != 0U) { { __bm_print_lock_info(mdev, "bm_find_next"); } } else { } { i = __bm_find_next(mdev, bm_fo, find_zero_bit, (enum km_type const )10); spin_unlock_irq(& b->bm_lock); } return (i); } } unsigned long drbd_bm_find_next(struct drbd_conf *mdev , unsigned long bm_fo ) { unsigned long tmp ; { { tmp = bm_find_next(mdev, bm_fo, (int const )0); } return (tmp); } } unsigned long _drbd_bm_find_next(struct drbd_conf *mdev , unsigned long bm_fo ) { unsigned long tmp ; { { tmp = __bm_find_next(mdev, bm_fo, (int const )0, (enum km_type const )4); } return (tmp); } } unsigned long _drbd_bm_find_next_zero(struct drbd_conf *mdev , unsigned long bm_fo ) { unsigned long tmp ; { { tmp = __bm_find_next(mdev, bm_fo, (int const )1, (enum km_type const )4); } return (tmp); } } static int __bm_change_bits_to(struct drbd_conf *mdev , unsigned long const s , unsigned long e , int val ) { struct drbd_bitmap *b ; unsigned long *p_addr ; unsigned long bitnr ; unsigned int last_page_nr ; int c ; int changed_total ; unsigned int page_nr ; unsigned int tmp ; int tmp___0 ; int tmp___1 ; { b = mdev->bitmap; p_addr = (unsigned long *)0; last_page_nr = 4294967295U; c = 0; changed_total = 0; if (b->bm_bits <= e) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: bit_s=%lu bit_e=%lu bm_bits=%lu\n", s, e, b->bm_bits); } if (b->bm_bits != 0UL) { e = b->bm_bits - 1UL; } else { e = 0UL; } } else { } bitnr = (unsigned long )s; goto ldv_48324; ldv_48323: { tmp = bm_bit_to_page_idx(b, (u64 )bitnr); page_nr = tmp; } if (page_nr != last_page_nr) { if ((unsigned long )p_addr != (unsigned long )((unsigned long *)0)) { { __bm_unmap(p_addr, (enum km_type const )10); } } else { } if (c < 0) { { bm_set_page_lazy_writeout(*(b->bm_pages + (unsigned long )last_page_nr)); } } else if (c > 0) { { bm_set_page_need_writeout(*(b->bm_pages + (unsigned long )last_page_nr)); } } else { } { changed_total = changed_total + c; c = 0; p_addr = __bm_map_pidx(b, page_nr, (enum km_type const )10); last_page_nr = page_nr; } } else { } if (val != 0) { { tmp___0 = __test_and_set_bit_le((int )bitnr & 32767, (void *)p_addr); c = (tmp___0 == 0) + c; } } else { { tmp___1 = __test_and_clear_bit_le((int )bitnr & 32767, (void *)p_addr); c = c - (tmp___1 != 0); } } bitnr = bitnr + 1UL; ldv_48324: ; if (bitnr <= e) { goto ldv_48323; } else { goto ldv_48325; } ldv_48325: ; if ((unsigned long )p_addr != (unsigned long )((unsigned long *)0)) { { __bm_unmap(p_addr, (enum km_type const )10); } } else { } if (c < 0) { { bm_set_page_lazy_writeout(*(b->bm_pages + (unsigned long )last_page_nr)); } } else if (c > 0) { { bm_set_page_need_writeout(*(b->bm_pages + (unsigned long )last_page_nr)); } } else { } changed_total = changed_total + c; b->bm_set = b->bm_set + (unsigned long )changed_total; return (changed_total); } } static int bm_change_bits_to(struct drbd_conf *mdev , unsigned long const s , unsigned long const e , int val ) { unsigned long flags ; struct drbd_bitmap *b ; int c ; int _b ; int _b___0 ; raw_spinlock_t *tmp ; unsigned int tmp___0 ; { b = mdev->bitmap; c = 0; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "bm_change_bits_to", (char *)"!b", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1322); } } else { } if (_b != 0) { return (1); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "bm_change_bits_to", (char *)"!b->bm_pages", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1323); } } else { } if (_b___0 != 0) { return (0); } else { } { tmp = spinlock_check(& b->bm_lock); flags = _raw_spin_lock_irqsave(tmp); } if (val != 0) { tmp___0 = 2U; } else { tmp___0 = 1U; } if ((tmp___0 & (unsigned int )b->bm_flags) != 0U) { { __bm_print_lock_info(mdev, "bm_change_bits_to"); } } else { } { c = __bm_change_bits_to(mdev, s, (unsigned long )e, val); spin_unlock_irqrestore(& b->bm_lock, flags); } return (c); } } int drbd_bm_set_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) { int tmp ; { { tmp = bm_change_bits_to(mdev, s, e, 1); } return (tmp); } } int drbd_bm_clear_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) { int tmp ; { { tmp = bm_change_bits_to(mdev, s, e, 0); } return (- tmp); } } __inline static void bm_set_full_words_within_one_page(struct drbd_bitmap *b , int page_nr , int first_word , int last_word ) { int i ; int bits ; unsigned long *paddr ; void *tmp ; unsigned long tmp___0 ; { { tmp = __kmap_atomic(*(b->bm_pages + (unsigned long )page_nr)); paddr = (unsigned long *)tmp; i = first_word; } goto ldv_48363; ldv_48362: { tmp___0 = hweight_long(*(paddr + (unsigned long )i)); bits = (int )tmp___0; *(paddr + (unsigned long )i) = 0x0fffffffffffffffUL; b->bm_set = b->bm_set + (unsigned long )(64 - bits); i = i + 1; } ldv_48363: ; if (i < last_word) { goto ldv_48362; } else { goto ldv_48364; } ldv_48364: { __kunmap_atomic((void *)paddr); } return; } } void _drbd_bm_set_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) { struct drbd_bitmap *b ; unsigned long sl ; unsigned long el ; int first_page ; int last_page ; int page_nr ; int first_word ; int last_word ; { b = mdev->bitmap; sl = ((unsigned long )s + 63UL) & 0x0fffffffffffffc0UL; el = ((unsigned long )e + 1UL) & 0x0fffffffffffffc0UL; if ((unsigned long )e - (unsigned long )s <= 192UL) { { spin_lock_irq(& b->bm_lock); __bm_change_bits_to(mdev, s, (unsigned long )e, 1); spin_unlock_irq(& b->bm_lock); } return; } else { } { spin_lock_irq(& b->bm_lock); } if (sl != 0UL) { { __bm_change_bits_to(mdev, s, sl - 1UL, 1); } } else { } first_page = (int )(sl >> 15); last_page = (int )(el >> 15); first_word = (int )(sl >> 6) & 511; last_word = 512; page_nr = first_page; goto ldv_48380; ldv_48379: { bm_set_full_words_within_one_page(mdev->bitmap, page_nr, first_word, last_word); spin_unlock_irq(& b->bm_lock); __might_sleep("/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1415, 0); _cond_resched(); first_word = 0; spin_lock_irq(& b->bm_lock); page_nr = page_nr + 1; } ldv_48380: ; if (page_nr < last_page) { goto ldv_48379; } else { goto ldv_48381; } ldv_48381: { last_word = (int )(el >> 6) & 511; bm_set_full_words_within_one_page(mdev->bitmap, last_page, first_word, last_word); } if (el <= (unsigned long )e) { { __bm_change_bits_to(mdev, (unsigned long const )el, (unsigned long )e, 1); } } else { } { spin_unlock_irq(& b->bm_lock); } return; } } int drbd_bm_test_bit(struct drbd_conf *mdev , unsigned long const bitnr ) { unsigned long flags ; struct drbd_bitmap *b ; unsigned long *p_addr ; int i ; int _b ; int _b___0 ; raw_spinlock_t *tmp ; unsigned int tmp___0 ; int tmp___1 ; { b = mdev->bitmap; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_test_bit", (char *)"!b", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1448); } } else { } if (_b != 0) { return (0); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_test_bit", (char *)"!b->bm_pages", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1449); } } else { } if (_b___0 != 0) { return (0); } else { } { tmp = spinlock_check(& b->bm_lock); flags = _raw_spin_lock_irqsave(tmp); } if (((unsigned int )b->bm_flags & 4U) != 0U) { { __bm_print_lock_info(mdev, "drbd_bm_test_bit"); } } else { } if (b->bm_bits > (unsigned long )bitnr) { { tmp___0 = bm_bit_to_page_idx(b, (u64 )bitnr); p_addr = bm_map_pidx(b, tmp___0); tmp___1 = test_bit_le((int )bitnr & 32767, (void const *)p_addr); i = tmp___1 != 0; bm_unmap(p_addr); } } else if (b->bm_bits == (unsigned long )bitnr) { i = -1; } else { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "bitnr=%lu > bm_bits=%lu\n", bitnr, b->bm_bits); i = 0; } } { spin_unlock_irqrestore(& b->bm_lock, flags); } return (i); } } int drbd_bm_count_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) { unsigned long flags ; struct drbd_bitmap *b ; unsigned long *p_addr ; unsigned long bitnr ; unsigned int page_nr ; int c ; int _b ; int _b___0 ; raw_spinlock_t *tmp ; unsigned int idx ; unsigned int tmp___0 ; int tmp___1 ; int _b___1 ; { b = mdev->bitmap; p_addr = (unsigned long *)0; page_nr = 4294967295U; c = 0; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_count_bits", (char *)"!b", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1483); } } else { } if (_b != 0) { return (1); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_count_bits", (char *)"!b->bm_pages", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1484); } } else { } if (_b___0 != 0) { return (1); } else { } { tmp = spinlock_check(& b->bm_lock); flags = _raw_spin_lock_irqsave(tmp); } if (((unsigned int )b->bm_flags & 4U) != 0U) { { __bm_print_lock_info(mdev, "drbd_bm_count_bits"); } } else { } bitnr = (unsigned long )s; goto ldv_48421; ldv_48420: { tmp___0 = bm_bit_to_page_idx(b, (u64 )bitnr); idx = tmp___0; } if (page_nr != idx) { page_nr = idx; if ((unsigned long )p_addr != (unsigned long )((unsigned long *)0)) { { bm_unmap(p_addr); } } else { } { p_addr = bm_map_pidx(b, idx); } } else { } _b___1 = b->bm_bits <= bitnr; if (_b___1 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_count_bits", (char *)"bitnr >= b->bm_bits", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1497); } } else { } if (_b___1 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "bitnr=%lu bm_bits=%lu\n", bitnr, b->bm_bits); } } else { { tmp___1 = test_bit_le((int )((unsigned int )bitnr - (page_nr << 15)), (void const *)p_addr); c = (tmp___1 != 0) + c; } } bitnr = bitnr + 1UL; ldv_48421: ; if (bitnr <= (unsigned long )e) { goto ldv_48420; } else { goto ldv_48422; } ldv_48422: ; if ((unsigned long )p_addr != (unsigned long )((unsigned long *)0)) { { bm_unmap(p_addr); } } else { } { spin_unlock_irqrestore(& b->bm_lock, flags); } return (c); } } int drbd_bm_e_weight(struct drbd_conf *mdev , unsigned long enr ) { struct drbd_bitmap *b ; int count ; int s ; int e ; unsigned long flags ; unsigned long *p_addr ; unsigned long *bm ; int _b ; int _b___0 ; raw_spinlock_t *tmp ; unsigned long _min1 ; size_t _min2 ; unsigned long tmp___0 ; int n ; unsigned int tmp___1 ; unsigned long *tmp___2 ; unsigned long tmp___3 ; int tmp___4 ; { b = mdev->bitmap; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_e_weight", (char *)"!b", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1531); } } else { } if (_b != 0) { return (0); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_e_weight", (char *)"!b->bm_pages", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1532); } } else { } if (_b___0 != 0) { return (0); } else { } { tmp = spinlock_check(& b->bm_lock); flags = _raw_spin_lock_irqsave(tmp); } if (((unsigned int )b->bm_flags & 4U) != 0U) { { __bm_print_lock_info(mdev, "drbd_bm_e_weight"); } } else { } s = (int )(enr << 6); _min1 = (enr + 1UL) << 6; _min2 = b->bm_words; if (_min1 < _min2) { tmp___0 = _min1; } else { tmp___0 = _min2; } e = (int )tmp___0; count = 0; if ((size_t )s < b->bm_words) { { n = e - s; tmp___1 = bm_word_to_page_idx(b, (unsigned long )s); p_addr = bm_map_pidx(b, tmp___1); bm = p_addr + ((unsigned long )s & 511UL); } goto ldv_48447; ldv_48446: { tmp___2 = bm; bm = bm + 1; tmp___3 = hweight_long(*tmp___2); count = (int )((unsigned int )tmp___3 + (unsigned int )count); } ldv_48447: tmp___4 = n; n = n - 1; if (tmp___4 != 0) { goto ldv_48446; } else { goto ldv_48448; } ldv_48448: { bm_unmap(p_addr); } } else { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "start offset (%d) too large in drbd_bm_e_weight\n", s); } } { spin_unlock_irqrestore(& b->bm_lock, flags); } return (count); } } unsigned long drbd_bm_ALe_set_all(struct drbd_conf *mdev , unsigned long al_enr ) { struct drbd_bitmap *b ; unsigned long *p_addr ; unsigned long *bm ; unsigned long weight ; unsigned long s ; unsigned long e ; int count ; int i ; int do_now ; int _b ; int _b___0 ; size_t __min1 ; size_t __min2 ; size_t tmp ; unsigned int tmp___0 ; unsigned long tmp___1 ; int tmp___2 ; int tmp___3 ; { b = mdev->bitmap; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_ALe_set_all", (char *)"!b", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1564); } } else { } if (_b != 0) { return (0UL); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_ALe_set_all", (char *)"!b->bm_pages", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1565); } } else { } if (_b___0 != 0) { return (0UL); } else { } { spin_lock_irq(& b->bm_lock); } if (((unsigned int )b->bm_flags & 2U) != 0U) { { __bm_print_lock_info(mdev, "drbd_bm_ALe_set_all"); } } else { } weight = b->bm_set; s = al_enr * 16UL; __min1 = s + 16UL; __min2 = b->bm_words; if (__min1 < __min2) { tmp = __min1; } else { tmp = __min2; } e = tmp; if ((e - 1UL) >> 9 != s >> 9) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( (e-1) >> (PAGE_SHIFT - LN2_BPL + 3) == s >> (PAGE_SHIFT - LN2_BPL + 3) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_bitmap.c.p", 1576); } } else { } count = 0; if (b->bm_words > s) { { do_now = (int )((unsigned int )e - (unsigned int )s); i = do_now; tmp___0 = bm_word_to_page_idx(b, s); p_addr = bm_map_pidx(b, tmp___0); bm = p_addr + (s & 511UL); } goto ldv_48471; ldv_48470: { tmp___1 = hweight_long(*bm); count = (int )((unsigned int )tmp___1 + (unsigned int )count); *bm = 0x0fffffffffffffffUL; bm = bm + 1; } ldv_48471: tmp___2 = i; i = i - 1; if (tmp___2 != 0) { goto ldv_48470; } else { goto ldv_48472; } ldv_48472: { bm_unmap(p_addr); b->bm_set = b->bm_set + (unsigned long )(do_now * 64 - count); } if (b->bm_words == e) { { tmp___3 = bm_clear_surplus(b); b->bm_set = b->bm_set - (unsigned long )tmp___3; } } else { } } else { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "start offset (%lu) too large in drbd_bm_ALe_set_all\n", s); } } { weight = b->bm_set - weight; spin_unlock_irq(& b->bm_lock); } return (weight); } } void ldv_check_final_state(void) ; extern void ldv_initialize(void) ; extern int __VERIFIER_nondet_int(void) ; int LDV_IN_INTERRUPT ; void ldv_blast_assert(void) { { ERROR: __VERIFIER_error(); } } extern int ldv_undefined_int(void) ; int ldv_module_refcounter = 1; void ldv_module_get(struct module *module ) { { if ((unsigned long )module != (unsigned long )((struct module *)0)) { ldv_module_refcounter = ldv_module_refcounter + 1; } else { } return; } } int ldv_try_module_get(struct module *module ) { int module_get_succeeded ; { if ((unsigned long )module != (unsigned long )((struct module *)0)) { { module_get_succeeded = ldv_undefined_int(); } if (module_get_succeeded == 1) { ldv_module_refcounter = ldv_module_refcounter + 1; return (1); } else { return (0); } } else { } return (0); } } void ldv_module_put(struct module *module ) { { if ((unsigned long )module != (unsigned long )((struct module *)0)) { if (ldv_module_refcounter <= 1) { { ldv_blast_assert(); } } else { } ldv_module_refcounter = ldv_module_refcounter - 1; } else { } return; } } void ldv_module_put_and_exit(void) { { { ldv_module_put((struct module *)1); } LDV_STOP: ; goto LDV_STOP; } } unsigned int ldv_module_refcount(void) { { return ((unsigned int )(ldv_module_refcounter + -1)); } } void ldv_check_final_state(void) { { if (ldv_module_refcounter != 1) { { ldv_blast_assert(); } } else { } return; } } __inline static int atomic_read(atomic_t const *v ) { { return ((int )*((int volatile *)(& v->counter))); } } extern struct module __this_module ; __inline static int ldv_try_module_get_1(struct module *module ) ; void ldv_module_put_2(struct module *ldv_func_arg1 ) ; __inline static struct proc_inode *PROC_I(struct inode const *inode ) { struct inode const *__mptr ; { __mptr = inode; return ((struct proc_inode *)__mptr + 0x0fffffffffffffc0UL); } } __inline static struct proc_dir_entry *PDE(struct inode const *inode ) { struct proc_inode *tmp ; { { tmp = PROC_I(inode); } return (tmp->pde); } } extern ssize_t seq_read(struct file * , char * , size_t , loff_t * ) ; extern loff_t seq_lseek(struct file * , loff_t , int ) ; extern int seq_printf(struct seq_file * , char const * , ...) ; extern int single_open(struct file * , int (*)(struct seq_file * , void * ) , void * ) ; extern int single_release(struct inode * , struct file * ) ; char const *drbd_buildtag(void) ; char const *drbd_conn_str(enum drbd_conns s ) ; char const *drbd_role_str(enum drbd_role s ) ; char const *drbd_disk_str(enum drbd_disk_state s ) ; extern size_t lc_seq_printf_stats(struct seq_file * , struct lru_cache * ) ; extern void lc_seq_dump_details(struct seq_file * , struct lru_cache * , char * , void (*)(struct seq_file * , struct lc_element * ) ) ; unsigned int minor_count ; struct drbd_conf **minor_table ; __inline static struct drbd_conf *minor_to_mdev(unsigned int minor ) { struct drbd_conf *mdev ; { if (minor < minor_count) { mdev = *(minor_table + (unsigned long )minor); } else { mdev = (struct drbd_conf *)0; } return (mdev); } } int proc_details ; struct proc_dir_entry *drbd_proc ; struct file_operations const drbd_proc_fops ; __inline static void drbd_get_syncer_progress(struct drbd_conf *mdev , unsigned long *bits_left , unsigned int *per_mil_done ) { unsigned long tmp ; char const *tmp___0 ; unsigned int shift ; unsigned int tmp___1 ; unsigned long left ; unsigned long total ; unsigned long tmp___2 ; { if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 288U) { *bits_left = mdev->ov_left; } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 304U) { *bits_left = mdev->ov_left; } else { { tmp = drbd_bm_total_weight(mdev); *bits_left = tmp - mdev->rs_failed; } } if (*bits_left > mdev->rs_total) { { __asm__ volatile ("": : : "memory"); tmp___0 = drbd_conn_str((enum drbd_conns )mdev->state.ldv_38339.conn); dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "cs:%s rs_left=%lu > rs_total=%lu (rs_failed %lu)\n", tmp___0, *bits_left, mdev->rs_total, mdev->rs_failed); *per_mil_done = 0U; } } else { if ((unsigned long long )mdev->rs_total > 4294967295ULL) { tmp___1 = 16U; } else { tmp___1 = 10U; } shift = tmp___1; left = *bits_left >> (int )shift; total = (mdev->rs_total >> (int )shift) + 1UL; tmp___2 = 1000UL - (left * 1000UL) / total; *per_mil_done = (unsigned int )tmp___2; } return; } } __inline static int is_susp(union drbd_state s ) { int tmp ; { if ((unsigned int )*((unsigned char *)(& s) + 2UL) != 0U) { tmp = 1; } else if ((unsigned int )*((unsigned char *)(& s) + 2UL) != 0U) { tmp = 1; } else if ((unsigned int )*((unsigned char *)(& s) + 2UL) != 0U) { tmp = 1; } else { tmp = 0; } return (tmp); } } static int drbd_proc_open(struct inode *inode , struct file *file ) ; static int drbd_proc_release(struct inode *inode , struct file *file ) ; struct file_operations const drbd_proc_fops = {& __this_module, & seq_lseek, & seq_read, (ssize_t (*)(struct file * , char const * , size_t , loff_t * ))0, (ssize_t (*)(struct kiocb * , struct iovec const * , unsigned long , loff_t ))0, (ssize_t (*)(struct kiocb * , struct iovec const * , unsigned long , loff_t ))0, (int (*)(struct file * , void * , int (*)(void * , char const * , int , loff_t , u64 , unsigned int ) ))0, (unsigned int (*)(struct file * , struct poll_table_struct * ))0, (long (*)(struct file * , unsigned int , unsigned long ))0, (long (*)(struct file * , unsigned int , unsigned long ))0, (int (*)(struct file * , struct vm_area_struct * ))0, & drbd_proc_open, (int (*)(struct file * , fl_owner_t ))0, & drbd_proc_release, (int (*)(struct file * , int ))0, (int (*)(struct kiocb * , int ))0, (int (*)(int , struct file * , int ))0, (int (*)(struct file * , int , struct file_lock * ))0, (ssize_t (*)(struct file * , struct page * , int , size_t , loff_t * , int ))0, (unsigned long (*)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ))0, (int (*)(int ))0, (int (*)(struct file * , int , struct file_lock * ))0, (ssize_t (*)(struct pipe_inode_info * , struct file * , loff_t * , size_t , unsigned int ))0, (ssize_t (*)(struct file * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ))0, (int (*)(struct file * , long , struct file_lock ** ))0, (long (*)(struct file * , int , loff_t , loff_t ))0}; void seq_printf_with_thousands_grouping(struct seq_file *seq , long v ) { long tmp ; long tmp___0 ; { { tmp___0 = __builtin_expect((long )(v > 999999L), 0L); } if (tmp___0 != 0L) { { seq_printf(seq, "%ld,", v / 1000000L); v = v / 1000000L; seq_printf(seq, "%03ld,%03ld", v / 1000L, v % 1000L); } } else { { tmp = __builtin_expect((long )(v > 999L), 1L); } if (tmp != 0L) { { seq_printf(seq, "%ld,%03ld", v / 1000L, v % 1000L); } } else { { seq_printf(seq, "%ld", v); } } } return; } } static void drbd_syncer_progress(struct drbd_conf *mdev , struct seq_file *seq ) { unsigned long db ; unsigned long dt ; unsigned long dbdt ; unsigned long rt ; unsigned long rs_left ; unsigned int res ; int i ; int x ; int y ; int stalled ; char *tmp ; unsigned long bm_bits ; unsigned long tmp___0 ; unsigned long bit_pos ; { { stalled = 0; drbd_get_syncer_progress(mdev, & rs_left, & res); x = (int )(res / 50U); y = 20 - x; seq_printf(seq, "\t["); i = 1; } goto ldv_47924; ldv_47923: { seq_printf(seq, "="); i = i + 1; } ldv_47924: ; if (i < x) { goto ldv_47923; } else { goto ldv_47925; } ldv_47925: { seq_printf(seq, ">"); i = 0; } goto ldv_47927; ldv_47926: { seq_printf(seq, "."); i = i + 1; } ldv_47927: ; if (i < y) { goto ldv_47926; } else { goto ldv_47928; } ldv_47928: { seq_printf(seq, "] "); } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 288U) { { seq_printf(seq, "verified:"); } } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 304U) { { seq_printf(seq, "verified:"); } } else { { seq_printf(seq, "sync\'ed:"); } } { seq_printf(seq, "%3u.%u%% ", res / 10U, res % 10U); } if (mdev->rs_total > 1048576UL) { { seq_printf(seq, "(%lu/%lu)M", (rs_left >> 10) << 2, (mdev->rs_total >> 10) << 2); } } else { { seq_printf(seq, "(%lu/%lu)K\n\t", rs_left << 2, mdev->rs_total << 2); } } i = (mdev->rs_last_mark + 2) % 8; dt = ((unsigned long )jiffies - mdev->rs_mark_time[i]) / 250UL; if (dt > 6000UL) { stalled = 1; } else { } if (dt == 0UL) { dt = dt + 1UL; } else { } { db = mdev->rs_mark_left[i] - rs_left; rt = ((rs_left / (db / 100UL + 1UL)) * dt) / 100UL; seq_printf(seq, "finish: %lu:%02lu:%02lu", rt / 3600UL, (rt % 3600UL) / 60UL, rt % 60UL); dbdt = db / dt << 2; seq_printf(seq, " speed: "); seq_printf_with_thousands_grouping(seq, (long )dbdt); seq_printf(seq, " ("); } if (proc_details > 0) { i = (mdev->rs_last_mark + 7) % 8; dt = ((unsigned long )jiffies - mdev->rs_mark_time[i]) / 250UL; if (dt == 0UL) { dt = dt + 1UL; } else { } { db = mdev->rs_mark_left[i] - rs_left; dbdt = db / dt << 2; seq_printf_with_thousands_grouping(seq, (long )dbdt); seq_printf(seq, " -- "); } } else { } dt = (((unsigned long )jiffies - mdev->rs_start) - mdev->rs_paused) / 250UL; if (dt == 0UL) { dt = 1UL; } else { } { db = mdev->rs_total - rs_left; dbdt = db / dt << 2; seq_printf_with_thousands_grouping(seq, (long )dbdt); seq_printf(seq, ")"); } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 272U) { { seq_printf(seq, " want: "); seq_printf_with_thousands_grouping(seq, (long )mdev->c_sync_rate); } } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 288U) { { seq_printf(seq, " want: "); seq_printf_with_thousands_grouping(seq, (long )mdev->c_sync_rate); } } else { } if (stalled != 0) { tmp = (char *)" (stalled)"; } else { tmp = (char *)""; } { seq_printf(seq, " K/sec%s\n", tmp); } if (proc_details > 0) { { tmp___0 = drbd_bm_bits(mdev); bm_bits = tmp___0; } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 288U) { bit_pos = bm_bits - mdev->ov_left; } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 304U) { bit_pos = bm_bits - mdev->ov_left; } else { bit_pos = mdev->bm_resync_fo; } { seq_printf(seq, "\t%3d%% sector pos: %llu/%llu\n", (int )(bit_pos / (bm_bits / 100UL + 1UL)), (unsigned long long )bit_pos * 8ULL, (unsigned long long )bm_bits * 8ULL); } } else { } return; } } static void resync_dump_detail(struct seq_file *seq , struct lc_element *e ) { struct bm_extent *bme ; struct lc_element const *__mptr ; char *tmp ; { __mptr = (struct lc_element const *)e; bme = (struct bm_extent *)__mptr + 0x0ffffffffffffff0UL; if ((int )bme->flags & 1) { tmp = (char *)"LOCKED"; } else { tmp = (char *)"------"; } { seq_printf(seq, "%5d %s %s\n", bme->rs_left, (char *)"---------", tmp); } return; } } static int drbd_seq_show(struct seq_file *seq , void *v ) { int i ; int hole ; char const *sn ; struct drbd_conf *mdev ; char write_ordering_chars[3U] ; char const *tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; char const *tmp___16 ; char const *tmp___17 ; char const *tmp___18 ; char const *tmp___19 ; unsigned long tmp___20 ; int tmp___21 ; { { hole = 0; write_ordering_chars[0] = (char)110; write_ordering_chars[1] = (char)100; write_ordering_chars[2] = (char)102; tmp = drbd_buildtag(); seq_printf(seq, "version: 8.3.11 (api:%d/proto:%d-%d)\n%s\n", 88, 86, 96, tmp); i = 0; } goto ldv_47949; ldv_47948: { mdev = minor_to_mdev((unsigned int )i); } if ((unsigned long )mdev == (unsigned long )((struct drbd_conf *)0)) { hole = 1; goto ldv_47947; } else { } if (hole != 0) { { hole = 0; seq_printf(seq, "\n"); } } else { } { sn = drbd_conn_str((enum drbd_conns )mdev->state.ldv_38339.conn); } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 0U) { if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 0U) { if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 2U) { { seq_printf(seq, "%2d: cs:Unconfigured\n", i); } } else { goto _L___0; } } else { goto _L___0; } } else { _L___0: { tmp___0 = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); tmp___1 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); tmp___2 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); tmp___3 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); tmp___4 = atomic_read((atomic_t const *)(& mdev->local_cnt)); tmp___7 = constant_test_bit(28U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___7 != 0) { tmp___6 = 115; } else { tmp___6 = 45; } if ((int )mdev->congestion_reason != 0) { tmp___8 = (int )mdev->congestion_reason; } else { tmp___8 = 45; } if ((unsigned int )*((unsigned char *)mdev + 2278UL) != 0U) { tmp___9 = 117; } else { tmp___9 = 45; } if ((unsigned int )*((unsigned char *)mdev + 2278UL) != 0U) { tmp___10 = 112; } else { tmp___10 = 45; } if ((unsigned int )*((unsigned char *)mdev + 2278UL) != 0U) { tmp___11 = 97; } else { tmp___11 = 45; } { tmp___14 = is_susp(mdev->state); } if (tmp___14 != 0) { tmp___13 = 115; } else { tmp___13 = 114; } if ((unsigned long )mdev->net_conf != (unsigned long )((struct net_conf *)0)) { tmp___15 = (mdev->net_conf)->wire_protocol + 64; } else { tmp___15 = 32; } { tmp___16 = drbd_disk_str((enum drbd_disk_state )mdev->state.ldv_38339.pdsk); tmp___17 = drbd_disk_str((enum drbd_disk_state )mdev->state.ldv_38339.disk); tmp___18 = drbd_role_str((enum drbd_role )mdev->state.ldv_38339.peer); tmp___19 = drbd_role_str((enum drbd_role )mdev->state.ldv_38339.role); seq_printf(seq, "%2d: cs:%s ro:%s/%s ds:%s/%s %c %c%c%c%c%c%c\n ns:%u nr:%u dw:%u dr:%u al:%u bm:%u lo:%d pe:%d ua:%d ap:%d ep:%d wo:%c", i, sn, tmp___19, tmp___18, tmp___17, tmp___16, tmp___15, tmp___13, tmp___11, tmp___10, tmp___9, tmp___8, tmp___6, mdev->send_cnt / 2U, mdev->recv_cnt / 2U, mdev->writ_cnt / 2U, mdev->read_cnt / 2U, mdev->al_writ_cnt, mdev->bm_writ_cnt, tmp___4, tmp___2 + tmp___3, tmp___1, tmp___0, mdev->epochs, (int )write_ordering_chars[(unsigned int )mdev->write_ordering]); tmp___20 = drbd_bm_total_weight(mdev); seq_printf(seq, " oos:%llu\n", (unsigned long long )tmp___20 << 2); } } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 256U) { { drbd_syncer_progress(mdev, seq); } } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 272U) { { drbd_syncer_progress(mdev, seq); } } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 288U) { { drbd_syncer_progress(mdev, seq); } } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 304U) { { drbd_syncer_progress(mdev, seq); } } else { } if (proc_details > 0) { { tmp___21 = _get_ldev_if_state(mdev, (enum drbd_disk_state )2); } if (tmp___21 != 0) { { lc_seq_printf_stats(seq, mdev->resync); lc_seq_printf_stats(seq, mdev->act_log); put_ldev(mdev); } } else { } } else { } if (proc_details > 1) { if ((unsigned long )mdev->resync != (unsigned long )((struct lru_cache *)0)) { { lc_seq_dump_details(seq, mdev->resync, (char *)"rs_left", & resync_dump_detail); } } else { } } else { } ldv_47947: i = i + 1; ldv_47949: ; if ((unsigned int )i < minor_count) { goto ldv_47948; } else { goto ldv_47950; } ldv_47950: ; return (0); } } static int drbd_proc_open(struct inode *inode , struct file *file ) { struct proc_dir_entry *tmp ; int tmp___0 ; int tmp___1 ; { { tmp___1 = ldv_try_module_get_1(& __this_module); } if (tmp___1 != 0) { { tmp = PDE((struct inode const *)inode); tmp___0 = single_open(file, & drbd_seq_show, tmp->data); } return (tmp___0); } else { } return (-19); } } static int drbd_proc_release(struct inode *inode , struct file *file ) { int tmp ; { { ldv_module_put_2(& __this_module); tmp = single_release(inode, file); } return (tmp); } } extern void ldv_check_return_value(int ) ; __inline static int ldv_try_module_get_1(struct module *module ) { int tmp ; { { tmp = ldv_try_module_get(module); } return (tmp); } } void ldv_module_put_2(struct module *ldv_func_arg1 ) { { { ldv_module_put(ldv_func_arg1); } return; } } __inline static void INIT_LIST_HEAD(struct list_head *list ) { { list->next = list; list->prev = list; return; } } extern void __list_add(struct list_head * , struct list_head * , struct list_head * ) ; __inline static void list_add(struct list_head *new , struct list_head *head ) { { { __list_add(new, head, head->next); } return; } } __inline static void list_add_tail(struct list_head *new , struct list_head *head ) { { { __list_add(new, head->prev, head); } return; } } extern void __list_del_entry(struct list_head * ) ; extern void list_del(struct list_head * ) ; __inline static void list_del_init(struct list_head *entry ) { { { __list_del_entry(entry); INIT_LIST_HEAD(entry); } return; } } __inline static int list_empty(struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)head->next) == (unsigned long )head); } } __inline static void __list_splice(struct list_head const *list , struct list_head *prev , struct list_head *next ) { struct list_head *first ; struct list_head *last ; { first = (struct list_head *)list->next; last = (struct list_head *)list->prev; first->prev = prev; prev->next = first; last->next = next; next->prev = last; return; } } __inline static void list_splice_init(struct list_head *list , struct list_head *head ) { int tmp ; { { tmp = list_empty((struct list_head const *)list); } if (tmp == 0) { { __list_splice((struct list_head const *)list, head, head->next); INIT_LIST_HEAD(list); } } else { } return; } } extern int sprintf(char * , char const * , ...) ; extern void __xchg_wrong_size(void) ; extern int memcmp(void const * , void const * , size_t ) ; __inline static void *ERR_PTR(long error ) { { return ((void *)error); } } __inline static void atomic_set(atomic_t *v , int i ) { { v->counter = i; return; } } __inline static void atomic_sub(int i , atomic_t *v ) { { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; subl %1,%0": "+m" (v->counter): "ir" (i)); return; } } __inline static void atomic_dec(atomic_t *v ) { { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; decl %0": "+m" (v->counter)); return; } } __inline static int atomic_xchg(atomic_t *v , int new ) { int __x ; u8 volatile *__ptr ; u16 volatile *__ptr___0 ; u32 volatile *__ptr___1 ; u64 volatile *__ptr___2 ; { __x = new; if (1) { goto case_4; } else { goto switch_default; if (0) { __ptr = (u8 volatile *)(& v->counter); __asm__ volatile ("xchgb %0,%1": "=q" (__x), "+m" (*__ptr): "0" (__x): "memory"); goto ldv_5560; __ptr___0 = (u16 volatile *)(& v->counter); __asm__ volatile ("xchgw %0,%1": "=r" (__x), "+m" (*__ptr___0): "0" (__x): "memory"); goto ldv_5560; case_4: __ptr___1 = (u32 volatile *)(& v->counter); __asm__ volatile ("xchgl %0,%1": "=r" (__x), "+m" (*__ptr___1): "0" (__x): "memory"); goto ldv_5560; __ptr___2 = (u64 volatile *)(& v->counter); __asm__ volatile ("xchgq %0,%1": "=r" (__x), "+m" (*__ptr___2): "0" (__x): "memory"); goto ldv_5560; switch_default: { __xchg_wrong_size(); } } else { } } ldv_5560: ; return (__x); } } extern void lockdep_init_map(struct lockdep_map * , char const * , struct lock_class_key * , int ) ; extern void _raw_spin_lock(raw_spinlock_t * ) ; extern void _raw_spin_unlock(raw_spinlock_t * ) ; extern void _raw_write_lock_irq(rwlock_t * ) ; extern void _raw_write_unlock_irq(rwlock_t * ) ; __inline static void spin_lock(spinlock_t *lock ) { { { _raw_spin_lock(& lock->ldv_6060.rlock); } return; } } __inline static void spin_unlock(spinlock_t *lock ) { { { _raw_spin_unlock(& lock->ldv_6060.rlock); } return; } } extern int mod_timer(struct timer_list * , unsigned long ) ; extern void add_timer(struct timer_list * ) ; __inline static int PageTail(struct page *page ) { int tmp ; { { tmp = constant_test_bit(15U, (unsigned long const volatile *)(& page->flags)); } return (tmp); } } __inline static struct page *compound_head(struct page *page ) { int tmp ; long tmp___0 ; { { tmp = PageTail(page); tmp___0 = __builtin_expect((long )(tmp != 0), 0L); } if (tmp___0 != 0L) { return (page->ldv_14032.first_page); } else { } return (page); } } __inline static int page_count(struct page *page ) { struct page *tmp ; int tmp___0 ; { { tmp = compound_head(page); tmp___0 = atomic_read((atomic_t const *)(& tmp->_count)); } return (tmp___0); } } __inline static void sg_assign_page(struct scatterlist *sg , struct page *page ) { unsigned long page_link ; long tmp ; long tmp___0 ; long tmp___1 ; { { page_link = sg->page_link & 3UL; tmp = __builtin_expect((long )(((unsigned long )page & 3UL) != 0UL), 0L); } if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/scatterlist.h"), "i" (63), "i" (12UL)); ldv_18256: ; goto ldv_18256; } else { } { tmp___0 = __builtin_expect((long )(sg->sg_magic != 2271560481UL), 0L); } if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/scatterlist.h"), "i" (65), "i" (12UL)); ldv_18257: ; goto ldv_18257; } else { } { tmp___1 = __builtin_expect((long )((int )sg->page_link) & 1L, 0L); } if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/scatterlist.h"), "i" (66), "i" (12UL)); ldv_18258: ; goto ldv_18258; } else { } sg->page_link = page_link | (unsigned long )page; return; } } __inline static void sg_set_page(struct scatterlist *sg , struct page *page , unsigned int len , unsigned int offset ) { { { sg_assign_page(sg, page); sg->offset = offset; sg->length = len; } return; } } extern void sg_init_table(struct scatterlist * , unsigned int ) ; __inline static void sema_init(struct semaphore *sem , int val ) { struct lock_class_key __key ; struct semaphore __constr_expr_0 ; { { __constr_expr_0.lock.ldv_6060.rlock.raw_lock.slock = 0U; __constr_expr_0.lock.ldv_6060.rlock.magic = 3735899821U; __constr_expr_0.lock.ldv_6060.rlock.owner_cpu = 4294967295U; __constr_expr_0.lock.ldv_6060.rlock.owner = (void *)0x0fffffffffffffffUL; __constr_expr_0.lock.ldv_6060.rlock.dep_map.key = (struct lock_class_key *)0; __constr_expr_0.lock.ldv_6060.rlock.dep_map.class_cache[0] = (struct lock_class *)0; __constr_expr_0.lock.ldv_6060.rlock.dep_map.class_cache[1] = (struct lock_class *)0; __constr_expr_0.lock.ldv_6060.rlock.dep_map.name = "(*sem).lock"; __constr_expr_0.lock.ldv_6060.rlock.dep_map.cpu = 0; __constr_expr_0.lock.ldv_6060.rlock.dep_map.ip = 0UL; __constr_expr_0.count = (unsigned int )val; __constr_expr_0.wait_list.next = & sem->wait_list; __constr_expr_0.wait_list.prev = & sem->wait_list; *sem = __constr_expr_0; lockdep_init_map(& sem->lock.ldv_6060.ldv_6059.dep_map, "semaphore->lock", & __key, 0); } return; } } extern int down_interruptible(struct semaphore * ) ; extern int down_trylock(struct semaphore * ) ; extern void up(struct semaphore * ) ; __inline static loff_t i_size_read(struct inode const *inode ) { { return ((loff_t )inode->i_size); } } extern long schedule_timeout_interruptible(long ) ; extern void flush_signals(struct task_struct * ) ; extern void force_sig(int , struct task_struct * ) ; extern int sock_setsockopt(struct socket * , int , int , char * , unsigned int ) ; __inline static struct crypto_tfm *crypto_hash_tfm(struct crypto_hash *tfm ) { { return (& tfm->base); } } __inline static struct hash_tfm *crypto_hash_crt(struct crypto_hash *tfm ) { struct crypto_tfm *tmp ; { { tmp = crypto_hash_tfm(tfm); } return (& tmp->crt_u.hash); } } __inline static unsigned int crypto_hash_digestsize(struct crypto_hash *tfm ) { struct hash_tfm *tmp ; { { tmp = crypto_hash_crt(tfm); } return (tmp->digestsize); } } __inline static int crypto_hash_init(struct hash_desc *desc ) { struct hash_tfm *tmp ; int tmp___0 ; { { tmp = crypto_hash_crt(desc->tfm); tmp___0 = (*(tmp->init))(desc); } return (tmp___0); } } __inline static int crypto_hash_update(struct hash_desc *desc , struct scatterlist *sg , unsigned int nbytes ) { struct hash_tfm *tmp ; int tmp___0 ; { { tmp = crypto_hash_crt(desc->tfm); tmp___0 = (*(tmp->update))(desc, sg, nbytes); } return (tmp___0); } } __inline static int crypto_hash_final(struct hash_desc *desc , u8 *out ) { struct hash_tfm *tmp ; int tmp___0 ; { { tmp = crypto_hash_crt(desc->tfm); tmp___0 = (*(tmp->final))(desc, out); } return (tmp___0); } } extern struct bio *bio_clone(struct bio * , gfp_t ) ; extern void generic_make_request(struct bio * ) ; __inline static unsigned int queue_max_hw_sectors(struct request_queue *q ) { { return (q->limits.max_hw_sectors); } } __inline static enum drbd_thread_state get_t_state(struct drbd_thread *thi ) { { __asm__ volatile ("": : : "memory"); return (thi->t_state); } } __inline static unsigned int mdev_to_minor(struct drbd_conf *mdev ) { { return (mdev->minor); } } __inline static int drbd_get_data_sock(struct drbd_conf *mdev ) { long tmp ; { { mutex_lock_nested(& mdev->data.mutex, 0U); tmp = __builtin_expect((long )((unsigned long )mdev->data.socket == (unsigned long )((struct socket *)0)), 0L); } if (tmp != 0L) { { mutex_unlock(& mdev->data.mutex); } return (0); } else { } return (1); } } __inline static void drbd_put_data_sock(struct drbd_conf *mdev ) { { { mutex_unlock(& mdev->data.mutex); } return; } } void drbd_force_state(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val ) ; void _drbd_thread_stop(struct drbd_thread *thi , int restart , int wait ) ; void drbd_thread_current_set_cpu(struct drbd_conf *mdev ) ; int drbd_gen_and_send_sync_uuid(struct drbd_conf *mdev ) ; int _drbd_send_cmd(struct drbd_conf *mdev , struct socket *sock , enum drbd_packets cmd , struct p_header80 *h , size_t size , unsigned int msg_flags ) ; int drbd_send_cmd(struct drbd_conf *mdev , int use_data_socket , enum drbd_packets cmd , struct p_header80 *h , size_t size ) ; int drbd_send_ack(struct drbd_conf *mdev , enum drbd_packets cmd , struct drbd_epoch_entry *e ) ; int drbd_send_ack_ex(struct drbd_conf *mdev , enum drbd_packets cmd , sector_t sector , int blksize , u64 block_id ) ; int drbd_send_oos(struct drbd_conf *mdev , struct drbd_request *req ) ; int drbd_send_block(struct drbd_conf *mdev , enum drbd_packets cmd , struct drbd_epoch_entry *e ) ; int drbd_send_dblock(struct drbd_conf *mdev , struct drbd_request *req ) ; int drbd_send_drequest(struct drbd_conf *mdev , int cmd , sector_t sector , int size , u64 block_id ) ; int drbd_send_drequest_csum(struct drbd_conf *mdev , sector_t sector , int size , void *digest , int digest_size , enum drbd_packets cmd ) ; int drbd_send_ov_request(struct drbd_conf *mdev , sector_t sector , int size ) ; void drbd_mdev_cleanup(struct drbd_conf *mdev ) ; void drbd_print_uuids(struct drbd_conf *mdev , char const *text ) ; void drbd_md_sync(struct drbd_conf *mdev ) ; void drbd_uuid_set(struct drbd_conf *mdev , int idx , u64 val ) ; void _drbd_uuid_set(struct drbd_conf *mdev , int idx , u64 val ) ; void drbd_uuid_set_bm(struct drbd_conf *mdev , u64 val ) ; wait_queue_head_t drbd_pp_wait ; rwlock_t global_state_lock ; int drbd_khelper(struct drbd_conf *mdev , char *cmd ) ; int drbd_worker(struct drbd_thread *thi ) ; int drbd_alter_sa(struct drbd_conf *mdev , int na ) ; void drbd_start_resync(struct drbd_conf *mdev , enum drbd_conns side ) ; void resume_next_sg(struct drbd_conf *mdev ) ; void suspend_other_sg(struct drbd_conf *mdev ) ; int drbd_resync_finished(struct drbd_conf *mdev ) ; void drbd_ov_oos_found(struct drbd_conf *mdev , sector_t sector , int size ) ; void drbd_rs_controller_reset(struct drbd_conf *mdev ) ; __inline static void ov_oos_print(struct drbd_conf *mdev ) { { if (mdev->ov_last_oos_size != 0UL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Out of sync: start=%llu, size=%lu (sectors)\n", (unsigned long long )mdev->ov_last_oos_start, mdev->ov_last_oos_size); } } else { } mdev->ov_last_oos_size = 0UL; return; } } void drbd_csum_bio(struct drbd_conf *mdev , struct crypto_hash *tfm , struct bio *bio , void *digest ) ; void drbd_csum_ee(struct drbd_conf *mdev , struct crypto_hash *tfm , struct drbd_epoch_entry *e , void *digest ) ; int w_read_retry_remote(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_e_end_data_req(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_e_end_rsdata_req(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_e_end_csum_rs_req(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_e_end_ov_reply(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_e_end_ov_req(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_ov_finished(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_resync_timer(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_send_write_hint(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_send_dblock(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_send_barrier(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_send_read_req(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_prev_work_done(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_restart_disk_io(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_send_oos(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_start_resync(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; void resync_timer_fn(unsigned long data ) ; void start_resync_timer_fn(unsigned long data ) ; int drbd_rs_should_slow_down(struct drbd_conf *mdev , sector_t sector ) ; int drbd_submit_ee(struct drbd_conf *mdev , struct drbd_epoch_entry *e , unsigned int const rw , int const fault_type ) ; struct drbd_epoch_entry *drbd_alloc_ee(struct drbd_conf *mdev , u64 id , sector_t sector , unsigned int data_size , gfp_t gfp_mask ) ; void drbd_free_some_ee(struct drbd_conf *mdev , struct drbd_epoch_entry *e , int is_net ) ; __inline static int drbd_setsockopt(struct socket *sock , int level , int optname , char *optval , int optlen ) { int err ; { if (level == 1) { { err = sock_setsockopt(sock, level, optname, optval, (unsigned int )optlen); } } else { { err = (*((sock->ops)->setsockopt))(sock, level, optname, optval, (unsigned int )optlen); } } return (err); } } __inline static void drbd_tcp_cork(struct socket *sock ) { int val ; { { val = 1; drbd_setsockopt(sock, 6, 3, (char *)(& val), 4); } return; } } __inline static void drbd_tcp_uncork(struct socket *sock ) { int val ; { { val = 0; drbd_setsockopt(sock, 6, 3, (char *)(& val), 4); } return; } } void drbd_al_begin_io(struct drbd_conf *mdev , sector_t sector ) ; void drbd_al_complete_io(struct drbd_conf *mdev , sector_t sector ) ; void drbd_rs_complete_io(struct drbd_conf *mdev , sector_t sector ) ; int drbd_try_rs_begin_io(struct drbd_conf *mdev , sector_t sector ) ; void drbd_rs_cancel_all(struct drbd_conf *mdev ) ; int drbd_rs_del_all(struct drbd_conf *mdev ) ; void drbd_rs_failed_io(struct drbd_conf *mdev , sector_t sector , int size ) ; void drbd_advance_rs_marks(struct drbd_conf *mdev , unsigned long still_to_go ) ; void __drbd_set_in_sync(struct drbd_conf *mdev , sector_t sector , int size , char const *file , unsigned int const line ) ; int __drbd_set_out_of_sync(struct drbd_conf *mdev , sector_t sector , int size , char const *file , unsigned int const line ) ; __inline static struct page *page_chain_next(struct page *page ) { { return ((struct page *)page->ldv_14032.ldv_14029.private); } } __inline static int drbd_ee_has_active_page(struct drbd_epoch_entry *e ) { struct page *page ; int tmp ; struct page *tmp___0 ; { page = e->pages; goto ldv_48200; ldv_48199: { tmp = page_count(page); } if (tmp > 1) { return (1); } else { } { page = page_chain_next(page); } ldv_48200: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { { tmp___0 = page_chain_next(page); __builtin_prefetch((void const *)tmp___0); } goto ldv_48199; } else { goto ldv_48201; } ldv_48201: ; return (0); } } __inline static void drbd_state_lock(struct drbd_conf *mdev ) { int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; { { tmp = test_and_set_bit(8, (unsigned long volatile *)(& mdev->flags)); } if (tmp == 0) { goto ldv_48205; } else { } { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_48208: { prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___1 = test_and_set_bit(8, (unsigned long volatile *)(& mdev->flags)); } if (tmp___1 == 0) { goto ldv_48207; } else { } { schedule(); } goto ldv_48208; ldv_48207: { finish_wait(& mdev->misc_wait, & __wait); } ldv_48205: ; return; } } __inline static void drbd_state_unlock(struct drbd_conf *mdev ) { { { clear_bit(8, (unsigned long volatile *)(& mdev->flags)); __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); } return; } } __inline static void __drbd_chk_io_error____0(struct drbd_conf *mdev , int forcedetach , char const *where ) { int tmp ; union drbd_state __ns ; union drbd_state __ns___0 ; { if ((mdev->ldev)->dc.on_io_error == 0) { goto case_0; } else if ((mdev->ldev)->dc.on_io_error == 2) { goto case_2; } else if ((mdev->ldev)->dc.on_io_error == 1) { goto case_1; } else if (0) { case_0: ; if (forcedetach == 0) { { tmp = ___ratelimit(& drbd_ratelimit_state, "__drbd_chk_io_error_"); } if (tmp != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s.\n", where); } } else { } if ((int )mdev->state.ldv_38339.disk > 4) { { __ns.i = mdev->state.i; __ns.ldv_38339.disk = (unsigned char)4; _drbd_set_state(mdev, __ns, (enum chg_state_flags )1, (struct completion *)0); } } else { } goto ldv_48233; } else { } case_2: ; case_1: { set_bit(19U, (unsigned long volatile *)(& mdev->flags)); } if ((int )mdev->state.ldv_38339.disk > 2) { { __ns___0.i = mdev->state.i; __ns___0.ldv_38339.disk = (unsigned char)2; _drbd_set_state(mdev, __ns___0, (enum chg_state_flags )1, (struct completion *)0); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s. Detaching...\n", where); } } else { } goto ldv_48233; } else { } ldv_48233: ; return; } } __inline static sector_t drbd_get_capacity(struct block_device *bdev ) { loff_t tmp ; sector_t tmp___0 ; { if ((unsigned long )bdev != (unsigned long )((struct block_device *)0)) { { tmp = i_size_read((struct inode const *)bdev->bd_inode); tmp___0 = (sector_t )(tmp >> 9); } } else { tmp___0 = 0UL; } return (tmp___0); } } __inline static void drbd_queue_work(struct drbd_work_queue *q , struct drbd_work *w ) { unsigned long flags ; raw_spinlock_t *tmp ; { { tmp = spinlock_check(& q->q_lock); flags = _raw_spin_lock_irqsave(tmp); list_add_tail(& w->list, & q->q); up(& q->s); spin_unlock_irqrestore(& q->q_lock, flags); } return; } } __inline static void wake_asender(struct drbd_conf *mdev ) { int tmp ; { { tmp = constant_test_bit(1U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp != 0) { { force_sig(24, mdev->asender.task); } } else { } return; } } __inline static void request_ping(struct drbd_conf *mdev ) { { { set_bit(2U, (unsigned long volatile *)(& mdev->flags)); wake_asender(mdev); } return; } } __inline static int drbd_send_short_cmd(struct drbd_conf *mdev , enum drbd_packets cmd ) { struct p_header80 h ; int tmp ; { { tmp = drbd_send_cmd(mdev, 1, cmd, & h, 8UL); } return (tmp); } } __inline static void drbd_thread_stop(struct drbd_thread *thi ) { { { _drbd_thread_stop(thi, 0, 1); } return; } } __inline static void inc_rs_pending(struct drbd_conf *mdev ) { { { atomic_inc(& mdev->rs_pending_cnt); } return; } } void drbd_md_io_complete(struct bio *bio , int error ) ; void drbd_endio_sec(struct bio *bio , int error ) ; void drbd_endio_pri(struct bio *bio , int error ) ; __inline static void drbd_req_make_private_bio(struct drbd_request *req , struct bio *bio_src ) { struct bio *bio ; { { bio = bio_clone(bio_src, 16U); req->private_bio = bio; bio->bi_private = (void *)req; bio->bi_end_io = & drbd_endio_pri; bio->bi_next = (struct bio *)0; } return; } } int __req_mod(struct drbd_request *req , enum drbd_req_event what , struct bio_and_error *m ) ; void complete_master_bio(struct drbd_conf *mdev , struct bio_and_error *m ) ; __inline static int _req_mod(struct drbd_request *req , enum drbd_req_event what ) { struct drbd_conf *mdev ; struct bio_and_error m ; int rv ; { { mdev = req->mdev; rv = __req_mod(req, what, & m); } if ((unsigned long )m.bio != (unsigned long )((struct bio *)0)) { { complete_master_bio(mdev, & m); } } else { } return (rv); } } __inline static int req_mod(struct drbd_request *req , enum drbd_req_event what ) { unsigned long flags ; struct drbd_conf *mdev ; struct bio_and_error m ; int rv ; raw_spinlock_t *tmp ; { { mdev = req->mdev; tmp = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp); rv = __req_mod(req, what, & m); spin_unlock_irqrestore(& mdev->req_lock, flags); } if ((unsigned long )m.bio != (unsigned long )((struct bio *)0)) { { complete_master_bio(mdev, & m); } } else { } return (rv); } } static int w_make_ov_request(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; static int w_make_resync_request(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; void drbd_md_io_complete(struct bio *bio , int error ) { struct drbd_md_io *md_io ; { { md_io = (struct drbd_md_io *)bio->bi_private; md_io->error = error; complete(& md_io->event); } return; } } void drbd_endio_read_sec_final(struct drbd_epoch_entry *e ) { unsigned long flags ; struct drbd_conf *mdev ; raw_spinlock_t *tmp ; int tmp___0 ; int tmp___1 ; { flags = 0UL; mdev = e->mdev; if (e->ldv_46600.block_id == 0ULL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( e->block_id != ID_VACANT ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", 95); } } else { } { tmp = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp); mdev->read_cnt = mdev->read_cnt + (e->size >> 9); list_del(& e->w.list); tmp___0 = list_empty((struct list_head const *)(& mdev->read_ee)); } if (tmp___0 != 0) { { __wake_up(& mdev->ee_wait, 3U, 1, (void *)0); } } else { } { tmp___1 = constant_test_bit(3U, (unsigned long const volatile *)(& e->flags)); } if (tmp___1 != 0) { { __drbd_chk_io_error____0(mdev, 0, "drbd_endio_read_sec_final"); } } else { } { spin_unlock_irqrestore(& mdev->req_lock, flags); drbd_queue_work(& mdev->data.work, & e->w); put_ldev(mdev); } return; } } static void drbd_endio_write_sec_final(struct drbd_epoch_entry *e ) { unsigned long flags ; struct drbd_conf *mdev ; sector_t e_sector ; int do_wake ; int is_syncer_req ; int do_al_complete_io ; raw_spinlock_t *tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { flags = 0UL; mdev = e->mdev; if (e->ldv_46600.block_id == 0ULL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( e->block_id != ID_VACANT ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", 121); } } else { } { e_sector = e->sector; do_al_complete_io = (int )e->flags & 1; is_syncer_req = e->ldv_46600.block_id == 0x0fffffffffffffffULL; tmp = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp); mdev->writ_cnt = mdev->writ_cnt + (e->size >> 9); list_del(& e->w.list); list_add_tail(& e->w.list, & mdev->done_ee); } if (is_syncer_req != 0) { { tmp___0 = list_empty((struct list_head const *)(& mdev->sync_ee)); do_wake = tmp___0; } } else { { tmp___1 = list_empty((struct list_head const *)(& mdev->active_ee)); do_wake = tmp___1; } } { tmp___2 = constant_test_bit(3U, (unsigned long const volatile *)(& e->flags)); } if (tmp___2 != 0) { { __drbd_chk_io_error____0(mdev, 0, "drbd_endio_write_sec_final"); } } else { } { spin_unlock_irqrestore(& mdev->req_lock, flags); } if (is_syncer_req != 0) { { drbd_rs_complete_io(mdev, e_sector); } } else { } if (do_wake != 0) { { __wake_up(& mdev->ee_wait, 3U, 1, (void *)0); } } else { } if (do_al_complete_io != 0) { { drbd_al_complete_io(mdev, e_sector); } } else { } { wake_asender(mdev); put_ldev(mdev); } return; } } void drbd_endio_sec(struct bio *bio , int error ) { struct drbd_epoch_entry *e ; struct drbd_conf *mdev ; int uptodate ; int is_write ; char *tmp ; int tmp___0 ; char *tmp___1 ; int tmp___2 ; int tmp___3 ; { e = (struct drbd_epoch_entry *)bio->bi_private; mdev = e->mdev; uptodate = (int )bio->bi_flags & 1; is_write = (int )bio->bi_rw & 1; if (error != 0) { { tmp___0 = ___ratelimit(& drbd_ratelimit_state, "drbd_endio_sec"); } if (tmp___0 != 0) { if (is_write != 0) { tmp = (char *)"write"; } else { tmp = (char *)"read"; } { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: error=%d s=%llus\n", tmp, error, (unsigned long long )e->sector); } } else { } } else { } if (error == 0) { if (uptodate == 0) { { tmp___2 = ___ratelimit(& drbd_ratelimit_state, "drbd_endio_sec"); } if (tmp___2 != 0) { if (is_write != 0) { tmp___1 = (char *)"write"; } else { tmp___1 = (char *)"read"; } { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: setting error to -EIO s=%llus\n", tmp___1, (unsigned long long )e->sector); } } else { } error = -5; } else { } } else { } if (error != 0) { { set_bit(3U, (unsigned long volatile *)(& e->flags)); } } else { } { bio_put(bio); tmp___3 = atomic_dec_and_test(& e->pending_bios); } if (tmp___3 != 0) { if (is_write != 0) { { drbd_endio_write_sec_final(e); } } else { { drbd_endio_read_sec_final(e); } } } else { } return; } } void drbd_endio_pri(struct bio *bio , int error ) { unsigned long flags ; struct drbd_request *req ; struct drbd_conf *mdev ; struct bio_and_error m ; enum drbd_req_event what ; int uptodate ; char *tmp ; int tmp___0 ; long tmp___1 ; void *tmp___2 ; raw_spinlock_t *tmp___3 ; { req = (struct drbd_request *)bio->bi_private; mdev = req->mdev; uptodate = (int )bio->bi_flags & 1; if (error == 0) { if (uptodate == 0) { if ((int )bio->bi_rw & 1) { tmp = (char *)"write"; } else { tmp = (char *)"read"; } { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "p %s: setting error to -EIO\n", tmp); error = -5; } } else { } } else { } { tmp___1 = __builtin_expect((long )(error != 0), 0L); } if (tmp___1 != 0L) { if ((int )bio->bi_rw & 1) { what = (enum drbd_req_event )21; } else { if ((bio->bi_rw & 257UL) == 0UL) { tmp___0 = 19; } else { tmp___0 = 20; } what = (enum drbd_req_event )tmp___0; } } else { what = (enum drbd_req_event )22; } { bio_put(req->private_bio); tmp___2 = ERR_PTR((long )error); req->private_bio = (struct bio *)tmp___2; tmp___3 = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp___3); __req_mod(req, what, & m); spin_unlock_irqrestore(& mdev->req_lock, flags); } if ((unsigned long )m.bio != (unsigned long )((struct bio *)0)) { { complete_master_bio(mdev, & m); } } else { } return; } } int w_read_retry_remote(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_request *req ; struct drbd_work const *__mptr ; int tmp ; { { __mptr = (struct drbd_work const *)w; req = (struct drbd_request *)__mptr; spin_lock_irq(& mdev->req_lock); } if (cancel != 0) { { _req_mod(req, (enum drbd_req_event )11); spin_unlock_irq(& mdev->req_lock); } return (1); } else if (*((unsigned int *)mdev + 569UL) != 65536U) { { _req_mod(req, (enum drbd_req_event )11); spin_unlock_irq(& mdev->req_lock); } return (1); } else { } { spin_unlock_irq(& mdev->req_lock); tmp = w_send_read_req(mdev, w, 0); } return (tmp); } } void drbd_csum_ee(struct drbd_conf *mdev , struct crypto_hash *tfm , struct drbd_epoch_entry *e , void *digest ) { struct hash_desc desc ; struct scatterlist sg ; struct page *page ; struct page *tmp ; unsigned int len ; unsigned int tmp___0 ; { { page = e->pages; desc.tfm = tfm; desc.flags = 0U; sg_init_table(& sg, 1U); crypto_hash_init(& desc); } goto ldv_48708; ldv_48707: { sg_set_page(& sg, page, 4096U, 0U); crypto_hash_update(& desc, & sg, sg.length); page = tmp; } ldv_48708: { tmp = page_chain_next(page); } if ((unsigned long )tmp != (unsigned long )((struct page *)0)) { goto ldv_48707; } else { goto ldv_48709; } ldv_48709: len = e->size & 4095U; if (len != 0U) { tmp___0 = len; } else { tmp___0 = 4096U; } { sg_set_page(& sg, page, tmp___0, 0U); crypto_hash_update(& desc, & sg, sg.length); crypto_hash_final(& desc, (u8 *)digest); } return; } } void drbd_csum_bio(struct drbd_conf *mdev , struct crypto_hash *tfm , struct bio *bio , void *digest ) { struct hash_desc desc ; struct scatterlist sg ; struct bio_vec *bvec ; int i ; { { desc.tfm = tfm; desc.flags = 0U; sg_init_table(& sg, 1U); crypto_hash_init(& desc); bvec = bio->bi_io_vec; i = 0; } goto ldv_48721; ldv_48720: { sg_set_page(& sg, bvec->bv_page, bvec->bv_len, bvec->bv_offset); crypto_hash_update(& desc, & sg, sg.length); bvec = bvec + 1; i = i + 1; } ldv_48721: ; if ((int )bio->bi_vcnt > i) { goto ldv_48720; } else { goto ldv_48722; } ldv_48722: { crypto_hash_final(& desc, (u8 *)digest); } return; } } int w_e_send_csum(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_epoch_entry *e ; struct drbd_work const *__mptr ; int digest_size ; void *digest ; int ok ; long tmp ; long tmp___0 ; unsigned int tmp___1 ; sector_t sector ; unsigned int size ; long tmp___2 ; { __mptr = (struct drbd_work const *)w; e = (struct drbd_epoch_entry *)__mptr; ok = 1; if (e->ldv_46600.block_id != 2205466966ULL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( e->block_id == DRBD_MAGIC + 0xbeef ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", 315); } } else { } { tmp = __builtin_expect((long )(cancel != 0), 0L); } if (tmp != 0L) { goto out; } else { } { tmp___0 = __builtin_expect((long )((e->flags & 8UL) != 0UL), 1L); } if (tmp___0 != 0L) { goto out; } else { } { tmp___1 = crypto_hash_digestsize(mdev->csums_tfm); digest_size = (int )tmp___1; digest = kmalloc((size_t )digest_size, 16U); } if ((unsigned long )digest != (unsigned long )((void *)0)) { { sector = e->sector; size = e->size; drbd_csum_ee(mdev, mdev->csums_tfm, e, digest); drbd_free_some_ee(mdev, e, 0); e = (struct drbd_epoch_entry *)0; inc_rs_pending(mdev); ok = drbd_send_drequest_csum(mdev, sector, (int )size, digest, digest_size, (enum drbd_packets )33); kfree((void const *)digest); } } else { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "kmalloc() of digest failed.\n"); ok = 0; } } out: ; if ((unsigned long )e != (unsigned long )((struct drbd_epoch_entry *)0)) { { drbd_free_some_ee(mdev, e, 0); } } else { } { tmp___2 = __builtin_expect((long )(ok == 0), 0L); } if (tmp___2 != 0L) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_send_drequest(..., csum) failed\n"); } } else { } return (ok); } } static int read_for_csum(struct drbd_conf *mdev , sector_t sector , int size ) { struct drbd_epoch_entry *e ; int tmp ; int tmp___0 ; int tmp___1 ; { { tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp == 0) { return (-5); } else { } { tmp___0 = drbd_rs_should_slow_down(mdev, sector); } if (tmp___0 != 0) { goto defer; } else { } { e = drbd_alloc_ee(mdev, 2205466966ULL, sector, (unsigned int )size, 514U); } if ((unsigned long )e == (unsigned long )((struct drbd_epoch_entry *)0)) { goto defer; } else { } { e->w.cb = & w_e_send_csum; spin_lock_irq(& mdev->req_lock); list_add(& e->w.list, & mdev->read_ee); spin_unlock_irq(& mdev->req_lock); atomic_add(size >> 9, & mdev->rs_sect_ev); tmp___1 = drbd_submit_ee(mdev, e, (unsigned int const )0U, (int const )3); } if (tmp___1 == 0) { return (0); } else { } { spin_lock_irq(& mdev->req_lock); list_del(& e->w.list); spin_unlock_irq(& mdev->req_lock); drbd_free_some_ee(mdev, e, 0); } defer: { put_ldev(mdev); } return (-11); } } int w_resync_timer(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { { if ((int )mdev->state.ldv_38339.conn == 18) { goto case_18; } else if ((int )mdev->state.ldv_38339.conn == 17) { goto case_17; } else if (0) { case_18: { w_make_ov_request(mdev, w, cancel); } goto ldv_48750; case_17: { w_make_resync_request(mdev, w, cancel); } goto ldv_48750; } else { } ldv_48750: ; return (1); } } void resync_timer_fn(unsigned long data ) { struct drbd_conf *mdev ; int tmp ; { { mdev = (struct drbd_conf *)data; tmp = list_empty((struct list_head const *)(& mdev->resync_work.list)); } if (tmp != 0) { { drbd_queue_work(& mdev->data.work, & mdev->resync_work); } } else { } return; } } static void fifo_set(struct fifo_buffer *fb , int value ) { int i ; { i = 0; goto ldv_48762; ldv_48761: *(fb->values + (unsigned long )i) = value; i = i + 1; ldv_48762: ; if ((unsigned int )i < fb->size) { goto ldv_48761; } else { goto ldv_48763; } ldv_48763: ; return; } } static int fifo_push(struct fifo_buffer *fb , int value ) { int ov ; unsigned int tmp ; { ov = *(fb->values + (unsigned long )fb->head_index); tmp = fb->head_index; fb->head_index = fb->head_index + 1U; *(fb->values + (unsigned long )tmp) = value; if (fb->head_index >= fb->size) { fb->head_index = 0U; } else { } return (ov); } } static void fifo_add_val(struct fifo_buffer *fb , int value ) { int i ; { i = 0; goto ldv_48775; ldv_48774: *(fb->values + (unsigned long )i) = *(fb->values + (unsigned long )i) + value; i = i + 1; ldv_48775: ; if ((unsigned int )i < fb->size) { goto ldv_48774; } else { goto ldv_48776; } ldv_48776: ; return; } } static int drbd_rs_controller(struct drbd_conf *mdev ) { unsigned int sect_in ; unsigned int want ; int req_sect ; int correction ; int cps ; int steps ; int curr_corr ; int max_sect ; int tmp ; { { tmp = atomic_xchg(& mdev->rs_sect_in, 0); sect_in = (unsigned int )tmp; mdev->rs_in_flight = (int )((unsigned int )mdev->rs_in_flight - sect_in); spin_lock(& mdev->peer_seq_lock); steps = (int )mdev->rs_plan_s.size; } if ((unsigned int )mdev->rs_in_flight + sect_in == 0U) { want = (unsigned int )(((mdev->sync_conf.rate * 50) / 250) * steps); } else if (mdev->sync_conf.c_fill_target != 0) { want = (unsigned int )mdev->sync_conf.c_fill_target; } else { want = (((unsigned int )mdev->sync_conf.c_delay_target * sect_in) * 250U) / 250U; } { correction = (int )((want - (unsigned int )mdev->rs_in_flight) - (unsigned int )mdev->rs_planed); cps = correction / steps; fifo_add_val(& mdev->rs_plan_s, cps); mdev->rs_planed = mdev->rs_planed + cps * steps; curr_corr = fifo_push(& mdev->rs_plan_s, 0); spin_unlock(& mdev->peer_seq_lock); mdev->rs_planed = mdev->rs_planed - curr_corr; req_sect = (int )(sect_in + (unsigned int )curr_corr); } if (req_sect < 0) { req_sect = 0; } else { } max_sect = (mdev->sync_conf.c_max_rate * 50) / 250; if (req_sect > max_sect) { req_sect = max_sect; } else { } return (req_sect); } } static int drbd_rs_number_requests(struct drbd_conf *mdev ) { int number ; int tmp ; { if (mdev->rs_plan_s.size != 0U) { { tmp = drbd_rs_controller(mdev); number = tmp >> 3; mdev->c_sync_rate = (number * 1000) / 25; } } else { mdev->c_sync_rate = mdev->sync_conf.rate; number = (mdev->c_sync_rate * 25) / 1000; } return (number); } } static int w_make_resync_request(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { unsigned long bit ; sector_t sector ; sector_t capacity ; sector_t tmp ; int max_bio_size ; int number ; int rollback_i ; int size ; int align ; int queued ; int sndbuf ; int i ; long tmp___0 ; int tmp___1 ; unsigned int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; long tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; unsigned long tmp___12 ; { { tmp = drbd_get_capacity(mdev->this_bdev); capacity = tmp; i = 0; tmp___0 = __builtin_expect((long )(cancel != 0), 0L); } if (tmp___0 != 0L) { return (1); } else { } if (mdev->rs_total == 0UL) { { drbd_resync_finished(mdev); } return (1); } else { } { tmp___1 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___1 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Disk broke down during resync!\n"); } return (1); } else { } { tmp___2 = queue_max_hw_sectors(mdev->rq_queue); max_bio_size = (int )(tmp___2 << 9); number = drbd_rs_number_requests(mdev); } if (number == 0) { goto requeue; } else { } i = 0; goto ldv_48823; ldv_48822: { mutex_lock_nested(& mdev->data.mutex, 0U); } if ((unsigned long )mdev->data.socket != (unsigned long )((struct socket *)0)) { queued = ((mdev->data.socket)->sk)->sk_wmem_queued; sndbuf = ((mdev->data.socket)->sk)->sk_sndbuf; } else { queued = 1; sndbuf = 0; } { mutex_unlock(& mdev->data.mutex); } if (sndbuf / 2 < queued) { goto requeue; } else { } next_sector: { size = 4096; bit = drbd_bm_find_next(mdev, mdev->bm_resync_fo); } if (bit == 0x0fffffffffffffffUL) { { mdev->bm_resync_fo = drbd_bm_bits(mdev); put_ldev(mdev); } return (1); } else { } { sector = bit << 3; tmp___3 = drbd_rs_should_slow_down(mdev, sector); } if (tmp___3 != 0) { mdev->bm_resync_fo = bit; goto requeue; } else { { tmp___4 = drbd_try_rs_begin_io(mdev, sector); } if (tmp___4 != 0) { mdev->bm_resync_fo = bit; goto requeue; } else { } } { mdev->bm_resync_fo = bit + 1UL; tmp___5 = drbd_bm_test_bit(mdev, bit); tmp___6 = __builtin_expect((long )(tmp___5 == 0), 0L); } if (tmp___6 != 0L) { { drbd_rs_complete_io(mdev, sector); } goto next_sector; } else { } align = 1; rollback_i = i; ldv_48811: ; if (size + 4096 > max_bio_size) { goto ldv_48810; } else { } if (((sector_t )((1 << (align + 3)) + -1) & sector) != 0UL) { goto ldv_48810; } else { } if (((bit + 1UL) & 4095UL) == 0UL) { goto ldv_48810; } else { } { tmp___7 = drbd_bm_test_bit(mdev, bit + 1UL); } if (tmp___7 != 1) { goto ldv_48810; } else { } bit = bit + 1UL; size = size + 4096; if (4096 << align <= size) { align = align + 1; } else { } i = i + 1; goto ldv_48811; ldv_48810: ; if (size > 4096) { mdev->bm_resync_fo = bit + 1UL; } else { } if ((sector_t )(size >> 9) + sector > capacity) { size = (int )((capacity - sector) << 9); } else { } if (mdev->agreed_pro_version > 88) { if ((unsigned long )mdev->csums_tfm != (unsigned long )((struct crypto_hash *)0)) { { tmp___8 = read_for_csum(mdev, sector, size); } if (tmp___8 == -5) { goto case_neg_5; } else if (tmp___8 == -11) { goto case_neg_11; } else if (tmp___8 == 0) { goto case_0; } else { goto switch_default; if (0) { case_neg_5: { put_ldev(mdev); } return (0); case_neg_11: { drbd_rs_complete_io(mdev, sector); mdev->bm_resync_fo = sector >> 3; i = rollback_i; } goto requeue; case_0: ; goto ldv_48815; switch_default: __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p"), "i" (645), "i" (12UL)); ldv_48817: ; goto ldv_48817; } else { } } ldv_48815: ; } else { goto _L; } } else { _L: { inc_rs_pending(mdev); tmp___11 = drbd_send_drequest(mdev, 9, sector, size, 0x0fffffffffffffffULL); } if (tmp___11 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_send_drequest() failed, aborting...\n"); atomic_dec(& mdev->rs_pending_cnt); tmp___10 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); } if (tmp___10 < 0) { { tmp___9 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "w_make_resync_request", 652, tmp___9); } } else { } { put_ldev(mdev); } return (0); } else { } } i = i + 1; ldv_48823: ; if (i < number) { goto ldv_48822; } else { goto ldv_48824; } ldv_48824: { tmp___12 = drbd_bm_bits(mdev); } if (mdev->bm_resync_fo >= tmp___12) { { put_ldev(mdev); } return (1); } else { } requeue: { mdev->rs_in_flight = mdev->rs_in_flight + (i << 3); mod_timer(& mdev->resync_timer, (unsigned long )jiffies + 25UL); put_ldev(mdev); } return (1); } } static int w_make_ov_request(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { int number ; int i ; int size ; sector_t sector ; sector_t capacity ; sector_t tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { { tmp = drbd_get_capacity(mdev->this_bdev); capacity = tmp; tmp___0 = __builtin_expect((long )(cancel != 0), 0L); } if (tmp___0 != 0L) { return (1); } else { } { number = drbd_rs_number_requests(mdev); sector = mdev->ov_position; i = 0; } goto ldv_48841; ldv_48840: ; if (sector >= capacity) { return (1); } else { } { size = 4096; tmp___1 = drbd_rs_should_slow_down(mdev, sector); } if (tmp___1 != 0) { mdev->ov_position = sector; goto requeue; } else { { tmp___2 = drbd_try_rs_begin_io(mdev, sector); } if (tmp___2 != 0) { mdev->ov_position = sector; goto requeue; } else { } } if ((sector_t )(size >> 9) + sector > capacity) { size = (int )((capacity - sector) << 9); } else { } { inc_rs_pending(mdev); tmp___5 = drbd_send_ov_request(mdev, sector, size); } if (tmp___5 == 0) { { atomic_dec(& mdev->rs_pending_cnt); tmp___4 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); } if (tmp___4 < 0) { { tmp___3 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "w_make_ov_request", 707, tmp___3); } } else { } return (0); } else { } sector = sector + 8UL; i = i + 1; ldv_48841: ; if (i < number) { goto ldv_48840; } else { goto ldv_48842; } ldv_48842: mdev->ov_position = sector; requeue: { mdev->rs_in_flight = mdev->rs_in_flight + (i << 3); mod_timer(& mdev->resync_timer, (unsigned long )jiffies + 25UL); } return (1); } } void start_resync_timer_fn(unsigned long data ) { struct drbd_conf *mdev ; { { mdev = (struct drbd_conf *)data; drbd_queue_work(& mdev->data.work, & mdev->start_resync_work); } return; } } int w_start_resync(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { int tmp ; int tmp___0 ; { { tmp = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); } if (tmp != 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "w_start_resync later...\n"); mdev->start_resync_timer.expires = (unsigned long )jiffies + 25UL; add_timer(& mdev->start_resync_timer); } return (1); } else { { tmp___0 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); } if (tmp___0 != 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "w_start_resync later...\n"); mdev->start_resync_timer.expires = (unsigned long )jiffies + 25UL; add_timer(& mdev->start_resync_timer); } return (1); } else { } } { drbd_start_resync(mdev, (enum drbd_conns )16); clear_bit(29, (unsigned long volatile *)(& (mdev->current_epoch)->flags)); } return (1); } } int w_ov_finished(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { { { kfree((void const *)w); ov_oos_print(mdev); drbd_resync_finished(mdev); } return (1); } } static int w_resync_finished(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { { { kfree((void const *)w); drbd_resync_finished(mdev); } return (1); } } static void ping_peer(struct drbd_conf *mdev ) { int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; { { clear_bit(26, (unsigned long volatile *)(& mdev->flags)); request_ping(mdev); tmp = constant_test_bit(26U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp != 0) { goto ldv_48865; } else if ((int )mdev->state.ldv_38339.conn <= 9) { goto ldv_48865; } else { } { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_48868: { prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___1 = constant_test_bit(26U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___1 != 0) { goto ldv_48867; } else if ((int )mdev->state.ldv_38339.conn <= 9) { goto ldv_48867; } else { } { schedule(); } goto ldv_48868; ldv_48867: { finish_wait(& mdev->misc_wait, & __wait); } ldv_48865: ; return; } } int drbd_resync_finished(struct drbd_conf *mdev ) { unsigned long db ; unsigned long dt ; unsigned long dbdt ; unsigned long n_oos ; union drbd_state os ; union drbd_state ns ; struct drbd_work *w ; char *khelper_cmd ; int verify_done ; void *tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; char *tmp___3 ; unsigned long s ; unsigned long t ; int ratio ; int tmp___4 ; int tmp___5 ; int i ; int i___0 ; { { khelper_cmd = (char *)0; verify_done = 0; tmp___0 = drbd_rs_del_all(mdev); } if (tmp___0 != 0) { { schedule_timeout_interruptible(25L); tmp = kmalloc(24UL, 32U); w = (struct drbd_work *)tmp; } if ((unsigned long )w != (unsigned long )((struct drbd_work *)0)) { { w->cb = & w_resync_finished; drbd_queue_work(& mdev->data.work, w); } return (1); } else { } { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Warn failed to drbd_rs_del_all() and to kmalloc(w).\n"); } } else { } dt = (((unsigned long )jiffies - mdev->rs_start) - mdev->rs_paused) / 250UL; if (dt == 0UL) { dt = 1UL; } else { } { db = mdev->rs_total; dbdt = db / dt << 2; mdev->rs_paused = mdev->rs_paused / 250UL; tmp___1 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___1 == 0) { goto out; } else { } { ping_peer(mdev); spin_lock_irq(& mdev->req_lock); os = mdev->state; } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 288U) { tmp___2 = 1; } else if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 304U) { tmp___2 = 1; } else { tmp___2 = 0; } verify_done = tmp___2; if ((int )os.ldv_38339.conn <= 10) { goto out_unlock; } else { } ns = os; ns.ldv_38339.conn = (unsigned char)10; if (verify_done != 0) { tmp___3 = (char *)"Online verify "; } else { tmp___3 = (char *)"Resync"; } { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s done (total %lu sec; paused %lu sec; %lu K/sec)\n", tmp___3, mdev->rs_paused + dt, mdev->rs_paused, dbdt); n_oos = drbd_bm_total_weight(mdev); } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 288U) { goto _L; } else if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 304U) { _L: if (n_oos != 0UL) { { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "Online verify found %lu %dk block out of sync!\n", n_oos, 4); khelper_cmd = (char *)"out-of-sync"; } } else { if (mdev->rs_failed != n_oos) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( (n_oos - mdev->rs_failed) == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", 834); } } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 272U) { khelper_cmd = (char *)"after-resync-target"; } else if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 336U) { khelper_cmd = (char *)"after-resync-target"; } else { } if ((unsigned long )mdev->csums_tfm != (unsigned long )((struct crypto_hash *)0)) { if (mdev->rs_total != 0UL) { s = mdev->rs_same_csum; t = mdev->rs_total; if (t != 0UL) { if (t <= 99999UL) { tmp___4 = (int )((int const )((s * 100UL) / t)); } else { tmp___4 = (int )((int const )(s / (t / 100UL))); } tmp___5 = tmp___4; } else { tmp___5 = (int )((int const )0); } { ratio = tmp___5; _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "%u %% had equal checksums, eliminated: %luK; transferred %luK total %luK\n", ratio, mdev->rs_same_csum << 2, (mdev->rs_total - mdev->rs_same_csum) << 2, mdev->rs_total << 2); } } else { } } else { } } } else { } if (mdev->rs_failed != 0UL) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), " %lu failed blocks\n", mdev->rs_failed); } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 272U) { ns.ldv_38339.disk = (unsigned char)4; ns.ldv_38339.pdsk = (unsigned char)8; } else if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 336U) { ns.ldv_38339.disk = (unsigned char)4; ns.ldv_38339.pdsk = (unsigned char)8; } else { ns.ldv_38339.disk = (unsigned char)8; ns.ldv_38339.pdsk = (unsigned char)4; } } else { ns.ldv_38339.disk = (unsigned char)8; ns.ldv_38339.pdsk = (unsigned char)8; if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 272U) { goto _L___0; } else if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 336U) { _L___0: if ((unsigned long )mdev->p_uuid != (unsigned long )((u64 *)0)) { i = 1; goto ldv_48888; ldv_48887: { _drbd_uuid_set(mdev, i, *(mdev->p_uuid + (unsigned long )i)); i = i + 1; } ldv_48888: ; if (i <= 3) { goto ldv_48887; } else { goto ldv_48889; } ldv_48889: { drbd_uuid_set(mdev, 1, (mdev->ldev)->md.uuid[0]); _drbd_uuid_set(mdev, 0, *(mdev->p_uuid)); } } else { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "mdev->p_uuid is NULL! BUG\n"); } } } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 288U) { if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 304U) { { drbd_uuid_set_bm(mdev, 0ULL); drbd_print_uuids(mdev, "updated UUIDs"); } if ((unsigned long )mdev->p_uuid != (unsigned long )((u64 *)0)) { i___0 = 0; goto ldv_48892; ldv_48891: *(mdev->p_uuid + (unsigned long )i___0) = (mdev->ldev)->md.uuid[i___0]; i___0 = i___0 + 1; ldv_48892: ; if (i___0 <= 3) { goto ldv_48891; } else { goto ldv_48893; } ldv_48893: ; } else { } } else { } } else { } } { _drbd_set_state(mdev, ns, (enum chg_state_flags )2, (struct completion *)0); } out_unlock: { spin_unlock_irq(& mdev->req_lock); put_ldev(mdev); } out: mdev->rs_total = 0UL; mdev->rs_failed = 0UL; mdev->rs_paused = 0UL; if (verify_done != 0) { mdev->ov_start_sector = 0UL; } else { } { drbd_md_sync(mdev); } if ((unsigned long )khelper_cmd != (unsigned long )((char *)0)) { { drbd_khelper(mdev, khelper_cmd); } } else { } return (1); } } static void move_to_net_ee_or_free(struct drbd_conf *mdev , struct drbd_epoch_entry *e ) { int i ; int tmp ; { { tmp = drbd_ee_has_active_page(e); } if (tmp != 0) { { i = (int )(((unsigned long )e->size + 4095UL) >> 12); atomic_add(i, & mdev->pp_in_use_by_net); atomic_sub(i, & mdev->pp_in_use); spin_lock_irq(& mdev->req_lock); list_add_tail(& e->w.list, & mdev->net_ee); spin_unlock_irq(& mdev->req_lock); __wake_up(& drbd_pp_wait, 3U, 1, (void *)0); } } else { { drbd_free_some_ee(mdev, e, 0); } } return; } } int w_e_end_data_req(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_epoch_entry *e ; struct drbd_work const *__mptr ; int ok ; int tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; long tmp___3 ; int tmp___4 ; int tmp___5 ; long tmp___6 ; { { __mptr = (struct drbd_work const *)w; e = (struct drbd_epoch_entry *)__mptr; tmp___1 = __builtin_expect((long )(cancel != 0), 0L); } if (tmp___1 != 0L) { { drbd_free_some_ee(mdev, e, 0); atomic_dec(& mdev->unacked_cnt); tmp___0 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); } if (tmp___0 < 0) { { tmp = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: unacked_cnt = %d < 0 !\n", "w_e_end_data_req", 943, tmp); } } else { } return (1); } else { } { tmp___3 = __builtin_expect((long )((e->flags & 8UL) == 0UL), 1L); } if (tmp___3 != 0L) { { ok = drbd_send_block(mdev, (enum drbd_packets )1, e); } } else { { tmp___2 = ___ratelimit(& drbd_ratelimit_state, "w_e_end_data_req"); } if (tmp___2 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Sending NegDReply. sector=%llus.\n", (unsigned long long )e->sector); } } else { } { ok = drbd_send_ack(mdev, (enum drbd_packets )26, e); } } { atomic_dec(& mdev->unacked_cnt); tmp___5 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); } if (tmp___5 < 0) { { tmp___4 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: unacked_cnt = %d < 0 !\n", "w_e_end_data_req", 957, tmp___4); } } else { } { move_to_net_ee_or_free(mdev, e); tmp___6 = __builtin_expect((long )(ok == 0), 0L); } if (tmp___6 != 0L) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_send_block() failed\n"); } } else { } return (ok); } } int w_e_end_rsdata_req(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_epoch_entry *e ; struct drbd_work const *__mptr ; int ok ; int tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; int tmp___3 ; long tmp___4 ; int tmp___5 ; long tmp___6 ; int tmp___7 ; int tmp___8 ; long tmp___9 ; { { __mptr = (struct drbd_work const *)w; e = (struct drbd_epoch_entry *)__mptr; tmp___1 = __builtin_expect((long )(cancel != 0), 0L); } if (tmp___1 != 0L) { { drbd_free_some_ee(mdev, e, 0); atomic_dec(& mdev->unacked_cnt); tmp___0 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); } if (tmp___0 < 0) { { tmp = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: unacked_cnt = %d < 0 !\n", "w_e_end_rsdata_req", 979, tmp); } } else { } return (1); } else { } { tmp___2 = _get_ldev_if_state(mdev, (enum drbd_disk_state )2); } if (tmp___2 != 0) { { drbd_rs_complete_io(mdev, e->sector); put_ldev(mdev); } } else { } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 352U) { { ok = drbd_send_ack(mdev, (enum drbd_packets )41, e); } } else { { tmp___6 = __builtin_expect((long )((e->flags & 8UL) == 0UL), 1L); } if (tmp___6 != 0L) { { tmp___4 = __builtin_expect((long )((int )mdev->state.ldv_38339.pdsk > 3), 1L); } if (tmp___4 != 0L) { { inc_rs_pending(mdev); ok = drbd_send_block(mdev, (enum drbd_packets )2, e); } } else { { tmp___3 = ___ratelimit(& drbd_ratelimit_state, "w_e_end_rsdata_req"); } if (tmp___3 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Not sending RSDataReply, partner DISKLESS!\n"); } } else { } ok = 1; } } else { { tmp___5 = ___ratelimit(& drbd_ratelimit_state, "w_e_end_rsdata_req"); } if (tmp___5 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Sending NegRSDReply. sector %llus.\n", (unsigned long long )e->sector); } } else { } { ok = drbd_send_ack(mdev, (enum drbd_packets )27, e); drbd_rs_failed_io(mdev, e->sector, (int )e->size); } } } { atomic_dec(& mdev->unacked_cnt); tmp___8 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); } if (tmp___8 < 0) { { tmp___7 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: unacked_cnt = %d < 0 !\n", "w_e_end_rsdata_req", 1011, tmp___7); } } else { } { move_to_net_ee_or_free(mdev, e); tmp___9 = __builtin_expect((long )(ok == 0), 0L); } if (tmp___9 != 0L) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_send_block() failed\n"); } } else { } return (ok); } } int w_e_end_csum_rs_req(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_epoch_entry *e ; struct drbd_work const *__mptr ; struct digest_info *di ; int digest_size ; void *digest ; int ok ; int eq ; int tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; unsigned int tmp___3 ; int tmp___4 ; int tmp___5 ; long tmp___6 ; int tmp___7 ; int tmp___8 ; long tmp___9 ; { { __mptr = (struct drbd_work const *)w; e = (struct drbd_epoch_entry *)__mptr; digest = (void *)0; eq = 0; tmp___1 = __builtin_expect((long )(cancel != 0), 0L); } if (tmp___1 != 0L) { { drbd_free_some_ee(mdev, e, 0); atomic_dec(& mdev->unacked_cnt); tmp___0 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); } if (tmp___0 < 0) { { tmp = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: unacked_cnt = %d < 0 !\n", "w_e_end_csum_rs_req", 1030, tmp); } } else { } return (1); } else { } { tmp___2 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___2 != 0) { { drbd_rs_complete_io(mdev, e->sector); put_ldev(mdev); } } else { } { di = e->ldv_46600.digest; tmp___6 = __builtin_expect((long )((e->flags & 8UL) == 0UL), 1L); } if (tmp___6 != 0L) { if ((unsigned long )mdev->csums_tfm != (unsigned long )((struct crypto_hash *)0)) { { tmp___3 = crypto_hash_digestsize(mdev->csums_tfm); digest_size = (int )tmp___3; } if (di->digest_size != digest_size) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( digest_size == di->digest_size ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", 1047); } } else { } { digest = kmalloc((size_t )digest_size, 16U); } } else { } if ((unsigned long )digest != (unsigned long )((void *)0)) { { drbd_csum_ee(mdev, mdev->csums_tfm, e, digest); tmp___4 = memcmp((void const *)digest, (void const *)di->digest, (size_t )digest_size); eq = tmp___4 == 0; kfree((void const *)digest); } } else { } if (eq != 0) { { __drbd_set_in_sync(mdev, e->sector, (int )e->size, "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", (unsigned int const )1057U); mdev->rs_same_csum = mdev->rs_same_csum + (unsigned long )(e->size >> 12); ok = drbd_send_ack(mdev, (enum drbd_packets )34, e); } } else { { inc_rs_pending(mdev); e->ldv_46600.block_id = 0x0fffffffffffffffULL; e->flags = e->flags & 0x0fffffffffffffefUL; kfree((void const *)di); ok = drbd_send_block(mdev, (enum drbd_packets )2, e); } } } else { { ok = drbd_send_ack(mdev, (enum drbd_packets )27, e); tmp___5 = ___ratelimit(& drbd_ratelimit_state, "w_e_end_csum_rs_req"); } if (tmp___5 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Sending NegDReply. I guess it gets messy.\n"); } } else { } } { atomic_dec(& mdev->unacked_cnt); tmp___8 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); } if (tmp___8 < 0) { { tmp___7 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: unacked_cnt = %d < 0 !\n", "w_e_end_csum_rs_req", 1074, tmp___7); } } else { } { move_to_net_ee_or_free(mdev, e); tmp___9 = __builtin_expect((long )(ok == 0), 0L); } if (tmp___9 != 0L) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_send_block/ack() failed\n"); } } else { } return (ok); } } int w_e_end_ov_req(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_epoch_entry *e ; struct drbd_work const *__mptr ; sector_t sector ; unsigned int size ; int digest_size ; void *digest ; int ok ; long tmp ; unsigned int tmp___0 ; long tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { { __mptr = (struct drbd_work const *)w; e = (struct drbd_epoch_entry *)__mptr; sector = e->sector; size = e->size; ok = 1; tmp = __builtin_expect((long )(cancel != 0), 0L); } if (tmp != 0L) { goto out; } else { } { tmp___0 = crypto_hash_digestsize(mdev->verify_tfm); digest_size = (int )tmp___0; digest = kmalloc((size_t )digest_size, 16U); } if ((unsigned long )digest == (unsigned long )((void *)0)) { ok = 0; goto out; } else { } { tmp___1 = __builtin_expect((long )((e->flags & 8UL) == 0UL), 1L); } if (tmp___1 != 0L) { { drbd_csum_ee(mdev, mdev->verify_tfm, e, digest); } } else { { memset(digest, 0, (size_t )digest_size); } } { drbd_free_some_ee(mdev, e, 0); e = (struct drbd_epoch_entry *)0; inc_rs_pending(mdev); ok = drbd_send_drequest_csum(mdev, sector, (int )size, digest, digest_size, (enum drbd_packets )31); } if (ok == 0) { { atomic_dec(& mdev->rs_pending_cnt); tmp___3 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); } if (tmp___3 < 0) { { tmp___2 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "w_e_end_ov_req", 1119, tmp___2); } } else { } } else { } { kfree((void const *)digest); } out: ; if ((unsigned long )e != (unsigned long )((struct drbd_epoch_entry *)0)) { { drbd_free_some_ee(mdev, e, 0); } } else { } { atomic_dec(& mdev->unacked_cnt); tmp___5 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); } if (tmp___5 < 0) { { tmp___4 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: unacked_cnt = %d < 0 !\n", "w_e_end_ov_req", 1125, tmp___4); } } else { } return (ok); } } void drbd_ov_oos_found(struct drbd_conf *mdev , sector_t sector , int size ) { { if (mdev->ov_last_oos_start + mdev->ov_last_oos_size == sector) { mdev->ov_last_oos_size = mdev->ov_last_oos_size + (sector_t )(size >> 9); } else { mdev->ov_last_oos_start = sector; mdev->ov_last_oos_size = (sector_t )(size >> 9); } { __drbd_set_out_of_sync(mdev, sector, size, "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", (unsigned int const )1137U); } return; } } int w_e_end_ov_reply(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_epoch_entry *e ; struct drbd_work const *__mptr ; struct digest_info *di ; void *digest ; sector_t sector ; unsigned int size ; int digest_size ; int ok ; int eq ; int tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; unsigned int tmp___3 ; int tmp___4 ; long tmp___5 ; unsigned long long tmp___6 ; int tmp___7 ; int tmp___8 ; { { __mptr = (struct drbd_work const *)w; e = (struct drbd_epoch_entry *)__mptr; sector = e->sector; size = e->size; eq = 0; tmp___1 = __builtin_expect((long )(cancel != 0), 0L); } if (tmp___1 != 0L) { { drbd_free_some_ee(mdev, e, 0); atomic_dec(& mdev->unacked_cnt); tmp___0 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); } if (tmp___0 < 0) { { tmp = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: unacked_cnt = %d < 0 !\n", "w_e_end_ov_reply", 1152, tmp); } } else { } return (1); } else { } { tmp___2 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___2 != 0) { { drbd_rs_complete_io(mdev, e->sector); put_ldev(mdev); } } else { } { di = e->ldv_46600.digest; tmp___5 = __builtin_expect((long )((e->flags & 8UL) == 0UL), 1L); } if (tmp___5 != 0L) { { tmp___3 = crypto_hash_digestsize(mdev->verify_tfm); digest_size = (int )tmp___3; digest = kmalloc((size_t )digest_size, 16U); } if ((unsigned long )digest != (unsigned long )((void *)0)) { { drbd_csum_ee(mdev, mdev->verify_tfm, e, digest); } if (di->digest_size != digest_size) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( digest_size == di->digest_size ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", 1171); } } else { } { tmp___4 = memcmp((void const *)digest, (void const *)di->digest, (size_t )digest_size); eq = tmp___4 == 0; kfree((void const *)digest); } } else { } } else { } { drbd_free_some_ee(mdev, e, 0); } if (eq == 0) { { drbd_ov_oos_found(mdev, sector, (int )size); } } else { { ov_oos_print(mdev); } } if (eq != 0) { tmp___6 = 4711ULL; } else { tmp___6 = 4712ULL; } { ok = drbd_send_ack_ex(mdev, (enum drbd_packets )32, sector, (int )size, tmp___6); atomic_dec(& mdev->unacked_cnt); tmp___8 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); } if (tmp___8 < 0) { { tmp___7 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: unacked_cnt = %d < 0 !\n", "w_e_end_ov_reply", 1191, tmp___7); } } else { } mdev->ov_left = mdev->ov_left - 1UL; if ((mdev->ov_left & 512UL) != 0UL) { { drbd_advance_rs_marks(mdev, mdev->ov_left); } } else { } if (mdev->ov_left == 0UL) { { ov_oos_print(mdev); drbd_resync_finished(mdev); } } else { } return (ok); } } int w_prev_work_done(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_wq_barrier *b ; struct drbd_work const *__mptr ; { { __mptr = (struct drbd_work const *)w; b = (struct drbd_wq_barrier *)__mptr; complete(& b->done); } return (1); } } int w_send_barrier(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_tl_epoch *b ; struct drbd_work const *__mptr ; struct p_barrier *p ; int ok ; int tmp ; { { __mptr = (struct drbd_work const *)w; b = (struct drbd_tl_epoch *)__mptr; p = & mdev->data.sbuf.barrier; ok = 1; spin_lock_irq(& mdev->req_lock); } if ((unsigned long )w->cb != (unsigned long )(& w_send_barrier)) { cancel = 1; } else if ((int )mdev->state.ldv_38339.conn <= 9) { cancel = 1; } else { } { spin_unlock_irq(& mdev->req_lock); } if (cancel != 0) { return (1); } else { } { tmp = drbd_get_data_sock(mdev); } if (tmp == 0) { return (0); } else { } { p->barrier = b->br_number; ok = _drbd_send_cmd(mdev, mdev->data.socket, (enum drbd_packets )3, (struct p_header80 *)p, 16UL, 0U); drbd_put_data_sock(mdev); } return (ok); } } int w_send_write_hint(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { int tmp ; { if (cancel != 0) { return (1); } else { } { tmp = drbd_send_short_cmd(mdev, (enum drbd_packets )7); } return (tmp); } } int w_send_oos(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_request *req ; struct drbd_work const *__mptr ; int ok ; long tmp ; { { __mptr = (struct drbd_work const *)w; req = (struct drbd_request *)__mptr; tmp = __builtin_expect((long )(cancel != 0), 0L); } if (tmp != 0L) { { req_mod(req, (enum drbd_req_event )6); } return (1); } else { } { ok = drbd_send_oos(mdev, req); req_mod(req, (enum drbd_req_event )9); } return (ok); } } int w_send_dblock(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_request *req ; struct drbd_work const *__mptr ; int ok ; long tmp ; int tmp___0 ; { { __mptr = (struct drbd_work const *)w; req = (struct drbd_request *)__mptr; tmp = __builtin_expect((long )(cancel != 0), 0L); } if (tmp != 0L) { { req_mod(req, (enum drbd_req_event )6); } return (1); } else { } { ok = drbd_send_dblock(mdev, req); } if (ok != 0) { tmp___0 = 8; } else { tmp___0 = 7; } { req_mod(req, (enum drbd_req_event )tmp___0); } return (ok); } } int w_send_read_req(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_request *req ; struct drbd_work const *__mptr ; int ok ; long tmp ; union drbd_state val ; union drbd_state mask ; int tmp___0 ; { { __mptr = (struct drbd_work const *)w; req = (struct drbd_request *)__mptr; tmp = __builtin_expect((long )(cancel != 0), 0L); } if (tmp != 0L) { { req_mod(req, (enum drbd_req_event )6); } return (1); } else { } { ok = drbd_send_drequest(mdev, 8, req->sector, (int )req->size, (u64 )req); } if (ok == 0) { if ((int )mdev->state.ldv_38339.conn > 9) { { val.i = 0U; val.ldv_38339.conn = (unsigned char)5; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } } else { } } else { } if (ok != 0) { tmp___0 = 8; } else { tmp___0 = 7; } { req_mod(req, (enum drbd_req_event )tmp___0); } return (ok); } } int w_restart_disk_io(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_request *req ; struct drbd_work const *__mptr ; { __mptr = (struct drbd_work const *)w; req = (struct drbd_request *)__mptr; if ((int )(req->master_bio)->bi_rw & 1) { if ((req->rq_state & 2048UL) != 0UL) { { drbd_al_begin_io(mdev, req->sector); } } else { } } else { } { drbd_req_make_private_bio(req, req->master_bio); (req->private_bio)->bi_bdev = (mdev->ldev)->backing_bdev; generic_make_request(req->private_bio); } return (1); } } static int _drbd_may_sync_now(struct drbd_conf *mdev ) { struct drbd_conf *odev ; int _b ; { odev = mdev; ldv_49068: ; if (odev->sync_conf.after == -1) { return (1); } else { } { odev = minor_to_mdev((unsigned int )odev->sync_conf.after); _b = (unsigned long )odev == (unsigned long )((struct drbd_conf *)0); } if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "_drbd_may_sync_now", (char *)"!odev", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", 1346); } } else { } if (_b != 0) { return (1); } else { } if ((int )odev->state.ldv_38339.conn > 15) { if ((int )odev->state.ldv_38339.conn <= 21) { return (0); } else { goto _L; } } else _L: if ((unsigned int )*((unsigned char *)odev + 2278UL) != 0U) { return (0); } else if ((unsigned int )*((unsigned char *)odev + 2278UL) != 0U) { return (0); } else if ((unsigned int )*((unsigned char *)odev + 2278UL) != 0U) { return (0); } else { } goto ldv_49068; } } static int _drbd_pause_after(struct drbd_conf *mdev ) { struct drbd_conf *odev ; int i ; int rv ; union drbd_state __ns ; enum drbd_state_rv tmp ; int tmp___0 ; { rv = 0; i = 0; goto ldv_49079; ldv_49078: { odev = minor_to_mdev((unsigned int )i); } if ((unsigned long )odev == (unsigned long )((struct drbd_conf *)0)) { goto ldv_49075; } else { } if ((unsigned int )*((unsigned short *)odev + 1138UL) == 0U) { if ((unsigned int )*((unsigned char *)odev + 2277UL) == 0U) { goto ldv_49075; } else { } } else { } { tmp___0 = _drbd_may_sync_now(odev); } if (tmp___0 == 0) { { __ns.i = odev->state.i; __ns.ldv_38339.aftr_isp = (unsigned char)1; tmp = __drbd_set_state(odev, __ns, (enum chg_state_flags )1, (struct completion *)0); rv = ((int )tmp != 2) | rv; } } else { } ldv_49075: i = i + 1; ldv_49079: ; if ((unsigned int )i < minor_count) { goto ldv_49078; } else { goto ldv_49080; } ldv_49080: ; return (rv); } } static int _drbd_resume_next(struct drbd_conf *mdev ) { struct drbd_conf *odev ; int i ; int rv ; union drbd_state __ns ; enum drbd_state_rv tmp ; int tmp___0 ; { rv = 0; i = 0; goto ldv_49091; ldv_49090: { odev = minor_to_mdev((unsigned int )i); } if ((unsigned long )odev == (unsigned long )((struct drbd_conf *)0)) { goto ldv_49087; } else { } if ((unsigned int )*((unsigned short *)odev + 1138UL) == 0U) { if ((unsigned int )*((unsigned char *)odev + 2277UL) == 0U) { goto ldv_49087; } else { } } else { } if ((unsigned int )*((unsigned char *)odev + 2278UL) != 0U) { { tmp___0 = _drbd_may_sync_now(odev); } if (tmp___0 != 0) { { __ns.i = odev->state.i; __ns.ldv_38339.aftr_isp = (unsigned char)0; tmp = __drbd_set_state(odev, __ns, (enum chg_state_flags )1, (struct completion *)0); rv = ((int )tmp != 2) | rv; } } else { } } else { } ldv_49087: i = i + 1; ldv_49091: ; if ((unsigned int )i < minor_count) { goto ldv_49090; } else { goto ldv_49092; } ldv_49092: ; return (rv); } } void resume_next_sg(struct drbd_conf *mdev ) { { { _raw_write_lock_irq(& global_state_lock); _drbd_resume_next(mdev); _raw_write_unlock_irq(& global_state_lock); } return; } } void suspend_other_sg(struct drbd_conf *mdev ) { { { _raw_write_lock_irq(& global_state_lock); _drbd_pause_after(mdev); _raw_write_unlock_irq(& global_state_lock); } return; } } static int sync_after_error(struct drbd_conf *mdev , int o_minor ) { struct drbd_conf *odev ; struct drbd_conf *tmp ; { if (o_minor == -1) { return (101); } else { } if (o_minor < -1) { return (132); } else { { tmp = minor_to_mdev((unsigned int )o_minor); } if ((unsigned long )tmp == (unsigned long )((struct drbd_conf *)0)) { return (132); } else { } } { odev = minor_to_mdev((unsigned int )o_minor); } ldv_49104: ; if ((unsigned long )odev == (unsigned long )mdev) { return (133); } else { } if (odev->sync_conf.after == -1) { return (101); } else { } { odev = minor_to_mdev((unsigned int )odev->sync_conf.after); } goto ldv_49104; } } int drbd_alter_sa(struct drbd_conf *mdev , int na ) { int changes ; int retcode ; int tmp ; { { _raw_write_lock_irq(& global_state_lock); retcode = sync_after_error(mdev, na); } if (retcode == 101) { mdev->sync_conf.after = na; ldv_49111: { changes = _drbd_pause_after(mdev); tmp = _drbd_resume_next(mdev); changes = tmp | changes; } if (changes != 0) { goto ldv_49111; } else { goto ldv_49112; } ldv_49112: ; } else { } { _raw_write_unlock_irq(& global_state_lock); } return (retcode); } } void drbd_rs_controller_reset(struct drbd_conf *mdev ) { { { atomic_set(& mdev->rs_sect_in, 0); atomic_set(& mdev->rs_sect_ev, 0); mdev->rs_in_flight = 0; mdev->rs_planed = 0; spin_lock(& mdev->peer_seq_lock); fifo_set(& mdev->rs_plan_s, 0); spin_unlock(& mdev->peer_seq_lock); } return; } } void drbd_start_resync(struct drbd_conf *mdev , enum drbd_conns side ) { union drbd_state ns ; int r ; union drbd_state val ; union drbd_state mask ; union drbd_state val___0 ; union drbd_state mask___0 ; int tmp ; int tmp___0 ; enum drbd_state_rv tmp___1 ; unsigned long tw ; unsigned long tmp___2 ; unsigned long now ; int i ; char const *tmp___3 ; { if ((int )mdev->state.ldv_38339.conn > 15) { if ((int )mdev->state.ldv_38339.conn <= 21) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Resync already running!\n"); } return; } else { } } else { } if ((int )mdev->state.ldv_38339.conn <= 21) { { drbd_rs_cancel_all(mdev); } } else { } if ((unsigned int )side == 17U) { { r = drbd_khelper(mdev, (char *)"before-resync-target"); r = (r >> 8) & 255; } if (r > 0) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "before-resync-target handler returned %d, dropping connection.\n", r); val.i = 0U; val.ldv_38339.conn = (unsigned char)1; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } return; } else { } } else { { r = drbd_khelper(mdev, (char *)"before-resync-source"); r = (r >> 8) & 255; } if (r > 0) { if (r == 3) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "before-resync-source handler returned %d, ignoring. Old userland tools?", r); } } else { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "before-resync-source handler returned %d, dropping connection.\n", r); val___0.i = 0U; val___0.ldv_38339.conn = (unsigned char)1; mask___0.i = 0U; mask___0.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask___0, val___0); } return; } } else { } } { drbd_state_lock(mdev); tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )3); } if (tmp == 0) { { drbd_state_unlock(mdev); } return; } else { } { _raw_write_lock_irq(& global_state_lock); ns = mdev->state; tmp___0 = _drbd_may_sync_now(mdev); ns.ldv_38339.aftr_isp = (unsigned char )(tmp___0 == 0); ns.ldv_38339.conn = (unsigned char )side; } if ((unsigned int )side == 17U) { ns.ldv_38339.disk = (unsigned char)4; } else { ns.ldv_38339.pdsk = (unsigned char)4; } { tmp___1 = __drbd_set_state(mdev, ns, (enum chg_state_flags )2, (struct completion *)0); r = (int )tmp___1; ns = mdev->state; } if ((int )ns.ldv_38339.conn <= 9) { r = 0; } else { } if (r == 1) { { tmp___2 = drbd_bm_total_weight(mdev); tw = tmp___2; now = (unsigned long )jiffies; mdev->rs_failed = 0UL; mdev->rs_paused = 0UL; mdev->rs_same_csum = 0UL; mdev->rs_last_events = 0; mdev->rs_last_sect_ev = 0; mdev->rs_total = tw; mdev->rs_start = now; i = 0; } goto ldv_49134; ldv_49133: mdev->rs_mark_left[i] = tw; mdev->rs_mark_time[i] = now; i = i + 1; ldv_49134: ; if (i <= 7) { goto ldv_49133; } else { goto ldv_49135; } ldv_49135: { _drbd_pause_after(mdev); } } else { } { _raw_write_unlock_irq(& global_state_lock); } if (r == 1) { { tmp___3 = drbd_conn_str((enum drbd_conns )ns.ldv_38339.conn); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Began resync as %s (will sync %lu KB [%lu bits set]).\n", tmp___3, mdev->rs_total << 2, mdev->rs_total); } if ((unsigned int )side == 17U) { mdev->bm_resync_fo = 0UL; } else { } if ((unsigned int )side == 16U) { if (mdev->agreed_pro_version <= 95) { { drbd_gen_and_send_sync_uuid(mdev); } } else { } } else { } if (mdev->agreed_pro_version <= 94) { if (mdev->rs_total == 0UL) { if ((unsigned int )side == 16U) { { schedule_timeout_interruptible((long )((mdev->net_conf)->ping_int * 250 + ((mdev->net_conf)->ping_timeo * 250) / 9)); } } else { } { drbd_resync_finished(mdev); } } else { } } else { } { drbd_rs_controller_reset(mdev); } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 272U) { { mod_timer(& mdev->resync_timer, (unsigned long )jiffies); } } else { } { drbd_md_sync(mdev); } } else { } { put_ldev(mdev); drbd_state_unlock(mdev); } return; } } int drbd_worker(struct drbd_thread *thi ) { struct drbd_conf *mdev ; struct drbd_work *w ; struct list_head work_list ; int intr ; int i ; unsigned int tmp ; struct task_struct *tmp___0 ; int tmp___1 ; struct task_struct *tmp___2 ; int _b ; enum drbd_thread_state tmp___3 ; enum drbd_thread_state tmp___4 ; int _b___0 ; int tmp___5 ; struct list_head const *__mptr ; union drbd_state val ; union drbd_state mask ; int tmp___6 ; enum drbd_thread_state tmp___7 ; int tmp___8 ; int tmp___9 ; struct list_head const *__mptr___0 ; int tmp___10 ; int tmp___11 ; { { mdev = thi->mdev; w = (struct drbd_work *)0; work_list.next = & work_list; work_list.prev = & work_list; intr = 0; tmp = mdev_to_minor(mdev); tmp___0 = get_current(); sprintf((char *)(& tmp___0->comm), "drbd%d_worker", tmp); } goto ldv_49147; ldv_49157: { drbd_thread_current_set_cpu(mdev); tmp___1 = down_trylock(& mdev->data.work.s); } if (tmp___1 != 0) { { mutex_lock_nested(& mdev->data.mutex, 0U); } if ((unsigned long )mdev->data.socket != (unsigned long )((struct socket *)0)) { if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) == 0U) { { drbd_tcp_uncork(mdev->data.socket); } } else { } } else { } { mutex_unlock(& mdev->data.mutex); intr = down_interruptible(& mdev->data.work.s); mutex_lock_nested(& mdev->data.mutex, 0U); } if ((unsigned long )mdev->data.socket != (unsigned long )((struct socket *)0)) { if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) == 0U) { { drbd_tcp_cork(mdev->data.socket); } } else { } } else { } { mutex_unlock(& mdev->data.mutex); } } else { } if (intr != 0) { if (intr != -4) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( intr == -EINTR ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", 1650); } } else { } { tmp___2 = get_current(); flush_signals(tmp___2); tmp___3 = get_t_state(thi); _b = (unsigned int )tmp___3 == 1U; } if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_worker", (char *)"get_t_state(thi) == Running", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", 1652); } } else { } if (_b != 0) { goto ldv_49147; } else { } goto ldv_49148; } else { } { tmp___4 = get_t_state(thi); } if ((unsigned int )tmp___4 != 1U) { goto ldv_49148; } else { } { w = (struct drbd_work *)0; spin_lock_irq(& mdev->data.work.q_lock); tmp___5 = list_empty((struct list_head const *)(& mdev->data.work.q)); _b___0 = tmp___5 != 0; } if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_worker", (char *)"list_empty(&mdev->data.work.q)", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", 1665); } } else { } if (_b___0 != 0) { { spin_unlock_irq(& mdev->data.work.q_lock); } goto ldv_49147; } else { } { __mptr = (struct list_head const *)mdev->data.work.q.next; w = (struct drbd_work *)__mptr; list_del_init(& w->list); spin_unlock_irq(& mdev->data.work.q_lock); tmp___6 = (*(w->cb))(mdev, w, (int )mdev->state.ldv_38339.conn <= 9); } if (tmp___6 == 0) { if ((int )mdev->state.ldv_38339.conn > 9) { { val.i = 0U; val.ldv_38339.conn = (unsigned char)5; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } } else { } } else { } ldv_49147: { tmp___7 = get_t_state(thi); } if ((unsigned int )tmp___7 == 1U) { goto ldv_49157; } else { goto ldv_49148; } ldv_49148: { tmp___8 = constant_test_bit(23U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___8 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( test_bit(DEVICE_DYING, &mdev->flags) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", 1691); } } else { } { tmp___9 = constant_test_bit(22U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___9 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( test_bit(CONFIG_PENDING, &mdev->flags) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", 1692); } } else { } { spin_lock_irq(& mdev->data.work.q_lock); i = 0; } goto ldv_49164; ldv_49163: { list_splice_init(& mdev->data.work.q, & work_list); spin_unlock_irq(& mdev->data.work.q_lock); } goto ldv_49161; ldv_49160: { __mptr___0 = (struct list_head const *)work_list.next; w = (struct drbd_work *)__mptr___0; list_del_init(& w->list); (*(w->cb))(mdev, w, 1); i = i + 1; } ldv_49161: { tmp___10 = list_empty((struct list_head const *)(& work_list)); } if (tmp___10 == 0) { goto ldv_49160; } else { goto ldv_49162; } ldv_49162: { spin_lock_irq(& mdev->data.work.q_lock); } ldv_49164: { tmp___11 = list_empty((struct list_head const *)(& mdev->data.work.q)); } if (tmp___11 == 0) { goto ldv_49163; } else { goto ldv_49165; } ldv_49165: { sema_init(& mdev->data.work.s, 0); spin_unlock_irq(& mdev->data.work.q_lock); } if ((unsigned int )*((unsigned char *)mdev + 2277UL) != 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.disk == D_DISKLESS && mdev->state.conn == C_STANDALONE ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", 1717); } } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) != 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.disk == D_DISKLESS && mdev->state.conn == C_STANDALONE ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_worker.c.p", 1717); } } else { } { drbd_thread_stop(& mdev->receiver); drbd_mdev_cleanup(mdev); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "worker terminated\n"); clear_bit(23, (unsigned long volatile *)(& mdev->flags)); clear_bit(22, (unsigned long volatile *)(& mdev->flags)); __wake_up(& mdev->state_wait, 3U, 1, (void *)0); } return (0); } } __inline static void list_move(struct list_head *list , struct list_head *head ) { { { __list_del_entry(list); list_add(list, head); } return; } } __inline static void INIT_HLIST_NODE(struct hlist_node *h ) { { h->next = (struct hlist_node *)0; h->pprev = (struct hlist_node **)0; return; } } __inline static int hlist_unhashed(struct hlist_node const *h ) { { return ((unsigned long )h->pprev == (unsigned long )((struct hlist_node ** const )0)); } } __inline static void __hlist_del(struct hlist_node *n ) { struct hlist_node *next ; struct hlist_node **pprev ; { next = n->next; pprev = n->pprev; *pprev = next; if ((unsigned long )next != (unsigned long )((struct hlist_node *)0)) { next->pprev = pprev; } else { } return; } } __inline static void hlist_del_init(struct hlist_node *n ) { int tmp ; { { tmp = hlist_unhashed((struct hlist_node const *)n); } if (tmp == 0) { { __hlist_del(n); INIT_HLIST_NODE(n); } } else { } return; } } __inline static void hlist_add_head(struct hlist_node *n , struct hlist_head *h ) { struct hlist_node *first ; { first = h->first; n->next = first; if ((unsigned long )first != (unsigned long )((struct hlist_node *)0)) { first->pprev = & n->next; } else { } h->first = n; n->pprev = & h->first; return; } } __inline static int test_and_clear_bit(int nr , unsigned long volatile *addr ) { int oldbit ; { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; btr %2,%1\n\tsbb %0,%0": "=r" (oldbit), "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return (oldbit); } } __inline static __u32 __arch_swab32(__u32 val ) { { __asm__ ("bswapl %0": "=r" (val): "0" (val)); return (val); } } __inline static __u64 __arch_swab64(__u64 val ) { { __asm__ ("bswapq %0": "=r" (val): "0" (val)); return (val); } } __inline static __u16 __fswab16(__u16 val ) { { return ((__u16 )((int )((short )((int )val << 8)) | (int )((short )((int )val >> 8)))); } } __inline static __u32 __fswab32(__u32 val ) { __u32 tmp ; { { tmp = __arch_swab32(val); } return (tmp); } } __inline static __u64 __fswab64(__u64 val ) { __u64 tmp ; { { tmp = __arch_swab64(val); } return (tmp); } } extern void dump_stack(void) ; extern unsigned long __phys_addr(unsigned long ) ; extern unsigned long __per_cpu_offset[4096U] ; extern size_t strlen(char const * ) ; extern char *strcpy(char * , char const * ) ; extern int strcmp(char const * , char const * ) ; extern int nr_cpu_ids ; extern struct cpumask const * const cpu_possible_mask ; __inline static unsigned int cpumask_check(unsigned int cpu ) { bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; { { __ret_warn_once = (unsigned int )nr_cpu_ids <= cpu; tmp___1 = __builtin_expect((long )(__ret_warn_once != 0), 0L); } if (tmp___1 != 0L) { { __ret_warn_on = ! __warned; tmp = __builtin_expect((long )(__ret_warn_on != 0), 0L); } if (tmp != 0L) { { warn_slowpath_null("include/linux/cpumask.h", (int const )107); } } else { } { tmp___0 = __builtin_expect((long )(__ret_warn_on != 0), 0L); } if (tmp___0 != 0L) { __warned = (bool )1; } else { } } else { } { __builtin_expect((long )(__ret_warn_once != 0), 0L); } return (cpu); } } __inline static unsigned int cpumask_next(int n , struct cpumask const *srcp ) { unsigned long tmp ; { if (n != -1) { { cpumask_check((unsigned int )n); } } else { } { tmp = find_next_bit((unsigned long const *)(& srcp->bits), (unsigned long )nr_cpu_ids, (unsigned long )(n + 1)); } return ((unsigned int )tmp); } } __inline static long PTR_ERR(void const *ptr ) { { return ((long )ptr); } } __inline static long IS_ERR(void const *ptr ) { long tmp ; { { tmp = __builtin_expect((long )((unsigned long )ptr > 0x0ffffffffffff000UL), 0L); } return (tmp); } } __inline static int test_ti_thread_flag(struct thread_info *ti , int flag ) { int tmp ; { { tmp = variable_test_bit(flag, (unsigned long const volatile *)(& ti->flags)); } return (tmp); } } extern int mutex_lock_interruptible_nested(struct mutex * , unsigned int ) ; extern int del_timer(struct timer_list * ) ; extern int del_timer_sync(struct timer_list * ) ; extern unsigned long __get_free_pages(gfp_t , unsigned int ) ; extern void free_pages(unsigned long , unsigned int ) ; extern void get_random_bytes(void * , int ) ; extern u32 random32(void) ; extern int sock_create_kern(int , int , int , struct socket ** ) ; extern int sock_create_lite(int , int , int , struct socket ** ) ; extern void sock_release(struct socket * ) ; extern int sock_recvmsg(struct socket * , struct msghdr * , size_t , int ) ; __inline static void sg_assign_page___0(struct scatterlist *sg , struct page *page ) { unsigned long page_link ; long tmp ; long tmp___0 ; long tmp___1 ; { { page_link = sg->page_link & 3UL; tmp = __builtin_expect((long )(((unsigned long )page & 3UL) != 0UL), 0L); } if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/scatterlist.h"), "i" (63), "i" (12UL)); ldv_18246: ; goto ldv_18246; } else { } { tmp___0 = __builtin_expect((long )(sg->sg_magic != 2271560481UL), 0L); } if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/scatterlist.h"), "i" (65), "i" (12UL)); ldv_18247: ; goto ldv_18247; } else { } { tmp___1 = __builtin_expect((long )((int )sg->page_link) & 1L, 0L); } if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/scatterlist.h"), "i" (66), "i" (12UL)); ldv_18248: ; goto ldv_18248; } else { } sg->page_link = page_link | (unsigned long )page; return; } } __inline static void sg_set_page___0(struct scatterlist *sg , struct page *page , unsigned int len , unsigned int offset ) { { { sg_assign_page___0(sg, page); sg->offset = offset; sg->length = len; } return; } } __inline static void sg_set_buf(struct scatterlist *sg , void const *buf , unsigned int buflen ) { unsigned long tmp ; { { tmp = __phys_addr((unsigned long )buf); sg_set_page___0(sg, (struct page *)(0x0fffea0000000000UL + (tmp >> 12)), buflen, (unsigned int )((long )buf) & 4095U); } return; } } extern void io_schedule(void) ; extern long schedule_timeout(long ) ; extern long schedule_timeout_uninterruptible(long ) ; __inline static int test_tsk_thread_flag(struct task_struct *tsk , int flag ) { int tmp ; { { tmp = test_ti_thread_flag((struct thread_info *)tsk->stack, flag); } return (tmp); } } __inline static int signal_pending(struct task_struct *p ) { int tmp ; long tmp___0 ; { { tmp = test_tsk_thread_flag(p, 2); tmp___0 = __builtin_expect((long )(tmp != 0), 0L); } return ((int )tmp___0); } } char const *drbd_set_st_err_str(enum drbd_state_rv err ) ; extern struct crypto_tfm *crypto_alloc_base(char const * , u32 , u32 ) ; __inline static void crypto_free_tfm(struct crypto_tfm *tfm ) { { return; } } __inline static u32 crypto_tfm_alg_type(struct crypto_tfm *tfm ) { { return ((tfm->__crt_alg)->cra_flags & 15U); } } __inline static struct crypto_hash *__crypto_hash_cast(struct crypto_tfm *tfm ) { { return ((struct crypto_hash *)tfm); } } __inline static struct crypto_hash *crypto_alloc_hash(char const *alg_name , u32 type , u32 mask ) { struct crypto_tfm *tmp ; struct crypto_hash *tmp___0 ; { { type = type & 4294967280U; mask = mask & 4294967280U; type = type | 8U; mask = mask | 14U; tmp = crypto_alloc_base(alg_name, type, mask); tmp___0 = __crypto_hash_cast(tmp); } return (tmp___0); } } __inline static void crypto_free_hash(struct crypto_hash *tfm ) { struct crypto_tfm *tmp ; { { tmp = crypto_hash_tfm(tfm); crypto_free_tfm(tmp); } return; } } __inline static int crypto_hash_digest(struct hash_desc *desc , struct scatterlist *sg , unsigned int nbytes , u8 *out ) { struct hash_tfm *tmp ; int tmp___0 ; { { tmp = crypto_hash_crt(desc->tfm); tmp___0 = (*(tmp->digest))(desc, sg, nbytes, out); } return (tmp___0); } } __inline static int crypto_hash_setkey(struct crypto_hash *hash , u8 const *key , unsigned int keylen ) { struct hash_tfm *tmp ; int tmp___0 ; { { tmp = crypto_hash_crt(hash); tmp___0 = (*(tmp->setkey))(hash, key, keylen); } return (tmp___0); } } __inline static void set_capacity(struct gendisk *disk , sector_t size ) { { disk->part0.nr_sects = size; return; } } __inline static void *kmap(struct page *page ) { void *tmp ; { { __might_sleep("include/linux/highmem.h", 50, 0); tmp = lowmem_page_address(page); } return (tmp); } } __inline static void kunmap(struct page *page ) { { return; } } extern void *mempool_alloc(mempool_t * , gfp_t ) ; extern void mempool_free(void * , mempool_t * ) ; extern struct lc_element *lc_find(struct lru_cache * , unsigned int ) ; __inline static char const *cmdname(enum drbd_packets cmd ) { char const *cmdnames[43U] ; { cmdnames[0] = "Data"; cmdnames[1] = "DataReply"; cmdnames[2] = "RSDataReply"; cmdnames[3] = "Barrier"; cmdnames[4] = "ReportBitMap"; cmdnames[5] = "BecomeSyncTarget"; cmdnames[6] = "BecomeSyncSource"; cmdnames[7] = "UnplugRemote"; cmdnames[8] = "DataRequest"; cmdnames[9] = "RSDataRequest"; cmdnames[10] = "SyncParam"; cmdnames[11] = "ReportProtocol"; cmdnames[12] = "ReportUUIDs"; cmdnames[13] = "ReportSizes"; cmdnames[14] = "ReportState"; cmdnames[15] = "ReportSyncUUID"; cmdnames[16] = "AuthChallenge"; cmdnames[17] = "AuthResponse"; cmdnames[18] = "StateChgRequest"; cmdnames[19] = "Ping"; cmdnames[20] = "PingAck"; cmdnames[21] = "RecvAck"; cmdnames[22] = "WriteAck"; cmdnames[23] = "RSWriteAck"; cmdnames[24] = "DiscardAck"; cmdnames[25] = "NegAck"; cmdnames[26] = "NegDReply"; cmdnames[27] = "NegRSDReply"; cmdnames[28] = "BarrierAck"; cmdnames[29] = "StateChgReply"; cmdnames[30] = "OVRequest"; cmdnames[31] = "OVReply"; cmdnames[32] = "OVResult"; cmdnames[33] = "CsumRSRequest"; cmdnames[34] = "CsumRSIsInSync"; cmdnames[35] = "SyncParam89"; cmdnames[36] = "CBitmap"; cmdnames[37] = (char const *)0; cmdnames[38] = (char const *)0; cmdnames[39] = "DelayProbe"; cmdnames[40] = "OutOfSync"; cmdnames[41] = (char const *)0; cmdnames[42] = (char const *)0; if ((unsigned int )cmd == 65521U) { return ("HandShakeM"); } else { } if ((unsigned int )cmd == 65522U) { return ("HandShakeS"); } else { } if ((unsigned int )cmd == 65534U) { return ("HandShake"); } else { } if ((unsigned int )cmd > 41U) { return ("Unknown"); } else { } return (cmdnames[(unsigned int )cmd]); } } void INFO_bm_xfer_stats(struct drbd_conf *mdev , char const *direction , struct bm_xfer_ctx *c ) ; __inline static void bm_xfer_ctx_bit_to_word_offset(struct bm_xfer_ctx *c ) { { c->word_offset = c->bit_offset >> 6; return; } } __inline static enum drbd_bitmap_code DCBP_get_code(struct p_compressed_bm *p ) { { return ((enum drbd_bitmap_code )((int )p->encoding & 15)); } } __inline static int DCBP_get_start(struct p_compressed_bm *p ) { { return ((int )((signed char )p->encoding) < 0); } } __inline static int DCBP_get_pad_bits(struct p_compressed_bm *p ) { { return (((int )p->encoding >> 4) & 7); } } enum drbd_state_rv drbd_change_state(struct drbd_conf *mdev , enum chg_state_flags f , union drbd_state mask , union drbd_state val ) ; enum drbd_state_rv _drbd_request_state(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val , enum chg_state_flags f ) ; int drbd_thread_start(struct drbd_thread *thi ) ; void tl_release(struct drbd_conf *mdev , unsigned int barrier_nr , unsigned int set_size ) ; void tl_clear(struct drbd_conf *mdev ) ; void drbd_free_sock(struct drbd_conf *mdev ) ; int drbd_send_protocol(struct drbd_conf *mdev ) ; int drbd_send_uuids(struct drbd_conf *mdev ) ; int drbd_send_sizes(struct drbd_conf *mdev , int trigger_reply , enum dds_flags flags ) ; int drbd_send_state(struct drbd_conf *mdev ) ; int drbd_send_cmd2(struct drbd_conf *mdev , enum drbd_packets cmd , char *data , size_t size ) ; int drbd_send_sync_param(struct drbd_conf *mdev , struct syncer_conf *sc ) ; int drbd_send_b_ack(struct drbd_conf *mdev , u32 barrier_nr , u32 set_size ) ; int drbd_send_ack_rp(struct drbd_conf *mdev , enum drbd_packets cmd , struct p_block_req *rp ) ; int drbd_send_ack_dp(struct drbd_conf *mdev , enum drbd_packets cmd , struct p_data *dp , int data_size ) ; int drbd_send_bitmap(struct drbd_conf *mdev ) ; int drbd_send_sr_reply(struct drbd_conf *mdev , enum drbd_state_rv retcode ) ; void drbd_uuid_new_current(struct drbd_conf *mdev ) ; int drbd_bitmap_io(struct drbd_conf *mdev , int (*io_fn)(struct drbd_conf * ) , char *why , enum bm_flag flags ) ; int drbd_bmio_set_n_write(struct drbd_conf *mdev ) ; int drbd_bmio_clear_n_write(struct drbd_conf *mdev ) ; mempool_t *drbd_ee_mempool ; struct page *drbd_pp_pool ; spinlock_t drbd_pp_lock ; int drbd_pp_vacant ; sector_t drbd_new_dev_size(struct drbd_conf *mdev , struct drbd_backing_dev *bdev , int assume_peer_has_space ) ; enum determine_dev_size drbd_determine_dev_size(struct drbd_conf *mdev , enum dds_flags flags ) ; void resync_after_online_grow(struct drbd_conf *mdev ) ; void drbd_reconsider_max_bio_size(struct drbd_conf *mdev ) ; enum drbd_state_rv drbd_set_role(struct drbd_conf *mdev , enum drbd_role new_role , int force ) ; void drbd_try_outdate_peer_async(struct drbd_conf *mdev ) ; int drbd_release_ee(struct drbd_conf *mdev , struct list_head *list ) ; void drbd_wait_ee_list_empty(struct drbd_conf *mdev , struct list_head *head ) ; void _drbd_wait_ee_list_empty(struct drbd_conf *mdev , struct list_head *head ) ; void drbd_flush_workqueue(struct drbd_conf *mdev ) ; void drbd_free_tl_hash(struct drbd_conf *mdev ) ; __inline static void drbd_tcp_nodelay(struct socket *sock ) { int val ; { { val = 1; drbd_setsockopt(sock, 6, 1, (char *)(& val), 4); } return; } } __inline static void drbd_tcp_quickack(struct socket *sock ) { int val ; { { val = 2; drbd_setsockopt(sock, 6, 12, (char *)(& val), 4); } return; } } void drbd_bump_write_ordering(struct drbd_conf *mdev , enum write_ordering_e wo ) ; int drbd_rs_begin_io(struct drbd_conf *mdev , sector_t sector ) ; void drbd_bcast_ee(struct drbd_conf *mdev , char const *reason , int const dgs , char const *seen_hash , char const *calc_hash , struct drbd_epoch_entry const *e ) ; __inline static int drbd_ee_has_active_page___0(struct drbd_epoch_entry *e ) { struct page *page ; int tmp ; struct page *tmp___0 ; { page = e->pages; goto ldv_48554; ldv_48553: { tmp = page_count(page); } if (tmp > 1) { return (1); } else { } { page = page_chain_next(page); } ldv_48554: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { { tmp___0 = page_chain_next(page); __builtin_prefetch((void const *)tmp___0); } goto ldv_48553; } else { goto ldv_48555; } ldv_48555: ; return (0); } } __inline static int drbd_request_state(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val ) { enum drbd_state_rv tmp ; { { tmp = _drbd_request_state(mdev, mask, val, (enum chg_state_flags )14); } return ((int )tmp); } } __inline static sector_t drbd_md_first_sector(struct drbd_backing_dev *bdev ) { { if (bdev->dc.meta_dev_idx == -1) { goto case_neg_1; } else if (bdev->dc.meta_dev_idx == -3) { goto case_neg_3; } else if (bdev->dc.meta_dev_idx == -2) { goto case_neg_2; } else { goto switch_default; if (0) { case_neg_1: ; case_neg_3: ; return ((sector_t )(bdev->md.md_offset + (u64 )bdev->md.bm_offset)); case_neg_2: ; switch_default: ; return ((sector_t )bdev->md.md_offset); } else { } } } } __inline static sector_t drbd_get_max_capacity(struct drbd_backing_dev *bdev ) { sector_t s ; sector_t __min1 ; sector_t __min2 ; sector_t tmp___0 ; sector_t tmp___1 ; sector_t tmp___2 ; sector_t __min1___0 ; sector_t __min2___0 ; sector_t tmp___3 ; sector_t tmp___4 ; sector_t __min1___1 ; sector_t __min2___1 ; sector_t tmp___5 ; sector_t __min1___2 ; sector_t __min2___2 ; sector_t tmp___6 ; sector_t tmp___7 ; { if (bdev->dc.meta_dev_idx == -1) { goto case_neg_1; } else if (bdev->dc.meta_dev_idx == -3) { goto case_neg_3; } else if (bdev->dc.meta_dev_idx == -2) { goto case_neg_2; } else { goto switch_default; if (0) { case_neg_1: ; case_neg_3: { tmp___2 = drbd_get_capacity(bdev->backing_bdev); } if (tmp___2 != 0UL) { { __min1 = 2251799813685248UL; tmp___0 = drbd_md_first_sector(bdev); __min2 = tmp___0; } if (__min1 < __min2) { tmp___1 = __min1; } else { tmp___1 = __min2; } s = tmp___1; } else { s = 0UL; } goto ldv_48628; case_neg_2: { __min1___0 = 2251799813685248UL; tmp___3 = drbd_get_capacity(bdev->backing_bdev); __min2___0 = tmp___3; } if (__min1___0 < __min2___0) { tmp___4 = __min1___0; } else { tmp___4 = __min2___0; } s = tmp___4; __min1___1 = s; __min2___1 = (unsigned long )(bdev->md.md_size_sect - (u32 )bdev->md.bm_offset) << 15; if (__min1___1 < __min2___1) { tmp___5 = __min1___1; } else { tmp___5 = __min2___1; } s = tmp___5; goto ldv_48628; switch_default: { __min1___2 = 8587575296UL; tmp___6 = drbd_get_capacity(bdev->backing_bdev); __min2___2 = tmp___6; } if (__min1___2 < __min2___2) { tmp___7 = __min1___2; } else { tmp___7 = __min2___2; } s = tmp___7; } else { } } ldv_48628: ; return (s); } } __inline static void drbd_queue_work_front(struct drbd_work_queue *q , struct drbd_work *w ) { unsigned long flags ; raw_spinlock_t *tmp ; { { tmp = spinlock_check(& q->q_lock); flags = _raw_spin_lock_irqsave(tmp); list_add(& w->list, & q->q); up(& q->s); spin_unlock_irqrestore(& q->q_lock, flags); } return; } } __inline static int drbd_send_ping(struct drbd_conf *mdev ) { struct p_header80 h ; int tmp ; { { tmp = drbd_send_cmd(mdev, 0, (enum drbd_packets )19, & h, 8UL); } return (tmp); } } __inline static int drbd_send_ping_ack(struct drbd_conf *mdev ) { struct p_header80 h ; int tmp ; { { tmp = drbd_send_cmd(mdev, 0, (enum drbd_packets )20, & h, 8UL); } return (tmp); } } __inline static void inc_unacked(struct drbd_conf *mdev ) { { { atomic_inc(& mdev->unacked_cnt); } return; } } __inline static void put_net_conf(struct drbd_conf *mdev ) { int tmp ; { { tmp = atomic_dec_and_test(& mdev->net_cnt); } if (tmp != 0) { { __wake_up(& mdev->net_cnt_wait, 3U, 1, (void *)0); } } else { } return; } } __inline static int get_net_conf(struct drbd_conf *mdev ) { int have_net_conf ; { { atomic_inc(& mdev->net_cnt); have_net_conf = (int )mdev->state.ldv_38339.conn > 1; } if (have_net_conf == 0) { { put_net_conf(mdev); } } else { } return (have_net_conf); } } __inline static int drbd_set_ed_uuid(struct drbd_conf *mdev , u64 val ) { int changed ; { changed = mdev->ed_uuid != val; mdev->ed_uuid = val; return (changed); } } __inline static int seq_cmp(u32 a , u32 b ) { { return ((int )a - (int )b); } } __inline static void update_peer_seq(struct drbd_conf *mdev , unsigned int new_seq ) { unsigned int m ; int tmp___0 ; { { spin_lock(& mdev->peer_seq_lock); tmp___0 = seq_cmp(mdev->peer_seq, new_seq); } if (tmp___0 > 0) { m = mdev->peer_seq; } else { m = new_seq; } { mdev->peer_seq = m; spin_unlock(& mdev->peer_seq_lock); } if (m == new_seq) { { __wake_up(& mdev->seq_wait, 3U, 1, (void *)0); } } else { } return; } } __inline static void drbd_set_my_capacity(struct drbd_conf *mdev , sector_t size ) { { { set_capacity(mdev->vdisk, size); ((mdev->this_bdev)->bd_inode)->i_size = (long long )size << 9; } return; } } __inline static void drbd_generic_make_request(struct drbd_conf *mdev , int fault_type , struct bio *bio ) { unsigned int tmp ; int tmp___0 ; { if ((unsigned long )bio->bi_bdev == (unsigned long )((struct block_device *)0)) { { tmp = mdev_to_minor(mdev); printk("<3>drbd%d: drbd_generic_make_request: bio->bi_bdev == NULL\n", tmp); dump_stack(); bio_endio(bio, -19); } return; } else { } { tmp___0 = drbd_insert_fault(mdev, (unsigned int )fault_type); } if (tmp___0 != 0) { { bio_endio(bio, -5); } } else { { generic_make_request(bio); } } return; } } __inline static int drbd_crypto_is_hash(struct crypto_tfm *tfm ) { u32 tmp ; { { tmp = crypto_tfm_alg_type(tfm); } return ((tmp & 14U) == 8U); } } __inline static struct hlist_head *ee_hash_slot(struct drbd_conf *mdev , sector_t sector ) { long tmp ; { { tmp = __builtin_expect((long )(mdev->ee_hash_s == 0U), 0L); } if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/inst/current/envs/linux-3.0.1/linux-3.0.1/drivers/block/drbd/drbd_req.h"), "i" (229), "i" (12UL)); ldv_48899: ; goto ldv_48899; } else { } return (mdev->ee_hash + (unsigned long )((unsigned int )(sector >> 8) % mdev->ee_hash_s)); } } __inline static struct hlist_head *tl_hash_slot(struct drbd_conf *mdev , sector_t sector ) { long tmp ; { { tmp = __builtin_expect((long )(mdev->tl_hash_s == 0U), 0L); } if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/inst/current/envs/linux-3.0.1/linux-3.0.1/drivers/block/drbd/drbd_req.h"), "i" (238), "i" (12UL)); ldv_48904: ; goto ldv_48904; } else { } return (mdev->tl_hash + (unsigned long )((unsigned int )(sector >> 8) % mdev->tl_hash_s)); } } static struct hlist_head *ar_hash_slot(struct drbd_conf *mdev , sector_t sector ) { { return (mdev->app_reads_hash + (unsigned long )((unsigned int )sector % 15U)); } } __inline static struct drbd_request *_ar_id_to_req(struct drbd_conf *mdev , u64 id , sector_t sector ) { struct hlist_head *slot ; struct hlist_head *tmp ; struct hlist_node *n ; struct drbd_request *req ; struct hlist_node const *__mptr ; { { tmp = ar_hash_slot(mdev, sector); slot = tmp; n = slot->first; } goto ldv_48921; ldv_48920: ; if ((unsigned long )req == (unsigned long )id) { if (req->sector != sector) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( req->sector == sector ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/inst/current/envs/linux-3.0.1/linux-3.0.1/drivers/block/drbd/drbd_req.h", 261); } } else { } return (req); } else { } n = n->next; ldv_48921: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)n; req = (struct drbd_request *)__mptr + 0x0fffffffffffffd8UL; goto ldv_48920; } else { goto ldv_48922; } ldv_48922: ; return ((struct drbd_request *)0); } } __inline static int overlaps(sector_t s1 , int l1 , sector_t s2 , int l2 ) { int tmp ; { if ((sector_t )(l1 >> 9) + s1 > s2) { if ((sector_t )(l2 >> 9) + s2 > s1) { tmp = 1; } else { tmp = 0; } } else { tmp = 0; } return (tmp); } } __inline static int vli_decode_bits(u64 *out , u64 const in ) { u64 adj ; { adj = 1ULL; if (((unsigned long long )in & 1ULL) == 0ULL) { *out = (((unsigned long long )in & 3ULL) >> 1) + adj; return (2); } else { } adj = adj + 2ULL; if (((unsigned long long )in & 3ULL) == 1ULL) { *out = (((unsigned long long )in & 7ULL) >> 2) + adj; return (3); } else { } adj = adj + 2ULL; if (((unsigned long long )in & 7ULL) == 3ULL) { *out = (((unsigned long long )in & 31ULL) >> 3) + adj; return (5); } else { } adj = adj + 4ULL; if (((unsigned long long )in & 15ULL) == 7ULL) { *out = (((unsigned long long )in & 127ULL) >> 4) + adj; return (7); } else { } adj = adj + 8ULL; if (((unsigned long long )in & 31ULL) == 15ULL) { *out = (((unsigned long long )in & 1023ULL) >> 5) + adj; return (10); } else { } adj = adj + 32ULL; if (((unsigned long long )in & 63ULL) == 31ULL) { *out = (((unsigned long long )in & 16383ULL) >> 6) + adj; return (14); } else { } adj = adj + 256ULL; if (((unsigned long long )in & 255ULL) == 63ULL) { *out = (((unsigned long long )in & 2097151ULL) >> 8) + adj; return (21); } else { } adj = adj + 8192ULL; if (((unsigned long long )in & 255ULL) == 127ULL) { *out = (((unsigned long long )in & 536870911ULL) >> 8) + adj; return (29); } else { } adj = adj + 2097152ULL; if (((unsigned long long )in & 255ULL) == 191ULL) { *out = (((unsigned long long )in & 4398046511103ULL) >> 8) + adj; return (42); } else { } adj = adj + 17179869184ULL; if (((unsigned long long )in & 255ULL) == 255ULL) { *out = ((unsigned long long )in >> 8) + adj; return (64); } else { } adj = adj + 72057594037927936ULL; __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/inst/current/envs/linux-3.0.1/linux-3.0.1/drivers/block/drbd/drbd_vli.h"), "i" (162), "i" (12UL)); ldv_48989: ; goto ldv_48989; } } __inline static void bitstream_cursor_reset(struct bitstream_cursor *cur , void *s ) { { cur->b = (u8 *)s; cur->bit = 0U; return; } } __inline static void bitstream_cursor_advance(struct bitstream_cursor *cur , unsigned int bits ) { { bits = cur->bit + bits; cur->b = cur->b + (unsigned long )(bits >> 3); cur->bit = bits & 7U; return; } } __inline static void bitstream_init(struct bitstream *bs , void *s , size_t len , unsigned int pad_bits ) { { { bs->buf = (unsigned char *)s; bs->buf_len = len; bs->pad_bits = pad_bits; bitstream_cursor_reset(& bs->cur, (void *)bs->buf); } return; } } __inline static int bitstream_get_bits(struct bitstream *bs , u64 *out , int bits ) { u64 val ; unsigned int n ; size_t __len ; void *__ret ; { if (bits > 64) { return (-22); } else { } if ((unsigned long )((long )(bs->cur.b + (unsigned long )((((bs->cur.bit + bs->pad_bits) + (unsigned int )bits) - 1U) >> 3)) - (long )bs->buf) >= bs->buf_len) { bits = (int )(((((unsigned int )bs->buf_len + ((unsigned int )((long )bs->buf) - (unsigned int )((long )bs->cur.b))) << 3U) - bs->cur.bit) - bs->pad_bits); } else { } if (bits == 0) { *out = 0ULL; return (0); } else { } val = 0ULL; n = ((bs->cur.bit + (unsigned int )bits) + 7U) >> 3; if (n != 0U) { { __len = (size_t )(n - 1U); __ret = __builtin_memcpy((void *)(& val), (void const *)bs->cur.b + 1U, __len); val = val << (int )(8U - bs->cur.bit); } } else { } { val = (u64 )((int )*(bs->cur.b) >> (int )bs->cur.bit) | val; val = (0x0fffffffffffffffULL >> (64 - bits)) & val; bitstream_cursor_advance(& bs->cur, (unsigned int )bits); *out = val; } return (bits); } } static int drbd_do_handshake(struct drbd_conf *mdev ) ; static int drbd_do_auth(struct drbd_conf *mdev ) ; static enum finish_epoch drbd_may_finish_epoch(struct drbd_conf *mdev , struct drbd_epoch *epoch , enum epoch_event ev ) ; static int e_end_block(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; static struct page *page_chain_del(struct page **head , int n ) { struct page *page ; struct page *tmp ; long tmp___0 ; long tmp___1 ; { { tmp___0 = __builtin_expect((long )(n == 0), 0L); } if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p"), "i" (88), "i" (12UL)); ldv_49069: ; goto ldv_49069; } else { } { tmp___1 = __builtin_expect((long )((unsigned long )head == (unsigned long )((struct page **)0)), 0L); } if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p"), "i" (89), "i" (12UL)); ldv_49070: ; goto ldv_49070; } else { } page = *head; if ((unsigned long )page == (unsigned long )((struct page *)0)) { return ((struct page *)0); } else { } goto ldv_49073; ldv_49072: { tmp = page_chain_next(page); n = n - 1; } if (n == 0) { goto ldv_49071; } else { } if ((unsigned long )tmp == (unsigned long )((struct page *)0)) { return ((struct page *)0); } else { } page = tmp; ldv_49073: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { goto ldv_49072; } else { goto ldv_49071; } ldv_49071: page->ldv_14032.ldv_14029.private = 0UL; page = *head; *head = tmp; return (page); } } static struct page *page_chain_tail(struct page *page , int *len ) { struct page *tmp ; int i ; { i = 1; goto ldv_49081; ldv_49080: i = i + 1; page = tmp; ldv_49081: { tmp = page_chain_next(page); } if ((unsigned long )tmp != (unsigned long )((struct page *)0)) { goto ldv_49080; } else { goto ldv_49082; } ldv_49082: ; if ((unsigned long )len != (unsigned long )((int *)0)) { *len = i; } else { } return (page); } } static int page_chain_free(struct page *page ) { struct page *tmp ; int i ; { i = 0; goto ldv_49090; ldv_49089: { put_page(page); i = i + 1; page = tmp; } ldv_49090: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { { tmp = page_chain_next(page); } goto ldv_49089; } else { goto ldv_49091; } ldv_49091: ; return (i); } } static void page_chain_add(struct page **head , struct page *chain_first , struct page *chain_last ) { struct page *tmp ; long tmp___0 ; { { tmp = page_chain_tail(chain_first, (int *)0); tmp___0 = __builtin_expect((long )((unsigned long )tmp != (unsigned long )chain_last), 0L); } if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p"), "i" (145), "i" (12UL)); ldv_49098: ; goto ldv_49098; } else { } chain_last->ldv_14032.ldv_14029.private = (unsigned long )*head; *head = chain_first; return; } } static struct page *drbd_pp_first_pages_or_try_alloc(struct drbd_conf *mdev , int number ) { struct page *page ; struct page *tmp ; int i ; { page = (struct page *)0; tmp = (struct page *)0; i = 0; if (drbd_pp_vacant >= number) { { spin_lock(& drbd_pp_lock); page = page_chain_del(& drbd_pp_pool, number); } if ((unsigned long )page != (unsigned long )((struct page *)0)) { drbd_pp_vacant = drbd_pp_vacant - number; } else { } { spin_unlock(& drbd_pp_lock); } if ((unsigned long )page != (unsigned long )((struct page *)0)) { return (page); } else { } } else { } i = 0; goto ldv_49108; ldv_49107: { tmp = alloc_pages(514U, 0U); } if ((unsigned long )tmp == (unsigned long )((struct page *)0)) { goto ldv_49106; } else { } tmp->ldv_14032.ldv_14029.private = (unsigned long )page; page = tmp; i = i + 1; ldv_49108: ; if (i < number) { goto ldv_49107; } else { goto ldv_49106; } ldv_49106: ; if (i == number) { return (page); } else { } if ((unsigned long )page != (unsigned long )((struct page *)0)) { { tmp = page_chain_tail(page, (int *)0); spin_lock(& drbd_pp_lock); page_chain_add(& drbd_pp_pool, page, tmp); drbd_pp_vacant = drbd_pp_vacant + i; spin_unlock(& drbd_pp_lock); } } else { } return ((struct page *)0); } } static void reclaim_net_ee(struct drbd_conf *mdev , struct list_head *to_be_freed ) { struct drbd_epoch_entry *e ; struct list_head *le ; struct list_head *tle ; struct list_head const *__mptr ; int tmp ; { le = mdev->net_ee.next; tle = le->next; goto ldv_49120; ldv_49119: { __mptr = (struct list_head const *)le; e = (struct drbd_epoch_entry *)__mptr; tmp = drbd_ee_has_active_page___0(e); } if (tmp != 0) { goto ldv_49118; } else { } { list_move(le, to_be_freed); le = tle; tle = le->next; } ldv_49120: ; if ((unsigned long )(& mdev->net_ee) != (unsigned long )le) { goto ldv_49119; } else { goto ldv_49118; } ldv_49118: ; return; } } static void drbd_kick_lo_and_reclaim_net(struct drbd_conf *mdev ) { struct list_head reclaimed ; struct drbd_epoch_entry *e ; struct drbd_epoch_entry *t ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { { reclaimed.next = & reclaimed; reclaimed.prev = & reclaimed; spin_lock_irq(& mdev->req_lock); reclaim_net_ee(mdev, & reclaimed); spin_unlock_irq(& mdev->req_lock); __mptr = (struct list_head const *)reclaimed.next; e = (struct drbd_epoch_entry *)__mptr; __mptr___0 = (struct list_head const *)e->w.list.next; t = (struct drbd_epoch_entry *)__mptr___0; } goto ldv_49134; ldv_49133: { drbd_free_some_ee(mdev, e, 1); e = t; __mptr___1 = (struct list_head const *)t->w.list.next; t = (struct drbd_epoch_entry *)__mptr___1; } ldv_49134: ; if ((unsigned long )(& e->w.list) != (unsigned long )(& reclaimed)) { goto ldv_49133; } else { goto ldv_49135; } ldv_49135: ; return; } } static struct page *drbd_pp_alloc(struct drbd_conf *mdev , unsigned int number , bool retry ) { struct page *page ; wait_queue_t wait ; struct task_struct *tmp ; int tmp___0 ; int tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; { { page = (struct page *)0; tmp = get_current(); wait.flags = 0U; wait.private = (void *)tmp; wait.func = & autoremove_wake_function; wait.task_list.next = & wait.task_list; wait.task_list.prev = & wait.task_list; tmp___0 = atomic_read((atomic_t const *)(& mdev->pp_in_use)); } if (tmp___0 < (mdev->net_conf)->max_buffers) { { page = drbd_pp_first_pages_or_try_alloc(mdev, (int )number); } } else { } goto ldv_49145; ldv_49144: { prepare_to_wait(& drbd_pp_wait, & wait, 1); drbd_kick_lo_and_reclaim_net(mdev); tmp___1 = atomic_read((atomic_t const *)(& mdev->pp_in_use)); } if (tmp___1 < (mdev->net_conf)->max_buffers) { { page = drbd_pp_first_pages_or_try_alloc(mdev, (int )number); } if ((unsigned long )page != (unsigned long )((struct page *)0)) { goto ldv_49143; } else { } } else { } if (! retry) { goto ldv_49143; } else { } { tmp___2 = get_current(); tmp___3 = signal_pending(tmp___2); } if (tmp___3 != 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_pp_alloc interrupted!\n"); } goto ldv_49143; } else { } { schedule(); } ldv_49145: ; if ((unsigned long )page == (unsigned long )((struct page *)0)) { goto ldv_49144; } else { goto ldv_49143; } ldv_49143: { finish_wait(& drbd_pp_wait, & wait); } if ((unsigned long )page != (unsigned long )((struct page *)0)) { { atomic_add((int )number, & mdev->pp_in_use); } } else { } return (page); } } static void drbd_pp_free(struct drbd_conf *mdev , struct page *page , int is_net ) { atomic_t *a ; atomic_t *tmp ; int i ; struct page *tmp___0 ; char *tmp___1 ; { if (is_net != 0) { tmp = & mdev->pp_in_use_by_net; } else { tmp = & mdev->pp_in_use; } a = tmp; if ((unsigned long )drbd_pp_vacant > (unsigned long )minor_count * 32UL) { { i = page_chain_free(page); } } else { { tmp___0 = page_chain_tail(page, & i); spin_lock(& drbd_pp_lock); page_chain_add(& drbd_pp_pool, page, tmp___0); drbd_pp_vacant = drbd_pp_vacant + i; spin_unlock(& drbd_pp_lock); } } { i = atomic_sub_return(i, a); } if (i < 0) { if (is_net != 0) { tmp___1 = (char *)"pp_in_use_by_net"; } else { tmp___1 = (char *)"pp_in_use"; } { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERTION FAILED: %s: %d < 0\n", tmp___1, i); } } else { } { __wake_up(& drbd_pp_wait, 3U, 1, (void *)0); } return; } } struct drbd_epoch_entry *drbd_alloc_ee(struct drbd_conf *mdev , u64 id , sector_t sector , unsigned int data_size , gfp_t gfp_mask ) { struct drbd_epoch_entry *e ; struct page *page ; unsigned int nr_pages ; int tmp ; void *tmp___0 ; { { nr_pages = (unsigned int )(((unsigned long )data_size + 4095UL) >> 12); tmp = drbd_insert_fault(mdev, 8U); } if (tmp != 0) { return ((struct drbd_epoch_entry *)0); } else { } { tmp___0 = mempool_alloc(drbd_ee_mempool, gfp_mask & 4294967293U); e = (struct drbd_epoch_entry *)tmp___0; } if ((unsigned long )e == (unsigned long )((struct drbd_epoch_entry *)0)) { if ((gfp_mask & 512U) == 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "alloc_ee: Allocation of an EE failed\n"); } } else { } return ((struct drbd_epoch_entry *)0); } else { } { page = drbd_pp_alloc(mdev, nr_pages, (bool )((gfp_mask & 16U) != 0U)); } if ((unsigned long )page == (unsigned long )((struct page *)0)) { goto fail; } else { } { INIT_HLIST_NODE(& e->collision); e->epoch = (struct drbd_epoch *)0; e->mdev = mdev; e->pages = page; atomic_set(& e->pending_bios, 0); e->size = data_size; e->flags = 0UL; e->sector = sector; e->ldv_46600.block_id = id; } return (e); fail: { mempool_free((void *)e, drbd_ee_mempool); } return ((struct drbd_epoch_entry *)0); } } void drbd_free_some_ee(struct drbd_conf *mdev , struct drbd_epoch_entry *e , int is_net ) { int tmp ; int tmp___0 ; { if ((e->flags & 16UL) != 0UL) { { kfree((void const *)e->ldv_46600.digest); } } else { } { drbd_pp_free(mdev, e->pages, is_net); tmp = atomic_read((atomic_t const *)(& e->pending_bios)); } if (tmp != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( atomic_read(&e->pending_bios) == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 366); } } else { } { tmp___0 = hlist_unhashed((struct hlist_node const *)(& e->collision)); } if (tmp___0 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( hlist_unhashed(&e->collision) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 367); } } else { } { mempool_free((void *)e, drbd_ee_mempool); } return; } } int drbd_release_ee(struct drbd_conf *mdev , struct list_head *list ) { struct list_head work_list ; struct drbd_epoch_entry *e ; struct drbd_epoch_entry *t ; int count ; int is_net ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { { work_list.next = & work_list; work_list.prev = & work_list; count = 0; is_net = (unsigned long )(& mdev->net_ee) == (unsigned long )list; spin_lock_irq(& mdev->req_lock); list_splice_init(list, & work_list); spin_unlock_irq(& mdev->req_lock); __mptr = (struct list_head const *)work_list.next; e = (struct drbd_epoch_entry *)__mptr; __mptr___0 = (struct list_head const *)e->w.list.next; t = (struct drbd_epoch_entry *)__mptr___0; } goto ldv_49186; ldv_49185: { drbd_free_some_ee(mdev, e, is_net); count = count + 1; e = t; __mptr___1 = (struct list_head const *)t->w.list.next; t = (struct drbd_epoch_entry *)__mptr___1; } ldv_49186: ; if ((unsigned long )(& e->w.list) != (unsigned long )(& work_list)) { goto ldv_49185; } else { goto ldv_49187; } ldv_49187: ; return (count); } } static int drbd_process_done_ee(struct drbd_conf *mdev ) { struct list_head work_list ; struct list_head reclaimed ; struct drbd_epoch_entry *e ; struct drbd_epoch_entry *t ; int ok ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; struct list_head const *__mptr___2 ; struct list_head const *__mptr___3 ; int tmp ; int tmp___0 ; struct list_head const *__mptr___4 ; { { work_list.next = & work_list; work_list.prev = & work_list; reclaimed.next = & reclaimed; reclaimed.prev = & reclaimed; ok = (int )mdev->state.ldv_38339.conn > 8; spin_lock_irq(& mdev->req_lock); reclaim_net_ee(mdev, & reclaimed); list_splice_init(& mdev->done_ee, & work_list); spin_unlock_irq(& mdev->req_lock); __mptr = (struct list_head const *)reclaimed.next; e = (struct drbd_epoch_entry *)__mptr; __mptr___0 = (struct list_head const *)e->w.list.next; t = (struct drbd_epoch_entry *)__mptr___0; } goto ldv_49203; ldv_49202: { drbd_free_some_ee(mdev, e, 1); e = t; __mptr___1 = (struct list_head const *)t->w.list.next; t = (struct drbd_epoch_entry *)__mptr___1; } ldv_49203: ; if ((unsigned long )(& e->w.list) != (unsigned long )(& reclaimed)) { goto ldv_49202; } else { goto ldv_49204; } ldv_49204: __mptr___2 = (struct list_head const *)work_list.next; e = (struct drbd_epoch_entry *)__mptr___2; __mptr___3 = (struct list_head const *)e->w.list.next; t = (struct drbd_epoch_entry *)__mptr___3; goto ldv_49212; ldv_49211: { tmp = (*(e->w.cb))(mdev, & e->w, ok == 0); } if (tmp != 0) { if (ok != 0) { tmp___0 = 1; } else { tmp___0 = 0; } } else { tmp___0 = 0; } { ok = tmp___0; drbd_free_some_ee(mdev, e, 0); e = t; __mptr___4 = (struct list_head const *)t->w.list.next; t = (struct drbd_epoch_entry *)__mptr___4; } ldv_49212: ; if ((unsigned long )(& e->w.list) != (unsigned long )(& work_list)) { goto ldv_49211; } else { goto ldv_49213; } ldv_49213: { __wake_up(& mdev->ee_wait, 3U, 1, (void *)0); } return (ok); } } void _drbd_wait_ee_list_empty(struct drbd_conf *mdev , struct list_head *head ) { wait_queue_t wait ; struct task_struct *tmp ; int tmp___0 ; { { tmp = get_current(); wait.flags = 0U; wait.private = (void *)tmp; wait.func = & autoremove_wake_function; wait.task_list.next = & wait.task_list; wait.task_list.prev = & wait.task_list; } goto ldv_49220; ldv_49219: { prepare_to_wait(& mdev->ee_wait, & wait, 2); spin_unlock_irq(& mdev->req_lock); io_schedule(); finish_wait(& mdev->ee_wait, & wait); spin_lock_irq(& mdev->req_lock); } ldv_49220: { tmp___0 = list_empty((struct list_head const *)head); } if (tmp___0 == 0) { goto ldv_49219; } else { goto ldv_49221; } ldv_49221: ; return; } } void drbd_wait_ee_list_empty(struct drbd_conf *mdev , struct list_head *head ) { { { spin_lock_irq(& mdev->req_lock); _drbd_wait_ee_list_empty(mdev, head); spin_unlock_irq(& mdev->req_lock); } return; } } static int drbd_accept(struct drbd_conf *mdev , char const **what , struct socket *sock , struct socket **newsock ) { struct sock *sk ; int err ; { { sk = sock->sk; err = 0; *what = "listen"; err = (*((sock->ops)->listen))(sock, 5); } if (err < 0) { goto out; } else { } { *what = "sock_create_lite"; err = sock_create_lite((int )sk->__sk_common.skc_family, (int )sk->sk_type, (int )sk->sk_protocol, newsock); } if (err < 0) { goto out; } else { } { *what = "accept"; err = (*((sock->ops)->accept))(sock, *newsock, 0); } if (err < 0) { { sock_release(*newsock); *newsock = (struct socket *)0; } goto out; } else { } (*newsock)->ops = sock->ops; out: ; return (err); } } static int drbd_recv_short(struct drbd_conf *mdev , struct socket *sock , void *buf , size_t size , int flags ) { mm_segment_t oldfs ; struct kvec iov ; struct msghdr msg ; unsigned int tmp ; int rv ; struct thread_info *tmp___0 ; struct thread_info *tmp___1 ; mm_segment_t __constr_expr_0 ; struct thread_info *tmp___2 ; { iov.iov_base = buf; iov.iov_len = size; if (flags != 0) { tmp = (unsigned int )flags; } else { tmp = 16640U; } { msg.msg_name = (void *)0; msg.msg_namelen = 0; msg.msg_iov = (struct iovec *)(& iov); msg.msg_iovlen = 1UL; msg.msg_control = (void *)0; msg.msg_controllen = 0UL; msg.msg_flags = tmp; tmp___0 = current_thread_info(); oldfs = tmp___0->addr_limit; tmp___1 = current_thread_info(); __constr_expr_0.seg = 0x0fffffffffffffffUL; tmp___1->addr_limit = __constr_expr_0; rv = sock_recvmsg(sock, & msg, size, (int )msg.msg_flags); tmp___2 = current_thread_info(); tmp___2->addr_limit = oldfs; } return (rv); } } static int drbd_recv(struct drbd_conf *mdev , void *buf , size_t size ) { mm_segment_t oldfs ; struct kvec iov ; struct msghdr msg ; int rv ; struct thread_info *tmp ; struct thread_info *tmp___0 ; mm_segment_t __constr_expr_0 ; struct thread_info *tmp___1 ; union drbd_state val ; union drbd_state mask ; { { iov.iov_base = buf; iov.iov_len = size; msg.msg_name = (void *)0; msg.msg_namelen = 0; msg.msg_iov = (struct iovec *)(& iov); msg.msg_iovlen = 1UL; msg.msg_control = (void *)0; msg.msg_controllen = 0UL; msg.msg_flags = 16640U; tmp = current_thread_info(); oldfs = tmp->addr_limit; tmp___0 = current_thread_info(); __constr_expr_0.seg = 0x0fffffffffffffffUL; tmp___0->addr_limit = __constr_expr_0; } ldv_49258: { rv = sock_recvmsg(mdev->data.socket, & msg, size, (int )msg.msg_flags); } if ((size_t )rv == size) { goto ldv_49257; } else { } if (rv < 0) { if (rv == -104) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "sock was reset by peer\n"); } } else if (rv != -512) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "sock_recvmsg returned %d\n", rv); } } else { } goto ldv_49257; } else if (rv == 0) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "sock was shut down by peer\n"); } goto ldv_49257; } else { goto ldv_49257; } goto ldv_49258; ldv_49257: { tmp___1 = current_thread_info(); tmp___1->addr_limit = oldfs; } if ((size_t )rv != size) { { val.i = 0U; val.ldv_38339.conn = (unsigned char)4; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } } else { } return (rv); } } static void drbd_setbufsize(struct socket *sock , unsigned int snd , unsigned int rcv ) { { if (snd != 0U) { (sock->sk)->sk_sndbuf = (int )snd; (sock->sk)->sk_userlocks = (unsigned char )((unsigned int )(sock->sk)->sk_userlocks | 1U); } else { } if (rcv != 0U) { (sock->sk)->sk_rcvbuf = (int )rcv; (sock->sk)->sk_userlocks = (unsigned char )((unsigned int )(sock->sk)->sk_userlocks | 2U); } else { } return; } } static struct socket *drbd_try_connect(struct drbd_conf *mdev ) { char const *what ; struct socket *sock ; struct sockaddr_in6 src_in6 ; int err ; int disconnect_on_error ; int tmp ; long tmp___0 ; size_t __len ; int __min1 ; int __min2 ; int tmp___1 ; void *__ret ; union drbd_state val ; union drbd_state mask ; { { disconnect_on_error = 1; tmp = get_net_conf(mdev); } if (tmp == 0) { return ((struct socket *)0); } else { } { what = "sock_create_kern"; err = sock_create_kern((int )((struct sockaddr *)(& (mdev->net_conf)->my_addr))->sa_family, 1, 6, & sock); } if (err < 0) { sock = (struct socket *)0; goto out; } else { } { tmp___0 = (long )((mdev->net_conf)->try_connect_int * 250); (sock->sk)->sk_sndtimeo = tmp___0; (sock->sk)->sk_rcvtimeo = tmp___0; drbd_setbufsize(sock, (unsigned int )(mdev->net_conf)->sndbuf_size, (unsigned int )(mdev->net_conf)->rcvbuf_size); __min1 = (mdev->net_conf)->my_addr_len; __min2 = 28; } if (__min1 < __min2) { tmp___1 = __min1; } else { tmp___1 = __min2; } { __len = (size_t )tmp___1; __ret = __builtin_memcpy((void *)(& src_in6), (void const *)(& (mdev->net_conf)->my_addr), __len); } if ((unsigned int )((struct sockaddr *)(& (mdev->net_conf)->my_addr))->sa_family == 10U) { src_in6.sin6_port = (__be16 )0U; } else { ((struct sockaddr_in *)(& src_in6))->sin_port = (__be16 )0U; } { what = "bind before connect"; err = (*((sock->ops)->bind))(sock, (struct sockaddr *)(& src_in6), (mdev->net_conf)->my_addr_len); } if (err < 0) { goto out; } else { } { disconnect_on_error = 0; what = "connect"; err = (*((sock->ops)->connect))(sock, (struct sockaddr *)(& (mdev->net_conf)->peer_addr), (mdev->net_conf)->peer_addr_len, 0); } out: ; if (err < 0) { if ((unsigned long )sock != (unsigned long )((struct socket *)0)) { { sock_release(sock); sock = (struct socket *)0; } } else { } if (- err == 110) { goto case_110; } else if (- err == 11) { goto case_11; } else if (- err == 115) { goto case_115; } else if (- err == 4) { goto case_4; } else if (- err == 512) { goto case_512; } else if (- err == 111) { goto case_111; } else if (- err == 101) { goto case_101; } else if (- err == 112) { goto case_112; } else if (- err == 113) { goto case_113; } else { goto switch_default; if (0) { case_110: ; case_11: ; case_115: ; case_4: ; case_512: ; case_111: ; case_101: ; case_112: ; case_113: disconnect_on_error = 0; goto ldv_49295; switch_default: { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s failed, err = %d\n", what, err); } } else { } } ldv_49295: ; if (disconnect_on_error != 0) { { val.i = 0U; val.ldv_38339.conn = (unsigned char)1; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } } else { } } else { } { put_net_conf(mdev); } return (sock); } } static struct socket *drbd_wait_for_connect(struct drbd_conf *mdev ) { int timeo ; int err ; struct socket *s_estab ; struct socket *s_listen ; char const *what ; int tmp ; int tmp___1 ; u32 tmp___2 ; union drbd_state val ; union drbd_state mask ; { { s_estab = (struct socket *)0; tmp = get_net_conf(mdev); } if (tmp == 0) { return ((struct socket *)0); } else { } { what = "sock_create_kern"; err = sock_create_kern((int )((struct sockaddr *)(& (mdev->net_conf)->my_addr))->sa_family, 1, 6, & s_listen); } if (err != 0) { s_listen = (struct socket *)0; goto out; } else { } { timeo = (mdev->net_conf)->try_connect_int * 250; tmp___2 = random32(); } if ((int )tmp___2 & 1) { tmp___1 = timeo / 7; } else { tmp___1 = - timeo / 7; } { timeo = tmp___1 + timeo; (s_listen->sk)->__sk_common.skc_reuse = (unsigned char)1; (s_listen->sk)->sk_rcvtimeo = (long )timeo; (s_listen->sk)->sk_sndtimeo = (long )timeo; drbd_setbufsize(s_listen, (unsigned int )(mdev->net_conf)->sndbuf_size, (unsigned int )(mdev->net_conf)->rcvbuf_size); what = "bind before listen"; err = (*((s_listen->ops)->bind))(s_listen, (struct sockaddr *)(& (mdev->net_conf)->my_addr), (mdev->net_conf)->my_addr_len); } if (err < 0) { goto out; } else { } { err = drbd_accept(mdev, & what, s_listen, & s_estab); } out: ; if ((unsigned long )s_listen != (unsigned long )((struct socket *)0)) { { sock_release(s_listen); } } else { } if (err < 0) { if (err != -11) { if (err != -4) { if (err != -512) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s failed, err = %d\n", what, err); val.i = 0U; val.ldv_38339.conn = (unsigned char)1; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } } else { } } else { } } else { } } else { } { put_net_conf(mdev); } return (s_estab); } } static int drbd_send_fp(struct drbd_conf *mdev , struct socket *sock , enum drbd_packets cmd ) { struct p_header80 *h ; int tmp ; { { h = & mdev->data.sbuf.header.h80; tmp = _drbd_send_cmd(mdev, sock, cmd, h, 8UL, 0U); } return (tmp); } } static enum drbd_packets drbd_recv_fp(struct drbd_conf *mdev , struct socket *sock ) { struct p_header80 *h ; int rr ; __u16 tmp ; { { h = & mdev->data.rbuf.header.h80; rr = drbd_recv_short(mdev, sock, (void *)h, 8UL, 0); } if (rr == 8) { if (h->magic == 1728214147U) { { tmp = __fswab16((__u16 )((int )h->command)); } return ((enum drbd_packets )tmp); } else { } } else { } return ((enum drbd_packets )65535); } } static int drbd_socket_okay(struct drbd_conf *mdev , struct socket **sock ) { int rr ; char tb[4U] ; { if ((unsigned long )*sock == (unsigned long )((struct socket *)0)) { return (0); } else { } { rr = drbd_recv_short(mdev, *sock, (void *)(& tb), 4UL, 66); } if (rr > 0) { return (1); } else if (rr == -11) { return (1); } else { { sock_release(*sock); *sock = (struct socket *)0; } return (0); } } } static int drbd_connect(struct drbd_conf *mdev ) { struct socket *s ; struct socket *sock ; struct socket *msock ; int try ; int h ; int ok ; union drbd_state val ; union drbd_state mask ; int tmp ; int tmp___0 ; int tmp___1 ; enum drbd_packets tmp___2 ; u32 tmp___3 ; struct task_struct *tmp___4 ; enum drbd_thread_state tmp___5 ; struct task_struct *tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; long tmp___10 ; int tmp___11 ; union drbd_state val___0 ; union drbd_state mask___0 ; int tmp___12 ; int tmp___13 ; { if ((unsigned long )mdev->data.socket != (unsigned long )((struct socket *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !mdev->data.socket ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 762); } } else { } { val.i = 0U; val.ldv_38339.conn = (unsigned char)8; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; tmp = drbd_request_state(mdev, mask, val); } if (tmp <= 0) { return (-2); } else { } { clear_bit(6, (unsigned long volatile *)(& mdev->flags)); sock = (struct socket *)0; msock = (struct socket *)0; } ldv_49354: try = 0; ldv_49346: { s = drbd_try_connect(mdev); } if ((unsigned long )s != (unsigned long )((struct socket *)0)) { goto ldv_49345; } else { try = try + 1; if (try > 2) { goto ldv_49345; } else { } } { schedule_timeout_interruptible(25L); } goto ldv_49346; ldv_49345: ; if ((unsigned long )s != (unsigned long )((struct socket *)0)) { if ((unsigned long )sock == (unsigned long )((struct socket *)0)) { { drbd_send_fp(mdev, s, (enum drbd_packets )65522); sock = s; s = (struct socket *)0; } } else if ((unsigned long )msock == (unsigned long )((struct socket *)0)) { { drbd_send_fp(mdev, s, (enum drbd_packets )65521); msock = s; s = (struct socket *)0; } } else { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Logic error in drbd_connect()\n"); } goto out_release_sockets; } } else { } if ((unsigned long )sock != (unsigned long )((struct socket *)0)) { if ((unsigned long )msock != (unsigned long )((struct socket *)0)) { { schedule_timeout_interruptible((long )(((mdev->net_conf)->ping_timeo * 250) / 10)); ok = drbd_socket_okay(mdev, & sock); tmp___0 = drbd_socket_okay(mdev, & msock); } if (tmp___0 != 0) { if (ok != 0) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } ok = tmp___1; if (ok != 0) { goto ldv_49348; } else { } } else { } } else { } retry: { s = drbd_wait_for_connect(mdev); } if ((unsigned long )s != (unsigned long )((struct socket *)0)) { { tmp___2 = drbd_recv_fp(mdev, s); try = (int )tmp___2; drbd_socket_okay(mdev, & sock); drbd_socket_okay(mdev, & msock); } if (try == 65522) { goto case_65522; } else if (try == 65521) { goto case_65521; } else { goto switch_default; if (0) { case_65522: ; if ((unsigned long )sock != (unsigned long )((struct socket *)0)) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "initial packet S crossed\n"); sock_release(sock); } } else { } sock = s; goto ldv_49351; case_65521: ; if ((unsigned long )msock != (unsigned long )((struct socket *)0)) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "initial packet M crossed\n"); sock_release(msock); } } else { } { msock = s; set_bit(6U, (unsigned long volatile *)(& mdev->flags)); } goto ldv_49351; switch_default: { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Error receiving initial packet\n"); sock_release(s); tmp___3 = random32(); } if ((int )tmp___3 & 1) { goto retry; } else { } } else { } } ldv_49351: ; } else { } if ((int )mdev->state.ldv_38339.conn <= 1) { goto out_release_sockets; } else { } { tmp___6 = get_current(); tmp___7 = signal_pending(tmp___6); } if (tmp___7 != 0) { { tmp___4 = get_current(); flush_signals(tmp___4); __asm__ volatile ("": : : "memory"); tmp___5 = get_t_state(& mdev->receiver); } if ((unsigned int )tmp___5 == 2U) { goto out_release_sockets; } else { } } else { } if ((unsigned long )sock != (unsigned long )((struct socket *)0)) { if ((unsigned long )msock != (unsigned long )((struct socket *)0)) { { ok = drbd_socket_okay(mdev, & sock); tmp___8 = drbd_socket_okay(mdev, & msock); } if (tmp___8 != 0) { if (ok != 0) { tmp___9 = 1; } else { tmp___9 = 0; } } else { tmp___9 = 0; } ok = tmp___9; if (ok != 0) { goto ldv_49348; } else { } } else { } } else { } goto ldv_49354; ldv_49348: { (msock->sk)->__sk_common.skc_reuse = (unsigned char)1; (sock->sk)->__sk_common.skc_reuse = (unsigned char)1; (sock->sk)->sk_allocation = 16U; (msock->sk)->sk_allocation = 16U; (sock->sk)->sk_priority = 4U; (msock->sk)->sk_priority = 6U; tmp___10 = (long )(((mdev->net_conf)->ping_timeo * 1000) / 10); (sock->sk)->sk_rcvtimeo = tmp___10; (sock->sk)->sk_sndtimeo = tmp___10; (msock->sk)->sk_sndtimeo = (long )(((mdev->net_conf)->timeout * 250) / 10); (msock->sk)->sk_rcvtimeo = (long )((mdev->net_conf)->ping_int * 250); drbd_tcp_nodelay(sock); drbd_tcp_nodelay(msock); mdev->data.socket = sock; mdev->meta.socket = msock; mdev->last_received = (unsigned long )jiffies; } if ((unsigned long )mdev->asender.task != (unsigned long )((struct task_struct *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->asender.task == NULL ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 881); } } else { } { h = drbd_do_handshake(mdev); } if (h <= 0) { return (h); } else { } if ((unsigned long )mdev->cram_hmac_tfm != (unsigned long )((struct crypto_hash *)0)) { { tmp___11 = drbd_do_auth(mdev); } if (tmp___11 == -1) { goto case_neg_1; } else if (tmp___11 == 0) { goto case_0; } else if (0) { case_neg_1: { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Authentication of peer failed\n"); } return (-1); case_0: { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Authentication of peer failed, trying again.\n"); } return (0); } else { } } else { } { val___0.i = 0U; val___0.ldv_38339.conn = (unsigned char)9; mask___0.i = 0U; mask___0.ldv_38339.conn = (unsigned char)31; tmp___12 = drbd_request_state(mdev, mask___0, val___0); } if (tmp___12 <= 0) { return (0); } else { } { (sock->sk)->sk_sndtimeo = (long )(((mdev->net_conf)->timeout * 250) / 10); (sock->sk)->sk_rcvtimeo = 9223372036854775807L; atomic_set(& mdev->packet_seq, 0); mdev->peer_seq = 0U; drbd_thread_start(& mdev->asender); tmp___13 = drbd_send_protocol(mdev); } if (tmp___13 == -1) { return (-1); } else { } { drbd_send_sync_param(mdev, & mdev->sync_conf); drbd_send_sizes(mdev, 0, (enum dds_flags )0); drbd_send_uuids(mdev); drbd_send_state(mdev); clear_bit(7, (unsigned long volatile *)(& mdev->flags)); clear_bit(24, (unsigned long volatile *)(& mdev->flags)); mod_timer(& mdev->request_timer, (unsigned long )jiffies + 250UL); } return (1); out_release_sockets: ; if ((unsigned long )sock != (unsigned long )((struct socket *)0)) { { sock_release(sock); } } else { } if ((unsigned long )msock != (unsigned long )((struct socket *)0)) { { sock_release(msock); } } else { } return (-1); } } static int drbd_recv_header(struct drbd_conf *mdev , enum drbd_packets *cmd , unsigned int *packet_size ) { union p_header *h ; int r ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; __u16 tmp___2 ; __u16 tmp___3 ; __u16 tmp___4 ; __u32 tmp___5 ; __u16 tmp___6 ; __u16 tmp___7 ; __u32 tmp___8 ; long tmp___9 ; { { h = & mdev->data.rbuf.header; r = drbd_recv(mdev, (void *)h, 8UL); tmp___1 = __builtin_expect((long )(r != 8), 0L); } if (tmp___1 != 0L) { { tmp = get_current(); tmp___0 = signal_pending(tmp); } if (tmp___0 == 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read expecting header on sock: r=%d\n", r); } } else { } return (0); } else { } { tmp___9 = __builtin_expect((long )(h->h80.magic == 1728214147U), 1L); } if (tmp___9 != 0L) { { tmp___2 = __fswab16((__u16 )((int )h->h80.command)); *cmd = (enum drbd_packets )tmp___2; tmp___3 = __fswab16((__u16 )((int )h->h80.length)); *packet_size = (unsigned int )tmp___3; } } else if ((unsigned int )h->h95.magic == 23171U) { { tmp___4 = __fswab16((__u16 )((int )h->h95.command)); *cmd = (enum drbd_packets )tmp___4; tmp___5 = __fswab32(h->h95.length); *packet_size = tmp___5; } } else { { tmp___6 = __fswab16((__u16 )((int )h->h80.length)); tmp___7 = __fswab16((__u16 )((int )h->h80.command)); tmp___8 = __fswab32(h->h80.magic); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "magic?? on data m: 0x%08x c: %d l: %d\n", tmp___8, (int )tmp___7, (int )tmp___6); } return (0); } mdev->last_received = (unsigned long )jiffies; return (1); } } static void drbd_flush(struct drbd_conf *mdev ) { int rv ; int tmp ; { if ((unsigned int )mdev->write_ordering > 1U) { { tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp != 0) { { rv = blkdev_issue_flush((mdev->ldev)->backing_bdev, 208U, (sector_t *)0); } if (rv != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "local disk flush failed with status %d\n", rv); drbd_bump_write_ordering(mdev, (enum write_ordering_e )1); } } else { } { put_ldev(mdev); } } else { } } else { } return; } } static enum finish_epoch drbd_may_finish_epoch(struct drbd_conf *mdev , struct drbd_epoch *epoch , enum epoch_event ev ) { int epoch_size ; struct drbd_epoch *next_epoch ; enum finish_epoch rv ; int tmp ; int tmp___0 ; struct list_head const *__mptr ; int tmp___1 ; int tmp___2 ; { { rv = (enum finish_epoch )0; spin_lock(& mdev->epoch_lock); } ldv_49391: { next_epoch = (struct drbd_epoch *)0; epoch_size = atomic_read((atomic_t const *)(& epoch->epoch_size)); } if ((int )((unsigned int )ev & 4294967263U) == 0) { goto case_0; } else if ((int )((unsigned int )ev & 4294967263U) == 1) { goto case_1; } else if ((int )((unsigned int )ev & 4294967263U) == 2) { goto case_2; } else if (0) { case_0: { atomic_dec(& epoch->active); } goto ldv_49381; case_1: { set_bit(0U, (unsigned long volatile *)(& epoch->flags)); } goto ldv_49381; case_2: ; goto ldv_49381; } else { } ldv_49381: ; if (epoch_size != 0) { { tmp___1 = atomic_read((atomic_t const *)(& epoch->active)); } if (tmp___1 == 0) { { tmp___2 = constant_test_bit(0U, (unsigned long const volatile *)(& epoch->flags)); } if (tmp___2 != 0) { if (((unsigned int )ev & 32U) == 0U) { { spin_unlock(& mdev->epoch_lock); drbd_send_b_ack(mdev, epoch->barrier_nr, (u32 )epoch_size); spin_lock(& mdev->epoch_lock); } } else { } { atomic_dec(& mdev->unacked_cnt); tmp___0 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); } if (tmp___0 < 0) { { tmp = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: unacked_cnt = %d < 0 !\n", "drbd_may_finish_epoch", 1018, tmp); } } else { } if ((unsigned long )mdev->current_epoch != (unsigned long )epoch) { { __mptr = (struct list_head const *)epoch->list.next; next_epoch = (struct drbd_epoch *)__mptr; list_del(& epoch->list); ev = (enum epoch_event )(((unsigned int )ev & 32U) | 2U); mdev->epochs = mdev->epochs - 1U; kfree((void const *)epoch); } if ((unsigned int )rv == 0U) { rv = (enum finish_epoch )1; } else { } } else { { epoch->flags = 0UL; atomic_set(& epoch->epoch_size, 0); } if ((unsigned int )rv == 0U) { rv = (enum finish_epoch )2; } else { } { __wake_up(& mdev->ee_wait, 3U, 1, (void *)0); } } } else { } } else { } } else { } if ((unsigned long )next_epoch == (unsigned long )((struct drbd_epoch *)0)) { goto ldv_49390; } else { } epoch = next_epoch; goto ldv_49391; ldv_49390: { spin_unlock(& mdev->epoch_lock); } return (rv); } } void drbd_bump_write_ordering(struct drbd_conf *mdev , enum write_ordering_e wo ) { enum write_ordering_e pwo ; char *write_ordering_str[3U] ; enum write_ordering_e _min1 ; enum write_ordering_e _min2 ; unsigned int tmp ; { write_ordering_str[0] = (char *)"none"; write_ordering_str[1] = (char *)"drain"; write_ordering_str[2] = (char *)"flush"; pwo = mdev->write_ordering; _min1 = pwo; _min2 = wo; if ((unsigned int )_min1 < (unsigned int )_min2) { tmp = (unsigned int )_min1; } else { tmp = (unsigned int )_min2; } wo = (enum write_ordering_e )tmp; if ((unsigned int )wo == 2U) { if ((unsigned int )*((unsigned char *)mdev->ldev + 372UL) != 0U) { wo = (enum write_ordering_e )1; } else { } } else { } if ((unsigned int )wo == 1U) { if ((unsigned int )*((unsigned char *)mdev->ldev + 380UL) != 0U) { wo = (enum write_ordering_e )0; } else { } } else { } mdev->write_ordering = wo; if ((unsigned int )mdev->write_ordering != (unsigned int )pwo) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Method to ensure write ordering: %s\n", write_ordering_str[(unsigned int )mdev->write_ordering]); } } else if ((unsigned int )wo == 2U) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Method to ensure write ordering: %s\n", write_ordering_str[(unsigned int )mdev->write_ordering]); } } else { } return; } } int drbd_submit_ee(struct drbd_conf *mdev , struct drbd_epoch_entry *e , unsigned int const rw , int const fault_type ) { struct bio *bios ; struct bio *bio ; struct page *page ; sector_t sector ; unsigned int ds ; unsigned int n_bios ; unsigned int nr_pages ; int err ; unsigned int len ; unsigned int __min1 ; unsigned int __min2 ; unsigned int tmp ; int tmp___0 ; struct page *tmp___1 ; { bios = (struct bio *)0; page = e->pages; sector = e->sector; ds = e->size; n_bios = 0U; nr_pages = (unsigned int )(((unsigned long )ds + 4095UL) >> 12); err = -12; next_bio: { bio = bio_alloc(16U, (int )nr_pages); } if ((unsigned long )bio == (unsigned long )((struct bio *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "submit_ee: Allocation of a bio failed\n"); } goto fail; } else { } bio->bi_sector = sector; bio->bi_bdev = (mdev->ldev)->backing_bdev; bio->bi_rw = (unsigned long )rw; bio->bi_private = (void *)e; bio->bi_end_io = & drbd_endio_sec; bio->bi_next = bios; bios = bio; n_bios = n_bios + 1U; goto ldv_49423; ldv_49422: __min1 = ds; __min2 = 4096U; if (__min1 < __min2) { tmp = __min1; } else { tmp = __min2; } { len = tmp; tmp___0 = bio_add_page(bio, page, len, 0U); } if (tmp___0 == 0) { if ((unsigned int )bio->bi_vcnt == 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "bio_add_page failed for len=%u, bi_vcnt=0 (bi_sector=%llu)\n", len, (unsigned long long )bio->bi_sector); err = -28; } goto fail; } else { } goto next_bio; } else { } { ds = ds - len; sector = (sector_t )(len >> 9) + sector; nr_pages = nr_pages - 1U; page = page_chain_next(page); } ldv_49423: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { { tmp___1 = page_chain_next(page); __builtin_prefetch((void const *)tmp___1); } goto ldv_49422; } else { goto ldv_49424; } ldv_49424: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( page == NULL ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1145); } } else { } if (ds != 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( ds == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1146); } } else { } { atomic_set(& e->pending_bios, (int )n_bios); } ldv_49425: { bio = bios; bios = bios->bi_next; bio->bi_next = (struct bio *)0; drbd_generic_make_request(mdev, (int )fault_type, bio); } if ((unsigned long )bios != (unsigned long )((struct bio *)0)) { goto ldv_49425; } else { goto ldv_49426; } ldv_49426: ; return (0); fail: ; goto ldv_49428; ldv_49427: { bio = bios; bios = bios->bi_next; bio_put(bio); } ldv_49428: ; if ((unsigned long )bios != (unsigned long )((struct bio *)0)) { goto ldv_49427; } else { goto ldv_49429; } ldv_49429: ; return (err); } } static int receive_Barrier(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { int rv ; struct p_barrier *p ; struct drbd_epoch *epoch ; enum finish_epoch tmp ; void *tmp___0 ; void *tmp___1 ; int tmp___2 ; int tmp___3 ; wait_queue_t __wait ; struct task_struct *tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; { { p = & mdev->data.rbuf.barrier; inc_unacked(mdev); (mdev->current_epoch)->barrier_nr = p->barrier; tmp = drbd_may_finish_epoch(mdev, mdev->current_epoch, (enum epoch_event )1); rv = (int )tmp; } if ((int )((unsigned int )mdev->write_ordering) == 0) { goto case_0; } else if ((int )((unsigned int )mdev->write_ordering) == 2) { goto case_2; } else if ((int )((unsigned int )mdev->write_ordering) == 1) { goto case_1; } else { goto switch_default; if (0) { case_0: ; if (rv == 2) { return (1); } else { } { tmp___0 = kmalloc(40UL, 16U); epoch = (struct drbd_epoch *)tmp___0; } if ((unsigned long )epoch != (unsigned long )((struct drbd_epoch *)0)) { goto ldv_49439; } else { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Allocation of an epoch failed, slowing down\n"); } } case_2: ; case_1: { drbd_wait_ee_list_empty(mdev, & mdev->active_ee); drbd_flush(mdev); tmp___2 = atomic_read((atomic_t const *)(& (mdev->current_epoch)->epoch_size)); } if (tmp___2 != 0) { { tmp___1 = kmalloc(40UL, 16U); epoch = (struct drbd_epoch *)tmp___1; } if ((unsigned long )epoch != (unsigned long )((struct drbd_epoch *)0)) { goto ldv_49439; } else { } } else { } { epoch = mdev->current_epoch; tmp___3 = atomic_read((atomic_t const *)(& epoch->epoch_size)); } if (tmp___3 == 0) { goto ldv_49442; } else { } { tmp___4 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___4; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_49445: { prepare_to_wait(& mdev->ee_wait, & __wait, 2); tmp___5 = atomic_read((atomic_t const *)(& epoch->epoch_size)); } if (tmp___5 == 0) { goto ldv_49444; } else { } { schedule(); } goto ldv_49445; ldv_49444: { finish_wait(& mdev->ee_wait, & __wait); } ldv_49442: { tmp___6 = atomic_read((atomic_t const *)(& epoch->active)); } if (tmp___6 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( atomic_read(&epoch->active) == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1211); } } else { } if (epoch->flags != 0UL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( epoch->flags == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1212); } } else { } return (1); switch_default: { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Strangeness in mdev->write_ordering %d\n", (unsigned int )mdev->write_ordering); } return (0); } else { } } ldv_49439: { epoch->flags = 0UL; atomic_set(& epoch->epoch_size, 0); atomic_set(& epoch->active, 0); spin_lock(& mdev->epoch_lock); tmp___7 = atomic_read((atomic_t const *)(& (mdev->current_epoch)->epoch_size)); } if (tmp___7 != 0) { { list_add(& epoch->list, & (mdev->current_epoch)->list); mdev->current_epoch = epoch; mdev->epochs = mdev->epochs + 1U; } } else { { kfree((void const *)epoch); } } { spin_unlock(& mdev->epoch_lock); } return (1); } } static struct drbd_epoch_entry *read_in_block(struct drbd_conf *mdev , u64 id , sector_t sector , int data_size ) { sector_t capacity ; sector_t tmp ; struct drbd_epoch_entry *e ; struct page *page ; int dgs ; int ds ; int rr ; void *dig_in ; void *dig_vv ; unsigned long *data ; unsigned int tmp___0 ; struct task_struct *tmp___1 ; int tmp___2 ; int _b ; int _b___0 ; int _b___1 ; unsigned int len ; int __min1 ; int __min2 ; int tmp___3 ; void *tmp___4 ; int tmp___5 ; struct task_struct *tmp___6 ; int tmp___7 ; struct page *tmp___8 ; int tmp___9 ; { { tmp = drbd_get_capacity(mdev->this_bdev); capacity = tmp; dig_in = mdev->int_dig_in; dig_vv = mdev->int_dig_vv; } if (mdev->agreed_pro_version > 86) { if ((unsigned long )mdev->integrity_r_tfm != (unsigned long )((struct crypto_hash *)0)) { { tmp___0 = crypto_hash_digestsize(mdev->integrity_r_tfm); dgs = (int )tmp___0; } } else { dgs = 0; } } else { dgs = 0; } if (dgs != 0) { { rr = drbd_recv(mdev, dig_in, (size_t )dgs); } if (rr != dgs) { { tmp___1 = get_current(); tmp___2 = signal_pending(tmp___1); } if (tmp___2 == 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving data digest: read %d expected %d\n", rr, dgs); } } else { } return ((struct drbd_epoch_entry *)0); } else { } } else { } data_size = data_size - dgs; _b = data_size == 0; if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "read_in_block", (char *)"data_size == 0", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1267); } } else { } if (_b != 0) { return ((struct drbd_epoch_entry *)0); } else { } _b___0 = (data_size & 511) != 0; if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "read_in_block", (char *)"data_size & 0x1ff", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1268); } } else { } if (_b___0 != 0) { return ((struct drbd_epoch_entry *)0); } else { } _b___1 = (unsigned int )data_size > 131072U; if (_b___1 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "read_in_block", (char *)"data_size > DRBD_MAX_BIO_SIZE", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1269); } } else { } if (_b___1 != 0) { return ((struct drbd_epoch_entry *)0); } else { } if ((sector_t )(data_size >> 9) + sector > capacity) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "request from peer beyond end of local disk: capacity: %llus < sector: %llus + size: %u\n", (unsigned long long )capacity, (unsigned long long )sector, data_size); } return ((struct drbd_epoch_entry *)0); } else { } { e = drbd_alloc_ee(mdev, id, sector, (unsigned int )data_size, 16U); } if ((unsigned long )e == (unsigned long )((struct drbd_epoch_entry *)0)) { return ((struct drbd_epoch_entry *)0); } else { } ds = data_size; page = e->pages; goto ldv_49475; ldv_49474: __min1 = ds; __min2 = 4096; if (__min1 < __min2) { tmp___3 = __min1; } else { tmp___3 = __min2; } { len = (unsigned int )tmp___3; tmp___4 = kmap(page); data = (unsigned long *)tmp___4; rr = drbd_recv(mdev, (void *)data, (size_t )len); tmp___5 = drbd_insert_fault(mdev, 9U); } if (tmp___5 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Fault injection: Corrupting data on receive\n"); *data = ~ *data; } } else { } { kunmap(page); } if ((unsigned int )rr != len) { { drbd_free_some_ee(mdev, e, 0); tmp___6 = get_current(); tmp___7 = signal_pending(tmp___6); } if (tmp___7 == 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving data: read %d expected %d\n", rr, len); } } else { } return ((struct drbd_epoch_entry *)0); } else { } { ds = ds - rr; page = page_chain_next(page); } ldv_49475: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { { tmp___8 = page_chain_next(page); __builtin_prefetch((void const *)tmp___8); } goto ldv_49474; } else { goto ldv_49476; } ldv_49476: ; if (dgs != 0) { { drbd_csum_ee(mdev, mdev->integrity_r_tfm, e, dig_vv); tmp___9 = memcmp((void const *)dig_in, (void const *)dig_vv, (size_t )dgs); } if (tmp___9 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Digest integrity check FAILED: %llus +%u\n", (unsigned long long )sector, data_size); drbd_bcast_ee(mdev, "digest failed", (int const )dgs, (char const *)dig_in, (char const *)dig_vv, (struct drbd_epoch_entry const *)e); drbd_free_some_ee(mdev, e, 0); } return ((struct drbd_epoch_entry *)0); } else { } } else { } mdev->recv_cnt = mdev->recv_cnt + (unsigned int )(data_size >> 9); return (e); } } static int drbd_drain_block(struct drbd_conf *mdev , int data_size ) { struct page *page ; int rr ; int rv ; void *data ; int __min1 ; int __min2 ; int tmp ; int __min1___0 ; int __min2___0 ; int tmp___0 ; struct task_struct *tmp___1 ; int tmp___2 ; int __min1___1 ; int __min2___1 ; int tmp___3 ; { rv = 1; if (data_size == 0) { return (1); } else { } { page = drbd_pp_alloc(mdev, 1U, (bool )1); data = kmap(page); } goto ldv_49496; ldv_49495: __min1 = data_size; __min2 = 4096; if (__min1 < __min2) { tmp = __min1; } else { tmp = __min2; } { rr = drbd_recv(mdev, data, (size_t )tmp); __min1___1 = data_size; __min2___1 = 4096; } if (__min1___1 < __min2___1) { tmp___3 = __min1___1; } else { tmp___3 = __min2___1; } if (tmp___3 != rr) { { rv = 0; tmp___1 = get_current(); tmp___2 = signal_pending(tmp___1); } if (tmp___2 == 0) { __min1___0 = data_size; __min2___0 = 4096; if (__min1___0 < __min2___0) { tmp___0 = __min1___0; } else { tmp___0 = __min2___0; } { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving data: read %d expected %d\n", rr, tmp___0); } } else { } goto ldv_49494; } else { } data_size = data_size - rr; ldv_49496: ; if (data_size != 0) { goto ldv_49495; } else { goto ldv_49494; } ldv_49494: { kunmap(page); drbd_pp_free(mdev, page, 0); } return (rv); } } static int recv_dless_read(struct drbd_conf *mdev , struct drbd_request *req , sector_t sector , int data_size ) { struct bio_vec *bvec ; struct bio *bio ; int dgs ; int rr ; int i ; int expect ; void *dig_in ; void *dig_vv ; unsigned int tmp ; struct task_struct *tmp___0 ; int tmp___1 ; int __min1 ; int __min2 ; int tmp___2 ; void *tmp___3 ; struct task_struct *tmp___4 ; int tmp___5 ; int tmp___6 ; { dig_in = mdev->int_dig_in; dig_vv = mdev->int_dig_vv; if (mdev->agreed_pro_version > 86) { if ((unsigned long )mdev->integrity_r_tfm != (unsigned long )((struct crypto_hash *)0)) { { tmp = crypto_hash_digestsize(mdev->integrity_r_tfm); dgs = (int )tmp; } } else { dgs = 0; } } else { dgs = 0; } if (dgs != 0) { { rr = drbd_recv(mdev, dig_in, (size_t )dgs); } if (rr != dgs) { { tmp___0 = get_current(); tmp___1 = signal_pending(tmp___0); } if (tmp___1 == 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving data reply digest: read %d expected %d\n", rr, dgs); } } else { } return (0); } else { } } else { } data_size = data_size - dgs; mdev->recv_cnt = mdev->recv_cnt + (unsigned int )(data_size >> 9); bio = req->master_bio; if (bio->bi_sector != sector) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( sector == bio->bi_sector ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1386); } } else { } bvec = bio->bi_io_vec + (unsigned long )bio->bi_idx; i = (int )bio->bi_idx; goto ldv_49515; ldv_49514: __min1 = data_size; __min2 = (int )bvec->bv_len; if (__min1 < __min2) { tmp___2 = __min1; } else { tmp___2 = __min2; } { expect = tmp___2; tmp___3 = kmap(bvec->bv_page); rr = drbd_recv(mdev, tmp___3 + (unsigned long )bvec->bv_offset, (size_t )expect); kunmap(bvec->bv_page); } if (rr != expect) { { tmp___4 = get_current(); tmp___5 = signal_pending(tmp___4); } if (tmp___5 == 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving data reply: read %d expected %d\n", rr, expect); } } else { } return (0); } else { } data_size = data_size - rr; bvec = bvec + 1; i = i + 1; ldv_49515: ; if ((int )bio->bi_vcnt > i) { goto ldv_49514; } else { goto ldv_49516; } ldv_49516: ; if (dgs != 0) { { drbd_csum_bio(mdev, mdev->integrity_r_tfm, bio, dig_vv); tmp___6 = memcmp((void const *)dig_in, (void const *)dig_vv, (size_t )dgs); } if (tmp___6 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Digest integrity check FAILED. Broken NICs?\n"); } return (0); } else { } } else { } if (data_size != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( data_size == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1412); } } else { } return (1); } } static int e_end_resync_block(struct drbd_conf *mdev , struct drbd_work *w , int unused ) { struct drbd_epoch_entry *e ; sector_t sector ; int ok ; int tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; { { e = (struct drbd_epoch_entry *)w; sector = e->sector; tmp = hlist_unhashed((struct hlist_node const *)(& e->collision)); } if (tmp == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( hlist_unhashed(&e->collision) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1424); } } else { } { tmp___0 = __builtin_expect((long )((e->flags & 8UL) == 0UL), 1L); } if (tmp___0 != 0L) { { __drbd_set_in_sync(mdev, sector, (int )e->size, "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", (unsigned int const )1427U); ok = drbd_send_ack(mdev, (enum drbd_packets )23, e); } } else { { drbd_rs_failed_io(mdev, sector, (int )e->size); ok = drbd_send_ack(mdev, (enum drbd_packets )25, e); } } { atomic_dec(& mdev->unacked_cnt); tmp___2 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); } if (tmp___2 < 0) { { tmp___1 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: unacked_cnt = %d < 0 !\n", "e_end_resync_block", 1435, tmp___1); } } else { } return (ok); } } static int recv_resync_read(struct drbd_conf *mdev , sector_t sector , int data_size ) { struct drbd_epoch_entry *e ; int tmp ; int tmp___0 ; int tmp___1 ; { { e = read_in_block(mdev, 0x0fffffffffffffffULL, sector, data_size); } if ((unsigned long )e == (unsigned long )((struct drbd_epoch_entry *)0)) { goto fail; } else { } { atomic_dec(& mdev->rs_pending_cnt); tmp___0 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); } if (tmp___0 < 0) { { tmp = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "recv_resync_read", 1448, tmp); } } else { } { inc_unacked(mdev); e->w.cb = & e_end_resync_block; spin_lock_irq(& mdev->req_lock); list_add(& e->w.list, & mdev->sync_ee); spin_unlock_irq(& mdev->req_lock); atomic_add(data_size >> 9, & mdev->rs_sect_ev); tmp___1 = drbd_submit_ee(mdev, e, (unsigned int const )1U, (int const )2); } if (tmp___1 == 0) { return (1); } else { } { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "submit failed, triggering re-connect\n"); spin_lock_irq(& mdev->req_lock); list_del(& e->w.list); spin_unlock_irq(& mdev->req_lock); drbd_free_some_ee(mdev, e, 0); } fail: { put_ldev(mdev); } return (0); } } static int receive_DataReply(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { struct drbd_request *req ; sector_t sector ; int ok ; struct p_data *p ; __u64 tmp ; long tmp___0 ; { { p = & mdev->data.rbuf.data; tmp = __fswab64(p->sector); sector = (sector_t )tmp; spin_lock_irq(& mdev->req_lock); req = _ar_id_to_req(mdev, p->block_id, sector); spin_unlock_irq(& mdev->req_lock); tmp___0 = __builtin_expect((long )((unsigned long )req == (unsigned long )((struct drbd_request *)0)), 0L); } if (tmp___0 != 0L) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Got a corrupt block_id/sector pair(1).\n"); } return (0); } else { } { ok = recv_dless_read(mdev, req, sector, (int )data_size); } if (ok != 0) { { req_mod(req, (enum drbd_req_event )18); } } else { } return (ok); } } static int receive_RSDataReply(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { sector_t sector ; int ok ; struct p_data *p ; __u64 tmp ; int tmp___0 ; int tmp___1 ; { { p = & mdev->data.rbuf.data; tmp = __fswab64(p->sector); sector = (sector_t )tmp; } if (p->block_id != 0x0fffffffffffffffULL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( p->block_id == ID_SYNCER ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1514); } } else { } { tmp___1 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___1 != 0) { { ok = recv_resync_read(mdev, sector, (int )data_size); } } else { { tmp___0 = ___ratelimit(& drbd_ratelimit_state, "receive_RSDataReply"); } if (tmp___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Can not write resync data to local disk.\n"); } } else { } { ok = drbd_drain_block(mdev, (int )data_size); drbd_send_ack_dp(mdev, (enum drbd_packets )25, p, (int )data_size); } } { atomic_add((int )(data_size >> 9), & mdev->rs_sect_in); } return (ok); } } static int e_end_block(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_epoch_entry *e ; sector_t sector ; int ok ; int pcmd ; int tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { e = (struct drbd_epoch_entry *)w; sector = e->sector; ok = 1; if ((mdev->net_conf)->wire_protocol == 3) { { tmp___0 = __builtin_expect((long )((e->flags & 8UL) == 0UL), 1L); } if (tmp___0 != 0L) { if ((int )mdev->state.ldv_38339.conn > 15) { if ((int )mdev->state.ldv_38339.conn <= 21) { if ((e->flags & 2UL) != 0UL) { pcmd = 23; } else { pcmd = 22; } } else { pcmd = 22; } } else { pcmd = 22; } { tmp = drbd_send_ack(mdev, (enum drbd_packets )pcmd, e); ok = tmp & ok; } if (pcmd == 23) { { __drbd_set_in_sync(mdev, sector, (int )e->size, "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", (unsigned int const )1552U); } } else { } } else { { ok = drbd_send_ack(mdev, (enum drbd_packets )25, e); } } { atomic_dec(& mdev->unacked_cnt); tmp___2 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); } if (tmp___2 < 0) { { tmp___1 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: unacked_cnt = %d < 0 !\n", "e_end_block", 1558, tmp___1); } } else { } } else { } if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) != 0U) { { spin_lock_irq(& mdev->req_lock); tmp___3 = hlist_unhashed((struct hlist_node const *)(& e->collision)); } if (tmp___3 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !hlist_unhashed(&e->collision) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1564); } } else { } { hlist_del_init(& e->collision); spin_unlock_irq(& mdev->req_lock); } } else { { tmp___4 = hlist_unhashed((struct hlist_node const *)(& e->collision)); } if (tmp___4 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( hlist_unhashed(&e->collision) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1568); } } else { } } if (cancel != 0) { tmp___5 = 32; } else { tmp___5 = 0; } { drbd_may_finish_epoch(mdev, e->epoch, (enum epoch_event )tmp___5); } return (ok); } } static int e_send_discard_ack(struct drbd_conf *mdev , struct drbd_work *w , int unused ) { struct drbd_epoch_entry *e ; int ok ; int tmp ; int tmp___0 ; int tmp___1 ; { e = (struct drbd_epoch_entry *)w; ok = 1; if ((mdev->net_conf)->wire_protocol != 3) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->net_conf->wire_protocol == DRBD_PROT_C ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1581); } } else { } { ok = drbd_send_ack(mdev, (enum drbd_packets )24, e); spin_lock_irq(& mdev->req_lock); tmp = hlist_unhashed((struct hlist_node const *)(& e->collision)); } if (tmp != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !hlist_unhashed(&e->collision) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1585); } } else { } { hlist_del_init(& e->collision); spin_unlock_irq(& mdev->req_lock); atomic_dec(& mdev->unacked_cnt); tmp___1 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); } if (tmp___1 < 0) { { tmp___0 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: unacked_cnt = %d < 0 !\n", "e_send_discard_ack", 1589, tmp___0); } } else { } return (ok); } } static int drbd_wait_peer_seq(struct drbd_conf *mdev , u32 const packet_seq ) { wait_queue_t wait ; struct task_struct *tmp ; unsigned int p_seq ; long timeout ; int ret ; int tmp___0 ; struct task_struct *tmp___1 ; int tmp___2 ; { { tmp = get_current(); wait.flags = 0U; wait.private = (void *)tmp; wait.func = & autoremove_wake_function; wait.task_list.next = & wait.task_list; wait.task_list.prev = & wait.task_list; ret = 0; spin_lock(& mdev->peer_seq_lock); } ldv_49591: { prepare_to_wait(& mdev->seq_wait, & wait, 1); tmp___0 = seq_cmp((u32 )packet_seq, mdev->peer_seq + 1U); } if (tmp___0 <= 0) { goto ldv_49590; } else { } { tmp___1 = get_current(); tmp___2 = signal_pending(tmp___1); } if (tmp___2 != 0) { ret = -512; goto ldv_49590; } else { } { p_seq = mdev->peer_seq; spin_unlock(& mdev->peer_seq_lock); timeout = schedule_timeout(7500L); spin_lock(& mdev->peer_seq_lock); } if (timeout == 0L) { if (mdev->peer_seq == p_seq) { { ret = -110; dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED waited 30 seconds for sequence update, forcing reconnect\n"); } goto ldv_49590; } else { } } else { } goto ldv_49591; ldv_49590: { finish_wait(& mdev->seq_wait, & wait); } if (mdev->peer_seq + 1U == (unsigned int )packet_seq) { mdev->peer_seq = mdev->peer_seq + 1U; } else { } { spin_unlock(& mdev->peer_seq_lock); } return (ret); } } static unsigned long wire_flags_to_bio(struct drbd_conf *mdev , u32 dpf ) { int tmp ; int tmp___0 ; int tmp___1 ; { if ((dpf & 2U) != 0U) { tmp = 16; } else { tmp = 0; } if ((dpf & 16U) != 0U) { tmp___0 = 4096; } else { tmp___0 = 0; } if ((dpf & 32U) != 0U) { tmp___1 = 8388608; } else { tmp___1 = 0; } return ((unsigned long )(((tmp | tmp___0) | tmp___1) | ((int )dpf & 64))); } } static int receive_Data(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { sector_t sector ; struct drbd_epoch_entry *e ; struct p_data *p ; int rw ; u32 dp_flags ; __u32 tmp ; int tmp___0 ; int tmp___1 ; __u64 tmp___2 ; __u32 tmp___3 ; unsigned long tmp___4 ; int size ; int discard ; int tmp___5 ; wait_queue_t wait ; struct task_struct *tmp___6 ; struct drbd_request *i ; struct hlist_node *n ; struct hlist_head *slot ; int first ; long tmp___7 ; long tmp___8 ; __u32 tmp___9 ; int tmp___10 ; struct hlist_head *tmp___11 ; int have_unacked ; int have_conflict ; struct task_struct *tmp___12 ; struct task_struct *tmp___13 ; int tmp___14 ; struct hlist_node const *__mptr ; struct task_struct *tmp___15 ; int tmp___16 ; int tmp___17 ; { { p = & mdev->data.rbuf.data; rw = 1; tmp___1 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___1 == 0) { { spin_lock(& mdev->peer_seq_lock); tmp = __fswab32(p->seq_num); } if (mdev->peer_seq + 1U == tmp) { mdev->peer_seq = mdev->peer_seq + 1U; } else { } { spin_unlock(& mdev->peer_seq_lock); drbd_send_ack_dp(mdev, (enum drbd_packets )25, p, (int )data_size); atomic_inc(& (mdev->current_epoch)->epoch_size); tmp___0 = drbd_drain_block(mdev, (int )data_size); } return (tmp___0); } else { } { tmp___2 = __fswab64(p->sector); sector = (sector_t )tmp___2; e = read_in_block(mdev, p->block_id, sector, (int )data_size); } if ((unsigned long )e == (unsigned long )((struct drbd_epoch_entry *)0)) { { put_ldev(mdev); } return (0); } else { } { e->w.cb = & e_end_block; tmp___3 = __fswab32(p->dp_flags); dp_flags = tmp___3; tmp___4 = wire_flags_to_bio(mdev, dp_flags); rw = (int )((unsigned int )tmp___4 | (unsigned int )rw); } if ((dp_flags & 4U) != 0U) { e->flags = e->flags | 2UL; } else { } { spin_lock(& mdev->epoch_lock); e->epoch = mdev->current_epoch; atomic_inc(& (e->epoch)->epoch_size); atomic_inc(& (e->epoch)->active); spin_unlock(& mdev->epoch_lock); } if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) == 0U) { { spin_lock_irq(& mdev->req_lock); } } else { { size = (int )((int const )e->size); tmp___5 = constant_test_bit(6U, (unsigned long const volatile *)(& mdev->flags)); discard = tmp___5; tmp___6 = get_current(); wait.flags = 0U; wait.private = (void *)tmp___6; wait.func = & autoremove_wake_function; wait.task_list.next = & wait.task_list; wait.task_list.prev = & wait.task_list; } if ((mdev->net_conf)->wire_protocol != 3) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->net_conf->wire_protocol == DRBD_PROT_C ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1718); } } else { } { tmp___7 = __builtin_expect((long )((unsigned long )mdev->ee_hash == (unsigned long )((struct hlist_head *)0)), 0L); } if (tmp___7 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p"), "i" (1719), "i" (12UL)); ldv_49613: ; goto ldv_49613; } else { } { tmp___8 = __builtin_expect((long )((unsigned long )mdev->tl_hash == (unsigned long )((struct hlist_head *)0)), 0L); } if (tmp___8 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p"), "i" (1720), "i" (12UL)); ldv_49614: ; goto ldv_49614; } else { } { tmp___9 = __fswab32(p->seq_num); tmp___10 = drbd_wait_peer_seq(mdev, (u32 const )tmp___9); } if (tmp___10 != 0) { goto out_interrupted; } else { } { spin_lock_irq(& mdev->req_lock); tmp___11 = ee_hash_slot(mdev, sector); hlist_add_head(& e->collision, tmp___11); slot = tl_hash_slot(mdev, sector); first = 1; } ldv_49625: { have_unacked = 0; have_conflict = 0; prepare_to_wait(& mdev->misc_wait, & wait, 1); n = slot->first; } goto ldv_49622; ldv_49621: { tmp___14 = overlaps(i->sector, (int )i->size, sector, size); } if (tmp___14 != 0) { if (first != 0) { { tmp___12 = get_current(); tmp___13 = get_current(); dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s[%u] Concurrent local write detected!\tnew: %llus +%u; pending: %llus +%u\n", (char *)(& tmp___13->comm), tmp___12->pid, (unsigned long long )sector, size, (unsigned long long )i->sector, i->size); } } else { } if ((i->rq_state & 8UL) != 0UL) { have_unacked = have_unacked + 1; } else { } have_conflict = have_conflict + 1; } else { } n = n->next; ldv_49622: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)n; i = (struct drbd_request *)__mptr + 0x0fffffffffffffd8UL; goto ldv_49621; } else { goto ldv_49623; } ldv_49623: ; if (have_conflict == 0) { goto ldv_49624; } else { } if (first != 0) { if (discard != 0) { if (have_unacked != 0) { { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "Concurrent write! [DISCARD BY FLAG] sec=%llus\n", (unsigned long long )sector); inc_unacked(mdev); e->w.cb = & e_send_discard_ack; list_add_tail(& e->w.list, & mdev->done_ee); spin_unlock_irq(& mdev->req_lock); put_ldev(mdev); wake_asender(mdev); finish_wait(& mdev->misc_wait, & wait); } return (1); } else { } } else { } } else { } { tmp___15 = get_current(); tmp___16 = signal_pending(tmp___15); } if (tmp___16 != 0) { { hlist_del_init(& e->collision); spin_unlock_irq(& mdev->req_lock); finish_wait(& mdev->misc_wait, & wait); } goto out_interrupted; } else { } { spin_unlock_irq(& mdev->req_lock); } if (first != 0) { { first = 0; dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "Concurrent write! [W AFTERWARDS] sec=%llus\n", (unsigned long long )sector); } } else if (discard != 0) { if (have_unacked != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( have_unacked == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1826); } } else { } } else { } { schedule(); spin_lock_irq(& mdev->req_lock); } goto ldv_49625; ldv_49624: { finish_wait(& mdev->misc_wait, & wait); } } { list_add(& e->w.list, & mdev->active_ee); spin_unlock_irq(& mdev->req_lock); } if ((mdev->net_conf)->wire_protocol == 3) { goto case_3; } else if ((mdev->net_conf)->wire_protocol == 2) { goto case_2; } else if ((mdev->net_conf)->wire_protocol == 1) { goto case_1; } else if (0) { case_3: { inc_unacked(mdev); } goto ldv_49627; case_2: { drbd_send_ack(mdev, (enum drbd_packets )21, e); } goto ldv_49627; case_1: ; goto ldv_49627; } else { } ldv_49627: ; if ((int )mdev->state.ldv_38339.pdsk <= 3) { { __drbd_set_out_of_sync(mdev, e->sector, (int )e->size, "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", (unsigned int const )1855U); e->flags = e->flags | 1UL; e->flags = e->flags & 0x0ffffffffffffffdUL; drbd_al_begin_io(mdev, e->sector); } } else { } { tmp___17 = drbd_submit_ee(mdev, e, (unsigned int const )rw, (int const )4); } if (tmp___17 == 0) { return (1); } else { } { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "submit failed, triggering re-connect\n"); spin_lock_irq(& mdev->req_lock); list_del(& e->w.list); hlist_del_init(& e->collision); spin_unlock_irq(& mdev->req_lock); } if ((int )e->flags & 1) { { drbd_al_complete_io(mdev, e->sector); } } else { } out_interrupted: { drbd_may_finish_epoch(mdev, e->epoch, (enum epoch_event )32); put_ldev(mdev); drbd_free_some_ee(mdev, e, 0); } return (0); } } int drbd_rs_should_slow_down(struct drbd_conf *mdev , sector_t sector ) { struct gendisk *disk ; unsigned long db ; unsigned long dt ; unsigned long dbdt ; struct lc_element *tmp ; int curr_events ; int throttle ; struct bm_extent *bm_ext ; struct lc_element const *__mptr ; int tmp___0 ; unsigned long res ; unsigned int _cpu ; void const *__vpp_verify ; unsigned long __ptr ; unsigned long res___0 ; unsigned int _cpu___0 ; void const *__vpp_verify___0 ; unsigned long __ptr___0 ; int tmp___1 ; unsigned long rs_left ; int i ; unsigned long tmp___2 ; { disk = (((mdev->ldev)->backing_bdev)->bd_contains)->bd_disk; throttle = 0; if (mdev->sync_conf.c_min_rate == 0) { return (0); } else { } { spin_lock_irq(& mdev->al_lock); tmp = lc_find(mdev->resync, (unsigned int )(sector >> 15)); } if ((unsigned long )tmp != (unsigned long )((struct lc_element *)0)) { { __mptr = (struct lc_element const *)tmp; bm_ext = (struct bm_extent *)__mptr + 0x0ffffffffffffff0UL; tmp___0 = constant_test_bit(2U, (unsigned long const volatile *)(& bm_ext->flags)); } if (tmp___0 != 0) { { spin_unlock_irq(& mdev->al_lock); } return (0); } else { } } else { } { spin_unlock_irq(& mdev->al_lock); res = 0UL; _cpu = 4294967295U; } goto ldv_49651; ldv_49650: __vpp_verify = (void const *)0; __asm__ ("": "=r" (__ptr): "0" (disk->part0.dkstats)); res = ((struct disk_stats *)(__per_cpu_offset[_cpu] + __ptr))->sectors[0] + res; ldv_49651: { _cpu = cpumask_next((int )_cpu, (struct cpumask const *)cpu_possible_mask); } if ((unsigned int )nr_cpu_ids > _cpu) { goto ldv_49650; } else { goto ldv_49652; } ldv_49652: res___0 = 0UL; _cpu___0 = 4294967295U; goto ldv_49661; ldv_49660: __vpp_verify___0 = (void const *)0; __asm__ ("": "=r" (__ptr___0): "0" (disk->part0.dkstats)); res___0 = ((struct disk_stats *)(__per_cpu_offset[_cpu___0] + __ptr___0))->sectors[1] + res___0; ldv_49661: { _cpu___0 = cpumask_next((int )_cpu___0, (struct cpumask const *)cpu_possible_mask); } if ((unsigned int )nr_cpu_ids > _cpu___0) { goto ldv_49660; } else { goto ldv_49662; } ldv_49662: { tmp___1 = atomic_read((atomic_t const *)(& mdev->rs_sect_ev)); curr_events = ((int )res + (int )res___0) - tmp___1; } if (mdev->rs_last_events == 0) { goto _L; } else if (curr_events - mdev->rs_last_events > 64) { _L: mdev->rs_last_events = curr_events; i = (mdev->rs_last_mark + 7) % 8; if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 288U) { rs_left = mdev->ov_left; } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 304U) { rs_left = mdev->ov_left; } else { { tmp___2 = drbd_bm_total_weight(mdev); rs_left = tmp___2 - mdev->rs_failed; } } dt = (unsigned long )(((long )jiffies - (long )mdev->rs_mark_time[i]) / 250L); if (dt == 0UL) { dt = dt + 1UL; } else { } db = mdev->rs_mark_left[i] - rs_left; dbdt = db / dt << 2; if ((unsigned long )mdev->sync_conf.c_min_rate < dbdt) { throttle = 1; } else { } } else { } return (throttle); } } static int receive_DataRequest(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int digest_size ) { sector_t sector ; sector_t capacity ; sector_t tmp ; struct drbd_epoch_entry *e ; struct digest_info *di ; int size ; int verb ; unsigned int fault_type ; struct p_block_req *p ; __u64 tmp___0 ; __u32 tmp___1 ; int tmp___2 ; int tmp___3 ; char const *tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; void *tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; unsigned long now ; int i ; unsigned long tmp___12 ; char const *tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; { { tmp = drbd_get_capacity(mdev->this_bdev); capacity = tmp; di = (struct digest_info *)0; p = & mdev->data.rbuf.block_req; tmp___0 = __fswab64(p->sector); sector = (sector_t )tmp___0; tmp___1 = __fswab32(p->blksize); size = (int )tmp___1; } if (size <= 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s:%d: sector: %llus, size: %u\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1961, (unsigned long long )sector, size); } return (0); } else if ((size & 511) != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s:%d: sector: %llus, size: %u\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1961, (unsigned long long )sector, size); } return (0); } else if ((unsigned int )size > 131072U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s:%d: sector: %llus, size: %u\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1961, (unsigned long long )sector, size); } return (0); } else { } if ((sector_t )(size >> 9) + sector > capacity) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s:%d: sector: %llus, size: %u\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 1966, (unsigned long long )sector, size); } return (0); } else { } { tmp___7 = _get_ldev_if_state(mdev, (enum drbd_disk_state )8); } if (tmp___7 == 0) { verb = 1; if ((int )((unsigned int )cmd) == 8) { goto case_8; } else if ((int )((unsigned int )cmd) == 9) { goto case_9; } else if ((int )((unsigned int )cmd) == 33) { goto case_33; } else if ((int )((unsigned int )cmd) == 30) { goto case_30; } else if ((int )((unsigned int )cmd) == 31) { goto case_31; } else { goto switch_default; if (0) { case_8: { drbd_send_ack_rp(mdev, (enum drbd_packets )26, p); } goto ldv_49680; case_9: ; case_33: ; case_30: { drbd_send_ack_rp(mdev, (enum drbd_packets )27, p); } goto ldv_49680; case_31: { verb = 0; atomic_dec(& mdev->rs_pending_cnt); tmp___3 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); } if (tmp___3 < 0) { { tmp___2 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "receive_DataRequest", 1984, tmp___2); } } else { } { drbd_send_ack_ex(mdev, (enum drbd_packets )32, sector, size, 4711ULL); } goto ldv_49680; switch_default: { tmp___4 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "unexpected command (%s) in receive_DataRequest\n", tmp___4); } } else { } } ldv_49680: ; if (verb != 0) { { tmp___5 = ___ratelimit(& drbd_ratelimit_state, "receive_DataRequest"); } if (tmp___5 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Can not satisfy peer\'s read request, no local data.\n"); } } else { } } else { } { tmp___6 = drbd_drain_block(mdev, (int )digest_size); } return (tmp___6); } else { } { e = drbd_alloc_ee(mdev, p->block_id, sector, (unsigned int )size, 16U); } if ((unsigned long )e == (unsigned long )((struct drbd_epoch_entry *)0)) { { put_ldev(mdev); } return (0); } else { } if ((int )((unsigned int )cmd) == 8) { goto case_8___0; } else if ((int )((unsigned int )cmd) == 9) { goto case_9___0; } else if ((int )((unsigned int )cmd) == 31) { goto case_31___0; } else if ((int )((unsigned int )cmd) == 33) { goto case_33___0; } else if ((int )((unsigned int )cmd) == 30) { goto case_30___0; } else { goto switch_default___0; if (0) { case_8___0: e->w.cb = & w_e_end_data_req; fault_type = 5U; goto submit; case_9___0: e->w.cb = & w_e_end_rsdata_req; fault_type = 3U; mdev->bm_resync_fo = sector >> 3; goto ldv_49693; case_31___0: ; case_33___0: { fault_type = 3U; tmp___8 = kmalloc((unsigned long )digest_size + 16UL, 16U); di = (struct digest_info *)tmp___8; } if ((unsigned long )di == (unsigned long )((struct digest_info *)0)) { goto out_free_e; } else { } { di->digest_size = (int )digest_size; di->digest = (void *)di + 16U; e->ldv_46600.digest = di; e->flags = e->flags | 16UL; tmp___9 = drbd_recv(mdev, di->digest, (size_t )digest_size); } if ((unsigned int )tmp___9 != digest_size) { goto out_free_e; } else { } if ((unsigned int )cmd == 33U) { if (mdev->agreed_pro_version <= 88) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->agreed_pro_version >= 89 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 2039); } } else { } e->w.cb = & w_e_end_csum_rs_req; mdev->bm_resync_fo = sector >> 3; } else if ((unsigned int )cmd == 31U) { { atomic_add(size >> 9, & mdev->rs_sect_in); e->w.cb = & w_e_end_ov_reply; atomic_dec(& mdev->rs_pending_cnt); tmp___11 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); } if (tmp___11 < 0) { { tmp___10 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "receive_DataRequest", 2047, tmp___10); } } else { } goto submit_for_resync; } else { } goto ldv_49693; case_30___0: ; if (mdev->ov_start_sector == 0x0fffffffffffffffUL) { if (mdev->agreed_pro_version > 89) { { now = (unsigned long )jiffies; mdev->ov_start_sector = sector; mdev->ov_position = sector; tmp___12 = drbd_bm_bits(mdev); mdev->ov_left = tmp___12 - (sector >> 3); mdev->rs_total = mdev->ov_left; i = 0; } goto ldv_49705; ldv_49704: mdev->rs_mark_left[i] = mdev->ov_left; mdev->rs_mark_time[i] = now; i = i + 1; ldv_49705: ; if (i <= 7) { goto ldv_49704; } else { goto ldv_49706; } ldv_49706: { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Online Verify start sector: %llu\n", (unsigned long long )sector); } } else { } } else { } e->w.cb = & w_e_end_ov_req; fault_type = 3U; goto ldv_49693; switch_default___0: { tmp___13 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "unexpected command (%s) in receive_DataRequest\n", tmp___13); fault_type = 10U; } goto out_free_e; } else { } } ldv_49693: ; if ((unsigned int )*((unsigned char *)mdev + 2276UL) != 4U) { { tmp___14 = drbd_rs_should_slow_down(mdev, sector); } if (tmp___14 != 0) { { schedule_timeout_uninterruptible(25L); } } else { } } else { } { tmp___15 = drbd_rs_begin_io(mdev, sector); } if (tmp___15 != 0) { goto out_free_e; } else { } submit_for_resync: { atomic_add(size >> 9, & mdev->rs_sect_ev); } submit: { inc_unacked(mdev); spin_lock_irq(& mdev->req_lock); list_add_tail(& e->w.list, & mdev->read_ee); spin_unlock_irq(& mdev->req_lock); tmp___16 = drbd_submit_ee(mdev, e, (unsigned int const )0U, (int const )fault_type); } if (tmp___16 == 0) { return (1); } else { } { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "submit failed, triggering re-connect\n"); spin_lock_irq(& mdev->req_lock); list_del(& e->w.list); spin_unlock_irq(& mdev->req_lock); } out_free_e: { put_ldev(mdev); drbd_free_some_ee(mdev, e, 0); } return (0); } } static int drbd_asb_recover_0p(struct drbd_conf *mdev ) { int self ; int peer ; int rv ; unsigned long ch_self ; unsigned long ch_peer ; int tmp___0 ; int tmp___2 ; { rv = -100; self = (int )(mdev->ldev)->md.uuid[1] & 1; peer = (int )*(mdev->p_uuid + 1UL) & 1; ch_peer = (unsigned long )*(mdev->p_uuid + 4UL); ch_self = mdev->comm_bm_set; if ((mdev->net_conf)->after_sb_0p == 7) { goto case_7; } else if ((mdev->net_conf)->after_sb_0p == 8) { goto case_8; } else if ((mdev->net_conf)->after_sb_0p == 9) { goto case_9; } else if ((mdev->net_conf)->after_sb_0p == 0) { goto case_0; } else if ((mdev->net_conf)->after_sb_0p == 1) { goto case_1; } else if ((mdev->net_conf)->after_sb_0p == 2) { goto case_2; } else if ((mdev->net_conf)->after_sb_0p == 3) { goto case_3; } else if ((mdev->net_conf)->after_sb_0p == 4) { goto case_4; } else if ((mdev->net_conf)->after_sb_0p == 5) { goto case_5; } else if ((mdev->net_conf)->after_sb_0p == 6) { goto case_6; } else if (0) { case_7: ; case_8: ; case_9: { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Configuration error.\n"); } goto ldv_49719; case_0: ; goto ldv_49719; case_1: ; if (self == 0) { if (peer == 1) { rv = -1; goto ldv_49719; } else { } } else { } if (self == 1) { if (peer == 0) { rv = 1; goto ldv_49719; } else { } } else { } case_2: ; if (self == 0) { if (peer == 1) { rv = 1; goto ldv_49719; } else { } } else { } if (self == 1) { if (peer == 0) { rv = -1; goto ldv_49719; } else { } } else { } { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Discard younger/older primary did not find a decision\nUsing discard-least-changes instead\n"); } case_3: ; if (ch_peer == 0UL) { if (ch_self == 0UL) { { tmp___0 = constant_test_bit(6U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___0 != 0) { rv = -1; } else { rv = 1; } goto ldv_49719; } else { goto _L; } } else { _L: if (ch_peer == 0UL) { rv = 1; goto ldv_49719; } else { } if (ch_self == 0UL) { rv = -1; goto ldv_49719; } else { } } if ((mdev->net_conf)->after_sb_0p == 3) { goto ldv_49719; } else { } case_4: ; if (ch_self < ch_peer) { rv = -1; } else if (ch_self > ch_peer) { rv = 1; } else { { tmp___2 = constant_test_bit(6U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___2 != 0) { rv = -1; } else { rv = 1; } } goto ldv_49719; case_5: rv = -1; goto ldv_49719; case_6: rv = 1; } else { } ldv_49719: ; return (rv); } } static int drbd_asb_recover_1p(struct drbd_conf *mdev ) { int hg ; int rv ; int tmp ; enum drbd_state_rv rv2 ; union drbd_state val ; union drbd_state mask ; { rv = -100; if ((mdev->net_conf)->after_sb_1p == 1) { goto case_1; } else if ((mdev->net_conf)->after_sb_1p == 2) { goto case_2; } else if ((mdev->net_conf)->after_sb_1p == 4) { goto case_4; } else if ((mdev->net_conf)->after_sb_1p == 5) { goto case_5; } else if ((mdev->net_conf)->after_sb_1p == 6) { goto case_6; } else if ((mdev->net_conf)->after_sb_1p == 0) { goto case_0; } else if ((mdev->net_conf)->after_sb_1p == 7) { goto case_7; } else if ((mdev->net_conf)->after_sb_1p == 10) { goto case_10; } else if ((mdev->net_conf)->after_sb_1p == 8) { goto case_8; } else if ((mdev->net_conf)->after_sb_1p == 9) { goto case_9; } else if (0) { case_1: ; case_2: ; case_4: ; case_5: ; case_6: { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Configuration error.\n"); } goto ldv_49737; case_0: ; goto ldv_49737; case_7: { hg = drbd_asb_recover_0p(mdev); } if (hg == -1) { if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 2U) { rv = hg; } else { } } else { } if (hg == 1) { if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { rv = hg; } else { } } else { } goto ldv_49737; case_10: { rv = drbd_asb_recover_0p(mdev); } goto ldv_49737; case_8: ; if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { tmp = 1; } else { tmp = -1; } return (tmp); case_9: { hg = drbd_asb_recover_0p(mdev); } if (hg == -1) { if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { { drbd_set_role(mdev, (enum drbd_role )2, 0); val.i = 0U; val.ldv_38339.role = (unsigned char)2; mask.i = 0U; mask.ldv_38339.role = (unsigned char)3; rv2 = drbd_change_state(mdev, (enum chg_state_flags )2, mask, val); } if ((int )rv2 != 1) { { drbd_khelper(mdev, (char *)"pri-lost-after-sb"); } } else { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Successfully gave up primary role.\n"); rv = hg; } } } else { rv = hg; } } else { rv = hg; } } else { } ldv_49737: ; return (rv); } } static int drbd_asb_recover_2p(struct drbd_conf *mdev ) { int hg ; int rv ; enum drbd_state_rv rv2 ; union drbd_state val ; union drbd_state mask ; { rv = -100; if ((mdev->net_conf)->after_sb_2p == 1) { goto case_1; } else if ((mdev->net_conf)->after_sb_2p == 2) { goto case_2; } else if ((mdev->net_conf)->after_sb_2p == 4) { goto case_4; } else if ((mdev->net_conf)->after_sb_2p == 5) { goto case_5; } else if ((mdev->net_conf)->after_sb_2p == 6) { goto case_6; } else if ((mdev->net_conf)->after_sb_2p == 7) { goto case_7; } else if ((mdev->net_conf)->after_sb_2p == 8) { goto case_8; } else if ((mdev->net_conf)->after_sb_2p == 10) { goto case_10; } else if ((mdev->net_conf)->after_sb_2p == 0) { goto case_0; } else if ((mdev->net_conf)->after_sb_2p == 9) { goto case_9; } else if (0) { case_1: ; case_2: ; case_4: ; case_5: ; case_6: ; case_7: ; case_8: { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Configuration error.\n"); } goto ldv_49760; case_10: { rv = drbd_asb_recover_0p(mdev); } goto ldv_49760; case_0: ; goto ldv_49760; case_9: { hg = drbd_asb_recover_0p(mdev); } if (hg == -1) { { val.i = 0U; val.ldv_38339.role = (unsigned char)2; mask.i = 0U; mask.ldv_38339.role = (unsigned char)3; rv2 = drbd_change_state(mdev, (enum chg_state_flags )2, mask, val); } if ((int )rv2 != 1) { { drbd_khelper(mdev, (char *)"pri-lost-after-sb"); } } else { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Successfully gave up primary role.\n"); rv = hg; } } } else { rv = hg; } } else { } ldv_49760: ; return (rv); } } static void drbd_uuid_dump(struct drbd_conf *mdev , char *text , u64 *uuid , u64 bits , u64 flags ) { { if ((unsigned long )uuid == (unsigned long )((u64 *)0)) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s uuid info vanished while I was looking!\n", text); } return; } else { } { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s %016llX:%016llX:%016llX:%016llX bits:%llu flags:%llX\n", text, *uuid, *(uuid + 1UL), *(uuid + 2UL), *(uuid + 3UL), bits, flags); } return; } } static int drbd_uuid_compare(struct drbd_conf *mdev , int *rule_nr ) { u64 self ; u64 peer ; int i ; int j ; int rct ; int dc ; unsigned long tmp ; u64 tmp___0 ; unsigned int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; unsigned long tmp___6 ; u64 tmp___7 ; int tmp___8 ; { self = (mdev->ldev)->md.uuid[0] & 0x0ffffffffffffffeULL; peer = *(mdev->p_uuid) & 0x0ffffffffffffffeULL; *rule_nr = 10; if (self == 4ULL) { if (peer == 4ULL) { return (0); } else { } } else { } *rule_nr = 20; if (self == 4ULL) { goto _L; } else if (self == 0ULL) { _L: if (peer != 4ULL) { return (-2); } else { } } else { } *rule_nr = 30; if (self != 4ULL) { if (peer == 4ULL) { return (2); } else if (peer == 0ULL) { return (2); } else { } } else { } if (self == peer) { if (*(mdev->p_uuid + 1UL) == 0ULL) { if ((mdev->ldev)->md.uuid[1] != 0ULL) { if (mdev->agreed_pro_version <= 90) { return (-1091); } else { } if ((((mdev->ldev)->md.uuid[1] ^ *(mdev->p_uuid + 2UL)) & 0x0ffffffffffffffeULL) == 0ULL) { if ((((mdev->ldev)->md.uuid[2] ^ *(mdev->p_uuid + 3UL)) & 0x0ffffffffffffffeULL) == 0ULL) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "was SyncSource, missed the resync finished event, corrected myself:\n"); drbd_uuid_set_bm(mdev, 0ULL); } if ((int )mdev->state.ldv_38339.disk > 2) { { tmp = drbd_bm_total_weight(mdev); tmp___0 = (u64 )tmp; } } else { tmp___0 = 0ULL; } { drbd_uuid_dump(mdev, (char *)"self", (u64 *)(& (mdev->ldev)->md.uuid), tmp___0, 0ULL); *rule_nr = 34; } } else { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "was SyncSource (peer failed to write sync_uuid)\n"); *rule_nr = 36; } } } else { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "was SyncSource (peer failed to write sync_uuid)\n"); *rule_nr = 36; } } return (1); } else { } } else { } if ((mdev->ldev)->md.uuid[1] == 0ULL) { if (*(mdev->p_uuid + 1UL) != 0ULL) { if (mdev->agreed_pro_version <= 90) { return (-1091); } else { } if ((((mdev->ldev)->md.uuid[2] ^ *(mdev->p_uuid + 1UL)) & 0x0ffffffffffffffeULL) == 0ULL) { if ((((mdev->ldev)->md.uuid[3] ^ *(mdev->p_uuid + 2UL)) & 0x0ffffffffffffffeULL) == 0ULL) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "was SyncTarget, peer missed the resync finished event, corrected peer:\n"); *(mdev->p_uuid + 3UL) = *(mdev->p_uuid + 2UL); *(mdev->p_uuid + 2UL) = *(mdev->p_uuid + 1UL); *(mdev->p_uuid + 1UL) = 0ULL; drbd_uuid_dump(mdev, (char *)"peer", mdev->p_uuid, *(mdev->p_uuid + 4UL), *(mdev->p_uuid + 5UL)); *rule_nr = 35; } } else { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "was SyncTarget (failed to write sync_uuid)\n"); *rule_nr = 37; } } } else { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "was SyncTarget (failed to write sync_uuid)\n"); *rule_nr = 37; } } return (-1); } else { } } else { } { tmp___3 = constant_test_bit(11U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___3 != 0) { tmp___2 = 1U; } else { tmp___2 = 0U; } rct = (int )(tmp___2 + ((unsigned int )*(mdev->p_uuid + 5UL) & 2U)); *rule_nr = 40; if (rct == 0) { goto case_0; } else if (rct == 1) { goto case_1; } else if (rct == 2) { goto case_2; } else if (rct == 3) { goto case_3; } else if (0) { case_0: ; return (0); case_1: ; return (1); case_2: ; return (-1); case_3: { dc = constant_test_bit(6U, (unsigned long const volatile *)(& mdev->flags)); } if (dc != 0) { tmp___4 = -1; } else { tmp___4 = 1; } return (tmp___4); } else { } } else { } *rule_nr = 50; peer = *(mdev->p_uuid + 1UL) & 0x0ffffffffffffffeULL; if (self == peer) { return (-1); } else { } *rule_nr = 51; peer = *(mdev->p_uuid + 2UL) & 0x0ffffffffffffffeULL; if (self == peer) { if (mdev->agreed_pro_version <= 95) { tmp___5 = (((mdev->ldev)->md.uuid[2] ^ *(mdev->p_uuid + 3UL)) & 0x0ffffffffffffffeULL) == 0ULL; } else { tmp___5 = peer + 281474976710656ULL == (*(mdev->p_uuid + 1UL) & 0x0ffffffffffffffeULL); } if (tmp___5) { if (mdev->agreed_pro_version <= 90) { return (-1091); } else { } { *(mdev->p_uuid + 1UL) = *(mdev->p_uuid + 2UL); *(mdev->p_uuid + 2UL) = *(mdev->p_uuid + 3UL); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Did not got last syncUUID packet, corrected:\n"); drbd_uuid_dump(mdev, (char *)"peer", mdev->p_uuid, *(mdev->p_uuid + 4UL), *(mdev->p_uuid + 5UL)); } return (-1); } else { } } else { } *rule_nr = 60; self = (mdev->ldev)->md.uuid[0] & 0x0ffffffffffffffeULL; i = 2; goto ldv_49791; ldv_49790: peer = *(mdev->p_uuid + (unsigned long )i) & 0x0ffffffffffffffeULL; if (self == peer) { return (-2); } else { } i = i + 1; ldv_49791: ; if (i <= 3) { goto ldv_49790; } else { goto ldv_49792; } ldv_49792: *rule_nr = 70; self = (mdev->ldev)->md.uuid[1] & 0x0ffffffffffffffeULL; peer = *(mdev->p_uuid) & 0x0ffffffffffffffeULL; if (self == peer) { return (1); } else { } *rule_nr = 71; self = (mdev->ldev)->md.uuid[2] & 0x0ffffffffffffffeULL; if (self == peer) { if (mdev->agreed_pro_version <= 95) { tmp___8 = (((mdev->ldev)->md.uuid[3] ^ *(mdev->p_uuid + 2UL)) & 0x0ffffffffffffffeULL) == 0ULL; } else { tmp___8 = self + 281474976710656ULL == ((mdev->ldev)->md.uuid[1] & 0x0ffffffffffffffeULL); } if (tmp___8) { if (mdev->agreed_pro_version <= 90) { return (-1091); } else { } { _drbd_uuid_set(mdev, 1, (mdev->ldev)->md.uuid[2]); _drbd_uuid_set(mdev, 2, (mdev->ldev)->md.uuid[3]); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Last syncUUID did not get through, corrected:\n"); } if ((int )mdev->state.ldv_38339.disk > 2) { { tmp___6 = drbd_bm_total_weight(mdev); tmp___7 = (u64 )tmp___6; } } else { tmp___7 = 0ULL; } { drbd_uuid_dump(mdev, (char *)"self", (u64 *)(& (mdev->ldev)->md.uuid), tmp___7, 0ULL); } return (1); } else { } } else { } *rule_nr = 80; peer = *(mdev->p_uuid) & 0x0ffffffffffffffeULL; i = 2; goto ldv_49794; ldv_49793: self = (mdev->ldev)->md.uuid[i] & 0x0ffffffffffffffeULL; if (self == peer) { return (2); } else { } i = i + 1; ldv_49794: ; if (i <= 3) { goto ldv_49793; } else { goto ldv_49795; } ldv_49795: *rule_nr = 90; self = (mdev->ldev)->md.uuid[1] & 0x0ffffffffffffffeULL; peer = *(mdev->p_uuid + 1UL) & 0x0ffffffffffffffeULL; if (self == peer) { if (self != 0ULL) { return (100); } else { } } else { } *rule_nr = 100; i = 2; goto ldv_49800; ldv_49799: self = (mdev->ldev)->md.uuid[i] & 0x0ffffffffffffffeULL; j = 2; goto ldv_49797; ldv_49796: peer = *(mdev->p_uuid + (unsigned long )j) & 0x0ffffffffffffffeULL; if (self == peer) { return (-100); } else { } j = j + 1; ldv_49797: ; if (j <= 3) { goto ldv_49796; } else { goto ldv_49798; } ldv_49798: i = i + 1; ldv_49800: ; if (i <= 3) { goto ldv_49799; } else { goto ldv_49801; } ldv_49801: ; return (-1000); } } static enum drbd_conns drbd_sync_handshake(struct drbd_conf *mdev , enum drbd_role peer_role , enum drbd_disk_state peer_disk ) { int hg ; int rule_nr ; enum drbd_conns rv ; enum drbd_disk_state mydisk ; int f ; long ret ; int __x___0 ; int tmp ; int tmp___0 ; char *tmp___1 ; long ret___0 ; int __x___2 ; int tmp___2 ; int pcount ; int forced ; char *tmp___3 ; long ret___1 ; int __x___4 ; int tmp___4 ; char *tmp___5 ; long ret___2 ; int __x___6 ; int tmp___6 ; char *tmp___8 ; long ret___4 ; int __x___10 ; int tmp___9 ; int tmp___10 ; char const *tmp___11 ; int tmp___12 ; int tmp___13 ; long ret___5 ; int __x___12 ; int tmp___14 ; unsigned long tmp___15 ; unsigned long tmp___16 ; { rv = (enum drbd_conns )31; mydisk = (enum drbd_disk_state )mdev->state.ldv_38339.disk; if ((unsigned int )mydisk == 3U) { mydisk = (enum drbd_disk_state )mdev->new_state_tmp.ldv_38339.disk; } else { } { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_sync_handshake:\n"); drbd_uuid_dump(mdev, (char *)"self", (u64 *)(& (mdev->ldev)->md.uuid), (u64 )mdev->comm_bm_set, 0ULL); drbd_uuid_dump(mdev, (char *)"peer", mdev->p_uuid, *(mdev->p_uuid + 4UL), *(mdev->p_uuid + 5UL)); hg = drbd_uuid_compare(mdev, & rule_nr); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "uuid_compare()=%d by rule %d\n", hg, rule_nr); } if (hg == -1000) { { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unrelated data, aborting!\n"); } return ((enum drbd_conns )31); } else { } if (hg < -1000) { { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "To resolve this both sides have to support at least protocol %d\n", -1000 - hg); } return ((enum drbd_conns )31); } else { } if ((unsigned int )mydisk == 4U) { if ((unsigned int )peer_disk > 4U) { goto _L; } else { goto _L___0; } } else _L___0: if ((unsigned int )peer_disk == 4U) { if ((unsigned int )mydisk > 4U) { _L: if (hg == -100) { tmp___0 = 1; } else { __x___0 = hg; if (__x___0 < 0) { tmp = - __x___0; } else { tmp = __x___0; } ret = (long )tmp; if (ret == 2L) { tmp___0 = 1; } else { tmp___0 = 0; } } f = tmp___0; if ((unsigned int )mydisk > 4U) { hg = 1; } else { hg = -1; } if (f != 0) { hg = hg * 2; } else { } if (hg > 0) { tmp___1 = (char *)"source"; } else { tmp___1 = (char *)"target"; } { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Becoming sync %s due to disk states.\n", tmp___1); } } else { } } else { } __x___2 = hg; if (__x___2 < 0) { tmp___2 = - __x___2; } else { tmp___2 = __x___2; } ret___0 = (long )tmp___2; if (ret___0 == 100L) { { drbd_khelper(mdev, (char *)"initial-split-brain"); } } else { } if (hg == 100) { goto _L___1; } else if (hg == -100) { if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) != 0U) { _L___1: pcount = ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) + ((unsigned int )peer_role == 1U); forced = hg == -100; if (pcount == 0) { goto case_0; } else if (pcount == 1) { goto case_1; } else if (pcount == 2) { goto case_2; } else if (0) { case_0: { hg = drbd_asb_recover_0p(mdev); } goto ldv_49823; case_1: { hg = drbd_asb_recover_1p(mdev); } goto ldv_49823; case_2: { hg = drbd_asb_recover_2p(mdev); } goto ldv_49823; } else { } ldv_49823: __x___4 = hg; if (__x___4 < 0) { tmp___4 = - __x___4; } else { tmp___4 = __x___4; } ret___1 = (long )tmp___4; if (ret___1 <= 99L) { if (hg < 0) { tmp___3 = (char *)"peer"; } else { tmp___3 = (char *)"this"; } { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Split-Brain detected, %d primaries, automatically solved. Sync from %s node\n", pcount, tmp___3); } if (forced != 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Doing a full sync, since UUIDs where ambiguous.\n"); hg = hg * 2; } } else { } } else { } } else { } } else { } if (hg == -100) { if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) != 0U) { if ((*(mdev->p_uuid + 5UL) & 1ULL) == 0ULL) { hg = -1; } else { } } else { } if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) == 0U) { if ((int )*(mdev->p_uuid + 5UL) & 1) { hg = 1; } else { } } else { } __x___6 = hg; if (__x___6 < 0) { tmp___6 = - __x___6; } else { tmp___6 = __x___6; } ret___2 = (long )tmp___6; if (ret___2 <= 99L) { if (hg < 0) { tmp___5 = (char *)"peer"; } else { tmp___5 = (char *)"this"; } { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Split-Brain detected, manually solved. Sync from %s node\n", tmp___5); } } else { } } else { } if (hg == -100) { { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "Split-Brain detected but unresolved, dropping connection!\n"); drbd_khelper(mdev, (char *)"split-brain"); } return ((enum drbd_conns )31); } else { } if (hg > 0) { if ((unsigned int )mydisk <= 4U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "I shall become SyncSource, but I am inconsistent!\n"); } return ((enum drbd_conns )31); } else { } } else { } if (hg < 0) { if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { if ((int )mdev->state.ldv_38339.disk > 6) { if ((mdev->net_conf)->rr_conflict == 9) { goto case_9; } else if ((mdev->net_conf)->rr_conflict == 0) { goto case_0___0; } else if ((mdev->net_conf)->rr_conflict == 10) { goto case_10; } else if (0) { case_9: { drbd_khelper(mdev, (char *)"pri-lost"); } case_0___0: { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "I shall become SyncTarget, but I am primary!\n"); } return ((enum drbd_conns )31); case_10: { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Becoming SyncTarget, violating the stable-dataassumption\n"); } } else { } } else { } } else { } } else { } if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) != 0U) { goto _L___2; } else { { tmp___12 = constant_test_bit(25U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___12 != 0) { _L___2: if (hg == 0) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "dry-run connect: No resync, would become Connected immediately.\n"); } } else { __x___10 = hg; if (__x___10 < 0) { tmp___9 = - __x___10; } else { tmp___9 = __x___10; } ret___4 = (long )tmp___9; if (ret___4 > 1L) { tmp___8 = (char *)"full"; } else { tmp___8 = (char *)"bit-map based"; } if (hg > 0) { tmp___10 = 16; } else { tmp___10 = 17; } { tmp___11 = drbd_conn_str((enum drbd_conns )tmp___10); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "dry-run connect: Would become %s, doing a %s resync.", tmp___11, tmp___8); } } return ((enum drbd_conns )31); } else { } } __x___12 = hg; if (__x___12 < 0) { tmp___14 = - __x___12; } else { tmp___14 = __x___12; } ret___5 = (long )tmp___14; if (ret___5 > 1L) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Writing the whole bitmap, full sync required after drbd_sync_handshake.\n"); tmp___13 = drbd_bitmap_io(mdev, & drbd_bmio_set_n_write, (char *)"set_n_write from sync_handshake", (enum bm_flag )1); } if (tmp___13 != 0) { return ((enum drbd_conns )31); } else { } } else { } if (hg > 0) { rv = (enum drbd_conns )13; } else if (hg < 0) { rv = (enum drbd_conns )14; } else { { rv = (enum drbd_conns )10; tmp___16 = drbd_bm_total_weight(mdev); } if (tmp___16 != 0UL) { { tmp___15 = drbd_bm_total_weight(mdev); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "No resync, but %lu bits in bitmap!\n", tmp___15); } } else { } } return (rv); } } static int cmp_after_sb(enum drbd_after_sb_p peer , enum drbd_after_sb_p self ) { { if ((unsigned int )peer == 6U) { if ((unsigned int )self == 5U) { return (0); } else { goto _L; } } else _L: if ((unsigned int )self == 6U) { if ((unsigned int )peer == 5U) { return (0); } else { } } else { } if ((unsigned int )peer == 6U) { return (1); } else if ((unsigned int )peer == 5U) { return (1); } else if ((unsigned int )self == 6U) { return (1); } else if ((unsigned int )self == 5U) { return (1); } else { } if ((unsigned int )peer == (unsigned int )self) { return (0); } else { } return (1); } } static int receive_protocol(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { struct p_protocol *p ; int p_proto ; int p_after_sb_0p ; int p_after_sb_1p ; int p_after_sb_2p ; int p_want_lose ; int p_two_primaries ; int cf ; char p_integrity_alg[64U] ; __u32 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; unsigned char *my_alg ; int tmp___8 ; int tmp___9 ; unsigned char *tmp___10 ; union drbd_state val ; union drbd_state mask ; { { p = & mdev->data.rbuf.protocol; p_integrity_alg[0] = (char )'\000'; tmp = __fswab32(p->protocol); p_proto = (int )tmp; tmp___0 = __fswab32(p->after_sb_0p); p_after_sb_0p = (int )tmp___0; tmp___1 = __fswab32(p->after_sb_1p); p_after_sb_1p = (int )tmp___1; tmp___2 = __fswab32(p->after_sb_2p); p_after_sb_2p = (int )tmp___2; tmp___3 = __fswab32(p->two_primaries); p_two_primaries = (int )tmp___3; tmp___4 = __fswab32(p->conn_flags); cf = (int )tmp___4; p_want_lose = cf & 1; clear_bit(25, (unsigned long volatile *)(& mdev->flags)); } if ((cf & 2) != 0) { { set_bit(25U, (unsigned long volatile *)(& mdev->flags)); } } else { } if ((mdev->net_conf)->wire_protocol != p_proto) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "incompatible communication protocols\n"); } goto disconnect; } else { } { tmp___5 = cmp_after_sb((enum drbd_after_sb_p )p_after_sb_0p, (enum drbd_after_sb_p )(mdev->net_conf)->after_sb_0p); } if (tmp___5 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "incompatible after-sb-0pri settings\n"); } goto disconnect; } else { } { tmp___6 = cmp_after_sb((enum drbd_after_sb_p )p_after_sb_1p, (enum drbd_after_sb_p )(mdev->net_conf)->after_sb_1p); } if (tmp___6 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "incompatible after-sb-1pri settings\n"); } goto disconnect; } else { } { tmp___7 = cmp_after_sb((enum drbd_after_sb_p )p_after_sb_2p, (enum drbd_after_sb_p )(mdev->net_conf)->after_sb_2p); } if (tmp___7 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "incompatible after-sb-2pri settings\n"); } goto disconnect; } else { } if (p_want_lose != 0) { if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) != 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "both sides have the \'want_lose\' flag set\n"); } goto disconnect; } else { } } else { } if ((int )(mdev->net_conf)->two_primaries != p_two_primaries) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "incompatible setting of the two-primaries options\n"); } goto disconnect; } else { } if (mdev->agreed_pro_version > 86) { { my_alg = (unsigned char *)(& (mdev->net_conf)->integrity_alg); tmp___8 = drbd_recv(mdev, (void *)(& p_integrity_alg), (size_t )data_size); } if ((unsigned int )tmp___8 != data_size) { return (0); } else { } { p_integrity_alg[63] = (char)0; tmp___9 = strcmp((char const *)(& p_integrity_alg), (char const *)my_alg); } if (tmp___9 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "incompatible setting of the data-integrity-alg\n"); } goto disconnect; } else { } if ((unsigned int )*my_alg != 0U) { tmp___10 = my_alg; } else { tmp___10 = (unsigned char *)""; } { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "data-integrity-alg: %s\n", tmp___10); } } else { } return (1); disconnect: { val.i = 0U; val.ldv_38339.conn = (unsigned char)1; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } return (0); } } struct crypto_hash *drbd_crypto_alloc_digest_safe(struct drbd_conf const *mdev , char const *alg , char const *name ) { struct crypto_hash *tfm ; long tmp ; long tmp___0 ; void *tmp___1 ; struct crypto_tfm *tmp___2 ; int tmp___3 ; { if ((int )((signed char )*alg) == 0) { return ((struct crypto_hash *)0); } else { } { tfm = crypto_alloc_hash(alg, 0U, 128U); tmp___0 = IS_ERR((void const *)tfm); } if (tmp___0 != 0L) { { tmp = PTR_ERR((void const *)tfm); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Can not allocate \"%s\" as %s (reason: %ld)\n", alg, name, tmp); } return (tfm); } else { } { tmp___2 = crypto_hash_tfm(tfm); tmp___3 = drbd_crypto_is_hash(tmp___2); } if (tmp___3 == 0) { { crypto_free_hash(tfm); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "\"%s\" is not a digest (%s)\n", alg, name); tmp___1 = ERR_PTR(-22L); } return ((struct crypto_hash *)tmp___1); } else { } return (tfm); } } static int receive_SyncParam(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int packet_size ) { int ok ; struct p_rs_param_95 *p ; unsigned int header_size ; unsigned int data_size ; unsigned int exp_max_sz ; struct crypto_hash *verify_tfm ; struct crypto_hash *csums_tfm ; int apv ; int *rs_plan_s ; int fifo_size ; unsigned int tmp ; unsigned int tmp___0 ; int tmp___1 ; __u32 tmp___2 ; int tmp___3 ; long tmp___4 ; int tmp___5 ; long tmp___6 ; int tmp___7 ; __u32 tmp___8 ; __u32 tmp___9 ; __u32 tmp___10 ; __u32 tmp___11 ; __u32 tmp___12 ; void *tmp___13 ; size_t tmp___14 ; size_t tmp___15 ; union drbd_state val ; union drbd_state mask ; { ok = 1; p = & mdev->data.rbuf.rs_param_95; verify_tfm = (struct crypto_hash *)0; csums_tfm = (struct crypto_hash *)0; apv = mdev->agreed_pro_version; rs_plan_s = (int *)0; fifo_size = 0; if (apv > 87) { if (apv != 88) { if (apv <= 94) { tmp = 140U; } else { tmp = 156U; } tmp___0 = tmp; } else { tmp___0 = 76U; } exp_max_sz = tmp___0; } else { exp_max_sz = 12U; } if (packet_size > exp_max_sz) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "SyncParam packet too long: received %u, expected <= %u bytes\n", packet_size, exp_max_sz); } return (0); } else { } if (apv <= 88) { header_size = 4U; data_size = packet_size - header_size; } else if (apv <= 94) { header_size = 132U; data_size = packet_size - header_size; if (data_size != 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( data_size == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 2800); } } else { } } else { header_size = 148U; data_size = packet_size - header_size; if (data_size != 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( data_size == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 2804); } } else { } } { memset((void *)(& p->verify_alg), 0, 128UL); tmp___1 = drbd_recv(mdev, (void *)(& p->head.payload), (size_t )header_size); } if ((unsigned int )tmp___1 != header_size) { return (0); } else { } { tmp___2 = __fswab32(p->rate); mdev->sync_conf.rate = (int )tmp___2; } if (apv > 87) { if (apv == 88) { if (data_size > 64U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "verify-alg too long, peer wants %u, accepting only %u byte\n", data_size, 64); } return (0); } else { } { tmp___3 = drbd_recv(mdev, (void *)(& p->verify_alg), (size_t )data_size); } if ((unsigned int )tmp___3 != data_size) { return (0); } else { } if ((int )((signed char )p->verify_alg[data_size - 1U]) != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( p->verify_alg[data_size-1] == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 2829); } } else { } p->verify_alg[data_size - 1U] = (char)0; } else { if ((int )((signed char )p->verify_alg[63]) != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( p->verify_alg[SHARED_SECRET_MAX-1] == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 2835); } } else { } if ((int )((signed char )p->csums_alg[63]) != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( p->csums_alg[SHARED_SECRET_MAX-1] == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 2836); } } else { } p->verify_alg[63] = (char)0; p->csums_alg[63] = (char)0; } { tmp___5 = strcmp((char const *)(& mdev->sync_conf.verify_alg), (char const *)(& p->verify_alg)); } if (tmp___5 != 0) { if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 144U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Different verify-alg settings. me=\"%s\" peer=\"%s\"\n", (unsigned char *)(& mdev->sync_conf.verify_alg), (char *)(& p->verify_alg)); } goto disconnect; } else { } { verify_tfm = drbd_crypto_alloc_digest_safe((struct drbd_conf const *)mdev, (char const *)(& p->verify_alg), "verify-alg"); tmp___4 = IS_ERR((void const *)verify_tfm); } if (tmp___4 != 0L) { verify_tfm = (struct crypto_hash *)0; goto disconnect; } else { } } else { } if (apv > 88) { { tmp___7 = strcmp((char const *)(& mdev->sync_conf.csums_alg), (char const *)(& p->csums_alg)); } if (tmp___7 != 0) { if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 144U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Different csums-alg settings. me=\"%s\" peer=\"%s\"\n", (unsigned char *)(& mdev->sync_conf.csums_alg), (char *)(& p->csums_alg)); } goto disconnect; } else { } { csums_tfm = drbd_crypto_alloc_digest_safe((struct drbd_conf const *)mdev, (char const *)(& p->csums_alg), "csums-alg"); tmp___6 = IS_ERR((void const *)csums_tfm); } if (tmp___6 != 0L) { csums_tfm = (struct crypto_hash *)0; goto disconnect; } else { } } else { } } else { } if (apv > 94) { { tmp___8 = __fswab32(p->rate); mdev->sync_conf.rate = (int )tmp___8; tmp___9 = __fswab32(p->c_plan_ahead); mdev->sync_conf.c_plan_ahead = (int )tmp___9; tmp___10 = __fswab32(p->c_delay_target); mdev->sync_conf.c_delay_target = (int )tmp___10; tmp___11 = __fswab32(p->c_fill_target); mdev->sync_conf.c_fill_target = (int )tmp___11; tmp___12 = __fswab32(p->c_max_rate); mdev->sync_conf.c_max_rate = (int )tmp___12; fifo_size = (mdev->sync_conf.c_plan_ahead * 250) / 250; } if ((unsigned int )fifo_size != mdev->rs_plan_s.size) { if (fifo_size > 0) { { tmp___13 = kzalloc((unsigned long )fifo_size * 4UL, 208U); rs_plan_s = (int *)tmp___13; } if ((unsigned long )rs_plan_s == (unsigned long )((int *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "kmalloc of fifo_buffer failed"); } goto disconnect; } else { } } else { } } else { } } else { } { spin_lock(& mdev->peer_seq_lock); } if ((unsigned long )verify_tfm != (unsigned long )((struct crypto_hash *)0)) { { strcpy((char *)(& mdev->sync_conf.verify_alg), (char const *)(& p->verify_alg)); tmp___14 = strlen((char const *)(& p->verify_alg)); mdev->sync_conf.verify_alg_len = (int )((unsigned int )tmp___14 + 1U); crypto_free_hash(mdev->verify_tfm); mdev->verify_tfm = verify_tfm; _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "using verify-alg: \"%s\"\n", (char *)(& p->verify_alg)); } } else { } if ((unsigned long )csums_tfm != (unsigned long )((struct crypto_hash *)0)) { { strcpy((char *)(& mdev->sync_conf.csums_alg), (char const *)(& p->csums_alg)); tmp___15 = strlen((char const *)(& p->csums_alg)); mdev->sync_conf.csums_alg_len = (int )((unsigned int )tmp___15 + 1U); crypto_free_hash(mdev->csums_tfm); mdev->csums_tfm = csums_tfm; _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "using csums-alg: \"%s\"\n", (char *)(& p->csums_alg)); } } else { } if ((unsigned int )fifo_size != mdev->rs_plan_s.size) { { kfree((void const *)mdev->rs_plan_s.values); mdev->rs_plan_s.values = rs_plan_s; mdev->rs_plan_s.size = (unsigned int )fifo_size; mdev->rs_planed = 0; } } else { } { spin_unlock(& mdev->peer_seq_lock); } } else { } return (ok); disconnect: { crypto_free_hash(csums_tfm); crypto_free_hash(verify_tfm); val.i = 0U; val.ldv_38339.conn = (unsigned char)1; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } return (0); } } static void warn_if_differ_considerably(struct drbd_conf *mdev , char const *s , sector_t a , sector_t b ) { sector_t d ; { if (a == 0UL) { return; } else if (b == 0UL) { return; } else { } if (a > b) { d = a - b; } else { d = b - a; } if (a >> 3 < d) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Considerable difference in %s: %llus vs. %llus\n", s, (unsigned long long )a, (unsigned long long )b); } } else if (b >> 3 < d) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Considerable difference in %s: %llus vs. %llus\n", s, (unsigned long long )a, (unsigned long long )b); } } else { } return; } } static int receive_sizes(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { struct p_sizes *p ; enum determine_dev_size dd ; sector_t p_size ; sector_t p_usize ; sector_t my_usize ; int ldsc ; enum dds_flags ddsf ; __u64 tmp ; __u64 tmp___0 ; union drbd_state val ; union drbd_state mask ; sector_t tmp___1 ; unsigned long __x ; sector_t __y ; unsigned long _min1 ; sector_t _min2 ; unsigned long tmp___2 ; unsigned long tmp___3 ; unsigned long tmp___4 ; union drbd_state val___0 ; union drbd_state mask___0 ; sector_t tmp___5 ; sector_t tmp___6 ; int tmp___7 ; __u16 tmp___8 ; int tmp___9 ; __u32 tmp___10 ; sector_t tmp___11 ; int tmp___12 ; __u64 tmp___13 ; sector_t tmp___14 ; int tmp___15 ; { { p = & mdev->data.rbuf.sizes; dd = (enum determine_dev_size )0; ldsc = 0; tmp = __fswab64(p->d_size); p_size = (sector_t )tmp; tmp___0 = __fswab64(p->u_size); p_usize = (sector_t )tmp___0; } if (p_size == 0UL) { if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "some backing storage is needed\n"); val.i = 0U; val.ldv_38339.conn = (unsigned char)1; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } return (0); } else { } } else { } { mdev->p_size = p_size; tmp___7 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___7 != 0) { { tmp___1 = drbd_get_max_capacity(mdev->ldev); warn_if_differ_considerably(mdev, "lower level device sizes", p_size, tmp___1); warn_if_differ_considerably(mdev, "user requested size", p_usize, (sector_t )(mdev->ldev)->dc.disk_size); } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 144U) { __x = (unsigned long )(mdev->ldev)->dc.disk_size; __y = p_usize; if (__x != 0UL) { if (__y != 0UL) { _min1 = __x; _min2 = __y; if (_min1 < _min2) { tmp___2 = _min1; } else { tmp___2 = _min2; } tmp___3 = tmp___2; } else { tmp___3 = __x; } tmp___4 = tmp___3; } else { tmp___4 = __y; } p_usize = tmp___4; } else { } my_usize = (sector_t )(mdev->ldev)->dc.disk_size; if ((mdev->ldev)->dc.disk_size != (unsigned long long )p_usize) { { (mdev->ldev)->dc.disk_size = (__u64 )p_usize; _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Peer sets u_size to %lu sectors\n", (unsigned long )(mdev->ldev)->dc.disk_size); } } else { } { tmp___5 = drbd_new_dev_size(mdev, mdev->ldev, 0); tmp___6 = drbd_get_capacity(mdev->this_bdev); } if (tmp___5 < tmp___6) { if ((int )mdev->state.ldv_38339.disk > 4) { if ((int )mdev->state.ldv_38339.conn <= 9) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "The peer\'s disk size is too small!\n"); val___0.i = 0U; val___0.ldv_38339.conn = (unsigned char)1; mask___0.i = 0U; mask___0.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask___0, val___0); (mdev->ldev)->dc.disk_size = (__u64 )my_usize; put_ldev(mdev); } return (0); } else { } } else { } } else { } { put_ldev(mdev); } } else { } { tmp___8 = __fswab16((__u16 )((int )p->dds_flags)); ddsf = (enum dds_flags )tmp___8; tmp___9 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___9 != 0) { { dd = drbd_determine_dev_size(mdev, ddsf); put_ldev(mdev); } if ((int )dd == -1) { return (0); } else { } { drbd_md_sync(mdev); } } else { { drbd_set_my_capacity(mdev, p_size); } } { tmp___10 = __fswab32(p->max_bio_size); mdev->peer_max_bio_size = (int )tmp___10; drbd_reconsider_max_bio_size(mdev); tmp___12 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___12 != 0) { { tmp___11 = drbd_get_capacity((mdev->ldev)->backing_bdev); } if ((mdev->ldev)->known_size != tmp___11) { { (mdev->ldev)->known_size = drbd_get_capacity((mdev->ldev)->backing_bdev); ldsc = 1; } } else { } { put_ldev(mdev); } } else { } if ((int )mdev->state.ldv_38339.conn > 9) { { tmp___13 = __fswab64(p->c_size); tmp___14 = drbd_get_capacity(mdev->this_bdev); } if (tmp___13 != (unsigned long long )tmp___14) { { drbd_send_sizes(mdev, 0, ddsf); } } else if (ldsc != 0) { { drbd_send_sizes(mdev, 0, ddsf); } } else { } { tmp___15 = test_and_clear_bit(24, (unsigned long volatile *)(& mdev->flags)); } if (tmp___15 != 0) { goto _L; } else if ((int )dd == 2) { if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 160U) { _L: if ((int )mdev->state.ldv_38339.pdsk > 3) { if ((int )mdev->state.ldv_38339.disk > 3) { if (((unsigned int )ddsf & 2U) != 0U) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Resync of new storage suppressed with --assume-clean\n"); } } else { { resync_after_online_grow(mdev); } } } else { { set_bit(20U, (unsigned long volatile *)(& mdev->flags)); } } } else { { set_bit(20U, (unsigned long volatile *)(& mdev->flags)); } } } else { } } else { } } else { } return (1); } } static int receive_uuids(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { struct p_uuids *p ; u64 *p_uuid ; int i ; int updated_uuids ; void *tmp ; __u64 tmp___0 ; union drbd_state val ; union drbd_state mask ; int skip_initial_sync ; int tmp___1 ; union drbd_state __ns ; int tmp___2 ; int tmp___3 ; wait_queue_t __wait ; struct task_struct *tmp___4 ; int tmp___5 ; int tmp___6 ; { { p = & mdev->data.rbuf.uuids; updated_uuids = 0; tmp = kmalloc(48UL, 16U); p_uuid = (u64 *)tmp; i = 0; } goto ldv_49938; ldv_49937: { tmp___0 = __fswab64(p->uuid[i]); *(p_uuid + (unsigned long )i) = tmp___0; i = i + 1; } ldv_49938: ; if (i <= 5) { goto ldv_49937; } else { goto ldv_49939; } ldv_49939: { kfree((void const *)mdev->p_uuid); mdev->p_uuid = p_uuid; } if ((int )mdev->state.ldv_38339.conn <= 9) { if ((int )mdev->state.ldv_38339.disk <= 3) { if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { if (((mdev->ed_uuid ^ *p_uuid) & 0x0ffffffffffffffeULL) != 0ULL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Can only connect to data with current UUID=%016llX\n", mdev->ed_uuid); val.i = 0U; val.ldv_38339.conn = (unsigned char)1; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } return (0); } else { } } else { } } else { } } else { } { tmp___2 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___2 != 0) { if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 160U) { if (mdev->agreed_pro_version > 89) { if ((mdev->ldev)->md.uuid[0] == 4ULL) { if ((*(p_uuid + 5UL) & 8ULL) != 0ULL) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } } else { tmp___1 = 0; } } else { tmp___1 = 0; } skip_initial_sync = tmp___1; if (skip_initial_sync != 0) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Accepted new current UUID, preparing to skip initial sync\n"); drbd_bitmap_io(mdev, & drbd_bmio_clear_n_write, (char *)"clear_n_write from receive_uuids", (enum bm_flag )3); _drbd_uuid_set(mdev, 0, *p_uuid); _drbd_uuid_set(mdev, 1, 0ULL); __ns.i = mdev->state.i; __ns.ldv_38339.disk = (unsigned char)8; __ns.ldv_38339.pdsk = (unsigned char)8; _drbd_set_state(mdev, __ns, (enum chg_state_flags )2, (struct completion *)0); drbd_md_sync(mdev); updated_uuids = 1; } } else { } { put_ldev(mdev); } } else if ((int )mdev->state.ldv_38339.disk <= 3) { if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { { updated_uuids = drbd_set_ed_uuid(mdev, *p_uuid); } } else { } } else { } { tmp___3 = constant_test_bit(8U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___3 == 0) { goto ldv_49947; } else { } { tmp___4 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___4; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_49950: { prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___5 = constant_test_bit(8U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___5 == 0) { goto ldv_49949; } else { } { schedule(); } goto ldv_49950; ldv_49949: { finish_wait(& mdev->misc_wait, & __wait); } ldv_49947: ; if ((int )mdev->state.ldv_38339.conn > 9) { if ((int )mdev->state.ldv_38339.disk <= 3) { { tmp___6 = drbd_set_ed_uuid(mdev, *p_uuid); updated_uuids = tmp___6 | updated_uuids; } } else { } } else { } if (updated_uuids != 0) { { drbd_print_uuids(mdev, "receiver updated UUIDs to"); } } else { } return (1); } } static union drbd_state convert_state(union drbd_state ps ) { union drbd_state ms ; enum drbd_conns c_tab[32U] ; { c_tab[0] = (enum drbd_conns )0; c_tab[1] = (enum drbd_conns )7; c_tab[2] = (enum drbd_conns )0; c_tab[3] = (enum drbd_conns )0; c_tab[4] = (enum drbd_conns )0; c_tab[5] = (enum drbd_conns )0; c_tab[6] = (enum drbd_conns )0; c_tab[7] = (enum drbd_conns )0; c_tab[8] = (enum drbd_conns )0; c_tab[9] = (enum drbd_conns )0; c_tab[10] = (enum drbd_conns )10; c_tab[11] = (enum drbd_conns )12; c_tab[12] = (enum drbd_conns )11; c_tab[13] = (enum drbd_conns )0; c_tab[14] = (enum drbd_conns )0; c_tab[15] = (enum drbd_conns )0; c_tab[16] = (enum drbd_conns )0; c_tab[17] = (enum drbd_conns )0; c_tab[18] = (enum drbd_conns )19; c_tab[19] = (enum drbd_conns )0; c_tab[20] = (enum drbd_conns )0; c_tab[21] = (enum drbd_conns )0; c_tab[22] = (enum drbd_conns )0; c_tab[23] = (enum drbd_conns )0; c_tab[24] = (enum drbd_conns )0; c_tab[25] = (enum drbd_conns )0; c_tab[26] = (enum drbd_conns )0; c_tab[27] = (enum drbd_conns )0; c_tab[28] = (enum drbd_conns )0; c_tab[29] = (enum drbd_conns )0; c_tab[30] = (enum drbd_conns )0; c_tab[31] = (enum drbd_conns )31; ms.i = ps.i; ms.ldv_38339.conn = (unsigned char )c_tab[(int )ps.ldv_38339.conn]; ms.ldv_38339.peer = ps.ldv_38339.role; ms.ldv_38339.role = ps.ldv_38339.peer; ms.ldv_38339.pdsk = ps.ldv_38339.disk; ms.ldv_38339.disk = ps.ldv_38339.pdsk; ms.ldv_38339.peer_isp = (unsigned char )((int )ps.ldv_38339.aftr_isp | (int )ps.ldv_38339.user_isp); return (ms); } } static int receive_req_state(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { struct p_req_state *p ; union drbd_state mask ; union drbd_state val ; enum drbd_state_rv rv ; __u32 tmp ; __u32 tmp___0 ; int tmp___1 ; int tmp___2 ; { { p = & mdev->data.rbuf.req_state; tmp = __fswab32(p->mask); mask.i = tmp; tmp___0 = __fswab32(p->val); val.i = tmp___0; tmp___1 = constant_test_bit(6U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___1 != 0) { { tmp___2 = constant_test_bit(8U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___2 != 0) { { drbd_send_sr_reply(mdev, (enum drbd_state_rv )-19); } return (1); } else { } } else { } { mask = convert_state(mask); val = convert_state(val); rv = drbd_change_state(mdev, (enum chg_state_flags )2, mask, val); drbd_send_sr_reply(mdev, rv); drbd_md_sync(mdev); } return (1); } } static int receive_state(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { struct p_state *p ; union drbd_state os ; union drbd_state ns ; union drbd_state peer_state ; enum drbd_disk_state real_peer_disk ; enum chg_state_flags cs_flags ; int rv ; __u32 tmp ; char const *tmp___0 ; unsigned long tmp___1 ; int cr ; int tmp___2 ; int tmp___3 ; int tmp___4 ; enum drbd_conns tmp___5 ; union drbd_state val ; union drbd_state mask ; int tmp___6 ; union drbd_state val___0 ; union drbd_state mask___0 ; int tmp___7 ; int tmp___8 ; union drbd_state val___1 ; union drbd_state mask___1 ; int tmp___9 ; int tmp___10 ; enum drbd_state_rv tmp___11 ; union drbd_state val___2 ; union drbd_state mask___2 ; { { p = & mdev->data.rbuf.state; tmp = __fswab32(p->state); peer_state.i = tmp; real_peer_disk = (enum drbd_disk_state )peer_state.ldv_38339.disk; } if ((unsigned int )*((unsigned char *)(& peer_state) + 1UL) == 6U) { if ((*(mdev->p_uuid + 5UL) & 4ULL) != 0ULL) { real_peer_disk = (enum drbd_disk_state )4; } else { real_peer_disk = (enum drbd_disk_state )7; } { tmp___0 = drbd_disk_str(real_peer_disk); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "real peer disk state = %s\n", tmp___0); } } else { } { spin_lock_irq(& mdev->req_lock); } retry: { ns = mdev->state; os = ns; spin_unlock_irq(& mdev->req_lock); } if (*((unsigned int *)(& os) + 0UL) == 32768U) { if ((unsigned int )real_peer_disk == 8U) { if ((int )os.ldv_38339.conn > 10) { if ((unsigned int )*((unsigned char *)(& os) + 1UL) == 16U) { if ((int )peer_state.ldv_38339.conn > 10) { if ((int )peer_state.ldv_38339.conn <= 15) { real_peer_disk = (enum drbd_disk_state )4; } else { goto _L; } } else _L: if ((int )os.ldv_38339.conn > 15) { if ((unsigned int )*((unsigned short *)(& peer_state) + 0UL) == 160U) { { tmp___1 = drbd_bm_total_weight(mdev); } if (tmp___1 <= mdev->rs_failed) { { drbd_resync_finished(mdev); } } else { } return (1); } else { } } else { } } else { } } else { } } else { } } else { } if (*((unsigned int *)(& os) + 0UL) == 65536U) { if ((unsigned int )real_peer_disk == 4U) { if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 160U) { if ((int )peer_state.ldv_38339.conn > 16) { real_peer_disk = (enum drbd_disk_state )8; } else { } } else { } } else { } } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 144U) { ns.ldv_38339.conn = (unsigned char)10; } else { } if ((unsigned int )*((unsigned short *)(& peer_state) + 0UL) == 352U) { ns.ldv_38339.conn = (unsigned char)23; } else { } if ((unsigned long )mdev->p_uuid != (unsigned long )((u64 *)0)) { if ((int )peer_state.ldv_38339.disk > 2) { { tmp___7 = _get_ldev_if_state(mdev, (enum drbd_disk_state )3); } if (tmp___7 != 0) { cr = (int )os.ldv_38339.conn <= 9; if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 160U) { if ((unsigned int )*((unsigned char *)(& peer_state) + 1UL) == 6U) { tmp___2 = 1; } else if ((unsigned int )*((unsigned char *)(& os) + 1UL) == 6U) { tmp___2 = 1; } else { tmp___2 = 0; } } else { tmp___2 = 0; } { cr = tmp___2 | cr; tmp___3 = constant_test_bit(13U, (unsigned long const volatile *)(& mdev->flags)); cr = tmp___3 | cr; } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 160U) { if ((int )peer_state.ldv_38339.conn > 10) { if ((int )peer_state.ldv_38339.conn <= 14) { tmp___4 = 1; } else { tmp___4 = 0; } } else { tmp___4 = 0; } } else { tmp___4 = 0; } cr = tmp___4 | cr; if (cr != 0) { { tmp___5 = drbd_sync_handshake(mdev, (enum drbd_role )peer_state.ldv_38339.role, real_peer_disk); ns.ldv_38339.conn = (unsigned char )tmp___5; } } else { } { put_ldev(mdev); } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 496U) { ns.ldv_38339.conn = (unsigned char)10; if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 6U) { { val.i = 0U; val.ldv_38339.disk = (unsigned char)2; mask.i = 0U; mask.ldv_38339.disk = (unsigned char)15; drbd_force_state(mdev, mask, val); } } else if ((unsigned int )*((unsigned char *)(& peer_state) + 1UL) == 6U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Disk attach process on the peer node was aborted.\n"); peer_state.ldv_38339.disk = (unsigned char)0; real_peer_disk = (enum drbd_disk_state )0; } } else { { tmp___6 = test_and_clear_bit(25, (unsigned long volatile *)(& mdev->flags)); } if (tmp___6 != 0) { return (0); } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 144U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( os.conn == C_WF_REPORT_PARAMS ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 3254); } } else { } { val___0.i = 0U; val___0.ldv_38339.conn = (unsigned char)1; mask___0.i = 0U; mask___0.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask___0, val___0); } return (0); } } else { } } else { } } else { } } else { } { spin_lock_irq(& mdev->req_lock); } if (mdev->state.i != os.i) { goto retry; } else { } { clear_bit(13, (unsigned long volatile *)(& mdev->flags)); ns.ldv_38339.peer = peer_state.ldv_38339.role; ns.ldv_38339.pdsk = (unsigned char )real_peer_disk; ns.ldv_38339.peer_isp = (unsigned char )((int )peer_state.ldv_38339.aftr_isp | (int )peer_state.ldv_38339.user_isp); } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 160U) { goto _L___0; } else if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 208U) { _L___0: if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 6U) { ns.ldv_38339.disk = mdev->new_state_tmp.ldv_38339.disk; } else { } } else { } if ((int )os.ldv_38339.conn > 9) { tmp___8 = 1; } else if ((int )ns.ldv_38339.conn <= 9) { tmp___8 = 1; } else { tmp___8 = 0; } cs_flags = (enum chg_state_flags )(tmp___8 + 2); if (*((unsigned int *)(& ns) + 0UL) == 57344U) { { tmp___9 = is_susp(ns); } if (tmp___9 != 0) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 160U) { if ((int )os.ldv_38339.conn <= 9) { { tmp___10 = constant_test_bit(27U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___10 != 0) { { spin_unlock_irq(& mdev->req_lock); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Aborting Connect, can not thaw IO with an only Consistent peer\n"); tl_clear(mdev); drbd_uuid_new_current(mdev); clear_bit(27, (unsigned long volatile *)(& mdev->flags)); val___1.i = 0U; val___1.ldv_38339.conn = (unsigned char)6; val___1.ldv_38339.susp = (unsigned char)0; mask___1.i = 0U; mask___1.ldv_38339.conn = (unsigned char)31; mask___1.ldv_38339.susp = (unsigned char)1; drbd_force_state(mdev, mask___1, val___1); } return (0); } else { } } else { } } else { } } else { } } else { } { tmp___11 = _drbd_set_state(mdev, ns, cs_flags, (struct completion *)0); rv = (int )tmp___11; ns = mdev->state; spin_unlock_irq(& mdev->req_lock); } if (rv <= 0) { { val___2.i = 0U; val___2.ldv_38339.conn = (unsigned char)1; mask___2.i = 0U; mask___2.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask___2, val___2); } return (0); } else { } if ((int )os.ldv_38339.conn > 9) { if ((int )ns.ldv_38339.conn > 10) { if ((int )peer_state.ldv_38339.conn <= 10) { if ((unsigned int )*((unsigned char *)(& peer_state) + 1UL) != 6U) { { drbd_send_uuids(mdev); drbd_send_state(mdev); } } else { } } else { } } else { } } else { } { (mdev->net_conf)->want_lose = (unsigned char)0; drbd_md_sync(mdev); } return (1); } } static int receive_sync_uuid(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { struct p_rs_uuid *p ; wait_queue_t __wait ; struct task_struct *tmp ; __u64 tmp___0 ; int tmp___1 ; { p = & mdev->data.rbuf.rs_uuid; if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 240U) { goto ldv_50001; } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 368U) { goto ldv_50001; } else if ((int )mdev->state.ldv_38339.conn <= 9) { goto ldv_50001; } else if ((int )mdev->state.ldv_38339.disk <= 2) { goto ldv_50001; } else { } { tmp = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_50004: { prepare_to_wait(& mdev->misc_wait, & __wait, 2); } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 240U) { goto ldv_50003; } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 368U) { goto ldv_50003; } else if ((int )mdev->state.ldv_38339.conn <= 9) { goto ldv_50003; } else if ((int )mdev->state.ldv_38339.disk <= 2) { goto ldv_50003; } else { } { schedule(); } goto ldv_50004; ldv_50003: { finish_wait(& mdev->misc_wait, & __wait); } ldv_50001: { tmp___1 = _get_ldev_if_state(mdev, (enum drbd_disk_state )3); } if (tmp___1 != 0) { { tmp___0 = __fswab64(p->uuid); _drbd_uuid_set(mdev, 0, tmp___0); _drbd_uuid_set(mdev, 1, 0ULL); drbd_print_uuids(mdev, "updated sync uuid"); drbd_start_resync(mdev, (enum drbd_conns )17); put_ldev(mdev); } } else { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Ignoring SyncUUID packet!\n"); } } return (1); } } static int receive_bitmap_plain(struct drbd_conf *mdev , unsigned int data_size , unsigned long *buffer , struct bm_xfer_ctx *c ) { unsigned int num_words ; size_t __min1 ; size_t __min2 ; size_t tmp ; unsigned int want ; int err ; { __min1 = 511UL; __min2 = c->bm_words - c->word_offset; if (__min1 < __min2) { tmp = __min1; } else { tmp = __min2; } num_words = (unsigned int )tmp; want = num_words * 8U; if (want != data_size) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s:want (%u) != data_size (%u)\n", "receive_bitmap_plain", want, data_size); } return (-5); } else { } if (want == 0U) { return (0); } else { } { err = drbd_recv(mdev, (void *)buffer, (size_t )want); } if ((unsigned int )err != want) { if (err >= 0) { err = -5; } else { } return (err); } else { } { drbd_bm_merge_lel(mdev, c->word_offset, (size_t )num_words, buffer); c->word_offset = c->word_offset + (unsigned long )num_words; c->bit_offset = c->word_offset * 64UL; } if (c->bit_offset > c->bm_bits) { c->bit_offset = c->bm_bits; } else { } return (1); } } static int recv_bm_rle_bits(struct drbd_conf *mdev , struct p_compressed_bm *p , struct bm_xfer_ctx *c ) { struct bitstream bs ; u64 look_ahead ; u64 rl ; u64 tmp ; unsigned long s ; unsigned long e ; int len ; __u16 tmp___0 ; int toggle ; int tmp___1 ; int have ; int bits ; int tmp___2 ; { { s = c->bit_offset; tmp___0 = __fswab16((__u16 )((int )p->head.length)); len = (int )((unsigned int )tmp___0 - 1U); tmp___1 = DCBP_get_start(p); toggle = tmp___1; tmp___2 = DCBP_get_pad_bits(p); bitstream_init(& bs, (void *)(& p->code), (size_t )len, (unsigned int )tmp___2); bits = bitstream_get_bits(& bs, & look_ahead, 64); } if (bits < 0) { return (-5); } else { } have = bits; goto ldv_50034; ldv_50033: { bits = vli_decode_bits(& rl, (u64 const )look_ahead); } if (bits <= 0) { return (-5); } else { } if (toggle != 0) { e = (unsigned long )(((unsigned long long )s + rl) - 1ULL); if (c->bm_bits <= e) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "bitmap overflow (e:%lu) while decoding bm RLE packet\n", e); } return (-5); } else { } { _drbd_bm_set_bits(mdev, (unsigned long const )s, (unsigned long const )e); } } else { } if (have < bits) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "bitmap decoding error: h:%d b:%d la:0x%08llx l:%u/%u\n", have, bits, look_ahead, (unsigned int )((long )bs.cur.b) - (unsigned int )((long )(& p->code)), (unsigned int )bs.buf_len); } return (-5); } else { } { look_ahead = look_ahead >> bits; have = have - bits; bits = bitstream_get_bits(& bs, & tmp, 64 - have); } if (bits < 0) { return (-5); } else { } look_ahead = (tmp << have) | look_ahead; have = have + bits; s = (unsigned long )((unsigned long long )s + rl); toggle = toggle == 0; ldv_50034: ; if (have > 0) { goto ldv_50033; } else { goto ldv_50035; } ldv_50035: { c->bit_offset = s; bm_xfer_ctx_bit_to_word_offset(c); } return (c->bm_bits != s); } } static int decode_bitmap_c(struct drbd_conf *mdev , struct p_compressed_bm *p , struct bm_xfer_ctx *c ) { int tmp ; enum drbd_bitmap_code tmp___0 ; union drbd_state val ; union drbd_state mask ; { { tmp___0 = DCBP_get_code(p); } if ((unsigned int )tmp___0 == 2U) { { tmp = recv_bm_rle_bits(mdev, p, c); } return (tmp); } else { } { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "receive_bitmap_c: unknown encoding %u\n", (int )p->encoding); val.i = 0U; val.ldv_38339.conn = (unsigned char)6; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } return (-5); } } void INFO_bm_xfer_stats(struct drbd_conf *mdev , char const *direction , struct bm_xfer_ctx *c ) { unsigned int plain ; unsigned int total ; unsigned int r ; { plain = (unsigned int )(((c->bm_words + 510UL) / 511UL + c->bm_words) + 1UL) * 8U; total = c->bytes[0] + c->bytes[1]; if (total == 0U) { return; } else { } if (total >= plain) { return; } else { } if (total > 4294967U) { r = total / (plain / 1000U); } else { r = (total * 1000U) / plain; } if (r > 1000U) { r = 1000U; } else { } { r = 1000U - r; _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s bitmap stats [Bytes(packets)]: plain %u(%u), RLE %u(%u), total %u; compression: %u.%u%%\n", direction, c->bytes[1], c->packets[1], c->bytes[0], c->packets[0], total, r / 10U, r % 10U); } return; } } static int receive_bitmap(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { struct bm_xfer_ctx c ; void *buffer ; int err ; int ok ; struct p_header80 *h ; unsigned long tmp ; struct bm_xfer_ctx __constr_expr_0 ; unsigned long tmp___0 ; size_t tmp___1 ; struct p_compressed_bm *p ; size_t __len ; void *__ret ; int tmp___2 ; int tmp___3 ; enum drbd_state_rv rv ; int tmp___4 ; union drbd_state val ; union drbd_state mask ; char const *tmp___5 ; { { ok = 0; h = & mdev->data.rbuf.header.h80; drbd_bm_lock(mdev, (char *)"receive bitmap", (enum bm_flag )1); tmp = __get_free_pages(16U, 0U); buffer = (void *)tmp; } if ((unsigned long )buffer == (unsigned long )((void *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "failed to allocate one page buffer in %s\n", "receive_bitmap"); } goto out; } else { } { tmp___0 = drbd_bm_bits(mdev); tmp___1 = drbd_bm_words(mdev); __constr_expr_0.bm_bits = tmp___0; __constr_expr_0.bm_words = tmp___1; __constr_expr_0.bit_offset = 0UL; __constr_expr_0.word_offset = 0UL; __constr_expr_0.packets[0] = 0U; __constr_expr_0.packets[1] = 0U; __constr_expr_0.bytes[0] = 0U; __constr_expr_0.bytes[1] = 0U; c = __constr_expr_0; } ldv_50071: ; if ((unsigned int )cmd == 4U) { { err = receive_bitmap_plain(mdev, data_size, (unsigned long *)buffer, & c); } } else if ((unsigned int )cmd == 36U) { if (data_size > 4088U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ReportCBitmap packet too large\n"); } goto out; } else { } p = (struct p_compressed_bm *)buffer; __len = 8UL; if (__len > 63UL) { { __ret = __memcpy((void *)p, (void const *)h, __len); } } else { { __ret = __builtin_memcpy((void *)p, (void const *)h, __len); } } { tmp___2 = drbd_recv(mdev, (void *)(& p->head.payload), (size_t )data_size); } if ((unsigned int )tmp___2 != data_size) { goto out; } else { } if (data_size <= 1U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ReportCBitmap packet too small (l:%u)\n", data_size); } goto out; } else { } { err = decode_bitmap_c(mdev, p, & c); } } else { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "receive_bitmap: cmd neither ReportBitMap nor ReportCBitMap (is 0x%x)", (unsigned int )cmd); } goto out; } c.packets[(unsigned int )cmd == 4U] = c.packets[(unsigned int )cmd == 4U] + 1U; c.bytes[(unsigned int )cmd == 4U] = (c.bytes[(unsigned int )cmd == 4U] + data_size) + 8U; if (err <= 0) { if (err < 0) { goto out; } else { } goto ldv_50070; } else { } { tmp___3 = drbd_recv_header(mdev, & cmd, & data_size); } if (tmp___3 == 0) { goto out; } else { } goto ldv_50071; ldv_50070: { INFO_bm_xfer_stats(mdev, "receive", & c); } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 224U) { { tmp___4 = drbd_send_bitmap(mdev); ok = tmp___4 == 0; } if (ok == 0) { goto out; } else { } { val.i = 0U; val.ldv_38339.conn = (unsigned char)15; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; rv = _drbd_request_state(mdev, mask, val, (enum chg_state_flags )2); } if ((int )rv != 1) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( rv == SS_SUCCESS ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 3579); } } else { } } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) != 208U) { { tmp___5 = drbd_conn_str((enum drbd_conns )mdev->state.ldv_38339.conn); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "unexpected cstate (%s) in receive_bitmap\n", tmp___5); } } else { } ok = 1; out: { drbd_bm_unlock(mdev); } if (ok != 0) { if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 208U) { { drbd_start_resync(mdev, (enum drbd_conns )16); } } else { } } else { } { free_pages((unsigned long )buffer, 0U); } return (ok); } } static int receive_skip(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { char sink[128U] ; int size ; int want ; int r ; int __min1 ; int __min2 ; int tmp ; int _b ; { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "skipping unknown optional packet type %d, l: %d!\n", (unsigned int )cmd, data_size); size = (int )data_size; } goto ldv_50094; ldv_50093: __min1 = size; __min2 = 128; if (__min1 < __min2) { tmp = __min1; } else { tmp = __min2; } { want = tmp; r = drbd_recv(mdev, (void *)(& sink), (size_t )want); _b = r <= 0; } if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "receive_skip", (char *)"r <= 0", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 3609); } } else { } if (_b != 0) { goto ldv_50092; } else { } size = size - r; ldv_50094: ; if (size > 0) { goto ldv_50093; } else { goto ldv_50092; } ldv_50092: ; return (size == 0); } } static int receive_UnplugRemote(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { { { drbd_tcp_quickack(mdev->data.socket); } return (1); } } static int receive_out_of_sync(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { struct p_block_desc *p ; char const *tmp ; __u32 tmp___0 ; __u64 tmp___1 ; { p = & mdev->data.rbuf.block_desc; if ((int )mdev->state.ldv_38339.conn == 15) { goto case_15; } else if ((int )mdev->state.ldv_38339.conn == 14) { goto case_14; } else if ((int )mdev->state.ldv_38339.conn == 23) { goto case_23; } else { goto switch_default; if (0) { case_15: ; case_14: ; case_23: ; goto ldv_50109; switch_default: { tmp = drbd_conn_str((enum drbd_conns )mdev->state.ldv_38339.conn); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED cstate = %s, expected: WFSyncUUID|WFBitMapT|Behind\n", tmp); } } else { } } ldv_50109: { tmp___0 = __fswab32(p->blksize); tmp___1 = __fswab64(p->sector); __drbd_set_out_of_sync(mdev, (sector_t )tmp___1, (int )tmp___0, "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", (unsigned int const )3638U); } return (1); } } static struct data_cmd drbd_cmd_handler[43U] = { {1, 32UL, & receive_Data}, {1, 32UL, & receive_DataReply}, {1, 32UL, & receive_RSDataReply}, {0, 16UL, & receive_Barrier}, {1, 8UL, & receive_bitmap}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 8UL, & receive_UnplugRemote}, {0, 32UL, & receive_DataRequest}, {0, 32UL, & receive_DataRequest}, {1, 8UL, & receive_SyncParam}, {1, 32UL, & receive_protocol}, {0, 56UL, & receive_uuids}, {0, 40UL, & receive_sizes}, {0, 12UL, & receive_state}, {0, 16UL, & receive_sync_uuid}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 16UL, & receive_req_state}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 32UL, & receive_DataRequest}, {1, 32UL, & receive_DataRequest}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {1, 32UL, & receive_DataRequest}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {1, 8UL, & receive_SyncParam}, {1, 8UL, & receive_bitmap}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 16UL, & receive_skip}, {0, 24UL, & receive_out_of_sync}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}, {0, 0UL, (int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0}}; static void drbdd(struct drbd_conf *mdev ) { union p_header *header ; unsigned int packet_size ; enum drbd_packets cmd ; size_t shs ; int rv ; int tmp ; long tmp___0 ; long tmp___1 ; char const *tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; long tmp___5 ; char const *tmp___6 ; long tmp___7 ; enum drbd_thread_state tmp___8 ; union drbd_state val ; union drbd_state mask ; { header = & mdev->data.rbuf.header; goto ldv_50130; ldv_50129: { drbd_thread_current_set_cpu(mdev); tmp = drbd_recv_header(mdev, & cmd, & packet_size); } if (tmp == 0) { goto err_out; } else { } { tmp___0 = __builtin_expect((long )((unsigned int )cmd > 41U), 0L); } if (tmp___0 != 0L) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "unknown packet type %d, l: %d!\n", (unsigned int )cmd, packet_size); } goto err_out; } else { { tmp___1 = __builtin_expect((long )((unsigned long )drbd_cmd_handler[(unsigned int )cmd].function == (unsigned long )((int (*)(struct drbd_conf * , enum drbd_packets , unsigned int ))0)), 0L); } if (tmp___1 != 0L) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "unknown packet type %d, l: %d!\n", (unsigned int )cmd, packet_size); } goto err_out; } else { } } shs = drbd_cmd_handler[(unsigned int )cmd].pkt_size - 8UL; if ((size_t )packet_size != shs) { if (drbd_cmd_handler[(unsigned int )cmd].expect_payload == 0) { { tmp___2 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "No payload expected %s l:%d\n", tmp___2, packet_size); } goto err_out; } else { } } else { } if (shs != 0UL) { { rv = drbd_recv(mdev, (void *)(& header->h80.payload), shs); tmp___5 = __builtin_expect((long )((size_t )rv != shs), 0L); } if (tmp___5 != 0L) { { tmp___3 = get_current(); tmp___4 = signal_pending(tmp___3); } if (tmp___4 == 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read while reading sub header: rv=%d\n", rv); } } else { } goto err_out; } else { } } else { } { rv = (*(drbd_cmd_handler[(unsigned int )cmd].function))(mdev, cmd, packet_size - (unsigned int )shs); tmp___7 = __builtin_expect((long )(rv == 0), 0L); } if (tmp___7 != 0L) { { tmp___6 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "error receiving %s, l: %d!\n", tmp___6, packet_size); } goto err_out; } else { } ldv_50130: { tmp___8 = get_t_state(& mdev->receiver); } if ((unsigned int )tmp___8 == 1U) { goto ldv_50129; } else { goto ldv_50131; } ldv_50131: ; if (0) { err_out: { val.i = 0U; val.ldv_38339.conn = (unsigned char)6; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } } else { } { drbd_md_sync(mdev); } return; } } void drbd_flush_workqueue(struct drbd_conf *mdev ) { struct drbd_wq_barrier barr ; { { barr.w.cb = & w_prev_work_done; init_completion(& barr.done); drbd_queue_work(& mdev->data.work, & barr.w); wait_for_completion(& barr.done); } return; } } void drbd_free_tl_hash(struct drbd_conf *mdev ) { struct hlist_head *h ; { { spin_lock_irq(& mdev->req_lock); } if ((unsigned long )mdev->tl_hash == (unsigned long )((struct hlist_head *)0)) { { spin_unlock_irq(& mdev->req_lock); } return; } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) != 0U) { { spin_unlock_irq(& mdev->req_lock); } return; } else { } h = mdev->ee_hash; goto ldv_50145; ldv_50144: ; if ((unsigned long )h->first != (unsigned long )((struct hlist_node *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED ee_hash[%u].first == %p, expected NULL\n", (int )(((long )h - (long )mdev->ee_hash) / 8L), h->first); } } else { } h = h + 1; ldv_50145: ; if ((unsigned long )(mdev->ee_hash + (unsigned long )mdev->ee_hash_s) > (unsigned long )h) { goto ldv_50144; } else { goto ldv_50146; } ldv_50146: { kfree((void const *)mdev->ee_hash); mdev->ee_hash = (struct hlist_head *)0; mdev->ee_hash_s = 0U; h = mdev->tl_hash; } goto ldv_50148; ldv_50147: ; if ((unsigned long )h->first != (unsigned long )((struct hlist_node *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED tl_hash[%u] == %p, expected NULL\n", (int )(((long )h - (long )mdev->tl_hash) / 8L), h->first); } } else { } h = h + 1; ldv_50148: ; if ((unsigned long )(mdev->tl_hash + (unsigned long )mdev->tl_hash_s) > (unsigned long )h) { goto ldv_50147; } else { goto ldv_50149; } ldv_50149: { kfree((void const *)mdev->tl_hash); mdev->tl_hash = (struct hlist_head *)0; mdev->tl_hash_s = 0U; spin_unlock_irq(& mdev->req_lock); } return; } } static void drbd_disconnect(struct drbd_conf *mdev ) { enum drbd_fencing_p fp ; union drbd_state os ; union drbd_state ns ; int rv ; unsigned int i ; int tmp ; int tmp___0 ; enum drbd_state_rv tmp___1 ; int tmp___2 ; wait_queue_t __wait ; struct task_struct *tmp___3 ; int tmp___4 ; union drbd_state val ; union drbd_state mask ; int tmp___5 ; wait_queue_t __wait___0 ; struct task_struct *tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; { rv = 0; if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 0U) { return; } else { } { drbd_thread_stop(& mdev->asender); drbd_free_sock(mdev); spin_lock_irq(& mdev->req_lock); _drbd_wait_ee_list_empty(mdev, & mdev->active_ee); _drbd_wait_ee_list_empty(mdev, & mdev->sync_ee); _drbd_wait_ee_list_empty(mdev, & mdev->read_ee); spin_unlock_irq(& mdev->req_lock); drbd_rs_cancel_all(mdev); mdev->rs_total = 0UL; mdev->rs_failed = 0UL; atomic_set(& mdev->rs_pending_cnt, 0); __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); del_timer(& mdev->request_timer); del_timer_sync(& mdev->resync_timer); resync_timer_fn((unsigned long )mdev); drbd_flush_workqueue(mdev); drbd_process_done_ee(mdev); kfree((void const *)mdev->p_uuid); mdev->p_uuid = (u64 *)0; tmp = is_susp(mdev->state); } if (tmp == 0) { { tl_clear(mdev); } } else { } { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Connection closed\n"); drbd_md_sync(mdev); fp = (enum drbd_fencing_p )0; tmp___0 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___0 != 0) { { fp = (enum drbd_fencing_p )(mdev->ldev)->dc.fencing; put_ldev(mdev); } } else { } if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { if ((unsigned int )fp != 0U) { if ((int )mdev->state.ldv_38339.pdsk > 5) { { drbd_try_outdate_peer_async(mdev); } } else { } } else { } } else { } { spin_lock_irq(& mdev->req_lock); os = mdev->state; } if ((int )os.ldv_38339.conn > 1) { { ns = os; ns.ldv_38339.conn = (unsigned char)2; tmp___1 = _drbd_set_state(mdev, ns, (enum chg_state_flags )2, (struct completion *)0); rv = (int )tmp___1; } } else { } { spin_unlock_irq(& mdev->req_lock); } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 16U) { { tmp___2 = atomic_read((atomic_t const *)(& mdev->net_cnt)); } if (tmp___2 == 0) { goto ldv_50158; } else { } { tmp___3 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___3; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_50161: { prepare_to_wait(& mdev->net_cnt_wait, & __wait, 2); tmp___4 = atomic_read((atomic_t const *)(& mdev->net_cnt)); } if (tmp___4 == 0) { goto ldv_50160; } else { } { schedule(); } goto ldv_50161; ldv_50160: { finish_wait(& mdev->net_cnt_wait, & __wait); } ldv_50158: { crypto_free_hash(mdev->cram_hmac_tfm); mdev->cram_hmac_tfm = (struct crypto_hash *)0; kfree((void const *)mdev->net_conf); mdev->net_conf = (struct net_conf *)0; val.i = 0U; val.ldv_38339.conn = (unsigned char)0; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_request_state(mdev, mask, val); } } else { } { tmp___5 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___5 == 0) { goto ldv_50166; } else { } { tmp___6 = get_current(); __wait___0.flags = 0U; __wait___0.private = (void *)tmp___6; __wait___0.func = & autoremove_wake_function; __wait___0.task_list.next = & __wait___0.task_list; __wait___0.task_list.prev = & __wait___0.task_list; } ldv_50169: { prepare_to_wait(& mdev->misc_wait, & __wait___0, 2); tmp___7 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___7 == 0) { goto ldv_50168; } else { } { schedule(); } goto ldv_50169; ldv_50168: { finish_wait(& mdev->misc_wait, & __wait___0); } ldv_50166: { tmp___8 = drbd_release_ee(mdev, & mdev->net_ee); i = (unsigned int )tmp___8; } if (i != 0U) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "net_ee not empty, killed %u entries\n", i); } } else { } { tmp___9 = atomic_read((atomic_t const *)(& mdev->pp_in_use_by_net)); i = (unsigned int )tmp___9; } if (i != 0U) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "pp_in_use_by_net = %d, expected 0\n", i); } } else { } { tmp___10 = atomic_read((atomic_t const *)(& mdev->pp_in_use)); i = (unsigned int )tmp___10; } if (i != 0U) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "pp_in_use = %d, expected 0\n", i); } } else { } { tmp___11 = list_empty((struct list_head const *)(& mdev->read_ee)); } if (tmp___11 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->read_ee) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 3890); } } else { } { tmp___12 = list_empty((struct list_head const *)(& mdev->active_ee)); } if (tmp___12 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->active_ee) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 3891); } } else { } { tmp___13 = list_empty((struct list_head const *)(& mdev->sync_ee)); } if (tmp___13 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->sync_ee) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 3892); } } else { } { tmp___14 = list_empty((struct list_head const *)(& mdev->done_ee)); } if (tmp___14 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->done_ee) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 3893); } } else { } { atomic_set(& (mdev->current_epoch)->epoch_size, 0); tmp___15 = list_empty((struct list_head const *)(& (mdev->current_epoch)->list)); } if (tmp___15 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->current_epoch->list) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 3897); } } else { } return; } } static int drbd_send_handshake(struct drbd_conf *mdev ) { struct p_handshake *p ; int ok ; int tmp ; { { p = & mdev->data.sbuf.handshake; tmp = mutex_lock_interruptible_nested(& mdev->data.mutex, 0U); } if (tmp != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "interrupted during initial handshake\n"); } return (0); } else { } if ((unsigned long )mdev->data.socket == (unsigned long )((struct socket *)0)) { { mutex_unlock(& mdev->data.mutex); } return (0); } else { } { memset((void *)p, 0, 80UL); p->protocol_min = 1442840576U; p->protocol_max = 1610612736U; ok = _drbd_send_cmd(mdev, mdev->data.socket, (enum drbd_packets )65534, (struct p_header80 *)p, 80UL, 0U); mutex_unlock(& mdev->data.mutex); } return (ok); } } static int drbd_do_handshake(struct drbd_conf *mdev ) { struct p_handshake *p ; int expect ; unsigned int length ; enum drbd_packets cmd ; int rv ; char const *tmp ; struct task_struct *tmp___0 ; int tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; int __min1 ; int __min2 ; int tmp___4 ; { { p = & mdev->data.rbuf.handshake; expect = 72; rv = drbd_send_handshake(mdev); } if (rv == 0) { return (0); } else { } { rv = drbd_recv_header(mdev, & cmd, & length); } if (rv == 0) { return (0); } else { } if ((unsigned int )cmd != 65534U) { { tmp = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "expected HandShake packet, received: %s (0x%04x)\n", tmp, (unsigned int )cmd); } return (-1); } else { } if ((unsigned int )expect != length) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "expected HandShake length: %u, received: %u\n", expect, length); } return (-1); } else { } { rv = drbd_recv(mdev, (void *)(& p->head.payload), (size_t )expect); } if (rv != expect) { { tmp___0 = get_current(); tmp___1 = signal_pending(tmp___0); } if (tmp___1 == 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving handshake packet: l=%u\n", rv); } } else { } return (0); } else { } { tmp___2 = __fswab32(p->protocol_min); p->protocol_min = tmp___2; tmp___3 = __fswab32(p->protocol_max); p->protocol_max = tmp___3; } if (p->protocol_max == 0U) { p->protocol_max = p->protocol_min; } else { } if (p->protocol_min > 96U) { goto incompat; } else if (p->protocol_max <= 85U) { goto incompat; } else { } __min1 = 96; __min2 = (int )p->protocol_max; if (__min1 < __min2) { tmp___4 = __min1; } else { tmp___4 = __min2; } { mdev->agreed_pro_version = tmp___4; _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Handshake successful: Agreed network protocol version %d\n", mdev->agreed_pro_version); } return (1); incompat: { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "incompatible DRBD dialects: I support %d-%d, peer supports %d-%d\n", 86, 96, p->protocol_min, p->protocol_max); } return (-1); } } static int drbd_do_auth(struct drbd_conf *mdev ) { char my_challenge[64U] ; struct scatterlist sg ; char *response ; char *right_response ; char *peers_ch ; unsigned int key_len ; size_t tmp ; unsigned int resp_size ; struct hash_desc desc ; enum drbd_packets cmd ; unsigned int length ; int rv ; char const *tmp___0 ; void *tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; void *tmp___4 ; char const *tmp___5 ; struct task_struct *tmp___6 ; int tmp___7 ; void *tmp___8 ; int tmp___9 ; { { response = (char *)0; right_response = (char *)0; peers_ch = (char *)0; tmp = strlen((char const *)(& (mdev->net_conf)->shared_secret)); key_len = (unsigned int )tmp; desc.tfm = mdev->cram_hmac_tfm; desc.flags = 0U; rv = crypto_hash_setkey(mdev->cram_hmac_tfm, (u8 const *)(& (mdev->net_conf)->shared_secret), key_len); } if (rv != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "crypto_hash_setkey() failed with %d\n", rv); rv = -1; } goto fail; } else { } { get_random_bytes((void *)(& my_challenge), 64); rv = drbd_send_cmd2(mdev, (enum drbd_packets )16, (char *)(& my_challenge), 64UL); } if (rv == 0) { goto fail; } else { } { rv = drbd_recv_header(mdev, & cmd, & length); } if (rv == 0) { goto fail; } else { } if ((unsigned int )cmd != 16U) { { tmp___0 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "expected AuthChallenge packet, received: %s (0x%04x)\n", tmp___0, (unsigned int )cmd); rv = 0; } goto fail; } else { } if (length > 128U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "expected AuthChallenge payload too big.\n"); rv = -1; } goto fail; } else { } { tmp___1 = kmalloc((size_t )length, 16U); peers_ch = (char *)tmp___1; } if ((unsigned long )peers_ch == (unsigned long )((char *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "kmalloc of peers_ch failed\n"); rv = -1; } goto fail; } else { } { rv = drbd_recv(mdev, (void *)peers_ch, (size_t )length); } if ((unsigned int )rv != length) { { tmp___2 = get_current(); tmp___3 = signal_pending(tmp___2); } if (tmp___3 == 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read AuthChallenge: l=%u\n", rv); } } else { } rv = 0; goto fail; } else { } { resp_size = crypto_hash_digestsize(mdev->cram_hmac_tfm); tmp___4 = kmalloc((size_t )resp_size, 16U); response = (char *)tmp___4; } if ((unsigned long )response == (unsigned long )((char *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "kmalloc of response failed\n"); rv = -1; } goto fail; } else { } { sg_init_table(& sg, 1U); sg_set_buf(& sg, (void const *)peers_ch, length); rv = crypto_hash_digest(& desc, & sg, sg.length, (u8 *)response); } if (rv != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "crypto_hash_digest() failed with %d\n", rv); rv = -1; } goto fail; } else { } { rv = drbd_send_cmd2(mdev, (enum drbd_packets )17, response, (size_t )resp_size); } if (rv == 0) { goto fail; } else { } { rv = drbd_recv_header(mdev, & cmd, & length); } if (rv == 0) { goto fail; } else { } if ((unsigned int )cmd != 17U) { { tmp___5 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "expected AuthResponse packet, received: %s (0x%04x)\n", tmp___5, (unsigned int )cmd); rv = 0; } goto fail; } else { } if (length != resp_size) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "expected AuthResponse payload of wrong size\n"); rv = 0; } goto fail; } else { } { rv = drbd_recv(mdev, (void *)response, (size_t )resp_size); } if ((unsigned int )rv != resp_size) { { tmp___6 = get_current(); tmp___7 = signal_pending(tmp___6); } if (tmp___7 == 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving AuthResponse: l=%u\n", rv); } } else { } rv = 0; goto fail; } else { } { tmp___8 = kmalloc((size_t )resp_size, 16U); right_response = (char *)tmp___8; } if ((unsigned long )right_response == (unsigned long )((char *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "kmalloc of right_response failed\n"); rv = -1; } goto fail; } else { } { sg_set_buf(& sg, (void const *)(& my_challenge), 64U); rv = crypto_hash_digest(& desc, & sg, sg.length, (u8 *)right_response); } if (rv != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "crypto_hash_digest() failed with %d\n", rv); rv = -1; } goto fail; } else { } { tmp___9 = memcmp((void const *)response, (void const *)right_response, (size_t )resp_size); rv = tmp___9 == 0; } if (rv != 0) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Peer authenticated using %d bytes of \'%s\' HMAC\n", resp_size, (unsigned char *)(& (mdev->net_conf)->cram_hmac_alg)); } } else { rv = -1; } fail: { kfree((void const *)peers_ch); kfree((void const *)response); kfree((void const *)right_response); } return (rv); } } int drbdd_init(struct drbd_thread *thi ) { struct drbd_conf *mdev ; unsigned int minor ; unsigned int tmp ; int h ; struct task_struct *tmp___0 ; union drbd_state val ; union drbd_state mask ; int tmp___1 ; { { mdev = thi->mdev; tmp = mdev_to_minor(mdev); minor = tmp; tmp___0 = get_current(); sprintf((char *)(& tmp___0->comm), "drbd%d_receiver", minor); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "receiver (re)started\n"); } ldv_50212: { h = drbd_connect(mdev); } if (h == 0) { { drbd_disconnect(mdev); schedule_timeout_interruptible(250L); } } else { } if (h == -1) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Discarding network configuration.\n"); val.i = 0U; val.ldv_38339.conn = (unsigned char)1; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } } else { } if (h == 0) { goto ldv_50212; } else { goto ldv_50213; } ldv_50213: ; if (h > 0) { { tmp___1 = get_net_conf(mdev); } if (tmp___1 != 0) { { drbdd(mdev); put_net_conf(mdev); } } else { } } else { } { drbd_disconnect(mdev); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "receiver terminated\n"); } return (0); } } static int got_RqSReply(struct drbd_conf *mdev , struct p_header80 *h ) { struct p_req_state_reply *p ; int retcode ; __u32 tmp ; char const *tmp___0 ; { { p = (struct p_req_state_reply *)h; tmp = __fswab32(p->retcode); retcode = (int )tmp; } if (retcode > 0) { { set_bit(9U, (unsigned long volatile *)(& mdev->flags)); } } else { { set_bit(10U, (unsigned long volatile *)(& mdev->flags)); tmp___0 = drbd_set_st_err_str((enum drbd_state_rv )retcode); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Requested state change failed by peer: %s (%d)\n", tmp___0, retcode); } } { __wake_up(& mdev->state_wait, 3U, 1, (void *)0); } return (1); } } static int got_Ping(struct drbd_conf *mdev , struct p_header80 *h ) { int tmp ; { { tmp = drbd_send_ping_ack(mdev); } return (tmp); } } static int got_PingAck(struct drbd_conf *mdev , struct p_header80 *h ) { int tmp ; { { ((mdev->meta.socket)->sk)->sk_rcvtimeo = (long )((mdev->net_conf)->ping_int * 250); tmp = test_and_set_bit(26, (unsigned long volatile *)(& mdev->flags)); } if (tmp == 0) { { __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); } } else { } return (1); } } static int got_IsInSync(struct drbd_conf *mdev , struct p_header80 *h ) { struct p_block_ack *p ; sector_t sector ; __u64 tmp ; int blksize ; __u32 tmp___0 ; __u32 tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { { p = (struct p_block_ack *)h; tmp = __fswab64(p->sector); sector = (sector_t )tmp; tmp___0 = __fswab32(p->blksize); blksize = (int )tmp___0; } if (mdev->agreed_pro_version <= 88) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->agreed_pro_version >= 89 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 4240); } } else { } { tmp___1 = __fswab32(p->seq_num); update_peer_seq(mdev, tmp___1); tmp___2 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___2 != 0) { { drbd_rs_complete_io(mdev, sector); __drbd_set_in_sync(mdev, sector, blksize, "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", (unsigned int const )4246U); mdev->rs_same_csum = mdev->rs_same_csum + (unsigned long )(blksize >> 12); put_ldev(mdev); } } else { } { atomic_dec(& mdev->rs_pending_cnt); tmp___4 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); } if (tmp___4 < 0) { { tmp___3 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "got_IsInSync", 4251, tmp___3); } } else { } { atomic_add(blksize >> 9, & mdev->rs_sect_in); } return (1); } } static struct drbd_request *_ack_id_to_req(struct drbd_conf *mdev , u64 id , sector_t sector ) { struct hlist_head *slot ; struct hlist_head *tmp ; struct hlist_node *n ; struct drbd_request *req ; struct hlist_node const *__mptr ; { { tmp = tl_hash_slot(mdev, sector); slot = tmp; n = slot->first; } goto ldv_50252; ldv_50251: ; if ((unsigned long )req == (unsigned long )id) { if (req->sector != sector) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "_ack_id_to_req: found req %p but it has wrong sector (%llus versus %llus)\n", req, (unsigned long long )req->sector, (unsigned long long )sector); } goto ldv_50250; } else { } return (req); } else { } n = n->next; ldv_50252: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)n; req = (struct drbd_request *)__mptr + 0x0fffffffffffffd8UL; goto ldv_50251; } else { goto ldv_50250; } ldv_50250: ; return ((struct drbd_request *)0); } } static int validate_req_change_req_state(struct drbd_conf *mdev , u64 id , sector_t sector , req_validator_fn *validator , char const *func , enum drbd_req_event what ) { struct drbd_request *req ; struct bio_and_error m ; long tmp ; { { spin_lock_irq(& mdev->req_lock); req = (*validator)(mdev, id, sector); tmp = __builtin_expect((long )((unsigned long )req == (unsigned long )((struct drbd_request *)0)), 0L); } if (tmp != 0L) { { spin_unlock_irq(& mdev->req_lock); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: failed to find req %p, sector %llus\n", func, (void *)id, (unsigned long long )sector); } return (0); } else { } { __req_mod(req, what, & m); spin_unlock_irq(& mdev->req_lock); } if ((unsigned long )m.bio != (unsigned long )((struct bio *)0)) { { complete_master_bio(mdev, & m); } } else { } return (1); } } static int got_BlockAck(struct drbd_conf *mdev , struct p_header80 *h ) { struct p_block_ack *p ; sector_t sector ; __u64 tmp ; int blksize ; __u32 tmp___0 ; enum drbd_req_event what ; __u32 tmp___1 ; int tmp___2 ; int tmp___3 ; __u16 tmp___4 ; int tmp___5 ; { { p = (struct p_block_ack *)h; tmp = __fswab64(p->sector); sector = (sector_t )tmp; tmp___0 = __fswab32(p->blksize); blksize = (int )tmp___0; tmp___1 = __fswab32(p->seq_num); update_peer_seq(mdev, tmp___1); } if (p->block_id == 0x0fffffffffffffffULL) { { __drbd_set_in_sync(mdev, sector, blksize, "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", (unsigned int const )4318U); atomic_dec(& mdev->rs_pending_cnt); tmp___3 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); } if (tmp___3 < 0) { { tmp___2 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "got_BlockAck", 4319, tmp___2); } } else { } return (1); } else { } { tmp___4 = __fswab16((__u16 )((int )h->command)); } if ((int )tmp___4 == 23) { goto case_23; } else if ((int )tmp___4 == 22) { goto case_22; } else if ((int )tmp___4 == 21) { goto case_21; } else if ((int )tmp___4 == 24) { goto case_24; } else { goto switch_default; if (0) { case_23: ; if ((mdev->net_conf)->wire_protocol != 3) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->net_conf->wire_protocol == DRBD_PROT_C ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 4324); } } else { } what = (enum drbd_req_event )14; goto ldv_50280; case_22: ; if ((mdev->net_conf)->wire_protocol != 3) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->net_conf->wire_protocol == DRBD_PROT_C ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 4328); } } else { } what = (enum drbd_req_event )13; goto ldv_50280; case_21: ; if ((mdev->net_conf)->wire_protocol != 2) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->net_conf->wire_protocol == DRBD_PROT_B ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 4332); } } else { } what = (enum drbd_req_event )12; goto ldv_50280; case_24: ; if ((mdev->net_conf)->wire_protocol != 3) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->net_conf->wire_protocol == DRBD_PROT_C ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 4336); } } else { } what = (enum drbd_req_event )15; goto ldv_50280; switch_default: { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 4340); } return (0); } else { } } ldv_50280: { tmp___5 = validate_req_change_req_state(mdev, p->block_id, sector, & _ack_id_to_req, "got_BlockAck", what); } return (tmp___5); } } static int got_NegAck(struct drbd_conf *mdev , struct p_header80 *h ) { struct p_block_ack *p ; sector_t sector ; __u64 tmp ; int size ; __u32 tmp___0 ; struct drbd_request *req ; struct bio_and_error m ; __u32 tmp___1 ; int tmp___2 ; int tmp___3 ; { { p = (struct p_block_ack *)h; tmp = __fswab64(p->sector); sector = (sector_t )tmp; tmp___0 = __fswab32(p->blksize); size = (int )tmp___0; tmp___1 = __fswab32(p->seq_num); update_peer_seq(mdev, tmp___1); } if (p->block_id == 0x0fffffffffffffffULL) { { atomic_dec(& mdev->rs_pending_cnt); tmp___3 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); } if (tmp___3 < 0) { { tmp___2 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "got_NegAck", 4359, tmp___2); } } else { } { drbd_rs_failed_io(mdev, sector, size); } return (1); } else { } { spin_lock_irq(& mdev->req_lock); req = _ack_id_to_req(mdev, p->block_id, sector); } if ((unsigned long )req == (unsigned long )((struct drbd_request *)0)) { { spin_unlock_irq(& mdev->req_lock); } if ((mdev->net_conf)->wire_protocol == 1) { { __drbd_set_out_of_sync(mdev, sector, size, "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", (unsigned int const )4376U); } return (1); } else if ((mdev->net_conf)->wire_protocol == 2) { { __drbd_set_out_of_sync(mdev, sector, size, "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", (unsigned int const )4376U); } return (1); } else { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: failed to find req %p, sector %llus\n", "got_NegAck", (void *)p->block_id, (unsigned long long )sector); } return (0); } } else { } { __req_mod(req, (enum drbd_req_event )16, & m); spin_unlock_irq(& mdev->req_lock); } if ((unsigned long )m.bio != (unsigned long )((struct bio *)0)) { { complete_master_bio(mdev, & m); } } else { } return (1); } } static int got_NegDReply(struct drbd_conf *mdev , struct p_header80 *h ) { struct p_block_ack *p ; sector_t sector ; __u64 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; int tmp___2 ; { { p = (struct p_block_ack *)h; tmp = __fswab64(p->sector); sector = (sector_t )tmp; tmp___0 = __fswab32(p->seq_num); update_peer_seq(mdev, tmp___0); tmp___1 = __fswab32(p->blksize); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Got NegDReply; Sector %llus, len %u; Fail original request.\n", (unsigned long long )sector, tmp___1); tmp___2 = validate_req_change_req_state(mdev, p->block_id, sector, & _ar_id_to_req, "got_NegDReply", (enum drbd_req_event )16); } return (tmp___2); } } static int got_NegRSDReply(struct drbd_conf *mdev , struct p_header80 *h ) { sector_t sector ; int size ; struct p_block_ack *p ; __u64 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; int tmp___2 ; int tmp___3 ; __u16 tmp___4 ; int tmp___5 ; { { p = (struct p_block_ack *)h; tmp = __fswab64(p->sector); sector = (sector_t )tmp; tmp___0 = __fswab32(p->blksize); size = (int )tmp___0; tmp___1 = __fswab32(p->seq_num); update_peer_seq(mdev, tmp___1); atomic_dec(& mdev->rs_pending_cnt); tmp___3 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); } if (tmp___3 < 0) { { tmp___2 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "got_NegRSDReply", 4416, tmp___2); } } else { } { tmp___5 = _get_ldev_if_state(mdev, (enum drbd_disk_state )2); } if (tmp___5 != 0) { { drbd_rs_complete_io(mdev, sector); tmp___4 = __fswab16((__u16 )((int )h->command)); } if ((int )tmp___4 == 27) { goto case_27; } else if ((int )tmp___4 == 41) { goto case_41; } else { goto switch_default; if (0) { case_27: { drbd_rs_failed_io(mdev, sector, size); } case_41: ; goto ldv_50318; switch_default: { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 4426); put_ldev(mdev); } return (0); } else { } } ldv_50318: { put_ldev(mdev); } } else { } return (1); } } static int got_BarrierAck(struct drbd_conf *mdev , struct p_header80 *h ) { struct p_barrier_ack *p ; __u32 tmp ; int tmp___0 ; int tmp___1 ; { { p = (struct p_barrier_ack *)h; tmp = __fswab32(p->set_size); tl_release(mdev, p->barrier, tmp); } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 352U) { { tmp___0 = atomic_read((atomic_t const *)(& mdev->ap_in_flight)); } if (tmp___0 == 0) { { tmp___1 = test_and_set_bit(29, (unsigned long volatile *)(& (mdev->current_epoch)->flags)); } if (tmp___1 == 0) { { mdev->start_resync_timer.expires = (unsigned long )jiffies + 250UL; add_timer(& mdev->start_resync_timer); } } else { } } else { } } else { } return (1); } } static int got_OVResult(struct drbd_conf *mdev , struct p_header80 *h ) { struct p_block_ack *p ; struct drbd_work *w ; sector_t sector ; int size ; __u64 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u64 tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; void *tmp___6 ; { { p = (struct p_block_ack *)h; tmp = __fswab64(p->sector); sector = (sector_t )tmp; tmp___0 = __fswab32(p->blksize); size = (int )tmp___0; tmp___1 = __fswab32(p->seq_num); update_peer_seq(mdev, tmp___1); tmp___2 = __fswab64(p->block_id); } if (tmp___2 == 4712ULL) { { drbd_ov_oos_found(mdev, sector, size); } } else { { ov_oos_print(mdev); } } { tmp___3 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___3 == 0) { return (1); } else { } { drbd_rs_complete_io(mdev, sector); atomic_dec(& mdev->rs_pending_cnt); tmp___5 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); } if (tmp___5 < 0) { { tmp___4 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "got_OVResult", 4473, tmp___4); } } else { } mdev->ov_left = mdev->ov_left - 1UL; if ((mdev->ov_left & 512UL) != 0UL) { { drbd_advance_rs_marks(mdev, mdev->ov_left); } } else { } if (mdev->ov_left == 0UL) { { tmp___6 = kmalloc(24UL, 16U); w = (struct drbd_work *)tmp___6; } if ((unsigned long )w != (unsigned long )((struct drbd_work *)0)) { { w->cb = & w_ov_finished; drbd_queue_work_front(& mdev->data.work, w); } } else { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "kmalloc(w) failed."); ov_oos_print(mdev); drbd_resync_finished(mdev); } } } else { } { put_ldev(mdev); } return (1); } } static int got_skip(struct drbd_conf *mdev , struct p_header80 *h ) { { return (1); } } static struct asender_cmd *get_asender_cmd(int cmd ) { struct asender_cmd asender_tbl[43U] ; { asender_tbl[0].pkt_size = 0UL; asender_tbl[0].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[1].pkt_size = 0UL; asender_tbl[1].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[2].pkt_size = 0UL; asender_tbl[2].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[3].pkt_size = 0UL; asender_tbl[3].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[4].pkt_size = 0UL; asender_tbl[4].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[5].pkt_size = 0UL; asender_tbl[5].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[6].pkt_size = 0UL; asender_tbl[6].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[7].pkt_size = 0UL; asender_tbl[7].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[8].pkt_size = 0UL; asender_tbl[8].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[9].pkt_size = 0UL; asender_tbl[9].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[10].pkt_size = 0UL; asender_tbl[10].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[11].pkt_size = 0UL; asender_tbl[11].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[12].pkt_size = 0UL; asender_tbl[12].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[13].pkt_size = 0UL; asender_tbl[13].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[14].pkt_size = 0UL; asender_tbl[14].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[15].pkt_size = 0UL; asender_tbl[15].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[16].pkt_size = 0UL; asender_tbl[16].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[17].pkt_size = 0UL; asender_tbl[17].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[18].pkt_size = 0UL; asender_tbl[18].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[19].pkt_size = 8UL; asender_tbl[19].process = & got_Ping; asender_tbl[20].pkt_size = 8UL; asender_tbl[20].process = & got_PingAck; asender_tbl[21].pkt_size = 32UL; asender_tbl[21].process = & got_BlockAck; asender_tbl[22].pkt_size = 32UL; asender_tbl[22].process = & got_BlockAck; asender_tbl[23].pkt_size = 32UL; asender_tbl[23].process = & got_BlockAck; asender_tbl[24].pkt_size = 32UL; asender_tbl[24].process = & got_BlockAck; asender_tbl[25].pkt_size = 32UL; asender_tbl[25].process = & got_NegAck; asender_tbl[26].pkt_size = 32UL; asender_tbl[26].process = & got_NegDReply; asender_tbl[27].pkt_size = 32UL; asender_tbl[27].process = & got_NegRSDReply; asender_tbl[28].pkt_size = 16UL; asender_tbl[28].process = & got_BarrierAck; asender_tbl[29].pkt_size = 12UL; asender_tbl[29].process = & got_RqSReply; asender_tbl[30].pkt_size = 0UL; asender_tbl[30].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[31].pkt_size = 0UL; asender_tbl[31].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[32].pkt_size = 32UL; asender_tbl[32].process = & got_OVResult; asender_tbl[33].pkt_size = 0UL; asender_tbl[33].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[34].pkt_size = 32UL; asender_tbl[34].process = & got_IsInSync; asender_tbl[35].pkt_size = 0UL; asender_tbl[35].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[36].pkt_size = 0UL; asender_tbl[36].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[37].pkt_size = 0UL; asender_tbl[37].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[38].pkt_size = 0UL; asender_tbl[38].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[39].pkt_size = 16UL; asender_tbl[39].process = & got_skip; asender_tbl[40].pkt_size = 0UL; asender_tbl[40].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; asender_tbl[41].pkt_size = 32UL; asender_tbl[41].process = & got_NegRSDReply; asender_tbl[42].pkt_size = 0UL; asender_tbl[42].process = (int (*)(struct drbd_conf * , struct p_header80 * ))0; if (cmd > 42) { return ((struct asender_cmd *)0); } else if ((unsigned long )asender_tbl[cmd].process == (unsigned long )((int (*)(struct drbd_conf * , struct p_header80 * ))0)) { return ((struct asender_cmd *)0); } else { } return ((struct asender_cmd *)(& asender_tbl) + (unsigned long )cmd); } } int drbd_asender(struct drbd_thread *thi ) { struct drbd_conf *mdev ; struct p_header80 *h ; struct asender_cmd *cmd ; int rv ; int len ; void *buf ; int received ; int expect ; int empty ; int ping_timeout_active ; unsigned int tmp ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; struct task_struct *tmp___2 ; int _b ; int tmp___3 ; int tmp___4 ; int tmp___5 ; struct task_struct *tmp___6 ; int tmp___7 ; struct task_struct *tmp___8 ; int tmp___9 ; struct task_struct *tmp___10 ; long tmp___11 ; __u16 tmp___12 ; __u16 tmp___13 ; __u32 tmp___14 ; long tmp___15 ; __u16 tmp___16 ; __u16 tmp___17 ; __u16 tmp___18 ; __u16 tmp___19 ; __u32 tmp___20 ; long tmp___21 ; int _b___0 ; int tmp___22 ; struct asender_cmd *tmp___23 ; enum drbd_thread_state tmp___24 ; union drbd_state val ; union drbd_state mask ; union drbd_state val___0 ; union drbd_state mask___0 ; { { mdev = thi->mdev; h = & mdev->meta.rbuf.header.h80; cmd = (struct asender_cmd *)0; buf = (void *)h; received = 0; expect = 8; ping_timeout_active = 0; tmp = mdev_to_minor(mdev); tmp___0 = get_current(); sprintf((char *)(& tmp___0->comm), "drbd%d_asender", tmp); tmp___1 = get_current(); tmp___1->policy = 2U; tmp___2 = get_current(); tmp___2->rt_priority = 2U; } goto ldv_50369; ldv_50379: { drbd_thread_current_set_cpu(mdev); tmp___4 = test_and_clear_bit(2, (unsigned long volatile *)(& mdev->flags)); } if (tmp___4 != 0) { { tmp___3 = drbd_send_ping(mdev); _b = tmp___3 == 0; } if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_asender", (char *)"!drbd_send_ping(mdev)", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 4555); } } else { } if (_b != 0) { goto reconnect; } else { } ((mdev->meta.socket)->sk)->sk_rcvtimeo = (long )(((mdev->net_conf)->ping_timeo * 250) / 10); ping_timeout_active = 1; } else { } if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) == 0U) { { tmp___5 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); } if (tmp___5 > 3) { { drbd_tcp_cork(mdev->meta.socket); } } else { } } else { } ldv_50368: { clear_bit(1, (unsigned long volatile *)(& mdev->flags)); tmp___6 = get_current(); flush_signals(tmp___6); tmp___7 = drbd_process_done_ee(mdev); } if (tmp___7 == 0) { goto reconnect; } else { } { set_bit(1U, (unsigned long volatile *)(& mdev->flags)); spin_lock_irq(& mdev->req_lock); empty = list_empty((struct list_head const *)(& mdev->done_ee)); spin_unlock_irq(& mdev->req_lock); } if (empty != 0) { goto ldv_50367; } else { } goto ldv_50368; ldv_50367: ; if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) == 0U) { { drbd_tcp_uncork(mdev->meta.socket); } } else { } { tmp___8 = get_current(); tmp___9 = signal_pending(tmp___8); } if (tmp___9 != 0) { goto ldv_50369; } else { } { rv = drbd_recv_short(mdev, mdev->meta.socket, buf, (size_t )(expect - received), 0); clear_bit(1, (unsigned long volatile *)(& mdev->flags)); tmp___10 = get_current(); flush_signals(tmp___10); tmp___11 = __builtin_expect((long )(rv > 0), 1L); } if (tmp___11 != 0L) { received = received + rv; buf = buf + (unsigned long )rv; } else if (rv == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "meta connection shut down by peer.\n"); } goto reconnect; } else if (rv == -11) { if ((long )((unsigned long )jiffies - (unsigned long )((mdev->meta.socket)->sk)->sk_rcvtimeo) - (long )mdev->last_received < 0L) { goto ldv_50369; } else { } if (ping_timeout_active != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "PingAck did not arrive in time.\n"); } goto reconnect; } else { } { set_bit(2U, (unsigned long volatile *)(& mdev->flags)); } goto ldv_50369; } else if (rv == -4) { goto ldv_50369; } else { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "sock_recvmsg returned %d\n", rv); } goto reconnect; } if (received == expect) { if ((unsigned long )cmd == (unsigned long )((struct asender_cmd *)0)) { { tmp___15 = __builtin_expect((long )(h->magic != 1728214147U), 0L); } if (tmp___15 != 0L) { { tmp___12 = __fswab16((__u16 )((int )h->length)); tmp___13 = __fswab16((__u16 )((int )h->command)); tmp___14 = __fswab32(h->magic); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "magic?? on meta m: 0x%08x c: %d l: %d\n", tmp___14, (int )tmp___13, (int )tmp___12); } goto reconnect; } else { } { tmp___16 = __fswab16((__u16 )((int )h->command)); cmd = get_asender_cmd((int )tmp___16); tmp___17 = __fswab16((__u16 )((int )h->length)); len = (int )tmp___17; tmp___21 = __builtin_expect((long )((unsigned long )cmd == (unsigned long )((struct asender_cmd *)0)), 0L); } if (tmp___21 != 0L) { { tmp___18 = __fswab16((__u16 )((int )h->length)); tmp___19 = __fswab16((__u16 )((int )h->command)); tmp___20 = __fswab32(h->magic); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "unknown command?? on meta m: 0x%08x c: %d l: %d\n", tmp___20, (int )tmp___19, (int )tmp___18); } goto disconnect; } else { } expect = (int )cmd->pkt_size; _b___0 = (unsigned long )len != (unsigned long )expect - 8UL; if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_asender", (char *)"len != expect-sizeof(struct p_header80)", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 4649); } } else { } if (_b___0 != 0) { goto reconnect; } else { } } else { } } else { } if (received == expect) { mdev->last_received = (unsigned long )jiffies; if ((unsigned long )cmd == (unsigned long )((struct asender_cmd *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( cmd != NULL ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 4654); } } else { } { tmp___22 = (*(cmd->process))(mdev, h); } if (tmp___22 == 0) { goto reconnect; } else { } { tmp___23 = get_asender_cmd(20); } if ((unsigned long )tmp___23 == (unsigned long )cmd) { ping_timeout_active = 0; } else { } buf = (void *)h; received = 0; expect = 8; cmd = (struct asender_cmd *)0; } else { } ldv_50369: { tmp___24 = get_t_state(thi); } if ((unsigned int )tmp___24 == 1U) { goto ldv_50379; } else { goto ldv_50380; } ldv_50380: ; if (0) { reconnect: { val.i = 0U; val.ldv_38339.conn = (unsigned char)5; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); drbd_md_sync(mdev); } } else { } if (0) { disconnect: { val___0.i = 0U; val___0.ldv_38339.conn = (unsigned char)1; mask___0.i = 0U; mask___0.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask___0, val___0); drbd_md_sync(mdev); } } else { } { clear_bit(1, (unsigned long volatile *)(& mdev->flags)); } if ((int )mdev->state.ldv_38339.conn > 9) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.conn < C_CONNECTED ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_receiver.c.p", 4682); } } else { } { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "asender terminated\n"); } return (0); } } __inline static void hlist_del(struct hlist_node *n ) { { { __hlist_del(n); n->next = (struct hlist_node *)0x0ead000000100100UL; n->pprev = (struct hlist_node **)0x0ead000000200200UL; } return; } } extern void lock_acquire(struct lockdep_map * , unsigned int , int , int , int , struct lockdep_map * , unsigned long ) ; extern void lock_release(struct lockdep_map * , int , unsigned long ) ; extern int cpu_number ; __inline static void __rcu_read_lock(void) { { return; } } extern struct lockdep_map rcu_lock_map ; __inline static void rcu_read_lock(void) { { { __rcu_read_lock(); lock_acquire(& rcu_lock_map, 0U, 0, 2, 1, (struct lockdep_map *)0, (unsigned long )((void *)0)); } return; } } __inline static void rcu_read_unlock(void) { { { lock_release(& rcu_lock_map, 1, (unsigned long )((void *)0)); __rcu_read_lock(); } return; } } __inline static struct gendisk *part_to_disk(struct hd_struct *part ) { struct device const *__mptr ; struct device const *__mptr___0 ; long tmp ; { { tmp = __builtin_expect((long )((unsigned long )part != (unsigned long )((struct hd_struct *)0)), 1L); } if (tmp != 0L) { if (part->partno != 0) { __mptr = (struct device const *)part->__dev.parent; return ((struct gendisk *)__mptr + 0x0fffffffffffff98UL); } else { __mptr___0 = (struct device const *)(& part->__dev); return ((struct gendisk *)__mptr___0 + 0x0fffffffffffff98UL); } } else { } return ((struct gendisk *)0); } } __inline static void part_inc_in_flight(struct hd_struct *part , int rw ) { struct gendisk *tmp ; { { atomic_inc((atomic_t *)(& part->in_flight) + (unsigned long )rw); } if (part->partno != 0) { { tmp = part_to_disk(part); atomic_inc((atomic_t *)(& tmp->part0.in_flight) + (unsigned long )rw); } } else { } return; } } __inline static void part_dec_in_flight(struct hd_struct *part , int rw ) { struct gendisk *tmp ; { { atomic_dec((atomic_t *)(& part->in_flight) + (unsigned long )rw); } if (part->partno != 0) { { tmp = part_to_disk(part); atomic_dec((atomic_t *)(& tmp->part0.in_flight) + (unsigned long )rw); } } else { } return; } } extern void part_round_stats(int , struct hd_struct * ) ; extern struct bio_pair *bio_split(struct bio * , int ) ; extern void bio_pair_release(struct bio_pair * ) ; int allow_oos ; void _tl_add_barrier(struct drbd_conf *mdev , struct drbd_tl_epoch *new ) ; mempool_t *drbd_request_mempool ; int drbd_make_request(struct request_queue *q , struct bio *bio ) ; int drbd_merge_bvec(struct request_queue *q , struct bvec_merge_data *bvm , struct bio_vec *bvec ) ; __inline static void inc_ap_pending(struct drbd_conf *mdev ) { { { atomic_inc(& mdev->ap_pending_cnt); } return; } } __inline static int drbd_get_max_buffers(struct drbd_conf *mdev ) { int mxb ; int tmp ; { { mxb = 1000000; tmp = get_net_conf(mdev); } if (tmp != 0) { { mxb = (mdev->net_conf)->max_buffers; put_net_conf(mdev); } } else { } return (mxb); } } __inline static int drbd_state_is_stable(struct drbd_conf *mdev ) { union drbd_state s ; { s = mdev->state; if ((int )((unsigned int )s.ldv_38339.conn) == 0) { goto case_0; } else if ((int )((unsigned int )s.ldv_38339.conn) == 8) { goto case_8; } else if ((int )((unsigned int )s.ldv_38339.conn) == 10) { goto case_10; } else if ((int )((unsigned int )s.ldv_38339.conn) == 16) { goto case_16; } else if ((int )((unsigned int )s.ldv_38339.conn) == 17) { goto case_17; } else if ((int )((unsigned int )s.ldv_38339.conn) == 18) { goto case_18; } else if ((int )((unsigned int )s.ldv_38339.conn) == 19) { goto case_19; } else if ((int )((unsigned int )s.ldv_38339.conn) == 20) { goto case_20; } else if ((int )((unsigned int )s.ldv_38339.conn) == 21) { goto case_21; } else if ((int )((unsigned int )s.ldv_38339.conn) == 22) { goto case_22; } else if ((int )((unsigned int )s.ldv_38339.conn) == 23) { goto case_23; } else if ((int )((unsigned int )s.ldv_38339.conn) == 1) { goto case_1; } else if ((int )((unsigned int )s.ldv_38339.conn) == 2) { goto case_2; } else if ((int )((unsigned int )s.ldv_38339.conn) == 3) { goto case_3; } else if ((int )((unsigned int )s.ldv_38339.conn) == 4) { goto case_4; } else if ((int )((unsigned int )s.ldv_38339.conn) == 5) { goto case_5; } else if ((int )((unsigned int )s.ldv_38339.conn) == 6) { goto case_6; } else if ((int )((unsigned int )s.ldv_38339.conn) == 7) { goto case_7; } else if ((int )((unsigned int )s.ldv_38339.conn) == 9) { goto case_9; } else if ((int )((unsigned int )s.ldv_38339.conn) == 11) { goto case_11; } else if ((int )((unsigned int )s.ldv_38339.conn) == 12) { goto case_12; } else if ((int )((unsigned int )s.ldv_38339.conn) == 13) { goto case_13; } else if ((int )((unsigned int )s.ldv_38339.conn) == 14) { goto case_14; } else if ((int )((unsigned int )s.ldv_38339.conn) == 15) { goto case_15; } else if ((int )((unsigned int )s.ldv_38339.conn) == 31) { goto case_31; } else if (0) { case_0: ; case_8: ; case_10: ; case_16: ; case_17: ; case_18: ; case_19: ; case_20: ; case_21: ; case_22: ; case_23: ; case_1: ; case_2: ; case_3: ; case_4: ; case_5: ; case_6: ; case_7: ; case_9: ; case_11: ; case_12: ; goto ldv_47785; case_13: ; if (mdev->agreed_pro_version <= 95) { return (0); } else { } goto ldv_47785; case_14: ; case_15: ; case_31: ; return (0); } else { } ldv_47785: ; if ((int )((unsigned int )s.ldv_38339.disk) == 0) { goto case_0___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 4) { goto case_4___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 5) { goto case_5___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 7) { goto case_7___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 8) { goto case_8___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 1) { goto case_1___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 2) { goto case_2___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 3) { goto case_3___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 6) { goto case_6___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 15) { goto case_15___0; } else if (0) { case_0___0: ; case_4___0: ; case_5___0: ; case_7___0: ; case_8___0: ; goto ldv_47795; case_1___0: ; case_2___0: ; case_3___0: ; case_6___0: ; case_15___0: ; return (0); } else { } ldv_47795: ; return (1); } } __inline static bool may_inc_ap_bio(struct drbd_conf *mdev ) { int mxb ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { { tmp = drbd_get_max_buffers(mdev); mxb = tmp; tmp___0 = is_susp(mdev->state); } if (tmp___0 != 0) { return ((bool )0); } else { } { tmp___1 = constant_test_bit(15U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___1 != 0) { return ((bool )0); } else { } { tmp___2 = drbd_state_is_stable(mdev); } if (tmp___2 == 0) { return ((bool )0); } else { } { tmp___3 = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); } if (tmp___3 > mxb) { return ((bool )0); } else { } { tmp___4 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___4 != 0) { return ((bool )0); } else { } return ((bool )1); } } __inline static bool inc_ap_bio_cond(struct drbd_conf *mdev , int count ) { bool rv ; { { rv = (bool )0; spin_lock_irq(& mdev->req_lock); rv = may_inc_ap_bio(mdev); } if ((int )rv) { { atomic_add(count, & mdev->ap_bio_cnt); } } else { } { spin_unlock_irq(& mdev->req_lock); } return (rv); } } __inline static void inc_ap_bio(struct drbd_conf *mdev , int count ) { bool tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; bool tmp___1 ; { { tmp = inc_ap_bio_cond(mdev, count); } if ((int )tmp) { goto ldv_47817; } else { } { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_47820: { prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___1 = inc_ap_bio_cond(mdev, count); } if ((int )tmp___1) { goto ldv_47819; } else { } { schedule(); } goto ldv_47820; ldv_47819: { finish_wait(& mdev->misc_wait, & __wait); } ldv_47817: ; return; } } __inline static void dec_ap_bio(struct drbd_conf *mdev ) { int mxb ; int tmp ; int ap_bio ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { { tmp = drbd_get_max_buffers(mdev); mxb = tmp; tmp___0 = atomic_sub_return(1, & mdev->ap_bio_cnt); ap_bio = tmp___0; } if (ap_bio < 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( ap_bio >= 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/inst/current/envs/linux-3.0.1/linux-3.0.1/drivers/block/drbd/drbd_int.h", 2388); } } else { } if (ap_bio < mxb) { { __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); } } else { } if (ap_bio == 0) { { tmp___2 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___2 != 0) { { tmp___1 = test_and_set_bit(17, (unsigned long volatile *)(& mdev->flags)); } if (tmp___1 == 0) { { drbd_queue_work(& mdev->data.work, & mdev->bm_io_work.w); } } else { } } else { } } else { } return; } } __inline static struct hlist_head *ee_hash_slot___0(struct drbd_conf *mdev , sector_t sector ) { long tmp ; { { tmp = __builtin_expect((long )(mdev->ee_hash_s == 0U), 0L); } if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/inst/current/envs/linux-3.0.1/linux-3.0.1/drivers/block/drbd/drbd_req.h"), "i" (229), "i" (12UL)); ldv_47925: ; goto ldv_47925; } else { } return (mdev->ee_hash + (unsigned long )((unsigned int )(sector >> 8) % mdev->ee_hash_s)); } } __inline static struct hlist_head *tl_hash_slot___0(struct drbd_conf *mdev , sector_t sector ) { long tmp ; { { tmp = __builtin_expect((long )(mdev->tl_hash_s == 0U), 0L); } if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/inst/current/envs/linux-3.0.1/linux-3.0.1/drivers/block/drbd/drbd_req.h"), "i" (238), "i" (12UL)); ldv_47930: ; goto ldv_47930; } else { } return (mdev->tl_hash + (unsigned long )((unsigned int )(sector >> 8) % mdev->tl_hash_s)); } } static struct hlist_head *ar_hash_slot___0(struct drbd_conf *mdev , sector_t sector ) { { return (mdev->app_reads_hash + (unsigned long )((unsigned int )sector % 15U)); } } __inline static struct drbd_request *drbd_req_new(struct drbd_conf *mdev , struct bio *bio_src ) { struct drbd_request *req ; void *tmp ; long tmp___0 ; { { tmp = mempool_alloc(drbd_request_mempool, 16U); req = (struct drbd_request *)tmp; tmp___0 = __builtin_expect((long )((unsigned long )req != (unsigned long )((struct drbd_request *)0)), 1L); } if (tmp___0 != 0L) { { drbd_req_make_private_bio(req, bio_src); } if ((int )bio_src->bi_rw & 1) { req->rq_state = 1024UL; } else { req->rq_state = 0UL; } { req->mdev = mdev; req->master_bio = bio_src; req->epoch = 0U; req->sector = bio_src->bi_sector; req->size = bio_src->bi_size; INIT_HLIST_NODE(& req->collision); INIT_LIST_HEAD(& req->tl_requests); INIT_LIST_HEAD(& req->w.list); } } else { } return (req); } } __inline static void drbd_req_free(struct drbd_request *req ) { { { mempool_free((void *)req, drbd_request_mempool); } return; } } void _req_may_be_done(struct drbd_request *req , struct bio_and_error *m ) ; void request_timer_fn(unsigned long data ) ; __inline static bool drbd_should_do_remote(union drbd_state s ) { int tmp ; { if (*((unsigned int *)(& s) + 0UL) == 65536U) { tmp = 1; } else if ((int )s.ldv_38339.pdsk > 3) { if ((int )s.ldv_38339.conn > 13) { if ((int )s.ldv_38339.conn <= 21) { tmp = 1; } else { tmp = 0; } } else { tmp = 0; } } else { tmp = 0; } return ((bool )tmp); } } __inline static bool drbd_should_send_oos(union drbd_state s ) { int tmp ; { if ((unsigned int )*((unsigned short *)(& s) + 0UL) == 352U) { tmp = 1; } else if ((unsigned int )*((unsigned short *)(& s) + 0UL) == 208U) { tmp = 1; } else { tmp = 0; } return ((bool )tmp); } } static void _drbd_start_io_acct(struct drbd_conf *mdev , struct drbd_request *req , struct bio *bio ) { int rw ; int cpu ; int pfo_ret__ ; void const *__vpp_verify ; unsigned long __ptr ; void const *__vpp_verify___0 ; unsigned long __ptr___0 ; struct gendisk *tmp ; void const *__vpp_verify___1 ; unsigned long __ptr___1 ; void const *__vpp_verify___2 ; unsigned long __ptr___2 ; struct gendisk *tmp___0 ; { { rw = (int )((int const )bio->bi_rw & 1); rcu_read_lock(); } if (1) { goto case_4; } else { goto switch_default; if (0) { __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "m" (cpu_number)); goto ldv_48019; __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_48019; case_4: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_48019; __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_48019; switch_default: { __bad_percpu_size(); } } else { } } ldv_48019: cpu = pfo_ret__; __vpp_verify = (void const *)0; __asm__ ("": "=r" (__ptr): "0" ((mdev->vdisk)->part0.dkstats)); ((struct disk_stats *)(__per_cpu_offset[cpu] + __ptr))->ios[rw] = ((struct disk_stats *)(__per_cpu_offset[cpu] + __ptr))->ios[rw] + 1UL; if ((mdev->vdisk)->part0.partno != 0) { { __vpp_verify___0 = (void const *)0; tmp = part_to_disk(& (mdev->vdisk)->part0); __asm__ ("": "=r" (__ptr___0): "0" (tmp->part0.dkstats)); ((struct disk_stats *)(__per_cpu_offset[cpu] + __ptr___0))->ios[rw] = ((struct disk_stats *)(__per_cpu_offset[cpu] + __ptr___0))->ios[rw] + 1UL; } } else { } __vpp_verify___1 = (void const *)0; __asm__ ("": "=r" (__ptr___1): "0" ((mdev->vdisk)->part0.dkstats)); ((struct disk_stats *)(__per_cpu_offset[cpu] + __ptr___1))->sectors[rw] = ((struct disk_stats *)(__per_cpu_offset[cpu] + __ptr___1))->sectors[rw] + (unsigned long )(bio->bi_size >> 9); if ((mdev->vdisk)->part0.partno != 0) { { __vpp_verify___2 = (void const *)0; tmp___0 = part_to_disk(& (mdev->vdisk)->part0); __asm__ ("": "=r" (__ptr___2): "0" (tmp___0->part0.dkstats)); ((struct disk_stats *)(__per_cpu_offset[cpu] + __ptr___2))->sectors[rw] = ((struct disk_stats *)(__per_cpu_offset[cpu] + __ptr___2))->sectors[rw] + (unsigned long )(bio->bi_size >> 9); } } else { } { part_inc_in_flight(& (mdev->vdisk)->part0, rw); rcu_read_unlock(); } return; } } static void _drbd_end_io_acct(struct drbd_conf *mdev , struct drbd_request *req ) { int rw ; unsigned long duration ; int cpu ; int pfo_ret__ ; void const *__vpp_verify ; unsigned long __ptr ; void const *__vpp_verify___0 ; unsigned long __ptr___0 ; struct gendisk *tmp ; { { rw = (int )(req->master_bio)->bi_rw & 1; duration = (unsigned long )jiffies - req->start_time; rcu_read_lock(); } if (1) { goto case_4; } else { goto switch_default; if (0) { __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "m" (cpu_number)); goto ldv_48052; __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_48052; case_4: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_48052; __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_48052; switch_default: { __bad_percpu_size(); } } else { } } ldv_48052: cpu = pfo_ret__; __vpp_verify = (void const *)0; __asm__ ("": "=r" (__ptr): "0" ((mdev->vdisk)->part0.dkstats)); ((struct disk_stats *)(__per_cpu_offset[cpu] + __ptr))->ticks[rw] = ((struct disk_stats *)(__per_cpu_offset[cpu] + __ptr))->ticks[rw] + duration; if ((mdev->vdisk)->part0.partno != 0) { { __vpp_verify___0 = (void const *)0; tmp = part_to_disk(& (mdev->vdisk)->part0); __asm__ ("": "=r" (__ptr___0): "0" (tmp->part0.dkstats)); ((struct disk_stats *)(__per_cpu_offset[cpu] + __ptr___0))->ticks[rw] = ((struct disk_stats *)(__per_cpu_offset[cpu] + __ptr___0))->ticks[rw] + duration; } } else { } { part_round_stats(cpu, & (mdev->vdisk)->part0); part_dec_in_flight(& (mdev->vdisk)->part0, rw); rcu_read_unlock(); } return; } } static void _req_is_done(struct drbd_conf *mdev , struct drbd_request *req , int const rw ) { unsigned long s ; int tmp ; int tmp___0 ; { { s = req->rq_state; list_del(& req->tl_requests); } if ((int )rw == 1) { if ((s & 128UL) == 0UL) { { __drbd_set_out_of_sync(mdev, req->sector, (int )req->size, "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", (unsigned int const )87U); } } else if ((s & 4UL) == 0UL) { { __drbd_set_out_of_sync(mdev, req->sector, (int )req->size, "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", (unsigned int const )87U); } } else { } if ((s & 128UL) != 0UL) { if ((s & 4UL) != 0UL) { if ((s & 256UL) != 0UL) { { __drbd_set_in_sync(mdev, req->sector, (int )req->size, "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", (unsigned int const )90U); } } else { } } else { } } else { } if ((s & 7UL) != 0UL) { { tmp___0 = _get_ldev_if_state(mdev, (enum drbd_disk_state )2); } if (tmp___0 != 0) { if ((s & 2048UL) != 0UL) { { drbd_al_complete_io(mdev, req->sector); } } else { } { put_ldev(mdev); } } else { { tmp = ___ratelimit(& drbd_ratelimit_state, "_req_is_done"); } if (tmp != 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Should have called drbd_al_complete_io(, %llu), but my Disk seems to have failed :(\n", (unsigned long long )req->sector); } } else { } } } else { } } else { } { drbd_req_free(req); } return; } } static void queue_barrier(struct drbd_conf *mdev ) { struct drbd_tl_epoch *b ; int tmp ; { { tmp = constant_test_bit(0U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp != 0) { return; } else { } { b = mdev->newest_tle; b->w.cb = & w_send_barrier; inc_ap_pending(mdev); drbd_queue_work(& mdev->data.work, & b->w); set_bit(0U, (unsigned long volatile *)(& mdev->flags)); } return; } } static void _about_to_complete_local_write(struct drbd_conf *mdev , struct drbd_request *req ) { unsigned long s ; struct drbd_request *i ; struct drbd_epoch_entry *e ; struct hlist_node *n ; struct hlist_head *slot ; sector_t sector ; int size ; int tmp ; struct hlist_node const *__mptr ; int tmp___0 ; struct hlist_node const *__mptr___0 ; { s = req->rq_state; if ((int )mdev->state.ldv_38339.conn > 9) { if ((s & 32UL) != 0UL) { if (req->epoch == (mdev->newest_tle)->br_number) { { queue_barrier(mdev); } } else { } } else { } } else { } if ((s & 64UL) != 0UL) { if ((unsigned long )mdev->ee_hash != (unsigned long )((struct hlist_head *)0)) { { sector = req->sector; size = (int )((int const )req->size); slot = tl_hash_slot___0(mdev, sector); n = slot->first; } goto ldv_48094; ldv_48093: { tmp = overlaps(sector, size, i->sector, (int )i->size); } if (tmp != 0) { { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "LOGIC BUG: completed: %p %llus +%u; other: %p %llus +%u\n", req, (unsigned long long )sector, size, i, (unsigned long long )i->sector, i->size); } } else { } n = n->next; ldv_48094: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)n; i = (struct drbd_request *)__mptr + 0x0fffffffffffffd8UL; goto ldv_48093; } else { goto ldv_48095; } ldv_48095: { slot = ee_hash_slot___0(mdev, req->sector); n = slot->first; } goto ldv_48101; ldv_48100: { tmp___0 = overlaps(sector, size, e->sector, (int )e->size); } if (tmp___0 != 0) { { __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); } goto ldv_48099; } else { } n = n->next; ldv_48101: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)n; e = (struct drbd_epoch_entry *)__mptr___0 + 0x0fffffffffffffe8UL; goto ldv_48100; } else { goto ldv_48099; } ldv_48099: ; } else { } } else { } return; } } void complete_master_bio(struct drbd_conf *mdev , struct bio_and_error *m ) { { { bio_endio(m->bio, m->error); dec_ap_bio(mdev); } return; } } void _req_may_be_done(struct drbd_request *req , struct bio_and_error *m ) { unsigned long s ; struct drbd_conf *mdev ; int rw ; int tmp ; int ok ; int tmp___0 ; int error ; long tmp___1 ; int tmp___2 ; int tmp___3 ; { s = req->rq_state; mdev = req->mdev; if ((unsigned long )req->master_bio != (unsigned long )((struct bio *)0)) { tmp = (int )(req->master_bio)->bi_rw & 1; } else { tmp = 1; } rw = tmp; if ((s & 16UL) != 0UL) { return; } else { } if ((s & 8UL) != 0UL) { return; } else { } if ((int )s & 1) { return; } else { } if ((unsigned long )req->master_bio != (unsigned long )((struct bio *)0)) { if ((s & 4UL) != 0UL) { tmp___0 = 1; } else if ((s & 128UL) != 0UL) { tmp___0 = 1; } else { tmp___0 = 0; } { ok = tmp___0; tmp___1 = PTR_ERR((void const *)req->private_bio); error = (int )tmp___1; tmp___2 = hlist_unhashed((struct hlist_node const *)(& req->collision)); } if (tmp___2 == 0) { { hlist_del(& req->collision); } } else if ((s & 440UL) != 0UL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( (s & (RQ_NET_MASK & ~RQ_NET_DONE)) == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 273); } } else { } if (rw == 1) { { _about_to_complete_local_write(mdev, req); } } else { } { _drbd_end_io_acct(mdev, req); } if (ok == 0) { if (error != 0) { tmp___3 = error; } else { tmp___3 = -5; } m->error = tmp___3; } else { m->error = 0; } m->bio = req->master_bio; req->master_bio = (struct bio *)0; } else { } if ((s & 504UL) == 0UL) { { _req_is_done(mdev, req, (int const )rw); } } else if ((s & 64UL) != 0UL) { { _req_is_done(mdev, req, (int const )rw); } } else { } return; } } static void _req_may_be_done_not_susp(struct drbd_request *req , struct bio_and_error *m ) { struct drbd_conf *mdev ; int tmp ; { { mdev = req->mdev; tmp = is_susp(mdev->state); } if (tmp == 0) { { _req_may_be_done(req, m); } } else { } return; } } static int _req_conflicts(struct drbd_request *req ) { struct drbd_conf *mdev ; sector_t sector ; int size ; struct drbd_request *i ; struct drbd_epoch_entry *e ; struct hlist_node *n ; struct hlist_head *slot ; int tmp ; int tmp___0 ; int _b ; long tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; struct hlist_node const *__mptr ; long tmp___5 ; struct task_struct *tmp___6 ; struct task_struct *tmp___7 ; int tmp___8 ; struct hlist_node const *__mptr___0 ; { { mdev = req->mdev; sector = req->sector; size = (int )((int const )req->size); tmp = hlist_unhashed((struct hlist_node const *)(& req->collision)); } if (tmp == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( hlist_unhashed(&req->collision) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 339); } } else { } { tmp___0 = get_net_conf(mdev); } if (tmp___0 == 0) { return (0); } else { } _b = mdev->tl_hash_s == 0U; if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "_req_conflicts", (char *)"mdev->tl_hash_s == 0", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 345); } } else { } if (_b != 0) { goto out_no_conflict; } else { } { tmp___1 = __builtin_expect((long )((unsigned long )mdev->tl_hash == (unsigned long )((struct hlist_head *)0)), 0L); } if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p"), "i" (347), "i" (12UL)); ldv_48134: ; goto ldv_48134; } else { } { slot = tl_hash_slot___0(mdev, sector); n = slot->first; } goto ldv_48140; ldv_48139: { tmp___4 = overlaps(i->sector, (int )i->size, sector, size); } if (tmp___4 != 0) { { tmp___2 = get_current(); tmp___3 = get_current(); dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s[%u] Concurrent local write detected! [DISCARD L] new: %llus +%u; pending: %llus +%u\n", (char *)(& tmp___3->comm), tmp___2->pid, (unsigned long long )sector, size, (unsigned long long )i->sector, i->size); } goto out_conflict; } else { } n = n->next; ldv_48140: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)n; i = (struct drbd_request *)__mptr + 0x0fffffffffffffd8UL; goto ldv_48139; } else { goto ldv_48141; } ldv_48141: ; if (mdev->ee_hash_s != 0U) { { tmp___5 = __builtin_expect((long )((unsigned long )mdev->ee_hash == (unsigned long )((struct hlist_head *)0)), 0L); } if (tmp___5 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p"), "i" (365), "i" (12UL)); ldv_48142: ; goto ldv_48142; } else { } { slot = ee_hash_slot___0(mdev, sector); n = slot->first; } goto ldv_48147; ldv_48146: { tmp___8 = overlaps(e->sector, (int )e->size, sector, size); } if (tmp___8 != 0) { { tmp___6 = get_current(); tmp___7 = get_current(); dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s[%u] Concurrent remote write detected! [DISCARD L] new: %llus +%u; pending: %llus +%u\n", (char *)(& tmp___7->comm), tmp___6->pid, (unsigned long long )sector, size, (unsigned long long )e->sector, e->size); } goto out_conflict; } else { } n = n->next; ldv_48147: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)n; e = (struct drbd_epoch_entry *)__mptr___0 + 0x0fffffffffffffe8UL; goto ldv_48146; } else { goto ldv_48148; } ldv_48148: ; } else { } out_no_conflict: { put_net_conf(mdev); } return (0); out_conflict: { put_net_conf(mdev); } return (1); } } int __req_mod(struct drbd_request *req , enum drbd_req_event what , struct bio_and_error *m ) { struct drbd_conf *mdev ; int rv ; struct hlist_head *tmp ; struct hlist_head *tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; { mdev = req->mdev; rv = 0; m->bio = (struct bio *)0; if ((int )((unsigned int )what) == 1) { goto case_1; } else if ((int )((unsigned int )what) == 2) { goto case_2; } else if ((int )((unsigned int )what) == 22) { goto case_22; } else if ((int )((unsigned int )what) == 21) { goto case_21; } else if ((int )((unsigned int )what) == 20) { goto case_20; } else if ((int )((unsigned int )what) == 19) { goto case_19; } else if ((int )((unsigned int )what) == 4) { goto case_4; } else if ((int )((unsigned int )what) == 3) { goto case_3; } else if ((int )((unsigned int )what) == 5) { goto case_5; } else if ((int )((unsigned int )what) == 9) { goto case_9; } else if ((int )((unsigned int )what) == 6) { goto case_6; } else if ((int )((unsigned int )what) == 7) { goto case_7; } else if ((int )((unsigned int )what) == 8) { goto case_8; } else if ((int )((unsigned int )what) == 11) { goto case_11; } else if ((int )((unsigned int )what) == 10) { goto case_10; } else if ((int )((unsigned int )what) == 14) { goto case_14; } else if ((int )((unsigned int )what) == 15) { goto case_15; } else if ((int )((unsigned int )what) == 13) { goto case_13; } else if ((int )((unsigned int )what) == 12) { goto case_12; } else if ((int )((unsigned int )what) == 16) { goto case_16; } else if ((int )((unsigned int )what) == 24) { goto case_24; } else if ((int )((unsigned int )what) == 25) { goto case_25; } else if ((int )((unsigned int )what) == 23) { goto case_23; } else if ((int )((unsigned int )what) == 17) { goto case_17; } else if ((int )((unsigned int )what) == 18) { goto case_18; } else { goto switch_default; if (0) { switch_default: { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "LOGIC BUG in %s:%u\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 415); } goto ldv_48157; case_1: ; if ((req->rq_state & 504UL) != 0UL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !(req->rq_state & RQ_NET_MASK) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 427); } } else { } { req->rq_state = req->rq_state | 8UL; inc_ap_pending(mdev); } goto ldv_48157; case_2: ; if ((req->rq_state & 7UL) != 0UL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !(req->rq_state & RQ_LOCAL_MASK) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 434); } } else { } req->rq_state = req->rq_state | 1UL; goto ldv_48157; case_22: ; if ((int )(req->master_bio)->bi_rw & 1) { mdev->writ_cnt = mdev->writ_cnt + (req->size >> 9); } else { mdev->read_cnt = mdev->read_cnt + (req->size >> 9); } { req->rq_state = req->rq_state | 6UL; req->rq_state = req->rq_state & 0x0ffffffffffffffeUL; _req_may_be_done_not_susp(req, m); put_ldev(mdev); } goto ldv_48157; case_21: { req->rq_state = req->rq_state | 2UL; req->rq_state = req->rq_state & 0x0ffffffffffffffeUL; __drbd_chk_io_error_(mdev, 0, "__req_mod"); _req_may_be_done_not_susp(req, m); put_ldev(mdev); } goto ldv_48157; case_20: { req->rq_state = req->rq_state | 2UL; req->rq_state = req->rq_state & 0x0ffffffffffffffeUL; _req_may_be_done_not_susp(req, m); put_ldev(mdev); } goto ldv_48157; case_19: { __drbd_set_out_of_sync(mdev, req->sector, (int )req->size, "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", (unsigned int const )469U); req->rq_state = req->rq_state | 2UL; req->rq_state = req->rq_state & 0x0ffffffffffffffeUL; } if ((req->rq_state & 504UL) != 0UL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !(req->rq_state & RQ_NET_MASK) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 474); } } else { } { __drbd_chk_io_error_(mdev, 0, "__req_mod"); put_ldev(mdev); } if (*((unsigned int *)mdev + 569UL) != 65536U) { { _req_may_be_done_not_susp(req, m); } goto ldv_48157; } else { } { req->rq_state = req->rq_state | 8UL; inc_ap_pending(mdev); } case_4: { tmp = ar_hash_slot___0(mdev, req->sector); hlist_add_head(& req->collision, tmp); set_bit(4U, (unsigned long volatile *)(& mdev->flags)); } if ((req->rq_state & 8UL) == 0UL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( req->rq_state & RQ_NET_PENDING ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 505); } } else { } req->rq_state = req->rq_state | 16UL; if ((req->rq_state & 7UL) != 0UL) { req->w.cb = & w_read_retry_remote; } else { req->w.cb = & w_send_read_req; } { drbd_queue_work(& mdev->data.work, & req->w); } goto ldv_48157; case_3: { tmp___0 = tl_hash_slot___0(mdev, req->sector); hlist_add_head(& req->collision, tmp___0); set_bit(4U, (unsigned long volatile *)(& mdev->flags)); tmp___1 = constant_test_bit(0U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___1 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( test_bit(CREATE_BARRIER, &mdev->flags) == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 541); } } else { } req->epoch = (mdev->newest_tle)->br_number; (mdev->newest_tle)->n_writes = (mdev->newest_tle)->n_writes + 1; if ((req->rq_state & 8UL) == 0UL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( req->rq_state & RQ_NET_PENDING ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 549); } } else { } { req->rq_state = req->rq_state | 16UL; req->w.cb = & w_send_dblock; drbd_queue_work(& mdev->data.work, & req->w); } if ((mdev->newest_tle)->n_writes >= (mdev->net_conf)->max_epoch_size) { { queue_barrier(mdev); } } else { } goto ldv_48157; case_5: { req->rq_state = req->rq_state | 16UL; req->w.cb = & w_send_oos; drbd_queue_work(& mdev->data.work, & req->w); } goto ldv_48157; case_9: ; case_6: ; case_7: { req->rq_state = req->rq_state & 0x0fffffffffffffefUL; _req_may_be_done_not_susp(req, m); } goto ldv_48157; case_8: ; if ((int )(req->master_bio)->bi_rw & 1) { { atomic_add((int )(req->size >> 9), & mdev->ap_in_flight); } } else { } if ((int )(req->master_bio)->bi_rw & 1) { if ((mdev->net_conf)->wire_protocol == 1) { if ((req->rq_state & 8UL) != 0UL) { { tmp___2 = atomic_dec_and_test(& mdev->ap_pending_cnt); } if (tmp___2 != 0) { { __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); } } else { } { tmp___4 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); } if (tmp___4 < 0) { { tmp___3 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: ap_pending_cnt = %d < 0 !\n", "__req_mod", 589, tmp___3); } } else { } req->rq_state = req->rq_state & 0x0ffffffffffffff7UL; req->rq_state = req->rq_state | 128UL; } else { } } else { } } else { } { req->rq_state = req->rq_state & 0x0fffffffffffffefUL; req->rq_state = req->rq_state | 32UL; _req_may_be_done_not_susp(req, m); } goto ldv_48157; case_11: req->rq_state = req->rq_state & 0x0fffffffffffffefUL; case_10: ; if ((req->rq_state & 8UL) != 0UL) { { tmp___5 = atomic_dec_and_test(& mdev->ap_pending_cnt); } if (tmp___5 != 0) { { __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); } } else { } { tmp___7 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); } if (tmp___7 < 0) { { tmp___6 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: ap_pending_cnt = %d < 0 !\n", "__req_mod", 614, tmp___6); } } else { } } else { } req->rq_state = req->rq_state & 0x0fffffffffffff77UL; req->rq_state = req->rq_state | 64UL; if ((req->rq_state & 32UL) != 0UL) { if ((req->rq_state & 1024UL) != 0UL) { { atomic_sub((int )(req->size >> 9), & mdev->ap_in_flight); } } else { } } else { } if ((req->rq_state & 16UL) == 0UL) { { _req_may_be_done(req, m); } } else { } goto ldv_48157; case_14: req->rq_state = req->rq_state | 256UL; case_15: ; if ((unsigned int )what == 15U) { { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "Got DiscardAck packet %llus +%u! DRBD is not a random data generator!\n", (unsigned long long )req->sector, req->size); } } else { } req->rq_state = req->rq_state | 64UL; case_13: ; case_12: req->rq_state = req->rq_state | 128UL; if ((req->rq_state & 8UL) == 0UL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( req->rq_state & RQ_NET_PENDING ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 655); } } else { } { tmp___8 = atomic_dec_and_test(& mdev->ap_pending_cnt); } if (tmp___8 != 0) { { __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); } } else { } { tmp___10 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); } if (tmp___10 < 0) { { tmp___9 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: ap_pending_cnt = %d < 0 !\n", "__req_mod", 656, tmp___9); } } else { } { atomic_sub((int )(req->size >> 9), & mdev->ap_in_flight); req->rq_state = req->rq_state & 0x0ffffffffffffff7UL; _req_may_be_done_not_susp(req, m); } goto ldv_48157; case_16: ; if ((req->rq_state & 8UL) != 0UL) { { tmp___11 = atomic_dec_and_test(& mdev->ap_pending_cnt); } if (tmp___11 != 0) { { __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); } } else { } { tmp___13 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); } if (tmp___13 < 0) { { tmp___12 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: ap_pending_cnt = %d < 0 !\n", "__req_mod", 665, tmp___12); } } else { } { atomic_sub((int )(req->size >> 9), & mdev->ap_in_flight); } } else { } { req->rq_state = req->rq_state & 0x0fffffffffffff77UL; req->rq_state = req->rq_state | 64UL; _req_may_be_done_not_susp(req, m); } goto ldv_48157; case_24: ; if ((req->rq_state & 2UL) == 0UL) { goto ldv_48157; } else { } { _req_may_be_done(req, m); } goto ldv_48157; case_25: ; if ((req->rq_state & 2UL) == 0UL) { goto ldv_48157; } else { } req->rq_state = req->rq_state & 0x0ffffffffffffffdUL; rv = 2; if ((int )(req->master_bio)->bi_rw & 1) { rv = 1; } else { } { _get_ldev_if_state(mdev, (enum drbd_disk_state )4); req->w.cb = & w_restart_disk_io; drbd_queue_work(& mdev->data.work, & req->w); } goto ldv_48157; case_23: ; if ((req->rq_state & 128UL) == 0UL) { if ((unsigned long )req->w.cb != (unsigned long )((int (*)(struct drbd_conf * , struct drbd_work * , int ))0)) { { drbd_queue_work(& mdev->data.work, & req->w); } if ((req->rq_state & 1024UL) != 0UL) { rv = 1; } else { rv = 2; } } else { } goto ldv_48157; } else { } case_17: ; if ((req->rq_state & 1024UL) == 0UL) { goto ldv_48157; } else { } if ((req->rq_state & 8UL) != 0UL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "FIXME (barrier_acked but pending)\n"); list_move(& req->tl_requests, & mdev->out_of_sequence_requests); } } else { } if ((req->rq_state & 504UL) != 0UL) { req->rq_state = req->rq_state | 64UL; if ((mdev->net_conf)->wire_protocol == 1) { { atomic_sub((int )(req->size >> 9), & mdev->ap_in_flight); } } else { } } else { } { _req_may_be_done(req, m); } goto ldv_48157; case_18: ; if ((req->rq_state & 8UL) == 0UL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( req->rq_state & RQ_NET_PENDING ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 731); } } else { } { tmp___14 = atomic_dec_and_test(& mdev->ap_pending_cnt); } if (tmp___14 != 0) { { __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); } } else { } { tmp___16 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); } if (tmp___16 < 0) { { tmp___15 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: ap_pending_cnt = %d < 0 !\n", "__req_mod", 732, tmp___15); } } else { } { req->rq_state = req->rq_state & 0x0ffffffffffffff7UL; req->rq_state = req->rq_state | 192UL; _req_may_be_done_not_susp(req, m); } goto ldv_48157; } else { } } ldv_48157: ; return (rv); } } static int drbd_may_do_local_read(struct drbd_conf *mdev , sector_t sector , int size ) { unsigned long sbnr ; unsigned long ebnr ; sector_t esector ; sector_t nr_sectors ; int tmp ; { if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 16U) { return (1); } else { } if ((int )mdev->state.ldv_38339.disk > 4) { return (0); } else { } if ((int )mdev->state.ldv_38339.disk <= 3) { return (0); } else { } { nr_sectors = drbd_get_capacity(mdev->this_bdev); esector = ((sector_t )(size >> 9) + sector) - 1UL; } if (sector >= nr_sectors) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( sector < nr_sectors ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 764); } } else { } if (esector >= nr_sectors) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( esector < nr_sectors ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 765); } } else { } { sbnr = sector >> 3; ebnr = esector >> 3; tmp = drbd_bm_count_bits(mdev, (unsigned long const )sbnr, (unsigned long const )ebnr); } return (tmp == 0); } } static int drbd_make_request_common(struct drbd_conf *mdev , struct bio *bio , unsigned long start_time ) { int rw ; int size ; sector_t sector ; struct drbd_tl_epoch *b ; struct drbd_request *req ; int local ; int remote ; int send_oos ; int err ; int ret ; int tmp ; int tmp___0 ; int tmp___1 ; bool tmp___2 ; int tmp___3 ; bool tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; void *tmp___8 ; int tmp___9 ; int tmp___10 ; bool tmp___11 ; bool tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; int tmp___17 ; int tmp___18 ; int tmp___19 ; int congested ; int tmp___20 ; union drbd_state __ns ; union drbd_state __ns___0 ; unsigned int tmp___21 ; unsigned int tmp___22 ; int tmp___23 ; int tmp___24 ; int tmp___25 ; int tmp___26 ; int tmp___27 ; { { rw = (int )((int const )bio->bi_rw & 257); size = (int )((int const )bio->bi_size); sector = bio->bi_sector; b = (struct drbd_tl_epoch *)0; send_oos = 0; err = -5; ret = 0; req = drbd_req_new(mdev, bio); } if ((unsigned long )req == (unsigned long )((struct drbd_request *)0)) { { dec_ap_bio(mdev); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "could not kmalloc() req\n"); bio_endio(bio, -12); } return (0); } else { } { req->start_time = start_time; local = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (local == 0) { { bio_put(req->private_bio); req->private_bio = (struct bio *)0; } } else { } if (rw == 1) { remote = 1; } else { if (local != 0) { { tmp = drbd_may_do_local_read(mdev, sector, size); } if (tmp == 0) { { local = 0; bio_put(req->private_bio); req->private_bio = (struct bio *)0; put_ldev(mdev); } } else { } } else { } if (local == 0) { if ((int )mdev->state.ldv_38339.pdsk > 7) { tmp___0 = 1; } else { tmp___0 = 0; } } else { tmp___0 = 0; } remote = tmp___0; } if (rw == 256) { if ((int )mdev->state.ldv_38339.disk > 3) { if (local == 0) { err = -11; goto fail_and_free_req; } else { } } else { } } else { } if (rw == 1) { if (local != 0) { { tmp___1 = constant_test_bit(28U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___1 == 0) { { req->rq_state = req->rq_state | 2048UL; drbd_al_begin_io(mdev, sector); } } else { } } else { } } else { } if (remote != 0) { { tmp___2 = drbd_should_do_remote(mdev->state); } if ((int )tmp___2) { tmp___3 = 1; } else { tmp___3 = 0; } } else { tmp___3 = 0; } remote = tmp___3; if (rw == 1) { { tmp___4 = drbd_should_send_oos(mdev->state); } if ((int )tmp___4) { tmp___5 = 1; } else { tmp___5 = 0; } } else { tmp___5 = 0; } send_oos = tmp___5; if (remote != 0) { if (send_oos != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !(remote && send_oos) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 846); } } else { } } else { } if (local == 0) { if (remote == 0) { { tmp___7 = is_susp(mdev->state); } if (tmp___7 == 0) { { tmp___6 = ___ratelimit(& drbd_ratelimit_state, "drbd_make_request_common"); } if (tmp___6 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "IO ERROR: neither local nor remote disk\n"); } } else { } goto fail_free_complete; } else { } } else { } } else { } if (rw == 1) { if (remote != 0) { goto _L; } else if (send_oos != 0) { _L: if ((unsigned long )mdev->unused_spare_tle == (unsigned long )((struct drbd_tl_epoch *)0)) { { tmp___9 = constant_test_bit(0U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___9 != 0) { allocate_barrier: { tmp___8 = kmalloc(56UL, 16U); b = (struct drbd_tl_epoch *)tmp___8; } if ((unsigned long )b == (unsigned long )((struct drbd_tl_epoch *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Failed to alloc barrier.\n"); err = -12; } goto fail_free_complete; } else { } } else { } } else { } } else { } } else { } { spin_lock_irq(& mdev->req_lock); tmp___10 = is_susp(mdev->state); } if (tmp___10 != 0) { { ret = 1; spin_unlock_irq(& mdev->req_lock); } goto fail_free_complete; } else { } if (remote != 0) { goto _L___0; } else if (send_oos != 0) { _L___0: { tmp___11 = drbd_should_do_remote(mdev->state); remote = (int )tmp___11; } if (rw == 1) { { tmp___12 = drbd_should_send_oos(mdev->state); } if ((int )tmp___12) { tmp___13 = 1; } else { tmp___13 = 0; } } else { tmp___13 = 0; } send_oos = tmp___13; if (remote != 0) { if (send_oos != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !(remote && send_oos) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 888); } } else { } } else { } if (remote == 0) { if (send_oos == 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "lost connection while grabbing the req_lock!\n"); } } else { } } else { } if (local == 0) { if (remote == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "IO ERROR: neither local nor remote disk\n"); spin_unlock_irq(& mdev->req_lock); } goto fail_free_complete; } else { } } else { } } else { } if ((unsigned long )b != (unsigned long )((struct drbd_tl_epoch *)0)) { if ((unsigned long )mdev->unused_spare_tle == (unsigned long )((struct drbd_tl_epoch *)0)) { mdev->unused_spare_tle = b; b = (struct drbd_tl_epoch *)0; } else { } } else { } if (rw == 1) { if (remote != 0) { goto _L___1; } else if (send_oos != 0) { _L___1: if ((unsigned long )mdev->unused_spare_tle == (unsigned long )((struct drbd_tl_epoch *)0)) { { tmp___14 = constant_test_bit(0U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___14 != 0) { { spin_unlock_irq(& mdev->req_lock); } goto allocate_barrier; } else { } } else { } } else { } } else { } { _drbd_start_io_acct(mdev, req, bio); } if (remote != 0) { goto _L___4; } else if (send_oos != 0) { _L___4: if ((unsigned long )mdev->unused_spare_tle != (unsigned long )((struct drbd_tl_epoch *)0)) { { tmp___16 = test_and_clear_bit(0, (unsigned long volatile *)(& mdev->flags)); } if (tmp___16 != 0) { { _tl_add_barrier(mdev, mdev->unused_spare_tle); mdev->unused_spare_tle = (struct drbd_tl_epoch *)0; } } else { goto _L___3; } } else { goto _L___3; } } else _L___3: if (remote != 0) { if (rw == 1) { { tmp___15 = constant_test_bit(0U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___15 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !(remote && rw == WRITE && test_bit(CREATE_BARRIER, &mdev->flags)) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 932); } } else { } } else { } } else { } if (remote != 0) { { _req_mod(req, (enum drbd_req_event )1); } } else { } if (local != 0) { { _req_mod(req, (enum drbd_req_event )2); } } else { } if (rw == 1) { { tmp___17 = _req_conflicts(req); } if (tmp___17 != 0) { goto fail_conflicting; } else { } } else { } { list_add_tail(& req->tl_requests, & (mdev->newest_tle)->requests); } if (remote != 0) { if (rw == 1) { tmp___18 = 3; } else { tmp___18 = 4; } { _req_mod(req, (enum drbd_req_event )tmp___18); } } else { } if (send_oos != 0) { { tmp___19 = __drbd_set_out_of_sync(mdev, sector, size, "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", (unsigned int const )974U); } if (tmp___19 != 0) { { _req_mod(req, (enum drbd_req_event )5); } } else { } } else { } if (remote != 0) { if ((mdev->net_conf)->on_congestion != 0) { if (mdev->agreed_pro_version > 95) { congested = 0; if ((mdev->net_conf)->cong_fill != 0) { { tmp___20 = atomic_read((atomic_t const *)(& mdev->ap_in_flight)); } if (tmp___20 >= (mdev->net_conf)->cong_fill) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Congestion-fill threshold reached\n"); congested = 1; } } else { } } else { } if ((mdev->act_log)->used >= (unsigned int )(mdev->net_conf)->cong_extents) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Congestion-extents threshold reached\n"); congested = 1; } } else { } if (congested != 0) { { queue_barrier(mdev); } if ((mdev->net_conf)->on_congestion == 1) { { __ns.i = mdev->state.i; __ns.ldv_38339.conn = (unsigned char)22; _drbd_set_state(mdev, __ns, (enum chg_state_flags )0, (struct completion *)0); } } else { { __ns___0.i = mdev->state.i; __ns___0.ldv_38339.conn = (unsigned char)1; _drbd_set_state(mdev, __ns___0, (enum chg_state_flags )0, (struct completion *)0); } } } else { } } else { } } else { } } else { } { spin_unlock_irq(& mdev->req_lock); kfree((void const *)b); } if (local != 0) { { (req->private_bio)->bi_bdev = (mdev->ldev)->backing_bdev; tmp___24 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___24 != 0) { if (rw != 1) { if (rw == 0) { tmp___21 = 5U; } else { tmp___21 = 6U; } tmp___22 = tmp___21; } else { tmp___22 = 4U; } { tmp___23 = drbd_insert_fault(mdev, tmp___22); } if (tmp___23 != 0) { { bio_endio(req->private_bio, -5); } } else { { generic_make_request(req->private_bio); } } { put_ldev(mdev); } } else { { bio_endio(req->private_bio, -5); } } } else { } return (0); fail_conflicting: { _drbd_end_io_acct(mdev, req); spin_unlock_irq(& mdev->req_lock); } if (remote != 0) { { tmp___25 = atomic_dec_and_test(& mdev->ap_pending_cnt); } if (tmp___25 != 0) { { __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); } } else { } { tmp___27 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); } if (tmp___27 < 0) { { tmp___26 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: ap_pending_cnt = %d < 0 !\n", "drbd_make_request_common", 1037, tmp___26); } } else { } } else { } err = 0; fail_free_complete: ; if ((req->rq_state & 2048UL) != 0UL) { { drbd_al_complete_io(mdev, sector); } } else { } fail_and_free_req: ; if (local != 0) { { bio_put(req->private_bio); req->private_bio = (struct bio *)0; put_ldev(mdev); } } else { } if (ret == 0) { { bio_endio(bio, err); } } else { } { drbd_req_free(req); dec_ap_bio(mdev); kfree((void const *)b); } return (ret); } } static int drbd_fail_request_early(struct drbd_conf *mdev , int is_write ) { char *tmp ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; int tmp___2 ; { if ((unsigned int )*((unsigned char *)mdev + 2276UL) != 1U) { if (allow_oos == 0) { goto _L; } else if (is_write != 0) { _L: { tmp___2 = ___ratelimit(& drbd_ratelimit_state, "drbd_fail_request_early"); } if (tmp___2 != 0) { if (is_write != 0) { tmp = (char *)"WRITE"; } else { tmp = (char *)"READ"; } { tmp___0 = get_current(); tmp___1 = get_current(); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Process %s[%u] tried to %s; since we are not in Primary state, we cannot allow this\n", (char *)(& tmp___1->comm), tmp___0->pid, tmp); } } else { } return (1); } else { } } else { } return (0); } } int drbd_make_request(struct request_queue *q , struct bio *bio ) { unsigned int s_enr ; unsigned int e_enr ; struct drbd_conf *mdev ; unsigned long start_time ; int tmp ; int tmp___0 ; long tmp___1 ; struct bio_pair *bp ; sector_t sect ; int sps ; int mask ; sector_t first_sectors ; int tmp___2 ; int tmp___3 ; { { mdev = (struct drbd_conf *)q->queuedata; tmp = drbd_fail_request_early(mdev, (int )bio->bi_rw & 1); } if (tmp != 0) { { bio_endio(bio, -1); } return (0); } else { } start_time = (unsigned long )jiffies; if (bio->bi_size == 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( bio->bi_size > 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 1099); } } else { } if ((bio->bi_size & 511U) != 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( (bio->bi_size & 0x1ff) == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 1100); } } else { } if ((unsigned int )bio->bi_idx != 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( bio->bi_idx == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 1101); } } else { } { s_enr = (unsigned int )(bio->bi_sector >> 8); e_enr = (unsigned int )(((bio->bi_sector + (sector_t )(bio->bi_size >> 9)) - 1UL) >> 8); tmp___1 = __builtin_expect((long )(s_enr == e_enr), 1L); } if (tmp___1 != 0L) { { inc_ap_bio(mdev, 1); tmp___0 = drbd_make_request_common(mdev, bio, start_time); } return (tmp___0); } else { } if ((unsigned int )bio->bi_vcnt != 1U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "bio would need to, but cannot, be split: (vcnt=%u,idx=%u,size=%u,sector=%llu)\n", (int )bio->bi_vcnt, (int )bio->bi_idx, bio->bi_size, (unsigned long long )bio->bi_sector); bio_endio(bio, -22); } } else if ((unsigned int )bio->bi_idx != 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "bio would need to, but cannot, be split: (vcnt=%u,idx=%u,size=%u,sector=%llu)\n", (int )bio->bi_vcnt, (int )bio->bi_idx, bio->bi_size, (unsigned long long )bio->bi_sector); bio_endio(bio, -22); } } else if (bio->bi_size > 131072U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "bio would need to, but cannot, be split: (vcnt=%u,idx=%u,size=%u,sector=%llu)\n", (int )bio->bi_vcnt, (int )bio->bi_idx, bio->bi_size, (unsigned long long )bio->bi_sector); bio_endio(bio, -22); } } else { { sect = bio->bi_sector; sps = 256; mask = sps + -1; first_sectors = (unsigned long )sps - ((unsigned long )mask & sect); bp = bio_split(bio, (int )first_sectors); inc_ap_bio(mdev, 3); } if (s_enr + 1U != e_enr) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( e_enr == s_enr + 1 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_req.c.p", 1146); } } else { } goto ldv_48255; ldv_48254: { inc_ap_bio(mdev, 1); } ldv_48255: { tmp___2 = drbd_make_request_common(mdev, & bp->bio1, start_time); } if (tmp___2 != 0) { goto ldv_48254; } else { goto ldv_48256; } ldv_48256: ; goto ldv_48258; ldv_48257: { inc_ap_bio(mdev, 1); } ldv_48258: { tmp___3 = drbd_make_request_common(mdev, & bp->bio2, start_time); } if (tmp___3 != 0) { goto ldv_48257; } else { goto ldv_48259; } ldv_48259: { dec_ap_bio(mdev); bio_pair_release(bp); } } return (0); } } int drbd_merge_bvec(struct request_queue *q , struct bvec_merge_data *bvm , struct bio_vec *bvec ) { struct drbd_conf *mdev ; unsigned int bio_offset ; unsigned int bio_size ; int limit ; int backing_limit ; struct request_queue *b ; int _min1 ; int _min2 ; int tmp ; int tmp___0 ; { mdev = (struct drbd_conf *)q->queuedata; bio_offset = (unsigned int )bvm->bi_sector << 9; bio_size = bvm->bi_size; limit = (int )(131072U - ((bio_offset & 131071U) + bio_size)); if (limit < 0) { limit = 0; } else { } if (bio_size == 0U) { if ((unsigned int )limit <= bvec->bv_len) { limit = (int )bvec->bv_len; } else if (limit != 0) { { tmp___0 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___0 != 0) { b = (((mdev->ldev)->backing_bdev)->bd_disk)->queue; if ((unsigned long )b->merge_bvec_fn != (unsigned long )((merge_bvec_fn *)0)) { { backing_limit = (*(b->merge_bvec_fn))(b, bvm, bvec); _min1 = limit; _min2 = backing_limit; } if (_min1 < _min2) { tmp = _min1; } else { tmp = _min2; } limit = tmp; } else { } { put_ldev(mdev); } } else { } } else { } } else { } return (limit); } } void request_timer_fn(unsigned long data ) { struct drbd_conf *mdev ; struct drbd_request *req ; struct list_head *le ; unsigned long et ; int tmp ; int tmp___0 ; struct list_head const *__mptr ; union drbd_state __ns ; { { mdev = (struct drbd_conf *)data; et = 0UL; tmp = get_net_conf(mdev); } if (tmp != 0) { { et = (unsigned long )((((mdev->net_conf)->timeout * 250) / 10) * (mdev->net_conf)->ko_count); put_net_conf(mdev); } } else { } if (et == 0UL) { return; } else if ((int )mdev->state.ldv_38339.conn <= 8) { return; } else { } { spin_lock_irq(& mdev->req_lock); le = & (mdev->oldest_tle)->requests; tmp___0 = list_empty((struct list_head const *)le); } if (tmp___0 != 0) { { spin_unlock_irq(& mdev->req_lock); mod_timer(& mdev->request_timer, (unsigned long )jiffies + et); } return; } else { } le = le->prev; __mptr = (struct list_head const *)le; req = (struct drbd_request *)__mptr + 0x0fffffffffffffb8UL; if ((long )jiffies - (long )(req->start_time + et) >= 0L) { if ((req->rq_state & 8UL) != 0UL) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Remote failed to finish a request within ko-count * timeout\n"); __ns.i = mdev->state.i; __ns.ldv_38339.conn = (unsigned char)3; _drbd_set_state(mdev, __ns, (enum chg_state_flags )2, (struct completion *)0); } } else { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local backing block device frozen?\n"); mod_timer(& mdev->request_timer, (unsigned long )jiffies + et); } } } else { { mod_timer(& mdev->request_timer, req->start_time + et); } } { spin_unlock_irq(& mdev->req_lock); } return; } } __inline static int mutex_is_locked(struct mutex *lock ) { int tmp ; { { tmp = atomic_read((atomic_t const *)(& lock->count)); } return (tmp != 1); } } __inline static struct request_queue *bdev_get_queue(struct block_device *bdev ) { { return ((bdev->bd_disk)->queue); } } __inline static unsigned short queue_logical_block_size(struct request_queue *q ) { int retval ; { retval = 512; if ((unsigned long )q != (unsigned long )((struct request_queue *)0)) { if ((unsigned int )q->limits.logical_block_size != 0U) { retval = (int )q->limits.logical_block_size; } else { } } else { } return ((unsigned short )retval); } } __inline static unsigned short bdev_logical_block_size(struct block_device *bdev ) { struct request_queue *tmp ; unsigned short tmp___0 ; { { tmp = bdev_get_queue(bdev); tmp___0 = queue_logical_block_size(tmp); } return (tmp___0); } } extern void lc_reset(struct lru_cache * ) ; extern void lc_set(struct lru_cache * , unsigned int , int ) ; extern void lc_del(struct lru_cache * , struct lc_element * ) ; extern struct lc_element *lc_try_get(struct lru_cache * , unsigned int ) ; extern struct lc_element *lc_get(struct lru_cache * , unsigned int ) ; extern unsigned int lc_put(struct lru_cache * , struct lc_element * ) ; extern void lc_changed(struct lru_cache * , struct lc_element * ) ; __inline static int lc_try_lock(struct lru_cache *lc ) { int tmp ; { { tmp = test_and_set_bit(1, (unsigned long volatile *)(& lc->flags)); } return (tmp == 0); } } __inline static void lc_unlock(struct lru_cache *lc ) { { { clear_bit(1, (unsigned long volatile *)(& lc->flags)); __asm__ volatile ("": : : "memory"); } return; } } __inline static int lc_is_used(struct lru_cache *lc , unsigned int enr ) { struct lc_element *e ; struct lc_element *tmp ; int tmp___0 ; { { tmp = lc_find(lc, enr); e = tmp; } if ((unsigned long )e != (unsigned long )((struct lc_element *)0)) { if (e->refcnt != 0U) { tmp___0 = 1; } else { tmp___0 = 0; } } else { tmp___0 = 0; } return (tmp___0); } } extern struct lc_element *lc_element_by_index(struct lru_cache * , unsigned int ) ; extern unsigned int lc_index_of(struct lru_cache * , struct lc_element * ) ; int drbd_md_sync_page_io(struct drbd_conf *mdev , struct drbd_backing_dev *bdev , sector_t sector , int rw ) ; int drbd_al_read_log(struct drbd_conf *mdev , struct drbd_backing_dev *bdev ) ; void drbd_al_apply_to_bm(struct drbd_conf *mdev ) ; void drbd_al_shrink(struct drbd_conf *mdev ) ; void drbd_bcast_sync_progress(struct drbd_conf *mdev ) ; int w_al_write_transaction(struct drbd_conf *mdev , struct drbd_work *w , int unused ) ; static int _drbd_md_sync_page_io(struct drbd_conf *mdev , struct drbd_backing_dev *bdev , struct page *page , sector_t sector , int rw , int size ) { struct bio *bio ; struct drbd_md_io md_io ; int ok ; int tmp ; int tmp___0 ; unsigned int tmp___1 ; int tmp___2 ; int tmp___3 ; { { md_io.mdev = mdev; init_completion(& md_io.event); md_io.error = 0; } if (rw & 1) { { tmp = constant_test_bit(14U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp == 0) { rw = rw | 8392704; } else { } } else { } { rw = rw | 16; bio = bio_alloc(16U, 1); bio->bi_bdev = bdev->md_bdev; bio->bi_sector = sector; tmp___0 = bio_add_page(bio, page, (unsigned int )size, 0U); ok = tmp___0 == size; } if (ok == 0) { goto out; } else { } bio->bi_private = (void *)(& md_io); bio->bi_end_io = & drbd_md_io_complete; bio->bi_rw = (unsigned long )rw; if (rw & 1) { tmp___1 = 0U; } else { tmp___1 = 1U; } { tmp___2 = drbd_insert_fault(mdev, tmp___1); } if (tmp___2 != 0) { { bio_endio(bio, -5); } } else { { submit_bio(rw, bio); } } { wait_for_completion(& md_io.event); } if ((int )bio->bi_flags & 1) { if (md_io.error == 0) { tmp___3 = 1; } else { tmp___3 = 0; } } else { tmp___3 = 0; } ok = tmp___3; out: { bio_put(bio); } return (ok); } } int drbd_md_sync_page_io(struct drbd_conf *mdev , struct drbd_backing_dev *bdev , sector_t sector , int rw ) { int logical_block_size ; int mask ; int ok ; int offset ; struct page *iop ; int tmp ; long tmp___0 ; unsigned short tmp___1 ; void *p ; void *tmp___2 ; void *hp ; void *tmp___3 ; long tmp___4 ; size_t __len ; void *__ret ; char *tmp___5 ; struct task_struct *tmp___6 ; struct task_struct *tmp___7 ; sector_t tmp___8 ; sector_t tmp___9 ; char *tmp___10 ; long tmp___11 ; void *p___0 ; void *tmp___12 ; void *hp___0 ; void *tmp___13 ; size_t __len___0 ; void *__ret___0 ; { { offset = 0; iop = mdev->md_io_page; tmp = mutex_is_locked(& mdev->md_io_mutex); } if (tmp == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mutex_is_locked(&mdev->md_io_mutex) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 121); } } else { } { tmp___0 = __builtin_expect((long )((unsigned long )bdev->md_bdev == (unsigned long )((struct block_device *)0)), 0L); } if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p"), "i" (123), "i" (12UL)); ldv_47929: ; goto ldv_47929; } else { } { tmp___1 = bdev_logical_block_size(bdev->md_bdev); logical_block_size = (int )tmp___1; } if (logical_block_size == 0) { logical_block_size = 512; } else { } if (logical_block_size != 512) { mask = logical_block_size / 512 + -1; if (mask != 1) { if (mask != 3) { if (mask != 7) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mask == 1 || mask == 3 || mask == 7 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 132); } } else { } } else { } } else { } if ((mask + 1) * 512 != logical_block_size) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( logical_block_size == (mask+1) * MD_SECTOR_SIZE ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 133); } } else { } offset = (int )((unsigned int )sector & (unsigned int )mask); sector = (sector_t )(~ mask) & sector; iop = mdev->md_io_tmpp; if (rw & 1) { { tmp___2 = lowmem_page_address(mdev->md_io_page); p = tmp___2; tmp___3 = lowmem_page_address(mdev->md_io_tmpp); hp = tmp___3; ok = _drbd_md_sync_page_io(mdev, bdev, iop, sector, 0, logical_block_size); tmp___4 = __builtin_expect((long )(ok == 0), 0L); } if (tmp___4 != 0L) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_md_sync_page_io(,%llus,READ [logical_block_size!=512]) failed!\n", (unsigned long long )sector); } return (0); } else { } __len = 512UL; if (__len > 63UL) { { __ret = __memcpy(hp + (unsigned long )(offset * 512), (void const *)p, __len); } } else { { __ret = __builtin_memcpy(hp + (unsigned long )(offset * 512), (void const *)p, __len); } } } else { } } else { } { tmp___8 = drbd_md_first_sector(bdev); } if (tmp___8 > sector) { goto _L; } else { { tmp___9 = drbd_md_last_sector(bdev); } if (tmp___9 < sector) { _L: if (rw & 1) { tmp___5 = (char *)"WRITE"; } else { tmp___5 = (char *)"READ"; } { tmp___6 = get_current(); tmp___7 = get_current(); dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s [%d]:%s(,%llus,%s) out of range md access!\n", (char *)(& tmp___7->comm), tmp___6->pid, "drbd_md_sync_page_io", (unsigned long long )sector, tmp___5); } } else { } } { ok = _drbd_md_sync_page_io(mdev, bdev, iop, sector, rw, logical_block_size); tmp___11 = __builtin_expect((long )(ok == 0), 0L); } if (tmp___11 != 0L) { if (rw & 1) { tmp___10 = (char *)"WRITE"; } else { tmp___10 = (char *)"READ"; } { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_md_sync_page_io(,%llus,%s) failed!\n", (unsigned long long )sector, tmp___10); } return (0); } else { } if (logical_block_size != 512) { if ((rw & 1) == 0) { { tmp___12 = lowmem_page_address(mdev->md_io_page); p___0 = tmp___12; tmp___13 = lowmem_page_address(mdev->md_io_tmpp); hp___0 = tmp___13; __len___0 = 512UL; } if (__len___0 > 63UL) { { __ret___0 = __memcpy(p___0, (void const *)hp___0 + (unsigned long )(offset * 512), __len___0); } } else { { __ret___0 = __builtin_memcpy(p___0, (void const *)hp___0 + (unsigned long )(offset * 512), __len___0); } } } else { } } else { } return (ok); } } static struct lc_element *_al_get(struct drbd_conf *mdev , unsigned int enr ) { struct lc_element *al_ext ; struct lc_element *tmp ; unsigned long al_flags ; int wake ; struct bm_extent *bm_ext ; struct lc_element const *__mptr ; int tmp___0 ; int tmp___1 ; long tmp___2 ; { { al_flags = 0UL; spin_lock_irq(& mdev->al_lock); tmp = lc_find(mdev->resync, enr / 4U); tmp___2 = __builtin_expect((long )((unsigned long )tmp != (unsigned long )((struct lc_element *)0)), 0L); } if (tmp___2 != 0L) { { __mptr = (struct lc_element const *)tmp; bm_ext = (struct bm_extent *)__mptr + 0x0ffffffffffffff0UL; tmp___1 = constant_test_bit(0U, (unsigned long const volatile *)(& bm_ext->flags)); } if (tmp___1 != 0) { { tmp___0 = test_and_set_bit(2, (unsigned long volatile *)(& bm_ext->flags)); wake = tmp___0 == 0; spin_unlock_irq(& mdev->al_lock); } if (wake != 0) { { __wake_up(& mdev->al_wait, 3U, 1, (void *)0); } } else { } return ((struct lc_element *)0); } else { } } else { } { al_ext = lc_get(mdev->act_log, enr); al_flags = (mdev->act_log)->flags; spin_unlock_irq(& mdev->al_lock); } return (al_ext); } } void drbd_al_begin_io(struct drbd_conf *mdev , sector_t sector ) { unsigned int enr ; struct lc_element *al_ext ; struct update_al_work al_work ; int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; { { enr = (unsigned int )(sector >> 13); tmp = atomic_read((atomic_t const *)(& mdev->local_cnt)); } if (tmp <= 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( atomic_read(&mdev->local_cnt) > 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 222); } } else { } { al_ext = _al_get(mdev, enr); } if ((unsigned long )al_ext != (unsigned long )((struct lc_element *)0)) { goto ldv_47959; } else { } { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_47962: { prepare_to_wait(& mdev->al_wait, & __wait, 2); al_ext = _al_get(mdev, enr); } if ((unsigned long )al_ext != (unsigned long )((struct lc_element *)0)) { goto ldv_47961; } else { } { schedule(); } goto ldv_47962; ldv_47961: { finish_wait(& mdev->al_wait, & __wait); } ldv_47959: ; if (al_ext->lc_number != enr) { { init_completion(& al_work.event); al_work.al_ext = al_ext; al_work.enr = enr; al_work.old_enr = al_ext->lc_number; al_work.w.cb = & w_al_write_transaction; drbd_queue_work_front(& mdev->data.work, & al_work.w); wait_for_completion(& al_work.event); mdev->al_writ_cnt = mdev->al_writ_cnt + 1U; spin_lock_irq(& mdev->al_lock); lc_changed(mdev->act_log, al_ext); spin_unlock_irq(& mdev->al_lock); __wake_up(& mdev->al_wait, 3U, 1, (void *)0); } } else { } return; } } void drbd_al_complete_io(struct drbd_conf *mdev , sector_t sector ) { unsigned int enr ; struct lc_element *extent ; unsigned long flags ; raw_spinlock_t *tmp ; unsigned int tmp___0 ; { { enr = (unsigned int )(sector >> 13); tmp = spinlock_check(& mdev->al_lock); flags = _raw_spin_lock_irqsave(tmp); extent = lc_find(mdev->act_log, enr); } if ((unsigned long )extent == (unsigned long )((struct lc_element *)0)) { { spin_unlock_irqrestore(& mdev->al_lock, flags); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "al_complete_io() called on inactive extent %u\n", enr); } return; } else { } { tmp___0 = lc_put(mdev->act_log, extent); } if (tmp___0 == 0U) { { __wake_up(& mdev->al_wait, 3U, 1, (void *)0); } } else { } { spin_unlock_irqrestore(& mdev->al_lock, flags); } return; } } static unsigned int al_extent_to_bm_page(unsigned int al_enr ) { { return (al_enr >> 5); } } static unsigned int rs_extent_to_bm_page(unsigned int rs_enr ) { { return (rs_enr >> 3); } } int w_al_write_transaction(struct drbd_conf *mdev , struct drbd_work *w , int unused ) { struct update_al_work *aw ; struct drbd_work const *__mptr ; struct lc_element *updated ; unsigned int new_enr ; unsigned int evicted ; struct al_transaction *buffer ; sector_t sector ; int i ; int n ; int mx ; unsigned int extent_nr ; u32 xor_sum ; char const *tmp ; int tmp___0 ; unsigned int tmp___1 ; char const *tmp___2 ; void *tmp___3 ; __u32 tmp___4 ; unsigned int tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; int __min1 ; int __min2 ; int tmp___8 ; unsigned int idx ; struct lc_element *tmp___9 ; __u32 tmp___10 ; __u32 tmp___11 ; __u32 tmp___12 ; int tmp___13 ; unsigned int tmp___14 ; { { __mptr = (struct drbd_work const *)w; aw = (struct update_al_work *)__mptr; updated = aw->al_ext; new_enr = aw->enr; evicted = aw->old_enr; xor_sum = 0U; tmp___0 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___0 == 0) { { tmp = drbd_disk_str((enum drbd_disk_state )mdev->state.ldv_38339.disk); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "disk is %s, cannot start al transaction (-%d +%d)\n", tmp, evicted, new_enr); complete(& ((struct update_al_work *)w)->event); } return (1); } else { } if ((int )mdev->state.ldv_38339.conn <= 9) { if (evicted != 4294967295U) { { tmp___1 = al_extent_to_bm_page(evicted); drbd_bm_write_page(mdev, tmp___1); } } else { } } else { } if ((int )mdev->state.ldv_38339.disk <= 3) { { tmp___2 = drbd_disk_str((enum drbd_disk_state )mdev->state.ldv_38339.disk); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "disk is %s, cannot write al transaction (-%d +%d)\n", tmp___2, evicted, new_enr); complete(& ((struct update_al_work *)w)->event); put_ldev(mdev); } return (1); } else { } { mutex_lock_nested(& mdev->md_io_mutex, 0U); tmp___3 = lowmem_page_address(mdev->md_io_page); buffer = (struct al_transaction *)tmp___3; buffer->magic = 1728214147U; tmp___4 = __fswab32(mdev->al_tr_number); buffer->tr_number = tmp___4; tmp___5 = lc_index_of(mdev->act_log, updated); n = (int )tmp___5; tmp___6 = __fswab32((__u32 )n); buffer->updates[0].pos = tmp___6; tmp___7 = __fswab32(new_enr); buffer->updates[0].extent = tmp___7; xor_sum = xor_sum ^ new_enr; __min1 = 61; __min2 = (int )((mdev->act_log)->nr_elements - (unsigned int )mdev->al_tr_cycle); } if (__min1 < __min2) { tmp___8 = __min1; } else { tmp___8 = __min2; } mx = tmp___8; i = 0; goto ldv_48002; ldv_48001: { idx = (unsigned int )(mdev->al_tr_cycle + i); tmp___9 = lc_element_by_index(mdev->act_log, idx); extent_nr = tmp___9->lc_number; tmp___10 = __fswab32(idx); buffer->updates[i + 1].pos = tmp___10; tmp___11 = __fswab32(extent_nr); buffer->updates[i + 1].extent = tmp___11; xor_sum = xor_sum ^ extent_nr; i = i + 1; } ldv_48002: ; if (i < mx) { goto ldv_48001; } else { goto ldv_48003; } ldv_48003: ; goto ldv_48005; ldv_48004: buffer->updates[i + 1].pos = 4294967295U; buffer->updates[i + 1].extent = 4294967295U; xor_sum = ~ xor_sum; i = i + 1; ldv_48005: ; if (i <= 60) { goto ldv_48004; } else { goto ldv_48006; } ldv_48006: mdev->al_tr_cycle = mdev->al_tr_cycle + 61; if ((unsigned int )mdev->al_tr_cycle >= (mdev->act_log)->nr_elements) { mdev->al_tr_cycle = 0; } else { } { tmp___12 = __fswab32(xor_sum); buffer->xor_sum = tmp___12; sector = (sector_t )(((mdev->ldev)->md.md_offset + (u64 )(mdev->ldev)->md.al_offset) + (u64 )mdev->al_tr_pos); tmp___13 = drbd_md_sync_page_io(mdev, mdev->ldev, sector, 1); } if (tmp___13 == 0) { { drbd_chk_io_error_(mdev, 1, 1, "w_al_write_transaction"); } } else { } mdev->al_tr_pos = mdev->al_tr_pos + 1; if ((mdev->act_log)->nr_elements % 61U != 0U) { tmp___14 = 1U; } else { tmp___14 = 0U; } if ((unsigned int )mdev->al_tr_pos > (mdev->act_log)->nr_elements / 61U + tmp___14) { mdev->al_tr_pos = 0; } else { } if (mdev->al_tr_pos > 63) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->al_tr_pos < MD_AL_MAX_SIZE ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 381); } } else { } { mdev->al_tr_number = mdev->al_tr_number + 1U; mutex_unlock(& mdev->md_io_mutex); complete(& ((struct update_al_work *)w)->event); put_ldev(mdev); } return (1); } } static int drbd_al_read_tr(struct drbd_conf *mdev , struct drbd_backing_dev *bdev , struct al_transaction *b , int index ) { sector_t sector ; int rv ; int i ; u32 xor_sum ; int tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; { { xor_sum = 0U; sector = (sector_t )((bdev->md.md_offset + (u64 )bdev->md.al_offset) + (u64 )index); tmp = drbd_md_sync_page_io(mdev, bdev, sector, 0); } if (tmp == 0) { return (-1); } else { } { tmp___0 = __fswab32(b->magic); rv = tmp___0 == 2205418087U; i = 0; } goto ldv_48019; ldv_48018: { tmp___1 = __fswab32(b->updates[i].extent); xor_sum = tmp___1 ^ xor_sum; i = i + 1; } ldv_48019: ; if (i <= 61) { goto ldv_48018; } else { goto ldv_48020; } ldv_48020: { tmp___2 = __fswab32(b->xor_sum); rv = (tmp___2 == xor_sum) & rv; } return (rv); } } int drbd_al_read_log(struct drbd_conf *mdev , struct drbd_backing_dev *bdev ) { struct al_transaction *buffer ; int i ; int rv ; int mx ; int active_extents ; int transactions ; int found_valid ; int from ; int to ; u32 from_tnr ; u32 to_tnr ; u32 cnr ; unsigned int tmp ; void *tmp___0 ; __u32 tmp___1 ; int j ; int pos ; unsigned int extent_nr ; unsigned int trn ; int _b ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; unsigned int tmp___5 ; { active_extents = 0; transactions = 0; found_valid = 0; from = 0; to = 0; from_tnr = 0U; to_tnr = 0U; if ((mdev->act_log)->nr_elements % 61U != 0U) { tmp = 1U; } else { tmp = 0U; } { mx = (int )((mdev->act_log)->nr_elements / 61U + tmp); mutex_lock_nested(& mdev->md_io_mutex, 0U); tmp___0 = lowmem_page_address(mdev->md_io_page); buffer = (struct al_transaction *)tmp___0; i = 0; } goto ldv_48039; ldv_48038: { rv = drbd_al_read_tr(mdev, bdev, buffer, i); } if (rv == 0) { goto ldv_48037; } else { } if (rv == -1) { { mutex_unlock(& mdev->md_io_mutex); } return (0); } else { } { tmp___1 = __fswab32(buffer->tr_number); cnr = tmp___1; found_valid = found_valid + 1; } if (found_valid == 1) { from = i; to = i; from_tnr = cnr; to_tnr = cnr; goto ldv_48037; } else { } if ((int )cnr - (int )from_tnr < 0) { if (((from_tnr - cnr) + (u32 )i) - (u32 )from != (u32 )(mx + 1)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( from_tnr - cnr + i - from == mx+1 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 475); } } else { } from = i; from_tnr = cnr; } else { } if ((int )cnr - (int )to_tnr > 0) { if (cnr - to_tnr != (u32 )(i - to)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( cnr - to_tnr == i - to ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 480); } } else { } to = i; to_tnr = cnr; } else { } ldv_48037: i = i + 1; ldv_48039: ; if (i <= mx) { goto ldv_48038; } else { goto ldv_48040; } ldv_48040: ; if (found_valid == 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "No usable activity log found.\n"); mutex_unlock(& mdev->md_io_mutex); } return (1); } else { } i = from; ldv_48054: { rv = drbd_al_read_tr(mdev, bdev, buffer, i); _b = rv == 0; } if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_al_read_log", (char *)"rv == 0", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 501); } } else { } if (_b != 0) { goto cancel; } else { } if (rv == -1) { { mutex_unlock(& mdev->md_io_mutex); } return (0); } else { } { tmp___2 = __fswab32(buffer->tr_number); trn = tmp___2; spin_lock_irq(& mdev->al_lock); j = 61; } goto ldv_48051; ldv_48050: { tmp___3 = __fswab32(buffer->updates[j].pos); pos = (int )tmp___3; tmp___4 = __fswab32(buffer->updates[j].extent); extent_nr = tmp___4; } if (extent_nr == 4294967295U) { goto ldv_48049; } else { } { lc_set(mdev->act_log, extent_nr, pos); active_extents = active_extents + 1; } ldv_48049: j = j - 1; ldv_48051: ; if (j >= 0) { goto ldv_48050; } else { goto ldv_48052; } ldv_48052: { spin_unlock_irq(& mdev->al_lock); transactions = transactions + 1; } cancel: ; if (i == to) { goto ldv_48053; } else { } i = i + 1; if (i > mx) { i = 0; } else { } goto ldv_48054; ldv_48053: mdev->al_tr_number = to_tnr + 1U; mdev->al_tr_pos = to; mdev->al_tr_pos = mdev->al_tr_pos + 1; if ((mdev->act_log)->nr_elements % 61U != 0U) { tmp___5 = 1U; } else { tmp___5 = 0U; } if ((unsigned int )mdev->al_tr_pos > (mdev->act_log)->nr_elements / 61U + tmp___5) { mdev->al_tr_pos = 0; } else { } { mutex_unlock(& mdev->md_io_mutex); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Found %d transactions (%d active extents) in activity log.\n", transactions, active_extents); } return (1); } } void drbd_al_apply_to_bm(struct drbd_conf *mdev ) { unsigned int enr ; unsigned long add ; char ppb[10U] ; int i ; int tmp ; int tmp___0 ; wait_queue_t __wait ; struct task_struct *tmp___1 ; int tmp___2 ; struct lc_element *tmp___3 ; unsigned long tmp___4 ; struct _ddebug descriptor ; long tmp___5 ; char *tmp___6 ; { { add = 0UL; tmp___0 = lc_try_lock(mdev->act_log); } if (tmp___0 != 0) { goto ldv_48063; } else { } { tmp___1 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___1; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_48066: { prepare_to_wait(& mdev->al_wait, & __wait, 2); tmp___2 = lc_try_lock(mdev->act_log); } if (tmp___2 != 0) { goto ldv_48065; } else { } { schedule(); } goto ldv_48066; ldv_48065: { finish_wait(& mdev->al_wait, & __wait); } ldv_48063: i = 0; goto ldv_48071; ldv_48070: { tmp___3 = lc_element_by_index(mdev->act_log, (unsigned int )i); enr = tmp___3->lc_number; } if (enr == 4294967295U) { goto ldv_48067; } else { } { tmp___4 = drbd_bm_ALe_set_all(mdev, (unsigned long )enr); tmp = (int )tmp___4; descriptor.modname = "drbd"; descriptor.function = "drbd_al_apply_to_bm"; descriptor.filename = "/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p"; descriptor.format = "AL: set %d bits in extent %u\n"; descriptor.lineno = 570U; descriptor.flags = (unsigned char)0; descriptor.enabled = (char)0; tmp___5 = __builtin_expect((long )((int )((signed char )descriptor.enabled) != 0), 0L); } if (tmp___5 != 0L) { { dev_printk("<7>", (struct device const *)(& (mdev->vdisk)->part0.__dev), "AL: set %d bits in extent %u\n", tmp, enr); } } else { } add = (unsigned long )tmp + add; ldv_48067: i = i + 1; ldv_48071: ; if ((unsigned int )i < (mdev->act_log)->nr_elements) { goto ldv_48070; } else { goto ldv_48072; } ldv_48072: { lc_unlock(mdev->act_log); __wake_up(& mdev->al_wait, 3U, 1, (void *)0); tmp___6 = ppsize((char *)(& ppb), (unsigned long long )(add << 2)); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Marked additional %s as out-of-sync based on AL.\n", tmp___6); } return; } } static int _try_lc_del(struct drbd_conf *mdev , struct lc_element *al_ext ) { int rv ; long tmp ; { { spin_lock_irq(& mdev->al_lock); rv = al_ext->refcnt == 0U; tmp = __builtin_expect((long )(rv != 0), 1L); } if (tmp != 0L) { { lc_del(mdev->act_log, al_ext); } } else { } { spin_unlock_irq(& mdev->al_lock); } return (rv); } } void drbd_al_shrink(struct drbd_conf *mdev ) { struct lc_element *al_ext ; int i ; int tmp ; int tmp___0 ; wait_queue_t __wait ; struct task_struct *tmp___1 ; int tmp___2 ; { { tmp = constant_test_bit(1U, (unsigned long const volatile *)(& (mdev->act_log)->flags)); } if (tmp == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( test_bit(__LC_DIRTY, &mdev->act_log->flags) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 608); } } else { } i = 0; goto ldv_48089; ldv_48088: { al_ext = lc_element_by_index(mdev->act_log, (unsigned int )i); } if (al_ext->lc_number == 4294967295U) { goto ldv_48083; } else { } { tmp___0 = _try_lc_del(mdev, al_ext); } if (tmp___0 != 0) { goto ldv_48084; } else { } { tmp___1 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___1; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_48087: { prepare_to_wait(& mdev->al_wait, & __wait, 2); tmp___2 = _try_lc_del(mdev, al_ext); } if (tmp___2 != 0) { goto ldv_48086; } else { } { schedule(); } goto ldv_48087; ldv_48086: { finish_wait(& mdev->al_wait, & __wait); } ldv_48084: ; ldv_48083: i = i + 1; ldv_48089: ; if ((unsigned int )i < (mdev->act_log)->nr_elements) { goto ldv_48088; } else { goto ldv_48090; } ldv_48090: { __wake_up(& mdev->al_wait, 3U, 1, (void *)0); } return; } } static int w_update_odbm(struct drbd_conf *mdev , struct drbd_work *w , int unused ) { struct update_odbm_work *udw ; struct drbd_work const *__mptr ; int tmp ; int tmp___0 ; unsigned int tmp___1 ; unsigned long tmp___2 ; { { __mptr = (struct drbd_work const *)w; udw = (struct update_odbm_work *)__mptr; tmp___0 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___0 == 0) { { tmp = ___ratelimit(& drbd_ratelimit_state, "w_update_odbm"); } if (tmp != 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Can not update on disk bitmap, local IO disabled.\n"); } } else { } { kfree((void const *)udw); } return (1); } else { } { tmp___1 = rs_extent_to_bm_page(udw->enr); drbd_bm_write_page(mdev, tmp___1); put_ldev(mdev); kfree((void const *)udw); tmp___2 = drbd_bm_total_weight(mdev); } if (tmp___2 <= mdev->rs_failed) { if ((int )mdev->state.ldv_38339.conn == 16) { goto case_16; } else if ((int )mdev->state.ldv_38339.conn == 17) { goto case_17; } else if ((int )mdev->state.ldv_38339.conn == 20) { goto case_20; } else if ((int )mdev->state.ldv_38339.conn == 21) { goto case_21; } else { goto switch_default; if (0) { case_16: ; case_17: ; case_20: ; case_21: { drbd_resync_finished(mdev); } switch_default: ; goto ldv_48105; } else { } } ldv_48105: ; } else { } { drbd_bcast_sync_progress(mdev); } return (1); } } static void drbd_try_clear_on_disk_bm(struct drbd_conf *mdev , sector_t sector , int count , int success ) { struct lc_element *e ; struct update_odbm_work *udw ; unsigned int enr ; int tmp ; struct bm_extent *ext ; struct lc_element const *__mptr ; union drbd_state val ; union drbd_state mask ; int rs_left ; int tmp___0 ; void *tmp___1 ; { { tmp = atomic_read((atomic_t const *)(& mdev->local_cnt)); } if (tmp == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( atomic_read(&mdev->local_cnt) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 666); } } else { } { enr = (unsigned int )(sector >> 15); e = lc_get(mdev->resync, enr); } if ((unsigned long )e != (unsigned long )((struct lc_element *)0)) { __mptr = (struct lc_element const *)e; ext = (struct bm_extent *)__mptr + 0x0ffffffffffffff0UL; if (ext->lce.lc_number == enr) { if (success != 0) { ext->rs_left = ext->rs_left - count; } else { ext->rs_failed = ext->rs_failed + count; } if (ext->rs_left < ext->rs_failed) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "BAD! sector=%llus enr=%u rs_left=%d rs_failed=%d count=%d\n", (unsigned long long )sector, ext->lce.lc_number, ext->rs_left, ext->rs_failed, count); dump_stack(); lc_put(mdev->resync, & ext->lce); val.i = 0U; val.ldv_38339.conn = (unsigned char)1; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } return; } else { } } else { { tmp___0 = drbd_bm_e_weight(mdev, (unsigned long )enr); rs_left = tmp___0; } if (ext->flags != 0UL) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "changing resync lce: %d[%u;%02lx] -> %d[%u;00]\n", ext->lce.lc_number, ext->rs_left, ext->flags, enr, rs_left); ext->flags = 0UL; } } else { } if (ext->rs_failed != 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Kicking resync_lru element enr=%u out with rs_failed=%d\n", ext->lce.lc_number, ext->rs_failed); } } else { } ext->rs_left = rs_left; if (success == 0) { ext->rs_failed = count; } else { ext->rs_failed = 0; } { lc_changed(mdev->resync, & ext->lce); } } { lc_put(mdev->resync, & ext->lce); } if (ext->rs_left == ext->rs_failed) { { ext->rs_failed = 0; tmp___1 = kmalloc(32UL, 32U); udw = (struct update_odbm_work *)tmp___1; } if ((unsigned long )udw != (unsigned long )((struct update_odbm_work *)0)) { { udw->enr = ext->lce.lc_number; udw->w.cb = & w_update_odbm; drbd_queue_work_front(& mdev->data.work, & udw->w); } } else { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Could not kmalloc an udw\n"); } } } else { } } else { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "lc_get() failed! locked=%d/%d flags=%lu\n", mdev->resync_locked, (mdev->resync)->nr_elements, (mdev->resync)->flags); } } return; } } void drbd_advance_rs_marks(struct drbd_conf *mdev , unsigned long still_to_go ) { unsigned long now ; unsigned long last ; int next ; { now = (unsigned long )jiffies; last = mdev->rs_mark_time[mdev->rs_last_mark]; next = (mdev->rs_last_mark + 1) % 8; if ((long )now - (long )(last + 750UL) >= 0L) { if (mdev->rs_mark_left[mdev->rs_last_mark] != still_to_go) { if ((unsigned int )*((unsigned short *)mdev + 1138UL) != 336U) { if ((unsigned int )*((unsigned short *)mdev + 1138UL) != 320U) { mdev->rs_mark_time[next] = now; mdev->rs_mark_left[next] = still_to_go; mdev->rs_last_mark = next; } else { } } else { } } else { } } else { } return; } } void __drbd_set_in_sync(struct drbd_conf *mdev , sector_t sector , int size , char const *file , unsigned int const line ) { unsigned long sbnr ; unsigned long ebnr ; unsigned long lbnr ; unsigned long count ; sector_t esector ; sector_t nr_sectors ; int wake_up ; unsigned long flags ; int _b ; int _b___0 ; long tmp ; long tmp___0 ; int tmp___1 ; unsigned long tmp___2 ; raw_spinlock_t *tmp___3 ; int tmp___4 ; { count = 0UL; wake_up = 0; if (size <= 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_set_in_sync: sector=%llus size=%d nonsense!\n", (unsigned long long )sector, size); } return; } else if ((size & 511) != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_set_in_sync: sector=%llus size=%d nonsense!\n", (unsigned long long )sector, size); } return; } else if ((unsigned int )size > 131072U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_set_in_sync: sector=%llus size=%d nonsense!\n", (unsigned long long )sector, size); } return; } else { } { nr_sectors = drbd_get_capacity(mdev->this_bdev); esector = ((sector_t )(size >> 9) + sector) - 1UL; _b = sector >= nr_sectors; } if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "__drbd_set_in_sync", (char *)"sector >= nr_sectors", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 780); } } else { } if (_b != 0) { return; } else { } _b___0 = esector >= nr_sectors; if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "__drbd_set_in_sync", (char *)"esector >= nr_sectors", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 781); } } else { } if (_b___0 != 0) { esector = nr_sectors - 1UL; } else { } { lbnr = (nr_sectors - 1UL) >> 3; tmp = __builtin_expect((long )(esector <= 6UL), 0L); } if (tmp != 0L) { return; } else { } { tmp___0 = __builtin_expect((long )(nr_sectors - 1UL == esector), 0L); } if (tmp___0 != 0L) { ebnr = lbnr; } else { ebnr = (esector - 7UL) >> 3; } sbnr = (sector + 7UL) >> 3; if (sbnr > ebnr) { return; } else { } { tmp___1 = drbd_bm_clear_bits(mdev, sbnr, ebnr); count = (unsigned long )tmp___1; } if (count != 0UL) { { tmp___4 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___4 != 0) { { tmp___2 = drbd_bm_total_weight(mdev); drbd_advance_rs_marks(mdev, tmp___2); tmp___3 = spinlock_check(& mdev->al_lock); flags = _raw_spin_lock_irqsave(tmp___3); drbd_try_clear_on_disk_bm(mdev, sector, (int )count, 1); spin_unlock_irqrestore(& mdev->al_lock, flags); wake_up = 1; put_ldev(mdev); } } else { } } else { } if (wake_up != 0) { { __wake_up(& mdev->al_wait, 3U, 1, (void *)0); } } else { } return; } } int __drbd_set_out_of_sync(struct drbd_conf *mdev , sector_t sector , int size , char const *file , unsigned int const line ) { unsigned long sbnr ; unsigned long ebnr ; unsigned long lbnr ; unsigned long flags ; sector_t esector ; sector_t nr_sectors ; unsigned int enr ; unsigned int count ; struct lc_element *e ; int tmp ; int _b ; int _b___0 ; raw_spinlock_t *tmp___0 ; int tmp___1 ; struct lc_element const *__mptr ; struct lc_element const *__mptr___0 ; { count = 0U; if (size <= 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "sector: %llus, size: %d\n", (unsigned long long )sector, size); } return (0); } else if ((size & 511) != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "sector: %llus, size: %d\n", (unsigned long long )sector, size); } return (0); } else if ((unsigned int )size > 131072U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "sector: %llus, size: %d\n", (unsigned long long )sector, size); } return (0); } else { } { tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp == 0) { return (0); } else { } { nr_sectors = drbd_get_capacity(mdev->this_bdev); esector = ((sector_t )(size >> 9) + sector) - 1UL; _b = sector >= nr_sectors; } if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "__drbd_set_out_of_sync", (char *)"sector >= nr_sectors", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 847); } } else { } if (_b != 0) { goto out; } else { } _b___0 = esector >= nr_sectors; if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "__drbd_set_out_of_sync", (char *)"esector >= nr_sectors", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 849); } } else { } if (_b___0 != 0) { esector = nr_sectors - 1UL; } else { } { lbnr = (nr_sectors - 1UL) >> 3; sbnr = sector >> 3; ebnr = esector >> 3; tmp___0 = spinlock_check(& mdev->al_lock); flags = _raw_spin_lock_irqsave(tmp___0); tmp___1 = drbd_bm_set_bits(mdev, sbnr, ebnr); count = (unsigned int )tmp___1; enr = (unsigned int )(sector >> 15); e = lc_find(mdev->resync, enr); } if ((unsigned long )e != (unsigned long )((struct lc_element *)0)) { __mptr = (struct lc_element const *)e; __mptr___0 = (struct lc_element const *)e; ((struct bm_extent *)__mptr + 0x0ffffffffffffff0UL)->rs_left = (int )((unsigned int )((struct bm_extent *)__mptr___0 + 0x0ffffffffffffff0UL)->rs_left + count); } else { } { spin_unlock_irqrestore(& mdev->al_lock, flags); } out: { put_ldev(mdev); } return ((int )count); } } static struct bm_extent *_bme_get(struct drbd_conf *mdev , unsigned int enr ) { struct lc_element *e ; struct bm_extent *bm_ext ; int wakeup ; unsigned long rs_flags ; struct lc_element const *__mptr ; long tmp ; { { wakeup = 0; spin_lock_irq(& mdev->al_lock); } if (mdev->resync_locked > (mdev->resync)->nr_elements / 2U) { { spin_unlock_irq(& mdev->al_lock); } return ((struct bm_extent *)0); } else { } { e = lc_get(mdev->resync, enr); } if ((unsigned long )e != (unsigned long )((struct lc_element *)0)) { __mptr = (struct lc_element const *)e; bm_ext = (struct bm_extent *)__mptr + 0x0ffffffffffffff0UL; } else { bm_ext = (struct bm_extent *)0; } if ((unsigned long )bm_ext != (unsigned long )((struct bm_extent *)0)) { if (bm_ext->lce.lc_number != enr) { { bm_ext->rs_left = drbd_bm_e_weight(mdev, (unsigned long )enr); bm_ext->rs_failed = 0; lc_changed(mdev->resync, & bm_ext->lce); wakeup = 1; } } else { } if (bm_ext->lce.refcnt == 1U) { mdev->resync_locked = mdev->resync_locked + 1U; } else { } { set_bit(0U, (unsigned long volatile *)(& bm_ext->flags)); } } else { } { rs_flags = (mdev->resync)->flags; spin_unlock_irq(& mdev->al_lock); } if (wakeup != 0) { { __wake_up(& mdev->al_wait, 3U, 1, (void *)0); } } else { } if ((unsigned long )bm_ext == (unsigned long )((struct bm_extent *)0)) { if ((rs_flags & 4UL) != 0UL) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Have to wait for element (resync LRU too small?)\n"); } } else { } { tmp = __builtin_expect((long )((rs_flags & 2UL) != 0UL), 0L); } if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p"), "i" (911), "i" (12UL)); ldv_48196: ; goto ldv_48196; } else { } } else { } return (bm_ext); } } static int _is_in_al(struct drbd_conf *mdev , unsigned int enr ) { struct lc_element *al_ext ; int rv ; long tmp ; { { rv = 0; spin_lock_irq(& mdev->al_lock); tmp = __builtin_expect((long )((mdev->act_log)->new_number == enr), 0L); } if (tmp != 0L) { rv = 1; } else { { al_ext = lc_find(mdev->act_log, enr); } if ((unsigned long )al_ext != (unsigned long )((struct lc_element *)0)) { if (al_ext->refcnt != 0U) { rv = 1; } else { } } else { } } { spin_unlock_irq(& mdev->al_lock); } return (rv); } } int drbd_rs_begin_io(struct drbd_conf *mdev , sector_t sector ) { unsigned int enr ; struct bm_extent *bm_ext ; int i ; int sig ; int sa ; int __ret ; wait_queue_t __wait ; struct task_struct *tmp ; struct task_struct *tmp___0 ; int tmp___1 ; int tmp___2 ; int __ret___0 ; wait_queue_t __wait___0 ; struct task_struct *tmp___3 ; int tmp___4 ; int tmp___5 ; struct task_struct *tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; unsigned int tmp___10 ; long tmp___11 ; int tmp___12 ; { enr = (unsigned int )(sector >> 15); sa = 200; retry: { __ret = 0; bm_ext = _bme_get(mdev, enr); } if ((unsigned long )bm_ext == (unsigned long )((struct bm_extent *)0)) { { tmp = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_48217: { prepare_to_wait(& mdev->al_wait, & __wait, 1); bm_ext = _bme_get(mdev, enr); } if ((unsigned long )bm_ext != (unsigned long )((struct bm_extent *)0)) { goto ldv_48215; } else { } { tmp___0 = get_current(); tmp___1 = signal_pending(tmp___0); } if (tmp___1 == 0) { { schedule(); } goto ldv_48216; } else { } __ret = -512; goto ldv_48215; ldv_48216: ; goto ldv_48217; ldv_48215: { finish_wait(& mdev->al_wait, & __wait); } } else { } sig = __ret; if (sig != 0) { return (-4); } else { } { tmp___2 = constant_test_bit(1U, (unsigned long const volatile *)(& bm_ext->flags)); } if (tmp___2 != 0) { return (0); } else { } i = 0; goto ldv_48226; ldv_48225: { __ret___0 = 0; tmp___8 = _is_in_al(mdev, enr * 4U + (unsigned int )i); } if (tmp___8 != 0) { { tmp___9 = constant_test_bit(2U, (unsigned long const volatile *)(& bm_ext->flags)); } if (tmp___9 == 0) { { tmp___3 = get_current(); __wait___0.flags = 0U; __wait___0.private = (void *)tmp___3; __wait___0.func = & autoremove_wake_function; __wait___0.task_list.next = & __wait___0.task_list; __wait___0.task_list.prev = & __wait___0.task_list; } ldv_48223: { prepare_to_wait(& mdev->al_wait, & __wait___0, 1); tmp___4 = _is_in_al(mdev, enr * 4U + (unsigned int )i); } if (tmp___4 == 0) { goto ldv_48221; } else { { tmp___5 = constant_test_bit(2U, (unsigned long const volatile *)(& bm_ext->flags)); } if (tmp___5 != 0) { goto ldv_48221; } else { } } { tmp___6 = get_current(); tmp___7 = signal_pending(tmp___6); } if (tmp___7 == 0) { { schedule(); } goto ldv_48222; } else { } __ret___0 = -512; goto ldv_48221; ldv_48222: ; goto ldv_48223; ldv_48221: { finish_wait(& mdev->al_wait, & __wait___0); } } else { } } else { } sig = __ret___0; if (sig != 0) { goto _L; } else { { tmp___12 = constant_test_bit(2U, (unsigned long const volatile *)(& bm_ext->flags)); } if (tmp___12 != 0) { if (sa != 0) { _L: { spin_lock_irq(& mdev->al_lock); tmp___10 = lc_put(mdev->resync, & bm_ext->lce); } if (tmp___10 == 0U) { { bm_ext->flags = 0UL; mdev->resync_locked = mdev->resync_locked - 1U; __wake_up(& mdev->al_wait, 3U, 1, (void *)0); } } else { } { spin_unlock_irq(& mdev->al_lock); } if (sig != 0) { return (-4); } else { } { tmp___11 = schedule_timeout_interruptible(25L); } if (tmp___11 != 0L) { return (-4); } else { } if (sa != 0) { sa = sa - 1; if (sa == 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_rs_begin_io() stepped aside for 20sec.Resync stalled?\n"); } } else { } } else { } goto retry; } else { } } else { } } i = i + 1; ldv_48226: ; if (i <= 3) { goto ldv_48225; } else { goto ldv_48227; } ldv_48227: { set_bit(1U, (unsigned long volatile *)(& bm_ext->flags)); } return (0); } } int drbd_try_rs_begin_io(struct drbd_conf *mdev , sector_t sector ) { unsigned int enr ; unsigned int al_enr ; struct lc_element *e ; struct bm_extent *bm_ext ; int i ; struct lc_element const *__mptr ; int tmp ; int tmp___0 ; unsigned int tmp___1 ; struct lc_element const *__mptr___0 ; int tmp___2 ; int tmp___3 ; struct lc_element const *__mptr___1 ; unsigned long rs_flags ; long tmp___4 ; int tmp___5 ; long tmp___6 ; int tmp___7 ; { { enr = (unsigned int )(sector >> 15); al_enr = enr * 4U; spin_lock_irq(& mdev->al_lock); } if (mdev->resync_wenr != 4294967295U) { if (mdev->resync_wenr != enr) { { e = lc_find(mdev->resync, mdev->resync_wenr); } if ((unsigned long )e != (unsigned long )((struct lc_element *)0)) { __mptr = (struct lc_element const *)e; bm_ext = (struct bm_extent *)__mptr + 0x0ffffffffffffff0UL; } else { bm_ext = (struct bm_extent *)0; } if ((unsigned long )bm_ext != (unsigned long )((struct bm_extent *)0)) { { tmp = constant_test_bit(1U, (unsigned long const volatile *)(& bm_ext->flags)); } if (tmp != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !test_bit(BME_LOCKED, &bm_ext->flags) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 1028); } } else { } { tmp___0 = constant_test_bit(0U, (unsigned long const volatile *)(& bm_ext->flags)); } if (tmp___0 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( test_bit(BME_NO_WRITES, &bm_ext->flags) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 1029); } } else { } { clear_bit(0, (unsigned long volatile *)(& bm_ext->flags)); mdev->resync_wenr = 4294967295U; tmp___1 = lc_put(mdev->resync, & bm_ext->lce); } if (tmp___1 == 0U) { mdev->resync_locked = mdev->resync_locked - 1U; } else { } { __wake_up(& mdev->al_wait, 3U, 1, (void *)0); } } else { { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "LOGIC BUG\n"); } } } else { } } else { } { e = lc_try_get(mdev->resync, enr); } if ((unsigned long )e != (unsigned long )((struct lc_element *)0)) { __mptr___0 = (struct lc_element const *)e; bm_ext = (struct bm_extent *)__mptr___0 + 0x0ffffffffffffff0UL; } else { bm_ext = (struct bm_extent *)0; } if ((unsigned long )bm_ext != (unsigned long )((struct bm_extent *)0)) { { tmp___2 = constant_test_bit(1U, (unsigned long const volatile *)(& bm_ext->flags)); } if (tmp___2 != 0) { goto proceed; } else { } { tmp___3 = test_and_set_bit(0, (unsigned long volatile *)(& bm_ext->flags)); } if (tmp___3 == 0) { mdev->resync_locked = mdev->resync_locked + 1U; } else { bm_ext->lce.refcnt = bm_ext->lce.refcnt - 1U; if (bm_ext->lce.refcnt == 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( bm_ext->lce.refcnt > 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 1053); } } else { } } goto check_al; } else { if (mdev->resync_locked > (mdev->resync)->nr_elements - 3U) { goto try_again; } else { } { e = lc_get(mdev->resync, enr); } if ((unsigned long )e != (unsigned long )((struct lc_element *)0)) { __mptr___1 = (struct lc_element const *)e; bm_ext = (struct bm_extent *)__mptr___1 + 0x0ffffffffffffff0UL; } else { bm_ext = (struct bm_extent *)0; } if ((unsigned long )bm_ext == (unsigned long )((struct bm_extent *)0)) { rs_flags = (mdev->resync)->flags; if ((rs_flags & 4UL) != 0UL) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Have to wait for element (resync LRU too small?)\n"); } } else { } { tmp___4 = __builtin_expect((long )((rs_flags & 2UL) != 0UL), 0L); } if (tmp___4 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p"), "i" (1068), "i" (12UL)); ldv_48247: ; goto ldv_48247; } else { } goto try_again; } else { } if (bm_ext->lce.lc_number != enr) { { bm_ext->rs_left = drbd_bm_e_weight(mdev, (unsigned long )enr); bm_ext->rs_failed = 0; lc_changed(mdev->resync, & bm_ext->lce); __wake_up(& mdev->al_wait, 3U, 1, (void *)0); tmp___5 = constant_test_bit(1U, (unsigned long const volatile *)(& bm_ext->flags)); } if (tmp___5 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( test_bit(BME_LOCKED, &bm_ext->flags) == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 1076); } } else { } } else { } { set_bit(0U, (unsigned long volatile *)(& bm_ext->flags)); } if (bm_ext->lce.refcnt != 1U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( bm_ext->lce.refcnt == 1 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 1079); } } else { } mdev->resync_locked = mdev->resync_locked + 1U; goto check_al; } check_al: i = 0; goto ldv_48249; ldv_48248: { tmp___6 = __builtin_expect((long )(al_enr + (unsigned int )i == (mdev->act_log)->new_number), 0L); } if (tmp___6 != 0L) { goto try_again; } else { } { tmp___7 = lc_is_used(mdev->act_log, al_enr + (unsigned int )i); } if (tmp___7 != 0) { goto try_again; } else { } i = i + 1; ldv_48249: ; if (i <= 3) { goto ldv_48248; } else { goto ldv_48250; } ldv_48250: { set_bit(1U, (unsigned long volatile *)(& bm_ext->flags)); } proceed: { mdev->resync_wenr = 4294967295U; spin_unlock_irq(& mdev->al_lock); } return (0); try_again: ; if ((unsigned long )bm_ext != (unsigned long )((struct bm_extent *)0)) { mdev->resync_wenr = enr; } else { } { spin_unlock_irq(& mdev->al_lock); } return (-11); } } void drbd_rs_complete_io(struct drbd_conf *mdev , sector_t sector ) { unsigned int enr ; struct lc_element *e ; struct bm_extent *bm_ext ; unsigned long flags ; raw_spinlock_t *tmp ; struct lc_element const *__mptr ; int tmp___0 ; unsigned int tmp___1 ; { { enr = (unsigned int )(sector >> 15); tmp = spinlock_check(& mdev->al_lock); flags = _raw_spin_lock_irqsave(tmp); e = lc_find(mdev->resync, enr); } if ((unsigned long )e != (unsigned long )((struct lc_element *)0)) { __mptr = (struct lc_element const *)e; bm_ext = (struct bm_extent *)__mptr + 0x0ffffffffffffff0UL; } else { bm_ext = (struct bm_extent *)0; } if ((unsigned long )bm_ext == (unsigned long )((struct bm_extent *)0)) { { spin_unlock_irqrestore(& mdev->al_lock, flags); tmp___0 = ___ratelimit(& drbd_ratelimit_state, "drbd_rs_complete_io"); } if (tmp___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_rs_complete_io() called, but extent not found\n"); } } else { } return; } else { } if (bm_ext->lce.refcnt == 0U) { { spin_unlock_irqrestore(& mdev->al_lock, flags); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_rs_complete_io(,%llu [=%u]) called, but refcnt is 0!?\n", (unsigned long long )sector, enr); } return; } else { } { tmp___1 = lc_put(mdev->resync, & bm_ext->lce); } if (tmp___1 == 0U) { { bm_ext->flags = 0UL; mdev->resync_locked = mdev->resync_locked - 1U; __wake_up(& mdev->al_wait, 3U, 1, (void *)0); } } else { } { spin_unlock_irqrestore(& mdev->al_lock, flags); } return; } } void drbd_rs_cancel_all(struct drbd_conf *mdev ) { int tmp ; { { spin_lock_irq(& mdev->al_lock); tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )2); } if (tmp != 0) { { lc_reset(mdev->resync); put_ldev(mdev); } } else { } { mdev->resync_locked = 0U; mdev->resync_wenr = 4294967295U; spin_unlock_irq(& mdev->al_lock); __wake_up(& mdev->al_wait, 3U, 1, (void *)0); } return; } } int drbd_rs_del_all(struct drbd_conf *mdev ) { struct lc_element *e ; struct bm_extent *bm_ext ; int i ; struct lc_element const *__mptr ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; { { spin_lock_irq(& mdev->al_lock); tmp___3 = _get_ldev_if_state(mdev, (enum drbd_disk_state )2); } if (tmp___3 != 0) { i = 0; goto ldv_48278; ldv_48277: { e = lc_element_by_index(mdev->resync, (unsigned int )i); __mptr = (struct lc_element const *)e; bm_ext = (struct bm_extent *)__mptr + 0x0ffffffffffffff0UL; } if (bm_ext->lce.lc_number == 4294967295U) { goto ldv_48276; } else { } if (bm_ext->lce.lc_number == mdev->resync_wenr) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "dropping %u in drbd_rs_del_all, apparently got \'synced\' by application io\n", mdev->resync_wenr); tmp = constant_test_bit(1U, (unsigned long const volatile *)(& bm_ext->flags)); } if (tmp != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !test_bit(BME_LOCKED, &bm_ext->flags) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 1181); } } else { } { tmp___0 = constant_test_bit(0U, (unsigned long const volatile *)(& bm_ext->flags)); } if (tmp___0 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( test_bit(BME_NO_WRITES, &bm_ext->flags) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 1182); } } else { } { clear_bit(0, (unsigned long volatile *)(& bm_ext->flags)); mdev->resync_wenr = 4294967295U; lc_put(mdev->resync, & bm_ext->lce); } } else { } if (bm_ext->lce.refcnt != 0U) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Retrying drbd_rs_del_all() later. refcnt=%d\n", bm_ext->lce.refcnt); put_ldev(mdev); spin_unlock_irq(& mdev->al_lock); } return (-11); } else { } { tmp___1 = constant_test_bit(1U, (unsigned long const volatile *)(& bm_ext->flags)); } if (tmp___1 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !test_bit(BME_LOCKED, &bm_ext->flags) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 1194); } } else { } { tmp___2 = constant_test_bit(0U, (unsigned long const volatile *)(& bm_ext->flags)); } if (tmp___2 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !test_bit(BME_NO_WRITES, &bm_ext->flags) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 1195); } } else { } { lc_del(mdev->resync, & bm_ext->lce); } ldv_48276: i = i + 1; ldv_48278: ; if ((unsigned int )i < (mdev->resync)->nr_elements) { goto ldv_48277; } else { goto ldv_48279; } ldv_48279: ; if ((mdev->resync)->used != 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->resync->used == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 1198); } } else { } { put_ldev(mdev); } } else { } { spin_unlock_irq(& mdev->al_lock); } return (0); } } void drbd_rs_failed_io(struct drbd_conf *mdev , sector_t sector , int size ) { unsigned long sbnr ; unsigned long ebnr ; unsigned long lbnr ; unsigned long count ; sector_t esector ; sector_t nr_sectors ; int wake_up ; int _b ; int _b___0 ; long tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; { wake_up = 0; if (size <= 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_rs_failed_io: sector=%llus size=%d nonsense!\n", (unsigned long long )sector, size); } return; } else if ((size & 511) != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_rs_failed_io: sector=%llus size=%d nonsense!\n", (unsigned long long )sector, size); } return; } else if ((unsigned int )size > 131072U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_rs_failed_io: sector=%llus size=%d nonsense!\n", (unsigned long long )sector, size); } return; } else { } { nr_sectors = drbd_get_capacity(mdev->this_bdev); esector = ((sector_t )(size >> 9) + sector) - 1UL; _b = sector >= nr_sectors; } if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_rs_failed_io", (char *)"sector >= nr_sectors", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 1228); } } else { } if (_b != 0) { return; } else { } _b___0 = esector >= nr_sectors; if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_rs_failed_io", (char *)"esector >= nr_sectors", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_actlog.c.p", 1229); } } else { } if (_b___0 != 0) { esector = nr_sectors - 1UL; } else { } { lbnr = (nr_sectors - 1UL) >> 3; tmp = __builtin_expect((long )(esector <= 6UL), 0L); } if (tmp != 0L) { return; } else { } { tmp___0 = __builtin_expect((long )(nr_sectors - 1UL == esector), 0L); } if (tmp___0 != 0L) { ebnr = lbnr; } else { ebnr = (esector - 7UL) >> 3; } sbnr = (sector + 7UL) >> 3; if (sbnr > ebnr) { return; } else { } { spin_lock_irq(& mdev->al_lock); tmp___1 = drbd_bm_count_bits(mdev, (unsigned long const )sbnr, (unsigned long const )ebnr); count = (unsigned long )tmp___1; } if (count != 0UL) { { mdev->rs_failed = mdev->rs_failed + count; tmp___2 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___2 != 0) { { drbd_try_clear_on_disk_bm(mdev, sector, (int )count, 0); put_ldev(mdev); } } else { } wake_up = 1; } else { } { spin_unlock_irq(& mdev->al_lock); } if (wake_up != 0) { { __wake_up(& mdev->al_wait, 3U, 1, (void *)0); } } else { } return; } } __inline static void list_splice(struct list_head const *list , struct list_head *head ) { int tmp ; { { tmp = list_empty(list); } if (tmp == 0) { { __list_splice(list, head, head->next); } } else { } return; } } __inline static __u32 __fswahw32(__u32 val ) { { return ((val << 16) | (val >> (8UL * sizeof(val) - 16UL))); } } extern int __bitmap_weight(unsigned long const * , int ) ; __inline static void bitmap_fill(unsigned long *dst , int nbits ) { size_t nlongs ; int len ; { { nlongs = ((unsigned long )nbits + 63UL) / 64UL; len = (int )(((unsigned int )nlongs + 536870911U) * 8U); memset((void *)dst, 255, (size_t )len); } if (((unsigned int )nbits & 63U) != 0U) { *(dst + (nlongs + 0x0fffffffffffffffUL)) = (1UL << nbits % 64) - 1UL; } else { *(dst + (nlongs + 0x0fffffffffffffffUL)) = 0x0fffffffffffffffUL; } return; } } __inline static int bitmap_weight(unsigned long const *src , int nbits ) { int tmp___1 ; { { tmp___1 = __bitmap_weight(src, nbits); } return (tmp___1); } } extern struct cpumask const * const cpu_online_mask ; __inline static void cpumask_set_cpu(unsigned int cpu , struct cpumask *dstp ) { unsigned int tmp ; { { tmp = cpumask_check(cpu); set_bit(tmp, (unsigned long volatile *)(& dstp->bits)); } return; } } __inline static void cpumask_setall(struct cpumask *dstp ) { { { bitmap_fill((unsigned long *)(& dstp->bits), nr_cpu_ids); } return; } } __inline static unsigned int cpumask_weight(struct cpumask const *srcp ) { int tmp ; { { tmp = bitmap_weight((unsigned long const *)(& srcp->bits), nr_cpu_ids); } return ((unsigned int )tmp); } } extern bool zalloc_cpumask_var(cpumask_var_t ** , gfp_t ) ; extern void free_cpumask_var(cpumask_var_t ) ; extern void __rwlock_init(rwlock_t * , char const * , struct lock_class_key * ) ; extern void init_timer_key(struct timer_list * , char const * , struct lock_class_key * ) ; __inline static int ldv_try_module_get_1(struct module *module ) ; void ldv_module_put_1(struct module *ldv_func_arg1 ) ; void ldv_module_put_3(struct module *ldv_func_arg1 ) ; extern int kernel_sendmsg(struct socket * , struct msghdr * , struct kvec * , size_t , size_t ) ; extern int kernel_sock_shutdown(struct socket * , enum sock_shutdown_cmd ) ; extern struct kmem_cache *kmem_cache_create(char const * , size_t , size_t , unsigned long , void (*)(void * ) ) ; extern void kmem_cache_destroy(struct kmem_cache * ) ; __inline static int PageSlab(struct page *page ) { int tmp ; { { tmp = constant_test_bit(7U, (unsigned long const volatile *)(& page->flags)); } return (tmp); } } extern int register_blkdev(unsigned int , char const * ) ; extern void unregister_blkdev(unsigned int , char const * ) ; extern struct block_device *bdget(dev_t ) ; extern void bdput(struct block_device * ) ; extern int blkdev_put(struct block_device * , fmode_t ) ; extern int set_cpus_allowed_ptr(struct task_struct * , struct cpumask const * ) ; extern int wake_up_process(struct task_struct * ) ; extern struct proc_dir_entry *proc_create_data(char const * , mode_t , struct proc_dir_entry * , struct file_operations const * , void * ) ; extern void remove_proc_entry(char const * , struct proc_dir_entry * ) ; extern int register_reboot_notifier(struct notifier_block * ) ; extern int unregister_reboot_notifier(struct notifier_block * ) ; extern struct task_struct *kthread_create_on_node(int (*)(void * ) , void * , int , char const * , ...) ; extern void del_gendisk(struct gendisk * ) ; extern void set_disk_ro(struct gendisk * , int ) ; extern struct gendisk *alloc_disk(int ) ; extern void put_disk(struct gendisk * ) ; __inline static int bdi_congested(struct backing_dev_info *bdi , int bdi_bits ) { int tmp ; { if ((unsigned long )bdi->congested_fn != (unsigned long )((congested_fn *)0)) { { tmp = (*(bdi->congested_fn))(bdi->congested_data, bdi_bits); } return (tmp); } else { } return ((int )((unsigned int )bdi->state & (unsigned int )bdi_bits)); } } extern mempool_t *mempool_create(int , mempool_alloc_t * , mempool_free_t * , void * ) ; extern void mempool_destroy(mempool_t * ) ; extern void *mempool_alloc_slab(gfp_t , void * ) ; extern void mempool_free_slab(void * , void * ) ; extern void blk_cleanup_queue(struct request_queue * ) ; extern void blk_queue_make_request(struct request_queue * , make_request_fn * ) ; extern void blk_queue_bounce_limit(struct request_queue * , u64 ) ; extern void blk_queue_max_hw_sectors(struct request_queue * , unsigned int ) ; extern void blk_queue_merge_bvec(struct request_queue * , merge_bvec_fn * ) ; extern struct request_queue *blk_alloc_queue(gfp_t ) ; extern void lc_destroy(struct lru_cache * ) ; int disable_sendpage ; int allow_oos ; unsigned int cn_idx ; int enable_faults ; int fault_rate ; int fault_devs ; char usermode_helper[80U] ; struct drbd_conf **minor_table ; __inline static void DCBP_set_code(struct p_compressed_bm *p , enum drbd_bitmap_code code ) { long tmp ; { { tmp = __builtin_expect((long )(((unsigned int )code & 4294967280U) != 0U), 0L); } if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/inst/current/envs/linux-3.0.1/linux-3.0.1/drivers/block/drbd/drbd_int.h"), "i" (594), "i" (12UL)); ldv_47253: ; goto ldv_47253; } else { } p->encoding = (u8 )(((unsigned int )p->encoding & 240U) | (unsigned int )((u8 )code)); return; } } __inline static void DCBP_set_start(struct p_compressed_bm *p , int set ) { int tmp ; { if (set != 0) { tmp = -128; } else { tmp = 0; } p->encoding = (u8 )(((int )((signed char )p->encoding) & 127) | tmp); return; } } __inline static void DCBP_set_pad_bits(struct p_compressed_bm *p , int n ) { long tmp ; { { tmp = __builtin_expect((long )((n & -8) != 0), 0L); } if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/anthill/stuff/tacas-comp/inst/current/envs/linux-3.0.1/linux-3.0.1/drivers/block/drbd/drbd_int.h"), "i" (619), "i" (12UL)); ldv_47268: ; goto ldv_47268; } else { } p->encoding = (u8 )(((int )((signed char )p->encoding) & -128) | (int )((signed char )(n << 4))); return; } } void drbd_init_set_defaults(struct drbd_conf *mdev ) ; void print_st_err(struct drbd_conf *mdev , union drbd_state os , union drbd_state ns , enum drbd_state_rv err ) ; void drbd_calc_cpu_mask(struct drbd_conf *mdev ) ; void drbd_free_resources(struct drbd_conf *mdev ) ; int drbd_send(struct drbd_conf *mdev , struct socket *sock , void *buf , size_t size , unsigned int msg_flags ) ; int drbd_send_uuids_skip_initial_sync(struct drbd_conf *mdev ) ; int _drbd_send_bitmap(struct drbd_conf *mdev ) ; void drbd_free_bc(struct drbd_backing_dev *ldev ) ; int drbd_md_read(struct drbd_conf *mdev , struct drbd_backing_dev *bdev ) ; void drbd_md_set_flag(struct drbd_conf *mdev , int flag ) ; void drbd_md_clear_flag(struct drbd_conf *mdev , int flag ) ; int drbd_md_test_flag(struct drbd_backing_dev *bdev , int flag ) ; void drbd_md_mark_dirty(struct drbd_conf *mdev ) ; void drbd_queue_bitmap_io(struct drbd_conf *mdev , int (*io_fn)(struct drbd_conf * ) , void (*done)(struct drbd_conf * , int ) , char *why , enum bm_flag flags ) ; struct kmem_cache *drbd_request_cache ; struct kmem_cache *drbd_ee_cache ; struct kmem_cache *drbd_bm_ext_cache ; struct kmem_cache *drbd_al_ext_cache ; mempool_t *drbd_request_mempool ; mempool_t *drbd_ee_mempool ; struct page *drbd_pp_pool ; spinlock_t drbd_pp_lock ; int drbd_pp_vacant ; wait_queue_head_t drbd_pp_wait ; struct drbd_conf *drbd_new_device(unsigned int minor ) ; void drbd_free_mdev(struct drbd_conf *mdev ) ; int proc_details ; void drbd_suspend_io(struct drbd_conf *mdev ) ; void drbd_resume_io(struct drbd_conf *mdev ) ; void drbd_nl_cleanup(void) ; int drbd_nl_init(void) ; void drbd_bcast_state(struct drbd_conf *mdev , union drbd_state state ) ; __inline static void drbd_state_lock___0(struct drbd_conf *mdev ) { int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; { { tmp = test_and_set_bit(8, (unsigned long volatile *)(& mdev->flags)); } if (tmp == 0) { goto ldv_48348; } else { } { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_48351: { prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___1 = test_and_set_bit(8, (unsigned long volatile *)(& mdev->flags)); } if (tmp___1 == 0) { goto ldv_48350; } else { } { schedule(); } goto ldv_48351; ldv_48350: { finish_wait(& mdev->misc_wait, & __wait); } ldv_48348: ; return; } } __inline static void __drbd_chk_io_error____3(struct drbd_conf *mdev , int forcedetach , char const *where ) { int tmp ; union drbd_state __ns ; union drbd_state __ns___0 ; { if ((mdev->ldev)->dc.on_io_error == 0) { goto case_0; } else if ((mdev->ldev)->dc.on_io_error == 2) { goto case_2; } else if ((mdev->ldev)->dc.on_io_error == 1) { goto case_1; } else if (0) { case_0: ; if (forcedetach == 0) { { tmp = ___ratelimit(& drbd_ratelimit_state, "__drbd_chk_io_error_"); } if (tmp != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s.\n", where); } } else { } if ((int )mdev->state.ldv_38339.disk > 4) { { __ns.i = mdev->state.i; __ns.ldv_38339.disk = (unsigned char)4; _drbd_set_state(mdev, __ns, (enum chg_state_flags )1, (struct completion *)0); } } else { } goto ldv_48376; } else { } case_2: ; case_1: { set_bit(19U, (unsigned long volatile *)(& mdev->flags)); } if ((int )mdev->state.ldv_38339.disk > 2) { { __ns___0.i = mdev->state.i; __ns___0.ldv_38339.disk = (unsigned char)2; _drbd_set_state(mdev, __ns___0, (enum chg_state_flags )1, (struct completion *)0); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s. Detaching...\n", where); } } else { } goto ldv_48376; } else { } ldv_48376: ; return; } } __inline static void drbd_chk_io_error____1(struct drbd_conf *mdev , int error , int forcedetach , char const *where ) { unsigned long flags ; raw_spinlock_t *tmp ; { if (error != 0) { { tmp = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp); __drbd_chk_io_error____3(mdev, forcedetach, where); spin_unlock_irqrestore(& mdev->req_lock, flags); } } else { } return; } } __inline static sector_t drbd_get_max_capacity___0(struct drbd_backing_dev *bdev ) { sector_t s ; sector_t __min1 ; sector_t __min2 ; sector_t tmp___0 ; sector_t tmp___1 ; sector_t tmp___2 ; sector_t __min1___0 ; sector_t __min2___0 ; sector_t tmp___3 ; sector_t tmp___4 ; sector_t __min1___1 ; sector_t __min2___1 ; sector_t tmp___5 ; sector_t __min1___2 ; sector_t __min2___2 ; sector_t tmp___6 ; sector_t tmp___7 ; { if (bdev->dc.meta_dev_idx == -1) { goto case_neg_1; } else if (bdev->dc.meta_dev_idx == -3) { goto case_neg_3; } else if (bdev->dc.meta_dev_idx == -2) { goto case_neg_2; } else { goto switch_default; if (0) { case_neg_1: ; case_neg_3: { tmp___2 = drbd_get_capacity(bdev->backing_bdev); } if (tmp___2 != 0UL) { { __min1 = 2251799813685248UL; tmp___0 = drbd_md_first_sector(bdev); __min2 = tmp___0; } if (__min1 < __min2) { tmp___1 = __min1; } else { tmp___1 = __min2; } s = tmp___1; } else { s = 0UL; } goto ldv_48417; case_neg_2: { __min1___0 = 2251799813685248UL; tmp___3 = drbd_get_capacity(bdev->backing_bdev); __min2___0 = tmp___3; } if (__min1___0 < __min2___0) { tmp___4 = __min1___0; } else { tmp___4 = __min2___0; } s = tmp___4; __min1___1 = s; __min2___1 = (unsigned long )(bdev->md.md_size_sect - (u32 )bdev->md.bm_offset) << 15; if (__min1___1 < __min2___1) { tmp___5 = __min1___1; } else { tmp___5 = __min2___1; } s = tmp___5; goto ldv_48417; switch_default: { __min1___2 = 8587575296UL; tmp___6 = drbd_get_capacity(bdev->backing_bdev); __min2___2 = tmp___6; } if (__min1___2 < __min2___2) { tmp___7 = __min1___2; } else { tmp___7 = __min2___2; } s = tmp___7; } else { } } ldv_48417: ; return (s); } } __inline static sector_t drbd_md_ss__(struct drbd_conf *mdev , struct drbd_backing_dev *bdev ) { int tmp ; sector_t tmp___0 ; { if (bdev->dc.meta_dev_idx == -1) { goto case_neg_1; } else if (bdev->dc.meta_dev_idx == -3) { goto case_neg_3; } else if (bdev->dc.meta_dev_idx == -2) { goto case_neg_2; } else { goto switch_default; if (0) { switch_default: ; return ((unsigned long )bdev->dc.meta_dev_idx * 262144UL); case_neg_1: ; case_neg_3: ; if ((unsigned long )bdev->backing_bdev == (unsigned long )((struct block_device *)0)) { { tmp = ___ratelimit(& drbd_ratelimit_state, "drbd_md_ss__"); } if (tmp != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "bdev->backing_bdev==NULL\n"); dump_stack(); } } else { } return (0UL); } else { } { tmp___0 = drbd_get_capacity(bdev->backing_bdev); } return ((sector_t )(((unsigned long long )tmp___0 & 0x0ffffffffffffff8ULL) - 8ULL)); case_neg_2: ; return (0UL); } else { } } } } __inline static void drbd_thread_stop_nowait(struct drbd_thread *thi ) { { { _drbd_thread_stop(thi, 0, 0); } return; } } __inline static void drbd_thread_restart_nowait(struct drbd_thread *thi ) { { { _drbd_thread_stop(thi, 1, 0); } return; } } __inline static int drbd_state_is_stable___0(struct drbd_conf *mdev ) { union drbd_state s ; { s = mdev->state; if ((int )((unsigned int )s.ldv_38339.conn) == 0) { goto case_0; } else if ((int )((unsigned int )s.ldv_38339.conn) == 8) { goto case_8; } else if ((int )((unsigned int )s.ldv_38339.conn) == 10) { goto case_10; } else if ((int )((unsigned int )s.ldv_38339.conn) == 16) { goto case_16; } else if ((int )((unsigned int )s.ldv_38339.conn) == 17) { goto case_17; } else if ((int )((unsigned int )s.ldv_38339.conn) == 18) { goto case_18; } else if ((int )((unsigned int )s.ldv_38339.conn) == 19) { goto case_19; } else if ((int )((unsigned int )s.ldv_38339.conn) == 20) { goto case_20; } else if ((int )((unsigned int )s.ldv_38339.conn) == 21) { goto case_21; } else if ((int )((unsigned int )s.ldv_38339.conn) == 22) { goto case_22; } else if ((int )((unsigned int )s.ldv_38339.conn) == 23) { goto case_23; } else if ((int )((unsigned int )s.ldv_38339.conn) == 1) { goto case_1; } else if ((int )((unsigned int )s.ldv_38339.conn) == 2) { goto case_2; } else if ((int )((unsigned int )s.ldv_38339.conn) == 3) { goto case_3; } else if ((int )((unsigned int )s.ldv_38339.conn) == 4) { goto case_4; } else if ((int )((unsigned int )s.ldv_38339.conn) == 5) { goto case_5; } else if ((int )((unsigned int )s.ldv_38339.conn) == 6) { goto case_6; } else if ((int )((unsigned int )s.ldv_38339.conn) == 7) { goto case_7; } else if ((int )((unsigned int )s.ldv_38339.conn) == 9) { goto case_9; } else if ((int )((unsigned int )s.ldv_38339.conn) == 11) { goto case_11; } else if ((int )((unsigned int )s.ldv_38339.conn) == 12) { goto case_12; } else if ((int )((unsigned int )s.ldv_38339.conn) == 13) { goto case_13; } else if ((int )((unsigned int )s.ldv_38339.conn) == 14) { goto case_14; } else if ((int )((unsigned int )s.ldv_38339.conn) == 15) { goto case_15; } else if ((int )((unsigned int )s.ldv_38339.conn) == 31) { goto case_31; } else if (0) { case_0: ; case_8: ; case_10: ; case_16: ; case_17: ; case_18: ; case_19: ; case_20: ; case_21: ; case_22: ; case_23: ; case_1: ; case_2: ; case_3: ; case_4: ; case_5: ; case_6: ; case_7: ; case_9: ; case_11: ; case_12: ; goto ldv_48548; case_13: ; if (mdev->agreed_pro_version <= 95) { return (0); } else { } goto ldv_48548; case_14: ; case_15: ; case_31: ; return (0); } else { } ldv_48548: ; if ((int )((unsigned int )s.ldv_38339.disk) == 0) { goto case_0___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 4) { goto case_4___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 5) { goto case_5___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 7) { goto case_7___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 8) { goto case_8___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 1) { goto case_1___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 2) { goto case_2___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 3) { goto case_3___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 6) { goto case_6___0; } else if ((int )((unsigned int )s.ldv_38339.disk) == 15) { goto case_15___0; } else if (0) { case_0___0: ; case_4___0: ; case_5___0: ; case_7___0: ; case_8___0: ; goto ldv_48558; case_1___0: ; case_2___0: ; case_3___0: ; case_6___0: ; case_15___0: ; return (0); } else { } ldv_48558: ; return (1); } } __inline static bool may_inc_ap_bio___0(struct drbd_conf *mdev ) { int mxb ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { { tmp = drbd_get_max_buffers(mdev); mxb = tmp; tmp___0 = is_susp(mdev->state); } if (tmp___0 != 0) { return ((bool )0); } else { } { tmp___1 = constant_test_bit(15U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___1 != 0) { return ((bool )0); } else { } { tmp___2 = drbd_state_is_stable___0(mdev); } if (tmp___2 == 0) { return ((bool )0); } else { } { tmp___3 = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); } if (tmp___3 > mxb) { return ((bool )0); } else { } { tmp___4 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___4 != 0) { return ((bool )0); } else { } return ((bool )1); } } __inline static void drbd_update_congested(struct drbd_conf *mdev ) { struct sock *sk ; { sk = (mdev->data.socket)->sk; if (sk->sk_wmem_queued > (sk->sk_sndbuf * 4) / 5) { { set_bit(21U, (unsigned long volatile *)(& mdev->flags)); } } else { } return; } } __inline static int drbd_queue_order_type(struct drbd_conf *mdev ) { { return (0); } } void tl_restart(struct drbd_conf *mdev , enum drbd_req_event what ) ; __inline static int __vli_encode_bits(u64 *out , u64 const in ) { u64 max ; u64 adj ; { max = 0ULL; adj = 1ULL; if ((unsigned long long )in == 0ULL) { return (-22); } else { } max = max + 2ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = ((unsigned long long )in - adj) << 1; } else { } return (2); } else { } adj = max + 1ULL; max = max + 2ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 2) | 1ULL; } else { } return (3); } else { } adj = max + 1ULL; max = max + 4ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 3) | 3ULL; } else { } return (5); } else { } adj = max + 1ULL; max = max + 8ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 4) | 7ULL; } else { } return (7); } else { } adj = max + 1ULL; max = max + 32ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 5) | 15ULL; } else { } return (10); } else { } adj = max + 1ULL; max = max + 256ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 6) | 31ULL; } else { } return (14); } else { } adj = max + 1ULL; max = max + 8192ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 8) | 63ULL; } else { } return (21); } else { } adj = max + 1ULL; max = max + 2097152ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 8) | 127ULL; } else { } return (29); } else { } adj = max + 1ULL; max = max + 17179869184ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 8) | 191ULL; } else { } return (42); } else { } adj = max + 1ULL; max = max + 72057594037927936ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 8) | 255ULL; } else { } return (64); } else { } adj = max + 1ULL; return (-75); } } __inline static int bitstream_put_bits(struct bitstream *bs , u64 val , unsigned int const bits ) { unsigned char *b ; unsigned int tmp ; unsigned char *tmp___0 ; unsigned char *tmp___1 ; { b = bs->cur.b; if ((unsigned int )bits == 0U) { return (0); } else { } if ((unsigned long )((long )(bs->cur.b + (unsigned long )(((bs->cur.bit + (unsigned int )bits) - 1U) >> 3)) - (long )bs->buf) >= bs->buf_len) { return (-105); } else { } if ((unsigned int )bits <= 63U) { val = (0x0fffffffffffffffULL >> (int )(64U - (unsigned int )bits)) & val; } else { } tmp___0 = b; b = b + 1; *tmp___0 = (unsigned char )((int )*tmp___0 | (int )((unsigned char )((val & 255ULL) << (int )bs->cur.bit))); tmp = 8U - bs->cur.bit; goto ldv_48811; ldv_48810: tmp___1 = b; b = b + 1; *tmp___1 = (unsigned char )((int )*tmp___1 | (int )((unsigned char )(val >> (int )tmp))); tmp = tmp + 8U; ldv_48811: ; if (tmp < (unsigned int )bits) { goto ldv_48810; } else { goto ldv_48812; } ldv_48812: { bitstream_cursor_advance(& bs->cur, (unsigned int )bits); } return ((int )bits); } } __inline static int vli_encode_bits(struct bitstream *bs , u64 in ) { u64 code ; int bits ; int tmp ; int tmp___0 ; { { code = code; tmp = __vli_encode_bits(& code, (u64 const )in); bits = tmp; } if (bits <= 0) { return (bits); } else { } { tmp___0 = bitstream_put_bits(bs, code, (unsigned int const )bits); } return (tmp___0); } } static struct mutex drbd_main_mutex = {{1}, {{{{0U}, 3735899821U, 4294967295U, (void *)0x0fffffffffffffffUL, {(struct lock_class_key *)0, {(struct lock_class *)0, (struct lock_class *)0}, "drbd_main_mutex.wait_lock", 0, 0UL}}}}, {& drbd_main_mutex.wait_list, & drbd_main_mutex.wait_list}, (struct task_struct *)0, (char const *)0, (void *)(& drbd_main_mutex), {(struct lock_class_key *)0, {(struct lock_class *)0, (struct lock_class *)0}, "drbd_main_mutex", 0, 0UL}}; int drbd_init(void) ; static int drbd_open(struct block_device *bdev , fmode_t mode ) ; static int drbd_release(struct gendisk *gd , fmode_t mode ) ; static int w_after_state_ch(struct drbd_conf *mdev , struct drbd_work *w , int unused ) ; static void after_state_ch(struct drbd_conf *mdev , union drbd_state os , union drbd_state ns , enum chg_state_flags flags ) ; static int w_md_sync(struct drbd_conf *mdev , struct drbd_work *w , int unused ) ; static void md_sync_timer_fn(unsigned long data ) ; static int w_bitmap_io(struct drbd_conf *mdev , struct drbd_work *w , int unused ) ; static int w_go_diskless(struct drbd_conf *mdev , struct drbd_work *w , int unused ) ; static int fault_count ; unsigned int minor_count = 32U; unsigned int cn_idx = 8U; char usermode_helper[80U] = { (char )'/', (char )'s', (char )'b', (char )'i', (char )'n', (char )'/', (char )'d', (char )'r', (char )'b', (char )'d', (char )'a', (char )'d', (char )'m', (char )'\000'}; struct ratelimit_state drbd_ratelimit_state = {{{{{0U}, 3735899821U, 4294967295U, (void *)0x0fffffffffffffffUL, {(struct lock_class_key *)0, {(struct lock_class *)0, (struct lock_class *)0}, "drbd_ratelimit_state.lock", 0, 0UL}}}}, 1250, 5, 0, 0, 0UL}; static struct block_device_operations const drbd_ops = {& drbd_open, & drbd_release, (int (*)(struct block_device * , fmode_t , unsigned int , unsigned long ))0, (int (*)(struct block_device * , fmode_t , unsigned int , unsigned long ))0, (int (*)(struct block_device * , sector_t , void ** , unsigned long * ))0, (unsigned int (*)(struct gendisk * , unsigned int ))0, (int (*)(struct gendisk * ))0, (void (*)(struct gendisk * ))0, (int (*)(struct gendisk * ))0, (int (*)(struct block_device * , struct hd_geometry * ))0, (void (*)(struct block_device * , unsigned long ))0, & __this_module}; static int tl_init(struct drbd_conf *mdev ) { struct drbd_tl_epoch *b ; void *tmp ; { { tmp = kmalloc(56UL, 208U); b = (struct drbd_tl_epoch *)tmp; } if ((unsigned long )b == (unsigned long )((struct drbd_tl_epoch *)0)) { return (0); } else { } { INIT_LIST_HEAD(& b->requests); INIT_LIST_HEAD(& b->w.list); b->next = (struct drbd_tl_epoch *)0; b->br_number = 4711U; b->n_writes = 0; b->w.cb = (int (*)(struct drbd_conf * , struct drbd_work * , int ))0; mdev->oldest_tle = b; mdev->newest_tle = b; INIT_LIST_HEAD(& mdev->out_of_sequence_requests); mdev->tl_hash = (struct hlist_head *)0; mdev->tl_hash_s = 0U; } return (1); } } static void tl_cleanup(struct drbd_conf *mdev ) { int tmp ; { if ((unsigned long )mdev->oldest_tle != (unsigned long )mdev->newest_tle) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->oldest_tle == mdev->newest_tle ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 228); } } else { } { tmp = list_empty((struct list_head const *)(& mdev->out_of_sequence_requests)); } if (tmp == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->out_of_sequence_requests) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 229); } } else { } { kfree((void const *)mdev->oldest_tle); mdev->oldest_tle = (struct drbd_tl_epoch *)0; kfree((void const *)mdev->unused_spare_tle); mdev->unused_spare_tle = (struct drbd_tl_epoch *)0; kfree((void const *)mdev->tl_hash); mdev->tl_hash = (struct hlist_head *)0; mdev->tl_hash_s = 0U; } return; } } void _tl_add_barrier(struct drbd_conf *mdev , struct drbd_tl_epoch *new ) { struct drbd_tl_epoch *newest_before ; { { INIT_LIST_HEAD(& new->requests); INIT_LIST_HEAD(& new->w.list); new->w.cb = (int (*)(struct drbd_conf * , struct drbd_work * , int ))0; new->next = (struct drbd_tl_epoch *)0; new->n_writes = 0; newest_before = mdev->newest_tle; } if (newest_before->br_number + 1U != 0U) { new->br_number = newest_before->br_number + 1U; } else { new->br_number = 1U; } if ((unsigned long )mdev->newest_tle != (unsigned long )new) { (mdev->newest_tle)->next = new; mdev->newest_tle = new; } else { } return; } } void tl_release(struct drbd_conf *mdev , unsigned int barrier_nr , unsigned int set_size ) { struct drbd_tl_epoch *b ; struct drbd_tl_epoch *nob ; struct list_head *le ; struct list_head *tle ; struct drbd_request *r ; struct list_head const *__mptr ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; union drbd_state val ; union drbd_state mask ; { { spin_lock_irq(& mdev->req_lock); b = mdev->oldest_tle; } if ((unsigned long )b == (unsigned long )((struct drbd_tl_epoch *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "BAD! BarrierAck #%u received, but no epoch in tl!?\n", barrier_nr); } goto bail; } else { } if (b->br_number != barrier_nr) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "BAD! BarrierAck #%u received, expected #%u!\n", barrier_nr, b->br_number); } goto bail; } else { } if ((unsigned int )b->n_writes != set_size) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "BAD! BarrierAck #%u received with n_writes=%u, expected n_writes=%u!\n", barrier_nr, set_size, b->n_writes); } goto bail; } else { } le = b->requests.next; tle = le->next; goto ldv_49039; ldv_49038: { __mptr = (struct list_head const *)le; r = (struct drbd_request *)__mptr + 0x0fffffffffffffb8UL; _req_mod(r, (enum drbd_req_event )17); le = tle; tle = le->next; } ldv_49039: ; if ((unsigned long )(& b->requests) != (unsigned long )le) { goto ldv_49038; } else { goto ldv_49040; } ldv_49040: { list_del_init(& b->requests); nob = b->next; tmp = test_and_clear_bit(0, (unsigned long volatile *)(& mdev->flags)); } if (tmp != 0) { { _tl_add_barrier(mdev, b); } if ((unsigned long )nob != (unsigned long )((struct drbd_tl_epoch *)0)) { mdev->oldest_tle = nob; } else { } } else { if ((unsigned long )nob == (unsigned long )((struct drbd_tl_epoch *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( nob != NULL ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 332); } } else { } { mdev->oldest_tle = nob; kfree((void const *)b); } } { spin_unlock_irq(& mdev->req_lock); tmp___0 = atomic_dec_and_test(& mdev->ap_pending_cnt); } if (tmp___0 != 0) { { __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); } } else { } { tmp___2 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); } if (tmp___2 < 0) { { tmp___1 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: ap_pending_cnt = %d < 0 !\n", "tl_release", 338, tmp___1); } } else { } return; bail: { spin_unlock_irq(& mdev->req_lock); val.i = 0U; val.ldv_38339.conn = (unsigned char)6; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } return; } } static void _tl_restart(struct drbd_conf *mdev , enum drbd_req_event what ) { struct drbd_tl_epoch *b ; struct drbd_tl_epoch *tmp ; struct drbd_tl_epoch **pn ; struct list_head *le ; struct list_head *tle ; struct list_head carry_reads ; struct drbd_request *req ; int rv ; int n_writes ; int n_reads ; struct list_head const *__mptr ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { b = mdev->oldest_tle; pn = & mdev->oldest_tle; goto ldv_49074; ldv_49073: { n_writes = 0; n_reads = 0; INIT_LIST_HEAD(& carry_reads); le = b->requests.next; tle = le->next; } goto ldv_49066; ldv_49065: { __mptr = (struct list_head const *)le; req = (struct drbd_request *)__mptr + 0x0fffffffffffffb8UL; rv = _req_mod(req, what); n_writes = (rv & 1) + n_writes; n_reads = ((rv & 2) >> 1) + n_reads; le = tle; tle = le->next; } ldv_49066: ; if ((unsigned long )(& b->requests) != (unsigned long )le) { goto ldv_49065; } else { goto ldv_49067; } ldv_49067: tmp = b->next; if (n_writes != 0) { if ((unsigned int )what == 23U) { b->n_writes = n_writes; if ((unsigned long )b->w.cb == (unsigned long )((int (*)(struct drbd_conf * , struct drbd_work * , int ))0)) { { b->w.cb = & w_send_barrier; inc_ap_pending(mdev); set_bit(0U, (unsigned long volatile *)(& mdev->flags)); } } else { } { drbd_queue_work(& mdev->data.work, & b->w); } } else { } pn = & b->next; } else { if (n_reads != 0) { { list_add(& carry_reads, & b->requests); } } else { } { list_del(& b->requests); } if ((unsigned long )b->w.cb != (unsigned long )((int (*)(struct drbd_conf * , struct drbd_work * , int ))0)) { { tmp___0 = atomic_dec_and_test(& mdev->ap_pending_cnt); } if (tmp___0 != 0) { { __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); } } else { } { tmp___2 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); } if (tmp___2 < 0) { { tmp___1 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: ap_pending_cnt = %d < 0 !\n", "_tl_restart", 401, tmp___1); } } else { } } else { } if ((unsigned long )mdev->newest_tle == (unsigned long )b) { if ((unsigned long )tmp != (unsigned long )((struct drbd_tl_epoch *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( tmp == NULL ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 405); } } else { } { INIT_LIST_HEAD(& b->requests); list_splice((struct list_head const *)(& carry_reads), & b->requests); INIT_LIST_HEAD(& b->w.list); b->w.cb = (int (*)(struct drbd_conf * , struct drbd_work * , int ))0; b->br_number = random32(); b->n_writes = 0; *pn = b; } goto ldv_49072; } else { } { *pn = tmp; kfree((void const *)b); } } { b = tmp; list_splice((struct list_head const *)(& carry_reads), & b->requests); } ldv_49074: ; if ((unsigned long )b != (unsigned long )((struct drbd_tl_epoch *)0)) { goto ldv_49073; } else { goto ldv_49072; } ldv_49072: ; return; } } void tl_clear(struct drbd_conf *mdev ) { struct list_head *le ; struct list_head *tle ; struct drbd_request *r ; int tmp ; struct list_head const *__mptr ; { { spin_lock_irq(& mdev->req_lock); _tl_restart(mdev, (enum drbd_req_event )10); tmp = list_empty((struct list_head const *)(& mdev->out_of_sequence_requests)); } if (tmp == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->out_of_sequence_requests) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 443); } } else { } le = mdev->out_of_sequence_requests.next; tle = le->next; goto ldv_49084; ldv_49083: { __mptr = (struct list_head const *)le; r = (struct drbd_request *)__mptr + 0x0fffffffffffffb8UL; _req_mod(r, (enum drbd_req_event )10); le = tle; tle = le->next; } ldv_49084: ; if ((unsigned long )(& mdev->out_of_sequence_requests) != (unsigned long )le) { goto ldv_49083; } else { goto ldv_49085; } ldv_49085: { clear_bit(0, (unsigned long volatile *)(& mdev->flags)); memset((void *)mdev->app_reads_hash, 0, 120UL); spin_unlock_irq(& mdev->req_lock); } return; } } void tl_restart(struct drbd_conf *mdev , enum drbd_req_event what ) { { { spin_lock_irq(& mdev->req_lock); _tl_restart(mdev, what); spin_unlock_irq(& mdev->req_lock); } return; } } static int cl_wide_st_chg(struct drbd_conf *mdev , union drbd_state os , union drbd_state ns ) { int tmp ; { if ((int )os.ldv_38339.conn > 9) { if ((int )ns.ldv_38339.conn > 9) { if ((unsigned int )*((unsigned char *)(& os) + 0UL) != 1U) { if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U) { tmp = 1; } else { goto _L___3; } } else _L___3: if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 192U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 192U) { tmp = 1; } else { goto _L___2; } } else _L___2: if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 176U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 176U) { tmp = 1; } else { goto _L___1; } } else _L___1: if ((unsigned int )*((unsigned char *)(& os) + 1UL) != 0U) { if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 0U) { tmp = 1; } else { goto _L___4; } } else { goto _L___4; } } else { goto _L___4; } } else _L___4: if ((int )os.ldv_38339.conn > 9) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 16U) { tmp = 1; } else { goto _L; } } else _L: if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 160U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U) { tmp = 1; } else { tmp = 0; } } else { tmp = 0; } return (tmp); } } enum drbd_state_rv drbd_change_state(struct drbd_conf *mdev , enum chg_state_flags f , union drbd_state mask , union drbd_state val ) { unsigned long flags ; union drbd_state os ; union drbd_state ns ; enum drbd_state_rv rv ; raw_spinlock_t *tmp ; { { tmp = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp); os = mdev->state; ns.i = (os.i & ~ mask.i) | val.i; rv = _drbd_set_state(mdev, ns, f, (struct completion *)0); ns = mdev->state; spin_unlock_irqrestore(& mdev->req_lock, flags); } return (rv); } } void drbd_force_state(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val ) { { { drbd_change_state(mdev, (enum chg_state_flags )1, mask, val); } return; } } static enum drbd_state_rv is_valid_state(struct drbd_conf *mdev , union drbd_state ns ) ; static enum drbd_state_rv is_valid_state_transition(struct drbd_conf *mdev , union drbd_state ns , union drbd_state os ) ; static union drbd_state sanitize_state(struct drbd_conf *mdev , union drbd_state os , union drbd_state ns , char const **warn_sync_abort ) ; int drbd_send_state_req(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val ) ; static enum drbd_state_rv _req_st_cond(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val ) { union drbd_state os ; union drbd_state ns ; unsigned long flags ; enum drbd_state_rv rv ; int tmp ; int tmp___0 ; raw_spinlock_t *tmp___1 ; int tmp___2 ; { { tmp = test_and_clear_bit(9, (unsigned long volatile *)(& mdev->flags)); } if (tmp != 0) { return ((enum drbd_state_rv )3); } else { } { tmp___0 = test_and_clear_bit(10, (unsigned long volatile *)(& mdev->flags)); } if (tmp___0 != 0) { return ((enum drbd_state_rv )-10); } else { } { rv = (enum drbd_state_rv )0; tmp___1 = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp___1); os = mdev->state; ns.i = (os.i & ~ mask.i) | val.i; ns = sanitize_state(mdev, os, ns, (char const **)0); tmp___2 = cl_wide_st_chg(mdev, os, ns); } if (tmp___2 == 0) { rv = (enum drbd_state_rv )4; } else { } if ((int )rv == 0) { { rv = is_valid_state(mdev, ns); } if ((int )rv == 1) { { rv = is_valid_state_transition(mdev, ns, os); } if ((int )rv == 1) { rv = (enum drbd_state_rv )0; } else { } } else { } } else { } { spin_unlock_irqrestore(& mdev->req_lock, flags); } return (rv); } } static enum drbd_state_rv drbd_req_state(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val , enum chg_state_flags f ) { struct completion done ; unsigned long flags ; union drbd_state os ; union drbd_state ns ; enum drbd_state_rv rv ; raw_spinlock_t *tmp ; int tmp___0 ; wait_queue_t __wait ; struct task_struct *tmp___1 ; raw_spinlock_t *tmp___2 ; int tmp___3 ; struct task_struct *tmp___4 ; { { init_completion(& done); } if (((unsigned int )f & 8U) != 0U) { { mutex_lock_nested(& mdev->state_mutex, 0U); } } else { } { tmp = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp); os = mdev->state; ns.i = (os.i & ~ mask.i) | val.i; ns = sanitize_state(mdev, os, ns, (char const **)0); tmp___3 = cl_wide_st_chg(mdev, os, ns); } if (tmp___3 != 0) { { rv = is_valid_state(mdev, ns); } if ((int )rv == 1) { { rv = is_valid_state_transition(mdev, ns, os); } } else { } { spin_unlock_irqrestore(& mdev->req_lock, flags); } if ((int )rv <= 0) { if (((unsigned int )f & 2U) != 0U) { { print_st_err(mdev, os, ns, (enum drbd_state_rv )((int )rv)); } } else { } goto abort; } else { } { drbd_state_lock___0(mdev); tmp___0 = drbd_send_state_req(mdev, mask, val); } if (tmp___0 == 0) { { drbd_state_unlock(mdev); rv = (enum drbd_state_rv )-10; } if (((unsigned int )f & 2U) != 0U) { { print_st_err(mdev, os, ns, (enum drbd_state_rv )((int )rv)); } } else { } goto abort; } else { } { rv = _req_st_cond(mdev, mask, val); } if ((int )rv != 0) { goto ldv_49156; } else { } { tmp___1 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___1; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_49159: { prepare_to_wait(& mdev->state_wait, & __wait, 2); rv = _req_st_cond(mdev, mask, val); } if ((int )rv != 0) { goto ldv_49158; } else { } { schedule(); } goto ldv_49159; ldv_49158: { finish_wait(& mdev->state_wait, & __wait); } ldv_49156: ; if ((int )rv <= 0) { { drbd_state_unlock(mdev); } if (((unsigned int )f & 2U) != 0U) { { print_st_err(mdev, os, ns, (enum drbd_state_rv )((int )rv)); } } else { } goto abort; } else { } { tmp___2 = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp___2); os = mdev->state; ns.i = (os.i & ~ mask.i) | val.i; rv = _drbd_set_state(mdev, ns, f, & done); drbd_state_unlock(mdev); } } else { { rv = _drbd_set_state(mdev, ns, f, & done); } } { spin_unlock_irqrestore(& mdev->req_lock, flags); } if (((unsigned int )f & 4U) != 0U) { if ((int )rv == 1) { { tmp___4 = get_current(); } if ((unsigned long )tmp___4 == (unsigned long )mdev->worker.task) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( current != mdev->worker.task ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 631); } } else { } { wait_for_completion(& done); } } else { } } else { } abort: ; if (((unsigned int )f & 8U) != 0U) { { mutex_unlock(& mdev->state_mutex); } } else { } return (rv); } } enum drbd_state_rv _drbd_request_state(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val , enum chg_state_flags f ) { enum drbd_state_rv rv ; wait_queue_t __wait ; struct task_struct *tmp ; { { rv = drbd_req_state(mdev, mask, val, f); } if ((int )rv != -18) { goto ldv_49170; } else { } { tmp = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_49173: { prepare_to_wait(& mdev->state_wait, & __wait, 2); rv = drbd_req_state(mdev, mask, val, f); } if ((int )rv != -18) { goto ldv_49172; } else { } { schedule(); } goto ldv_49173; ldv_49172: { finish_wait(& mdev->state_wait, & __wait); } ldv_49170: ; return (rv); } } static void print_st(struct drbd_conf *mdev , char *name , union drbd_state ns ) { int tmp ; int tmp___0 ; int tmp___1 ; int tmp___3 ; int tmp___4 ; char const *tmp___5 ; char const *tmp___6 ; char const *tmp___7 ; char const *tmp___8 ; char const *tmp___9 ; { if ((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { tmp = 117; } else { tmp = 45; } if ((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { tmp___0 = 112; } else { tmp___0 = 45; } if ((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { tmp___1 = 97; } else { tmp___1 = 45; } { tmp___4 = is_susp(ns); } if (tmp___4 != 0) { tmp___3 = 115; } else { tmp___3 = 114; } { tmp___5 = drbd_disk_str((enum drbd_disk_state )ns.ldv_38339.pdsk); tmp___6 = drbd_disk_str((enum drbd_disk_state )ns.ldv_38339.disk); tmp___7 = drbd_role_str((enum drbd_role )ns.ldv_38339.peer); tmp___8 = drbd_role_str((enum drbd_role )ns.ldv_38339.role); tmp___9 = drbd_conn_str((enum drbd_conns )ns.ldv_38339.conn); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), " %s = { cs:%s ro:%s/%s ds:%s/%s %c%c%c%c }\n", name, tmp___9, tmp___8, tmp___7, tmp___6, tmp___5, tmp___3, tmp___1, tmp___0, tmp); } return; } } void print_st_err(struct drbd_conf *mdev , union drbd_state os , union drbd_state ns , enum drbd_state_rv err ) { char const *tmp ; { if ((int )err == -18) { return; } else { } { tmp = drbd_set_st_err_str(err); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "State change failed: %s\n", tmp); print_st(mdev, (char *)" state", os); print_st(mdev, (char *)"wanted", ns); } return; } } static enum drbd_state_rv is_valid_state(struct drbd_conf *mdev , union drbd_state ns ) { enum drbd_fencing_p fp ; enum drbd_state_rv rv ; int tmp ; int tmp___0 ; { { rv = (enum drbd_state_rv )1; fp = (enum drbd_fencing_p )0; tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp != 0) { { fp = (enum drbd_fencing_p )(mdev->ldev)->dc.fencing; put_ldev(mdev); } } else { } { tmp___0 = get_net_conf(mdev); } if (tmp___0 != 0) { if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) == 0U) { if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U) { if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 4U) { rv = (enum drbd_state_rv )-1; } else { } } else { } } else { } { put_net_conf(mdev); } } else { } if ((int )rv <= 0) { } else if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 2U) { if (mdev->open_cnt != 0) { rv = (enum drbd_state_rv )-12; } else { goto _L___16; } } else _L___16: if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U) { if ((int )ns.ldv_38339.conn <= 9) { if ((int )ns.ldv_38339.disk <= 7) { rv = (enum drbd_state_rv )-2; } else { goto _L___15; } } else { goto _L___15; } } else _L___15: if ((unsigned int )fp != 0U) { if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U) { if ((int )ns.ldv_38339.conn <= 9) { if ((int )ns.ldv_38339.pdsk > 5) { rv = (enum drbd_state_rv )-7; } else { goto _L___13; } } else { goto _L___13; } } else { goto _L___13; } } else _L___13: if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U) { if ((int )ns.ldv_38339.disk <= 4) { if ((int )ns.ldv_38339.pdsk <= 4) { rv = (enum drbd_state_rv )-2; } else { goto _L___10; } } else { goto _L___10; } } else _L___10: if ((int )ns.ldv_38339.conn > 10) { if ((int )ns.ldv_38339.disk <= 3) { rv = (enum drbd_state_rv )-4; } else { goto _L___8; } } else _L___8: if ((int )ns.ldv_38339.conn > 10) { if ((int )ns.ldv_38339.pdsk <= 3) { rv = (enum drbd_state_rv )-5; } else { goto _L___7; } } else _L___7: if ((int )ns.ldv_38339.conn > 10) { if ((int )ns.ldv_38339.disk <= 7) { if ((int )ns.ldv_38339.pdsk <= 7) { rv = (enum drbd_state_rv )-2; } else { goto _L___6; } } else { goto _L___6; } } else _L___6: if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 160U) { goto _L___4; } else if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 208U) { goto _L___4; } else if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 256U) { goto _L___4; } else if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 320U) { _L___4: if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 10U) { rv = (enum drbd_state_rv )-6; } else { goto _L___3; } } else _L___3: if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U) { goto _L___2; } else if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 304U) { _L___2: if ((unsigned int )mdev->sync_conf.verify_alg[0] == 0U) { rv = (enum drbd_state_rv )-14; } else { goto _L___1; } } else _L___1: if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U) { goto _L___0; } else if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 304U) { _L___0: if (mdev->agreed_pro_version <= 87) { rv = (enum drbd_state_rv )-17; } else { goto _L; } } else _L: if ((int )ns.ldv_38339.conn > 9) { if (*((unsigned int *)(& ns) + 0UL) == 49152U) { rv = (enum drbd_state_rv )-6; } else { } } else { } return (rv); } } static enum drbd_state_rv is_valid_state_transition(struct drbd_conf *mdev , union drbd_state ns , union drbd_state os ) { enum drbd_state_rv rv ; { rv = (enum drbd_state_rv )1; if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 192U) { goto _L; } else if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 176U) { _L: if ((int )os.ldv_38339.conn > 10) { rv = (enum drbd_state_rv )-8; } else { } } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 16U) { if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 0U) { rv = (enum drbd_state_rv )-9; } else { } } else { } if ((int )ns.ldv_38339.disk > 1) { if ((unsigned int )*((unsigned char *)(& os) + 1UL) == 0U) { rv = (enum drbd_state_rv )-11; } else { } } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 128U) { if ((int )os.ldv_38339.conn <= 1) { rv = (enum drbd_state_rv )-13; } else { } } else { } if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 10U) { if ((int )os.ldv_38339.disk <= 4) { if ((unsigned int )*((unsigned char *)(& os) + 1UL) != 2U) { rv = (enum drbd_state_rv )-16; } else { } } else { } } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 16U) { if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 32U) { rv = (enum drbd_state_rv )-18; } else { } } else { } if ((int )ns.ldv_38339.conn == (int )os.ldv_38339.conn) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 144U) { rv = (enum drbd_state_rv )-18; } else { } } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U) { goto _L___0; } else if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 304U) { _L___0: if ((int )os.ldv_38339.conn <= 9) { rv = (enum drbd_state_rv )-15; } else { } } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U) { goto _L___1; } else if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 304U) { _L___1: if ((int )ns.ldv_38339.conn != (int )os.ldv_38339.conn) { if ((int )os.ldv_38339.conn > 10) { rv = (enum drbd_state_rv )-8; } else { } } else { } } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 176U) { goto _L___2; } else if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 192U) { _L___2: if ((int )os.ldv_38339.conn <= 9) { rv = (enum drbd_state_rv )-15; } else { } } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 272U) { goto _L___3; } else if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 256U) { _L___3: if ((int )os.ldv_38339.conn <= 8) { rv = (enum drbd_state_rv )-15; } else { } } else { } return (rv); } } static union drbd_state sanitize_state(struct drbd_conf *mdev , union drbd_state os , union drbd_state ns , char const **warn_sync_abort ) { enum drbd_fencing_p fp ; enum drbd_disk_state disk_min ; enum drbd_disk_state disk_max ; enum drbd_disk_state pdsk_min ; enum drbd_disk_state pdsk_max ; int tmp ; int tmp___0 ; char const *tmp___1 ; char const *tmp___2 ; char const *tmp___3 ; char const *tmp___4 ; { { fp = (enum drbd_fencing_p )0; tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp != 0) { { fp = (enum drbd_fencing_p )(mdev->ldev)->dc.fencing; put_ldev(mdev); } } else { } if ((int )ns.ldv_38339.conn > 2) { if ((int )ns.ldv_38339.conn <= 7) { if ((int )os.ldv_38339.conn <= 1) { ns.ldv_38339.conn = os.ldv_38339.conn; } else { } } else { } } else { } if ((int )os.ldv_38339.conn > 2) { if ((int )os.ldv_38339.conn <= 7) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) != 32U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) != 16U) { if ((int )ns.ldv_38339.conn <= 7) { ns.ldv_38339.conn = os.ldv_38339.conn; } else { } } else { } } else { } } else { } } else { } if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 4U) { if ((unsigned int )*((unsigned char *)(& os) + 1UL) == 0U) { ns.ldv_38339.disk = (unsigned char)0; } else { } } else { } if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 4U) { if ((unsigned int )*((unsigned char *)(& os) + 1UL) == 2U) { ns.ldv_38339.disk = (unsigned char)0; } else { } } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 16U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) != 0U) { ns.ldv_38339.conn = os.ldv_38339.conn; } else { } } else { } if ((int )ns.ldv_38339.conn <= 9) { ns.ldv_38339.peer_isp = (unsigned char)0; ns.ldv_38339.peer = (unsigned char)0; if ((int )ns.ldv_38339.pdsk > 6) { ns.ldv_38339.pdsk = (unsigned char)6; } else if ((int )ns.ldv_38339.pdsk <= 3) { ns.ldv_38339.pdsk = (unsigned char)6; } else { } } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 0U) { if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 0U) { if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 2U) { ns.ldv_38339.aftr_isp = (unsigned char)0; } else { } } else { } } else { } if ((int )os.ldv_38339.conn > 10) { if ((int )ns.ldv_38339.conn > 10) { if ((int )ns.ldv_38339.disk <= 2) { goto _L; } else if ((int )ns.ldv_38339.pdsk <= 2) { _L: if ((unsigned long )warn_sync_abort != (unsigned long )((char const **)0)) { if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 288U) { *warn_sync_abort = "Online-verify"; } else if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 304U) { *warn_sync_abort = "Online-verify"; } else { *warn_sync_abort = "Resync"; } } else { } ns.ldv_38339.conn = (unsigned char)10; } else { } } else { } } else { } if ((int )ns.ldv_38339.conn <= 9) { if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 6U) { { tmp___0 = _get_ldev_if_state(mdev, (enum drbd_disk_state )3); } if (tmp___0 != 0) { if (mdev->ed_uuid == (mdev->ldev)->md.uuid[0]) { ns.ldv_38339.disk = mdev->new_state_tmp.ldv_38339.disk; ns.ldv_38339.pdsk = mdev->new_state_tmp.ldv_38339.pdsk; } else { { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "Connection lost while negotiating, no data!\n"); ns.ldv_38339.disk = (unsigned char)0; ns.ldv_38339.pdsk = (unsigned char)6; } } { put_ldev(mdev); } } else { } } else { } } else { } if ((int )ns.ldv_38339.conn > 9) { if ((int )ns.ldv_38339.conn <= 21) { if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 14U) { ns.ldv_38339.disk = (unsigned char)8; } else if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 10U) { ns.ldv_38339.disk = (unsigned char)8; } else { } if (*((unsigned int *)(& ns) + 0UL) == 57344U) { ns.ldv_38339.pdsk = (unsigned char)8; } else if (*((unsigned int *)(& ns) + 0UL) == 40960U) { ns.ldv_38339.pdsk = (unsigned char)8; } else { } } else { } } else { } disk_min = (enum drbd_disk_state )0; disk_max = (enum drbd_disk_state )8; pdsk_min = (enum drbd_disk_state )4; pdsk_max = (enum drbd_disk_state )6; if ((int )((unsigned int )ns.ldv_38339.conn) == 14) { goto case_14; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 21) { goto case_21; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 12) { goto case_12; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 15) { goto case_15; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 23) { goto case_23; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 18) { goto case_18; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 19) { goto case_19; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 10) { goto case_10; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 13) { goto case_13; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 20) { goto case_20; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 11) { goto case_11; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 22) { goto case_22; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 17) { goto case_17; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 16) { goto case_16; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 0) { goto case_0; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 1) { goto case_1; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 2) { goto case_2; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 3) { goto case_3; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 4) { goto case_4; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 5) { goto case_5; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 6) { goto case_6; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 7) { goto case_7; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 8) { goto case_8; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 9) { goto case_9; } else if ((int )((unsigned int )ns.ldv_38339.conn) == 31) { goto case_31; } else if (0) { case_14: ; case_21: ; case_12: ; case_15: ; case_23: disk_min = (enum drbd_disk_state )4; disk_max = (enum drbd_disk_state )5; pdsk_min = (enum drbd_disk_state )8; pdsk_max = (enum drbd_disk_state )8; goto ldv_49213; case_18: ; case_19: disk_min = (enum drbd_disk_state )8; disk_max = (enum drbd_disk_state )8; pdsk_min = (enum drbd_disk_state )8; pdsk_max = (enum drbd_disk_state )8; goto ldv_49213; case_10: disk_min = (enum drbd_disk_state )0; disk_max = (enum drbd_disk_state )8; pdsk_min = (enum drbd_disk_state )0; pdsk_max = (enum drbd_disk_state )8; goto ldv_49213; case_13: ; case_20: ; case_11: ; case_22: disk_min = (enum drbd_disk_state )8; disk_max = (enum drbd_disk_state )8; pdsk_min = (enum drbd_disk_state )4; pdsk_max = (enum drbd_disk_state )7; goto ldv_49213; case_17: disk_min = (enum drbd_disk_state )4; disk_max = (enum drbd_disk_state )4; pdsk_min = (enum drbd_disk_state )8; pdsk_max = (enum drbd_disk_state )8; goto ldv_49213; case_16: disk_min = (enum drbd_disk_state )8; disk_max = (enum drbd_disk_state )8; pdsk_min = (enum drbd_disk_state )4; pdsk_max = (enum drbd_disk_state )4; goto ldv_49213; case_0: ; case_1: ; case_2: ; case_3: ; case_4: ; case_5: ; case_6: ; case_7: ; case_8: ; case_9: ; case_31: ; goto ldv_49213; } else { } ldv_49213: ; if ((unsigned int )ns.ldv_38339.disk > (unsigned int )disk_max) { ns.ldv_38339.disk = (unsigned char )disk_max; } else { } if ((unsigned int )ns.ldv_38339.disk < (unsigned int )disk_min) { { tmp___1 = drbd_disk_str(disk_min); tmp___2 = drbd_disk_str((enum drbd_disk_state )ns.ldv_38339.disk); dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Implicitly set disk from %s to %s\n", tmp___2, tmp___1); ns.ldv_38339.disk = (unsigned char )disk_min; } } else { } if ((unsigned int )ns.ldv_38339.pdsk > (unsigned int )pdsk_max) { ns.ldv_38339.pdsk = (unsigned char )pdsk_max; } else { } if ((unsigned int )ns.ldv_38339.pdsk < (unsigned int )pdsk_min) { { tmp___3 = drbd_disk_str(pdsk_min); tmp___4 = drbd_disk_str((enum drbd_disk_state )ns.ldv_38339.pdsk); dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Implicitly set pdsk from %s to %s\n", tmp___4, tmp___3); ns.ldv_38339.pdsk = (unsigned char )pdsk_min; } } else { } if ((unsigned int )fp == 2U) { if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U) { if ((int )ns.ldv_38339.conn <= 9) { if ((int )ns.ldv_38339.pdsk > 5) { if ((unsigned int )*((unsigned char *)(& os) + 0UL) != 1U) { ns.ldv_38339.susp_fen = (unsigned char)1; } else if ((int )os.ldv_38339.conn > 9) { ns.ldv_38339.susp_fen = (unsigned char)1; } else if ((int )os.ldv_38339.pdsk <= 5) { ns.ldv_38339.susp_fen = (unsigned char)1; } else { } } else { } } else { } } else { } } else { } if (mdev->sync_conf.on_no_data == 1) { if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U) { if ((int )ns.ldv_38339.disk <= 7) { if ((int )ns.ldv_38339.pdsk <= 7) { if ((unsigned int )*((unsigned char *)(& os) + 0UL) != 1U) { ns.ldv_38339.susp_nod = (unsigned char)1; } else if ((int )os.ldv_38339.disk > 7) { ns.ldv_38339.susp_nod = (unsigned char)1; } else if ((int )os.ldv_38339.pdsk > 7) { ns.ldv_38339.susp_nod = (unsigned char)1; } else { } } else { } } else { } } else { } } else { } if ((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { goto _L___0; } else if ((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { goto _L___0; } else if ((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { _L___0: if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 256U) { ns.ldv_38339.conn = (unsigned char)20; } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 272U) { ns.ldv_38339.conn = (unsigned char)21; } else { } } else { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 320U) { ns.ldv_38339.conn = (unsigned char)16; } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 336U) { ns.ldv_38339.conn = (unsigned char)17; } else { } } return (ns); } } static void set_ov_position(struct drbd_conf *mdev , enum drbd_conns cs ) { unsigned long bit ; { if (mdev->agreed_pro_version <= 89) { mdev->ov_start_sector = 0UL; } else { } { mdev->rs_total = drbd_bm_bits(mdev); mdev->ov_position = 0UL; } if ((unsigned int )cs == 19U) { mdev->ov_start_sector = 0x0fffffffffffffffUL; } else { bit = mdev->ov_start_sector >> 3; if (mdev->rs_total <= bit) { mdev->ov_start_sector = (mdev->rs_total - 1UL) << 3; mdev->rs_total = 1UL; } else { mdev->rs_total = mdev->rs_total - bit; } mdev->ov_position = mdev->ov_start_sector; } mdev->ov_left = mdev->rs_total; return; } } static void drbd_resume_al(struct drbd_conf *mdev ) { int tmp ; { { tmp = test_and_clear_bit(28, (unsigned long volatile *)(& mdev->flags)); } if (tmp != 0) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Resumed AL updates\n"); } } else { } return; } } enum drbd_state_rv __drbd_set_state(struct drbd_conf *mdev , union drbd_state ns , enum chg_state_flags flags , struct completion *done ) { union drbd_state os ; enum drbd_state_rv rv ; char const *warn_sync_abort ; struct after_state_chg_work *ascw ; enum drbd_state_rv tmp ; char *pbp ; char pb[300U] ; char const *tmp___0 ; char const *tmp___1 ; int tmp___2 ; char const *tmp___3 ; char const *tmp___4 ; int tmp___5 ; char const *tmp___6 ; char const *tmp___7 ; int tmp___8 ; char const *tmp___9 ; char const *tmp___10 ; int tmp___11 ; char const *tmp___12 ; char const *tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; int tmp___17 ; int tmp___18 ; int tmp___19 ; int tmp___20 ; int tmp___21 ; int tmp___22 ; int tmp___23 ; unsigned long tmp___24 ; unsigned long now ; int i ; u32 mdf ; int tmp___25 ; int tmp___26 ; void *tmp___27 ; { { rv = (enum drbd_state_rv )1; warn_sync_abort = (char const *)0; os = mdev->state; ns = sanitize_state(mdev, os, ns, & warn_sync_abort); } if (ns.i == os.i) { return ((enum drbd_state_rv )2); } else { } if (((unsigned int )flags & 1U) == 0U) { { rv = is_valid_state(mdev, ns); } if ((int )rv <= 0) { { tmp = is_valid_state(mdev, os); } if ((int )tmp == (int )rv) { { rv = is_valid_state_transition(mdev, ns, os); } } else { { rv = is_valid_state_transition(mdev, ns, os); } } } else { } } else { } if ((int )rv <= 0) { if (((unsigned int )flags & 2U) != 0U) { { print_st_err(mdev, os, ns, rv); } } else { } return (rv); } else { } if ((unsigned long )warn_sync_abort != (unsigned long )((char const *)0)) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s aborted.\n", warn_sync_abort); } } else { } pbp = (char *)(& pb); *pbp = (char)0; if ((int )ns.ldv_38339.role != (int )os.ldv_38339.role) { { tmp___0 = drbd_role_str((enum drbd_role )ns.ldv_38339.role); tmp___1 = drbd_role_str((enum drbd_role )os.ldv_38339.role); tmp___2 = sprintf(pbp, "role( %s -> %s ) ", tmp___1, tmp___0); pbp = pbp + (unsigned long )tmp___2; } } else { } if ((int )ns.ldv_38339.peer != (int )os.ldv_38339.peer) { { tmp___3 = drbd_role_str((enum drbd_role )ns.ldv_38339.peer); tmp___4 = drbd_role_str((enum drbd_role )os.ldv_38339.peer); tmp___5 = sprintf(pbp, "peer( %s -> %s ) ", tmp___4, tmp___3); pbp = pbp + (unsigned long )tmp___5; } } else { } if ((int )ns.ldv_38339.conn != (int )os.ldv_38339.conn) { { tmp___6 = drbd_conn_str((enum drbd_conns )ns.ldv_38339.conn); tmp___7 = drbd_conn_str((enum drbd_conns )os.ldv_38339.conn); tmp___8 = sprintf(pbp, "conn( %s -> %s ) ", tmp___7, tmp___6); pbp = pbp + (unsigned long )tmp___8; } } else { } if ((int )ns.ldv_38339.disk != (int )os.ldv_38339.disk) { { tmp___9 = drbd_disk_str((enum drbd_disk_state )ns.ldv_38339.disk); tmp___10 = drbd_disk_str((enum drbd_disk_state )os.ldv_38339.disk); tmp___11 = sprintf(pbp, "disk( %s -> %s ) ", tmp___10, tmp___9); pbp = pbp + (unsigned long )tmp___11; } } else { } if ((int )ns.ldv_38339.pdsk != (int )os.ldv_38339.pdsk) { { tmp___12 = drbd_disk_str((enum drbd_disk_state )ns.ldv_38339.pdsk); tmp___13 = drbd_disk_str((enum drbd_disk_state )os.ldv_38339.pdsk); tmp___14 = sprintf(pbp, "pdsk( %s -> %s ) ", tmp___13, tmp___12); pbp = pbp + (unsigned long )tmp___14; } } else { } { tmp___18 = is_susp(ns); tmp___19 = is_susp(os); } if (tmp___18 != tmp___19) { { tmp___15 = is_susp(ns); tmp___16 = is_susp(os); tmp___17 = sprintf(pbp, "susp( %d -> %d ) ", tmp___16, tmp___15); pbp = pbp + (unsigned long )tmp___17; } } else { } if ((int )ns.ldv_38339.aftr_isp != (int )os.ldv_38339.aftr_isp) { { tmp___20 = sprintf(pbp, "aftr_isp( %d -> %d ) ", (int )os.ldv_38339.aftr_isp, (int )ns.ldv_38339.aftr_isp); pbp = pbp + (unsigned long )tmp___20; } } else { } if ((int )ns.ldv_38339.peer_isp != (int )os.ldv_38339.peer_isp) { { tmp___21 = sprintf(pbp, "peer_isp( %d -> %d ) ", (int )os.ldv_38339.peer_isp, (int )ns.ldv_38339.peer_isp); pbp = pbp + (unsigned long )tmp___21; } } else { } if ((int )ns.ldv_38339.user_isp != (int )os.ldv_38339.user_isp) { { tmp___22 = sprintf(pbp, "user_isp( %d -> %d ) ", (int )os.ldv_38339.user_isp, (int )ns.ldv_38339.user_isp); pbp = pbp + (unsigned long )tmp___22; } } else { } { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s\n", (char *)(& pb)); } if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 0U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 0U) { if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 2U) { { tmp___23 = test_and_set_bit(22, (unsigned long volatile *)(& mdev->flags)); } if (tmp___23 == 0) { { set_bit(23U, (unsigned long volatile *)(& mdev->flags)); } } else { } } else { } } else { } } else { } if ((unsigned int )*((unsigned char *)(& os) + 1UL) != 4U) { if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 4U) { { atomic_inc(& mdev->local_cnt); } } else { goto _L; } } else _L: if ((unsigned int )*((unsigned char *)(& os) + 1UL) != 0U) { if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 0U) { { atomic_inc(& mdev->local_cnt); } } else { } } else { } mdev->state = ns; if ((unsigned int )*((unsigned char *)(& os) + 1UL) == 2U) { if ((int )ns.ldv_38339.disk > 2) { { drbd_print_uuids(mdev, "attached to UUIDs"); } } else { } } else { } { __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); __wake_up(& mdev->state_wait, 3U, 1, (void *)0); } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 288U) { goto _L___0; } else if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 304U) { _L___0: if ((int )ns.ldv_38339.conn <= 9) { { tmp___24 = drbd_bm_bits(mdev); mdev->ov_start_sector = (tmp___24 - mdev->ov_left) << 3; _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Online Verify reached sector %llu\n", (unsigned long long )mdev->ov_start_sector); } } else { } } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 336U) { goto _L___2; } else if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 320U) { _L___2: if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 272U) { goto _L___1; } else if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 256U) { _L___1: { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Syncer continues.\n"); mdev->rs_paused = mdev->rs_paused + (unsigned long )((long )jiffies - (long )mdev->rs_mark_time[mdev->rs_last_mark]); } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 272U) { { mod_timer(& mdev->resync_timer, (unsigned long )jiffies); } } else { } } else { } } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 272U) { goto _L___3; } else if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 256U) { _L___3: if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 336U) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Resync suspended\n"); mdev->rs_mark_time[mdev->rs_last_mark] = (unsigned long )jiffies; } } else if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 320U) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Resync suspended\n"); mdev->rs_mark_time[mdev->rs_last_mark] = (unsigned long )jiffies; } } else { } } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 160U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U) { goto _L___4; } else if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 304U) { _L___4: { now = (unsigned long )jiffies; set_ov_position(mdev, (enum drbd_conns )ns.ldv_38339.conn); mdev->rs_start = now; mdev->rs_last_events = 0; mdev->rs_last_sect_ev = 0; mdev->ov_last_oos_size = 0UL; mdev->ov_last_oos_start = 0UL; i = 0; } goto ldv_49257; ldv_49256: mdev->rs_mark_left[i] = mdev->ov_left; mdev->rs_mark_time[i] = now; i = i + 1; ldv_49257: ; if (i <= 7) { goto ldv_49256; } else { goto ldv_49258; } ldv_49258: { drbd_rs_controller_reset(mdev); } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Starting Online Verify from sector %llu\n", (unsigned long long )mdev->ov_position); mod_timer(& mdev->resync_timer, (unsigned long )jiffies); } } else { } } else { } } else { } { tmp___26 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___26 != 0) { { mdf = (mdev->ldev)->md.flags & 4294967176U; tmp___25 = constant_test_bit(11U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___25 != 0) { mdf = mdf | 64U; } else { } if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { mdf = mdf | 2U; } else if ((int )mdev->state.ldv_38339.pdsk <= 3) { if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 4U) { mdf = mdf | 2U; } else { } } else { } if ((int )mdev->state.ldv_38339.conn > 9) { mdf = mdf | 4U; } else { } if ((int )mdev->state.ldv_38339.disk > 4) { mdf = mdf | 1U; } else { } if ((int )mdev->state.ldv_38339.disk > 5) { mdf = mdf | 16U; } else { } if ((int )mdev->state.ldv_38339.pdsk <= 5) { if ((int )mdev->state.ldv_38339.pdsk > 3) { mdf = mdf | 32U; } else { } } else { } if ((mdev->ldev)->md.flags != mdf) { { (mdev->ldev)->md.flags = mdf; drbd_md_mark_dirty(mdev); } } else { } if ((int )os.ldv_38339.disk <= 6) { if ((int )ns.ldv_38339.disk > 6) { { drbd_set_ed_uuid(mdev, (mdev->ldev)->md.uuid[0]); } } else { } } else { } { put_ldev(mdev); } } else { } if ((unsigned int )*((unsigned char *)(& os) + 1UL) == 8U) { if (*((unsigned int *)(& os) + 0UL) == 32768U) { if ((unsigned int )*((unsigned char *)(& os) + 0UL) == 8U) { if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 4U) { { set_bit(13U, (unsigned long volatile *)(& mdev->flags)); } } else { } } else { } } else { } } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 16U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 16U) { { drbd_thread_stop_nowait(& mdev->receiver); } } else { } } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 0U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 0U) { { drbd_thread_stop_nowait(& mdev->receiver); } } else { } } else { } if ((int )os.ldv_38339.conn > 7) { if ((int )ns.ldv_38339.conn <= 7) { if ((int )ns.ldv_38339.conn > 2) { { drbd_thread_restart_nowait(& mdev->receiver); } } else { } } else { } } else { } if ((int )os.ldv_38339.conn <= 9) { if ((int )ns.ldv_38339.conn > 9) { { drbd_resume_al(mdev); } } else { } } else { } { tmp___27 = kmalloc(48UL, 32U); ascw = (struct after_state_chg_work *)tmp___27; } if ((unsigned long )ascw != (unsigned long )((struct after_state_chg_work *)0)) { { ascw->os = os; ascw->ns = ns; ascw->flags = flags; ascw->w.cb = & w_after_state_ch; ascw->done = done; drbd_queue_work(& mdev->data.work, & ascw->w); } } else { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Could not kmalloc an ascw\n"); } } return (rv); } } static int w_after_state_ch(struct drbd_conf *mdev , struct drbd_work *w , int unused ) { struct after_state_chg_work *ascw ; struct drbd_work const *__mptr ; { { __mptr = (struct drbd_work const *)w; ascw = (struct after_state_chg_work *)__mptr; after_state_ch(mdev, ascw->os, ascw->ns, ascw->flags); } if (((unsigned int )ascw->flags & 4U) != 0U) { if ((unsigned long )ascw->done == (unsigned long )((struct completion *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( ascw->done != NULL ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 1283); } } else { } { complete(ascw->done); } } else { } { kfree((void const *)ascw); } return (1); } } static void abw_start_sync(struct drbd_conf *mdev , int rv ) { union drbd_state val ; union drbd_state mask ; union drbd_state val___0 ; union drbd_state mask___0 ; { if (rv != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Writing the bitmap failed not starting resync.\n"); val.i = 0U; val.ldv_38339.conn = (unsigned char)10; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; _drbd_request_state(mdev, mask, val, (enum chg_state_flags )2); } return; } else { } if ((int )mdev->state.ldv_38339.conn == 12) { goto case_12; } else if ((int )mdev->state.ldv_38339.conn == 11) { goto case_11; } else if (0) { case_12: { val___0.i = 0U; val___0.ldv_38339.conn = (unsigned char)15; mask___0.i = 0U; mask___0.ldv_38339.conn = (unsigned char)31; _drbd_request_state(mdev, mask___0, val___0, (enum chg_state_flags )2); } goto ldv_49281; case_11: { drbd_start_resync(mdev, (enum drbd_conns )16); } goto ldv_49281; } else { } ldv_49281: ; return; } } int drbd_bitmap_io_from_worker(struct drbd_conf *mdev , int (*io_fn)(struct drbd_conf * ) , char *why , enum bm_flag flags ) { int rv ; struct task_struct *tmp ; { { tmp = get_current(); } if ((unsigned long )tmp != (unsigned long )mdev->worker.task) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( current == mdev->worker.task ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 1315); } } else { } { set_bit(15U, (unsigned long volatile *)(& mdev->flags)); drbd_bm_lock(mdev, why, flags); rv = (*io_fn)(mdev); drbd_bm_unlock(mdev); drbd_resume_io(mdev); } return (rv); } } static void after_state_ch(struct drbd_conf *mdev , union drbd_state os , union drbd_state ns , enum chg_state_flags flags ) { enum drbd_fencing_p fp ; enum drbd_req_event what ; union drbd_state nsm ; int tmp ; int tmp___0 ; union drbd_state __ns ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; enum drbd_io_error_p eh ; int was_io_error ; char const *tmp___6 ; int tmp___7 ; char const *tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; { what = (enum drbd_req_event )26; nsm.i = 4294967295U; if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 160U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 160U) { { clear_bit(11, (unsigned long volatile *)(& mdev->flags)); } if ((unsigned long )mdev->p_uuid != (unsigned long )((u64 *)0)) { *(mdev->p_uuid + 5UL) = *(mdev->p_uuid + 5UL) & 0x0ffffffffffffffdULL; } else { } } else { } } else { } { fp = (enum drbd_fencing_p )0; tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp != 0) { { fp = (enum drbd_fencing_p )(mdev->ldev)->dc.fencing; put_ldev(mdev); } } else { } { drbd_bcast_state(mdev, ns); } if ((unsigned int )*((unsigned char *)(& os) + 0UL) != 1U) { goto _L; } else if ((int )os.ldv_38339.disk > 7) { goto _L; } else if ((int )os.ldv_38339.pdsk > 7) { _L: if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U) { if ((int )ns.ldv_38339.disk <= 7) { if ((int )ns.ldv_38339.pdsk <= 7) { { drbd_khelper(mdev, (char *)"pri-on-incon-degr"); } } else { } } else { } } else { } } else { } nsm.i = 4294967295U; if ((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { if ((int )os.ldv_38339.conn <= 9) { if ((int )ns.ldv_38339.conn > 9) { what = (enum drbd_req_event )23; } else { } } else { } if ((unsigned int )*((unsigned char *)(& os) + 1UL) == 2U) { if ((int )ns.ldv_38339.disk > 1) { what = (enum drbd_req_event )25; } else { } } else { } if ((unsigned int )what != 26U) { nsm.ldv_38339.susp_nod = (unsigned char)0; } else { } } else { } if ((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { if ((int )os.ldv_38339.pdsk > 5) { if ((int )ns.ldv_38339.pdsk <= 5) { { tl_clear(mdev); tmp___0 = constant_test_bit(27U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___0 != 0) { { drbd_uuid_new_current(mdev); clear_bit(27, (unsigned long volatile *)(& mdev->flags)); } } else { } { spin_lock_irq(& mdev->req_lock); __ns.i = mdev->state.i; __ns.ldv_38339.susp_fen = (unsigned char)0; _drbd_set_state(mdev, __ns, (enum chg_state_flags )2, (struct completion *)0); spin_unlock_irq(& mdev->req_lock); } } else { } } else { } if ((int )os.ldv_38339.conn <= 9) { if ((int )ns.ldv_38339.conn > 9) { { clear_bit(27, (unsigned long volatile *)(& mdev->flags)); what = (enum drbd_req_event )23; nsm.ldv_38339.susp_fen = (unsigned char)0; } } else { } } else { } } else { } if ((unsigned int )what != 26U) { { spin_lock_irq(& mdev->req_lock); _tl_restart(mdev, what); nsm.i = nsm.i & mdev->state.i; _drbd_set_state(mdev, nsm, (enum chg_state_flags )2, (struct completion *)0); spin_unlock_irq(& mdev->req_lock); } } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 256U) { if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 320U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 256U) { goto _L___0; } else if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 320U) { _L___0: if (mdev->agreed_pro_version > 95) { { tmp___1 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___1 != 0) { { drbd_gen_and_send_sync_uuid(mdev); put_ldev(mdev); } } else { } } else { } } else { } } else { } } else { } if (*((unsigned int *)(& os) + 0UL) == 0U) { if ((int )ns.ldv_38339.pdsk > 0) { { drbd_send_uuids(mdev); drbd_send_state(mdev); } } else { } } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 208U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 208U) { if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 208U) { { drbd_queue_bitmap_io(mdev, & drbd_send_bitmap, (void (*)(struct drbd_conf * , int ))0, (char *)"send_bitmap (WFBitMapS)", (enum bm_flag )3); } } else { } } else { } } else { } if ((int )os.ldv_38339.pdsk > 3) { if (*((unsigned int *)(& os) + 0UL) != 49152U) { if (*((unsigned int *)(& os) + 0UL) != 40960U) { if ((int )ns.ldv_38339.pdsk <= 3) { goto _L___2; } else if (*((unsigned int *)(& ns) + 0UL) == 49152U) { goto _L___2; } else if (*((unsigned int *)(& ns) + 0UL) == 40960U) { _L___2: { tmp___3 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___3 != 0) { if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U) { goto _L___1; } else if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 4U) { _L___1: if ((mdev->ldev)->md.uuid[1] == 0ULL) { if ((int )ns.ldv_38339.disk > 7) { { tmp___2 = is_susp(mdev->state); } if (tmp___2 != 0) { { set_bit(27U, (unsigned long volatile *)(& mdev->flags)); } } else { { drbd_uuid_new_current(mdev); drbd_send_uuids(mdev); } } } else { } } else { } } else { } { put_ldev(mdev); } } else { } } else { } } else { } } else { } } else { } if ((int )ns.ldv_38339.pdsk <= 3) { { tmp___4 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___4 != 0) { if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 4U) { if ((mdev->ldev)->md.uuid[1] == 0ULL) { { drbd_uuid_new_current(mdev); drbd_send_uuids(mdev); } } else { } } else { } if ((unsigned int )*((unsigned char *)(& os) + 0UL) == 4U) { if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 8U) { { drbd_bitmap_io_from_worker(mdev, & drbd_bm_write, (char *)"demote diskless peer", (enum bm_flag )1); } } else { } } else { } { put_ldev(mdev); } } else { } } else { } if ((unsigned int )*((unsigned char *)(& os) + 0UL) == 1U) { if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 2U) { if ((int )mdev->state.ldv_38339.conn <= 10) { { tmp___5 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___5 != 0) { { drbd_bitmap_io_from_worker(mdev, & drbd_bm_write, (char *)"demote", (enum bm_flag )3); put_ldev(mdev); } } else { } } else { } } else { } } else { } if ((int )ns.ldv_38339.conn > 9) { if ((unsigned int )*((unsigned char *)(& os) + 1UL) == 2U) { if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 6U) { { drbd_send_sizes(mdev, 0, (enum dds_flags )0); drbd_send_uuids(mdev); drbd_send_state(mdev); } } else { } } else { } } else { } if ((int )ns.ldv_38339.conn > 9) { if ((int )os.ldv_38339.aftr_isp != (int )ns.ldv_38339.aftr_isp) { { drbd_send_state(mdev); } } else if ((int )os.ldv_38339.user_isp != (int )ns.ldv_38339.user_isp) { { drbd_send_state(mdev); } } else { } } else { } if ((unsigned int )*((unsigned char *)(& os) + 2UL) == 0U) { if ((unsigned int )*((unsigned char *)(& os) + 2UL) == 0U) { if ((unsigned int )*((unsigned char *)(& os) + 2UL) == 0U) { if ((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { { suspend_other_sg(mdev); } } else if ((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { { suspend_other_sg(mdev); } } else if ((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { { suspend_other_sg(mdev); } } else { } } else { } } else { } } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 144U) { if ((int )ns.ldv_38339.conn > 9) { { drbd_send_state(mdev); } } else { } } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 352U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 352U) { { drbd_send_state(mdev); } } else { } } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 192U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 192U) { { drbd_queue_bitmap_io(mdev, & drbd_bmio_set_n_write, & abw_start_sync, (char *)"set_n_write from StartingSync", (enum bm_flag )3); } } else { goto _L___3; } } else _L___3: if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 176U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 176U) { { drbd_queue_bitmap_io(mdev, & drbd_bmio_set_n_write, & abw_start_sync, (char *)"set_n_write from StartingSync", (enum bm_flag )3); } } else { } } else { } if ((int )os.ldv_38339.conn <= 9) { if ((int )ns.ldv_38339.conn <= 9) { if ((int )os.ldv_38339.disk > 4) { if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 8U) { { drbd_queue_bitmap_io(mdev, & drbd_bmio_set_n_write, (void (*)(struct drbd_conf * , int ))0, (char *)"set_n_write from invalidate", (enum bm_flag )7); } } else { } } else { } } else { } } else { } if ((unsigned int )*((unsigned char *)(& os) + 1UL) != 4U) { if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 4U) { { eh = (enum drbd_io_error_p )(mdev->ldev)->dc.on_io_error; was_io_error = test_and_clear_bit(19, (unsigned long volatile *)(& mdev->flags)); } if ((unsigned int )*((unsigned char *)mdev + 2277UL) != 4U) { { tmp___6 = drbd_disk_str((enum drbd_disk_state )mdev->state.ldv_38339.disk); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: disk is %s during detach\n", tmp___6); } } else { } { tmp___7 = drbd_send_state(mdev); } if (tmp___7 != 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Notified peer that I am detaching my disk\n"); } } else { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Sending state for detaching disk failed\n"); } } { drbd_rs_cancel_all(mdev); drbd_md_sync(mdev); put_ldev(mdev); } if (was_io_error != 0) { if ((unsigned int )eh == 1U) { { drbd_khelper(mdev, (char *)"local-io-error"); } } else { } } else { } } else { } } else { } if ((unsigned int )*((unsigned char *)(& os) + 1UL) != 0U) { if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 0U) { if ((unsigned int )*((unsigned char *)mdev + 2277UL) != 0U) { { tmp___8 = drbd_disk_str((enum drbd_disk_state )mdev->state.ldv_38339.disk); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: disk is %s while going diskless\n", tmp___8); } } else { } { mdev->rs_total = 0UL; mdev->rs_failed = 0UL; atomic_set(& mdev->rs_pending_cnt, 0); tmp___9 = drbd_send_state(mdev); } if (tmp___9 != 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Notified peer that I\'m now diskless.\n"); } } else { } { put_ldev(mdev); } } else { } } else { } if ((unsigned int )*((unsigned char *)(& os) + 1UL) == 16U) { if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 8U) { { drbd_send_state(mdev); } } else { } } else { } if ((int )ns.ldv_38339.disk > 3) { if ((int )ns.ldv_38339.pdsk > 3) { { tmp___10 = test_and_clear_bit(20, (unsigned long volatile *)(& mdev->flags)); } if (tmp___10 != 0) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 160U) { { resync_after_online_grow(mdev); } } else { } } else { } } else { } } else { } if ((int )os.ldv_38339.conn > 10) { if ((int )ns.ldv_38339.conn <= 10) { { resume_next_sg(mdev); } } else { goto _L___5; } } else _L___5: if ((unsigned int )*((unsigned char *)(& os) + 2UL) != 0U) { if ((unsigned int )*((unsigned char *)(& ns) + 2UL) == 0U) { { resume_next_sg(mdev); } } else { goto _L___4; } } else _L___4: if ((unsigned int )*((unsigned char *)(& os) + 2UL) != 0U) { if ((unsigned int )*((unsigned char *)(& ns) + 2UL) == 0U) { { resume_next_sg(mdev); } } else { } } else { } if ((int )os.ldv_38339.disk <= 7) { if ((int )os.ldv_38339.conn > 15) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 160U) { { drbd_send_state(mdev); } } else { } } else { } } else { } if ((int )os.ldv_38339.conn > 10) { if ((int )ns.ldv_38339.conn <= 10) { { tmp___11 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___11 != 0) { { drbd_queue_bitmap_io(mdev, & drbd_bm_write, (void (*)(struct drbd_conf * , int ))0, (char *)"write from resync_finished", (enum bm_flag )1); put_ldev(mdev); } } else { } } else { } } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 0U) { { tmp___12 = is_susp(ns); } if (tmp___12 == 0) { if ((unsigned long )mdev->tl_hash != (unsigned long )((struct hlist_head *)0)) { { drbd_free_tl_hash(mdev); } } else { } } else { } } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 0U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 32U) { { drbd_thread_start(& mdev->receiver); } } else { } } else { } if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 0U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 0U) { if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 2U) { if ((int )os.ldv_38339.aftr_isp != (int )ns.ldv_38339.aftr_isp) { { resume_next_sg(mdev); } } else { } { tmp___13 = constant_test_bit(23U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___13 != 0) { { drbd_thread_stop_nowait(& mdev->worker); } } else { } } else { } } else { } } else { } { drbd_md_sync(mdev); } return; } } static int drbd_thread_setup(void *arg ) { struct drbd_thread *thi ; struct drbd_conf *mdev ; unsigned long flags ; int retval ; raw_spinlock_t *tmp ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; { thi = (struct drbd_thread *)arg; mdev = thi->mdev; restart: { retval = (*(thi->function))(thi); tmp = spinlock_check(& thi->t_lock); flags = _raw_spin_lock_irqsave(tmp); } if ((unsigned int )thi->t_state == 3U) { { tmp___0 = get_current(); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Restarting %s\n", (char *)(& tmp___0->comm)); thi->t_state = (enum drbd_thread_state )1; spin_unlock_irqrestore(& thi->t_lock, flags); } goto restart; } else { } { thi->task = (struct task_struct *)0; thi->t_state = (enum drbd_thread_state )0; __asm__ volatile ("mfence": : : "memory"); complete(& thi->stop); spin_unlock_irqrestore(& thi->t_lock, flags); tmp___1 = get_current(); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Terminating %s\n", (char *)(& tmp___1->comm)); ldv_module_put_1(& __this_module); } return (retval); } } static void drbd_thread_init(struct drbd_conf *mdev , struct drbd_thread *thi , int (*func)(struct drbd_thread * ) ) { struct lock_class_key __key ; { { spinlock_check(& thi->t_lock); __raw_spin_lock_init(& thi->t_lock.ldv_6060.rlock, "&(&thi->t_lock)->rlock", & __key); thi->task = (struct task_struct *)0; thi->t_state = (enum drbd_thread_state )0; thi->function = func; thi->mdev = mdev; } return; } } int drbd_thread_start(struct drbd_thread *thi ) { struct drbd_conf *mdev ; struct task_struct *nt ; unsigned long flags ; char const *me ; char const *tmp ; char const *tmp___0 ; char const *tmp___1 ; raw_spinlock_t *tmp___2 ; struct task_struct *tmp___3 ; struct task_struct *tmp___4 ; int tmp___5 ; struct task_struct *tmp___6 ; unsigned int tmp___7 ; long tmp___8 ; raw_spinlock_t *tmp___9 ; struct task_struct *tmp___10 ; struct task_struct *tmp___11 ; { mdev = thi->mdev; if ((unsigned long )(& mdev->receiver) != (unsigned long )thi) { if ((unsigned long )(& mdev->asender) != (unsigned long )thi) { if ((unsigned long )(& mdev->worker) == (unsigned long )thi) { tmp = "worker"; } else { tmp = "NONSENSE"; } tmp___0 = tmp; } else { tmp___0 = "asender"; } tmp___1 = tmp___0; } else { tmp___1 = "receiver"; } { me = tmp___1; tmp___2 = spinlock_check(& thi->t_lock); flags = _raw_spin_lock_irqsave(tmp___2); } if ((int )((unsigned int )thi->t_state) == 0) { goto case_0; } else if ((int )((unsigned int )thi->t_state) == 2) { goto case_2; } else if ((int )((unsigned int )thi->t_state) == 1) { goto case_1; } else if ((int )((unsigned int )thi->t_state) == 3) { goto case_3; } else { goto switch_default; if (0) { case_0: { tmp___3 = get_current(); tmp___4 = get_current(); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Starting %s thread (from %s [%d])\n", me, (char *)(& tmp___4->comm), tmp___3->pid); tmp___5 = ldv_try_module_get_1(& __this_module); } if (tmp___5 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Failed to get module reference in drbd_thread_start\n"); spin_unlock_irqrestore(& thi->t_lock, flags); } return (0); } else { } { init_completion(& thi->stop); } if ((unsigned long )thi->task != (unsigned long )((struct task_struct *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( thi->task == NULL ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 1718); } } else { } { thi->reset_cpu_mask = 1; thi->t_state = (enum drbd_thread_state )1; spin_unlock_irqrestore(& thi->t_lock, flags); tmp___6 = get_current(); flush_signals(tmp___6); tmp___7 = mdev_to_minor(mdev); nt = kthread_create_on_node(& drbd_thread_setup, (void *)thi, -1, "drbd%d_%s", tmp___7, me); tmp___8 = IS_ERR((void const *)nt); } if (tmp___8 != 0L) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Couldn\'t start thread\n"); ldv_module_put_3(& __this_module); } return (0); } else { } { tmp___9 = spinlock_check(& thi->t_lock); flags = _raw_spin_lock_irqsave(tmp___9); thi->task = nt; thi->t_state = (enum drbd_thread_state )1; spin_unlock_irqrestore(& thi->t_lock, flags); wake_up_process(nt); } goto ldv_49337; case_2: { thi->t_state = (enum drbd_thread_state )3; tmp___10 = get_current(); tmp___11 = get_current(); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Restarting %s thread (from %s [%d])\n", me, (char *)(& tmp___11->comm), tmp___10->pid); } case_1: ; case_3: ; switch_default: { spin_unlock_irqrestore(& thi->t_lock, flags); } goto ldv_49337; } else { } } ldv_49337: ; return (1); } } void _drbd_thread_stop(struct drbd_thread *thi , int restart , int wait ) { unsigned long flags ; enum drbd_thread_state ns ; int tmp ; raw_spinlock_t *tmp___0 ; struct task_struct *tmp___1 ; { if (restart != 0) { tmp = 3; } else { tmp = 2; } { ns = (enum drbd_thread_state )tmp; tmp___0 = spinlock_check(& thi->t_lock); flags = _raw_spin_lock_irqsave(tmp___0); } if ((unsigned int )thi->t_state == 0U) { { spin_unlock_irqrestore(& thi->t_lock, flags); } if (restart != 0) { { drbd_thread_start(thi); } } else { } return; } else { } if ((unsigned int )thi->t_state != (unsigned int )ns) { if ((unsigned long )thi->task == (unsigned long )((struct task_struct *)0)) { { spin_unlock_irqrestore(& thi->t_lock, flags); } return; } else { } { thi->t_state = ns; __asm__ volatile ("mfence": : : "memory"); init_completion(& thi->stop); tmp___1 = get_current(); } if ((unsigned long )thi->task != (unsigned long )tmp___1) { { force_sig(1, thi->task); } } else { } } else { } { spin_unlock_irqrestore(& thi->t_lock, flags); } if (wait != 0) { { wait_for_completion(& thi->stop); } } else { } return; } } void drbd_calc_cpu_mask(struct drbd_conf *mdev ) { int ord ; int cpu ; unsigned int tmp ; unsigned int tmp___0 ; unsigned int tmp___1 ; int tmp___2 ; unsigned int tmp___3 ; { { tmp = cpumask_weight((struct cpumask const *)mdev->cpu_mask); } if (tmp != 0U) { return; } else { } { tmp___0 = mdev_to_minor(mdev); tmp___1 = cpumask_weight((struct cpumask const *)cpu_online_mask); ord = (int )(tmp___0 % tmp___1); cpu = -1; } goto ldv_49358; ldv_49357: tmp___2 = ord; ord = ord - 1; if (tmp___2 == 0) { { cpumask_set_cpu((unsigned int )cpu, mdev->cpu_mask); } return; } else { } ldv_49358: { tmp___3 = cpumask_next(cpu, (struct cpumask const *)cpu_online_mask); cpu = (int )tmp___3; } if (cpu < nr_cpu_ids) { goto ldv_49357; } else { goto ldv_49359; } ldv_49359: { cpumask_setall(mdev->cpu_mask); } return; } } void drbd_thread_current_set_cpu(struct drbd_conf *mdev ) { struct task_struct *p ; struct task_struct *tmp ; struct drbd_thread *thi ; struct drbd_thread *tmp___0 ; struct drbd_thread *tmp___1 ; struct drbd_thread *tmp___2 ; int _b ; { { tmp = get_current(); p = tmp; } if ((unsigned long )mdev->asender.task == (unsigned long )p) { tmp___2 = & mdev->asender; } else { if ((unsigned long )mdev->receiver.task == (unsigned long )p) { tmp___1 = & mdev->receiver; } else { if ((unsigned long )mdev->worker.task == (unsigned long )p) { tmp___0 = & mdev->worker; } else { tmp___0 = (struct drbd_thread *)0; } tmp___1 = tmp___0; } tmp___2 = tmp___1; } thi = tmp___2; _b = (unsigned long )thi == (unsigned long )((struct drbd_thread *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_thread_current_set_cpu", (char *)"thi == NULL", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 1833); } } else { } if (_b != 0) { return; } else { } if (thi->reset_cpu_mask == 0) { return; } else { } { thi->reset_cpu_mask = 0; set_cpus_allowed_ptr(p, (struct cpumask const *)mdev->cpu_mask); } return; } } int _drbd_send_cmd(struct drbd_conf *mdev , struct socket *sock , enum drbd_packets cmd , struct p_header80 *h , size_t size , unsigned int msg_flags ) { int sent ; int ok ; int _b ; int _b___0 ; __u16 tmp ; __u16 tmp___0 ; char const *tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; { _b = (unsigned long )h == (unsigned long )((struct p_header80 *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "_drbd_send_cmd", (char *)"!h", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 1849); } } else { } if (_b != 0) { return (0); } else { } _b___0 = size == 0UL; if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "_drbd_send_cmd", (char *)"!size", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 1850); } } else { } if (_b___0 != 0) { return (0); } else { } { h->magic = 1728214147U; tmp = __fswab16((__u16 )((int )((__u16 )cmd))); h->command = tmp; tmp___0 = __fswab16((__u16 )((int )((unsigned int )((__u16 )size) - 8U))); h->length = tmp___0; sent = drbd_send(mdev, sock, (void *)h, size, msg_flags); ok = (size_t )sent == size; } if (ok == 0) { { tmp___2 = get_current(); tmp___3 = signal_pending(tmp___2); } if (tmp___3 == 0) { { tmp___1 = cmdname(cmd); dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short sent %s size=%d sent=%d\n", tmp___1, (int )size, sent); } } else { } } else { } return (ok); } } int drbd_send_cmd(struct drbd_conf *mdev , int use_data_socket , enum drbd_packets cmd , struct p_header80 *h , size_t size ) { int ok ; struct socket *sock ; long tmp ; { ok = 0; if (use_data_socket != 0) { { mutex_lock_nested(& mdev->data.mutex, 0U); sock = mdev->data.socket; } } else { { mutex_lock_nested(& mdev->meta.mutex, 0U); sock = mdev->meta.socket; } } { tmp = __builtin_expect((long )((unsigned long )sock != (unsigned long )((struct socket *)0)), 1L); } if (tmp != 0L) { { ok = _drbd_send_cmd(mdev, sock, cmd, h, size, 0U); } } else { } if (use_data_socket != 0) { { mutex_unlock(& mdev->data.mutex); } } else { { mutex_unlock(& mdev->meta.mutex); } } return (ok); } } int drbd_send_cmd2(struct drbd_conf *mdev , enum drbd_packets cmd , char *data , size_t size ) { struct p_header80 h ; int ok ; __u16 tmp ; __u16 tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { { h.magic = 1728214147U; tmp = __fswab16((__u16 )((int )((__u16 )cmd))); h.command = tmp; tmp___0 = __fswab16((__u16 )((int )((__u16 )size))); h.length = tmp___0; tmp___1 = drbd_get_data_sock(mdev); } if (tmp___1 == 0) { return (0); } else { } { tmp___2 = drbd_send(mdev, mdev->data.socket, (void *)(& h), 8UL, 0U); ok = tmp___2 == 8; } if (ok != 0) { { tmp___3 = drbd_send(mdev, mdev->data.socket, (void *)data, size, 0U); } if ((size_t )tmp___3 == size) { tmp___4 = 1; } else { tmp___4 = 0; } } else { tmp___4 = 0; } { ok = tmp___4; drbd_put_data_sock(mdev); } return (ok); } } int drbd_send_sync_param(struct drbd_conf *mdev , struct syncer_conf *sc ) { struct p_rs_param_95 *p ; struct socket *sock ; int size ; int rv ; int apv ; size_t tmp ; int tmp___0 ; int tmp___1 ; enum drbd_packets cmd ; int tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; long tmp___8 ; { apv = mdev->agreed_pro_version; if (apv > 87) { if (apv == 88) { { tmp = strlen((char const *)(& mdev->sync_conf.verify_alg)); tmp___1 = (int )((unsigned int )tmp + 13U); } } else { if (apv <= 94) { tmp___0 = 140; } else { tmp___0 = 156; } tmp___1 = tmp___0; } size = tmp___1; } else { size = 12; } { mutex_lock_nested(& mdev->data.mutex, 0U); sock = mdev->data.socket; tmp___8 = __builtin_expect((long )((unsigned long )sock != (unsigned long )((struct socket *)0)), 1L); } if (tmp___8 != 0L) { if (apv > 88) { tmp___2 = 35; } else { tmp___2 = 10; } { cmd = (enum drbd_packets )tmp___2; p = & mdev->data.sbuf.rs_param_95; memset((void *)(& p->verify_alg), 0, 128UL); tmp___3 = __fswab32((__u32 )sc->rate); p->rate = tmp___3; tmp___4 = __fswab32((__u32 )sc->c_plan_ahead); p->c_plan_ahead = tmp___4; tmp___5 = __fswab32((__u32 )sc->c_delay_target); p->c_delay_target = tmp___5; tmp___6 = __fswab32((__u32 )sc->c_fill_target); p->c_fill_target = tmp___6; tmp___7 = __fswab32((__u32 )sc->c_max_rate); p->c_max_rate = tmp___7; } if (apv > 87) { { strcpy((char *)(& p->verify_alg), (char const *)(& mdev->sync_conf.verify_alg)); } } else { } if (apv > 88) { { strcpy((char *)(& p->csums_alg), (char const *)(& mdev->sync_conf.csums_alg)); } } else { } { rv = _drbd_send_cmd(mdev, sock, cmd, & p->head, (size_t )size, 0U); } } else { rv = 0; } { mutex_unlock(& mdev->data.mutex); } return (rv); } } int drbd_send_protocol(struct drbd_conf *mdev ) { struct p_protocol *p ; int size ; int cf ; int rv ; size_t tmp ; void *tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; __u32 tmp___6 ; { size = 32; if (mdev->agreed_pro_version > 86) { { tmp = strlen((char const *)(& (mdev->net_conf)->integrity_alg)); size = (int )(((unsigned int )tmp + (unsigned int )size) + 1U); } } else { } { tmp___0 = kmalloc((size_t )size, 16U); p = (struct p_protocol *)tmp___0; } if ((unsigned long )p == (unsigned long )((struct p_protocol *)0)) { return (0); } else { } { tmp___1 = __fswab32((__u32 )(mdev->net_conf)->wire_protocol); p->protocol = tmp___1; tmp___2 = __fswab32((__u32 )(mdev->net_conf)->after_sb_0p); p->after_sb_0p = tmp___2; tmp___3 = __fswab32((__u32 )(mdev->net_conf)->after_sb_1p); p->after_sb_1p = tmp___3; tmp___4 = __fswab32((__u32 )(mdev->net_conf)->after_sb_2p); p->after_sb_2p = tmp___4; tmp___5 = __fswab32((__u32 )(mdev->net_conf)->two_primaries); p->two_primaries = tmp___5; cf = 0; } if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) != 0U) { cf = cf | 1; } else { } if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) != 0U) { if (mdev->agreed_pro_version > 91) { cf = cf | 2; } else { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "--dry-run is not supported by peer"); kfree((void const *)p); } return (-1); } } else { } { tmp___6 = __fswab32((__u32 )cf); p->conn_flags = tmp___6; } if (mdev->agreed_pro_version > 86) { { strcpy((char *)(& p->integrity_alg), (char const *)(& (mdev->net_conf)->integrity_alg)); } } else { } { rv = drbd_send_cmd(mdev, 1, (enum drbd_packets )11, (struct p_header80 *)p, (size_t )size); kfree((void const *)p); } return (rv); } } int _drbd_send_uuids(struct drbd_conf *mdev , u64 uuid_flags ) { struct p_uuids p ; int i ; int tmp ; __u64 tmp___0 ; __u64 tmp___1 ; unsigned long long tmp___2 ; unsigned long long tmp___4 ; int tmp___5 ; unsigned long long tmp___6 ; __u64 tmp___7 ; int tmp___8 ; { { tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )3); } if (tmp == 0) { return (1); } else { } i = 0; goto ldv_49424; ldv_49423: ; if ((unsigned long )mdev->ldev != (unsigned long )((struct drbd_backing_dev *)0)) { { tmp___0 = __fswab64((mdev->ldev)->md.uuid[i]); p.uuid[i] = tmp___0; } } else { p.uuid[i] = 0ULL; } i = i + 1; ldv_49424: ; if (i <= 3) { goto ldv_49423; } else { goto ldv_49425; } ldv_49425: { mdev->comm_bm_set = drbd_bm_total_weight(mdev); tmp___1 = __fswab64((__u64 )mdev->comm_bm_set); p.uuid[4] = tmp___1; } if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) != 0U) { tmp___2 = 1ULL; } else { tmp___2 = 0ULL; } { uuid_flags = tmp___2 | uuid_flags; tmp___5 = constant_test_bit(11U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___5 != 0) { tmp___4 = 2ULL; } else { tmp___4 = 0ULL; } uuid_flags = tmp___4 | uuid_flags; if ((unsigned int )*((unsigned char *)mdev + 2273UL) == 8U) { tmp___6 = 4ULL; } else { tmp___6 = 0ULL; } { uuid_flags = tmp___6 | uuid_flags; tmp___7 = __fswab64(uuid_flags); p.uuid[5] = tmp___7; put_ldev(mdev); tmp___8 = drbd_send_cmd(mdev, 1, (enum drbd_packets )12, (struct p_header80 *)(& p), 56UL); } return (tmp___8); } } int drbd_send_uuids(struct drbd_conf *mdev ) { int tmp ; { { tmp = _drbd_send_uuids(mdev, 0ULL); } return (tmp); } } int drbd_send_uuids_skip_initial_sync(struct drbd_conf *mdev ) { int tmp ; { { tmp = _drbd_send_uuids(mdev, 8ULL); } return (tmp); } } void drbd_print_uuids(struct drbd_conf *mdev , char const *text ) { u64 *uuid ; int tmp ; { { tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )3); } if (tmp != 0) { { uuid = (u64 *)(& (mdev->ldev)->md.uuid); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s %016llX:%016llX:%016llX:%016llX\n", text, *uuid, *(uuid + 1UL), *(uuid + 2UL), *(uuid + 3UL)); put_ldev(mdev); } } else { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s effective data uuid: %016llX\n", text, mdev->ed_uuid); } } return; } } int drbd_gen_and_send_sync_uuid(struct drbd_conf *mdev ) { struct p_rs_uuid p ; u64 uuid ; __u64 tmp ; int tmp___0 ; { if ((unsigned int )*((unsigned char *)mdev + 2277UL) != 16U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.disk == D_UP_TO_DATE ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 2066); } } else { } { uuid = (mdev->ldev)->md.uuid[1] + 281474976710656ULL; drbd_uuid_set(mdev, 1, uuid); drbd_print_uuids(mdev, "updated sync UUID"); drbd_md_sync(mdev); tmp = __fswab64(uuid); p.uuid = tmp; tmp___0 = drbd_send_cmd(mdev, 1, (enum drbd_packets )15, (struct p_header80 *)(& p), 16UL); } return (tmp___0); } } int drbd_send_sizes(struct drbd_conf *mdev , int trigger_reply , enum dds_flags flags ) { struct p_sizes p ; sector_t d_size ; sector_t u_size ; int q_order_type ; int max_bio_size ; int ok ; unsigned int tmp ; int __min1 ; int __min2 ; int tmp___0 ; int tmp___1 ; __u64 tmp___2 ; __u64 tmp___3 ; sector_t tmp___4 ; __u64 tmp___5 ; __u64 tmp___6 ; __u32 tmp___7 ; __u16 tmp___8 ; __u16 tmp___9 ; { { tmp___1 = _get_ldev_if_state(mdev, (enum drbd_disk_state )3); } if (tmp___1 != 0) { if ((unsigned long )(mdev->ldev)->backing_bdev == (unsigned long )((struct block_device *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->ldev->backing_bdev ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 2086); } } else { } { d_size = drbd_get_max_capacity___0(mdev->ldev); u_size = (sector_t )(mdev->ldev)->dc.disk_size; q_order_type = drbd_queue_order_type(mdev); tmp = queue_max_hw_sectors((((mdev->ldev)->backing_bdev)->bd_disk)->queue); max_bio_size = (int )(tmp << 9); __min1 = max_bio_size; __min2 = 131072; } if (__min1 < __min2) { tmp___0 = __min1; } else { tmp___0 = __min2; } { max_bio_size = tmp___0; put_ldev(mdev); } } else { d_size = 0UL; u_size = 0UL; q_order_type = 0; max_bio_size = 131072; } { tmp___2 = __fswab64((__u64 )d_size); p.d_size = tmp___2; tmp___3 = __fswab64((__u64 )u_size); p.u_size = tmp___3; } if (trigger_reply == 0) { { tmp___4 = drbd_get_capacity(mdev->this_bdev); tmp___5 = (__u64 )tmp___4; } } else { tmp___5 = 0ULL; } { tmp___6 = __fswab64(tmp___5); p.c_size = tmp___6; tmp___7 = __fswab32((__u32 )max_bio_size); p.max_bio_size = tmp___7; tmp___8 = __fswab16((__u16 )((int )((__u16 )q_order_type))); p.queue_order_type = tmp___8; tmp___9 = __fswab16((__u16 )((int )((__u16 )flags))); p.dds_flags = tmp___9; ok = drbd_send_cmd(mdev, 1, (enum drbd_packets )13, (struct p_header80 *)(& p), 40UL); } return (ok); } } int drbd_send_state(struct drbd_conf *mdev ) { struct socket *sock ; struct p_state p ; int ok ; __u32 tmp ; long tmp___0 ; { { ok = 0; drbd_state_lock___0(mdev); mutex_lock_nested(& mdev->data.mutex, 0U); tmp = __fswab32(mdev->state.i); p.state = tmp; sock = mdev->data.socket; tmp___0 = __builtin_expect((long )((unsigned long )sock != (unsigned long )((struct socket *)0)), 1L); } if (tmp___0 != 0L) { { ok = _drbd_send_cmd(mdev, sock, (enum drbd_packets )14, (struct p_header80 *)(& p), 12UL, 0U); } } else { } { mutex_unlock(& mdev->data.mutex); drbd_state_unlock(mdev); } return (ok); } } int drbd_send_state_req(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val ) { struct p_req_state p ; __u32 tmp ; __u32 tmp___0 ; int tmp___1 ; { { tmp = __fswab32(mask.i); p.mask = tmp; tmp___0 = __fswab32(val.i); p.val = tmp___0; tmp___1 = drbd_send_cmd(mdev, 1, (enum drbd_packets )18, (struct p_header80 *)(& p), 16UL); } return (tmp___1); } } int drbd_send_sr_reply(struct drbd_conf *mdev , enum drbd_state_rv retcode ) { struct p_req_state_reply p ; __u32 tmp ; int tmp___0 ; { { tmp = __fswab32((__u32 )retcode); p.retcode = tmp; tmp___0 = drbd_send_cmd(mdev, 0, (enum drbd_packets )29, (struct p_header80 *)(& p), 12UL); } return (tmp___0); } } int fill_bitmap_rle_bits(struct drbd_conf *mdev , struct p_compressed_bm *p , struct bm_xfer_ctx *c ) { struct bitstream bs ; unsigned long plain_bits ; unsigned long tmp ; unsigned long rl ; unsigned int len ; unsigned int toggle ; int bits ; unsigned long tmp___0 ; unsigned long tmp___1 ; { if ((unsigned int )*((unsigned char *)mdev + 200UL) == 0U) { return (0); } else if (mdev->agreed_pro_version <= 89) { return (0); } else { } if (c->bit_offset >= c->bm_bits) { return (0); } else { } { bitstream_init(& bs, (void *)(& p->code), 4087UL, 0U); memset((void *)(& p->code), 0, 4087UL); plain_bits = 0UL; toggle = 2U; } ldv_49487: ; if (toggle == 0U) { { tmp___0 = _drbd_bm_find_next_zero(mdev, c->bit_offset); tmp = tmp___0; } } else { { tmp___1 = _drbd_bm_find_next(mdev, c->bit_offset); tmp = tmp___1; } } if (tmp == 0x0fffffffffffffffUL) { tmp = c->bm_bits; } else { } rl = tmp - c->bit_offset; if (toggle == 2U) { if (rl == 0UL) { { DCBP_set_start(p, 1); toggle = (unsigned int )(toggle == 0U); } goto ldv_49485; } else { } { DCBP_set_start(p, 0); } } else { } if (rl == 0UL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "unexpected zero runlength while encoding bitmap t:%u bo:%lu\n", toggle, c->bit_offset); } return (-1); } else { } { bits = vli_encode_bits(& bs, (u64 )rl); } if (bits == -105) { goto ldv_49486; } else { } if (bits <= 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "error while encoding bitmap: %d\n", bits); } return (0); } else { } toggle = (unsigned int )(toggle == 0U); plain_bits = plain_bits + rl; c->bit_offset = tmp; ldv_49485: ; if (c->bit_offset < c->bm_bits) { goto ldv_49487; } else { goto ldv_49486; } ldv_49486: len = ((unsigned int )((long )bs.cur.b) - (unsigned int )((long )(& p->code))) + (unsigned int )(bs.cur.bit != 0U); if ((unsigned long )(len << 3) > plain_bits) { { c->bit_offset = c->bit_offset - plain_bits; bm_xfer_ctx_bit_to_word_offset(c); c->bit_offset = c->word_offset * 64UL; } return (0); } else { } { bm_xfer_ctx_bit_to_word_offset(c); DCBP_set_pad_bits(p, (int )(- bs.cur.bit) & 7); } return ((int )len); } } static int send_bitmap_rle_or_plain(struct drbd_conf *mdev , struct p_header80 *h , struct bm_xfer_ctx *c ) { struct p_compressed_bm *p ; unsigned long num_words ; int len ; int ok ; size_t __min1 ; size_t __min2 ; size_t tmp ; { { p = (struct p_compressed_bm *)h; len = fill_bitmap_rle_bits(mdev, p, c); } if (len < 0) { return (-5); } else { } if (len != 0) { { DCBP_set_code(p, (enum drbd_bitmap_code )2); ok = _drbd_send_cmd(mdev, mdev->data.socket, (enum drbd_packets )36, h, (unsigned long )len + 9UL, 0U); c->packets[0] = c->packets[0] + 1U; c->bytes[0] = (c->bytes[0] + (unsigned int )len) + 9U; } if (c->bit_offset >= c->bm_bits) { len = 0; } else { } } else { __min1 = 511UL; __min2 = c->bm_words - c->word_offset; if (__min1 < __min2) { tmp = __min1; } else { tmp = __min2; } num_words = tmp; len = (int )((unsigned int )num_words * 8U); if (len != 0) { { drbd_bm_get_lel(mdev, c->word_offset, num_words, (unsigned long *)(& h->payload)); } } else { } { ok = _drbd_send_cmd(mdev, mdev->data.socket, (enum drbd_packets )4, h, (unsigned long )len + 8UL, 0U); c->word_offset = c->word_offset + num_words; c->bit_offset = c->word_offset * 64UL; c->packets[1] = c->packets[1] + 1U; c->bytes[1] = (c->bytes[1] + (unsigned int )len) + 8U; } if (c->bit_offset > c->bm_bits) { c->bit_offset = c->bm_bits; } else { } } if (ok != 0) { if (len == 0) { { INFO_bm_xfer_stats(mdev, "send", c); } return (0); } else { return (1); } } else { } return (-5); } } int _drbd_send_bitmap(struct drbd_conf *mdev ) { struct bm_xfer_ctx c ; struct p_header80 *p ; int err ; int _b ; unsigned long tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; struct bm_xfer_ctx __constr_expr_0 ; unsigned long tmp___3 ; size_t tmp___4 ; { _b = (unsigned long )mdev->bitmap == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "_drbd_send_bitmap", (char *)"!mdev->bitmap", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 2323); } } else { } if (_b != 0) { return (0); } else { } { tmp = __get_free_pages(16U, 0U); p = (struct p_header80 *)tmp; } if ((unsigned long )p == (unsigned long )((struct p_header80 *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "failed to allocate one page buffer in %s\n", "_drbd_send_bitmap"); } return (0); } else { } { tmp___2 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___2 != 0) { { tmp___1 = drbd_md_test_flag(mdev->ldev, 8); } if (tmp___1 != 0) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Writing the whole bitmap, MDF_FullSync was set.\n"); drbd_bm_set_all(mdev); tmp___0 = drbd_bm_write(mdev); } if (tmp___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Failed to write bitmap to disk!\n"); } } else { { drbd_md_clear_flag(mdev, 8); drbd_md_sync(mdev); } } } else { } { put_ldev(mdev); } } else { } { tmp___3 = drbd_bm_bits(mdev); tmp___4 = drbd_bm_words(mdev); __constr_expr_0.bm_bits = tmp___3; __constr_expr_0.bm_words = tmp___4; __constr_expr_0.bit_offset = 0UL; __constr_expr_0.word_offset = 0UL; __constr_expr_0.packets[0] = 0U; __constr_expr_0.packets[1] = 0U; __constr_expr_0.bytes[0] = 0U; __constr_expr_0.bytes[1] = 0U; c = __constr_expr_0; } ldv_49510: { err = send_bitmap_rle_or_plain(mdev, p, & c); } if (err > 0) { goto ldv_49510; } else { goto ldv_49511; } ldv_49511: { free_pages((unsigned long )p, 0U); } return (err == 0); } } int drbd_send_bitmap(struct drbd_conf *mdev ) { int err ; int tmp ; int tmp___0 ; { { tmp = drbd_get_data_sock(mdev); } if (tmp == 0) { return (-1); } else { } { tmp___0 = _drbd_send_bitmap(mdev); err = tmp___0 == 0; drbd_put_data_sock(mdev); } return (err); } } int drbd_send_b_ack(struct drbd_conf *mdev , u32 barrier_nr , u32 set_size ) { int ok ; struct p_barrier_ack p ; __u32 tmp ; { { p.barrier = barrier_nr; tmp = __fswab32(set_size); p.set_size = tmp; } if ((int )mdev->state.ldv_38339.conn <= 9) { return (0); } else { } { ok = drbd_send_cmd(mdev, 0, (enum drbd_packets )28, (struct p_header80 *)(& p), 16UL); } return (ok); } } static int _drbd_send_ack(struct drbd_conf *mdev , enum drbd_packets cmd , u64 sector , u32 blksize , u64 block_id ) { int ok ; struct p_block_ack p ; int tmp ; __u32 tmp___0 ; { { p.sector = sector; p.block_id = block_id; p.blksize = blksize; tmp = atomic_add_return(1, & mdev->packet_seq); tmp___0 = __fswab32((__u32 )tmp); p.seq_num = tmp___0; } if ((unsigned long )mdev->meta.socket == (unsigned long )((struct socket *)0)) { return (0); } else if ((int )mdev->state.ldv_38339.conn <= 9) { return (0); } else { } { ok = drbd_send_cmd(mdev, 0, cmd, (struct p_header80 *)(& p), 32UL); } return (ok); } } int drbd_send_ack_dp(struct drbd_conf *mdev , enum drbd_packets cmd , struct p_data *dp , int data_size ) { unsigned int tmp ; unsigned int tmp___0 ; __u32 tmp___1 ; int tmp___2 ; { if (mdev->agreed_pro_version > 86) { if ((unsigned long )mdev->integrity_r_tfm != (unsigned long )((struct crypto_hash *)0)) { { tmp = crypto_hash_digestsize(mdev->integrity_r_tfm); tmp___0 = tmp; } } else { tmp___0 = 0U; } } else { tmp___0 = 0U; } { data_size = (int )((unsigned int )data_size - tmp___0); tmp___1 = __fswab32((__u32 )data_size); tmp___2 = _drbd_send_ack(mdev, cmd, dp->sector, tmp___1, dp->block_id); } return (tmp___2); } } int drbd_send_ack_rp(struct drbd_conf *mdev , enum drbd_packets cmd , struct p_block_req *rp ) { int tmp ; { { tmp = _drbd_send_ack(mdev, cmd, rp->sector, rp->blksize, rp->block_id); } return (tmp); } } int drbd_send_ack(struct drbd_conf *mdev , enum drbd_packets cmd , struct drbd_epoch_entry *e ) { __u32 tmp ; __u64 tmp___0 ; int tmp___1 ; { { tmp = __fswab32(e->size); tmp___0 = __fswab64((__u64 )e->sector); tmp___1 = _drbd_send_ack(mdev, cmd, tmp___0, tmp, e->ldv_46600.block_id); } return (tmp___1); } } int drbd_send_ack_ex(struct drbd_conf *mdev , enum drbd_packets cmd , sector_t sector , int blksize , u64 block_id ) { __u64 tmp ; __u32 tmp___0 ; __u64 tmp___1 ; int tmp___2 ; { { tmp = __fswab64(block_id); tmp___0 = __fswab32((__u32 )blksize); tmp___1 = __fswab64((__u64 )sector); tmp___2 = _drbd_send_ack(mdev, cmd, tmp___1, tmp___0, tmp); } return (tmp___2); } } int drbd_send_drequest(struct drbd_conf *mdev , int cmd , sector_t sector , int size , u64 block_id ) { int ok ; struct p_block_req p ; __u64 tmp ; __u32 tmp___0 ; { { tmp = __fswab64((__u64 )sector); p.sector = tmp; p.block_id = block_id; tmp___0 = __fswab32((__u32 )size); p.blksize = tmp___0; ok = drbd_send_cmd(mdev, 1, (enum drbd_packets )cmd, (struct p_header80 *)(& p), 32UL); } return (ok); } } int drbd_send_drequest_csum(struct drbd_conf *mdev , sector_t sector , int size , void *digest , int digest_size , enum drbd_packets cmd ) { int ok ; struct p_block_req p ; __u64 tmp ; __u32 tmp___0 ; __u16 tmp___1 ; __u16 tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { { tmp = __fswab64((__u64 )sector); p.sector = tmp; p.block_id = 1728263026ULL; tmp___0 = __fswab32((__u32 )size); p.blksize = tmp___0; p.head.magic = 1728214147U; tmp___1 = __fswab16((__u16 )((int )((__u16 )cmd))); p.head.command = tmp___1; tmp___2 = __fswab16((__u16 )((int )((unsigned int )((__u16 )digest_size) + 24U))); p.head.length = tmp___2; mutex_lock_nested(& mdev->data.mutex, 0U); tmp___3 = drbd_send(mdev, mdev->data.socket, (void *)(& p), 32UL, 0U); ok = tmp___3 == 32; } if (ok != 0) { { tmp___4 = drbd_send(mdev, mdev->data.socket, digest, (size_t )digest_size, 0U); } if (tmp___4 == digest_size) { tmp___5 = 1; } else { tmp___5 = 0; } } else { tmp___5 = 0; } { ok = tmp___5; mutex_unlock(& mdev->data.mutex); } return (ok); } } int drbd_send_ov_request(struct drbd_conf *mdev , sector_t sector , int size ) { int ok ; struct p_block_req p ; __u64 tmp ; __u32 tmp___0 ; { { tmp = __fswab64((__u64 )sector); p.sector = tmp; p.block_id = 1728261953ULL; tmp___0 = __fswab32((__u32 )size); p.blksize = tmp___0; ok = drbd_send_cmd(mdev, 1, (enum drbd_packets )30, (struct p_header80 *)(& p), 32UL); } return (ok); } } static int we_should_drop_the_connection(struct drbd_conf *mdev , struct socket *sock ) { int drop_it ; enum drbd_thread_state tmp ; int tmp___0 ; struct task_struct *tmp___1 ; struct task_struct *tmp___2 ; { if ((unsigned long )mdev->meta.socket == (unsigned long )sock) { tmp___0 = 1; } else if ((unsigned long )mdev->asender.task == (unsigned long )((struct task_struct *)0)) { tmp___0 = 1; } else { { tmp = get_t_state(& mdev->asender); } if ((unsigned int )tmp != 1U) { tmp___0 = 1; } else if ((int )mdev->state.ldv_38339.conn <= 9) { tmp___0 = 1; } else { tmp___0 = 0; } } drop_it = tmp___0; if (drop_it != 0) { return (1); } else { } mdev->ko_count = mdev->ko_count - 1U; drop_it = mdev->ko_count == 0U; if (drop_it == 0) { { tmp___1 = get_current(); tmp___2 = get_current(); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "[%s/%d] sock_sendmsg time expired, ko = %u\n", (char *)(& tmp___2->comm), tmp___1->pid, mdev->ko_count); request_ping(mdev); } } else { } return (drop_it); } } static int _drbd_no_send_page(struct drbd_conf *mdev , struct page *page , int offset , size_t size , unsigned int msg_flags ) { int sent ; void *tmp ; int tmp___0 ; { { tmp = kmap(page); tmp___0 = drbd_send(mdev, mdev->data.socket, tmp + (unsigned long )offset, size, msg_flags); sent = tmp___0; kunmap(page); } if ((size_t )sent == size) { mdev->send_cnt = mdev->send_cnt + (unsigned int )(size >> 9); } else { } return ((size_t )sent == size); } } static int _drbd_send_page(struct drbd_conf *mdev , struct page *page , int offset , size_t size , unsigned int msg_flags ) { mm_segment_t oldfs ; struct thread_info *tmp ; int sent ; int ok ; int len ; int tmp___0 ; int tmp___1 ; int tmp___2 ; struct thread_info *tmp___3 ; mm_segment_t __constr_expr_0 ; ssize_t tmp___4 ; int tmp___5 ; struct thread_info *tmp___6 ; long tmp___7 ; { { tmp = current_thread_info(); oldfs = tmp->addr_limit; len = (int )size; } if (disable_sendpage != 0) { { tmp___0 = _drbd_no_send_page(mdev, page, offset, size, msg_flags); } return (tmp___0); } else { { tmp___1 = page_count(page); } if (tmp___1 <= 0) { { tmp___0 = _drbd_no_send_page(mdev, page, offset, size, msg_flags); } return (tmp___0); } else { { tmp___2 = PageSlab(page); } if (tmp___2 != 0) { { tmp___0 = _drbd_no_send_page(mdev, page, offset, size, msg_flags); } return (tmp___0); } else { } } } { msg_flags = msg_flags | 16384U; drbd_update_congested(mdev); tmp___3 = current_thread_info(); __constr_expr_0.seg = 0x0fffffffffffffffUL; tmp___3->addr_limit = __constr_expr_0; } ldv_49609: { tmp___4 = (*(((mdev->data.socket)->ops)->sendpage))(mdev->data.socket, page, offset, (size_t )len, (int )msg_flags); sent = (int )tmp___4; } if (sent == -11) { { tmp___5 = we_should_drop_the_connection(mdev, mdev->data.socket); } if (tmp___5 != 0) { goto ldv_49606; } else { goto ldv_49607; } } else { } if (sent <= 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: size=%d len=%d sent=%d\n", "_drbd_send_page", (int )size, len, sent); } goto ldv_49606; } else { } len = len - sent; offset = offset + sent; ldv_49607: ; if (len > 0) { goto ldv_49609; } else { goto ldv_49606; } ldv_49606: { tmp___6 = current_thread_info(); tmp___6->addr_limit = oldfs; clear_bit(21, (unsigned long volatile *)(& mdev->flags)); ok = len == 0; tmp___7 = __builtin_expect((long )(ok != 0), 1L); } if (tmp___7 != 0L) { mdev->send_cnt = mdev->send_cnt + (unsigned int )(size >> 9); } else { } return (ok); } } static int _drbd_send_bio(struct drbd_conf *mdev , struct bio *bio ) { struct bio_vec *bvec ; int i ; unsigned int tmp ; int tmp___0 ; { bvec = bio->bi_io_vec; i = 0; goto ldv_49617; ldv_49616: ; if ((int )bio->bi_vcnt + -1 == i) { tmp = 0U; } else { tmp = 32768U; } { tmp___0 = _drbd_no_send_page(mdev, bvec->bv_page, (int )bvec->bv_offset, (size_t )bvec->bv_len, tmp); } if (tmp___0 == 0) { return (0); } else { } bvec = bvec + 1; i = i + 1; ldv_49617: ; if ((int )bio->bi_vcnt > i) { goto ldv_49616; } else { goto ldv_49618; } ldv_49618: ; return (1); } } static int _drbd_send_zc_bio(struct drbd_conf *mdev , struct bio *bio ) { struct bio_vec *bvec ; int i ; unsigned int tmp ; int tmp___0 ; { bvec = bio->bi_io_vec; i = 0; goto ldv_49626; ldv_49625: ; if ((int )bio->bi_vcnt + -1 == i) { tmp = 0U; } else { tmp = 32768U; } { tmp___0 = _drbd_send_page(mdev, bvec->bv_page, (int )bvec->bv_offset, (size_t )bvec->bv_len, tmp); } if (tmp___0 == 0) { return (0); } else { } bvec = bvec + 1; i = i + 1; ldv_49626: ; if ((int )bio->bi_vcnt > i) { goto ldv_49625; } else { goto ldv_49627; } ldv_49627: ; return (1); } } static int _drbd_send_zc_ee(struct drbd_conf *mdev , struct drbd_epoch_entry *e ) { struct page *page ; unsigned int len ; unsigned int l ; unsigned int __min1 ; unsigned int __min2 ; unsigned int tmp ; unsigned int tmp___1 ; struct page *tmp___2 ; int tmp___3 ; struct page *tmp___4 ; { page = e->pages; len = e->size; goto ldv_49640; ldv_49639: __min1 = len; __min2 = 4096U; if (__min1 < __min2) { tmp = __min1; } else { tmp = __min2; } { l = tmp; tmp___2 = page_chain_next(page); } if ((unsigned long )tmp___2 != (unsigned long )((struct page *)0)) { tmp___1 = 32768U; } else { tmp___1 = 0U; } { tmp___3 = _drbd_send_page(mdev, page, 0, (size_t )l, tmp___1); } if (tmp___3 == 0) { return (0); } else { } { len = len - l; page = page_chain_next(page); } ldv_49640: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { { tmp___4 = page_chain_next(page); __builtin_prefetch((void const *)tmp___4); } goto ldv_49639; } else { goto ldv_49641; } ldv_49641: ; return (1); } } static u32 bio_flags_to_wire(struct drbd_conf *mdev , unsigned long bi_rw ) { int tmp ; int tmp___0 ; int tmp___1 ; unsigned int tmp___2 ; { if (mdev->agreed_pro_version > 94) { if ((bi_rw & 16UL) != 0UL) { tmp = 2; } else { tmp = 0; } if ((bi_rw & 4096UL) != 0UL) { tmp___0 = 16; } else { tmp___0 = 0; } if ((bi_rw & 8388608UL) != 0UL) { tmp___1 = 32; } else { tmp___1 = 0; } return ((u32 )(((tmp | tmp___0) | tmp___1) | ((int )bi_rw & 64))); } else { if ((bi_rw & 16UL) != 0UL) { tmp___2 = 2U; } else { tmp___2 = 0U; } return (tmp___2); } } } int drbd_send_dblock(struct drbd_conf *mdev , struct drbd_request *req ) { int ok ; struct p_data p ; unsigned int dp_flags ; void *dgb ; int dgs ; int tmp ; unsigned int tmp___0 ; __u16 tmp___1 ; __u32 tmp___2 ; __u64 tmp___3 ; int tmp___4 ; __u32 tmp___5 ; __u32 tmp___6 ; unsigned int tmp___7 ; int tmp___8 ; int tmp___9 ; unsigned char digest[64U] ; int tmp___10 ; { { ok = 1; dp_flags = 0U; tmp = drbd_get_data_sock(mdev); } if (tmp == 0) { return (0); } else { } if (mdev->agreed_pro_version > 86) { if ((unsigned long )mdev->integrity_w_tfm != (unsigned long )((struct crypto_hash *)0)) { { tmp___0 = crypto_hash_digestsize(mdev->integrity_w_tfm); dgs = (int )tmp___0; } } else { dgs = 0; } } else { dgs = 0; } if (req->size <= 32768U) { { p.head.h80.magic = 1728214147U; p.head.h80.command = (u16 )0U; tmp___1 = __fswab16((__u16 )((int )((unsigned int )((int )((__u16 )dgs) + (int )((__u16 )req->size)) + 24U))); p.head.h80.length = tmp___1; } } else { { p.head.h95.magic = (u16 )23171U; p.head.h95.command = (u16 )0U; tmp___2 = __fswab32((req->size + (__u32 )dgs) + 24U); p.head.h95.length = tmp___2; } } { tmp___3 = __fswab64((__u64 )req->sector); p.sector = tmp___3; p.block_id = (u64 )req; tmp___4 = atomic_add_return(1, & mdev->packet_seq); req->seq_num = tmp___4; tmp___5 = __fswab32((__u32 )tmp___4); p.seq_num = tmp___5; dp_flags = bio_flags_to_wire(mdev, (req->master_bio)->bi_rw); } if ((int )mdev->state.ldv_38339.conn > 15) { if ((int )mdev->state.ldv_38339.conn <= 21) { dp_flags = dp_flags | 4U; } else { } } else { } { tmp___6 = __fswab32(dp_flags); p.dp_flags = tmp___6; set_bit(4U, (unsigned long volatile *)(& mdev->flags)); } if (dgs != 0) { tmp___7 = 32768U; } else { tmp___7 = 0U; } { tmp___8 = drbd_send(mdev, mdev->data.socket, (void *)(& p), 32UL, tmp___7); ok = tmp___8 == 32; } if (ok != 0) { if (dgs != 0) { { dgb = mdev->int_dig_out; drbd_csum_bio(mdev, mdev->integrity_w_tfm, req->master_bio, dgb); tmp___9 = drbd_send(mdev, mdev->data.socket, dgb, (size_t )dgs, 0U); ok = tmp___9 == dgs; } } else { } } else { } if (ok != 0) { if ((mdev->net_conf)->wire_protocol == 1) { { ok = _drbd_send_bio(mdev, req->master_bio); } } else if (dgs != 0) { { ok = _drbd_send_bio(mdev, req->master_bio); } } else { { ok = _drbd_send_zc_bio(mdev, req->master_bio); } } if (dgs > 0) { if (dgs <= 64) { { drbd_csum_bio(mdev, mdev->integrity_w_tfm, req->master_bio, (void *)(& digest)); tmp___10 = memcmp((void const *)mdev->int_dig_out, (void const *)(& digest), (size_t )dgs); } if (tmp___10 != 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Digest mismatch, buffer modified by upper layers during write: %llus +%u\n", (unsigned long long )req->sector, req->size); } } else { } } else { } } else { } } else { } { drbd_put_data_sock(mdev); } return (ok); } } int drbd_send_block(struct drbd_conf *mdev , enum drbd_packets cmd , struct drbd_epoch_entry *e ) { int ok ; struct p_data p ; void *dgb ; int dgs ; unsigned int tmp ; __u16 tmp___0 ; __u16 tmp___1 ; __u16 tmp___2 ; __u32 tmp___3 ; __u64 tmp___4 ; int tmp___5 ; unsigned int tmp___6 ; int tmp___7 ; int tmp___8 ; { if (mdev->agreed_pro_version > 86) { if ((unsigned long )mdev->integrity_w_tfm != (unsigned long )((struct crypto_hash *)0)) { { tmp = crypto_hash_digestsize(mdev->integrity_w_tfm); dgs = (int )tmp; } } else { dgs = 0; } } else { dgs = 0; } if (e->size <= 32768U) { { p.head.h80.magic = 1728214147U; tmp___0 = __fswab16((__u16 )((int )((__u16 )cmd))); p.head.h80.command = tmp___0; tmp___1 = __fswab16((__u16 )((int )((unsigned int )((int )((__u16 )dgs) + (int )((__u16 )e->size)) + 24U))); p.head.h80.length = tmp___1; } } else { { p.head.h95.magic = (u16 )23171U; tmp___2 = __fswab16((__u16 )((int )((__u16 )cmd))); p.head.h95.command = tmp___2; tmp___3 = __fswab32((e->size + (__u32 )dgs) + 24U); p.head.h95.length = tmp___3; } } { tmp___4 = __fswab64((__u64 )e->sector); p.sector = tmp___4; p.block_id = e->ldv_46600.block_id; tmp___5 = drbd_get_data_sock(mdev); } if (tmp___5 == 0) { return (0); } else { } if (dgs != 0) { tmp___6 = 32768U; } else { tmp___6 = 0U; } { tmp___7 = drbd_send(mdev, mdev->data.socket, (void *)(& p), 32UL, tmp___6); ok = tmp___7 == 32; } if (ok != 0) { if (dgs != 0) { { dgb = mdev->int_dig_out; drbd_csum_ee(mdev, mdev->integrity_w_tfm, e, dgb); tmp___8 = drbd_send(mdev, mdev->data.socket, dgb, (size_t )dgs, 0U); ok = tmp___8 == dgs; } } else { } } else { } if (ok != 0) { { ok = _drbd_send_zc_ee(mdev, e); } } else { } { drbd_put_data_sock(mdev); } return (ok); } } int drbd_send_oos(struct drbd_conf *mdev , struct drbd_request *req ) { struct p_block_desc p ; __u64 tmp ; __u32 tmp___0 ; int tmp___1 ; { { tmp = __fswab64((__u64 )req->sector); p.sector = tmp; tmp___0 = __fswab32(req->size); p.blksize = tmp___0; tmp___1 = drbd_send_cmd(mdev, 1, (enum drbd_packets )40, & p.head, 24UL); } return (tmp___1); } } int drbd_send(struct drbd_conf *mdev , struct socket *sock , void *buf , size_t size , unsigned int msg_flags ) { struct kvec iov ; struct msghdr msg ; int rv ; int sent ; int tmp ; struct task_struct *tmp___0 ; char *tmp___1 ; union drbd_state val ; union drbd_state mask ; union drbd_state val___0 ; union drbd_state mask___0 ; { sent = 0; if ((unsigned long )sock == (unsigned long )((struct socket *)0)) { return (-1000); } else { } iov.iov_base = buf; iov.iov_len = size; msg.msg_name = (void *)0; msg.msg_namelen = 0; msg.msg_control = (void *)0; msg.msg_controllen = 0UL; msg.msg_flags = msg_flags | 16384U; if ((unsigned long )mdev->data.socket == (unsigned long )sock) { { mdev->ko_count = (unsigned int )(mdev->net_conf)->ko_count; drbd_update_congested(mdev); } } else { } ldv_49683: { rv = kernel_sendmsg(sock, & msg, & iov, 1UL, size); } if (rv == -11) { { tmp = we_should_drop_the_connection(mdev, sock); } if (tmp != 0) { goto ldv_49681; } else { goto ldv_49682; } } else { } if (rv == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( rv != 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 2882); } } else { } if (rv == -4) { { tmp___0 = get_current(); flush_signals(tmp___0); rv = 0; } } else { } if (rv < 0) { goto ldv_49681; } else { } sent = sent + rv; iov.iov_base = iov.iov_base + (unsigned long )rv; iov.iov_len = iov.iov_len - (size_t )rv; ldv_49682: ; if ((size_t )sent < size) { goto ldv_49683; } else { goto ldv_49681; } ldv_49681: ; if ((unsigned long )mdev->data.socket == (unsigned long )sock) { { clear_bit(21, (unsigned long volatile *)(& mdev->flags)); } } else { } if (rv <= 0) { if (rv != -11) { if ((unsigned long )mdev->meta.socket == (unsigned long )sock) { tmp___1 = (char *)"msock"; } else { tmp___1 = (char *)"sock"; } { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s_sendmsg returned %d\n", tmp___1, rv); val.i = 0U; val.ldv_38339.conn = (unsigned char)4; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask, val); } } else { { val___0.i = 0U; val___0.ldv_38339.conn = (unsigned char)3; mask___0.i = 0U; mask___0.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask___0, val___0); } } } else { } return (sent); } } static int drbd_open(struct block_device *bdev , fmode_t mode ) { struct drbd_conf *mdev ; unsigned long flags ; int rv ; raw_spinlock_t *tmp ; { { mdev = (struct drbd_conf *)(bdev->bd_disk)->private_data; rv = 0; mutex_lock_nested(& drbd_main_mutex, 0U); tmp = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp); } if ((unsigned int )*((unsigned char *)mdev + 2276UL) != 1U) { if ((mode & 2U) != 0U) { rv = -30; } else if (allow_oos == 0) { rv = -124; } else { } } else { } if (rv == 0) { mdev->open_cnt = mdev->open_cnt + 1; } else { } { spin_unlock_irqrestore(& mdev->req_lock, flags); mutex_unlock(& drbd_main_mutex); } return (rv); } } static int drbd_release(struct gendisk *gd , fmode_t mode ) { struct drbd_conf *mdev ; { { mdev = (struct drbd_conf *)gd->private_data; mutex_lock_nested(& drbd_main_mutex, 0U); mdev->open_cnt = mdev->open_cnt - 1; mutex_unlock(& drbd_main_mutex); } return (0); } } static void drbd_set_defaults(struct drbd_conf *mdev ) { struct syncer_conf __constr_expr_0 ; union drbd_state __constr_expr_1 ; { __constr_expr_0.rate = 250; __constr_expr_0.after = -1; __constr_expr_0.al_extents = 127; __constr_expr_0.verify_alg[0] = (unsigned char)0; __constr_expr_0.verify_alg[1] = (unsigned char)0; __constr_expr_0.verify_alg[2] = (unsigned char)0; __constr_expr_0.verify_alg[3] = (unsigned char)0; __constr_expr_0.verify_alg[4] = (unsigned char)0; __constr_expr_0.verify_alg[5] = (unsigned char)0; __constr_expr_0.verify_alg[6] = (unsigned char)0; __constr_expr_0.verify_alg[7] = (unsigned char)0; __constr_expr_0.verify_alg[8] = (unsigned char)0; __constr_expr_0.verify_alg[9] = (unsigned char)0; __constr_expr_0.verify_alg[10] = (unsigned char)0; __constr_expr_0.verify_alg[11] = (unsigned char)0; __constr_expr_0.verify_alg[12] = (unsigned char)0; __constr_expr_0.verify_alg[13] = (unsigned char)0; __constr_expr_0.verify_alg[14] = (unsigned char)0; __constr_expr_0.verify_alg[15] = (unsigned char)0; __constr_expr_0.verify_alg[16] = (unsigned char)0; __constr_expr_0.verify_alg[17] = (unsigned char)0; __constr_expr_0.verify_alg[18] = (unsigned char)0; __constr_expr_0.verify_alg[19] = (unsigned char)0; __constr_expr_0.verify_alg[20] = (unsigned char)0; __constr_expr_0.verify_alg[21] = (unsigned char)0; __constr_expr_0.verify_alg[22] = (unsigned char)0; __constr_expr_0.verify_alg[23] = (unsigned char)0; __constr_expr_0.verify_alg[24] = (unsigned char)0; __constr_expr_0.verify_alg[25] = (unsigned char)0; __constr_expr_0.verify_alg[26] = (unsigned char)0; __constr_expr_0.verify_alg[27] = (unsigned char)0; __constr_expr_0.verify_alg[28] = (unsigned char)0; __constr_expr_0.verify_alg[29] = (unsigned char)0; __constr_expr_0.verify_alg[30] = (unsigned char)0; __constr_expr_0.verify_alg[31] = (unsigned char)0; __constr_expr_0.verify_alg[32] = (unsigned char)0; __constr_expr_0.verify_alg[33] = (unsigned char)0; __constr_expr_0.verify_alg[34] = (unsigned char)0; __constr_expr_0.verify_alg[35] = (unsigned char)0; __constr_expr_0.verify_alg[36] = (unsigned char)0; __constr_expr_0.verify_alg[37] = (unsigned char)0; __constr_expr_0.verify_alg[38] = (unsigned char)0; __constr_expr_0.verify_alg[39] = (unsigned char)0; __constr_expr_0.verify_alg[40] = (unsigned char)0; __constr_expr_0.verify_alg[41] = (unsigned char)0; __constr_expr_0.verify_alg[42] = (unsigned char)0; __constr_expr_0.verify_alg[43] = (unsigned char)0; __constr_expr_0.verify_alg[44] = (unsigned char)0; __constr_expr_0.verify_alg[45] = (unsigned char)0; __constr_expr_0.verify_alg[46] = (unsigned char)0; __constr_expr_0.verify_alg[47] = (unsigned char)0; __constr_expr_0.verify_alg[48] = (unsigned char)0; __constr_expr_0.verify_alg[49] = (unsigned char)0; __constr_expr_0.verify_alg[50] = (unsigned char)0; __constr_expr_0.verify_alg[51] = (unsigned char)0; __constr_expr_0.verify_alg[52] = (unsigned char)0; __constr_expr_0.verify_alg[53] = (unsigned char)0; __constr_expr_0.verify_alg[54] = (unsigned char)0; __constr_expr_0.verify_alg[55] = (unsigned char)0; __constr_expr_0.verify_alg[56] = (unsigned char)0; __constr_expr_0.verify_alg[57] = (unsigned char)0; __constr_expr_0.verify_alg[58] = (unsigned char)0; __constr_expr_0.verify_alg[59] = (unsigned char)0; __constr_expr_0.verify_alg[60] = (unsigned char)0; __constr_expr_0.verify_alg[61] = (unsigned char)0; __constr_expr_0.verify_alg[62] = (unsigned char)0; __constr_expr_0.verify_alg[63] = (unsigned char)0; __constr_expr_0.verify_alg_len = 0; __constr_expr_0.cpu_mask[0] = (unsigned char)0; __constr_expr_0.cpu_mask[1] = (unsigned char)0; __constr_expr_0.cpu_mask[2] = (unsigned char)0; __constr_expr_0.cpu_mask[3] = (unsigned char)0; __constr_expr_0.cpu_mask[4] = (unsigned char)0; __constr_expr_0.cpu_mask[5] = (unsigned char)0; __constr_expr_0.cpu_mask[6] = (unsigned char)0; __constr_expr_0.cpu_mask[7] = (unsigned char)0; __constr_expr_0.cpu_mask[8] = (unsigned char)0; __constr_expr_0.cpu_mask[9] = (unsigned char)0; __constr_expr_0.cpu_mask[10] = (unsigned char)0; __constr_expr_0.cpu_mask[11] = (unsigned char)0; __constr_expr_0.cpu_mask[12] = (unsigned char)0; __constr_expr_0.cpu_mask[13] = (unsigned char)0; __constr_expr_0.cpu_mask[14] = (unsigned char)0; __constr_expr_0.cpu_mask[15] = (unsigned char)0; __constr_expr_0.cpu_mask[16] = (unsigned char)0; __constr_expr_0.cpu_mask[17] = (unsigned char)0; __constr_expr_0.cpu_mask[18] = (unsigned char)0; __constr_expr_0.cpu_mask[19] = (unsigned char)0; __constr_expr_0.cpu_mask[20] = (unsigned char)0; __constr_expr_0.cpu_mask[21] = (unsigned char)0; __constr_expr_0.cpu_mask[22] = (unsigned char)0; __constr_expr_0.cpu_mask[23] = (unsigned char)0; __constr_expr_0.cpu_mask[24] = (unsigned char)0; __constr_expr_0.cpu_mask[25] = (unsigned char)0; __constr_expr_0.cpu_mask[26] = (unsigned char)0; __constr_expr_0.cpu_mask[27] = (unsigned char)0; __constr_expr_0.cpu_mask[28] = (unsigned char)0; __constr_expr_0.cpu_mask[29] = (unsigned char)0; __constr_expr_0.cpu_mask[30] = (unsigned char)0; __constr_expr_0.cpu_mask[31] = (unsigned char)0; __constr_expr_0.cpu_mask_len = 0; __constr_expr_0.csums_alg[0] = (unsigned char)0; __constr_expr_0.csums_alg[1] = (unsigned char)0; __constr_expr_0.csums_alg[2] = (unsigned char)0; __constr_expr_0.csums_alg[3] = (unsigned char)0; __constr_expr_0.csums_alg[4] = (unsigned char)0; __constr_expr_0.csums_alg[5] = (unsigned char)0; __constr_expr_0.csums_alg[6] = (unsigned char)0; __constr_expr_0.csums_alg[7] = (unsigned char)0; __constr_expr_0.csums_alg[8] = (unsigned char)0; __constr_expr_0.csums_alg[9] = (unsigned char)0; __constr_expr_0.csums_alg[10] = (unsigned char)0; __constr_expr_0.csums_alg[11] = (unsigned char)0; __constr_expr_0.csums_alg[12] = (unsigned char)0; __constr_expr_0.csums_alg[13] = (unsigned char)0; __constr_expr_0.csums_alg[14] = (unsigned char)0; __constr_expr_0.csums_alg[15] = (unsigned char)0; __constr_expr_0.csums_alg[16] = (unsigned char)0; __constr_expr_0.csums_alg[17] = (unsigned char)0; __constr_expr_0.csums_alg[18] = (unsigned char)0; __constr_expr_0.csums_alg[19] = (unsigned char)0; __constr_expr_0.csums_alg[20] = (unsigned char)0; __constr_expr_0.csums_alg[21] = (unsigned char)0; __constr_expr_0.csums_alg[22] = (unsigned char)0; __constr_expr_0.csums_alg[23] = (unsigned char)0; __constr_expr_0.csums_alg[24] = (unsigned char)0; __constr_expr_0.csums_alg[25] = (unsigned char)0; __constr_expr_0.csums_alg[26] = (unsigned char)0; __constr_expr_0.csums_alg[27] = (unsigned char)0; __constr_expr_0.csums_alg[28] = (unsigned char)0; __constr_expr_0.csums_alg[29] = (unsigned char)0; __constr_expr_0.csums_alg[30] = (unsigned char)0; __constr_expr_0.csums_alg[31] = (unsigned char)0; __constr_expr_0.csums_alg[32] = (unsigned char)0; __constr_expr_0.csums_alg[33] = (unsigned char)0; __constr_expr_0.csums_alg[34] = (unsigned char)0; __constr_expr_0.csums_alg[35] = (unsigned char)0; __constr_expr_0.csums_alg[36] = (unsigned char)0; __constr_expr_0.csums_alg[37] = (unsigned char)0; __constr_expr_0.csums_alg[38] = (unsigned char)0; __constr_expr_0.csums_alg[39] = (unsigned char)0; __constr_expr_0.csums_alg[40] = (unsigned char)0; __constr_expr_0.csums_alg[41] = (unsigned char)0; __constr_expr_0.csums_alg[42] = (unsigned char)0; __constr_expr_0.csums_alg[43] = (unsigned char)0; __constr_expr_0.csums_alg[44] = (unsigned char)0; __constr_expr_0.csums_alg[45] = (unsigned char)0; __constr_expr_0.csums_alg[46] = (unsigned char)0; __constr_expr_0.csums_alg[47] = (unsigned char)0; __constr_expr_0.csums_alg[48] = (unsigned char)0; __constr_expr_0.csums_alg[49] = (unsigned char)0; __constr_expr_0.csums_alg[50] = (unsigned char)0; __constr_expr_0.csums_alg[51] = (unsigned char)0; __constr_expr_0.csums_alg[52] = (unsigned char)0; __constr_expr_0.csums_alg[53] = (unsigned char)0; __constr_expr_0.csums_alg[54] = (unsigned char)0; __constr_expr_0.csums_alg[55] = (unsigned char)0; __constr_expr_0.csums_alg[56] = (unsigned char)0; __constr_expr_0.csums_alg[57] = (unsigned char)0; __constr_expr_0.csums_alg[58] = (unsigned char)0; __constr_expr_0.csums_alg[59] = (unsigned char)0; __constr_expr_0.csums_alg[60] = (unsigned char)0; __constr_expr_0.csums_alg[61] = (unsigned char)0; __constr_expr_0.csums_alg[62] = (unsigned char)0; __constr_expr_0.csums_alg[63] = (unsigned char)0; __constr_expr_0.csums_alg_len = 0; __constr_expr_0.use_rle = (unsigned char)0; __constr_expr_0.on_no_data = 0; __constr_expr_0.c_plan_ahead = 0; __constr_expr_0.c_delay_target = 10; __constr_expr_0.c_fill_target = 0; __constr_expr_0.c_max_rate = 102400; __constr_expr_0.c_min_rate = 4096; mdev->sync_conf = __constr_expr_0; __constr_expr_1.ldv_38339.role = (unsigned char)2; __constr_expr_1.ldv_38339.peer = (unsigned char)0; __constr_expr_1.ldv_38339.conn = (unsigned char)0; __constr_expr_1.ldv_38339.disk = (unsigned char)0; __constr_expr_1.ldv_38339.pdsk = (unsigned char)6; __constr_expr_1.ldv_38339.susp = (unsigned char)0; __constr_expr_1.ldv_38339.aftr_isp = (unsigned char)0; __constr_expr_1.ldv_38339.peer_isp = (unsigned char)0; __constr_expr_1.ldv_38339.user_isp = (unsigned char)0; __constr_expr_1.ldv_38339.susp_nod = (unsigned char)0; __constr_expr_1.ldv_38339.susp_fen = (unsigned char)0; __constr_expr_1.ldv_38339._pad = (unsigned short)0; mdev->state = __constr_expr_1; return; } } void drbd_init_set_defaults(struct drbd_conf *mdev ) { struct lock_class_key __key ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; struct lock_class_key __key___2 ; struct lock_class_key __key___3 ; struct lock_class_key __key___4 ; struct lock_class_key __key___5 ; struct lock_class_key __key___6 ; struct lock_class_key __key___7 ; struct lock_class_key __key___8 ; struct lock_class_key __key___9 ; struct lock_class_key __key___10 ; struct lock_class_key __key___11 ; struct lock_class_key __key___12 ; struct lock_class_key __key___13 ; struct lock_class_key __key___14 ; struct lock_class_key __key___15 ; struct lock_class_key __key___16 ; struct lock_class_key __key___17 ; struct lock_class_key __key___18 ; { { drbd_set_defaults(mdev); atomic_set(& mdev->ap_bio_cnt, 0); atomic_set(& mdev->ap_pending_cnt, 0); atomic_set(& mdev->rs_pending_cnt, 0); atomic_set(& mdev->unacked_cnt, 0); atomic_set(& mdev->local_cnt, 0); atomic_set(& mdev->net_cnt, 0); atomic_set(& mdev->packet_seq, 0); atomic_set(& mdev->pp_in_use, 0); atomic_set(& mdev->pp_in_use_by_net, 0); atomic_set(& mdev->rs_sect_in, 0); atomic_set(& mdev->rs_sect_ev, 0); atomic_set(& mdev->ap_in_flight, 0); __mutex_init(& mdev->md_io_mutex, "&mdev->md_io_mutex", & __key); __mutex_init(& mdev->data.mutex, "&mdev->data.mutex", & __key___0); __mutex_init(& mdev->meta.mutex, "&mdev->meta.mutex", & __key___1); sema_init(& mdev->data.work.s, 0); sema_init(& mdev->meta.work.s, 0); __mutex_init(& mdev->state_mutex, "&mdev->state_mutex", & __key___2); spinlock_check(& mdev->data.work.q_lock); __raw_spin_lock_init(& mdev->data.work.q_lock.ldv_6060.rlock, "&(&mdev->data.work.q_lock)->rlock", & __key___3); spinlock_check(& mdev->meta.work.q_lock); __raw_spin_lock_init(& mdev->meta.work.q_lock.ldv_6060.rlock, "&(&mdev->meta.work.q_lock)->rlock", & __key___4); spinlock_check(& mdev->al_lock); __raw_spin_lock_init(& mdev->al_lock.ldv_6060.rlock, "&(&mdev->al_lock)->rlock", & __key___5); spinlock_check(& mdev->req_lock); __raw_spin_lock_init(& mdev->req_lock.ldv_6060.rlock, "&(&mdev->req_lock)->rlock", & __key___6); spinlock_check(& mdev->peer_seq_lock); __raw_spin_lock_init(& mdev->peer_seq_lock.ldv_6060.rlock, "&(&mdev->peer_seq_lock)->rlock", & __key___7); spinlock_check(& mdev->epoch_lock); __raw_spin_lock_init(& mdev->epoch_lock.ldv_6060.rlock, "&(&mdev->epoch_lock)->rlock", & __key___8); INIT_LIST_HEAD(& mdev->active_ee); INIT_LIST_HEAD(& mdev->sync_ee); INIT_LIST_HEAD(& mdev->done_ee); INIT_LIST_HEAD(& mdev->read_ee); INIT_LIST_HEAD(& mdev->net_ee); INIT_LIST_HEAD(& mdev->resync_reads); INIT_LIST_HEAD(& mdev->data.work.q); INIT_LIST_HEAD(& mdev->meta.work.q); INIT_LIST_HEAD(& mdev->resync_work.list); INIT_LIST_HEAD(& mdev->unplug_work.list); INIT_LIST_HEAD(& mdev->go_diskless.list); INIT_LIST_HEAD(& mdev->md_sync_work.list); INIT_LIST_HEAD(& mdev->start_resync_work.list); INIT_LIST_HEAD(& mdev->bm_io_work.w.list); mdev->resync_work.cb = & w_resync_timer; mdev->unplug_work.cb = & w_send_write_hint; mdev->go_diskless.cb = & w_go_diskless; mdev->md_sync_work.cb = & w_md_sync; mdev->bm_io_work.w.cb = & w_bitmap_io; mdev->start_resync_work.cb = & w_start_resync; init_timer_key(& mdev->resync_timer, "&mdev->resync_timer", & __key___9); init_timer_key(& mdev->md_sync_timer, "&mdev->md_sync_timer", & __key___10); init_timer_key(& mdev->start_resync_timer, "&mdev->start_resync_timer", & __key___11); init_timer_key(& mdev->request_timer, "&mdev->request_timer", & __key___12); mdev->resync_timer.function = & resync_timer_fn; mdev->resync_timer.data = (unsigned long )mdev; mdev->md_sync_timer.function = & md_sync_timer_fn; mdev->md_sync_timer.data = (unsigned long )mdev; mdev->start_resync_timer.function = & start_resync_timer_fn; mdev->start_resync_timer.data = (unsigned long )mdev; mdev->request_timer.function = & request_timer_fn; mdev->request_timer.data = (unsigned long )mdev; __init_waitqueue_head(& mdev->misc_wait, & __key___13); __init_waitqueue_head(& mdev->state_wait, & __key___14); __init_waitqueue_head(& mdev->net_cnt_wait, & __key___15); __init_waitqueue_head(& mdev->ee_wait, & __key___16); __init_waitqueue_head(& mdev->al_wait, & __key___17); __init_waitqueue_head(& mdev->seq_wait, & __key___18); drbd_thread_init(mdev, & mdev->receiver, & drbdd_init); drbd_thread_init(mdev, & mdev->worker, & drbd_worker); drbd_thread_init(mdev, & mdev->asender, & drbd_asender); mdev->agreed_pro_version = 96; mdev->write_ordering = (enum write_ordering_e )2; mdev->resync_wenr = 4294967295U; mdev->peer_max_bio_size = 4096; mdev->local_max_bio_size = 4096; } return; } } void drbd_mdev_cleanup(struct drbd_conf *mdev ) { int i ; int tmp ; int tmp___0 ; unsigned int tmp___1 ; unsigned int tmp___2 ; unsigned int tmp___3 ; unsigned int tmp___4 ; unsigned int tmp___5 ; sector_t tmp___6 ; unsigned long tmp___7 ; unsigned long tmp___8 ; unsigned long tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; int tmp___17 ; int tmp___18 ; int tmp___19 ; int tmp___20 ; { if ((unsigned int )mdev->receiver.t_state != 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: receiver t_state == %d expected 0.\n", (unsigned int )mdev->receiver.t_state); } } else { } { tmp___0 = atomic_read((atomic_t const *)(& (mdev->current_epoch)->epoch_size)); } if (tmp___0 != 0) { { tmp = atomic_read((atomic_t const *)(& (mdev->current_epoch)->epoch_size)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "epoch_size:%d\n", tmp); } } else { } tmp___9 = 0UL; mdev->rs_failed = tmp___9; tmp___8 = tmp___9; mdev->rs_total = tmp___8; tmp___7 = tmp___8; mdev->rs_start = tmp___7; tmp___6 = tmp___7; mdev->p_size = tmp___6; tmp___5 = (unsigned int )tmp___6; mdev->writ_cnt = tmp___5; tmp___4 = tmp___5; mdev->send_cnt = tmp___4; tmp___3 = tmp___4; mdev->recv_cnt = tmp___3; tmp___2 = tmp___3; mdev->read_cnt = tmp___2; tmp___1 = tmp___2; mdev->bm_writ_cnt = tmp___1; mdev->al_writ_cnt = tmp___1; mdev->rs_last_events = 0; mdev->rs_last_sect_ev = 0; i = 0; goto ldv_49740; ldv_49739: mdev->rs_mark_left[i] = 0UL; mdev->rs_mark_time[i] = 0UL; i = i + 1; ldv_49740: ; if (i <= 7) { goto ldv_49739; } else { goto ldv_49741; } ldv_49741: ; if ((unsigned long )mdev->net_conf != (unsigned long )((struct net_conf *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->net_conf == NULL ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3092); } } else { } { drbd_set_my_capacity(mdev, 0UL); } if ((unsigned long )mdev->bitmap != (unsigned long )((struct drbd_bitmap *)0)) { { drbd_bm_resize(mdev, 0UL, 1); drbd_bm_cleanup(mdev); } } else { } { drbd_free_resources(mdev); clear_bit(28, (unsigned long volatile *)(& mdev->flags)); tmp___10 = list_empty((struct list_head const *)(& mdev->active_ee)); } if (tmp___10 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->active_ee) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3108); } } else { } { tmp___11 = list_empty((struct list_head const *)(& mdev->sync_ee)); } if (tmp___11 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->sync_ee) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3109); } } else { } { tmp___12 = list_empty((struct list_head const *)(& mdev->done_ee)); } if (tmp___12 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->done_ee) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3110); } } else { } { tmp___13 = list_empty((struct list_head const *)(& mdev->read_ee)); } if (tmp___13 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->read_ee) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3111); } } else { } { tmp___14 = list_empty((struct list_head const *)(& mdev->net_ee)); } if (tmp___14 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->net_ee) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3112); } } else { } { tmp___15 = list_empty((struct list_head const *)(& mdev->resync_reads)); } if (tmp___15 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->resync_reads) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3113); } } else { } { tmp___16 = list_empty((struct list_head const *)(& mdev->data.work.q)); } if (tmp___16 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->data.work.q) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3114); } } else { } { tmp___17 = list_empty((struct list_head const *)(& mdev->meta.work.q)); } if (tmp___17 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->meta.work.q) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3115); } } else { } { tmp___18 = list_empty((struct list_head const *)(& mdev->resync_work.list)); } if (tmp___18 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->resync_work.list) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3116); } } else { } { tmp___19 = list_empty((struct list_head const *)(& mdev->unplug_work.list)); } if (tmp___19 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->unplug_work.list) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3117); } } else { } { tmp___20 = list_empty((struct list_head const *)(& mdev->go_diskless.list)); } if (tmp___20 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->go_diskless.list) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3118); } } else { } { drbd_set_defaults(mdev); } return; } } static void drbd_destroy_mempools(void) { struct page *page ; { goto ldv_49747; ldv_49746: { page = drbd_pp_pool; drbd_pp_pool = (struct page *)page->ldv_14032.ldv_14029.private; __free_pages(page, 0U); drbd_pp_vacant = drbd_pp_vacant - 1; } ldv_49747: ; if ((unsigned long )drbd_pp_pool != (unsigned long )((struct page *)0)) { goto ldv_49746; } else { goto ldv_49748; } ldv_49748: ; if ((unsigned long )drbd_ee_mempool != (unsigned long )((mempool_t *)0)) { { mempool_destroy(drbd_ee_mempool); } } else { } if ((unsigned long )drbd_request_mempool != (unsigned long )((mempool_t *)0)) { { mempool_destroy(drbd_request_mempool); } } else { } if ((unsigned long )drbd_ee_cache != (unsigned long )((struct kmem_cache *)0)) { { kmem_cache_destroy(drbd_ee_cache); } } else { } if ((unsigned long )drbd_request_cache != (unsigned long )((struct kmem_cache *)0)) { { kmem_cache_destroy(drbd_request_cache); } } else { } if ((unsigned long )drbd_bm_ext_cache != (unsigned long )((struct kmem_cache *)0)) { { kmem_cache_destroy(drbd_bm_ext_cache); } } else { } if ((unsigned long )drbd_al_ext_cache != (unsigned long )((struct kmem_cache *)0)) { { kmem_cache_destroy(drbd_al_ext_cache); } } else { } drbd_ee_mempool = (mempool_t *)0; drbd_request_mempool = (mempool_t *)0; drbd_ee_cache = (struct kmem_cache *)0; drbd_request_cache = (struct kmem_cache *)0; drbd_bm_ext_cache = (struct kmem_cache *)0; drbd_al_ext_cache = (struct kmem_cache *)0; return; } } static int drbd_create_mempools(void) { struct page *page ; int number ; int i ; struct lock_class_key __key ; { { number = (int )((int const )(minor_count * 32U)); drbd_request_mempool = (mempool_t *)0; drbd_ee_cache = (struct kmem_cache *)0; drbd_request_cache = (struct kmem_cache *)0; drbd_bm_ext_cache = (struct kmem_cache *)0; drbd_al_ext_cache = (struct kmem_cache *)0; drbd_pp_pool = (struct page *)0; drbd_request_cache = kmem_cache_create("drbd_req", 120UL, 0UL, 0UL, (void (*)(void * ))0); } if ((unsigned long )drbd_request_cache == (unsigned long )((struct kmem_cache *)0)) { goto Enomem; } else { } { drbd_ee_cache = kmem_cache_create("drbd_ee", 96UL, 0UL, 0UL, (void (*)(void * ))0); } if ((unsigned long )drbd_ee_cache == (unsigned long )((struct kmem_cache *)0)) { goto Enomem; } else { } { drbd_bm_ext_cache = kmem_cache_create("drbd_bm", 64UL, 0UL, 0UL, (void (*)(void * ))0); } if ((unsigned long )drbd_bm_ext_cache == (unsigned long )((struct kmem_cache *)0)) { goto Enomem; } else { } { drbd_al_ext_cache = kmem_cache_create("drbd_al", 48UL, 0UL, 0UL, (void (*)(void * ))0); } if ((unsigned long )drbd_al_ext_cache == (unsigned long )((struct kmem_cache *)0)) { goto Enomem; } else { } { drbd_request_mempool = mempool_create(number, & mempool_alloc_slab, & mempool_free_slab, (void *)drbd_request_cache); } if ((unsigned long )drbd_request_mempool == (unsigned long )((mempool_t *)0)) { goto Enomem; } else { } { drbd_ee_mempool = mempool_create(number, & mempool_alloc_slab, & mempool_free_slab, (void *)drbd_ee_cache); } if ((unsigned long )drbd_ee_mempool == (unsigned long )((mempool_t *)0)) { goto Enomem; } else { } { spinlock_check(& drbd_pp_lock); __raw_spin_lock_init(& drbd_pp_lock.ldv_6060.rlock, "&(&drbd_pp_lock)->rlock", & __key); i = 0; } goto ldv_49758; ldv_49757: { page = alloc_pages(131282U, 0U); } if ((unsigned long )page == (unsigned long )((struct page *)0)) { goto Enomem; } else { } page->ldv_14032.ldv_14029.private = (unsigned long )drbd_pp_pool; drbd_pp_pool = page; i = i + 1; ldv_49758: ; if (i < number) { goto ldv_49757; } else { goto ldv_49759; } ldv_49759: drbd_pp_vacant = number; return (0); Enomem: { drbd_destroy_mempools(); } return (-12); } } static int drbd_notify_sys(struct notifier_block *this , unsigned long code , void *unused ) { { return (0); } } static struct notifier_block drbd_notifier = {& drbd_notify_sys, (struct notifier_block *)0, 0}; static void drbd_release_ee_lists(struct drbd_conf *mdev ) { int rr ; { { rr = drbd_release_ee(mdev, & mdev->active_ee); } if (rr != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%d EEs in active list found!\n", rr); } } else { } { rr = drbd_release_ee(mdev, & mdev->sync_ee); } if (rr != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%d EEs in sync list found!\n", rr); } } else { } { rr = drbd_release_ee(mdev, & mdev->read_ee); } if (rr != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%d EEs in read list found!\n", rr); } } else { } { rr = drbd_release_ee(mdev, & mdev->done_ee); } if (rr != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%d EEs in done list found!\n", rr); } } else { } { rr = drbd_release_ee(mdev, & mdev->net_ee); } if (rr != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%d EEs in net list found!\n", rr); } } else { } return; } } static void drbd_delete_device(unsigned int minor ) { struct drbd_conf *mdev ; struct drbd_conf *tmp ; struct list_head *lp ; int _b ; int tmp___0 ; { { tmp = minor_to_mdev(minor); mdev = tmp; } if ((unsigned long )mdev == (unsigned long )((struct drbd_conf *)0)) { return; } else { } if (mdev->open_cnt != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "open_cnt = %d in %s:%u", mdev->open_cnt, (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3276); } } else { } { tmp___0 = list_empty((struct list_head const *)(& mdev->data.work.q)); _b = tmp___0 == 0; } if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_delete_device", (char *)"!list_empty(&mdev->data.work.q)", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3278); } } else { } if (_b != 0) { lp = mdev->data.work.q.next; goto ldv_49779; ldv_49778: { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "lp = %p\n", lp); lp = lp->next; } ldv_49779: ; if ((unsigned long )(& mdev->data.work.q) != (unsigned long )lp) { goto ldv_49778; } else { goto ldv_49780; } ldv_49780: ; } else { } { del_gendisk(mdev->vdisk); } if ((unsigned long )mdev->this_bdev != (unsigned long )((struct block_device *)0)) { { bdput(mdev->this_bdev); } } else { } { drbd_free_resources(mdev); drbd_release_ee_lists(mdev); kfree((void const *)mdev->ee_hash); lc_destroy(mdev->act_log); lc_destroy(mdev->resync); kfree((void const *)mdev->p_uuid); kfree((void const *)mdev->int_dig_out); kfree((void const *)mdev->int_dig_in); kfree((void const *)mdev->int_dig_vv); drbd_free_mdev(mdev); } return; } } static void drbd_cleanup(void) { unsigned int i ; unsigned int tmp ; { { unregister_reboot_notifier(& drbd_notifier); } if ((unsigned long )drbd_proc != (unsigned long )((struct proc_dir_entry *)0)) { { remove_proc_entry("drbd", (struct proc_dir_entry *)0); } } else { } { drbd_nl_cleanup(); } if ((unsigned long )minor_table != (unsigned long )((struct drbd_conf **)0)) { i = minor_count; goto ldv_49786; ldv_49785: { drbd_delete_device(i); } ldv_49786: tmp = i; i = i - 1U; if (tmp != 0U) { goto ldv_49785; } else { goto ldv_49787; } ldv_49787: { drbd_destroy_mempools(); } } else { } { kfree((void const *)minor_table); unregister_blkdev(147U, "drbd"); printk("<6>drbd: module cleanup done.\n"); } return; } } static int drbd_congested(void *congested_data , int bdi_bits ) { struct drbd_conf *mdev ; struct request_queue *q ; char reason ; int r ; bool tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { { mdev = (struct drbd_conf *)congested_data; reason = (char)45; r = 0; tmp = may_inc_ap_bio___0(mdev); } if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { r = bdi_bits; reason = (char)100; goto out; } else { } { tmp___1 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___1 != 0) { { q = bdev_get_queue((mdev->ldev)->backing_bdev); r = bdi_congested(& q->backing_dev_info, bdi_bits); put_ldev(mdev); } if (r != 0) { reason = (char)98; } else { } } else { } if ((bdi_bits & 4) != 0) { { tmp___2 = constant_test_bit(21U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___2 != 0) { r = r | 4; if ((int )((signed char )reason) == 98) { reason = (char)97; } else { reason = (char)110; } } else { } } else { } out: mdev->congestion_reason = reason; return (r); } } struct drbd_conf *drbd_new_device(unsigned int minor ) { struct drbd_conf *mdev ; struct gendisk *disk ; struct request_queue *q ; void *tmp ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; void *tmp___4 ; void *tmp___5 ; { { tmp = kzalloc(4848UL, 208U); mdev = (struct drbd_conf *)tmp; } if ((unsigned long )mdev == (unsigned long )((struct drbd_conf *)0)) { return ((struct drbd_conf *)0); } else { } { tmp___0 = zalloc_cpumask_var((cpumask_var_t **)(& mdev->cpu_mask), 208U); } if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto out_no_cpumask; } else { } { mdev->minor = minor; drbd_init_set_defaults(mdev); q = blk_alloc_queue(208U); } if ((unsigned long )q == (unsigned long )((struct request_queue *)0)) { goto out_no_q; } else { } { mdev->rq_queue = q; q->queuedata = (void *)mdev; disk = alloc_disk(1); } if ((unsigned long )disk == (unsigned long )((struct gendisk *)0)) { goto out_no_disk; } else { } { mdev->vdisk = disk; set_disk_ro(disk, 1); disk->queue = q; disk->major = 147; disk->first_minor = (int )minor; disk->fops = & drbd_ops; sprintf((char *)(& disk->disk_name), "drbd%d", minor); disk->private_data = (void *)mdev; mdev->this_bdev = bdget(minor | 154140672U); (mdev->this_bdev)->bd_contains = mdev->this_bdev; q->backing_dev_info.congested_fn = & drbd_congested; q->backing_dev_info.congested_data = (void *)mdev; blk_queue_make_request(q, & drbd_make_request); blk_queue_max_hw_sectors(q, 16U); blk_queue_bounce_limit(q, 0x0fffffffffffffffULL); blk_queue_merge_bvec(q, & drbd_merge_bvec); q->queue_lock = & mdev->req_lock; mdev->md_io_page = alloc_pages(208U, 0U); } if ((unsigned long )mdev->md_io_page == (unsigned long )((struct page *)0)) { goto out_no_io_page; } else { } { tmp___2 = drbd_bm_init(mdev); } if (tmp___2 != 0) { goto out_no_bitmap; } else { } { tmp___3 = tl_init(mdev); } if (tmp___3 == 0) { goto out_no_tl; } else { } { tmp___4 = kzalloc(120UL, 208U); mdev->app_reads_hash = (struct hlist_head *)tmp___4; } if ((unsigned long )mdev->app_reads_hash == (unsigned long )((struct hlist_head *)0)) { goto out_no_app_reads; } else { } { tmp___5 = kzalloc(40UL, 208U); mdev->current_epoch = (struct drbd_epoch *)tmp___5; } if ((unsigned long )mdev->current_epoch == (unsigned long )((struct drbd_epoch *)0)) { goto out_no_epoch; } else { } { INIT_LIST_HEAD(& (mdev->current_epoch)->list); mdev->epochs = 1U; } return (mdev); out_no_epoch: { kfree((void const *)mdev->app_reads_hash); } out_no_app_reads: { tl_cleanup(mdev); } out_no_tl: { drbd_bm_cleanup(mdev); } out_no_bitmap: { __free_pages(mdev->md_io_page, 0U); } out_no_io_page: { put_disk(disk); } out_no_disk: { blk_cleanup_queue(q); } out_no_q: { free_cpumask_var(mdev->cpu_mask); } out_no_cpumask: { kfree((void const *)mdev); } return ((struct drbd_conf *)0); } } void drbd_free_mdev(struct drbd_conf *mdev ) { { { kfree((void const *)mdev->current_epoch); kfree((void const *)mdev->app_reads_hash); tl_cleanup(mdev); } if ((unsigned long )mdev->bitmap != (unsigned long )((struct drbd_bitmap *)0)) { { drbd_bm_cleanup(mdev); } } else { } { __free_pages(mdev->md_io_page, 0U); put_disk(mdev->vdisk); blk_cleanup_queue(mdev->rq_queue); free_cpumask_var(mdev->cpu_mask); drbd_free_tl_hash(mdev); kfree((void const *)mdev); } return; } } int drbd_init(void) { int err ; struct lock_class_key __key ; void *tmp ; struct lock_class_key __key___0 ; char const *tmp___0 ; { if (minor_count == 0U) { { printk("<3>drbd: invalid minor_count (%d)\n", minor_count); } return (-22); } else if (minor_count > 256U) { { printk("<3>drbd: invalid minor_count (%d)\n", minor_count); } return (-22); } else { } { err = drbd_nl_init(); } if (err != 0) { return (err); } else { } { err = register_blkdev(147U, "drbd"); } if (err != 0) { { printk("<3>drbd: unable to register block device major %d\n", 147); } return (err); } else { } { register_reboot_notifier(& drbd_notifier); err = -12; __init_waitqueue_head(& drbd_pp_wait, & __key); drbd_proc = (struct proc_dir_entry *)0; tmp = kzalloc((unsigned long )minor_count * 8UL, 208U); minor_table = (struct drbd_conf **)tmp; } if ((unsigned long )minor_table == (unsigned long )((struct drbd_conf **)0)) { goto Enomem; } else { } { err = drbd_create_mempools(); } if (err != 0) { goto Enomem; } else { } { drbd_proc = proc_create_data("drbd", 33060U, (struct proc_dir_entry *)0, & drbd_proc_fops, (void *)0); } if ((unsigned long )drbd_proc == (unsigned long )((struct proc_dir_entry *)0)) { { printk("<3>drbd: unable to register proc file\n"); } goto Enomem; } else { } { __rwlock_init(& global_state_lock, "&global_state_lock", & __key___0); printk("<6>drbd: initialized. Version: 8.3.11 (api:%d/proto:%d-%d)\n", 88, 86, 96); tmp___0 = drbd_buildtag(); printk("<6>drbd: %s\n", tmp___0); printk("<6>drbd: registered as block device major %d\n", 147); printk("<6>drbd: minor_table @ 0x%p\n", minor_table); } return (0); Enomem: { drbd_cleanup(); } if (err == -12) { { printk("<3>drbd: ran out of memory\n"); } } else { { printk("<3>drbd: initialization failure\n"); } } return (err); } } void drbd_free_bc(struct drbd_backing_dev *ldev ) { { if ((unsigned long )ldev == (unsigned long )((struct drbd_backing_dev *)0)) { return; } else { } { blkdev_put(ldev->backing_bdev, 131U); blkdev_put(ldev->md_bdev, 131U); kfree((void const *)ldev); } return; } } void drbd_free_sock(struct drbd_conf *mdev ) { { if ((unsigned long )mdev->data.socket != (unsigned long )((struct socket *)0)) { { mutex_lock_nested(& mdev->data.mutex, 0U); kernel_sock_shutdown(mdev->data.socket, (enum sock_shutdown_cmd )2); sock_release(mdev->data.socket); mdev->data.socket = (struct socket *)0; mutex_unlock(& mdev->data.mutex); } } else { } if ((unsigned long )mdev->meta.socket != (unsigned long )((struct socket *)0)) { { mutex_lock_nested(& mdev->meta.mutex, 0U); kernel_sock_shutdown(mdev->meta.socket, (enum sock_shutdown_cmd )2); sock_release(mdev->meta.socket); mdev->meta.socket = (struct socket *)0; mutex_unlock(& mdev->meta.mutex); } } else { } return; } } void drbd_free_resources(struct drbd_conf *mdev ) { { { crypto_free_hash(mdev->csums_tfm); mdev->csums_tfm = (struct crypto_hash *)0; crypto_free_hash(mdev->verify_tfm); mdev->verify_tfm = (struct crypto_hash *)0; crypto_free_hash(mdev->cram_hmac_tfm); mdev->cram_hmac_tfm = (struct crypto_hash *)0; crypto_free_hash(mdev->integrity_w_tfm); mdev->integrity_w_tfm = (struct crypto_hash *)0; crypto_free_hash(mdev->integrity_r_tfm); mdev->integrity_r_tfm = (struct crypto_hash *)0; drbd_free_sock(mdev); drbd_free_bc(mdev->ldev); mdev->ldev = (struct drbd_backing_dev *)0; } return; } } void drbd_md_sync(struct drbd_conf *mdev ) { struct meta_data_on_disk *buffer ; sector_t sector ; int i ; int tmp ; int tmp___0 ; void *tmp___1 ; sector_t tmp___2 ; __u64 tmp___3 ; __u64 tmp___4 ; __u32 tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; __u32 tmp___8 ; __u64 tmp___9 ; __u32 tmp___10 ; __u32 tmp___11 ; sector_t tmp___12 ; int tmp___13 ; sector_t tmp___14 ; { { del_timer(& mdev->md_sync_timer); tmp = test_and_clear_bit(5, (unsigned long volatile *)(& mdev->flags)); } if (tmp == 0) { return; } else { } { tmp___0 = _get_ldev_if_state(mdev, (enum drbd_disk_state )2); } if (tmp___0 == 0) { return; } else { } { mutex_lock_nested(& mdev->md_io_mutex, 0U); tmp___1 = lowmem_page_address(mdev->md_io_page); buffer = (struct meta_data_on_disk *)tmp___1; memset((void *)buffer, 0, 512UL); tmp___2 = drbd_get_capacity(mdev->this_bdev); tmp___3 = __fswab64((__u64 )tmp___2); buffer->la_size = tmp___3; i = 0; } goto ldv_49851; ldv_49850: { tmp___4 = __fswab64((mdev->ldev)->md.uuid[i]); buffer->uuid[i] = tmp___4; i = i + 1; } ldv_49851: ; if (i <= 3) { goto ldv_49850; } else { goto ldv_49852; } ldv_49852: { tmp___5 = __fswab32((mdev->ldev)->md.flags); buffer->flags = tmp___5; buffer->magic = 1795323011U; tmp___6 = __fswab32((mdev->ldev)->md.md_size_sect); buffer->md_size_sect = tmp___6; tmp___7 = __fswab32((__u32 )(mdev->ldev)->md.al_offset); buffer->al_offset = tmp___7; tmp___8 = __fswab32((mdev->act_log)->nr_elements); buffer->al_nr_extents = tmp___8; buffer->bm_bytes_per_bit = 1048576U; tmp___9 = __fswab64((mdev->ldev)->md.device_uuid); buffer->device_uuid = tmp___9; tmp___10 = __fswab32((__u32 )(mdev->ldev)->md.bm_offset); buffer->bm_offset = tmp___10; tmp___11 = __fswab32((__u32 )mdev->peer_max_bio_size); buffer->la_peer_max_bio_size = tmp___11; tmp___12 = drbd_md_ss__(mdev, mdev->ldev); } if ((unsigned long long )tmp___12 != (mdev->ldev)->md.md_offset) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( drbd_md_ss__(mdev, mdev->ldev) == mdev->ldev->md.md_offset ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3696); } } else { } { sector = (sector_t )(mdev->ldev)->md.md_offset; tmp___13 = drbd_md_sync_page_io(mdev, mdev->ldev, sector, 1); } if (tmp___13 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "meta data update failed!\n"); drbd_chk_io_error____1(mdev, 1, 1, "drbd_md_sync"); } } else { } { tmp___14 = drbd_get_capacity(mdev->this_bdev); (mdev->ldev)->md.la_size_sect = (u64 )tmp___14; mutex_unlock(& mdev->md_io_mutex); put_ldev(mdev); } return; } } int drbd_md_read(struct drbd_conf *mdev , struct drbd_backing_dev *bdev ) { struct meta_data_on_disk *buffer ; int i ; int rv ; int tmp ; void *tmp___0 ; int tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; __u32 tmp___8 ; __u32 tmp___9 ; __u32 tmp___10 ; __u64 tmp___11 ; __u64 tmp___12 ; __u32 tmp___13 ; __u32 tmp___14 ; __u64 tmp___15 ; int peer ; __u32 tmp___16 ; int __max1 ; int __max2 ; int tmp___17 ; { { rv = 101; tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )1); } if (tmp == 0) { return (118); } else { } { mutex_lock_nested(& mdev->md_io_mutex, 0U); tmp___0 = lowmem_page_address(mdev->md_io_page); buffer = (struct meta_data_on_disk *)tmp___0; tmp___1 = drbd_md_sync_page_io(mdev, bdev, (sector_t )bdev->md.md_offset, 0); } if (tmp___1 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Error while reading metadata.\n"); rv = 118; } goto err; } else { } { tmp___2 = __fswab32(buffer->magic); } if (tmp___2 != 2205418091U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Error while reading metadata, magic not found.\n"); rv = 119; } goto err; } else { } { tmp___4 = __fswab32(buffer->al_offset); } if (tmp___4 != (unsigned int )bdev->md.al_offset) { { tmp___3 = __fswab32(buffer->al_offset); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "unexpected al_offset: %d (expected %d)\n", tmp___3, bdev->md.al_offset); rv = 119; } goto err; } else { } { tmp___6 = __fswab32(buffer->bm_offset); } if (tmp___6 != (unsigned int )bdev->md.bm_offset) { { tmp___5 = __fswab32(buffer->bm_offset); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "unexpected bm_offset: %d (expected %d)\n", tmp___5, bdev->md.bm_offset); rv = 119; } goto err; } else { } { tmp___8 = __fswab32(buffer->md_size_sect); } if (tmp___8 != bdev->md.md_size_sect) { { tmp___7 = __fswab32(buffer->md_size_sect); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "unexpected md_size: %u (expected %u)\n", tmp___7, bdev->md.md_size_sect); rv = 119; } goto err; } else { } { tmp___10 = __fswab32(buffer->bm_bytes_per_bit); } if (tmp___10 != 4096U) { { tmp___9 = __fswab32(buffer->bm_bytes_per_bit); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "unexpected bm_bytes_per_bit: %u (expected %u)\n", tmp___9, 4096); rv = 119; } goto err; } else { } { tmp___11 = __fswab64(buffer->la_size); bdev->md.la_size_sect = tmp___11; i = 0; } goto ldv_49863; ldv_49862: { tmp___12 = __fswab64(buffer->uuid[i]); bdev->md.uuid[i] = tmp___12; i = i + 1; } ldv_49863: ; if (i <= 3) { goto ldv_49862; } else { goto ldv_49864; } ldv_49864: { tmp___13 = __fswab32(buffer->flags); bdev->md.flags = tmp___13; tmp___14 = __fswab32(buffer->al_nr_extents); mdev->sync_conf.al_extents = (int )tmp___14; tmp___15 = __fswab64(buffer->device_uuid); bdev->md.device_uuid = tmp___15; spin_lock_irq(& mdev->req_lock); } if ((int )mdev->state.ldv_38339.conn <= 9) { { tmp___16 = __fswab32(buffer->la_peer_max_bio_size); peer = (int )tmp___16; __max1 = peer; __max2 = 4096; } if (__max1 > __max2) { tmp___17 = __max1; } else { tmp___17 = __max2; } peer = tmp___17; mdev->peer_max_bio_size = peer; } else { } { spin_unlock_irq(& mdev->req_lock); } if (mdev->sync_conf.al_extents <= 6) { mdev->sync_conf.al_extents = 127; } else { } err: { mutex_unlock(& mdev->md_io_mutex); put_ldev(mdev); } return (rv); } } void drbd_md_mark_dirty(struct drbd_conf *mdev ) { int tmp ; { { tmp = test_and_set_bit(5, (unsigned long volatile *)(& mdev->flags)); } if (tmp == 0) { { mod_timer(& mdev->md_sync_timer, (unsigned long )jiffies + 1250UL); } } else { } return; } } static void drbd_uuid_move_history(struct drbd_conf *mdev ) { int i ; { i = 2; goto ldv_49877; ldv_49876: (mdev->ldev)->md.uuid[i + 1] = (mdev->ldev)->md.uuid[i]; i = i + 1; ldv_49877: ; if (i <= 2) { goto ldv_49876; } else { goto ldv_49878; } ldv_49878: ; return; } } void _drbd_uuid_set(struct drbd_conf *mdev , int idx , u64 val ) { { if (idx == 0) { if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { val = val | 1ULL; } else { val = val & 0x0ffffffffffffffeULL; } { drbd_set_ed_uuid(mdev, val); } } else { } { (mdev->ldev)->md.uuid[idx] = val; drbd_md_mark_dirty(mdev); } return; } } void drbd_uuid_set(struct drbd_conf *mdev , int idx , u64 val ) { { if ((mdev->ldev)->md.uuid[idx] != 0ULL) { { drbd_uuid_move_history(mdev); (mdev->ldev)->md.uuid[2] = (mdev->ldev)->md.uuid[idx]; } } else { } { _drbd_uuid_set(mdev, idx, val); } return; } } void drbd_uuid_new_current(struct drbd_conf *mdev ) { u64 val ; unsigned long long bm_uuid ; { bm_uuid = (mdev->ldev)->md.uuid[1]; if (bm_uuid != 0ULL) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "bm UUID was already set: %llX\n", bm_uuid); } } else { } { (mdev->ldev)->md.uuid[1] = (mdev->ldev)->md.uuid[0]; get_random_bytes((void *)(& val), 8); _drbd_uuid_set(mdev, 0, val); drbd_print_uuids(mdev, "new current UUID"); drbd_md_sync(mdev); } return; } } void drbd_uuid_set_bm(struct drbd_conf *mdev , u64 val ) { unsigned long long bm_uuid ; { if ((mdev->ldev)->md.uuid[1] == 0ULL) { if (val == 0ULL) { return; } else { } } else { } if (val == 0ULL) { { drbd_uuid_move_history(mdev); (mdev->ldev)->md.uuid[2] = (mdev->ldev)->md.uuid[1]; (mdev->ldev)->md.uuid[1] = 0ULL; } } else { bm_uuid = (mdev->ldev)->md.uuid[1]; if (bm_uuid != 0ULL) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "bm UUID was already set: %llX\n", bm_uuid); } } else { } (mdev->ldev)->md.uuid[1] = val & 0x0ffffffffffffffeULL; } { drbd_md_mark_dirty(mdev); } return; } } int drbd_bmio_set_n_write(struct drbd_conf *mdev ) { int rv ; int tmp ; { { rv = -5; tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )1); } if (tmp != 0) { { drbd_md_set_flag(mdev, 8); drbd_md_sync(mdev); drbd_bm_set_all(mdev); rv = drbd_bm_write(mdev); } if (rv == 0) { { drbd_md_clear_flag(mdev, 8); drbd_md_sync(mdev); } } else { } { put_ldev(mdev); } } else { } return (rv); } } int drbd_bmio_clear_n_write(struct drbd_conf *mdev ) { int rv ; int tmp ; { { rv = -5; drbd_resume_al(mdev); tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )1); } if (tmp != 0) { { drbd_bm_clear_all(mdev); rv = drbd_bm_write(mdev); put_ldev(mdev); } } else { } return (rv); } } static int w_bitmap_io(struct drbd_conf *mdev , struct drbd_work *w , int unused ) { struct bm_io_work *work ; struct drbd_work const *__mptr ; int rv ; int tmp ; int tmp___0 ; { { __mptr = (struct drbd_work const *)w; work = (struct bm_io_work *)__mptr; rv = -5; tmp = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); } if (tmp != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( atomic_read(&mdev->ap_bio_cnt) == 0 ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3951); } } else { } { tmp___0 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___0 != 0) { { drbd_bm_lock(mdev, work->why, work->flags); rv = (*(work->io_fn))(mdev); drbd_bm_unlock(mdev); put_ldev(mdev); } } else { } { clear_bit(16, (unsigned long volatile *)(& mdev->flags)); __asm__ volatile ("": : : "memory"); __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); } if ((unsigned long )work->done != (unsigned long )((void (*)(struct drbd_conf * , int ))0)) { { (*(work->done))(mdev, rv); } } else { } { clear_bit(17, (unsigned long volatile *)(& mdev->flags)); work->why = (char *)0; work->flags = (enum bm_flag )0; } return (1); } } void drbd_ldev_destroy(struct drbd_conf *mdev ) { { { lc_destroy(mdev->resync); mdev->resync = (struct lru_cache *)0; lc_destroy(mdev->act_log); mdev->act_log = (struct lru_cache *)0; drbd_free_bc(mdev->ldev); mdev->ldev = (struct drbd_backing_dev *)0; } if ((unsigned long )mdev->md_io_tmpp != (unsigned long )((struct page *)0)) { { __free_pages(mdev->md_io_tmpp, 0U); mdev->md_io_tmpp = (struct page *)0; } } else { } { clear_bit(18, (unsigned long volatile *)(& mdev->flags)); } return; } } static int w_go_diskless(struct drbd_conf *mdev , struct drbd_work *w , int unused ) { union drbd_state val ; union drbd_state mask ; { if ((unsigned int )*((unsigned char *)mdev + 2277UL) != 4U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.disk == D_FAILED ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 3993); } } else { } { val.i = 0U; val.ldv_38339.disk = (unsigned char)0; mask.i = 0U; mask.ldv_38339.disk = (unsigned char)15; drbd_force_state(mdev, mask, val); } return (1); } } void drbd_go_diskless(struct drbd_conf *mdev ) { int tmp ; { if ((unsigned int )*((unsigned char *)mdev + 2277UL) != 4U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.disk == D_FAILED ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 4004); } } else { } { tmp = test_and_set_bit(18, (unsigned long volatile *)(& mdev->flags)); } if (tmp == 0) { { drbd_queue_work(& mdev->data.work, & mdev->go_diskless); } } else { } return; } } void drbd_queue_bitmap_io(struct drbd_conf *mdev , int (*io_fn)(struct drbd_conf * ) , void (*done)(struct drbd_conf * , int ) , char *why , enum bm_flag flags ) { struct task_struct *tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { { tmp = get_current(); } if ((unsigned long )tmp != (unsigned long )mdev->worker.task) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( current == mdev->worker.task ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 4026); } } else { } { tmp___0 = constant_test_bit(17U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !test_bit(BITMAP_IO_QUEUED, &mdev->flags) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 4028); } } else { } { tmp___1 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___1 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !test_bit(BITMAP_IO, &mdev->flags) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 4029); } } else { } { tmp___2 = list_empty((struct list_head const *)(& mdev->bm_io_work.w.list)); } if (tmp___2 == 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->bm_io_work.w.list) ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 4030); } } else { } if ((unsigned long )mdev->bm_io_work.why != (unsigned long )((char *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "FIXME going to queue \'%s\' but \'%s\' still pending?\n", why, mdev->bm_io_work.why); } } else { } { mdev->bm_io_work.io_fn = io_fn; mdev->bm_io_work.done = done; mdev->bm_io_work.why = why; mdev->bm_io_work.flags = flags; spin_lock_irq(& mdev->req_lock); set_bit(16U, (unsigned long volatile *)(& mdev->flags)); tmp___4 = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); } if (tmp___4 == 0) { { tmp___3 = test_and_set_bit(17, (unsigned long volatile *)(& mdev->flags)); } if (tmp___3 == 0) { { drbd_queue_work(& mdev->data.work, & mdev->bm_io_work.w); } } else { } } else { } { spin_unlock_irq(& mdev->req_lock); } return; } } int drbd_bitmap_io(struct drbd_conf *mdev , int (*io_fn)(struct drbd_conf * ) , char *why , enum bm_flag flags ) { int rv ; struct task_struct *tmp ; { { tmp = get_current(); } if ((unsigned long )tmp == (unsigned long )mdev->worker.task) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( current != mdev->worker.task ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_main.c.p", 4063); } } else { } if (((unsigned int )flags & 1U) == 0U) { { drbd_suspend_io(mdev); } } else { } { drbd_bm_lock(mdev, why, flags); rv = (*io_fn)(mdev); drbd_bm_unlock(mdev); } if (((unsigned int )flags & 1U) == 0U) { { drbd_resume_io(mdev); } } else { } return (rv); } } void drbd_md_set_flag(struct drbd_conf *mdev , int flag ) { { if (((mdev->ldev)->md.flags & (u32 )flag) != (u32 )flag) { { drbd_md_mark_dirty(mdev); (mdev->ldev)->md.flags = (mdev->ldev)->md.flags | (u32 )flag; } } else { } return; } } void drbd_md_clear_flag(struct drbd_conf *mdev , int flag ) { { if (((mdev->ldev)->md.flags & (u32 )flag) != 0U) { { drbd_md_mark_dirty(mdev); (mdev->ldev)->md.flags = (mdev->ldev)->md.flags & (u32 )(~ flag); } } else { } return; } } int drbd_md_test_flag(struct drbd_backing_dev *bdev , int flag ) { { return ((bdev->md.flags & (u32 )flag) != 0U); } } static void md_sync_timer_fn(unsigned long data ) { struct drbd_conf *mdev ; { { mdev = (struct drbd_conf *)data; drbd_queue_work_front(& mdev->data.work, & mdev->md_sync_work); } return; } } static int w_md_sync(struct drbd_conf *mdev , struct drbd_work *w , int unused ) { { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "md_sync_timer expired! Worker calls drbd_md_sync().\n"); drbd_md_sync(mdev); } return (1); } } static unsigned long _drbd_fault_random(struct fault_random_state *rsp ) { long refresh ; unsigned long tmp ; __u32 tmp___0 ; { tmp = rsp->count; rsp->count = rsp->count - 1UL; if (tmp == 0UL) { { get_random_bytes((void *)(& refresh), 8); rsp->state = rsp->state + (unsigned long )refresh; rsp->count = 10000UL; } } else { } { rsp->state = rsp->state * 39916801UL + 479001701UL; tmp___0 = __fswahw32((__u32 )rsp->state); } return ((unsigned long )tmp___0); } } static char *_drbd_fault_str(unsigned int type ) { char *_faults[10U] ; char *tmp ; { _faults[0] = (char *)"Meta-data write"; _faults[1] = (char *)"Meta-data read"; _faults[2] = (char *)"Resync write"; _faults[3] = (char *)"Resync read"; _faults[4] = (char *)"Data write"; _faults[5] = (char *)"Data read"; _faults[6] = (char *)"Data read ahead"; _faults[7] = (char *)"BM allocation"; _faults[8] = (char *)"EE allocation"; _faults[9] = (char *)"receive data corruption"; if (type <= 9U) { tmp = _faults[type]; } else { tmp = (char *)"**Unknown**"; } return (tmp); } } unsigned int _drbd_insert_fault(struct drbd_conf *mdev , unsigned int type ) { struct fault_random_state rrs ; unsigned int ret ; unsigned int tmp ; unsigned long tmp___0 ; int tmp___1 ; char *tmp___2 ; int tmp___3 ; { rrs.state = 0UL; rrs.count = 0UL; if (fault_devs == 0) { goto _L; } else { { tmp = mdev_to_minor(mdev); } if ((fault_devs >> (int )tmp) & 1) { _L: { tmp___0 = _drbd_fault_random(& rrs); } if (tmp___0 % 100UL + 1UL <= (unsigned long )fault_rate) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } } ret = (unsigned int )tmp___1; if (ret != 0U) { { fault_count = fault_count + 1; tmp___3 = ___ratelimit(& drbd_ratelimit_state, "_drbd_insert_fault"); } if (tmp___3 != 0) { { tmp___2 = _drbd_fault_str(type); dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "***Simulating %s failure\n", tmp___2); } } else { } } else { } return (ret); } } char const *drbd_buildtag(void) { char buildtag[38U] ; { buildtag[0] = (char )'\000'; if ((int )((signed char )buildtag[0]) == 0) { if ((unsigned long )(& __this_module) != (unsigned long )((struct module *)0)) { { sprintf((char *)(& buildtag), "srcversion: %-24s", __this_module.srcversion); } } else { buildtag[0] = (char)98; } } else { } return ((char const *)(& buildtag)); } } int main(void) { struct block_device *var_group1 ; fmode_t var_drbd_open_68_p1 ; int res_drbd_open_68 ; struct gendisk *var_group2 ; fmode_t var_drbd_release_69_p1 ; struct notifier_block *var_group3 ; unsigned long var_drbd_notify_sys_75_p1 ; void *var_drbd_notify_sys_75_p2 ; unsigned long var_md_sync_timer_fn_104_p0 ; int ldv_s_drbd_ops_block_device_operations ; int tmp ; int tmp___0 ; int tmp___1 ; { { ldv_s_drbd_ops_block_device_operations = 0; LDV_IN_INTERRUPT = 1; ldv_initialize(); tmp = drbd_init(); } if (tmp != 0) { goto ldv_final; } else { } goto ldv_50053; ldv_50052: { tmp___0 = __VERIFIER_nondet_int(); } if (tmp___0 == 0) { goto case_0; } else if (tmp___0 == 1) { goto case_1; } else if (tmp___0 == 2) { goto case_2; } else if (tmp___0 == 3) { goto case_3; } else { goto switch_default; if (0) { case_0: ; if (ldv_s_drbd_ops_block_device_operations == 0) { { res_drbd_open_68 = drbd_open(var_group1, var_drbd_open_68_p1); ldv_check_return_value(res_drbd_open_68); } if (res_drbd_open_68 != 0) { goto ldv_module_exit; } else { } ldv_s_drbd_ops_block_device_operations = ldv_s_drbd_ops_block_device_operations + 1; } else { } goto ldv_50047; case_1: ; if (ldv_s_drbd_ops_block_device_operations == 1) { { drbd_release(var_group2, var_drbd_release_69_p1); ldv_s_drbd_ops_block_device_operations = 0; } } else { } goto ldv_50047; case_2: { drbd_notify_sys(var_group3, var_drbd_notify_sys_75_p1, var_drbd_notify_sys_75_p2); } goto ldv_50047; case_3: { md_sync_timer_fn(var_md_sync_timer_fn_104_p0); } goto ldv_50047; switch_default: ; goto ldv_50047; } else { } } ldv_50047: ; ldv_50053: { tmp___1 = __VERIFIER_nondet_int(); } if (tmp___1 != 0) { goto ldv_50052; } else if (ldv_s_drbd_ops_block_device_operations != 0) { goto ldv_50052; } else { goto ldv_50054; } ldv_50054: ; ldv_module_exit: { drbd_cleanup(); } ldv_final: { ldv_check_final_state(); } return 0; } } void ldv_module_put_1(struct module *ldv_func_arg1 ) { { { ldv_module_put(ldv_func_arg1); } return; } } void ldv_module_put_3(struct module *ldv_func_arg1 ) { { { ldv_module_put(ldv_func_arg1); } return; } } static char const *drbd_conn_s_names[24U] = { "StandAlone", "Disconnecting", "Unconnected", "Timeout", "BrokenPipe", "NetworkFailure", "ProtocolError", "TearDown", "WFConnection", "WFReportParams", "Connected", "StartingSyncS", "StartingSyncT", "WFBitMapS", "WFBitMapT", "WFSyncUUID", "SyncSource", "SyncTarget", "VerifyS", "VerifyT", "PausedSyncS", "PausedSyncT", "Ahead", "Behind"}; static char const *drbd_role_s_names[3U] = { "Unknown", "Primary", "Secondary"}; static char const *drbd_disk_s_names[9U] = { "Diskless", "Attaching", "Failed", "Negotiating", "Inconsistent", "Outdated", "DUnknown", "Consistent", "UpToDate"}; static char const *drbd_state_sw_errors[20U] = { (char const *)0, "Multiple primaries not allowed by config", "Need access to UpToDate data", (char const *)0, "Can not resync without local disk", "Can not resync without remote disk", "Refusing to be Outdated while Connected", "Refusing to be Primary while peer is not outdated", "Can not start OV/resync since it is already active", "Can not disconnect a StandAlone device", "State change was refused by peer node", "Device is diskless, the requested operation requires a disk", "Device is held open by someone", "Have no net/connection configuration", "Need a verify algorithm to start online verify", "Need a connection to start verify or resync", "Disk state is lower than outdated", "Peer does not support protocol", "In transient state, retry after next state change", "Concurrent state changes detected and aborted"}; char const *drbd_conn_str(enum drbd_conns s ) { char const *tmp ; { if ((unsigned int )s <= 23U) { tmp = drbd_conn_s_names[(unsigned int )s]; } else { tmp = "TOO_LARGE"; } return (tmp); } } char const *drbd_role_str(enum drbd_role s ) { char const *tmp ; { if ((unsigned int )s <= 2U) { tmp = drbd_role_s_names[(unsigned int )s]; } else { tmp = "TOO_LARGE"; } return (tmp); } } char const *drbd_disk_str(enum drbd_disk_state s ) { char const *tmp ; { if ((unsigned int )s <= 8U) { tmp = drbd_disk_s_names[(unsigned int )s]; } else { tmp = "TOO_LARGE"; } return (tmp); } } char const *drbd_set_st_err_str(enum drbd_state_rv err ) { char const *tmp ; char const *tmp___0 ; { if ((int )err >= -19) { if ((int )err < 0) { tmp = drbd_state_sw_errors[- ((int )err)]; } else { tmp = "TOO_LARGE"; } tmp___0 = tmp; } else { tmp___0 = "TOO_SMALL"; } return (tmp___0); } } __inline static __u64 __le64_to_cpup(__le64 const *p ) { { return ((__u64 )*p); } } __inline static __u32 __le32_to_cpup(__le32 const *p ) { { return ((__u32 )*p); } } __inline static __u16 __le16_to_cpup(__le16 const *p ) { { return ((__u16 )*p); } } extern int snprintf(char * , size_t , char const * , ...) ; extern int __bitmap_equal(unsigned long const * , unsigned long const * , int ) ; extern int __bitmap_parse(char const * , unsigned int , int , unsigned long * , int ) ; __inline static void bitmap_copy(unsigned long *dst , unsigned long const *src , int nbits ) { int len ; size_t __len ; void *__ret ; { { len = (int )((unsigned int )(((unsigned long )nbits + 63UL) / 64UL) * 8U); __len = (size_t )len; __ret = __builtin_memcpy((void *)dst, (void const *)src, __len); } return; } } __inline static int bitmap_equal(unsigned long const *src1 , unsigned long const *src2 , int nbits ) { int tmp___0 ; { { tmp___0 = __bitmap_equal(src1, src2, nbits); } return (tmp___0); } } __inline static bool cpumask_equal(struct cpumask const *src1p , struct cpumask const *src2p ) { int tmp ; { { tmp = bitmap_equal((unsigned long const *)(& src1p->bits), (unsigned long const *)(& src2p->bits), nr_cpu_ids); } return ((bool )(tmp != 0)); } } __inline static void cpumask_copy(struct cpumask *dstp , struct cpumask const *srcp ) { { { bitmap_copy((unsigned long *)(& dstp->bits), (unsigned long const *)(& srcp->bits), nr_cpu_ids); } return; } } extern struct subprocess_info *call_usermodehelper_setup(char * , char ** , char ** , gfp_t ) ; extern void call_usermodehelper_setfns(struct subprocess_info * , int (*)(struct subprocess_info * , struct cred * ) , void (*)(struct subprocess_info * ) , void * ) ; extern int call_usermodehelper_exec(struct subprocess_info * , enum umh_wait ) ; __inline static int call_usermodehelper_fns(char *path , char **argv , char **envp , enum umh_wait wait , int (*init)(struct subprocess_info * , struct cred * ) , void (*cleanup)(struct subprocess_info * ) , void *data ) { struct subprocess_info *info ; gfp_t gfp_mask ; unsigned int tmp ; int tmp___0 ; { if ((int )wait == -1) { tmp = 32U; } else { tmp = 208U; } { gfp_mask = tmp; info = call_usermodehelper_setup(path, argv, envp, gfp_mask); } if ((unsigned long )info == (unsigned long )((struct subprocess_info *)0)) { return (-12); } else { } { call_usermodehelper_setfns(info, init, cleanup, data); tmp___0 = call_usermodehelper_exec(info, wait); } return (tmp___0); } } __inline static int call_usermodehelper(char *path , char **argv , char **envp , enum umh_wait wait ) { int tmp ; { { tmp = call_usermodehelper_fns(path, argv, envp, wait, (int (*)(struct subprocess_info * , struct cred * ))0, (void (*)(struct subprocess_info * ))0, (void *)0); } return (tmp); } } extern int kobject_uevent(struct kobject * , enum kobject_action ) ; __inline static int ldv_try_module_get_1(struct module *module ) ; extern struct block_device *blkdev_get_by_path(char const * , fmode_t , void * ) ; extern int cn_add_callback(struct cb_id * , char const * , void (*)(struct cn_msg * , struct netlink_skb_parms * ) ) ; extern void cn_del_callback(struct cb_id * ) ; extern int cn_netlink_send(struct cn_msg * , u32 , gfp_t ) ; extern void add_disk(struct gendisk * ) ; extern void blk_queue_max_segments(struct request_queue * , unsigned short ) ; extern void blk_queue_logical_block_size(struct request_queue * , unsigned short ) ; extern void blk_queue_stack_limits(struct request_queue * , struct request_queue * ) ; extern void blk_queue_segment_boundary(struct request_queue * , unsigned long ) ; extern struct lru_cache *lc_create(char const * , struct kmem_cache * , unsigned int , size_t , size_t ) ; enum drbd_disk_state drbd_try_outdate_peer(struct drbd_conf *mdev ) ; __inline static sector_t drbd_get_max_capacity___1(struct drbd_backing_dev *bdev ) { sector_t s ; sector_t __min1 ; sector_t __min2 ; sector_t tmp___0 ; sector_t tmp___1 ; sector_t tmp___2 ; sector_t __min1___0 ; sector_t __min2___0 ; sector_t tmp___3 ; sector_t tmp___4 ; sector_t __min1___1 ; sector_t __min2___1 ; sector_t tmp___5 ; sector_t __min1___2 ; sector_t __min2___2 ; sector_t tmp___6 ; sector_t tmp___7 ; { if (bdev->dc.meta_dev_idx == -1) { goto case_neg_1; } else if (bdev->dc.meta_dev_idx == -3) { goto case_neg_3; } else if (bdev->dc.meta_dev_idx == -2) { goto case_neg_2; } else { goto switch_default; if (0) { case_neg_1: ; case_neg_3: { tmp___2 = drbd_get_capacity(bdev->backing_bdev); } if (tmp___2 != 0UL) { { __min1 = 2251799813685248UL; tmp___0 = drbd_md_first_sector(bdev); __min2 = tmp___0; } if (__min1 < __min2) { tmp___1 = __min1; } else { tmp___1 = __min2; } s = tmp___1; } else { s = 0UL; } goto ldv_47715; case_neg_2: { __min1___0 = 2251799813685248UL; tmp___3 = drbd_get_capacity(bdev->backing_bdev); __min2___0 = tmp___3; } if (__min1___0 < __min2___0) { tmp___4 = __min1___0; } else { tmp___4 = __min2___0; } s = tmp___4; __min1___1 = s; __min2___1 = (unsigned long )(bdev->md.md_size_sect - (u32 )bdev->md.bm_offset) << 15; if (__min1___1 < __min2___1) { tmp___5 = __min1___1; } else { tmp___5 = __min2___1; } s = tmp___5; goto ldv_47715; switch_default: { __min1___2 = 8587575296UL; tmp___6 = drbd_get_capacity(bdev->backing_bdev); __min2___2 = tmp___6; } if (__min1___2 < __min2___2) { tmp___7 = __min1___2; } else { tmp___7 = __min2___2; } s = tmp___7; } else { } } ldv_47715: ; return (s); } } __inline static u16 get_unaligned_le16(void const *p ) { __u16 tmp ; { { tmp = __le16_to_cpup((__le16 const *)p); } return (tmp); } } __inline static u32 get_unaligned_le32(void const *p ) { __u32 tmp ; { { tmp = __le32_to_cpup((__le32 const *)p); } return (tmp); } } __inline static u64 get_unaligned_le64(void const *p ) { __u64 tmp ; { { tmp = __le64_to_cpup((__le64 const *)p); } return (tmp); } } __inline static void put_unaligned_le16(u16 val , void *p ) { { *((__le16 *)p) = val; return; } } __inline static void put_unaligned_le32(u32 val , void *p ) { { *((__le32 *)p) = val; return; } } __inline static void put_unaligned_le64(u64 val , void *p ) { { *((__le64 *)p) = val; return; } } extern void __bad_unaligned_access_size(void) ; static struct tag const tag_descriptions[85U] = { {(char const *)0, 0, 0}, {"primary_force", 32768, 4}, {"disk_size", 16384, 8}, {"backing_dev", 57344, 128}, {"meta_dev", 57344, 128}, {"meta_dev_idx", 8192, 4}, {"on_io_error", 0, 4}, {"fencing", 0, 4}, {"my_addr", 57344, 128}, {"peer_addr", 57344, 128}, {"shared_secret", 49152, 64}, {"cram_hmac_alg", 49152, 64}, {(char const *)0, 0, 0}, {(char const *)0, 0, 0}, {"timeout", 0, 4}, {"wire_protocol", 8192, 4}, {"try_connect_int", 0, 4}, {"ping_int", 0, 4}, {"max_epoch_size", 0, 4}, {"max_buffers", 0, 4}, {"unplug_watermark", 0, 4}, {"sndbuf_size", 0, 4}, {"ko_count", 0, 4}, {(char const *)0, 0, 0}, {"after_sb_0p", 0, 4}, {"after_sb_1p", 0, 4}, {"after_sb_2p", 0, 4}, {"want_lose", 32768, 4}, {"two_primaries", 32768, 4}, {"resize_size", 16384, 8}, {"rate", 0, 4}, {"after", 0, 4}, {"al_extents", 0, 4}, {"state_i", 0, 4}, {"uuids", 49152, 32}, {"uuids_flags", 0, 4}, {"use_degraded", 32768, 4}, {"use_bmbv", 32768, 4}, {"helper", 49152, 32}, {"rr_conflict", 0, 4}, {"ping_timeo", 0, 4}, {"always_asbp", 32768, 4}, {(char const *)0, 0, 0}, {"sync_progress", 0, 4}, {"integrity_alg", 49152, 64}, {"dump_ee_reason", 49152, 32}, {"seen_digest", 49152, 64}, {"calc_digest", 49152, 64}, {"ee_sector", 16384, 8}, {"ee_block_id", 16384, 8}, {"ee_data", 49152, 32768}, {"cpu_mask", 49152, 32}, {"verify_alg", 49152, 64}, {"no_disk_flush", 32768, 4}, {"no_md_flush", 32768, 4}, {(char const *)0, 0, 0}, {"max_bio_bvecs", 0, 4}, {"no_disk_barrier", 32768, 4}, {"no_disk_drain", 32768, 4}, {(char const *)0, 0, 0}, {"mind_af", 40960, 4}, {"no_cork", 32768, 4}, {"auto_sndbuf_size", 40960, 4}, {"clear_bm", 40960, 4}, {"csums_alg", 49152, 64}, {"use_rle", 32768, 4}, {"start_sector", 16384, 8}, {"rcvbuf_size", 0, 4}, {"resize_force", 32768, 4}, {"no_resync", 40960, 4}, {"dry_run", 40960, 4}, {(char const *)0, 0, 0}, {(char const *)0, 0, 0}, {(char const *)0, 0, 0}, {(char const *)0, 0, 0}, {"on_no_data", 0, 4}, {"c_plan_ahead", 0, 4}, {"c_delay_target", 0, 4}, {"c_fill_target", 0, 4}, {"c_max_rate", 0, 4}, {"c_min_rate", 0, 4}, {"on_congestion", 0, 4}, {"cong_fill", 0, 4}, {"cong_extents", 0, 4}, {"force", 32768, 4}}; static unsigned short *tl_add_blob(unsigned short *tl , enum drbd_tags tag , void const *data , int len ) ; static unsigned short *tl_add_str(unsigned short *tl , enum drbd_tags tag , char const *str ) ; static unsigned short *tl_add_int(unsigned short *tl , enum drbd_tags tag , void const *val ) ; static char *drbd_m_holder = (char *)"Hands off! this is DRBD\'s meta data device."; static int primary_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct primary *arg ) ; static int primary_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct primary *arg ) { int tag ; int dlen ; unsigned short *tmp ; u16 tmp___0 ; unsigned short *tmp___1 ; u16 tmp___2 ; { goto ldv_48486; ldv_48485: { tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; } if ((tag & 8191) == 1) { goto case_1; } else { goto switch_default; if (0) { case_1: arg->primary_force = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48483; switch_default: ; if ((tag & 8192) != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); } return (0); } else { } } else { } } ldv_48483: tags = tags + (unsigned long )dlen; ldv_48486: { tmp___1 = tags; tags = tags + 1; tmp___2 = get_unaligned_le16((void const *)tmp___1); tag = (int )tmp___2; } if (tag != 0) { goto ldv_48485; } else { goto ldv_48487; } ldv_48487: ; return (1); } } static int disk_conf_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct disk_conf *arg ) ; static int disk_conf_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct disk_conf *arg ) { int tag ; int dlen ; unsigned short *tmp ; u16 tmp___0 ; size_t __len ; size_t __min1 ; size_t __min2 ; size_t tmp___1 ; void *__ret ; size_t __len___0 ; size_t __min1___0 ; size_t __min2___0 ; size_t tmp___2 ; void *__ret___0 ; u32 tmp___3 ; u32 tmp___4 ; u32 tmp___5 ; u32 tmp___6 ; unsigned short *tmp___7 ; u16 tmp___8 ; { goto ldv_48547; ldv_48546: { tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; } if ((tag & 8191) == 2) { goto case_2; } else if ((tag & 8191) == 3) { goto case_3; } else if ((tag & 8191) == 4) { goto case_4; } else if ((tag & 8191) == 5) { goto case_5; } else if ((tag & 8191) == 6) { goto case_6; } else if ((tag & 8191) == 7) { goto case_7; } else if ((tag & 8191) == 37) { goto case_37; } else if ((tag & 8191) == 53) { goto case_53; } else if ((tag & 8191) == 54) { goto case_54; } else if ((tag & 8191) == 56) { goto case_56; } else if ((tag & 8191) == 57) { goto case_57; } else if ((tag & 8191) == 58) { goto case_58; } else { goto switch_default; if (0) { case_2: { arg->disk_size = get_unaligned_le64((void const *)tags); } goto ldv_48515; case_3: ; if (dlen > 128) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "arg too long: %s (%u wanted, max len: %u bytes)\n", (char *)"backing_dev", dlen, 128U); } return (0); } else { } arg->backing_dev_len = dlen; __min1 = (size_t )dlen; __min2 = 128UL; if (__min1 < __min2) { tmp___1 = __min1; } else { tmp___1 = __min2; } { __len = tmp___1; __ret = __builtin_memcpy((void *)(& arg->backing_dev), (void const *)tags, __len); } goto ldv_48515; case_4: ; if (dlen > 128) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "arg too long: %s (%u wanted, max len: %u bytes)\n", (char *)"meta_dev", dlen, 128U); } return (0); } else { } arg->meta_dev_len = dlen; __min1___0 = (size_t )dlen; __min2___0 = 128UL; if (__min1___0 < __min2___0) { tmp___2 = __min1___0; } else { tmp___2 = __min2___0; } { __len___0 = tmp___2; __ret___0 = __builtin_memcpy((void *)(& arg->meta_dev), (void const *)tags, __len___0); } goto ldv_48515; case_5: { tmp___3 = get_unaligned_le32((void const *)tags); arg->meta_dev_idx = (int )tmp___3; } goto ldv_48515; case_6: { tmp___4 = get_unaligned_le32((void const *)tags); arg->on_io_error = (int )tmp___4; } goto ldv_48515; case_7: { tmp___5 = get_unaligned_le32((void const *)tags); arg->fencing = (int )tmp___5; } goto ldv_48515; case_37: arg->use_bmbv = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48515; case_53: arg->no_disk_flush = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48515; case_54: arg->no_md_flush = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48515; case_56: { tmp___6 = get_unaligned_le32((void const *)tags); arg->max_bio_bvecs = (int )tmp___6; } goto ldv_48515; case_57: arg->no_disk_barrier = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48515; case_58: arg->no_disk_drain = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48515; switch_default: ; if ((tag & 8192) != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); } return (0); } else { } } else { } } ldv_48515: tags = tags + (unsigned long )dlen; ldv_48547: { tmp___7 = tags; tags = tags + 1; tmp___8 = get_unaligned_le16((void const *)tmp___7); tag = (int )tmp___8; } if (tag != 0) { goto ldv_48546; } else { goto ldv_48548; } ldv_48548: ; return (1); } } static int net_conf_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct net_conf *arg ) ; static int net_conf_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct net_conf *arg ) { int tag ; int dlen ; unsigned short *tmp ; u16 tmp___0 ; size_t __len ; size_t __min1 ; size_t __min2 ; size_t tmp___1 ; void *__ret ; size_t __len___0 ; size_t __min1___0 ; size_t __min2___0 ; size_t tmp___2 ; void *__ret___0 ; size_t __len___1 ; size_t __min1___1 ; size_t __min2___1 ; size_t tmp___3 ; void *__ret___1 ; size_t __len___2 ; size_t __min1___2 ; size_t __min2___2 ; size_t tmp___4 ; void *__ret___2 ; size_t __len___3 ; size_t __min1___3 ; size_t __min2___3 ; size_t tmp___5 ; void *__ret___3 ; u32 tmp___6 ; u32 tmp___7 ; u32 tmp___8 ; u32 tmp___9 ; u32 tmp___10 ; u32 tmp___11 ; u32 tmp___12 ; u32 tmp___13 ; u32 tmp___14 ; u32 tmp___15 ; u32 tmp___16 ; u32 tmp___17 ; u32 tmp___18 ; u32 tmp___19 ; u32 tmp___20 ; u32 tmp___21 ; u32 tmp___22 ; u32 tmp___23 ; unsigned short *tmp___24 ; u16 tmp___25 ; { goto ldv_48653; ldv_48652: { tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; } if ((tag & 8191) == 8) { goto case_8; } else if ((tag & 8191) == 9) { goto case_9; } else if ((tag & 8191) == 10) { goto case_10; } else if ((tag & 8191) == 11) { goto case_11; } else if ((tag & 8191) == 44) { goto case_44; } else if ((tag & 8191) == 14) { goto case_14; } else if ((tag & 8191) == 15) { goto case_15; } else if ((tag & 8191) == 16) { goto case_16; } else if ((tag & 8191) == 17) { goto case_17; } else if ((tag & 8191) == 18) { goto case_18; } else if ((tag & 8191) == 19) { goto case_19; } else if ((tag & 8191) == 20) { goto case_20; } else if ((tag & 8191) == 21) { goto case_21; } else if ((tag & 8191) == 22) { goto case_22; } else if ((tag & 8191) == 24) { goto case_24; } else if ((tag & 8191) == 25) { goto case_25; } else if ((tag & 8191) == 26) { goto case_26; } else if ((tag & 8191) == 39) { goto case_39; } else if ((tag & 8191) == 40) { goto case_40; } else if ((tag & 8191) == 67) { goto case_67; } else if ((tag & 8191) == 81) { goto case_81; } else if ((tag & 8191) == 82) { goto case_82; } else if ((tag & 8191) == 83) { goto case_83; } else if ((tag & 8191) == 60) { goto case_60; } else if ((tag & 8191) == 27) { goto case_27; } else if ((tag & 8191) == 28) { goto case_28; } else if ((tag & 8191) == 41) { goto case_41; } else if ((tag & 8191) == 61) { goto case_61; } else if ((tag & 8191) == 62) { goto case_62; } else if ((tag & 8191) == 70) { goto case_70; } else { goto switch_default; if (0) { case_8: ; if (dlen > 128) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "arg too long: %s (%u wanted, max len: %u bytes)\n", (char *)"my_addr", dlen, 128U); } return (0); } else { } arg->my_addr_len = dlen; __min1 = (size_t )dlen; __min2 = 128UL; if (__min1 < __min2) { tmp___1 = __min1; } else { tmp___1 = __min2; } { __len = tmp___1; __ret = __builtin_memcpy((void *)(& arg->my_addr), (void const *)tags, __len); } goto ldv_48585; case_9: ; if (dlen > 128) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "arg too long: %s (%u wanted, max len: %u bytes)\n", (char *)"peer_addr", dlen, 128U); } return (0); } else { } arg->peer_addr_len = dlen; __min1___0 = (size_t )dlen; __min2___0 = 128UL; if (__min1___0 < __min2___0) { tmp___2 = __min1___0; } else { tmp___2 = __min2___0; } { __len___0 = tmp___2; __ret___0 = __builtin_memcpy((void *)(& arg->peer_addr), (void const *)tags, __len___0); } goto ldv_48585; case_10: ; if (dlen > 64) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "arg too long: %s (%u wanted, max len: %u bytes)\n", (char *)"shared_secret", dlen, 64U); } return (0); } else { } arg->shared_secret_len = dlen; __min1___1 = (size_t )dlen; __min2___1 = 64UL; if (__min1___1 < __min2___1) { tmp___3 = __min1___1; } else { tmp___3 = __min2___1; } { __len___1 = tmp___3; __ret___1 = __builtin_memcpy((void *)(& arg->shared_secret), (void const *)tags, __len___1); } goto ldv_48585; case_11: ; if (dlen > 64) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "arg too long: %s (%u wanted, max len: %u bytes)\n", (char *)"cram_hmac_alg", dlen, 64U); } return (0); } else { } arg->cram_hmac_alg_len = dlen; __min1___2 = (size_t )dlen; __min2___2 = 64UL; if (__min1___2 < __min2___2) { tmp___4 = __min1___2; } else { tmp___4 = __min2___2; } { __len___2 = tmp___4; __ret___2 = __builtin_memcpy((void *)(& arg->cram_hmac_alg), (void const *)tags, __len___2); } goto ldv_48585; case_44: ; if (dlen > 64) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "arg too long: %s (%u wanted, max len: %u bytes)\n", (char *)"integrity_alg", dlen, 64U); } return (0); } else { } arg->integrity_alg_len = dlen; __min1___3 = (size_t )dlen; __min2___3 = 64UL; if (__min1___3 < __min2___3) { tmp___5 = __min1___3; } else { tmp___5 = __min2___3; } { __len___3 = tmp___5; __ret___3 = __builtin_memcpy((void *)(& arg->integrity_alg), (void const *)tags, __len___3); } goto ldv_48585; case_14: { tmp___6 = get_unaligned_le32((void const *)tags); arg->timeout = (int )tmp___6; } goto ldv_48585; case_15: { tmp___7 = get_unaligned_le32((void const *)tags); arg->wire_protocol = (int )tmp___7; } goto ldv_48585; case_16: { tmp___8 = get_unaligned_le32((void const *)tags); arg->try_connect_int = (int )tmp___8; } goto ldv_48585; case_17: { tmp___9 = get_unaligned_le32((void const *)tags); arg->ping_int = (int )tmp___9; } goto ldv_48585; case_18: { tmp___10 = get_unaligned_le32((void const *)tags); arg->max_epoch_size = (int )tmp___10; } goto ldv_48585; case_19: { tmp___11 = get_unaligned_le32((void const *)tags); arg->max_buffers = (int )tmp___11; } goto ldv_48585; case_20: { tmp___12 = get_unaligned_le32((void const *)tags); arg->unplug_watermark = (int )tmp___12; } goto ldv_48585; case_21: { tmp___13 = get_unaligned_le32((void const *)tags); arg->sndbuf_size = (int )tmp___13; } goto ldv_48585; case_22: { tmp___14 = get_unaligned_le32((void const *)tags); arg->ko_count = (int )tmp___14; } goto ldv_48585; case_24: { tmp___15 = get_unaligned_le32((void const *)tags); arg->after_sb_0p = (int )tmp___15; } goto ldv_48585; case_25: { tmp___16 = get_unaligned_le32((void const *)tags); arg->after_sb_1p = (int )tmp___16; } goto ldv_48585; case_26: { tmp___17 = get_unaligned_le32((void const *)tags); arg->after_sb_2p = (int )tmp___17; } goto ldv_48585; case_39: { tmp___18 = get_unaligned_le32((void const *)tags); arg->rr_conflict = (int )tmp___18; } goto ldv_48585; case_40: { tmp___19 = get_unaligned_le32((void const *)tags); arg->ping_timeo = (int )tmp___19; } goto ldv_48585; case_67: { tmp___20 = get_unaligned_le32((void const *)tags); arg->rcvbuf_size = (int )tmp___20; } goto ldv_48585; case_81: { tmp___21 = get_unaligned_le32((void const *)tags); arg->on_congestion = (int )tmp___21; } goto ldv_48585; case_82: { tmp___22 = get_unaligned_le32((void const *)tags); arg->cong_fill = (int )tmp___22; } goto ldv_48585; case_83: { tmp___23 = get_unaligned_le32((void const *)tags); arg->cong_extents = (int )tmp___23; } goto ldv_48585; case_60: arg->mind_af = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48585; case_27: arg->want_lose = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48585; case_28: arg->two_primaries = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48585; case_41: arg->always_asbp = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48585; case_61: arg->no_cork = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48585; case_62: arg->auto_sndbuf_size = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48585; case_70: arg->dry_run = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48585; switch_default: ; if ((tag & 8192) != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); } return (0); } else { } } else { } } ldv_48585: tags = tags + (unsigned long )dlen; ldv_48653: { tmp___24 = tags; tags = tags + 1; tmp___25 = get_unaligned_le16((void const *)tmp___24); tag = (int )tmp___25; } if (tag != 0) { goto ldv_48652; } else { goto ldv_48654; } ldv_48654: ; return (1); } } static int disconnect_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct disconnect *arg ) ; static int disconnect_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct disconnect *arg ) { int tag ; int dlen ; unsigned short *tmp ; u16 tmp___0 ; unsigned short *tmp___1 ; u16 tmp___2 ; { goto ldv_48670; ldv_48669: { tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; } if ((tag & 8191) == 84) { goto case_84; } else { goto switch_default; if (0) { case_84: arg->force = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48667; switch_default: ; if ((tag & 8192) != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); } return (0); } else { } } else { } } ldv_48667: tags = tags + (unsigned long )dlen; ldv_48670: { tmp___1 = tags; tags = tags + 1; tmp___2 = get_unaligned_le16((void const *)tmp___1); tag = (int )tmp___2; } if (tag != 0) { goto ldv_48669; } else { goto ldv_48671; } ldv_48671: ; return (1); } } static int resize_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct resize *arg ) ; static int resize_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct resize *arg ) { int tag ; int dlen ; unsigned short *tmp ; u16 tmp___0 ; unsigned short *tmp___1 ; u16 tmp___2 ; { goto ldv_48689; ldv_48688: { tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; } if ((tag & 8191) == 29) { goto case_29; } else if ((tag & 8191) == 68) { goto case_68; } else if ((tag & 8191) == 69) { goto case_69; } else { goto switch_default; if (0) { case_29: { arg->resize_size = get_unaligned_le64((void const *)tags); } goto ldv_48684; case_68: arg->resize_force = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48684; case_69: arg->no_resync = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48684; switch_default: ; if ((tag & 8192) != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); } return (0); } else { } } else { } } ldv_48684: tags = tags + (unsigned long )dlen; ldv_48689: { tmp___1 = tags; tags = tags + 1; tmp___2 = get_unaligned_le16((void const *)tmp___1); tag = (int )tmp___2; } if (tag != 0) { goto ldv_48688; } else { goto ldv_48690; } ldv_48690: ; return (1); } } static int syncer_conf_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct syncer_conf *arg ) ; static int syncer_conf_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct syncer_conf *arg ) { int tag ; int dlen ; unsigned short *tmp ; u16 tmp___0 ; u32 tmp___1 ; u32 tmp___2 ; u32 tmp___3 ; size_t __len ; size_t __min1 ; size_t __min2 ; size_t tmp___4 ; void *__ret ; size_t __len___0 ; size_t __min1___0 ; size_t __min2___0 ; size_t tmp___5 ; void *__ret___0 ; size_t __len___1 ; size_t __min1___1 ; size_t __min2___1 ; size_t tmp___6 ; void *__ret___1 ; u32 tmp___7 ; u32 tmp___8 ; u32 tmp___9 ; u32 tmp___10 ; u32 tmp___11 ; u32 tmp___12 ; unsigned short *tmp___13 ; u16 tmp___14 ; { goto ldv_48745; ldv_48744: { tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; } if ((tag & 8191) == 30) { goto case_30; } else if ((tag & 8191) == 31) { goto case_31; } else if ((tag & 8191) == 32) { goto case_32; } else if ((tag & 8191) == 52) { goto case_52; } else if ((tag & 8191) == 51) { goto case_51; } else if ((tag & 8191) == 64) { goto case_64; } else if ((tag & 8191) == 65) { goto case_65; } else if ((tag & 8191) == 75) { goto case_75; } else if ((tag & 8191) == 76) { goto case_76; } else if ((tag & 8191) == 77) { goto case_77; } else if ((tag & 8191) == 78) { goto case_78; } else if ((tag & 8191) == 79) { goto case_79; } else if ((tag & 8191) == 80) { goto case_80; } else { goto switch_default; if (0) { case_30: { tmp___1 = get_unaligned_le32((void const *)tags); arg->rate = (int )tmp___1; } goto ldv_48703; case_31: { tmp___2 = get_unaligned_le32((void const *)tags); arg->after = (int )tmp___2; } goto ldv_48703; case_32: { tmp___3 = get_unaligned_le32((void const *)tags); arg->al_extents = (int )tmp___3; } goto ldv_48703; case_52: ; if (dlen > 64) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "arg too long: %s (%u wanted, max len: %u bytes)\n", (char *)"verify_alg", dlen, 64U); } return (0); } else { } arg->verify_alg_len = dlen; __min1 = (size_t )dlen; __min2 = 64UL; if (__min1 < __min2) { tmp___4 = __min1; } else { tmp___4 = __min2; } { __len = tmp___4; __ret = __builtin_memcpy((void *)(& arg->verify_alg), (void const *)tags, __len); } goto ldv_48703; case_51: ; if (dlen > 32) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "arg too long: %s (%u wanted, max len: %u bytes)\n", (char *)"cpu_mask", dlen, 32U); } return (0); } else { } arg->cpu_mask_len = dlen; __min1___0 = (size_t )dlen; __min2___0 = 32UL; if (__min1___0 < __min2___0) { tmp___5 = __min1___0; } else { tmp___5 = __min2___0; } { __len___0 = tmp___5; __ret___0 = __builtin_memcpy((void *)(& arg->cpu_mask), (void const *)tags, __len___0); } goto ldv_48703; case_64: ; if (dlen > 64) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "arg too long: %s (%u wanted, max len: %u bytes)\n", (char *)"csums_alg", dlen, 64U); } return (0); } else { } arg->csums_alg_len = dlen; __min1___1 = (size_t )dlen; __min2___1 = 64UL; if (__min1___1 < __min2___1) { tmp___6 = __min1___1; } else { tmp___6 = __min2___1; } { __len___1 = tmp___6; __ret___1 = __builtin_memcpy((void *)(& arg->csums_alg), (void const *)tags, __len___1); } goto ldv_48703; case_65: arg->use_rle = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_48703; case_75: { tmp___7 = get_unaligned_le32((void const *)tags); arg->on_no_data = (int )tmp___7; } goto ldv_48703; case_76: { tmp___8 = get_unaligned_le32((void const *)tags); arg->c_plan_ahead = (int )tmp___8; } goto ldv_48703; case_77: { tmp___9 = get_unaligned_le32((void const *)tags); arg->c_delay_target = (int )tmp___9; } goto ldv_48703; case_78: { tmp___10 = get_unaligned_le32((void const *)tags); arg->c_fill_target = (int )tmp___10; } goto ldv_48703; case_79: { tmp___11 = get_unaligned_le32((void const *)tags); arg->c_max_rate = (int )tmp___11; } goto ldv_48703; case_80: { tmp___12 = get_unaligned_le32((void const *)tags); arg->c_min_rate = (int )tmp___12; } goto ldv_48703; switch_default: ; if ((tag & 8192) != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); } return (0); } else { } } else { } } ldv_48703: tags = tags + (unsigned long )dlen; ldv_48745: { tmp___13 = tags; tags = tags + 1; tmp___14 = get_unaligned_le16((void const *)tmp___13); tag = (int )tmp___14; } if (tag != 0) { goto ldv_48744; } else { goto ldv_48746; } ldv_48746: ; return (1); } } static int start_ov_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct start_ov *arg ) ; static int start_ov_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct start_ov *arg ) { int tag ; int dlen ; unsigned short *tmp ; u16 tmp___0 ; unsigned short *tmp___1 ; u16 tmp___2 ; { goto ldv_49044; ldv_49043: { tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; } if ((tag & 8191) == 66) { goto case_66; } else { goto switch_default; if (0) { case_66: { arg->start_sector = get_unaligned_le64((void const *)tags); } goto ldv_49041; switch_default: ; if ((tag & 8192) != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); } return (0); } else { } } else { } } ldv_49041: tags = tags + (unsigned long )dlen; ldv_49044: { tmp___1 = tags; tags = tags + 1; tmp___2 = get_unaligned_le16((void const *)tmp___1); tag = (int )tmp___2; } if (tag != 0) { goto ldv_49043; } else { goto ldv_49045; } ldv_49045: ; return (1); } } static int new_c_uuid_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct new_c_uuid *arg ) ; static int new_c_uuid_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct new_c_uuid *arg ) { int tag ; int dlen ; unsigned short *tmp ; u16 tmp___0 ; unsigned short *tmp___1 ; u16 tmp___2 ; { goto ldv_49061; ldv_49060: { tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; } if ((tag & 8191) == 63) { goto case_63; } else { goto switch_default; if (0) { case_63: arg->clear_bm = (unsigned char )((int )((signed char )*((char *)tags)) != 0); goto ldv_49058; switch_default: ; if ((tag & 8192) != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); } return (0); } else { } } else { } } ldv_49058: tags = tags + (unsigned long )dlen; ldv_49061: { tmp___1 = tags; tags = tags + 1; tmp___2 = get_unaligned_le16((void const *)tmp___1); tag = (int )tmp___2; } if (tag != 0) { goto ldv_49060; } else { goto ldv_49062; } ldv_49062: ; return (1); } } static unsigned short *disk_conf_to_tags(struct drbd_conf *mdev , struct disk_conf *arg , unsigned short *tags ) ; static unsigned short *disk_conf_to_tags(struct drbd_conf *mdev , struct disk_conf *arg , unsigned short *tags ) { void *__gu_p ; unsigned short *tmp ; void *__gu_p___0 ; unsigned short *tmp___0 ; void *__gu_p___1 ; void *__gu_p___2 ; unsigned short *tmp___1 ; void *__gu_p___3 ; unsigned short *tmp___2 ; size_t __len ; void *__ret ; void *__gu_p___4 ; unsigned short *tmp___3 ; void *__gu_p___5 ; unsigned short *tmp___4 ; size_t __len___0 ; void *__ret___0 ; void *__gu_p___6 ; unsigned short *tmp___5 ; void *__gu_p___7 ; unsigned short *tmp___6 ; void *__gu_p___8 ; void *__gu_p___9 ; unsigned short *tmp___7 ; void *__gu_p___10 ; unsigned short *tmp___8 ; void *__gu_p___11 ; void *__gu_p___12 ; unsigned short *tmp___9 ; void *__gu_p___13 ; unsigned short *tmp___10 ; void *__gu_p___14 ; void *__gu_p___15 ; unsigned short *tmp___11 ; void *__gu_p___16 ; unsigned short *tmp___12 ; void *__gu_p___17 ; unsigned short *tmp___13 ; void *__gu_p___18 ; unsigned short *tmp___14 ; void *__gu_p___19 ; unsigned short *tmp___15 ; void *__gu_p___20 ; unsigned short *tmp___16 ; void *__gu_p___21 ; unsigned short *tmp___17 ; void *__gu_p___22 ; unsigned short *tmp___18 ; void *__gu_p___23 ; void *__gu_p___24 ; unsigned short *tmp___19 ; void *__gu_p___25 ; unsigned short *tmp___20 ; void *__gu_p___26 ; unsigned short *tmp___21 ; void *__gu_p___27 ; unsigned short *tmp___22 ; { tmp = tags; tags = tags + 1; __gu_p = (void *)tmp; if (1) { goto case_2; } else { goto switch_default; if (0) { *((u8 *)__gu_p) = (u8 )2U; goto ldv_49106; case_2: { put_unaligned_le16((u16 )16386, __gu_p); } goto ldv_49106; { put_unaligned_le32(16386U, __gu_p); } goto ldv_49106; { put_unaligned_le64(16386ULL, __gu_p); } goto ldv_49106; switch_default: { __bad_unaligned_access_size(); } goto ldv_49106; } else { } } ldv_49106: tmp___0 = tags; tags = tags + 1; __gu_p___0 = (void *)tmp___0; if (1) { goto case_2___0; } else { goto switch_default___0; if (0) { *((u8 *)__gu_p___0) = (u8 )8U; goto ldv_49113; case_2___0: { put_unaligned_le16((u16 )8, __gu_p___0); } goto ldv_49113; { put_unaligned_le32(8U, __gu_p___0); } goto ldv_49113; { put_unaligned_le64(8ULL, __gu_p___0); } goto ldv_49113; switch_default___0: { __bad_unaligned_access_size(); } goto ldv_49113; } else { } } ldv_49113: __gu_p___1 = (void *)tags; if (1) { goto case_8___1; } else { goto switch_default___1; if (0) { *((u8 *)__gu_p___1) = (unsigned char )arg->disk_size; goto ldv_49120; { put_unaligned_le16((u16 )((int )((unsigned short )arg->disk_size)), __gu_p___1); } goto ldv_49120; { put_unaligned_le32((unsigned int )arg->disk_size, __gu_p___1); } goto ldv_49120; case_8___1: { put_unaligned_le64(arg->disk_size, __gu_p___1); } goto ldv_49120; switch_default___1: { __bad_unaligned_access_size(); } goto ldv_49120; } else { } } ldv_49120: tags = tags + 8U; tmp___1 = tags; tags = tags + 1; __gu_p___2 = (void *)tmp___1; if (1) { goto case_2___2; } else { goto switch_default___2; if (0) { *((u8 *)__gu_p___2) = (u8 )3U; goto ldv_49127; case_2___2: { put_unaligned_le16((u16 )57347, __gu_p___2); } goto ldv_49127; { put_unaligned_le32(57347U, __gu_p___2); } goto ldv_49127; { put_unaligned_le64(57347ULL, __gu_p___2); } goto ldv_49127; switch_default___2: { __bad_unaligned_access_size(); } goto ldv_49127; } else { } } ldv_49127: tmp___2 = tags; tags = tags + 1; __gu_p___3 = (void *)tmp___2; if (1) { goto case_2___3; } else { goto switch_default___3; if (0) { *((u8 *)__gu_p___3) = (unsigned char )arg->backing_dev_len; goto ldv_49134; case_2___3: { put_unaligned_le16((u16 )((int )((unsigned short )arg->backing_dev_len)), __gu_p___3); } goto ldv_49134; { put_unaligned_le32((unsigned int )arg->backing_dev_len, __gu_p___3); } goto ldv_49134; { put_unaligned_le64((unsigned long long )arg->backing_dev_len, __gu_p___3); } goto ldv_49134; switch_default___3: { __bad_unaligned_access_size(); } goto ldv_49134; } else { } } ldv_49134: { __len = (size_t )arg->backing_dev_len; __ret = __builtin_memcpy((void *)tags, (void const *)(& arg->backing_dev), __len); tags = tags + (unsigned long )arg->backing_dev_len; tmp___3 = tags; tags = tags + 1; __gu_p___4 = (void *)tmp___3; } if (1) { goto case_2___4; } else { goto switch_default___4; if (0) { *((u8 *)__gu_p___4) = (u8 )4U; goto ldv_49144; case_2___4: { put_unaligned_le16((u16 )57348, __gu_p___4); } goto ldv_49144; { put_unaligned_le32(57348U, __gu_p___4); } goto ldv_49144; { put_unaligned_le64(57348ULL, __gu_p___4); } goto ldv_49144; switch_default___4: { __bad_unaligned_access_size(); } goto ldv_49144; } else { } } ldv_49144: tmp___4 = tags; tags = tags + 1; __gu_p___5 = (void *)tmp___4; if (1) { goto case_2___5; } else { goto switch_default___5; if (0) { *((u8 *)__gu_p___5) = (unsigned char )arg->meta_dev_len; goto ldv_49151; case_2___5: { put_unaligned_le16((u16 )((int )((unsigned short )arg->meta_dev_len)), __gu_p___5); } goto ldv_49151; { put_unaligned_le32((unsigned int )arg->meta_dev_len, __gu_p___5); } goto ldv_49151; { put_unaligned_le64((unsigned long long )arg->meta_dev_len, __gu_p___5); } goto ldv_49151; switch_default___5: { __bad_unaligned_access_size(); } goto ldv_49151; } else { } } ldv_49151: { __len___0 = (size_t )arg->meta_dev_len; __ret___0 = __builtin_memcpy((void *)tags, (void const *)(& arg->meta_dev), __len___0); tags = tags + (unsigned long )arg->meta_dev_len; tmp___5 = tags; tags = tags + 1; __gu_p___6 = (void *)tmp___5; } if (1) { goto case_2___6; } else { goto switch_default___6; if (0) { *((u8 *)__gu_p___6) = (u8 )5U; goto ldv_49161; case_2___6: { put_unaligned_le16((u16 )8197, __gu_p___6); } goto ldv_49161; { put_unaligned_le32(8197U, __gu_p___6); } goto ldv_49161; { put_unaligned_le64(8197ULL, __gu_p___6); } goto ldv_49161; switch_default___6: { __bad_unaligned_access_size(); } goto ldv_49161; } else { } } ldv_49161: tmp___6 = tags; tags = tags + 1; __gu_p___7 = (void *)tmp___6; if (1) { goto case_2___7; } else { goto switch_default___7; if (0) { *((u8 *)__gu_p___7) = (u8 )4U; goto ldv_49168; case_2___7: { put_unaligned_le16((u16 )4, __gu_p___7); } goto ldv_49168; { put_unaligned_le32(4U, __gu_p___7); } goto ldv_49168; { put_unaligned_le64(4ULL, __gu_p___7); } goto ldv_49168; switch_default___7: { __bad_unaligned_access_size(); } goto ldv_49168; } else { } } ldv_49168: __gu_p___8 = (void *)tags; if (1) { goto case_4___8; } else { goto switch_default___8; if (0) { *((u8 *)__gu_p___8) = (unsigned char )arg->meta_dev_idx; goto ldv_49175; { put_unaligned_le16((u16 )((int )((unsigned short )arg->meta_dev_idx)), __gu_p___8); } goto ldv_49175; case_4___8: { put_unaligned_le32((unsigned int )arg->meta_dev_idx, __gu_p___8); } goto ldv_49175; { put_unaligned_le64((unsigned long long )arg->meta_dev_idx, __gu_p___8); } goto ldv_49175; switch_default___8: { __bad_unaligned_access_size(); } goto ldv_49175; } else { } } ldv_49175: tags = tags + 4U; tmp___7 = tags; tags = tags + 1; __gu_p___9 = (void *)tmp___7; if (1) { goto case_2___9; } else { goto switch_default___9; if (0) { *((u8 *)__gu_p___9) = (u8 )6U; goto ldv_49182; case_2___9: { put_unaligned_le16((u16 )6, __gu_p___9); } goto ldv_49182; { put_unaligned_le32(6U, __gu_p___9); } goto ldv_49182; { put_unaligned_le64(6ULL, __gu_p___9); } goto ldv_49182; switch_default___9: { __bad_unaligned_access_size(); } goto ldv_49182; } else { } } ldv_49182: tmp___8 = tags; tags = tags + 1; __gu_p___10 = (void *)tmp___8; if (1) { goto case_2___10; } else { goto switch_default___10; if (0) { *((u8 *)__gu_p___10) = (u8 )4U; goto ldv_49189; case_2___10: { put_unaligned_le16((u16 )4, __gu_p___10); } goto ldv_49189; { put_unaligned_le32(4U, __gu_p___10); } goto ldv_49189; { put_unaligned_le64(4ULL, __gu_p___10); } goto ldv_49189; switch_default___10: { __bad_unaligned_access_size(); } goto ldv_49189; } else { } } ldv_49189: __gu_p___11 = (void *)tags; if (1) { goto case_4___11; } else { goto switch_default___11; if (0) { *((u8 *)__gu_p___11) = (unsigned char )arg->on_io_error; goto ldv_49196; { put_unaligned_le16((u16 )((int )((unsigned short )arg->on_io_error)), __gu_p___11); } goto ldv_49196; case_4___11: { put_unaligned_le32((unsigned int )arg->on_io_error, __gu_p___11); } goto ldv_49196; { put_unaligned_le64((unsigned long long )arg->on_io_error, __gu_p___11); } goto ldv_49196; switch_default___11: { __bad_unaligned_access_size(); } goto ldv_49196; } else { } } ldv_49196: tags = tags + 4U; tmp___9 = tags; tags = tags + 1; __gu_p___12 = (void *)tmp___9; if (1) { goto case_2___12; } else { goto switch_default___12; if (0) { *((u8 *)__gu_p___12) = (u8 )7U; goto ldv_49203; case_2___12: { put_unaligned_le16((u16 )7, __gu_p___12); } goto ldv_49203; { put_unaligned_le32(7U, __gu_p___12); } goto ldv_49203; { put_unaligned_le64(7ULL, __gu_p___12); } goto ldv_49203; switch_default___12: { __bad_unaligned_access_size(); } goto ldv_49203; } else { } } ldv_49203: tmp___10 = tags; tags = tags + 1; __gu_p___13 = (void *)tmp___10; if (1) { goto case_2___13; } else { goto switch_default___13; if (0) { *((u8 *)__gu_p___13) = (u8 )4U; goto ldv_49210; case_2___13: { put_unaligned_le16((u16 )4, __gu_p___13); } goto ldv_49210; { put_unaligned_le32(4U, __gu_p___13); } goto ldv_49210; { put_unaligned_le64(4ULL, __gu_p___13); } goto ldv_49210; switch_default___13: { __bad_unaligned_access_size(); } goto ldv_49210; } else { } } ldv_49210: __gu_p___14 = (void *)tags; if (1) { goto case_4___14; } else { goto switch_default___14; if (0) { *((u8 *)__gu_p___14) = (unsigned char )arg->fencing; goto ldv_49217; { put_unaligned_le16((u16 )((int )((unsigned short )arg->fencing)), __gu_p___14); } goto ldv_49217; case_4___14: { put_unaligned_le32((unsigned int )arg->fencing, __gu_p___14); } goto ldv_49217; { put_unaligned_le64((unsigned long long )arg->fencing, __gu_p___14); } goto ldv_49217; switch_default___14: { __bad_unaligned_access_size(); } goto ldv_49217; } else { } } ldv_49217: tags = tags + 4U; tmp___11 = tags; tags = tags + 1; __gu_p___15 = (void *)tmp___11; if (1) { goto case_2___15; } else { goto switch_default___15; if (0) { *((u8 *)__gu_p___15) = (u8 )37U; goto ldv_49224; case_2___15: { put_unaligned_le16((u16 )32805, __gu_p___15); } goto ldv_49224; { put_unaligned_le32(32805U, __gu_p___15); } goto ldv_49224; { put_unaligned_le64(32805ULL, __gu_p___15); } goto ldv_49224; switch_default___15: { __bad_unaligned_access_size(); } goto ldv_49224; } else { } } ldv_49224: tmp___12 = tags; tags = tags + 1; __gu_p___16 = (void *)tmp___12; if (1) { goto case_2___16; } else { goto switch_default___16; if (0) { *((u8 *)__gu_p___16) = (u8 )1U; goto ldv_49231; case_2___16: { put_unaligned_le16((u16 )1, __gu_p___16); } goto ldv_49231; { put_unaligned_le32(1U, __gu_p___16); } goto ldv_49231; { put_unaligned_le64(1ULL, __gu_p___16); } goto ldv_49231; switch_default___16: { __bad_unaligned_access_size(); } goto ldv_49231; } else { } } ldv_49231: *((char *)tags) = (char )arg->use_bmbv; tags = tags + 1U; tmp___13 = tags; tags = tags + 1; __gu_p___17 = (void *)tmp___13; if (1) { goto case_2___17; } else { goto switch_default___17; if (0) { *((u8 *)__gu_p___17) = (u8 )53U; goto ldv_49238; case_2___17: { put_unaligned_le16((u16 )32821, __gu_p___17); } goto ldv_49238; { put_unaligned_le32(32821U, __gu_p___17); } goto ldv_49238; { put_unaligned_le64(32821ULL, __gu_p___17); } goto ldv_49238; switch_default___17: { __bad_unaligned_access_size(); } goto ldv_49238; } else { } } ldv_49238: tmp___14 = tags; tags = tags + 1; __gu_p___18 = (void *)tmp___14; if (1) { goto case_2___18; } else { goto switch_default___18; if (0) { *((u8 *)__gu_p___18) = (u8 )1U; goto ldv_49245; case_2___18: { put_unaligned_le16((u16 )1, __gu_p___18); } goto ldv_49245; { put_unaligned_le32(1U, __gu_p___18); } goto ldv_49245; { put_unaligned_le64(1ULL, __gu_p___18); } goto ldv_49245; switch_default___18: { __bad_unaligned_access_size(); } goto ldv_49245; } else { } } ldv_49245: *((char *)tags) = (char )arg->no_disk_flush; tags = tags + 1U; tmp___15 = tags; tags = tags + 1; __gu_p___19 = (void *)tmp___15; if (1) { goto case_2___19; } else { goto switch_default___19; if (0) { *((u8 *)__gu_p___19) = (u8 )54U; goto ldv_49252; case_2___19: { put_unaligned_le16((u16 )32822, __gu_p___19); } goto ldv_49252; { put_unaligned_le32(32822U, __gu_p___19); } goto ldv_49252; { put_unaligned_le64(32822ULL, __gu_p___19); } goto ldv_49252; switch_default___19: { __bad_unaligned_access_size(); } goto ldv_49252; } else { } } ldv_49252: tmp___16 = tags; tags = tags + 1; __gu_p___20 = (void *)tmp___16; if (1) { goto case_2___20; } else { goto switch_default___20; if (0) { *((u8 *)__gu_p___20) = (u8 )1U; goto ldv_49259; case_2___20: { put_unaligned_le16((u16 )1, __gu_p___20); } goto ldv_49259; { put_unaligned_le32(1U, __gu_p___20); } goto ldv_49259; { put_unaligned_le64(1ULL, __gu_p___20); } goto ldv_49259; switch_default___20: { __bad_unaligned_access_size(); } goto ldv_49259; } else { } } ldv_49259: *((char *)tags) = (char )arg->no_md_flush; tags = tags + 1U; tmp___17 = tags; tags = tags + 1; __gu_p___21 = (void *)tmp___17; if (1) { goto case_2___21; } else { goto switch_default___21; if (0) { *((u8 *)__gu_p___21) = (u8 )56U; goto ldv_49266; case_2___21: { put_unaligned_le16((u16 )56, __gu_p___21); } goto ldv_49266; { put_unaligned_le32(56U, __gu_p___21); } goto ldv_49266; { put_unaligned_le64(56ULL, __gu_p___21); } goto ldv_49266; switch_default___21: { __bad_unaligned_access_size(); } goto ldv_49266; } else { } } ldv_49266: tmp___18 = tags; tags = tags + 1; __gu_p___22 = (void *)tmp___18; if (1) { goto case_2___22; } else { goto switch_default___22; if (0) { *((u8 *)__gu_p___22) = (u8 )4U; goto ldv_49273; case_2___22: { put_unaligned_le16((u16 )4, __gu_p___22); } goto ldv_49273; { put_unaligned_le32(4U, __gu_p___22); } goto ldv_49273; { put_unaligned_le64(4ULL, __gu_p___22); } goto ldv_49273; switch_default___22: { __bad_unaligned_access_size(); } goto ldv_49273; } else { } } ldv_49273: __gu_p___23 = (void *)tags; if (1) { goto case_4___23; } else { goto switch_default___23; if (0) { *((u8 *)__gu_p___23) = (unsigned char )arg->max_bio_bvecs; goto ldv_49280; { put_unaligned_le16((u16 )((int )((unsigned short )arg->max_bio_bvecs)), __gu_p___23); } goto ldv_49280; case_4___23: { put_unaligned_le32((unsigned int )arg->max_bio_bvecs, __gu_p___23); } goto ldv_49280; { put_unaligned_le64((unsigned long long )arg->max_bio_bvecs, __gu_p___23); } goto ldv_49280; switch_default___23: { __bad_unaligned_access_size(); } goto ldv_49280; } else { } } ldv_49280: tags = tags + 4U; tmp___19 = tags; tags = tags + 1; __gu_p___24 = (void *)tmp___19; if (1) { goto case_2___24; } else { goto switch_default___24; if (0) { *((u8 *)__gu_p___24) = (u8 )57U; goto ldv_49287; case_2___24: { put_unaligned_le16((u16 )32825, __gu_p___24); } goto ldv_49287; { put_unaligned_le32(32825U, __gu_p___24); } goto ldv_49287; { put_unaligned_le64(32825ULL, __gu_p___24); } goto ldv_49287; switch_default___24: { __bad_unaligned_access_size(); } goto ldv_49287; } else { } } ldv_49287: tmp___20 = tags; tags = tags + 1; __gu_p___25 = (void *)tmp___20; if (1) { goto case_2___25; } else { goto switch_default___25; if (0) { *((u8 *)__gu_p___25) = (u8 )1U; goto ldv_49294; case_2___25: { put_unaligned_le16((u16 )1, __gu_p___25); } goto ldv_49294; { put_unaligned_le32(1U, __gu_p___25); } goto ldv_49294; { put_unaligned_le64(1ULL, __gu_p___25); } goto ldv_49294; switch_default___25: { __bad_unaligned_access_size(); } goto ldv_49294; } else { } } ldv_49294: *((char *)tags) = (char )arg->no_disk_barrier; tags = tags + 1U; tmp___21 = tags; tags = tags + 1; __gu_p___26 = (void *)tmp___21; if (1) { goto case_2___26; } else { goto switch_default___26; if (0) { *((u8 *)__gu_p___26) = (u8 )58U; goto ldv_49301; case_2___26: { put_unaligned_le16((u16 )32826, __gu_p___26); } goto ldv_49301; { put_unaligned_le32(32826U, __gu_p___26); } goto ldv_49301; { put_unaligned_le64(32826ULL, __gu_p___26); } goto ldv_49301; switch_default___26: { __bad_unaligned_access_size(); } goto ldv_49301; } else { } } ldv_49301: tmp___22 = tags; tags = tags + 1; __gu_p___27 = (void *)tmp___22; if (1) { goto case_2___27; } else { goto switch_default___27; if (0) { *((u8 *)__gu_p___27) = (u8 )1U; goto ldv_49308; case_2___27: { put_unaligned_le16((u16 )1, __gu_p___27); } goto ldv_49308; { put_unaligned_le32(1U, __gu_p___27); } goto ldv_49308; { put_unaligned_le64(1ULL, __gu_p___27); } goto ldv_49308; switch_default___27: { __bad_unaligned_access_size(); } goto ldv_49308; } else { } } ldv_49308: *((char *)tags) = (char )arg->no_disk_drain; tags = tags + 1U; return (tags); } } static unsigned short *net_conf_to_tags(struct drbd_conf *mdev , struct net_conf *arg , unsigned short *tags ) ; static unsigned short *net_conf_to_tags(struct drbd_conf *mdev , struct net_conf *arg , unsigned short *tags ) { void *__gu_p ; unsigned short *tmp ; void *__gu_p___0 ; unsigned short *tmp___0 ; size_t __len ; void *__ret ; void *__gu_p___1 ; unsigned short *tmp___1 ; void *__gu_p___2 ; unsigned short *tmp___2 ; size_t __len___0 ; void *__ret___0 ; void *__gu_p___3 ; unsigned short *tmp___3 ; void *__gu_p___4 ; unsigned short *tmp___4 ; size_t __len___1 ; void *__ret___1 ; void *__gu_p___5 ; unsigned short *tmp___5 ; void *__gu_p___6 ; unsigned short *tmp___6 ; size_t __len___2 ; void *__ret___2 ; void *__gu_p___7 ; unsigned short *tmp___7 ; void *__gu_p___8 ; unsigned short *tmp___8 ; size_t __len___3 ; void *__ret___3 ; void *__gu_p___9 ; unsigned short *tmp___9 ; void *__gu_p___10 ; unsigned short *tmp___10 ; void *__gu_p___11 ; void *__gu_p___12 ; unsigned short *tmp___11 ; void *__gu_p___13 ; unsigned short *tmp___12 ; void *__gu_p___14 ; void *__gu_p___15 ; unsigned short *tmp___13 ; void *__gu_p___16 ; unsigned short *tmp___14 ; void *__gu_p___17 ; void *__gu_p___18 ; unsigned short *tmp___15 ; void *__gu_p___19 ; unsigned short *tmp___16 ; void *__gu_p___20 ; void *__gu_p___21 ; unsigned short *tmp___17 ; void *__gu_p___22 ; unsigned short *tmp___18 ; void *__gu_p___23 ; void *__gu_p___24 ; unsigned short *tmp___19 ; void *__gu_p___25 ; unsigned short *tmp___20 ; void *__gu_p___26 ; void *__gu_p___27 ; unsigned short *tmp___21 ; void *__gu_p___28 ; unsigned short *tmp___22 ; void *__gu_p___29 ; void *__gu_p___30 ; unsigned short *tmp___23 ; void *__gu_p___31 ; unsigned short *tmp___24 ; void *__gu_p___32 ; void *__gu_p___33 ; unsigned short *tmp___25 ; void *__gu_p___34 ; unsigned short *tmp___26 ; void *__gu_p___35 ; void *__gu_p___36 ; unsigned short *tmp___27 ; void *__gu_p___37 ; unsigned short *tmp___28 ; void *__gu_p___38 ; void *__gu_p___39 ; unsigned short *tmp___29 ; void *__gu_p___40 ; unsigned short *tmp___30 ; void *__gu_p___41 ; void *__gu_p___42 ; unsigned short *tmp___31 ; void *__gu_p___43 ; unsigned short *tmp___32 ; void *__gu_p___44 ; void *__gu_p___45 ; unsigned short *tmp___33 ; void *__gu_p___46 ; unsigned short *tmp___34 ; void *__gu_p___47 ; void *__gu_p___48 ; unsigned short *tmp___35 ; void *__gu_p___49 ; unsigned short *tmp___36 ; void *__gu_p___50 ; void *__gu_p___51 ; unsigned short *tmp___37 ; void *__gu_p___52 ; unsigned short *tmp___38 ; void *__gu_p___53 ; void *__gu_p___54 ; unsigned short *tmp___39 ; void *__gu_p___55 ; unsigned short *tmp___40 ; void *__gu_p___56 ; void *__gu_p___57 ; unsigned short *tmp___41 ; void *__gu_p___58 ; unsigned short *tmp___42 ; void *__gu_p___59 ; void *__gu_p___60 ; unsigned short *tmp___43 ; void *__gu_p___61 ; unsigned short *tmp___44 ; void *__gu_p___62 ; void *__gu_p___63 ; unsigned short *tmp___45 ; void *__gu_p___64 ; unsigned short *tmp___46 ; void *__gu_p___65 ; unsigned short *tmp___47 ; void *__gu_p___66 ; unsigned short *tmp___48 ; void *__gu_p___67 ; unsigned short *tmp___49 ; void *__gu_p___68 ; unsigned short *tmp___50 ; void *__gu_p___69 ; unsigned short *tmp___51 ; void *__gu_p___70 ; unsigned short *tmp___52 ; void *__gu_p___71 ; unsigned short *tmp___53 ; void *__gu_p___72 ; unsigned short *tmp___54 ; void *__gu_p___73 ; unsigned short *tmp___55 ; void *__gu_p___74 ; unsigned short *tmp___56 ; void *__gu_p___75 ; unsigned short *tmp___57 ; void *__gu_p___76 ; unsigned short *tmp___58 ; { tmp = tags; tags = tags + 1; __gu_p = (void *)tmp; if (1) { goto case_2; } else { goto switch_default; if (0) { *((u8 *)__gu_p) = (u8 )8U; goto ldv_49333; case_2: { put_unaligned_le16((u16 )57352, __gu_p); } goto ldv_49333; { put_unaligned_le32(57352U, __gu_p); } goto ldv_49333; { put_unaligned_le64(57352ULL, __gu_p); } goto ldv_49333; switch_default: { __bad_unaligned_access_size(); } goto ldv_49333; } else { } } ldv_49333: tmp___0 = tags; tags = tags + 1; __gu_p___0 = (void *)tmp___0; if (1) { goto case_2___0; } else { goto switch_default___0; if (0) { *((u8 *)__gu_p___0) = (unsigned char )arg->my_addr_len; goto ldv_49340; case_2___0: { put_unaligned_le16((u16 )((int )((unsigned short )arg->my_addr_len)), __gu_p___0); } goto ldv_49340; { put_unaligned_le32((unsigned int )arg->my_addr_len, __gu_p___0); } goto ldv_49340; { put_unaligned_le64((unsigned long long )arg->my_addr_len, __gu_p___0); } goto ldv_49340; switch_default___0: { __bad_unaligned_access_size(); } goto ldv_49340; } else { } } ldv_49340: { __len = (size_t )arg->my_addr_len; __ret = __builtin_memcpy((void *)tags, (void const *)(& arg->my_addr), __len); tags = tags + (unsigned long )arg->my_addr_len; tmp___1 = tags; tags = tags + 1; __gu_p___1 = (void *)tmp___1; } if (1) { goto case_2___1; } else { goto switch_default___1; if (0) { *((u8 *)__gu_p___1) = (u8 )9U; goto ldv_49350; case_2___1: { put_unaligned_le16((u16 )57353, __gu_p___1); } goto ldv_49350; { put_unaligned_le32(57353U, __gu_p___1); } goto ldv_49350; { put_unaligned_le64(57353ULL, __gu_p___1); } goto ldv_49350; switch_default___1: { __bad_unaligned_access_size(); } goto ldv_49350; } else { } } ldv_49350: tmp___2 = tags; tags = tags + 1; __gu_p___2 = (void *)tmp___2; if (1) { goto case_2___2; } else { goto switch_default___2; if (0) { *((u8 *)__gu_p___2) = (unsigned char )arg->peer_addr_len; goto ldv_49357; case_2___2: { put_unaligned_le16((u16 )((int )((unsigned short )arg->peer_addr_len)), __gu_p___2); } goto ldv_49357; { put_unaligned_le32((unsigned int )arg->peer_addr_len, __gu_p___2); } goto ldv_49357; { put_unaligned_le64((unsigned long long )arg->peer_addr_len, __gu_p___2); } goto ldv_49357; switch_default___2: { __bad_unaligned_access_size(); } goto ldv_49357; } else { } } ldv_49357: { __len___0 = (size_t )arg->peer_addr_len; __ret___0 = __builtin_memcpy((void *)tags, (void const *)(& arg->peer_addr), __len___0); tags = tags + (unsigned long )arg->peer_addr_len; tmp___3 = tags; tags = tags + 1; __gu_p___3 = (void *)tmp___3; } if (1) { goto case_2___3; } else { goto switch_default___3; if (0) { *((u8 *)__gu_p___3) = (u8 )10U; goto ldv_49367; case_2___3: { put_unaligned_le16((u16 )49162, __gu_p___3); } goto ldv_49367; { put_unaligned_le32(49162U, __gu_p___3); } goto ldv_49367; { put_unaligned_le64(49162ULL, __gu_p___3); } goto ldv_49367; switch_default___3: { __bad_unaligned_access_size(); } goto ldv_49367; } else { } } ldv_49367: tmp___4 = tags; tags = tags + 1; __gu_p___4 = (void *)tmp___4; if (1) { goto case_2___4; } else { goto switch_default___4; if (0) { *((u8 *)__gu_p___4) = (unsigned char )arg->shared_secret_len; goto ldv_49374; case_2___4: { put_unaligned_le16((u16 )((int )((unsigned short )arg->shared_secret_len)), __gu_p___4); } goto ldv_49374; { put_unaligned_le32((unsigned int )arg->shared_secret_len, __gu_p___4); } goto ldv_49374; { put_unaligned_le64((unsigned long long )arg->shared_secret_len, __gu_p___4); } goto ldv_49374; switch_default___4: { __bad_unaligned_access_size(); } goto ldv_49374; } else { } } ldv_49374: { __len___1 = (size_t )arg->shared_secret_len; __ret___1 = __builtin_memcpy((void *)tags, (void const *)(& arg->shared_secret), __len___1); tags = tags + (unsigned long )arg->shared_secret_len; tmp___5 = tags; tags = tags + 1; __gu_p___5 = (void *)tmp___5; } if (1) { goto case_2___5; } else { goto switch_default___5; if (0) { *((u8 *)__gu_p___5) = (u8 )11U; goto ldv_49384; case_2___5: { put_unaligned_le16((u16 )49163, __gu_p___5); } goto ldv_49384; { put_unaligned_le32(49163U, __gu_p___5); } goto ldv_49384; { put_unaligned_le64(49163ULL, __gu_p___5); } goto ldv_49384; switch_default___5: { __bad_unaligned_access_size(); } goto ldv_49384; } else { } } ldv_49384: tmp___6 = tags; tags = tags + 1; __gu_p___6 = (void *)tmp___6; if (1) { goto case_2___6; } else { goto switch_default___6; if (0) { *((u8 *)__gu_p___6) = (unsigned char )arg->cram_hmac_alg_len; goto ldv_49391; case_2___6: { put_unaligned_le16((u16 )((int )((unsigned short )arg->cram_hmac_alg_len)), __gu_p___6); } goto ldv_49391; { put_unaligned_le32((unsigned int )arg->cram_hmac_alg_len, __gu_p___6); } goto ldv_49391; { put_unaligned_le64((unsigned long long )arg->cram_hmac_alg_len, __gu_p___6); } goto ldv_49391; switch_default___6: { __bad_unaligned_access_size(); } goto ldv_49391; } else { } } ldv_49391: { __len___2 = (size_t )arg->cram_hmac_alg_len; __ret___2 = __builtin_memcpy((void *)tags, (void const *)(& arg->cram_hmac_alg), __len___2); tags = tags + (unsigned long )arg->cram_hmac_alg_len; tmp___7 = tags; tags = tags + 1; __gu_p___7 = (void *)tmp___7; } if (1) { goto case_2___7; } else { goto switch_default___7; if (0) { *((u8 *)__gu_p___7) = (u8 )44U; goto ldv_49401; case_2___7: { put_unaligned_le16((u16 )49196, __gu_p___7); } goto ldv_49401; { put_unaligned_le32(49196U, __gu_p___7); } goto ldv_49401; { put_unaligned_le64(49196ULL, __gu_p___7); } goto ldv_49401; switch_default___7: { __bad_unaligned_access_size(); } goto ldv_49401; } else { } } ldv_49401: tmp___8 = tags; tags = tags + 1; __gu_p___8 = (void *)tmp___8; if (1) { goto case_2___8; } else { goto switch_default___8; if (0) { *((u8 *)__gu_p___8) = (unsigned char )arg->integrity_alg_len; goto ldv_49408; case_2___8: { put_unaligned_le16((u16 )((int )((unsigned short )arg->integrity_alg_len)), __gu_p___8); } goto ldv_49408; { put_unaligned_le32((unsigned int )arg->integrity_alg_len, __gu_p___8); } goto ldv_49408; { put_unaligned_le64((unsigned long long )arg->integrity_alg_len, __gu_p___8); } goto ldv_49408; switch_default___8: { __bad_unaligned_access_size(); } goto ldv_49408; } else { } } ldv_49408: { __len___3 = (size_t )arg->integrity_alg_len; __ret___3 = __builtin_memcpy((void *)tags, (void const *)(& arg->integrity_alg), __len___3); tags = tags + (unsigned long )arg->integrity_alg_len; tmp___9 = tags; tags = tags + 1; __gu_p___9 = (void *)tmp___9; } if (1) { goto case_2___9; } else { goto switch_default___9; if (0) { *((u8 *)__gu_p___9) = (u8 )14U; goto ldv_49418; case_2___9: { put_unaligned_le16((u16 )14, __gu_p___9); } goto ldv_49418; { put_unaligned_le32(14U, __gu_p___9); } goto ldv_49418; { put_unaligned_le64(14ULL, __gu_p___9); } goto ldv_49418; switch_default___9: { __bad_unaligned_access_size(); } goto ldv_49418; } else { } } ldv_49418: tmp___10 = tags; tags = tags + 1; __gu_p___10 = (void *)tmp___10; if (1) { goto case_2___10; } else { goto switch_default___10; if (0) { *((u8 *)__gu_p___10) = (u8 )4U; goto ldv_49425; case_2___10: { put_unaligned_le16((u16 )4, __gu_p___10); } goto ldv_49425; { put_unaligned_le32(4U, __gu_p___10); } goto ldv_49425; { put_unaligned_le64(4ULL, __gu_p___10); } goto ldv_49425; switch_default___10: { __bad_unaligned_access_size(); } goto ldv_49425; } else { } } ldv_49425: __gu_p___11 = (void *)tags; if (1) { goto case_4___11; } else { goto switch_default___11; if (0) { *((u8 *)__gu_p___11) = (unsigned char )arg->timeout; goto ldv_49432; { put_unaligned_le16((u16 )((int )((unsigned short )arg->timeout)), __gu_p___11); } goto ldv_49432; case_4___11: { put_unaligned_le32((unsigned int )arg->timeout, __gu_p___11); } goto ldv_49432; { put_unaligned_le64((unsigned long long )arg->timeout, __gu_p___11); } goto ldv_49432; switch_default___11: { __bad_unaligned_access_size(); } goto ldv_49432; } else { } } ldv_49432: tags = tags + 4U; tmp___11 = tags; tags = tags + 1; __gu_p___12 = (void *)tmp___11; if (1) { goto case_2___12; } else { goto switch_default___12; if (0) { *((u8 *)__gu_p___12) = (u8 )15U; goto ldv_49439; case_2___12: { put_unaligned_le16((u16 )8207, __gu_p___12); } goto ldv_49439; { put_unaligned_le32(8207U, __gu_p___12); } goto ldv_49439; { put_unaligned_le64(8207ULL, __gu_p___12); } goto ldv_49439; switch_default___12: { __bad_unaligned_access_size(); } goto ldv_49439; } else { } } ldv_49439: tmp___12 = tags; tags = tags + 1; __gu_p___13 = (void *)tmp___12; if (1) { goto case_2___13; } else { goto switch_default___13; if (0) { *((u8 *)__gu_p___13) = (u8 )4U; goto ldv_49446; case_2___13: { put_unaligned_le16((u16 )4, __gu_p___13); } goto ldv_49446; { put_unaligned_le32(4U, __gu_p___13); } goto ldv_49446; { put_unaligned_le64(4ULL, __gu_p___13); } goto ldv_49446; switch_default___13: { __bad_unaligned_access_size(); } goto ldv_49446; } else { } } ldv_49446: __gu_p___14 = (void *)tags; if (1) { goto case_4___14; } else { goto switch_default___14; if (0) { *((u8 *)__gu_p___14) = (unsigned char )arg->wire_protocol; goto ldv_49453; { put_unaligned_le16((u16 )((int )((unsigned short )arg->wire_protocol)), __gu_p___14); } goto ldv_49453; case_4___14: { put_unaligned_le32((unsigned int )arg->wire_protocol, __gu_p___14); } goto ldv_49453; { put_unaligned_le64((unsigned long long )arg->wire_protocol, __gu_p___14); } goto ldv_49453; switch_default___14: { __bad_unaligned_access_size(); } goto ldv_49453; } else { } } ldv_49453: tags = tags + 4U; tmp___13 = tags; tags = tags + 1; __gu_p___15 = (void *)tmp___13; if (1) { goto case_2___15; } else { goto switch_default___15; if (0) { *((u8 *)__gu_p___15) = (u8 )16U; goto ldv_49460; case_2___15: { put_unaligned_le16((u16 )16, __gu_p___15); } goto ldv_49460; { put_unaligned_le32(16U, __gu_p___15); } goto ldv_49460; { put_unaligned_le64(16ULL, __gu_p___15); } goto ldv_49460; switch_default___15: { __bad_unaligned_access_size(); } goto ldv_49460; } else { } } ldv_49460: tmp___14 = tags; tags = tags + 1; __gu_p___16 = (void *)tmp___14; if (1) { goto case_2___16; } else { goto switch_default___16; if (0) { *((u8 *)__gu_p___16) = (u8 )4U; goto ldv_49467; case_2___16: { put_unaligned_le16((u16 )4, __gu_p___16); } goto ldv_49467; { put_unaligned_le32(4U, __gu_p___16); } goto ldv_49467; { put_unaligned_le64(4ULL, __gu_p___16); } goto ldv_49467; switch_default___16: { __bad_unaligned_access_size(); } goto ldv_49467; } else { } } ldv_49467: __gu_p___17 = (void *)tags; if (1) { goto case_4___17; } else { goto switch_default___17; if (0) { *((u8 *)__gu_p___17) = (unsigned char )arg->try_connect_int; goto ldv_49474; { put_unaligned_le16((u16 )((int )((unsigned short )arg->try_connect_int)), __gu_p___17); } goto ldv_49474; case_4___17: { put_unaligned_le32((unsigned int )arg->try_connect_int, __gu_p___17); } goto ldv_49474; { put_unaligned_le64((unsigned long long )arg->try_connect_int, __gu_p___17); } goto ldv_49474; switch_default___17: { __bad_unaligned_access_size(); } goto ldv_49474; } else { } } ldv_49474: tags = tags + 4U; tmp___15 = tags; tags = tags + 1; __gu_p___18 = (void *)tmp___15; if (1) { goto case_2___18; } else { goto switch_default___18; if (0) { *((u8 *)__gu_p___18) = (u8 )17U; goto ldv_49481; case_2___18: { put_unaligned_le16((u16 )17, __gu_p___18); } goto ldv_49481; { put_unaligned_le32(17U, __gu_p___18); } goto ldv_49481; { put_unaligned_le64(17ULL, __gu_p___18); } goto ldv_49481; switch_default___18: { __bad_unaligned_access_size(); } goto ldv_49481; } else { } } ldv_49481: tmp___16 = tags; tags = tags + 1; __gu_p___19 = (void *)tmp___16; if (1) { goto case_2___19; } else { goto switch_default___19; if (0) { *((u8 *)__gu_p___19) = (u8 )4U; goto ldv_49488; case_2___19: { put_unaligned_le16((u16 )4, __gu_p___19); } goto ldv_49488; { put_unaligned_le32(4U, __gu_p___19); } goto ldv_49488; { put_unaligned_le64(4ULL, __gu_p___19); } goto ldv_49488; switch_default___19: { __bad_unaligned_access_size(); } goto ldv_49488; } else { } } ldv_49488: __gu_p___20 = (void *)tags; if (1) { goto case_4___20; } else { goto switch_default___20; if (0) { *((u8 *)__gu_p___20) = (unsigned char )arg->ping_int; goto ldv_49495; { put_unaligned_le16((u16 )((int )((unsigned short )arg->ping_int)), __gu_p___20); } goto ldv_49495; case_4___20: { put_unaligned_le32((unsigned int )arg->ping_int, __gu_p___20); } goto ldv_49495; { put_unaligned_le64((unsigned long long )arg->ping_int, __gu_p___20); } goto ldv_49495; switch_default___20: { __bad_unaligned_access_size(); } goto ldv_49495; } else { } } ldv_49495: tags = tags + 4U; tmp___17 = tags; tags = tags + 1; __gu_p___21 = (void *)tmp___17; if (1) { goto case_2___21; } else { goto switch_default___21; if (0) { *((u8 *)__gu_p___21) = (u8 )18U; goto ldv_49502; case_2___21: { put_unaligned_le16((u16 )18, __gu_p___21); } goto ldv_49502; { put_unaligned_le32(18U, __gu_p___21); } goto ldv_49502; { put_unaligned_le64(18ULL, __gu_p___21); } goto ldv_49502; switch_default___21: { __bad_unaligned_access_size(); } goto ldv_49502; } else { } } ldv_49502: tmp___18 = tags; tags = tags + 1; __gu_p___22 = (void *)tmp___18; if (1) { goto case_2___22; } else { goto switch_default___22; if (0) { *((u8 *)__gu_p___22) = (u8 )4U; goto ldv_49509; case_2___22: { put_unaligned_le16((u16 )4, __gu_p___22); } goto ldv_49509; { put_unaligned_le32(4U, __gu_p___22); } goto ldv_49509; { put_unaligned_le64(4ULL, __gu_p___22); } goto ldv_49509; switch_default___22: { __bad_unaligned_access_size(); } goto ldv_49509; } else { } } ldv_49509: __gu_p___23 = (void *)tags; if (1) { goto case_4___23; } else { goto switch_default___23; if (0) { *((u8 *)__gu_p___23) = (unsigned char )arg->max_epoch_size; goto ldv_49516; { put_unaligned_le16((u16 )((int )((unsigned short )arg->max_epoch_size)), __gu_p___23); } goto ldv_49516; case_4___23: { put_unaligned_le32((unsigned int )arg->max_epoch_size, __gu_p___23); } goto ldv_49516; { put_unaligned_le64((unsigned long long )arg->max_epoch_size, __gu_p___23); } goto ldv_49516; switch_default___23: { __bad_unaligned_access_size(); } goto ldv_49516; } else { } } ldv_49516: tags = tags + 4U; tmp___19 = tags; tags = tags + 1; __gu_p___24 = (void *)tmp___19; if (1) { goto case_2___24; } else { goto switch_default___24; if (0) { *((u8 *)__gu_p___24) = (u8 )19U; goto ldv_49523; case_2___24: { put_unaligned_le16((u16 )19, __gu_p___24); } goto ldv_49523; { put_unaligned_le32(19U, __gu_p___24); } goto ldv_49523; { put_unaligned_le64(19ULL, __gu_p___24); } goto ldv_49523; switch_default___24: { __bad_unaligned_access_size(); } goto ldv_49523; } else { } } ldv_49523: tmp___20 = tags; tags = tags + 1; __gu_p___25 = (void *)tmp___20; if (1) { goto case_2___25; } else { goto switch_default___25; if (0) { *((u8 *)__gu_p___25) = (u8 )4U; goto ldv_49530; case_2___25: { put_unaligned_le16((u16 )4, __gu_p___25); } goto ldv_49530; { put_unaligned_le32(4U, __gu_p___25); } goto ldv_49530; { put_unaligned_le64(4ULL, __gu_p___25); } goto ldv_49530; switch_default___25: { __bad_unaligned_access_size(); } goto ldv_49530; } else { } } ldv_49530: __gu_p___26 = (void *)tags; if (1) { goto case_4___26; } else { goto switch_default___26; if (0) { *((u8 *)__gu_p___26) = (unsigned char )arg->max_buffers; goto ldv_49537; { put_unaligned_le16((u16 )((int )((unsigned short )arg->max_buffers)), __gu_p___26); } goto ldv_49537; case_4___26: { put_unaligned_le32((unsigned int )arg->max_buffers, __gu_p___26); } goto ldv_49537; { put_unaligned_le64((unsigned long long )arg->max_buffers, __gu_p___26); } goto ldv_49537; switch_default___26: { __bad_unaligned_access_size(); } goto ldv_49537; } else { } } ldv_49537: tags = tags + 4U; tmp___21 = tags; tags = tags + 1; __gu_p___27 = (void *)tmp___21; if (1) { goto case_2___27; } else { goto switch_default___27; if (0) { *((u8 *)__gu_p___27) = (u8 )20U; goto ldv_49544; case_2___27: { put_unaligned_le16((u16 )20, __gu_p___27); } goto ldv_49544; { put_unaligned_le32(20U, __gu_p___27); } goto ldv_49544; { put_unaligned_le64(20ULL, __gu_p___27); } goto ldv_49544; switch_default___27: { __bad_unaligned_access_size(); } goto ldv_49544; } else { } } ldv_49544: tmp___22 = tags; tags = tags + 1; __gu_p___28 = (void *)tmp___22; if (1) { goto case_2___28; } else { goto switch_default___28; if (0) { *((u8 *)__gu_p___28) = (u8 )4U; goto ldv_49551; case_2___28: { put_unaligned_le16((u16 )4, __gu_p___28); } goto ldv_49551; { put_unaligned_le32(4U, __gu_p___28); } goto ldv_49551; { put_unaligned_le64(4ULL, __gu_p___28); } goto ldv_49551; switch_default___28: { __bad_unaligned_access_size(); } goto ldv_49551; } else { } } ldv_49551: __gu_p___29 = (void *)tags; if (1) { goto case_4___29; } else { goto switch_default___29; if (0) { *((u8 *)__gu_p___29) = (unsigned char )arg->unplug_watermark; goto ldv_49558; { put_unaligned_le16((u16 )((int )((unsigned short )arg->unplug_watermark)), __gu_p___29); } goto ldv_49558; case_4___29: { put_unaligned_le32((unsigned int )arg->unplug_watermark, __gu_p___29); } goto ldv_49558; { put_unaligned_le64((unsigned long long )arg->unplug_watermark, __gu_p___29); } goto ldv_49558; switch_default___29: { __bad_unaligned_access_size(); } goto ldv_49558; } else { } } ldv_49558: tags = tags + 4U; tmp___23 = tags; tags = tags + 1; __gu_p___30 = (void *)tmp___23; if (1) { goto case_2___30; } else { goto switch_default___30; if (0) { *((u8 *)__gu_p___30) = (u8 )21U; goto ldv_49565; case_2___30: { put_unaligned_le16((u16 )21, __gu_p___30); } goto ldv_49565; { put_unaligned_le32(21U, __gu_p___30); } goto ldv_49565; { put_unaligned_le64(21ULL, __gu_p___30); } goto ldv_49565; switch_default___30: { __bad_unaligned_access_size(); } goto ldv_49565; } else { } } ldv_49565: tmp___24 = tags; tags = tags + 1; __gu_p___31 = (void *)tmp___24; if (1) { goto case_2___31; } else { goto switch_default___31; if (0) { *((u8 *)__gu_p___31) = (u8 )4U; goto ldv_49572; case_2___31: { put_unaligned_le16((u16 )4, __gu_p___31); } goto ldv_49572; { put_unaligned_le32(4U, __gu_p___31); } goto ldv_49572; { put_unaligned_le64(4ULL, __gu_p___31); } goto ldv_49572; switch_default___31: { __bad_unaligned_access_size(); } goto ldv_49572; } else { } } ldv_49572: __gu_p___32 = (void *)tags; if (1) { goto case_4___32; } else { goto switch_default___32; if (0) { *((u8 *)__gu_p___32) = (unsigned char )arg->sndbuf_size; goto ldv_49579; { put_unaligned_le16((u16 )((int )((unsigned short )arg->sndbuf_size)), __gu_p___32); } goto ldv_49579; case_4___32: { put_unaligned_le32((unsigned int )arg->sndbuf_size, __gu_p___32); } goto ldv_49579; { put_unaligned_le64((unsigned long long )arg->sndbuf_size, __gu_p___32); } goto ldv_49579; switch_default___32: { __bad_unaligned_access_size(); } goto ldv_49579; } else { } } ldv_49579: tags = tags + 4U; tmp___25 = tags; tags = tags + 1; __gu_p___33 = (void *)tmp___25; if (1) { goto case_2___33; } else { goto switch_default___33; if (0) { *((u8 *)__gu_p___33) = (u8 )22U; goto ldv_49586; case_2___33: { put_unaligned_le16((u16 )22, __gu_p___33); } goto ldv_49586; { put_unaligned_le32(22U, __gu_p___33); } goto ldv_49586; { put_unaligned_le64(22ULL, __gu_p___33); } goto ldv_49586; switch_default___33: { __bad_unaligned_access_size(); } goto ldv_49586; } else { } } ldv_49586: tmp___26 = tags; tags = tags + 1; __gu_p___34 = (void *)tmp___26; if (1) { goto case_2___34; } else { goto switch_default___34; if (0) { *((u8 *)__gu_p___34) = (u8 )4U; goto ldv_49593; case_2___34: { put_unaligned_le16((u16 )4, __gu_p___34); } goto ldv_49593; { put_unaligned_le32(4U, __gu_p___34); } goto ldv_49593; { put_unaligned_le64(4ULL, __gu_p___34); } goto ldv_49593; switch_default___34: { __bad_unaligned_access_size(); } goto ldv_49593; } else { } } ldv_49593: __gu_p___35 = (void *)tags; if (1) { goto case_4___35; } else { goto switch_default___35; if (0) { *((u8 *)__gu_p___35) = (unsigned char )arg->ko_count; goto ldv_49600; { put_unaligned_le16((u16 )((int )((unsigned short )arg->ko_count)), __gu_p___35); } goto ldv_49600; case_4___35: { put_unaligned_le32((unsigned int )arg->ko_count, __gu_p___35); } goto ldv_49600; { put_unaligned_le64((unsigned long long )arg->ko_count, __gu_p___35); } goto ldv_49600; switch_default___35: { __bad_unaligned_access_size(); } goto ldv_49600; } else { } } ldv_49600: tags = tags + 4U; tmp___27 = tags; tags = tags + 1; __gu_p___36 = (void *)tmp___27; if (1) { goto case_2___36; } else { goto switch_default___36; if (0) { *((u8 *)__gu_p___36) = (u8 )24U; goto ldv_49607; case_2___36: { put_unaligned_le16((u16 )24, __gu_p___36); } goto ldv_49607; { put_unaligned_le32(24U, __gu_p___36); } goto ldv_49607; { put_unaligned_le64(24ULL, __gu_p___36); } goto ldv_49607; switch_default___36: { __bad_unaligned_access_size(); } goto ldv_49607; } else { } } ldv_49607: tmp___28 = tags; tags = tags + 1; __gu_p___37 = (void *)tmp___28; if (1) { goto case_2___37; } else { goto switch_default___37; if (0) { *((u8 *)__gu_p___37) = (u8 )4U; goto ldv_49614; case_2___37: { put_unaligned_le16((u16 )4, __gu_p___37); } goto ldv_49614; { put_unaligned_le32(4U, __gu_p___37); } goto ldv_49614; { put_unaligned_le64(4ULL, __gu_p___37); } goto ldv_49614; switch_default___37: { __bad_unaligned_access_size(); } goto ldv_49614; } else { } } ldv_49614: __gu_p___38 = (void *)tags; if (1) { goto case_4___38; } else { goto switch_default___38; if (0) { *((u8 *)__gu_p___38) = (unsigned char )arg->after_sb_0p; goto ldv_49621; { put_unaligned_le16((u16 )((int )((unsigned short )arg->after_sb_0p)), __gu_p___38); } goto ldv_49621; case_4___38: { put_unaligned_le32((unsigned int )arg->after_sb_0p, __gu_p___38); } goto ldv_49621; { put_unaligned_le64((unsigned long long )arg->after_sb_0p, __gu_p___38); } goto ldv_49621; switch_default___38: { __bad_unaligned_access_size(); } goto ldv_49621; } else { } } ldv_49621: tags = tags + 4U; tmp___29 = tags; tags = tags + 1; __gu_p___39 = (void *)tmp___29; if (1) { goto case_2___39; } else { goto switch_default___39; if (0) { *((u8 *)__gu_p___39) = (u8 )25U; goto ldv_49628; case_2___39: { put_unaligned_le16((u16 )25, __gu_p___39); } goto ldv_49628; { put_unaligned_le32(25U, __gu_p___39); } goto ldv_49628; { put_unaligned_le64(25ULL, __gu_p___39); } goto ldv_49628; switch_default___39: { __bad_unaligned_access_size(); } goto ldv_49628; } else { } } ldv_49628: tmp___30 = tags; tags = tags + 1; __gu_p___40 = (void *)tmp___30; if (1) { goto case_2___40; } else { goto switch_default___40; if (0) { *((u8 *)__gu_p___40) = (u8 )4U; goto ldv_49635; case_2___40: { put_unaligned_le16((u16 )4, __gu_p___40); } goto ldv_49635; { put_unaligned_le32(4U, __gu_p___40); } goto ldv_49635; { put_unaligned_le64(4ULL, __gu_p___40); } goto ldv_49635; switch_default___40: { __bad_unaligned_access_size(); } goto ldv_49635; } else { } } ldv_49635: __gu_p___41 = (void *)tags; if (1) { goto case_4___41; } else { goto switch_default___41; if (0) { *((u8 *)__gu_p___41) = (unsigned char )arg->after_sb_1p; goto ldv_49642; { put_unaligned_le16((u16 )((int )((unsigned short )arg->after_sb_1p)), __gu_p___41); } goto ldv_49642; case_4___41: { put_unaligned_le32((unsigned int )arg->after_sb_1p, __gu_p___41); } goto ldv_49642; { put_unaligned_le64((unsigned long long )arg->after_sb_1p, __gu_p___41); } goto ldv_49642; switch_default___41: { __bad_unaligned_access_size(); } goto ldv_49642; } else { } } ldv_49642: tags = tags + 4U; tmp___31 = tags; tags = tags + 1; __gu_p___42 = (void *)tmp___31; if (1) { goto case_2___42; } else { goto switch_default___42; if (0) { *((u8 *)__gu_p___42) = (u8 )26U; goto ldv_49649; case_2___42: { put_unaligned_le16((u16 )26, __gu_p___42); } goto ldv_49649; { put_unaligned_le32(26U, __gu_p___42); } goto ldv_49649; { put_unaligned_le64(26ULL, __gu_p___42); } goto ldv_49649; switch_default___42: { __bad_unaligned_access_size(); } goto ldv_49649; } else { } } ldv_49649: tmp___32 = tags; tags = tags + 1; __gu_p___43 = (void *)tmp___32; if (1) { goto case_2___43; } else { goto switch_default___43; if (0) { *((u8 *)__gu_p___43) = (u8 )4U; goto ldv_49656; case_2___43: { put_unaligned_le16((u16 )4, __gu_p___43); } goto ldv_49656; { put_unaligned_le32(4U, __gu_p___43); } goto ldv_49656; { put_unaligned_le64(4ULL, __gu_p___43); } goto ldv_49656; switch_default___43: { __bad_unaligned_access_size(); } goto ldv_49656; } else { } } ldv_49656: __gu_p___44 = (void *)tags; if (1) { goto case_4___44; } else { goto switch_default___44; if (0) { *((u8 *)__gu_p___44) = (unsigned char )arg->after_sb_2p; goto ldv_49663; { put_unaligned_le16((u16 )((int )((unsigned short )arg->after_sb_2p)), __gu_p___44); } goto ldv_49663; case_4___44: { put_unaligned_le32((unsigned int )arg->after_sb_2p, __gu_p___44); } goto ldv_49663; { put_unaligned_le64((unsigned long long )arg->after_sb_2p, __gu_p___44); } goto ldv_49663; switch_default___44: { __bad_unaligned_access_size(); } goto ldv_49663; } else { } } ldv_49663: tags = tags + 4U; tmp___33 = tags; tags = tags + 1; __gu_p___45 = (void *)tmp___33; if (1) { goto case_2___45; } else { goto switch_default___45; if (0) { *((u8 *)__gu_p___45) = (u8 )39U; goto ldv_49670; case_2___45: { put_unaligned_le16((u16 )39, __gu_p___45); } goto ldv_49670; { put_unaligned_le32(39U, __gu_p___45); } goto ldv_49670; { put_unaligned_le64(39ULL, __gu_p___45); } goto ldv_49670; switch_default___45: { __bad_unaligned_access_size(); } goto ldv_49670; } else { } } ldv_49670: tmp___34 = tags; tags = tags + 1; __gu_p___46 = (void *)tmp___34; if (1) { goto case_2___46; } else { goto switch_default___46; if (0) { *((u8 *)__gu_p___46) = (u8 )4U; goto ldv_49677; case_2___46: { put_unaligned_le16((u16 )4, __gu_p___46); } goto ldv_49677; { put_unaligned_le32(4U, __gu_p___46); } goto ldv_49677; { put_unaligned_le64(4ULL, __gu_p___46); } goto ldv_49677; switch_default___46: { __bad_unaligned_access_size(); } goto ldv_49677; } else { } } ldv_49677: __gu_p___47 = (void *)tags; if (1) { goto case_4___47; } else { goto switch_default___47; if (0) { *((u8 *)__gu_p___47) = (unsigned char )arg->rr_conflict; goto ldv_49684; { put_unaligned_le16((u16 )((int )((unsigned short )arg->rr_conflict)), __gu_p___47); } goto ldv_49684; case_4___47: { put_unaligned_le32((unsigned int )arg->rr_conflict, __gu_p___47); } goto ldv_49684; { put_unaligned_le64((unsigned long long )arg->rr_conflict, __gu_p___47); } goto ldv_49684; switch_default___47: { __bad_unaligned_access_size(); } goto ldv_49684; } else { } } ldv_49684: tags = tags + 4U; tmp___35 = tags; tags = tags + 1; __gu_p___48 = (void *)tmp___35; if (1) { goto case_2___48; } else { goto switch_default___48; if (0) { *((u8 *)__gu_p___48) = (u8 )40U; goto ldv_49691; case_2___48: { put_unaligned_le16((u16 )40, __gu_p___48); } goto ldv_49691; { put_unaligned_le32(40U, __gu_p___48); } goto ldv_49691; { put_unaligned_le64(40ULL, __gu_p___48); } goto ldv_49691; switch_default___48: { __bad_unaligned_access_size(); } goto ldv_49691; } else { } } ldv_49691: tmp___36 = tags; tags = tags + 1; __gu_p___49 = (void *)tmp___36; if (1) { goto case_2___49; } else { goto switch_default___49; if (0) { *((u8 *)__gu_p___49) = (u8 )4U; goto ldv_49698; case_2___49: { put_unaligned_le16((u16 )4, __gu_p___49); } goto ldv_49698; { put_unaligned_le32(4U, __gu_p___49); } goto ldv_49698; { put_unaligned_le64(4ULL, __gu_p___49); } goto ldv_49698; switch_default___49: { __bad_unaligned_access_size(); } goto ldv_49698; } else { } } ldv_49698: __gu_p___50 = (void *)tags; if (1) { goto case_4___50; } else { goto switch_default___50; if (0) { *((u8 *)__gu_p___50) = (unsigned char )arg->ping_timeo; goto ldv_49705; { put_unaligned_le16((u16 )((int )((unsigned short )arg->ping_timeo)), __gu_p___50); } goto ldv_49705; case_4___50: { put_unaligned_le32((unsigned int )arg->ping_timeo, __gu_p___50); } goto ldv_49705; { put_unaligned_le64((unsigned long long )arg->ping_timeo, __gu_p___50); } goto ldv_49705; switch_default___50: { __bad_unaligned_access_size(); } goto ldv_49705; } else { } } ldv_49705: tags = tags + 4U; tmp___37 = tags; tags = tags + 1; __gu_p___51 = (void *)tmp___37; if (1) { goto case_2___51; } else { goto switch_default___51; if (0) { *((u8 *)__gu_p___51) = (u8 )67U; goto ldv_49712; case_2___51: { put_unaligned_le16((u16 )67, __gu_p___51); } goto ldv_49712; { put_unaligned_le32(67U, __gu_p___51); } goto ldv_49712; { put_unaligned_le64(67ULL, __gu_p___51); } goto ldv_49712; switch_default___51: { __bad_unaligned_access_size(); } goto ldv_49712; } else { } } ldv_49712: tmp___38 = tags; tags = tags + 1; __gu_p___52 = (void *)tmp___38; if (1) { goto case_2___52; } else { goto switch_default___52; if (0) { *((u8 *)__gu_p___52) = (u8 )4U; goto ldv_49719; case_2___52: { put_unaligned_le16((u16 )4, __gu_p___52); } goto ldv_49719; { put_unaligned_le32(4U, __gu_p___52); } goto ldv_49719; { put_unaligned_le64(4ULL, __gu_p___52); } goto ldv_49719; switch_default___52: { __bad_unaligned_access_size(); } goto ldv_49719; } else { } } ldv_49719: __gu_p___53 = (void *)tags; if (1) { goto case_4___53; } else { goto switch_default___53; if (0) { *((u8 *)__gu_p___53) = (unsigned char )arg->rcvbuf_size; goto ldv_49726; { put_unaligned_le16((u16 )((int )((unsigned short )arg->rcvbuf_size)), __gu_p___53); } goto ldv_49726; case_4___53: { put_unaligned_le32((unsigned int )arg->rcvbuf_size, __gu_p___53); } goto ldv_49726; { put_unaligned_le64((unsigned long long )arg->rcvbuf_size, __gu_p___53); } goto ldv_49726; switch_default___53: { __bad_unaligned_access_size(); } goto ldv_49726; } else { } } ldv_49726: tags = tags + 4U; tmp___39 = tags; tags = tags + 1; __gu_p___54 = (void *)tmp___39; if (1) { goto case_2___54; } else { goto switch_default___54; if (0) { *((u8 *)__gu_p___54) = (u8 )81U; goto ldv_49733; case_2___54: { put_unaligned_le16((u16 )81, __gu_p___54); } goto ldv_49733; { put_unaligned_le32(81U, __gu_p___54); } goto ldv_49733; { put_unaligned_le64(81ULL, __gu_p___54); } goto ldv_49733; switch_default___54: { __bad_unaligned_access_size(); } goto ldv_49733; } else { } } ldv_49733: tmp___40 = tags; tags = tags + 1; __gu_p___55 = (void *)tmp___40; if (1) { goto case_2___55; } else { goto switch_default___55; if (0) { *((u8 *)__gu_p___55) = (u8 )4U; goto ldv_49740; case_2___55: { put_unaligned_le16((u16 )4, __gu_p___55); } goto ldv_49740; { put_unaligned_le32(4U, __gu_p___55); } goto ldv_49740; { put_unaligned_le64(4ULL, __gu_p___55); } goto ldv_49740; switch_default___55: { __bad_unaligned_access_size(); } goto ldv_49740; } else { } } ldv_49740: __gu_p___56 = (void *)tags; if (1) { goto case_4___56; } else { goto switch_default___56; if (0) { *((u8 *)__gu_p___56) = (unsigned char )arg->on_congestion; goto ldv_49747; { put_unaligned_le16((u16 )((int )((unsigned short )arg->on_congestion)), __gu_p___56); } goto ldv_49747; case_4___56: { put_unaligned_le32((unsigned int )arg->on_congestion, __gu_p___56); } goto ldv_49747; { put_unaligned_le64((unsigned long long )arg->on_congestion, __gu_p___56); } goto ldv_49747; switch_default___56: { __bad_unaligned_access_size(); } goto ldv_49747; } else { } } ldv_49747: tags = tags + 4U; tmp___41 = tags; tags = tags + 1; __gu_p___57 = (void *)tmp___41; if (1) { goto case_2___57; } else { goto switch_default___57; if (0) { *((u8 *)__gu_p___57) = (u8 )82U; goto ldv_49754; case_2___57: { put_unaligned_le16((u16 )82, __gu_p___57); } goto ldv_49754; { put_unaligned_le32(82U, __gu_p___57); } goto ldv_49754; { put_unaligned_le64(82ULL, __gu_p___57); } goto ldv_49754; switch_default___57: { __bad_unaligned_access_size(); } goto ldv_49754; } else { } } ldv_49754: tmp___42 = tags; tags = tags + 1; __gu_p___58 = (void *)tmp___42; if (1) { goto case_2___58; } else { goto switch_default___58; if (0) { *((u8 *)__gu_p___58) = (u8 )4U; goto ldv_49761; case_2___58: { put_unaligned_le16((u16 )4, __gu_p___58); } goto ldv_49761; { put_unaligned_le32(4U, __gu_p___58); } goto ldv_49761; { put_unaligned_le64(4ULL, __gu_p___58); } goto ldv_49761; switch_default___58: { __bad_unaligned_access_size(); } goto ldv_49761; } else { } } ldv_49761: __gu_p___59 = (void *)tags; if (1) { goto case_4___59; } else { goto switch_default___59; if (0) { *((u8 *)__gu_p___59) = (unsigned char )arg->cong_fill; goto ldv_49768; { put_unaligned_le16((u16 )((int )((unsigned short )arg->cong_fill)), __gu_p___59); } goto ldv_49768; case_4___59: { put_unaligned_le32((unsigned int )arg->cong_fill, __gu_p___59); } goto ldv_49768; { put_unaligned_le64((unsigned long long )arg->cong_fill, __gu_p___59); } goto ldv_49768; switch_default___59: { __bad_unaligned_access_size(); } goto ldv_49768; } else { } } ldv_49768: tags = tags + 4U; tmp___43 = tags; tags = tags + 1; __gu_p___60 = (void *)tmp___43; if (1) { goto case_2___60; } else { goto switch_default___60; if (0) { *((u8 *)__gu_p___60) = (u8 )83U; goto ldv_49775; case_2___60: { put_unaligned_le16((u16 )83, __gu_p___60); } goto ldv_49775; { put_unaligned_le32(83U, __gu_p___60); } goto ldv_49775; { put_unaligned_le64(83ULL, __gu_p___60); } goto ldv_49775; switch_default___60: { __bad_unaligned_access_size(); } goto ldv_49775; } else { } } ldv_49775: tmp___44 = tags; tags = tags + 1; __gu_p___61 = (void *)tmp___44; if (1) { goto case_2___61; } else { goto switch_default___61; if (0) { *((u8 *)__gu_p___61) = (u8 )4U; goto ldv_49782; case_2___61: { put_unaligned_le16((u16 )4, __gu_p___61); } goto ldv_49782; { put_unaligned_le32(4U, __gu_p___61); } goto ldv_49782; { put_unaligned_le64(4ULL, __gu_p___61); } goto ldv_49782; switch_default___61: { __bad_unaligned_access_size(); } goto ldv_49782; } else { } } ldv_49782: __gu_p___62 = (void *)tags; if (1) { goto case_4___62; } else { goto switch_default___62; if (0) { *((u8 *)__gu_p___62) = (unsigned char )arg->cong_extents; goto ldv_49789; { put_unaligned_le16((u16 )((int )((unsigned short )arg->cong_extents)), __gu_p___62); } goto ldv_49789; case_4___62: { put_unaligned_le32((unsigned int )arg->cong_extents, __gu_p___62); } goto ldv_49789; { put_unaligned_le64((unsigned long long )arg->cong_extents, __gu_p___62); } goto ldv_49789; switch_default___62: { __bad_unaligned_access_size(); } goto ldv_49789; } else { } } ldv_49789: tags = tags + 4U; tmp___45 = tags; tags = tags + 1; __gu_p___63 = (void *)tmp___45; if (1) { goto case_2___63; } else { goto switch_default___63; if (0) { *((u8 *)__gu_p___63) = (u8 )60U; goto ldv_49796; case_2___63: { put_unaligned_le16((u16 )41020, __gu_p___63); } goto ldv_49796; { put_unaligned_le32(41020U, __gu_p___63); } goto ldv_49796; { put_unaligned_le64(41020ULL, __gu_p___63); } goto ldv_49796; switch_default___63: { __bad_unaligned_access_size(); } goto ldv_49796; } else { } } ldv_49796: tmp___46 = tags; tags = tags + 1; __gu_p___64 = (void *)tmp___46; if (1) { goto case_2___64; } else { goto switch_default___64; if (0) { *((u8 *)__gu_p___64) = (u8 )1U; goto ldv_49803; case_2___64: { put_unaligned_le16((u16 )1, __gu_p___64); } goto ldv_49803; { put_unaligned_le32(1U, __gu_p___64); } goto ldv_49803; { put_unaligned_le64(1ULL, __gu_p___64); } goto ldv_49803; switch_default___64: { __bad_unaligned_access_size(); } goto ldv_49803; } else { } } ldv_49803: *((char *)tags) = (char )arg->mind_af; tags = tags + 1U; tmp___47 = tags; tags = tags + 1; __gu_p___65 = (void *)tmp___47; if (1) { goto case_2___65; } else { goto switch_default___65; if (0) { *((u8 *)__gu_p___65) = (u8 )27U; goto ldv_49810; case_2___65: { put_unaligned_le16((u16 )32795, __gu_p___65); } goto ldv_49810; { put_unaligned_le32(32795U, __gu_p___65); } goto ldv_49810; { put_unaligned_le64(32795ULL, __gu_p___65); } goto ldv_49810; switch_default___65: { __bad_unaligned_access_size(); } goto ldv_49810; } else { } } ldv_49810: tmp___48 = tags; tags = tags + 1; __gu_p___66 = (void *)tmp___48; if (1) { goto case_2___66; } else { goto switch_default___66; if (0) { *((u8 *)__gu_p___66) = (u8 )1U; goto ldv_49817; case_2___66: { put_unaligned_le16((u16 )1, __gu_p___66); } goto ldv_49817; { put_unaligned_le32(1U, __gu_p___66); } goto ldv_49817; { put_unaligned_le64(1ULL, __gu_p___66); } goto ldv_49817; switch_default___66: { __bad_unaligned_access_size(); } goto ldv_49817; } else { } } ldv_49817: *((char *)tags) = (char )arg->want_lose; tags = tags + 1U; tmp___49 = tags; tags = tags + 1; __gu_p___67 = (void *)tmp___49; if (1) { goto case_2___67; } else { goto switch_default___67; if (0) { *((u8 *)__gu_p___67) = (u8 )28U; goto ldv_49824; case_2___67: { put_unaligned_le16((u16 )32796, __gu_p___67); } goto ldv_49824; { put_unaligned_le32(32796U, __gu_p___67); } goto ldv_49824; { put_unaligned_le64(32796ULL, __gu_p___67); } goto ldv_49824; switch_default___67: { __bad_unaligned_access_size(); } goto ldv_49824; } else { } } ldv_49824: tmp___50 = tags; tags = tags + 1; __gu_p___68 = (void *)tmp___50; if (1) { goto case_2___68; } else { goto switch_default___68; if (0) { *((u8 *)__gu_p___68) = (u8 )1U; goto ldv_49831; case_2___68: { put_unaligned_le16((u16 )1, __gu_p___68); } goto ldv_49831; { put_unaligned_le32(1U, __gu_p___68); } goto ldv_49831; { put_unaligned_le64(1ULL, __gu_p___68); } goto ldv_49831; switch_default___68: { __bad_unaligned_access_size(); } goto ldv_49831; } else { } } ldv_49831: *((char *)tags) = (char )arg->two_primaries; tags = tags + 1U; tmp___51 = tags; tags = tags + 1; __gu_p___69 = (void *)tmp___51; if (1) { goto case_2___69; } else { goto switch_default___69; if (0) { *((u8 *)__gu_p___69) = (u8 )41U; goto ldv_49838; case_2___69: { put_unaligned_le16((u16 )32809, __gu_p___69); } goto ldv_49838; { put_unaligned_le32(32809U, __gu_p___69); } goto ldv_49838; { put_unaligned_le64(32809ULL, __gu_p___69); } goto ldv_49838; switch_default___69: { __bad_unaligned_access_size(); } goto ldv_49838; } else { } } ldv_49838: tmp___52 = tags; tags = tags + 1; __gu_p___70 = (void *)tmp___52; if (1) { goto case_2___70; } else { goto switch_default___70; if (0) { *((u8 *)__gu_p___70) = (u8 )1U; goto ldv_49845; case_2___70: { put_unaligned_le16((u16 )1, __gu_p___70); } goto ldv_49845; { put_unaligned_le32(1U, __gu_p___70); } goto ldv_49845; { put_unaligned_le64(1ULL, __gu_p___70); } goto ldv_49845; switch_default___70: { __bad_unaligned_access_size(); } goto ldv_49845; } else { } } ldv_49845: *((char *)tags) = (char )arg->always_asbp; tags = tags + 1U; tmp___53 = tags; tags = tags + 1; __gu_p___71 = (void *)tmp___53; if (1) { goto case_2___71; } else { goto switch_default___71; if (0) { *((u8 *)__gu_p___71) = (u8 )61U; goto ldv_49852; case_2___71: { put_unaligned_le16((u16 )32829, __gu_p___71); } goto ldv_49852; { put_unaligned_le32(32829U, __gu_p___71); } goto ldv_49852; { put_unaligned_le64(32829ULL, __gu_p___71); } goto ldv_49852; switch_default___71: { __bad_unaligned_access_size(); } goto ldv_49852; } else { } } ldv_49852: tmp___54 = tags; tags = tags + 1; __gu_p___72 = (void *)tmp___54; if (1) { goto case_2___72; } else { goto switch_default___72; if (0) { *((u8 *)__gu_p___72) = (u8 )1U; goto ldv_49859; case_2___72: { put_unaligned_le16((u16 )1, __gu_p___72); } goto ldv_49859; { put_unaligned_le32(1U, __gu_p___72); } goto ldv_49859; { put_unaligned_le64(1ULL, __gu_p___72); } goto ldv_49859; switch_default___72: { __bad_unaligned_access_size(); } goto ldv_49859; } else { } } ldv_49859: *((char *)tags) = (char )arg->no_cork; tags = tags + 1U; tmp___55 = tags; tags = tags + 1; __gu_p___73 = (void *)tmp___55; if (1) { goto case_2___73; } else { goto switch_default___73; if (0) { *((u8 *)__gu_p___73) = (u8 )62U; goto ldv_49866; case_2___73: { put_unaligned_le16((u16 )41022, __gu_p___73); } goto ldv_49866; { put_unaligned_le32(41022U, __gu_p___73); } goto ldv_49866; { put_unaligned_le64(41022ULL, __gu_p___73); } goto ldv_49866; switch_default___73: { __bad_unaligned_access_size(); } goto ldv_49866; } else { } } ldv_49866: tmp___56 = tags; tags = tags + 1; __gu_p___74 = (void *)tmp___56; if (1) { goto case_2___74; } else { goto switch_default___74; if (0) { *((u8 *)__gu_p___74) = (u8 )1U; goto ldv_49873; case_2___74: { put_unaligned_le16((u16 )1, __gu_p___74); } goto ldv_49873; { put_unaligned_le32(1U, __gu_p___74); } goto ldv_49873; { put_unaligned_le64(1ULL, __gu_p___74); } goto ldv_49873; switch_default___74: { __bad_unaligned_access_size(); } goto ldv_49873; } else { } } ldv_49873: *((char *)tags) = (char )arg->auto_sndbuf_size; tags = tags + 1U; tmp___57 = tags; tags = tags + 1; __gu_p___75 = (void *)tmp___57; if (1) { goto case_2___75; } else { goto switch_default___75; if (0) { *((u8 *)__gu_p___75) = (u8 )70U; goto ldv_49880; case_2___75: { put_unaligned_le16((u16 )41030, __gu_p___75); } goto ldv_49880; { put_unaligned_le32(41030U, __gu_p___75); } goto ldv_49880; { put_unaligned_le64(41030ULL, __gu_p___75); } goto ldv_49880; switch_default___75: { __bad_unaligned_access_size(); } goto ldv_49880; } else { } } ldv_49880: tmp___58 = tags; tags = tags + 1; __gu_p___76 = (void *)tmp___58; if (1) { goto case_2___76; } else { goto switch_default___76; if (0) { *((u8 *)__gu_p___76) = (u8 )1U; goto ldv_49887; case_2___76: { put_unaligned_le16((u16 )1, __gu_p___76); } goto ldv_49887; { put_unaligned_le32(1U, __gu_p___76); } goto ldv_49887; { put_unaligned_le64(1ULL, __gu_p___76); } goto ldv_49887; switch_default___76: { __bad_unaligned_access_size(); } goto ldv_49887; } else { } } ldv_49887: *((char *)tags) = (char )arg->dry_run; tags = tags + 1U; return (tags); } } static unsigned short *syncer_conf_to_tags(struct drbd_conf *mdev , struct syncer_conf *arg , unsigned short *tags ) ; static unsigned short *syncer_conf_to_tags(struct drbd_conf *mdev , struct syncer_conf *arg , unsigned short *tags ) { void *__gu_p ; unsigned short *tmp ; void *__gu_p___0 ; unsigned short *tmp___0 ; void *__gu_p___1 ; void *__gu_p___2 ; unsigned short *tmp___1 ; void *__gu_p___3 ; unsigned short *tmp___2 ; void *__gu_p___4 ; void *__gu_p___5 ; unsigned short *tmp___3 ; void *__gu_p___6 ; unsigned short *tmp___4 ; void *__gu_p___7 ; void *__gu_p___8 ; unsigned short *tmp___5 ; void *__gu_p___9 ; unsigned short *tmp___6 ; size_t __len ; void *__ret ; void *__gu_p___10 ; unsigned short *tmp___7 ; void *__gu_p___11 ; unsigned short *tmp___8 ; size_t __len___0 ; void *__ret___0 ; void *__gu_p___12 ; unsigned short *tmp___9 ; void *__gu_p___13 ; unsigned short *tmp___10 ; size_t __len___1 ; void *__ret___1 ; void *__gu_p___14 ; unsigned short *tmp___11 ; void *__gu_p___15 ; unsigned short *tmp___12 ; void *__gu_p___16 ; unsigned short *tmp___13 ; void *__gu_p___17 ; unsigned short *tmp___14 ; void *__gu_p___18 ; void *__gu_p___19 ; unsigned short *tmp___15 ; void *__gu_p___20 ; unsigned short *tmp___16 ; void *__gu_p___21 ; void *__gu_p___22 ; unsigned short *tmp___17 ; void *__gu_p___23 ; unsigned short *tmp___18 ; void *__gu_p___24 ; void *__gu_p___25 ; unsigned short *tmp___19 ; void *__gu_p___26 ; unsigned short *tmp___20 ; void *__gu_p___27 ; void *__gu_p___28 ; unsigned short *tmp___21 ; void *__gu_p___29 ; unsigned short *tmp___22 ; void *__gu_p___30 ; void *__gu_p___31 ; unsigned short *tmp___23 ; void *__gu_p___32 ; unsigned short *tmp___24 ; void *__gu_p___33 ; { tmp = tags; tags = tags + 1; __gu_p = (void *)tmp; if (1) { goto case_2; } else { goto switch_default; if (0) { *((u8 *)__gu_p) = (u8 )30U; goto ldv_49984; case_2: { put_unaligned_le16((u16 )30, __gu_p); } goto ldv_49984; { put_unaligned_le32(30U, __gu_p); } goto ldv_49984; { put_unaligned_le64(30ULL, __gu_p); } goto ldv_49984; switch_default: { __bad_unaligned_access_size(); } goto ldv_49984; } else { } } ldv_49984: tmp___0 = tags; tags = tags + 1; __gu_p___0 = (void *)tmp___0; if (1) { goto case_2___0; } else { goto switch_default___0; if (0) { *((u8 *)__gu_p___0) = (u8 )4U; goto ldv_49991; case_2___0: { put_unaligned_le16((u16 )4, __gu_p___0); } goto ldv_49991; { put_unaligned_le32(4U, __gu_p___0); } goto ldv_49991; { put_unaligned_le64(4ULL, __gu_p___0); } goto ldv_49991; switch_default___0: { __bad_unaligned_access_size(); } goto ldv_49991; } else { } } ldv_49991: __gu_p___1 = (void *)tags; if (1) { goto case_4___1; } else { goto switch_default___1; if (0) { *((u8 *)__gu_p___1) = (unsigned char )arg->rate; goto ldv_49998; { put_unaligned_le16((u16 )((int )((unsigned short )arg->rate)), __gu_p___1); } goto ldv_49998; case_4___1: { put_unaligned_le32((unsigned int )arg->rate, __gu_p___1); } goto ldv_49998; { put_unaligned_le64((unsigned long long )arg->rate, __gu_p___1); } goto ldv_49998; switch_default___1: { __bad_unaligned_access_size(); } goto ldv_49998; } else { } } ldv_49998: tags = tags + 4U; tmp___1 = tags; tags = tags + 1; __gu_p___2 = (void *)tmp___1; if (1) { goto case_2___2; } else { goto switch_default___2; if (0) { *((u8 *)__gu_p___2) = (u8 )31U; goto ldv_50005; case_2___2: { put_unaligned_le16((u16 )31, __gu_p___2); } goto ldv_50005; { put_unaligned_le32(31U, __gu_p___2); } goto ldv_50005; { put_unaligned_le64(31ULL, __gu_p___2); } goto ldv_50005; switch_default___2: { __bad_unaligned_access_size(); } goto ldv_50005; } else { } } ldv_50005: tmp___2 = tags; tags = tags + 1; __gu_p___3 = (void *)tmp___2; if (1) { goto case_2___3; } else { goto switch_default___3; if (0) { *((u8 *)__gu_p___3) = (u8 )4U; goto ldv_50012; case_2___3: { put_unaligned_le16((u16 )4, __gu_p___3); } goto ldv_50012; { put_unaligned_le32(4U, __gu_p___3); } goto ldv_50012; { put_unaligned_le64(4ULL, __gu_p___3); } goto ldv_50012; switch_default___3: { __bad_unaligned_access_size(); } goto ldv_50012; } else { } } ldv_50012: __gu_p___4 = (void *)tags; if (1) { goto case_4___4; } else { goto switch_default___4; if (0) { *((u8 *)__gu_p___4) = (unsigned char )arg->after; goto ldv_50019; { put_unaligned_le16((u16 )((int )((unsigned short )arg->after)), __gu_p___4); } goto ldv_50019; case_4___4: { put_unaligned_le32((unsigned int )arg->after, __gu_p___4); } goto ldv_50019; { put_unaligned_le64((unsigned long long )arg->after, __gu_p___4); } goto ldv_50019; switch_default___4: { __bad_unaligned_access_size(); } goto ldv_50019; } else { } } ldv_50019: tags = tags + 4U; tmp___3 = tags; tags = tags + 1; __gu_p___5 = (void *)tmp___3; if (1) { goto case_2___5; } else { goto switch_default___5; if (0) { *((u8 *)__gu_p___5) = (u8 )32U; goto ldv_50026; case_2___5: { put_unaligned_le16((u16 )32, __gu_p___5); } goto ldv_50026; { put_unaligned_le32(32U, __gu_p___5); } goto ldv_50026; { put_unaligned_le64(32ULL, __gu_p___5); } goto ldv_50026; switch_default___5: { __bad_unaligned_access_size(); } goto ldv_50026; } else { } } ldv_50026: tmp___4 = tags; tags = tags + 1; __gu_p___6 = (void *)tmp___4; if (1) { goto case_2___6; } else { goto switch_default___6; if (0) { *((u8 *)__gu_p___6) = (u8 )4U; goto ldv_50033; case_2___6: { put_unaligned_le16((u16 )4, __gu_p___6); } goto ldv_50033; { put_unaligned_le32(4U, __gu_p___6); } goto ldv_50033; { put_unaligned_le64(4ULL, __gu_p___6); } goto ldv_50033; switch_default___6: { __bad_unaligned_access_size(); } goto ldv_50033; } else { } } ldv_50033: __gu_p___7 = (void *)tags; if (1) { goto case_4___7; } else { goto switch_default___7; if (0) { *((u8 *)__gu_p___7) = (unsigned char )arg->al_extents; goto ldv_50040; { put_unaligned_le16((u16 )((int )((unsigned short )arg->al_extents)), __gu_p___7); } goto ldv_50040; case_4___7: { put_unaligned_le32((unsigned int )arg->al_extents, __gu_p___7); } goto ldv_50040; { put_unaligned_le64((unsigned long long )arg->al_extents, __gu_p___7); } goto ldv_50040; switch_default___7: { __bad_unaligned_access_size(); } goto ldv_50040; } else { } } ldv_50040: tags = tags + 4U; tmp___5 = tags; tags = tags + 1; __gu_p___8 = (void *)tmp___5; if (1) { goto case_2___8; } else { goto switch_default___8; if (0) { *((u8 *)__gu_p___8) = (u8 )52U; goto ldv_50047; case_2___8: { put_unaligned_le16((u16 )49204, __gu_p___8); } goto ldv_50047; { put_unaligned_le32(49204U, __gu_p___8); } goto ldv_50047; { put_unaligned_le64(49204ULL, __gu_p___8); } goto ldv_50047; switch_default___8: { __bad_unaligned_access_size(); } goto ldv_50047; } else { } } ldv_50047: tmp___6 = tags; tags = tags + 1; __gu_p___9 = (void *)tmp___6; if (1) { goto case_2___9; } else { goto switch_default___9; if (0) { *((u8 *)__gu_p___9) = (unsigned char )arg->verify_alg_len; goto ldv_50054; case_2___9: { put_unaligned_le16((u16 )((int )((unsigned short )arg->verify_alg_len)), __gu_p___9); } goto ldv_50054; { put_unaligned_le32((unsigned int )arg->verify_alg_len, __gu_p___9); } goto ldv_50054; { put_unaligned_le64((unsigned long long )arg->verify_alg_len, __gu_p___9); } goto ldv_50054; switch_default___9: { __bad_unaligned_access_size(); } goto ldv_50054; } else { } } ldv_50054: { __len = (size_t )arg->verify_alg_len; __ret = __builtin_memcpy((void *)tags, (void const *)(& arg->verify_alg), __len); tags = tags + (unsigned long )arg->verify_alg_len; tmp___7 = tags; tags = tags + 1; __gu_p___10 = (void *)tmp___7; } if (1) { goto case_2___10; } else { goto switch_default___10; if (0) { *((u8 *)__gu_p___10) = (u8 )51U; goto ldv_50064; case_2___10: { put_unaligned_le16((u16 )49203, __gu_p___10); } goto ldv_50064; { put_unaligned_le32(49203U, __gu_p___10); } goto ldv_50064; { put_unaligned_le64(49203ULL, __gu_p___10); } goto ldv_50064; switch_default___10: { __bad_unaligned_access_size(); } goto ldv_50064; } else { } } ldv_50064: tmp___8 = tags; tags = tags + 1; __gu_p___11 = (void *)tmp___8; if (1) { goto case_2___11; } else { goto switch_default___11; if (0) { *((u8 *)__gu_p___11) = (unsigned char )arg->cpu_mask_len; goto ldv_50071; case_2___11: { put_unaligned_le16((u16 )((int )((unsigned short )arg->cpu_mask_len)), __gu_p___11); } goto ldv_50071; { put_unaligned_le32((unsigned int )arg->cpu_mask_len, __gu_p___11); } goto ldv_50071; { put_unaligned_le64((unsigned long long )arg->cpu_mask_len, __gu_p___11); } goto ldv_50071; switch_default___11: { __bad_unaligned_access_size(); } goto ldv_50071; } else { } } ldv_50071: { __len___0 = (size_t )arg->cpu_mask_len; __ret___0 = __builtin_memcpy((void *)tags, (void const *)(& arg->cpu_mask), __len___0); tags = tags + (unsigned long )arg->cpu_mask_len; tmp___9 = tags; tags = tags + 1; __gu_p___12 = (void *)tmp___9; } if (1) { goto case_2___12; } else { goto switch_default___12; if (0) { *((u8 *)__gu_p___12) = (u8 )64U; goto ldv_50081; case_2___12: { put_unaligned_le16((u16 )49216, __gu_p___12); } goto ldv_50081; { put_unaligned_le32(49216U, __gu_p___12); } goto ldv_50081; { put_unaligned_le64(49216ULL, __gu_p___12); } goto ldv_50081; switch_default___12: { __bad_unaligned_access_size(); } goto ldv_50081; } else { } } ldv_50081: tmp___10 = tags; tags = tags + 1; __gu_p___13 = (void *)tmp___10; if (1) { goto case_2___13; } else { goto switch_default___13; if (0) { *((u8 *)__gu_p___13) = (unsigned char )arg->csums_alg_len; goto ldv_50088; case_2___13: { put_unaligned_le16((u16 )((int )((unsigned short )arg->csums_alg_len)), __gu_p___13); } goto ldv_50088; { put_unaligned_le32((unsigned int )arg->csums_alg_len, __gu_p___13); } goto ldv_50088; { put_unaligned_le64((unsigned long long )arg->csums_alg_len, __gu_p___13); } goto ldv_50088; switch_default___13: { __bad_unaligned_access_size(); } goto ldv_50088; } else { } } ldv_50088: { __len___1 = (size_t )arg->csums_alg_len; __ret___1 = __builtin_memcpy((void *)tags, (void const *)(& arg->csums_alg), __len___1); tags = tags + (unsigned long )arg->csums_alg_len; tmp___11 = tags; tags = tags + 1; __gu_p___14 = (void *)tmp___11; } if (1) { goto case_2___14; } else { goto switch_default___14; if (0) { *((u8 *)__gu_p___14) = (u8 )65U; goto ldv_50098; case_2___14: { put_unaligned_le16((u16 )32833, __gu_p___14); } goto ldv_50098; { put_unaligned_le32(32833U, __gu_p___14); } goto ldv_50098; { put_unaligned_le64(32833ULL, __gu_p___14); } goto ldv_50098; switch_default___14: { __bad_unaligned_access_size(); } goto ldv_50098; } else { } } ldv_50098: tmp___12 = tags; tags = tags + 1; __gu_p___15 = (void *)tmp___12; if (1) { goto case_2___15; } else { goto switch_default___15; if (0) { *((u8 *)__gu_p___15) = (u8 )1U; goto ldv_50105; case_2___15: { put_unaligned_le16((u16 )1, __gu_p___15); } goto ldv_50105; { put_unaligned_le32(1U, __gu_p___15); } goto ldv_50105; { put_unaligned_le64(1ULL, __gu_p___15); } goto ldv_50105; switch_default___15: { __bad_unaligned_access_size(); } goto ldv_50105; } else { } } ldv_50105: *((char *)tags) = (char )arg->use_rle; tags = tags + 1U; tmp___13 = tags; tags = tags + 1; __gu_p___16 = (void *)tmp___13; if (1) { goto case_2___16; } else { goto switch_default___16; if (0) { *((u8 *)__gu_p___16) = (u8 )75U; goto ldv_50112; case_2___16: { put_unaligned_le16((u16 )75, __gu_p___16); } goto ldv_50112; { put_unaligned_le32(75U, __gu_p___16); } goto ldv_50112; { put_unaligned_le64(75ULL, __gu_p___16); } goto ldv_50112; switch_default___16: { __bad_unaligned_access_size(); } goto ldv_50112; } else { } } ldv_50112: tmp___14 = tags; tags = tags + 1; __gu_p___17 = (void *)tmp___14; if (1) { goto case_2___17; } else { goto switch_default___17; if (0) { *((u8 *)__gu_p___17) = (u8 )4U; goto ldv_50119; case_2___17: { put_unaligned_le16((u16 )4, __gu_p___17); } goto ldv_50119; { put_unaligned_le32(4U, __gu_p___17); } goto ldv_50119; { put_unaligned_le64(4ULL, __gu_p___17); } goto ldv_50119; switch_default___17: { __bad_unaligned_access_size(); } goto ldv_50119; } else { } } ldv_50119: __gu_p___18 = (void *)tags; if (1) { goto case_4___18; } else { goto switch_default___18; if (0) { *((u8 *)__gu_p___18) = (unsigned char )arg->on_no_data; goto ldv_50126; { put_unaligned_le16((u16 )((int )((unsigned short )arg->on_no_data)), __gu_p___18); } goto ldv_50126; case_4___18: { put_unaligned_le32((unsigned int )arg->on_no_data, __gu_p___18); } goto ldv_50126; { put_unaligned_le64((unsigned long long )arg->on_no_data, __gu_p___18); } goto ldv_50126; switch_default___18: { __bad_unaligned_access_size(); } goto ldv_50126; } else { } } ldv_50126: tags = tags + 4U; tmp___15 = tags; tags = tags + 1; __gu_p___19 = (void *)tmp___15; if (1) { goto case_2___19; } else { goto switch_default___19; if (0) { *((u8 *)__gu_p___19) = (u8 )76U; goto ldv_50133; case_2___19: { put_unaligned_le16((u16 )76, __gu_p___19); } goto ldv_50133; { put_unaligned_le32(76U, __gu_p___19); } goto ldv_50133; { put_unaligned_le64(76ULL, __gu_p___19); } goto ldv_50133; switch_default___19: { __bad_unaligned_access_size(); } goto ldv_50133; } else { } } ldv_50133: tmp___16 = tags; tags = tags + 1; __gu_p___20 = (void *)tmp___16; if (1) { goto case_2___20; } else { goto switch_default___20; if (0) { *((u8 *)__gu_p___20) = (u8 )4U; goto ldv_50140; case_2___20: { put_unaligned_le16((u16 )4, __gu_p___20); } goto ldv_50140; { put_unaligned_le32(4U, __gu_p___20); } goto ldv_50140; { put_unaligned_le64(4ULL, __gu_p___20); } goto ldv_50140; switch_default___20: { __bad_unaligned_access_size(); } goto ldv_50140; } else { } } ldv_50140: __gu_p___21 = (void *)tags; if (1) { goto case_4___21; } else { goto switch_default___21; if (0) { *((u8 *)__gu_p___21) = (unsigned char )arg->c_plan_ahead; goto ldv_50147; { put_unaligned_le16((u16 )((int )((unsigned short )arg->c_plan_ahead)), __gu_p___21); } goto ldv_50147; case_4___21: { put_unaligned_le32((unsigned int )arg->c_plan_ahead, __gu_p___21); } goto ldv_50147; { put_unaligned_le64((unsigned long long )arg->c_plan_ahead, __gu_p___21); } goto ldv_50147; switch_default___21: { __bad_unaligned_access_size(); } goto ldv_50147; } else { } } ldv_50147: tags = tags + 4U; tmp___17 = tags; tags = tags + 1; __gu_p___22 = (void *)tmp___17; if (1) { goto case_2___22; } else { goto switch_default___22; if (0) { *((u8 *)__gu_p___22) = (u8 )77U; goto ldv_50154; case_2___22: { put_unaligned_le16((u16 )77, __gu_p___22); } goto ldv_50154; { put_unaligned_le32(77U, __gu_p___22); } goto ldv_50154; { put_unaligned_le64(77ULL, __gu_p___22); } goto ldv_50154; switch_default___22: { __bad_unaligned_access_size(); } goto ldv_50154; } else { } } ldv_50154: tmp___18 = tags; tags = tags + 1; __gu_p___23 = (void *)tmp___18; if (1) { goto case_2___23; } else { goto switch_default___23; if (0) { *((u8 *)__gu_p___23) = (u8 )4U; goto ldv_50161; case_2___23: { put_unaligned_le16((u16 )4, __gu_p___23); } goto ldv_50161; { put_unaligned_le32(4U, __gu_p___23); } goto ldv_50161; { put_unaligned_le64(4ULL, __gu_p___23); } goto ldv_50161; switch_default___23: { __bad_unaligned_access_size(); } goto ldv_50161; } else { } } ldv_50161: __gu_p___24 = (void *)tags; if (1) { goto case_4___24; } else { goto switch_default___24; if (0) { *((u8 *)__gu_p___24) = (unsigned char )arg->c_delay_target; goto ldv_50168; { put_unaligned_le16((u16 )((int )((unsigned short )arg->c_delay_target)), __gu_p___24); } goto ldv_50168; case_4___24: { put_unaligned_le32((unsigned int )arg->c_delay_target, __gu_p___24); } goto ldv_50168; { put_unaligned_le64((unsigned long long )arg->c_delay_target, __gu_p___24); } goto ldv_50168; switch_default___24: { __bad_unaligned_access_size(); } goto ldv_50168; } else { } } ldv_50168: tags = tags + 4U; tmp___19 = tags; tags = tags + 1; __gu_p___25 = (void *)tmp___19; if (1) { goto case_2___25; } else { goto switch_default___25; if (0) { *((u8 *)__gu_p___25) = (u8 )78U; goto ldv_50175; case_2___25: { put_unaligned_le16((u16 )78, __gu_p___25); } goto ldv_50175; { put_unaligned_le32(78U, __gu_p___25); } goto ldv_50175; { put_unaligned_le64(78ULL, __gu_p___25); } goto ldv_50175; switch_default___25: { __bad_unaligned_access_size(); } goto ldv_50175; } else { } } ldv_50175: tmp___20 = tags; tags = tags + 1; __gu_p___26 = (void *)tmp___20; if (1) { goto case_2___26; } else { goto switch_default___26; if (0) { *((u8 *)__gu_p___26) = (u8 )4U; goto ldv_50182; case_2___26: { put_unaligned_le16((u16 )4, __gu_p___26); } goto ldv_50182; { put_unaligned_le32(4U, __gu_p___26); } goto ldv_50182; { put_unaligned_le64(4ULL, __gu_p___26); } goto ldv_50182; switch_default___26: { __bad_unaligned_access_size(); } goto ldv_50182; } else { } } ldv_50182: __gu_p___27 = (void *)tags; if (1) { goto case_4___27; } else { goto switch_default___27; if (0) { *((u8 *)__gu_p___27) = (unsigned char )arg->c_fill_target; goto ldv_50189; { put_unaligned_le16((u16 )((int )((unsigned short )arg->c_fill_target)), __gu_p___27); } goto ldv_50189; case_4___27: { put_unaligned_le32((unsigned int )arg->c_fill_target, __gu_p___27); } goto ldv_50189; { put_unaligned_le64((unsigned long long )arg->c_fill_target, __gu_p___27); } goto ldv_50189; switch_default___27: { __bad_unaligned_access_size(); } goto ldv_50189; } else { } } ldv_50189: tags = tags + 4U; tmp___21 = tags; tags = tags + 1; __gu_p___28 = (void *)tmp___21; if (1) { goto case_2___28; } else { goto switch_default___28; if (0) { *((u8 *)__gu_p___28) = (u8 )79U; goto ldv_50196; case_2___28: { put_unaligned_le16((u16 )79, __gu_p___28); } goto ldv_50196; { put_unaligned_le32(79U, __gu_p___28); } goto ldv_50196; { put_unaligned_le64(79ULL, __gu_p___28); } goto ldv_50196; switch_default___28: { __bad_unaligned_access_size(); } goto ldv_50196; } else { } } ldv_50196: tmp___22 = tags; tags = tags + 1; __gu_p___29 = (void *)tmp___22; if (1) { goto case_2___29; } else { goto switch_default___29; if (0) { *((u8 *)__gu_p___29) = (u8 )4U; goto ldv_50203; case_2___29: { put_unaligned_le16((u16 )4, __gu_p___29); } goto ldv_50203; { put_unaligned_le32(4U, __gu_p___29); } goto ldv_50203; { put_unaligned_le64(4ULL, __gu_p___29); } goto ldv_50203; switch_default___29: { __bad_unaligned_access_size(); } goto ldv_50203; } else { } } ldv_50203: __gu_p___30 = (void *)tags; if (1) { goto case_4___30; } else { goto switch_default___30; if (0) { *((u8 *)__gu_p___30) = (unsigned char )arg->c_max_rate; goto ldv_50210; { put_unaligned_le16((u16 )((int )((unsigned short )arg->c_max_rate)), __gu_p___30); } goto ldv_50210; case_4___30: { put_unaligned_le32((unsigned int )arg->c_max_rate, __gu_p___30); } goto ldv_50210; { put_unaligned_le64((unsigned long long )arg->c_max_rate, __gu_p___30); } goto ldv_50210; switch_default___30: { __bad_unaligned_access_size(); } goto ldv_50210; } else { } } ldv_50210: tags = tags + 4U; tmp___23 = tags; tags = tags + 1; __gu_p___31 = (void *)tmp___23; if (1) { goto case_2___31; } else { goto switch_default___31; if (0) { *((u8 *)__gu_p___31) = (u8 )80U; goto ldv_50217; case_2___31: { put_unaligned_le16((u16 )80, __gu_p___31); } goto ldv_50217; { put_unaligned_le32(80U, __gu_p___31); } goto ldv_50217; { put_unaligned_le64(80ULL, __gu_p___31); } goto ldv_50217; switch_default___31: { __bad_unaligned_access_size(); } goto ldv_50217; } else { } } ldv_50217: tmp___24 = tags; tags = tags + 1; __gu_p___32 = (void *)tmp___24; if (1) { goto case_2___32; } else { goto switch_default___32; if (0) { *((u8 *)__gu_p___32) = (u8 )4U; goto ldv_50224; case_2___32: { put_unaligned_le16((u16 )4, __gu_p___32); } goto ldv_50224; { put_unaligned_le32(4U, __gu_p___32); } goto ldv_50224; { put_unaligned_le64(4ULL, __gu_p___32); } goto ldv_50224; switch_default___32: { __bad_unaligned_access_size(); } goto ldv_50224; } else { } } ldv_50224: __gu_p___33 = (void *)tags; if (1) { goto case_4___33; } else { goto switch_default___33; if (0) { *((u8 *)__gu_p___33) = (unsigned char )arg->c_min_rate; goto ldv_50231; { put_unaligned_le16((u16 )((int )((unsigned short )arg->c_min_rate)), __gu_p___33); } goto ldv_50231; case_4___33: { put_unaligned_le32((unsigned int )arg->c_min_rate, __gu_p___33); } goto ldv_50231; { put_unaligned_le64((unsigned long long )arg->c_min_rate, __gu_p___33); } goto ldv_50231; switch_default___33: { __bad_unaligned_access_size(); } goto ldv_50231; } else { } } ldv_50231: tags = tags + 4U; return (tags); } } static unsigned short *get_state_to_tags(struct drbd_conf *mdev , struct get_state *arg , unsigned short *tags ) ; static unsigned short *get_state_to_tags(struct drbd_conf *mdev , struct get_state *arg , unsigned short *tags ) { void *__gu_p ; unsigned short *tmp ; void *__gu_p___0 ; unsigned short *tmp___0 ; void *__gu_p___1 ; { tmp = tags; tags = tags + 1; __gu_p = (void *)tmp; if (1) { goto case_2; } else { goto switch_default; if (0) { *((u8 *)__gu_p) = (u8 )33U; goto ldv_50319; case_2: { put_unaligned_le16((u16 )33, __gu_p); } goto ldv_50319; { put_unaligned_le32(33U, __gu_p); } goto ldv_50319; { put_unaligned_le64(33ULL, __gu_p); } goto ldv_50319; switch_default: { __bad_unaligned_access_size(); } goto ldv_50319; } else { } } ldv_50319: tmp___0 = tags; tags = tags + 1; __gu_p___0 = (void *)tmp___0; if (1) { goto case_2___0; } else { goto switch_default___0; if (0) { *((u8 *)__gu_p___0) = (u8 )4U; goto ldv_50326; case_2___0: { put_unaligned_le16((u16 )4, __gu_p___0); } goto ldv_50326; { put_unaligned_le32(4U, __gu_p___0); } goto ldv_50326; { put_unaligned_le64(4ULL, __gu_p___0); } goto ldv_50326; switch_default___0: { __bad_unaligned_access_size(); } goto ldv_50326; } else { } } ldv_50326: __gu_p___1 = (void *)tags; if (1) { goto case_4___1; } else { goto switch_default___1; if (0) { *((u8 *)__gu_p___1) = (unsigned char )arg->state_i; goto ldv_50333; { put_unaligned_le16((u16 )((int )((unsigned short )arg->state_i)), __gu_p___1); } goto ldv_50333; case_4___1: { put_unaligned_le32((unsigned int )arg->state_i, __gu_p___1); } goto ldv_50333; { put_unaligned_le64((unsigned long long )arg->state_i, __gu_p___1); } goto ldv_50333; switch_default___1: { __bad_unaligned_access_size(); } goto ldv_50333; } else { } } ldv_50333: tags = tags + 4U; return (tags); } } void drbd_bcast_ev_helper(struct drbd_conf *mdev , char *helper_name ) ; void drbd_nl_send_reply(struct cn_msg *req , int ret_code ) ; int drbd_khelper(struct drbd_conf *mdev , char *cmd ) { char *envp[6U] ; char mb[12U] ; char af[20U] ; char ad[60U] ; char *afs ; char *argv[4U] ; int ret ; unsigned int tmp ; int tmp___0 ; { { envp[0] = (char *)"HOME=/"; envp[1] = (char *)"TERM=linux"; envp[2] = (char *)"PATH=/sbin:/usr/sbin:/bin:/usr/bin"; envp[3] = (char *)0; envp[4] = (char *)0; envp[5] = (char *)0; argv[0] = (char *)(& usermode_helper); argv[1] = cmd; argv[2] = (char *)(& mb); argv[3] = (char *)0; tmp = mdev_to_minor(mdev); snprintf((char *)(& mb), 12UL, "minor-%d", tmp); tmp___0 = get_net_conf(mdev); } if (tmp___0 != 0) { if ((int )((struct sockaddr *)(& (mdev->net_conf)->peer_addr))->sa_family == 10) { goto case_10; } else if ((int )((struct sockaddr *)(& (mdev->net_conf)->peer_addr))->sa_family == 2) { goto case_2; } else { goto switch_default; if (0) { case_10: { afs = (char *)"ipv6"; snprintf((char *)(& ad), 60UL, "DRBD_PEER_ADDRESS=%pI6", & ((struct sockaddr_in6 *)(& (mdev->net_conf)->peer_addr))->sin6_addr); } goto ldv_50654; case_2: { afs = (char *)"ipv4"; snprintf((char *)(& ad), 60UL, "DRBD_PEER_ADDRESS=%pI4", & ((struct sockaddr_in *)(& (mdev->net_conf)->peer_addr))->sin_addr); } goto ldv_50654; switch_default: { afs = (char *)"ssocks"; snprintf((char *)(& ad), 60UL, "DRBD_PEER_ADDRESS=%pI4", & ((struct sockaddr_in *)(& (mdev->net_conf)->peer_addr))->sin_addr); } } else { } } ldv_50654: { snprintf((char *)(& af), 20UL, "DRBD_PEER_AF=%s", afs); envp[3] = (char *)(& af); envp[4] = (char *)(& ad); put_net_conf(mdev); } } else { } { drbd_md_sync(mdev); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "helper command: %s %s %s\n", (char *)(& usermode_helper), cmd, (char *)(& mb)); drbd_bcast_ev_helper(mdev, cmd); ret = call_usermodehelper((char *)(& usermode_helper), (char **)(& argv), (char **)(& envp), (enum umh_wait )1); } if (ret != 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "helper command: %s %s %s exit code %u (0x%x)\n", (char *)(& usermode_helper), cmd, (char *)(& mb), (ret >> 8) & 255, ret); } } else { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "helper command: %s %s %s exit code %u (0x%x)\n", (char *)(& usermode_helper), cmd, (char *)(& mb), (ret >> 8) & 255, ret); } } if (ret < 0) { ret = 0; } else { } return (ret); } } enum drbd_disk_state drbd_try_outdate_peer(struct drbd_conf *mdev ) { char *ex_to_string ; int r ; enum drbd_disk_state nps ; enum drbd_fencing_p fp ; int tmp ; union drbd_state val ; union drbd_state mask ; union drbd_state val___0 ; union drbd_state mask___0 ; { if (*((unsigned int *)mdev + 569UL) != 49152U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.pdsk == D_UNKNOWN ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_nl.c.p", 212); } } else { } { tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )7); } if (tmp != 0) { { fp = (enum drbd_fencing_p )(mdev->ldev)->dc.fencing; put_ldev(mdev); } } else { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Not fencing peer, I\'m not even Consistent myself.\n"); nps = (enum drbd_disk_state )mdev->state.ldv_38339.pdsk; } goto out; } { r = drbd_khelper(mdev, (char *)"fence-peer"); } if (((r >> 8) & 255) == 3) { goto case_3; } else if (((r >> 8) & 255) == 4) { goto case_4; } else if (((r >> 8) & 255) == 5) { goto case_5; } else if (((r >> 8) & 255) == 6) { goto case_6; } else if (((r >> 8) & 255) == 7) { goto case_7; } else { goto switch_default; if (0) { case_3: ex_to_string = (char *)"peer is inconsistent or worse"; nps = (enum drbd_disk_state )4; goto ldv_50666; case_4: ex_to_string = (char *)"peer was fenced"; nps = (enum drbd_disk_state )5; goto ldv_50666; case_5: ; if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 16U) { ex_to_string = (char *)"peer is unreachable, assumed to be dead"; nps = (enum drbd_disk_state )5; } else { ex_to_string = (char *)"peer unreachable, doing nothing since disk != UpToDate"; nps = (enum drbd_disk_state )mdev->state.ldv_38339.pdsk; } goto ldv_50666; case_6: { ex_to_string = (char *)"peer is active"; dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Peer is primary, outdating myself.\n"); nps = (enum drbd_disk_state )6; val.i = 0U; val.ldv_38339.disk = (unsigned char)5; mask.i = 0U; mask.ldv_38339.disk = (unsigned char)15; _drbd_request_state(mdev, mask, val, (enum chg_state_flags )4); } goto ldv_50666; case_7: ; if ((unsigned int )fp != 2U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "fence-peer() = 7 && fencing != Stonith !!!\n"); } } else { } ex_to_string = (char *)"peer was stonithed"; nps = (enum drbd_disk_state )5; goto ldv_50666; switch_default: { nps = (enum drbd_disk_state )6; dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "fence-peer helper broken, returned %d\n", (r >> 8) & 255); } return (nps); } else { } } ldv_50666: { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "fence-peer helper returned %d (%s)\n", (r >> 8) & 255, ex_to_string); } out: ; if ((unsigned int )*((unsigned char *)mdev + 2278UL) != 0U) { if ((unsigned int )nps > 5U) { { val___0.i = 0U; val___0.ldv_38339.susp_fen = (unsigned char)0; mask___0.i = 0U; mask___0.ldv_38339.susp_fen = (unsigned char)1; _drbd_request_state(mdev, mask___0, val___0, (enum chg_state_flags )2); } } else { } } else { } return (nps); } } static int _try_outdate_peer_async(void *data ) { struct drbd_conf *mdev ; enum drbd_disk_state nps ; union drbd_state ns ; { { mdev = (struct drbd_conf *)data; nps = drbd_try_outdate_peer(mdev); spin_lock_irq(& mdev->req_lock); ns = mdev->state; } if ((int )ns.ldv_38339.conn <= 8) { { ns.ldv_38339.pdsk = (unsigned char )nps; _drbd_set_state(mdev, ns, (enum chg_state_flags )2, (struct completion *)0); } } else { } { spin_unlock_irq(& mdev->req_lock); } return (0); } } void drbd_try_outdate_peer_async(struct drbd_conf *mdev ) { struct task_struct *opa ; struct task_struct *__k ; unsigned int tmp ; struct task_struct *tmp___0 ; long tmp___1 ; long tmp___2 ; { { tmp = mdev_to_minor(mdev); tmp___0 = kthread_create_on_node(& _try_outdate_peer_async, (void *)mdev, -1, "drbd%d_a_helper", tmp); __k = tmp___0; tmp___1 = IS_ERR((void const *)__k); } if (tmp___1 == 0L) { { wake_up_process(__k); } } else { } { opa = __k; tmp___2 = IS_ERR((void const *)opa); } if (tmp___2 != 0L) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "out of mem, failed to invoke fence-peer helper\n"); } } else { } return; } } enum drbd_state_rv drbd_set_role(struct drbd_conf *mdev , enum drbd_role new_role , int force ) { int max_tries ; enum drbd_state_rv rv ; int try ; int forced ; union drbd_state mask ; union drbd_state val ; enum drbd_disk_state nps ; int tmp ; int tmp___0 ; wait_queue_t __wait ; struct task_struct *tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { max_tries = 4; rv = (enum drbd_state_rv )0; try = 0; forced = 0; if ((unsigned int )new_role == 1U) { { request_ping(mdev); } } else { } { mutex_lock_nested(& mdev->state_mutex, 0U); mask.i = 0U; mask.ldv_38339.role = (unsigned char)3; val.i = 0U; val.ldv_38339.role = (unsigned char )new_role; } goto ldv_50704; ldv_50707: { rv = _drbd_request_state(mdev, mask, val, (enum chg_state_flags )4); } if ((int )rv == -10) { if (*((unsigned int *)(& mask) + 0UL) != 0U) { val.ldv_38339.pdsk = (unsigned char)0; mask.ldv_38339.pdsk = (unsigned char)0; goto ldv_50704; } else { } } else { } if ((int )rv == -2) { if (force != 0) { if ((int )mdev->state.ldv_38339.disk <= 7) { if ((int )mdev->state.ldv_38339.disk > 3) { mask.ldv_38339.disk = (unsigned char)15; val.ldv_38339.disk = (unsigned char)8; forced = 1; goto ldv_50704; } else { } } else { } } else { } } else { } if ((int )rv == -2) { if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 14U) { if (*((unsigned int *)(& mask) + 0UL) == 0U) { if (*((unsigned int *)mdev + 569UL) != 49152U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.pdsk == D_UNKNOWN ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_nl.c.p", 357); } } else { } { nps = drbd_try_outdate_peer(mdev); } if ((unsigned int )nps == 5U) { val.ldv_38339.disk = (unsigned char)8; mask.ldv_38339.disk = (unsigned char)15; } else if ((unsigned int )nps == 4U) { val.ldv_38339.disk = (unsigned char)8; mask.ldv_38339.disk = (unsigned char)15; } else { } val.ldv_38339.pdsk = (unsigned char )nps; mask.ldv_38339.pdsk = (unsigned char)15; goto ldv_50704; } else { } } else { } } else { } if ((int )rv == 2) { goto fail; } else { } if ((int )rv == -7) { if (*((unsigned int *)(& mask) + 0UL) == 0U) { { nps = drbd_try_outdate_peer(mdev); } if (force != 0) { if ((unsigned int )nps > 5U) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Forced into split brain situation!\n"); nps = (enum drbd_disk_state )5; } } else { } } else { } mask.ldv_38339.pdsk = (unsigned char)15; val.ldv_38339.pdsk = (unsigned char )nps; goto ldv_50704; } else { } } else { } if ((int )rv == -1) { { schedule_timeout_interruptible((long )((((mdev->net_conf)->ping_timeo + 1) * 250) / 10)); } if (try < max_tries) { try = max_tries + -1; } else { } goto ldv_50704; } else { } if ((int )rv <= 0) { { rv = _drbd_request_state(mdev, mask, val, (enum chg_state_flags )6); } if ((int )rv <= 0) { goto fail; } else { } } else { } goto ldv_50706; ldv_50704: tmp = try; try = try + 1; if (tmp < max_tries) { goto ldv_50707; } else { goto ldv_50706; } ldv_50706: ; if ((int )rv <= 0) { goto fail; } else { } if (forced != 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Forced to consider local data as UpToDate!\n"); } } else { } { tmp___0 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); } if (tmp___0 == 0) { goto ldv_50708; } else { } { tmp___1 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___1; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_50711: { prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___2 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); } if (tmp___2 == 0) { goto ldv_50710; } else { } { schedule(); } goto ldv_50711; ldv_50710: { finish_wait(& mdev->misc_wait, & __wait); } ldv_50708: ; if ((unsigned int )new_role == 2U) { { set_disk_ro(mdev->vdisk, 1); tmp___3 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___3 != 0) { { (mdev->ldev)->md.uuid[0] = (mdev->ldev)->md.uuid[0] & 0x0ffffffffffffffeULL; put_ldev(mdev); } } else { } } else { { tmp___4 = get_net_conf(mdev); } if (tmp___4 != 0) { { (mdev->net_conf)->want_lose = (unsigned char)0; put_net_conf(mdev); } } else { } { set_disk_ro(mdev->vdisk, 0); tmp___5 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___5 != 0) { if ((int )mdev->state.ldv_38339.conn <= 9) { goto _L___0; } else if ((int )mdev->state.ldv_38339.pdsk <= 2) { _L___0: if ((mdev->ldev)->md.uuid[1] == 0ULL) { { drbd_uuid_new_current(mdev); } } else { goto _L; } } else _L: if (forced != 0) { { drbd_uuid_new_current(mdev); } } else { } { (mdev->ldev)->md.uuid[0] = (mdev->ldev)->md.uuid[0] | 1ULL; put_ldev(mdev); } } else { } } if ((int )mdev->state.ldv_38339.conn > 8) { if (forced != 0) { { drbd_send_uuids(mdev); } } else { } { drbd_send_state(mdev); } } else { } { drbd_md_sync(mdev); kobject_uevent(& (mdev->vdisk)->part0.__dev.kobj, (enum kobject_action )2); } fail: { mutex_unlock(& mdev->state_mutex); } return (rv); } } static struct drbd_conf *ensure_mdev(int minor , int create ) { struct drbd_conf *mdev ; struct gendisk *disk ; { if ((unsigned int )minor >= minor_count) { return ((struct drbd_conf *)0); } else { } { mdev = minor_to_mdev((unsigned int )minor); } if ((unsigned long )mdev == (unsigned long )((struct drbd_conf *)0)) { if (create != 0) { { disk = (struct gendisk *)0; mdev = drbd_new_device((unsigned int )minor); spin_lock_irq(& drbd_pp_lock); } if ((unsigned long )*(minor_table + (unsigned long )minor) == (unsigned long )((struct drbd_conf *)0)) { *(minor_table + (unsigned long )minor) = mdev; disk = mdev->vdisk; mdev = (struct drbd_conf *)0; } else { } { spin_unlock_irq(& drbd_pp_lock); } if ((unsigned long )disk != (unsigned long )((struct gendisk *)0)) { { add_disk(disk); } } else { { drbd_free_mdev(mdev); } } { mdev = minor_to_mdev((unsigned int )minor); } } else { } } else { } return (mdev); } } static int drbd_nl_primary(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { struct primary primary_args ; int tmp ; enum drbd_state_rv tmp___0 ; { { memset((void *)(& primary_args), 0, 4UL); tmp = primary_from_tags(mdev, (unsigned short *)(& nlp->tag_list), & primary_args); } if (tmp == 0) { reply->ret_code = 126; return (0); } else { } { tmp___0 = drbd_set_role(mdev, (enum drbd_role )1, (int )primary_args.primary_force); reply->ret_code = (int )tmp___0; } return (0); } } static int drbd_nl_secondary(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { enum drbd_state_rv tmp ; { { tmp = drbd_set_role(mdev, (enum drbd_role )2, 0); reply->ret_code = (int )tmp; } return (0); } } static void drbd_md_set_sector_offsets(struct drbd_conf *mdev , struct drbd_backing_dev *bdev ) { sector_t md_size_sect ; sector_t tmp ; sector_t tmp___0 ; sector_t tmp___1 ; { md_size_sect = 0UL; if (bdev->dc.meta_dev_idx == -2) { goto case_neg_2; } else if (bdev->dc.meta_dev_idx == -1) { goto case_neg_1; } else if (bdev->dc.meta_dev_idx == -3) { goto case_neg_3; } else { goto switch_default; if (0) { switch_default: { bdev->md.md_size_sect = 262144U; tmp = drbd_md_ss__(mdev, bdev); bdev->md.md_offset = (u64 )tmp; bdev->md.al_offset = 8; bdev->md.bm_offset = 72; } goto ldv_50735; case_neg_2: { tmp___0 = drbd_get_capacity(bdev->md_bdev); bdev->md.md_size_sect = (u32 )tmp___0; bdev->md.md_offset = 0ULL; bdev->md.al_offset = 8; bdev->md.bm_offset = 72; } goto ldv_50735; case_neg_1: ; case_neg_3: { tmp___1 = drbd_md_ss__(mdev, bdev); bdev->md.md_offset = (u64 )tmp___1; bdev->md.al_offset = -64; md_size_sect = drbd_get_capacity(bdev->backing_bdev); md_size_sect = (md_size_sect + 32767UL) & 0x0fffffffffff8000UL; md_size_sect = md_size_sect >> 15; md_size_sect = (md_size_sect + 7UL) & 0x0ffffffffffffff8UL; md_size_sect = md_size_sect + 72UL; bdev->md.md_size_sect = (u32 )md_size_sect; bdev->md.bm_offset = (s32 )(8U - (unsigned int )md_size_sect); } goto ldv_50735; } else { } } ldv_50735: ; return; } } char *ppsize(char *buf , unsigned long long size ) { char units[6U] ; int base ; { units[0] = (char)75; units[1] = (char)77; units[2] = (char)71; units[3] = (char)84; units[4] = (char)80; units[5] = (char)69; base = 0; goto ldv_50746; ldv_50745: size = (size >> 10) + (unsigned long long )((size & 512ULL) != 0ULL); base = base + 1; ldv_50746: ; if (size > 9999ULL) { if ((unsigned int )base <= 4U) { goto ldv_50745; } else { goto ldv_50747; } } else { goto ldv_50747; } ldv_50747: { sprintf(buf, "%u %cB", (unsigned int )size, (int )units[base]); } return (buf); } } void drbd_suspend_io(struct drbd_conf *mdev ) { int tmp ; int tmp___0 ; wait_queue_t __wait ; struct task_struct *tmp___1 ; int tmp___2 ; { { set_bit(15U, (unsigned long volatile *)(& mdev->flags)); tmp = is_susp(mdev->state); } if (tmp != 0) { return; } else { } { tmp___0 = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); } if (tmp___0 == 0) { goto ldv_50751; } else { } { tmp___1 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___1; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_50754: { prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___2 = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); } if (tmp___2 == 0) { goto ldv_50753; } else { } { schedule(); } goto ldv_50754; ldv_50753: { finish_wait(& mdev->misc_wait, & __wait); } ldv_50751: ; return; } } void drbd_resume_io(struct drbd_conf *mdev ) { { { clear_bit(15, (unsigned long volatile *)(& mdev->flags)); __wake_up(& mdev->misc_wait, 3U, 1, (void *)0); } return; } } enum determine_dev_size drbd_determine_dev_size(struct drbd_conf *mdev , enum dds_flags flags ) { sector_t prev_first_sect ; sector_t prev_size ; sector_t la_size ; sector_t size ; char ppb[10U] ; int md_moved ; int la_size_changed ; enum determine_dev_size rv ; int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; int err ; sector_t tmp___2 ; long tmp___3 ; char *tmp___4 ; sector_t tmp___5 ; sector_t tmp___6 ; sector_t tmp___7 ; int tmp___8 ; int err___0 ; char *tmp___9 ; char *tmp___10 ; { { rv = (enum determine_dev_size )0; drbd_suspend_io(mdev); tmp = lc_try_lock(mdev->act_log); } if (tmp != 0) { goto ldv_50770; } else { } { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_50773: { prepare_to_wait(& mdev->al_wait, & __wait, 2); tmp___1 = lc_try_lock(mdev->act_log); } if (tmp___1 != 0) { goto ldv_50772; } else { } { schedule(); } goto ldv_50773; ldv_50772: { finish_wait(& mdev->al_wait, & __wait); } ldv_50770: { prev_first_sect = drbd_md_first_sector(mdev->ldev); prev_size = (sector_t )(mdev->ldev)->md.md_size_sect; la_size = (sector_t )(mdev->ldev)->md.la_size_sect; drbd_md_set_sector_offsets(mdev, mdev->ldev); size = drbd_new_dev_size(mdev, mdev->ldev, (int )flags & 1); tmp___5 = drbd_get_capacity(mdev->this_bdev); } if (tmp___5 != size) { goto _L; } else { { tmp___6 = drbd_bm_capacity(mdev); } if (tmp___6 != size) { _L: { err = drbd_bm_resize(mdev, size, ((unsigned int )flags & 2U) == 0U); tmp___3 = __builtin_expect((long )(err != 0), 0L); } if (tmp___3 != 0L) { { tmp___2 = drbd_bm_capacity(mdev); size = tmp___2 >> 1; } if (size == 0UL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "OUT OF MEMORY! Could not allocate bitmap!\n"); } } else { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "BM resizing failed. Leaving size unchanged at size = %lu KB\n", size); } } rv = (enum determine_dev_size )-1; } else { } { drbd_set_my_capacity(mdev, size); (mdev->ldev)->md.la_size_sect = (u64 )size; tmp___4 = ppsize((char *)(& ppb), (unsigned long long )(size >> 1)); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "size = %s (%llu KB)\n", tmp___4, (unsigned long long )size >> 1); } } else { } } if ((int )rv == -1) { goto out; } else { } { la_size_changed = (mdev->ldev)->md.la_size_sect != (unsigned long long )la_size; tmp___7 = drbd_md_first_sector(mdev->ldev); } if (tmp___7 != prev_first_sect) { tmp___8 = 1; } else if ((sector_t )(mdev->ldev)->md.md_size_sect != prev_size) { tmp___8 = 1; } else { tmp___8 = 0; } md_moved = tmp___8; if (la_size_changed != 0) { goto _L___1; } else if (md_moved != 0) { _L___1: { drbd_al_shrink(mdev); } if (la_size_changed == 0) { goto _L___0; } else if (md_moved == 0) { _L___0: if (la_size_changed != 0) { tmp___9 = (char *)"size changed"; } else { tmp___9 = (char *)"md moved"; } tmp___10 = tmp___9; } else { tmp___10 = (char *)"size changed and md moved"; } { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Writing the whole bitmap, %s\n", tmp___10); err___0 = drbd_bitmap_io(mdev, & drbd_bm_write, (char *)"size changed", (enum bm_flag )7); } if (err___0 != 0) { rv = (enum determine_dev_size )-1; goto out; } else { } { drbd_md_mark_dirty(mdev); } } else { } if (size > la_size) { rv = (enum determine_dev_size )2; } else { } if (size < la_size) { rv = (enum determine_dev_size )1; } else { } out: { lc_unlock(mdev->act_log); __wake_up(& mdev->al_wait, 3U, 1, (void *)0); drbd_resume_io(mdev); } return (rv); } } sector_t drbd_new_dev_size(struct drbd_conf *mdev , struct drbd_backing_dev *bdev , int assume_peer_has_space ) { sector_t p_size ; sector_t la_size ; sector_t m_size ; sector_t u_size ; sector_t size ; sector_t __min1 ; sector_t __min2 ; sector_t tmp ; { { p_size = mdev->p_size; la_size = (sector_t )bdev->md.la_size_sect; u_size = (sector_t )bdev->dc.disk_size; size = 0UL; m_size = drbd_get_max_capacity___1(bdev); } if ((int )mdev->state.ldv_38339.conn <= 9) { if (assume_peer_has_space != 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Resize while not connected was forced by the user!\n"); p_size = m_size; } } else { } } else { } if (p_size != 0UL) { if (m_size != 0UL) { __min1 = p_size; __min2 = m_size; if (__min1 < __min2) { tmp = __min1; } else { tmp = __min2; } size = tmp; } else { goto _L; } } else _L: if (la_size != 0UL) { size = la_size; if (m_size != 0UL) { if (m_size < size) { size = m_size; } else { } } else { } if (p_size != 0UL) { if (p_size < size) { size = p_size; } else { } } else { } } else { if (m_size != 0UL) { size = m_size; } else { } if (p_size != 0UL) { size = p_size; } else { } } if (size == 0UL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Both nodes diskless!\n"); } } else { } if (u_size != 0UL) { if (u_size > size) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Requested disk size is too big (%lu > %lu)\n", u_size >> 1, size >> 1); } } else { size = u_size; } } else { } return (size); } } static int drbd_check_al_size(struct drbd_conf *mdev ) { struct lru_cache *n ; struct lru_cache *t ; struct lc_element *e ; unsigned int in_use ; int i ; int _b ; { _b = mdev->sync_conf.al_extents <= 6; if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_check_al_size", (char *)"mdev->sync_conf.al_extents < 7", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_nl.c.p", 761); } } else { } if (_b != 0) { mdev->sync_conf.al_extents = 127; } else { } if ((unsigned long )mdev->act_log != (unsigned long )((struct lru_cache *)0)) { if ((mdev->act_log)->nr_elements == (unsigned int )mdev->sync_conf.al_extents) { return (0); } else { } } else { } { in_use = 0U; t = mdev->act_log; n = lc_create("act_log", drbd_al_ext_cache, (unsigned int )mdev->sync_conf.al_extents, 48UL, 0UL); } if ((unsigned long )n == (unsigned long )((struct lru_cache *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Cannot allocate act_log lru!\n"); } return (-12); } else { } { spin_lock_irq(& mdev->al_lock); } if ((unsigned long )t != (unsigned long )((struct lru_cache *)0)) { i = 0; goto ldv_50802; ldv_50801: { e = lc_element_by_index(t, (unsigned int )i); } if (e->refcnt != 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "refcnt(%d)==%d\n", e->lc_number, e->refcnt); } } else { } in_use = e->refcnt + in_use; i = i + 1; ldv_50802: ; if ((unsigned int )i < t->nr_elements) { goto ldv_50801; } else { goto ldv_50803; } ldv_50803: ; } else { } if (in_use == 0U) { mdev->act_log = n; } else { } { spin_unlock_irq(& mdev->al_lock); } if (in_use != 0U) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Activity log still in use!\n"); lc_destroy(n); } return (-16); } else if ((unsigned long )t != (unsigned long )((struct lru_cache *)0)) { { lc_destroy(t); } } else { } { drbd_md_mark_dirty(mdev); } return (0); } } static void drbd_setup_queue_param(struct drbd_conf *mdev , unsigned int max_bio_size ) { struct request_queue *q ; int max_hw_sectors ; int max_segments ; struct request_queue *b ; unsigned int _min1 ; unsigned int tmp ; unsigned int _min2 ; unsigned int tmp___0 ; int tmp___1 ; int tmp___2 ; struct request_queue *b___0 ; int tmp___3 ; { { q = mdev->rq_queue; max_hw_sectors = (int )(max_bio_size >> 9); max_segments = 0; tmp___1 = _get_ldev_if_state(mdev, (enum drbd_disk_state )1); } if (tmp___1 != 0) { { b = (((mdev->ldev)->backing_bdev)->bd_disk)->queue; tmp = queue_max_hw_sectors(b); _min1 = tmp; _min2 = max_bio_size >> 9; } if (_min1 < _min2) { tmp___0 = _min1; } else { tmp___0 = _min2; } { max_hw_sectors = (int )tmp___0; max_segments = (mdev->ldev)->dc.max_bio_bvecs; put_ldev(mdev); } } else { } { blk_queue_logical_block_size(q, (unsigned short)512); blk_queue_max_hw_sectors(q, (unsigned int )max_hw_sectors); } if (max_segments != 0) { tmp___2 = (int )((unsigned short )max_segments); } else { tmp___2 = 128; } { blk_queue_max_segments(q, (unsigned short )tmp___2); blk_queue_segment_boundary(q, 4095UL); tmp___3 = _get_ldev_if_state(mdev, (enum drbd_disk_state )1); } if (tmp___3 != 0) { { b___0 = (((mdev->ldev)->backing_bdev)->bd_disk)->queue; blk_queue_stack_limits(q, b___0); } if (q->backing_dev_info.ra_pages != b___0->backing_dev_info.ra_pages) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Adjusting my ra_pages to backing device\'s (%lu -> %lu)\n", q->backing_dev_info.ra_pages, b___0->backing_dev_info.ra_pages); q->backing_dev_info.ra_pages = b___0->backing_dev_info.ra_pages; } } else { } { put_ldev(mdev); } } else { } return; } } void drbd_reconsider_max_bio_size(struct drbd_conf *mdev ) { int now ; int new ; int local ; int peer ; unsigned int tmp ; unsigned int tmp___0 ; int tmp___1 ; int __min1 ; int __min2 ; int tmp___2 ; { { tmp = queue_max_hw_sectors(mdev->rq_queue); now = (int )(tmp << 9); local = mdev->local_max_bio_size; peer = mdev->peer_max_bio_size; tmp___1 = _get_ldev_if_state(mdev, (enum drbd_disk_state )1); } if (tmp___1 != 0) { { tmp___0 = queue_max_hw_sectors((((mdev->ldev)->backing_bdev)->bd_disk)->queue); local = (int )(tmp___0 << 9); mdev->local_max_bio_size = local; put_ldev(mdev); } } else { } if ((int )mdev->state.ldv_38339.conn > 9) { if (mdev->agreed_pro_version <= 93) { peer = mdev->peer_max_bio_size; } else if (mdev->agreed_pro_version == 94) { peer = 32768; } else { peer = 131072; } } else { } __min1 = local; __min2 = peer; if (__min1 < __min2) { tmp___2 = __min1; } else { tmp___2 = __min2; } new = tmp___2; if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { if (new < now) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED new < now; (%d < %d)\n", new, now); } } else { } } else { } if (new != now) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "max BIO size = %u\n", new); } } else { } { drbd_setup_queue_param(mdev, (unsigned int )new); } return; } } static void drbd_reconfig_start(struct drbd_conf *mdev ) { int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; int tmp___2 ; wait_queue_t __wait___0 ; struct task_struct *tmp___3 ; int tmp___4 ; { { tmp = test_and_set_bit(22, (unsigned long volatile *)(& mdev->flags)); } if (tmp == 0) { goto ldv_50829; } else { } { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_50832: { prepare_to_wait(& mdev->state_wait, & __wait, 2); tmp___1 = test_and_set_bit(22, (unsigned long volatile *)(& mdev->flags)); } if (tmp___1 == 0) { goto ldv_50831; } else { } { schedule(); } goto ldv_50832; ldv_50831: { finish_wait(& mdev->state_wait, & __wait); } ldv_50829: { tmp___2 = constant_test_bit(23U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___2 == 0) { goto ldv_50833; } else { } { tmp___3 = get_current(); __wait___0.flags = 0U; __wait___0.private = (void *)tmp___3; __wait___0.func = & autoremove_wake_function; __wait___0.task_list.next = & __wait___0.task_list; __wait___0.task_list.prev = & __wait___0.task_list; } ldv_50836: { prepare_to_wait(& mdev->state_wait, & __wait___0, 2); tmp___4 = constant_test_bit(23U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___4 == 0) { goto ldv_50835; } else { } { schedule(); } goto ldv_50836; ldv_50835: { finish_wait(& mdev->state_wait, & __wait___0); } ldv_50833: { drbd_thread_start(& mdev->worker); drbd_flush_workqueue(mdev); } return; } } static void drbd_reconfig_done(struct drbd_conf *mdev ) { { { spin_lock_irq(& mdev->req_lock); } if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 0U) { if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 0U) { if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 2U) { { set_bit(23U, (unsigned long volatile *)(& mdev->flags)); drbd_thread_stop_nowait(& mdev->worker); } } else { { clear_bit(22, (unsigned long volatile *)(& mdev->flags)); } } } else { { clear_bit(22, (unsigned long volatile *)(& mdev->flags)); } } } else { { clear_bit(22, (unsigned long volatile *)(& mdev->flags)); } } { spin_unlock_irq(& mdev->req_lock); __wake_up(& mdev->state_wait, 3U, 1, (void *)0); } return; } } static void drbd_suspend_al(struct drbd_conf *mdev ) { int s ; int tmp ; int tmp___0 ; { { s = 0; tmp = lc_try_lock(mdev->act_log); } if (tmp != 0) { { drbd_al_shrink(mdev); lc_unlock(mdev->act_log); } } else { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Failed to lock al in drbd_suspend_al()\n"); } return; } { spin_lock_irq(& mdev->req_lock); } if ((int )mdev->state.ldv_38339.conn <= 9) { { tmp___0 = test_and_set_bit(28, (unsigned long volatile *)(& mdev->flags)); s = tmp___0 == 0; } } else { } { spin_unlock_irq(& mdev->req_lock); } if (s != 0) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Suspended AL updates\n"); } } else { } return; } } static int drbd_nl_disk_conf(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { enum drbd_ret_code retcode ; enum determine_dev_size dd ; sector_t max_possible_sectors ; sector_t min_md_device_sectors ; struct drbd_backing_dev *nbc ; struct block_device *bdev ; struct lru_cache *resync_lru ; union drbd_state ns ; union drbd_state os ; enum drbd_state_rv rv ; int cp_discovered ; int logical_block_size ; int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; void *tmp___2 ; int tmp___3 ; int prot ; int tmp___4 ; long tmp___5 ; long tmp___6 ; void *tmp___7 ; long tmp___8 ; long tmp___9 ; int tmp___10 ; sector_t tmp___11 ; sector_t tmp___12 ; sector_t tmp___13 ; sector_t tmp___14 ; sector_t tmp___15 ; int tmp___16 ; int tmp___17 ; wait_queue_t __wait___0 ; struct task_struct *tmp___18 ; int tmp___19 ; int tmp___20 ; union drbd_state val ; union drbd_state mask ; int tmp___21 ; unsigned short tmp___22 ; struct page *page ; struct page *tmp___23 ; int tmp___24 ; int tmp___25 ; int tmp___26 ; int tmp___27 ; sector_t tmp___28 ; int tmp___29 ; int tmp___30 ; int tmp___31 ; int tmp___32 ; int tmp___33 ; int tmp___34 ; int tmp___35 ; int tmp___36 ; int tmp___37 ; unsigned long tmp___38 ; unsigned long tmp___39 ; int tmp___40 ; int tmp___41 ; int tmp___42 ; union drbd_state val___0 ; union drbd_state mask___0 ; { { nbc = (struct drbd_backing_dev *)0; resync_lru = (struct lru_cache *)0; cp_discovered = 0; drbd_reconfig_start(mdev); } if ((int )mdev->state.ldv_38339.disk > 0) { retcode = (enum drbd_ret_code )124; goto fail; } else { } { tmp = atomic_read((atomic_t const *)(& mdev->local_cnt)); } if (tmp == 0) { goto ldv_50862; } else { } { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_50865: { prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___1 = atomic_read((atomic_t const *)(& mdev->local_cnt)); } if (tmp___1 == 0) { goto ldv_50864; } else { } { schedule(); } goto ldv_50865; ldv_50864: { finish_wait(& mdev->misc_wait, & __wait); } ldv_50862: { tmp___2 = kzalloc(392UL, 208U); nbc = (struct drbd_backing_dev *)tmp___2; } if ((unsigned long )nbc == (unsigned long )((struct drbd_backing_dev *)0)) { retcode = (enum drbd_ret_code )122; goto fail; } else { } { nbc->dc.disk_size = 0ULL; nbc->dc.on_io_error = 0; nbc->dc.fencing = 0; nbc->dc.max_bio_bvecs = 0; tmp___3 = disk_conf_from_tags(mdev, (unsigned short *)(& nlp->tag_list), & nbc->dc); } if (tmp___3 == 0) { retcode = (enum drbd_ret_code )126; goto fail; } else { } if (nbc->dc.meta_dev_idx < -3) { retcode = (enum drbd_ret_code )116; goto fail; } else { } { tmp___4 = get_net_conf(mdev); } if (tmp___4 != 0) { { prot = (mdev->net_conf)->wire_protocol; put_net_conf(mdev); } if (nbc->dc.fencing == 2) { if (prot == 1) { retcode = (enum drbd_ret_code )154; goto fail; } else { } } else { } } else { } { bdev = blkdev_get_by_path((char const *)(& nbc->dc.backing_dev), 131U, (void *)mdev); tmp___6 = IS_ERR((void const *)bdev); } if (tmp___6 != 0L) { { tmp___5 = PTR_ERR((void const *)bdev); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "open(\"%s\") failed with %ld\n", (unsigned char *)(& nbc->dc.backing_dev), tmp___5); retcode = (enum drbd_ret_code )104; } goto fail; } else { } nbc->backing_bdev = bdev; if (nbc->dc.meta_dev_idx < 0) { tmp___7 = (void *)mdev; } else { tmp___7 = (void *)drbd_m_holder; } { bdev = blkdev_get_by_path((char const *)(& nbc->dc.meta_dev), 131U, tmp___7); tmp___9 = IS_ERR((void const *)bdev); } if (tmp___9 != 0L) { { tmp___8 = PTR_ERR((void const *)bdev); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "open(\"%s\") failed with %ld\n", (unsigned char *)(& nbc->dc.meta_dev), tmp___8); retcode = (enum drbd_ret_code )105; } goto fail; } else { } nbc->md_bdev = bdev; if (nbc->dc.meta_dev_idx == -1) { tmp___10 = 1; } else if (nbc->dc.meta_dev_idx == -3) { tmp___10 = 1; } else { tmp___10 = 0; } if (((unsigned long )nbc->backing_bdev == (unsigned long )nbc->md_bdev) ^ (int )((_Bool )tmp___10)) { retcode = (enum drbd_ret_code )116; goto fail; } else { } { resync_lru = lc_create("resync", drbd_bm_ext_cache, 61U, 64UL, 16UL); } if ((unsigned long )resync_lru == (unsigned long )((struct lru_cache *)0)) { retcode = (enum drbd_ret_code )122; goto fail; } else { } { drbd_md_set_sector_offsets(mdev, nbc); tmp___12 = drbd_get_max_capacity___1(nbc); } if ((unsigned long long )tmp___12 < nbc->dc.disk_size) { { tmp___11 = drbd_get_max_capacity___1(nbc); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "max capacity %llu smaller than disk size %llu\n", (unsigned long long )tmp___11, nbc->dc.disk_size); retcode = (enum drbd_ret_code )111; } goto fail; } else { } if (nbc->dc.meta_dev_idx < 0) { max_possible_sectors = 2251799813685248UL; min_md_device_sectors = 2048UL; } else { max_possible_sectors = 8587575296UL; min_md_device_sectors = (unsigned long )(nbc->dc.meta_dev_idx + 1) * 262144UL; } { tmp___13 = drbd_get_capacity(nbc->md_bdev); } if (tmp___13 < min_md_device_sectors) { { retcode = (enum drbd_ret_code )112; dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "refusing attach: md-device too small, at least %llu sectors needed for this meta-disk type\n", (unsigned long long )min_md_device_sectors); } goto fail; } else { } { tmp___14 = drbd_get_max_capacity___1(nbc); tmp___15 = drbd_get_capacity(mdev->this_bdev); } if (tmp___14 < tmp___15) { retcode = (enum drbd_ret_code )111; goto fail; } else { } { nbc->known_size = drbd_get_capacity(nbc->backing_bdev); } if (nbc->known_size > max_possible_sectors) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "==> truncating very big lower level device to currently maximum possible %llu sectors <==\n", (unsigned long long )max_possible_sectors); } if (nbc->dc.meta_dev_idx >= 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "==>> using internal or flexible meta data may help <<==\n"); } } else { } } else { } { drbd_suspend_io(mdev); tmp___16 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); } if (tmp___16 == 0) { goto ldv_50867; } else { { tmp___17 = is_susp(mdev->state); } if (tmp___17 != 0) { goto ldv_50867; } else { } } { tmp___18 = get_current(); __wait___0.flags = 0U; __wait___0.private = (void *)tmp___18; __wait___0.func = & autoremove_wake_function; __wait___0.task_list.next = & __wait___0.task_list; __wait___0.task_list.prev = & __wait___0.task_list; } ldv_50870: { prepare_to_wait(& mdev->misc_wait, & __wait___0, 2); tmp___19 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); } if (tmp___19 == 0) { goto ldv_50869; } else { { tmp___20 = is_susp(mdev->state); } if (tmp___20 != 0) { goto ldv_50869; } else { } } { schedule(); } goto ldv_50870; ldv_50869: { finish_wait(& mdev->misc_wait, & __wait___0); } ldv_50867: { drbd_flush_workqueue(mdev); val.i = 0U; val.ldv_38339.disk = (unsigned char)1; mask.i = 0U; mask.ldv_38339.disk = (unsigned char)15; rv = _drbd_request_state(mdev, mask, val, (enum chg_state_flags )2); retcode = (enum drbd_ret_code )rv; drbd_resume_io(mdev); } if ((int )rv <= 0) { goto fail; } else { } { tmp___21 = _get_ldev_if_state(mdev, (enum drbd_disk_state )1); } if (tmp___21 == 0) { goto force_diskless; } else { } { drbd_md_set_sector_offsets(mdev, nbc); tmp___22 = bdev_logical_block_size(nbc->md_bdev); logical_block_size = (int )tmp___22; } if (logical_block_size == 0) { logical_block_size = 512; } else { } if (logical_block_size != 512) { if ((unsigned long )mdev->md_io_tmpp == (unsigned long )((struct page *)0)) { { tmp___23 = alloc_pages(16U, 0U); page = tmp___23; } if ((unsigned long )page == (unsigned long )((struct page *)0)) { goto force_diskless_dec; } else { } { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Meta data\'s bdev logical_block_size = %d != %d\n", logical_block_size, 512); dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Workaround engaged (has performance impact).\n"); mdev->md_io_tmpp = page; } } else { } } else { } if ((unsigned long )mdev->bitmap == (unsigned long )((struct drbd_bitmap *)0)) { { tmp___24 = drbd_bm_init(mdev); } if (tmp___24 != 0) { retcode = (enum drbd_ret_code )122; goto force_diskless_dec; } else { } } else { } { tmp___25 = drbd_md_read(mdev, nbc); retcode = (enum drbd_ret_code )tmp___25; } if ((unsigned int )retcode != 101U) { goto force_diskless_dec; } else { } if ((int )mdev->state.ldv_38339.conn <= 9) { if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { if (((mdev->ed_uuid ^ nbc->md.uuid[0]) & 0x0ffffffffffffffeULL) != 0ULL) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Can only attach to data with current UUID=%016llX\n", mdev->ed_uuid); retcode = (enum drbd_ret_code )150; } goto force_diskless_dec; } else { } } else { } } else { } { tmp___26 = drbd_check_al_size(mdev); } if (tmp___26 != 0) { retcode = (enum drbd_ret_code )122; goto force_diskless_dec; } else { } { tmp___27 = drbd_md_test_flag(nbc, 1); } if (tmp___27 != 0) { { tmp___28 = drbd_new_dev_size(mdev, nbc, 0); } if ((unsigned long long )tmp___28 < nbc->md.la_size_sect) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "refusing to truncate a consistent device\n"); retcode = (enum drbd_ret_code )111; } goto force_diskless_dec; } else { } } else { } { tmp___29 = drbd_al_read_log(mdev, nbc); } if (tmp___29 == 0) { retcode = (enum drbd_ret_code )118; goto force_diskless_dec; } else { } if ((unsigned int )*((unsigned char *)nbc + 372UL) != 0U) { { set_bit(14U, (unsigned long volatile *)(& mdev->flags)); } } else { { clear_bit(14, (unsigned long volatile *)(& mdev->flags)); } } if ((unsigned long )mdev->ldev != (unsigned long )((struct drbd_backing_dev *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->ldev == NULL ) in %s:%d\n", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_nl.c.p", 1168); } } else { } { mdev->ldev = nbc; mdev->resync = resync_lru; nbc = (struct drbd_backing_dev *)0; resync_lru = (struct lru_cache *)0; mdev->write_ordering = (enum write_ordering_e )2; drbd_bump_write_ordering(mdev, (enum write_ordering_e )2); tmp___30 = drbd_md_test_flag(mdev->ldev, 64); } if (tmp___30 != 0) { { set_bit(11U, (unsigned long volatile *)(& mdev->flags)); } } else { { clear_bit(11, (unsigned long volatile *)(& mdev->flags)); } } { tmp___31 = drbd_md_test_flag(mdev->ldev, 2); } if (tmp___31 != 0) { if ((unsigned int )*((unsigned char *)mdev + 2276UL) != 1U) { { set_bit(11U, (unsigned long volatile *)(& mdev->flags)); cp_discovered = 1; } } else if ((unsigned int )*((unsigned char *)mdev + 2278UL) == 0U) { { set_bit(11U, (unsigned long volatile *)(& mdev->flags)); cp_discovered = 1; } } else { } } else { } { mdev->send_cnt = 0U; mdev->recv_cnt = 0U; mdev->read_cnt = 0U; mdev->writ_cnt = 0U; drbd_reconsider_max_bio_size(mdev); clear_bit(7, (unsigned long volatile *)(& mdev->flags)); } if ((unsigned int )*((unsigned char *)mdev + 2276UL) != 1U) { { tmp___32 = drbd_md_test_flag(mdev->ldev, 2); } if (tmp___32 != 0) { { tmp___33 = drbd_md_test_flag(mdev->ldev, 4); } if (tmp___33 == 0) { { set_bit(7U, (unsigned long volatile *)(& mdev->flags)); } } else { } } else { } } else { } { dd = drbd_determine_dev_size(mdev, (enum dds_flags )0); } if ((int )dd == -1) { retcode = (enum drbd_ret_code )140; goto force_diskless_dec; } else if ((int )dd == 2) { { set_bit(20U, (unsigned long volatile *)(& mdev->flags)); } } else { } { tmp___36 = drbd_md_test_flag(mdev->ldev, 8); } if (tmp___36 != 0) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Assuming that all blocks are out of sync (aka FullSync)\n"); tmp___34 = drbd_bitmap_io(mdev, & drbd_bmio_set_n_write, (char *)"set_n_write from attaching", (enum bm_flag )7); } if (tmp___34 != 0) { retcode = (enum drbd_ret_code )118; goto force_diskless_dec; } else { } } else { { tmp___35 = drbd_bitmap_io(mdev, & drbd_bm_read, (char *)"read from attaching", (enum bm_flag )7); } if (tmp___35 < 0) { retcode = (enum drbd_ret_code )118; goto force_diskless_dec; } else { } } if (cp_discovered != 0) { { drbd_al_apply_to_bm(mdev); tmp___37 = drbd_bitmap_io(mdev, & drbd_bm_write, (char *)"crashed primary apply AL", (enum bm_flag )7); } if (tmp___37 != 0) { retcode = (enum drbd_ret_code )118; goto force_diskless_dec; } else { } } else { } { tmp___38 = _drbd_bm_total_weight(mdev); tmp___39 = drbd_bm_bits(mdev); } if (tmp___38 == tmp___39) { { drbd_suspend_al(mdev); } } else { } { spin_lock_irq(& mdev->req_lock); os = mdev->state; ns.i = os.i; tmp___41 = drbd_md_test_flag(mdev->ldev, 1); } if (tmp___41 != 0) { { tmp___40 = drbd_md_test_flag(mdev->ldev, 16); } if (tmp___40 != 0) { ns.ldv_38339.disk = (unsigned char)7; } else { ns.ldv_38339.disk = (unsigned char)5; } } else { ns.ldv_38339.disk = (unsigned char)4; } { tmp___42 = drbd_md_test_flag(mdev->ldev, 32); } if (tmp___42 != 0) { ns.ldv_38339.pdsk = (unsigned char)5; } else { } if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 14U) { if (*((unsigned int *)(& ns) + 0UL) == 40960U) { ns.ldv_38339.disk = (unsigned char)8; } else if ((mdev->ldev)->dc.fencing == 0) { ns.ldv_38339.disk = (unsigned char)8; } else { } } else { } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 160U) { { mdev->new_state_tmp.i = ns.i; ns.i = os.i; ns.ldv_38339.disk = (unsigned char)3; kfree((void const *)mdev->p_uuid); mdev->p_uuid = (u64 *)0; } } else { } { rv = _drbd_set_state(mdev, ns, (enum chg_state_flags )2, (struct completion *)0); ns = mdev->state; spin_unlock_irq(& mdev->req_lock); } if ((int )rv <= 0) { goto force_diskless_dec; } else { } if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { (mdev->ldev)->md.uuid[0] = (mdev->ldev)->md.uuid[0] | 1ULL; } else { (mdev->ldev)->md.uuid[0] = (mdev->ldev)->md.uuid[0] & 0x0ffffffffffffffeULL; } { drbd_md_mark_dirty(mdev); drbd_md_sync(mdev); kobject_uevent(& (mdev->vdisk)->part0.__dev.kobj, (enum kobject_action )2); put_ldev(mdev); reply->ret_code = (int )retcode; drbd_reconfig_done(mdev); } return (0); force_diskless_dec: { put_ldev(mdev); } force_diskless: { val___0.i = 0U; val___0.ldv_38339.disk = (unsigned char)2; mask___0.i = 0U; mask___0.ldv_38339.disk = (unsigned char)15; drbd_force_state(mdev, mask___0, val___0); drbd_md_sync(mdev); } fail: ; if ((unsigned long )nbc != (unsigned long )((struct drbd_backing_dev *)0)) { if ((unsigned long )nbc->backing_bdev != (unsigned long )((struct block_device *)0)) { { blkdev_put(nbc->backing_bdev, 131U); } } else { } if ((unsigned long )nbc->md_bdev != (unsigned long )((struct block_device *)0)) { { blkdev_put(nbc->md_bdev, 131U); } } else { } { kfree((void const *)nbc); } } else { } { lc_destroy(resync_lru); reply->ret_code = (int )retcode; drbd_reconfig_done(mdev); } return (0); } } static int drbd_nl_detach(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { enum drbd_ret_code retcode ; int ret ; union drbd_state val ; union drbd_state mask ; int tmp ; int __ret ; wait_queue_t __wait ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; int tmp___2 ; { { drbd_suspend_io(mdev); val.i = 0U; val.ldv_38339.disk = (unsigned char)2; mask.i = 0U; mask.ldv_38339.disk = (unsigned char)15; tmp = drbd_request_state(mdev, mask, val); retcode = (enum drbd_ret_code )tmp; __ret = 0; } if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 4U) { { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_50897: { prepare_to_wait(& mdev->misc_wait, & __wait, 1); } if ((unsigned int )*((unsigned char *)mdev + 2277UL) != 4U) { goto ldv_50895; } else { } { tmp___1 = get_current(); tmp___2 = signal_pending(tmp___1); } if (tmp___2 == 0) { { schedule(); } goto ldv_50896; } else { } __ret = -512; goto ldv_50895; ldv_50896: ; goto ldv_50897; ldv_50895: { finish_wait(& mdev->misc_wait, & __wait); } } else { } { ret = __ret; drbd_resume_io(mdev); } if ((long )retcode == 4294967285L) { retcode = (enum drbd_ret_code )2; } else { } if (ret != 0) { retcode = (enum drbd_ret_code )129; } else { } reply->ret_code = (int )retcode; return (0); } } static int drbd_nl_net_conf(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { int i ; int ns ; enum drbd_ret_code retcode ; struct net_conf *new_conf ; struct crypto_hash *tfm ; struct crypto_hash *integrity_w_tfm ; struct crypto_hash *integrity_r_tfm ; struct hlist_head *new_tl_hash ; struct hlist_head *new_ee_hash ; struct drbd_conf *odev ; char hmac_name[64U] ; void *int_dig_out ; void *int_dig_in ; void *int_dig_vv ; struct sockaddr *new_my_addr ; struct sockaddr *new_peer_addr ; struct sockaddr *taken_addr ; void *tmp ; int tmp___0 ; enum drbd_fencing_p fp ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; long tmp___5 ; struct crypto_tfm *tmp___6 ; int tmp___7 ; long tmp___8 ; struct crypto_tfm *tmp___9 ; int tmp___10 ; long tmp___11 ; void *tmp___12 ; void *tmp___13 ; unsigned int tmp___14 ; int tmp___15 ; union drbd_state __ns ; enum drbd_state_rv tmp___16 ; { { new_conf = (struct net_conf *)0; tfm = (struct crypto_hash *)0; integrity_w_tfm = (struct crypto_hash *)0; integrity_r_tfm = (struct crypto_hash *)0; new_tl_hash = (struct hlist_head *)0; new_ee_hash = (struct hlist_head *)0; int_dig_out = (void *)0; int_dig_in = (void *)0; int_dig_vv = (void *)0; drbd_reconfig_start(mdev); } if ((int )mdev->state.ldv_38339.conn > 0) { retcode = (enum drbd_ret_code )125; goto fail; } else { } { tmp = kzalloc(544UL, 208U); new_conf = (struct net_conf *)tmp; } if ((unsigned long )new_conf == (unsigned long )((struct net_conf *)0)) { retcode = (enum drbd_ret_code )122; goto fail; } else { } { new_conf->timeout = 60; new_conf->try_connect_int = 10; new_conf->ping_int = 10; new_conf->max_epoch_size = 2048; new_conf->max_buffers = 2048; new_conf->unplug_watermark = 128; new_conf->sndbuf_size = 0; new_conf->rcvbuf_size = 0; new_conf->ko_count = 0; new_conf->after_sb_0p = 0; new_conf->after_sb_1p = 0; new_conf->after_sb_2p = 0; new_conf->want_lose = (unsigned char)0; new_conf->two_primaries = (unsigned char)0; new_conf->wire_protocol = 3; new_conf->ping_timeo = 5; new_conf->rr_conflict = 0; new_conf->on_congestion = 0; new_conf->cong_extents = 127; tmp___0 = net_conf_from_tags(mdev, (unsigned short *)(& nlp->tag_list), new_conf); } if (tmp___0 == 0) { retcode = (enum drbd_ret_code )126; goto fail; } else { } if ((unsigned int )*((unsigned char *)new_conf + 540UL) != 0U) { if (new_conf->wire_protocol != 3) { retcode = (enum drbd_ret_code )139; goto fail; } else { } } else { } { tmp___1 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___1 != 0) { { fp = (enum drbd_fencing_p )(mdev->ldev)->dc.fencing; put_ldev(mdev); } if (new_conf->wire_protocol == 1) { if ((unsigned int )fp == 2U) { retcode = (enum drbd_ret_code )154; goto fail; } else { } } else { } } else { } if (new_conf->on_congestion != 0) { if (new_conf->wire_protocol != 1) { retcode = (enum drbd_ret_code )155; goto fail; } else { } } else { } if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { if ((unsigned int )*((unsigned char *)new_conf + 540UL) != 0U) { retcode = (enum drbd_ret_code )123; goto fail; } else { } } else { } retcode = (enum drbd_ret_code )101; new_my_addr = (struct sockaddr *)(& new_conf->my_addr); new_peer_addr = (struct sockaddr *)(& new_conf->peer_addr); i = 0; goto ldv_50925; ldv_50924: { odev = minor_to_mdev((unsigned int )i); } if ((unsigned long )odev == (unsigned long )((struct drbd_conf *)0)) { goto ldv_50923; } else if ((unsigned long )odev == (unsigned long )mdev) { goto ldv_50923; } else { } { tmp___4 = get_net_conf(odev); } if (tmp___4 != 0) { taken_addr = (struct sockaddr *)(& (odev->net_conf)->my_addr); if (new_conf->my_addr_len == (odev->net_conf)->my_addr_len) { { tmp___2 = memcmp((void const *)new_my_addr, (void const *)taken_addr, (size_t )new_conf->my_addr_len); } if (tmp___2 == 0) { retcode = (enum drbd_ret_code )102; } else { } } else { } taken_addr = (struct sockaddr *)(& (odev->net_conf)->peer_addr); if (new_conf->peer_addr_len == (odev->net_conf)->peer_addr_len) { { tmp___3 = memcmp((void const *)new_peer_addr, (void const *)taken_addr, (size_t )new_conf->peer_addr_len); } if (tmp___3 == 0) { retcode = (enum drbd_ret_code )103; } else { } } else { } { put_net_conf(odev); } if ((unsigned int )retcode != 101U) { goto fail; } else { } } else { } ldv_50923: i = i + 1; ldv_50925: ; if ((unsigned int )i < minor_count) { goto ldv_50924; } else { goto ldv_50926; } ldv_50926: ; if ((unsigned int )new_conf->cram_hmac_alg[0] != 0U) { { snprintf((char *)(& hmac_name), 64UL, "hmac(%s)", (unsigned char *)(& new_conf->cram_hmac_alg)); tfm = crypto_alloc_hash((char const *)(& hmac_name), 0U, 128U); tmp___5 = IS_ERR((void const *)tfm); } if (tmp___5 != 0L) { tfm = (struct crypto_hash *)0; retcode = (enum drbd_ret_code )120; goto fail; } else { } { tmp___6 = crypto_hash_tfm(tfm); tmp___7 = drbd_crypto_is_hash(tmp___6); } if (tmp___7 == 0) { retcode = (enum drbd_ret_code )121; goto fail; } else { } } else { } if ((unsigned int )new_conf->integrity_alg[0] != 0U) { { integrity_w_tfm = crypto_alloc_hash((char const *)(& new_conf->integrity_alg), 0U, 128U); tmp___8 = IS_ERR((void const *)integrity_w_tfm); } if (tmp___8 != 0L) { integrity_w_tfm = (struct crypto_hash *)0; retcode = (enum drbd_ret_code )141; goto fail; } else { } { tmp___9 = crypto_hash_tfm(integrity_w_tfm); tmp___10 = drbd_crypto_is_hash(tmp___9); } if (tmp___10 == 0) { retcode = (enum drbd_ret_code )142; goto fail; } else { } { integrity_r_tfm = crypto_alloc_hash((char const *)(& new_conf->integrity_alg), 0U, 128U); tmp___11 = IS_ERR((void const *)integrity_r_tfm); } if (tmp___11 != 0L) { integrity_r_tfm = (struct crypto_hash *)0; retcode = (enum drbd_ret_code )141; goto fail; } else { } } else { } ns = new_conf->max_epoch_size / 8; if (mdev->tl_hash_s != (unsigned int )ns) { { tmp___12 = kzalloc((unsigned long )ns * 8UL, 208U); new_tl_hash = (struct hlist_head *)tmp___12; } if ((unsigned long )new_tl_hash == (unsigned long )((struct hlist_head *)0)) { retcode = (enum drbd_ret_code )122; goto fail; } else { } } else { } ns = new_conf->max_buffers / 8; if ((unsigned int )*((unsigned char *)new_conf + 540UL) != 0U) { if (mdev->ee_hash_s != (unsigned int )ns) { { tmp___13 = kzalloc((unsigned long )ns * 8UL, 208U); new_ee_hash = (struct hlist_head *)tmp___13; } if ((unsigned long )new_ee_hash == (unsigned long )((struct hlist_head *)0)) { retcode = (enum drbd_ret_code )122; goto fail; } else { } } else { } } else { } *((char *)(& new_conf->shared_secret) + 63UL) = (char)0; if ((unsigned long )integrity_w_tfm != (unsigned long )((struct crypto_hash *)0)) { { tmp___14 = crypto_hash_digestsize(integrity_w_tfm); i = (int )tmp___14; int_dig_out = kmalloc((size_t )i, 208U); } if ((unsigned long )int_dig_out == (unsigned long )((void *)0)) { retcode = (enum drbd_ret_code )122; goto fail; } else { } { int_dig_in = kmalloc((size_t )i, 208U); } if ((unsigned long )int_dig_in == (unsigned long )((void *)0)) { retcode = (enum drbd_ret_code )122; goto fail; } else { } { int_dig_vv = kmalloc((size_t )i, 208U); } if ((unsigned long )int_dig_vv == (unsigned long )((void *)0)) { retcode = (enum drbd_ret_code )122; goto fail; } else { } } else { } if ((unsigned long )mdev->bitmap == (unsigned long )((struct drbd_bitmap *)0)) { { tmp___15 = drbd_bm_init(mdev); } if (tmp___15 != 0) { retcode = (enum drbd_ret_code )122; goto fail; } else { } } else { } { drbd_flush_workqueue(mdev); spin_lock_irq(& mdev->req_lock); } if ((unsigned long )mdev->net_conf != (unsigned long )((struct net_conf *)0)) { { retcode = (enum drbd_ret_code )125; spin_unlock_irq(& mdev->req_lock); } goto fail; } else { } mdev->net_conf = new_conf; mdev->send_cnt = 0U; mdev->recv_cnt = 0U; if ((unsigned long )new_tl_hash != (unsigned long )((struct hlist_head *)0)) { { kfree((void const *)mdev->tl_hash); mdev->tl_hash_s = (unsigned int )((mdev->net_conf)->max_epoch_size / 8); mdev->tl_hash = new_tl_hash; } } else { } if ((unsigned long )new_ee_hash != (unsigned long )((struct hlist_head *)0)) { { kfree((void const *)mdev->ee_hash); mdev->ee_hash_s = (unsigned int )((mdev->net_conf)->max_buffers / 8); mdev->ee_hash = new_ee_hash; } } else { } { crypto_free_hash(mdev->cram_hmac_tfm); mdev->cram_hmac_tfm = tfm; crypto_free_hash(mdev->integrity_w_tfm); mdev->integrity_w_tfm = integrity_w_tfm; crypto_free_hash(mdev->integrity_r_tfm); mdev->integrity_r_tfm = integrity_r_tfm; kfree((void const *)mdev->int_dig_out); kfree((void const *)mdev->int_dig_in); kfree((void const *)mdev->int_dig_vv); mdev->int_dig_out = int_dig_out; mdev->int_dig_in = int_dig_in; mdev->int_dig_vv = int_dig_vv; __ns.i = mdev->state.i; __ns.ldv_38339.conn = (unsigned char)2; tmp___16 = _drbd_set_state(mdev, __ns, (enum chg_state_flags )2, (struct completion *)0); retcode = (enum drbd_ret_code )tmp___16; spin_unlock_irq(& mdev->req_lock); kobject_uevent(& (mdev->vdisk)->part0.__dev.kobj, (enum kobject_action )2); reply->ret_code = (int )retcode; drbd_reconfig_done(mdev); } return (0); fail: { kfree((void const *)int_dig_out); kfree((void const *)int_dig_in); kfree((void const *)int_dig_vv); crypto_free_hash(tfm); crypto_free_hash(integrity_w_tfm); crypto_free_hash(integrity_r_tfm); kfree((void const *)new_tl_hash); kfree((void const *)new_ee_hash); kfree((void const *)new_conf); reply->ret_code = (int )retcode; drbd_reconfig_done(mdev); } return (0); } } static int drbd_nl_disconnect(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { int retcode ; struct disconnect dc ; int tmp ; union drbd_state __ns ; union drbd_state val ; union drbd_state mask ; enum drbd_state_rv tmp___0 ; union drbd_state val___0 ; union drbd_state mask___0 ; union drbd_state val___1 ; union drbd_state mask___1 ; enum drbd_state_rv tmp___1 ; union drbd_state val___2 ; union drbd_state mask___2 ; int __ret ; wait_queue_t __wait ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; { { memset((void *)(& dc), 0, 4UL); tmp = disconnect_from_tags(mdev, (unsigned short *)(& nlp->tag_list), & dc); } if (tmp == 0) { retcode = 126; goto fail; } else { } if ((unsigned int )*((unsigned char *)(& dc) + 0UL) != 0U) { { spin_lock_irq(& mdev->req_lock); } if ((int )mdev->state.ldv_38339.conn > 7) { { __ns.i = mdev->state.i; __ns.ldv_38339.conn = (unsigned char)1; _drbd_set_state(mdev, __ns, (enum chg_state_flags )1, (struct completion *)0); } } else { } { spin_unlock_irq(& mdev->req_lock); } goto done; } else { } { val.i = 0U; val.ldv_38339.conn = (unsigned char)1; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; tmp___0 = _drbd_request_state(mdev, mask, val, (enum chg_state_flags )12); retcode = (int )tmp___0; } if (retcode == 2) { goto done; } else if (retcode == -9) { goto done; } else if (retcode == -7) { { val___0.i = 0U; val___0.ldv_38339.conn = (unsigned char)1; val___0.ldv_38339.pdsk = (unsigned char)5; mask___0.i = 0U; mask___0.ldv_38339.conn = (unsigned char)31; mask___0.ldv_38339.pdsk = (unsigned char)15; retcode = drbd_request_state(mdev, mask___0, val___0); } } else if (retcode == -10) { { val___1.i = 0U; val___1.ldv_38339.conn = (unsigned char)1; val___1.ldv_38339.disk = (unsigned char)5; mask___1.i = 0U; mask___1.ldv_38339.conn = (unsigned char)31; mask___1.ldv_38339.disk = (unsigned char)15; tmp___1 = _drbd_request_state(mdev, mask___1, val___1, (enum chg_state_flags )12); retcode = (int )tmp___1; } if (retcode == -11) { goto _L; } else if (retcode == -16) { _L: { val___2.i = 0U; val___2.ldv_38339.conn = (unsigned char)1; mask___2.i = 0U; mask___2.ldv_38339.conn = (unsigned char)31; drbd_force_state(mdev, mask___2, val___2); retcode = 1; } } else { } } else { } if (retcode <= 0) { goto fail; } else { } __ret = 0; if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 16U) { { tmp___2 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___2; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_50960: { prepare_to_wait(& mdev->state_wait, & __wait, 1); } if ((unsigned int )*((unsigned short *)mdev + 1138UL) != 16U) { goto ldv_50958; } else { } { tmp___3 = get_current(); tmp___4 = signal_pending(tmp___3); } if (tmp___4 == 0) { { schedule(); } goto ldv_50959; } else { } __ret = -512; goto ldv_50958; ldv_50959: ; goto ldv_50960; ldv_50958: { finish_wait(& mdev->state_wait, & __wait); } } else { } if (__ret != 0) { retcode = 129; goto fail; } else { } done: retcode = 101; fail: { drbd_md_sync(mdev); reply->ret_code = retcode; } return (0); } } void resync_after_online_grow(struct drbd_conf *mdev ) { int iass ; union drbd_state val ; union drbd_state mask ; { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Resync of new storage after online grow\n"); } if ((int )mdev->state.ldv_38339.role != (int )mdev->state.ldv_38339.peer) { iass = (unsigned int )*((unsigned char *)mdev + 2276UL) == 1U; } else { { iass = constant_test_bit(6U, (unsigned long const volatile *)(& mdev->flags)); } } if (iass != 0) { { drbd_start_resync(mdev, (enum drbd_conns )16); } } else { { val.i = 0U; val.ldv_38339.conn = (unsigned char)15; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; _drbd_request_state(mdev, mask, val, (enum chg_state_flags )10); } } return; } } static int drbd_nl_resize(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { struct resize rs ; int retcode ; enum determine_dev_size dd ; enum dds_flags ddsf ; int tmp ; int tmp___0 ; sector_t tmp___1 ; { { retcode = 101; memset((void *)(& rs), 0, 16UL); tmp = resize_from_tags(mdev, (unsigned short *)(& nlp->tag_list), & rs); } if (tmp == 0) { retcode = 126; goto fail; } else { } if ((int )mdev->state.ldv_38339.conn > 10) { retcode = 130; goto fail; } else { } if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 2U) { if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 8U) { retcode = 131; goto fail; } else { } } else { } { tmp___0 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___0 == 0) { retcode = 138; goto fail; } else { } if ((unsigned int )*((unsigned char *)(& rs) + 8UL) != 0U) { if (mdev->agreed_pro_version <= 92) { retcode = 153; goto fail; } else { } } else { } { tmp___1 = drbd_get_capacity((mdev->ldev)->backing_bdev); } if ((mdev->ldev)->known_size != tmp___1) { { (mdev->ldev)->known_size = drbd_get_capacity((mdev->ldev)->backing_bdev); } } else { } { (mdev->ldev)->dc.disk_size = rs.resize_size; ddsf = (enum dds_flags )(((unsigned int )*((unsigned char *)(& rs) + 8UL) != 0U) | ((int )*((unsigned char *)(& rs) + 8UL) & 2)); dd = drbd_determine_dev_size(mdev, ddsf); drbd_md_sync(mdev); put_ldev(mdev); } if ((int )dd == -1) { retcode = 140; goto fail; } else { } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 160U) { if ((int )dd == 2) { { set_bit(24U, (unsigned long volatile *)(& mdev->flags)); } } else { } { drbd_send_uuids(mdev); drbd_send_sizes(mdev, 1, ddsf); } } else { } fail: reply->ret_code = retcode; return (0); } } static int drbd_nl_syncer_conf(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { int retcode ; int err ; int ovr ; int rsr ; struct crypto_hash *verify_tfm ; struct crypto_hash *csums_tfm ; struct syncer_conf sc ; cpumask_var_t new_cpu_mask ; int *rs_plan_s ; int fifo_size ; bool tmp ; int tmp___0 ; size_t __len ; void *__ret ; int tmp___1 ; int tmp___2 ; int tmp___3 ; long tmp___4 ; struct crypto_tfm *tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; long tmp___9 ; struct crypto_tfm *tmp___10 ; int tmp___11 ; int _b ; int _b___0 ; void *tmp___12 ; int tmp___13 ; wait_queue_t __wait ; struct task_struct *tmp___14 ; int tmp___15 ; int tmp___16 ; bool tmp___17 ; int tmp___18 ; { { retcode = 101; verify_tfm = (struct crypto_hash *)0; csums_tfm = (struct crypto_hash *)0; rs_plan_s = (int *)0; tmp = zalloc_cpumask_var((cpumask_var_t **)(& new_cpu_mask), 208U); } if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { retcode = 122; goto fail; } else { } if ((nlp->flags & 2) != 0) { { memset((void *)(& sc), 0, 212UL); sc.rate = 250; sc.after = -1; sc.al_extents = 127; sc.on_no_data = 0; sc.c_plan_ahead = 0; sc.c_delay_target = 10; sc.c_fill_target = 0; sc.c_max_rate = 102400; sc.c_min_rate = 4096; } } else { __len = 212UL; if (__len > 63UL) { { __ret = __memcpy((void *)(& sc), (void const *)(& mdev->sync_conf), __len); } } else { { __ret = __builtin_memcpy((void *)(& sc), (void const *)(& mdev->sync_conf), __len); } } } { tmp___1 = syncer_conf_from_tags(mdev, (unsigned short *)(& nlp->tag_list), & sc); } if (tmp___1 == 0) { retcode = 126; goto fail; } else { } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 256U) { tmp___2 = 1; } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 272U) { tmp___2 = 1; } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 320U) { tmp___2 = 1; } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 336U) { tmp___2 = 1; } else { tmp___2 = 0; } rsr = tmp___2; if (rsr != 0) { { tmp___3 = strcmp((char const *)(& sc.csums_alg), (char const *)(& mdev->sync_conf.csums_alg)); } if (tmp___3 != 0) { retcode = 148; goto fail; } else { } } else { } if (rsr == 0) { if ((unsigned int )sc.csums_alg[0] != 0U) { { csums_tfm = crypto_alloc_hash((char const *)(& sc.csums_alg), 0U, 128U); tmp___4 = IS_ERR((void const *)csums_tfm); } if (tmp___4 != 0L) { csums_tfm = (struct crypto_hash *)0; retcode = 144; goto fail; } else { } { tmp___5 = crypto_hash_tfm(csums_tfm); tmp___6 = drbd_crypto_is_hash(tmp___5); } if (tmp___6 == 0) { retcode = 145; goto fail; } else { } } else { } } else { } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 288U) { tmp___7 = 1; } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 304U) { tmp___7 = 1; } else { tmp___7 = 0; } ovr = tmp___7; if (ovr != 0) { { tmp___8 = strcmp((char const *)(& sc.verify_alg), (char const *)(& mdev->sync_conf.verify_alg)); } if (tmp___8 != 0) { retcode = 149; goto fail; } else { } } else { } if (ovr == 0) { if ((unsigned int )sc.verify_alg[0] != 0U) { { verify_tfm = crypto_alloc_hash((char const *)(& sc.verify_alg), 0U, 128U); tmp___9 = IS_ERR((void const *)verify_tfm); } if (tmp___9 != 0L) { verify_tfm = (struct crypto_hash *)0; retcode = 146; goto fail; } else { } { tmp___10 = crypto_hash_tfm(verify_tfm); tmp___11 = drbd_crypto_is_hash(tmp___10); } if (tmp___11 == 0) { retcode = 147; goto fail; } else { } } else { } } else { } if (nr_cpu_ids > 1) { if ((unsigned int )sc.cpu_mask[0] != 0U) { { err = __bitmap_parse((char const *)(& sc.cpu_mask), 32U, 0, (unsigned long *)(& new_cpu_mask->bits), nr_cpu_ids); } if (err != 0) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "__bitmap_parse() failed with %d\n", err); retcode = 143; } goto fail; } else { } } else { } } else { } _b = sc.rate <= 0; if (_b != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_nl_syncer_conf", (char *)"sc.rate < 1", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_nl.c.p", 1848); } } else { } if (_b != 0) { sc.rate = 1; } else { } _b___0 = sc.al_extents <= 6; if (_b___0 != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_nl_syncer_conf", (char *)"sc.al_extents < 7", (char *)"/anthill/stuff/tacas-comp/work/current--X--drivers/block/drbd/drbd.ko--X--unsafe1_safe6linux-3.0.1--X--08_1/linux-3.0.1/csd_deg_dscv/19/dscv_tempdir/dscv/ri/08_1/drivers/block/drbd/drbd_nl.c.p", 1849); } } else { } if (_b___0 != 0) { sc.al_extents = 127; } else { } if (sc.al_extents > 3843) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "sc.al_extents > %d\n", 3843); sc.al_extents = 3843; } } else { } if (sc.after >= 0) { { ensure_mdev(sc.after, 1); } } else { } { retcode = drbd_alter_sa(mdev, sc.after); } if (retcode != 101) { goto fail; } else { } fifo_size = (sc.c_plan_ahead * 250) / 250; if ((unsigned int )fifo_size != mdev->rs_plan_s.size) { if (fifo_size > 0) { { tmp___12 = kzalloc((unsigned long )fifo_size * 4UL, 208U); rs_plan_s = (int *)tmp___12; } if ((unsigned long )rs_plan_s == (unsigned long )((int *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "kmalloc of fifo_buffer failed"); retcode = 122; } goto fail; } else { } } else { } } else { } { spin_lock(& mdev->peer_seq_lock); mdev->sync_conf = sc; } if (rsr == 0) { { crypto_free_hash(mdev->csums_tfm); mdev->csums_tfm = csums_tfm; csums_tfm = (struct crypto_hash *)0; } } else { } if (ovr == 0) { { crypto_free_hash(mdev->verify_tfm); mdev->verify_tfm = verify_tfm; verify_tfm = (struct crypto_hash *)0; } } else { } if ((unsigned int )fifo_size != mdev->rs_plan_s.size) { { kfree((void const *)mdev->rs_plan_s.values); mdev->rs_plan_s.values = rs_plan_s; mdev->rs_plan_s.size = (unsigned int )fifo_size; mdev->rs_planed = 0; rs_plan_s = (int *)0; } } else { } { spin_unlock(& mdev->peer_seq_lock); tmp___16 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___16 != 0) { { tmp___13 = lc_try_lock(mdev->act_log); } if (tmp___13 != 0) { goto ldv_51004; } else { } { tmp___14 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___14; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_51007: { prepare_to_wait(& mdev->al_wait, & __wait, 2); tmp___15 = lc_try_lock(mdev->act_log); } if (tmp___15 != 0) { goto ldv_51006; } else { } { schedule(); } goto ldv_51007; ldv_51006: { finish_wait(& mdev->al_wait, & __wait); } ldv_51004: { drbd_al_shrink(mdev); err = drbd_check_al_size(mdev); lc_unlock(mdev->act_log); __wake_up(& mdev->al_wait, 3U, 1, (void *)0); put_ldev(mdev); drbd_md_sync(mdev); } if (err != 0) { retcode = 122; goto fail; } else { } } else { } if ((int )mdev->state.ldv_38339.conn > 9) { { drbd_send_sync_param(mdev, & sc); } } else { } { tmp___17 = cpumask_equal((struct cpumask const *)mdev->cpu_mask, (struct cpumask const *)new_cpu_mask); } if (tmp___17) { tmp___18 = 0; } else { tmp___18 = 1; } if (tmp___18) { { cpumask_copy(mdev->cpu_mask, (struct cpumask const *)new_cpu_mask); drbd_calc_cpu_mask(mdev); mdev->receiver.reset_cpu_mask = 1; mdev->asender.reset_cpu_mask = 1; mdev->worker.reset_cpu_mask = 1; } } else { } { kobject_uevent(& (mdev->vdisk)->part0.__dev.kobj, (enum kobject_action )2); } fail: { kfree((void const *)rs_plan_s); free_cpumask_var(new_cpu_mask); crypto_free_hash(csums_tfm); crypto_free_hash(verify_tfm); reply->ret_code = retcode; } return (0); } } static int drbd_nl_invalidate(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { int retcode ; int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; union drbd_state val ; union drbd_state mask ; enum drbd_state_rv tmp___2 ; union drbd_state val___0 ; union drbd_state mask___0 ; union drbd_state __ns ; enum drbd_state_rv tmp___3 ; union drbd_state val___1 ; union drbd_state mask___1 ; { { tmp = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp == 0) { goto ldv_51014; } else { } { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_51017: { prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___1 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___1 == 0) { goto ldv_51016; } else { } { schedule(); } goto ldv_51017; ldv_51016: { finish_wait(& mdev->misc_wait, & __wait); } ldv_51014: { val.i = 0U; val.ldv_38339.conn = (unsigned char)12; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; tmp___2 = _drbd_request_state(mdev, mask, val, (enum chg_state_flags )12); retcode = (int )tmp___2; } if (retcode <= 0) { if (retcode != -15) { { val___0.i = 0U; val___0.ldv_38339.conn = (unsigned char)12; mask___0.i = 0U; mask___0.ldv_38339.conn = (unsigned char)31; retcode = drbd_request_state(mdev, mask___0, val___0); } } else { } } else { } goto ldv_51034; ldv_51033: { spin_lock_irq(& mdev->req_lock); } if ((int )mdev->state.ldv_38339.conn <= 9) { { __ns.i = mdev->state.i; __ns.ldv_38339.disk = (unsigned char)4; tmp___3 = _drbd_set_state(mdev, __ns, (enum chg_state_flags )2, (struct completion *)0); retcode = (int )tmp___3; } } else { } { spin_unlock_irq(& mdev->req_lock); } if (retcode != -15) { goto ldv_51028; } else { } { val___1.i = 0U; val___1.ldv_38339.conn = (unsigned char)12; mask___1.i = 0U; mask___1.ldv_38339.conn = (unsigned char)31; retcode = drbd_request_state(mdev, mask___1, val___1); } ldv_51034: ; if (retcode == -15) { goto ldv_51033; } else { goto ldv_51028; } ldv_51028: reply->ret_code = retcode; return (0); } } static int drbd_bmio_set_susp_al(struct drbd_conf *mdev ) { int rv ; { { rv = drbd_bmio_set_n_write(mdev); drbd_suspend_al(mdev); } return (rv); } } static int drbd_nl_invalidate_peer(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { int retcode ; int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; union drbd_state val ; union drbd_state mask ; enum drbd_state_rv tmp___2 ; union drbd_state val___0 ; union drbd_state mask___0 ; int tmp___3 ; union drbd_state val___1 ; union drbd_state mask___1 ; { { tmp = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp == 0) { goto ldv_51045; } else { } { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_51048: { prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___1 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___1 == 0) { goto ldv_51047; } else { } { schedule(); } goto ldv_51048; ldv_51047: { finish_wait(& mdev->misc_wait, & __wait); } ldv_51045: { val.i = 0U; val.ldv_38339.conn = (unsigned char)11; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; tmp___2 = _drbd_request_state(mdev, mask, val, (enum chg_state_flags )12); retcode = (int )tmp___2; } if (retcode <= 0) { if (retcode == -15) { if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { { val___0.i = 0U; val___0.ldv_38339.pdsk = (unsigned char)4; mask___0.i = 0U; mask___0.ldv_38339.pdsk = (unsigned char)15; retcode = drbd_request_state(mdev, mask___0, val___0); } if (retcode > 0) { { tmp___3 = drbd_bitmap_io(mdev, & drbd_bmio_set_susp_al, (char *)"set_n_write from invalidate_peer", (enum bm_flag )1); } if (tmp___3 != 0) { retcode = 118; } else { } } else { } } else { { val___1.i = 0U; val___1.ldv_38339.conn = (unsigned char)11; mask___1.i = 0U; mask___1.ldv_38339.conn = (unsigned char)31; retcode = drbd_request_state(mdev, mask___1, val___1); } } } else { { val___1.i = 0U; val___1.ldv_38339.conn = (unsigned char)11; mask___1.i = 0U; mask___1.ldv_38339.conn = (unsigned char)31; retcode = drbd_request_state(mdev, mask___1, val___1); } } } else { } reply->ret_code = retcode; return (0); } } static int drbd_nl_pause_sync(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { int retcode ; union drbd_state val ; union drbd_state mask ; int tmp ; { { retcode = 101; val.i = 0U; val.ldv_38339.user_isp = (unsigned char)1; mask.i = 0U; mask.ldv_38339.user_isp = (unsigned char)1; tmp = drbd_request_state(mdev, mask, val); } if (tmp == 2) { retcode = 134; } else { } reply->ret_code = retcode; return (0); } } static int drbd_nl_resume_sync(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { int retcode ; union drbd_state s ; int tmp ; union drbd_state val ; union drbd_state mask ; int tmp___0 ; { { retcode = 101; val.i = 0U; val.ldv_38339.user_isp = (unsigned char)0; mask.i = 0U; mask.ldv_38339.user_isp = (unsigned char)1; tmp___0 = drbd_request_state(mdev, mask, val); } if (tmp___0 == 2) { s = mdev->state; if ((unsigned int )*((unsigned short *)(& s) + 0UL) == 320U) { goto _L; } else if ((unsigned int )*((unsigned short *)(& s) + 0UL) == 336U) { _L: if ((unsigned int )*((unsigned char *)(& s) + 2UL) == 0U) { if ((unsigned int )*((unsigned char *)(& s) + 2UL) != 0U) { tmp = 157; } else { tmp = 135; } retcode = tmp; } else { retcode = 156; } } else { retcode = 135; } } else { } reply->ret_code = retcode; return (0); } } static int drbd_nl_suspend_io(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { union drbd_state val ; union drbd_state mask ; { { val.i = 0U; val.ldv_38339.susp = (unsigned char)1; mask.i = 0U; mask.ldv_38339.susp = (unsigned char)1; reply->ret_code = drbd_request_state(mdev, mask, val); } return (0); } } static int drbd_nl_resume_io(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { int tmp ; union drbd_state val ; union drbd_state mask ; { { tmp = constant_test_bit(27U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp != 0) { { drbd_uuid_new_current(mdev); clear_bit(27, (unsigned long volatile *)(& mdev->flags)); } } else { } { drbd_suspend_io(mdev); val.i = 0U; val.ldv_38339.susp = (unsigned char)0; val.ldv_38339.susp_nod = (unsigned char)0; val.ldv_38339.susp_fen = (unsigned char)0; mask.i = 0U; mask.ldv_38339.susp = (unsigned char)1; mask.ldv_38339.susp_nod = (unsigned char)1; mask.ldv_38339.susp_fen = (unsigned char)1; reply->ret_code = drbd_request_state(mdev, mask, val); } if (reply->ret_code == 1) { if ((int )mdev->state.ldv_38339.conn <= 9) { { tl_clear(mdev); } } else { } if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 0U) { { tl_restart(mdev, (enum drbd_req_event )24); } } else if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 4U) { { tl_restart(mdev, (enum drbd_req_event )24); } } else { } } else { } { drbd_resume_io(mdev); } return (0); } } static int drbd_nl_outdate(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { union drbd_state val ; union drbd_state mask ; { { val.i = 0U; val.ldv_38339.disk = (unsigned char)5; mask.i = 0U; mask.ldv_38339.disk = (unsigned char)15; reply->ret_code = drbd_request_state(mdev, mask, val); } return (0); } } static int drbd_nl_get_config(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { unsigned short *tl ; int tmp ; int tmp___0 ; void *__gu_p ; unsigned short *tmp___1 ; { { tl = (unsigned short *)(& reply->tag_list); tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp != 0) { { tl = disk_conf_to_tags(mdev, & (mdev->ldev)->dc, tl); put_ldev(mdev); } } else { } { tmp___0 = get_net_conf(mdev); } if (tmp___0 != 0) { { tl = net_conf_to_tags(mdev, mdev->net_conf, tl); put_net_conf(mdev); } } else { } { tl = syncer_conf_to_tags(mdev, & mdev->sync_conf, tl); tmp___1 = tl; tl = tl + 1; __gu_p = (void *)tmp___1; } if (1) { goto case_2; } else { goto switch_default; if (0) { *((u8 *)__gu_p) = (u8 )0U; goto ldv_51117; case_2: { put_unaligned_le16((u16 )0, __gu_p); } goto ldv_51117; { put_unaligned_le32(0U, __gu_p); } goto ldv_51117; { put_unaligned_le64(0ULL, __gu_p); } goto ldv_51117; switch_default: { __bad_unaligned_access_size(); } goto ldv_51117; } else { } } ldv_51117: ; return ((int )((unsigned int )((long )tl) - (unsigned int )((long )(& reply->tag_list)))); } } static int drbd_nl_get_state(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { unsigned short *tl ; union drbd_state s ; unsigned long rs_left ; unsigned int res ; int tmp ; void *__gu_p ; unsigned short *tmp___0 ; { { tl = (unsigned short *)(& reply->tag_list); s = mdev->state; tl = get_state_to_tags(mdev, (struct get_state *)(& s), tl); } if ((int )s.ldv_38339.conn > 15) { if ((int )s.ldv_38339.conn <= 21) { { tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp != 0) { { drbd_get_syncer_progress(mdev, & rs_left, & res); tl = tl_add_int(tl, (enum drbd_tags )43, (void const *)(& res)); put_ldev(mdev); } } else { } } else { } } else { } tmp___0 = tl; tl = tl + 1; __gu_p = (void *)tmp___0; if (1) { goto case_2; } else { goto switch_default; if (0) { *((u8 *)__gu_p) = (u8 )0U; goto ldv_51133; case_2: { put_unaligned_le16((u16 )0, __gu_p); } goto ldv_51133; { put_unaligned_le32(0U, __gu_p); } goto ldv_51133; { put_unaligned_le64(0ULL, __gu_p); } goto ldv_51133; switch_default: { __bad_unaligned_access_size(); } goto ldv_51133; } else { } } ldv_51133: ; return ((int )((unsigned int )((long )tl) - (unsigned int )((long )(& reply->tag_list)))); } } static int drbd_nl_get_uuids(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { unsigned short *tl ; int tmp ; void *__gu_p ; unsigned short *tmp___0 ; { { tl = (unsigned short *)(& reply->tag_list); tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp != 0) { { tl = tl_add_blob(tl, (enum drbd_tags )49186, (void const *)(& (mdev->ldev)->md.uuid), 32); tl = tl_add_int(tl, (enum drbd_tags )35, (void const *)(& (mdev->ldev)->md.flags)); put_ldev(mdev); } } else { } tmp___0 = tl; tl = tl + 1; __gu_p = (void *)tmp___0; if (1) { goto case_2; } else { goto switch_default; if (0) { *((u8 *)__gu_p) = (u8 )0U; goto ldv_51146; case_2: { put_unaligned_le16((u16 )0, __gu_p); } goto ldv_51146; { put_unaligned_le32(0U, __gu_p); } goto ldv_51146; { put_unaligned_le64(0ULL, __gu_p); } goto ldv_51146; switch_default: { __bad_unaligned_access_size(); } goto ldv_51146; } else { } } ldv_51146: ; return ((int )((unsigned int )((long )tl) - (unsigned int )((long )(& reply->tag_list)))); } } static int drbd_nl_get_timeout_flag(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { unsigned short *tl ; char rv ; int tmp ; void *__gu_p ; unsigned short *tmp___0 ; { tl = (unsigned short *)(& reply->tag_list); if (*((unsigned int *)mdev + 569UL) != 40960U) { { tmp = constant_test_bit(7U, (unsigned long const volatile *)(& mdev->flags)); rv = (char )(tmp != 0); } } else { rv = (char)2; } { tl = tl_add_blob(tl, (enum drbd_tags )32804, (void const *)(& rv), 1); tmp___0 = tl; tl = tl + 1; __gu_p = (void *)tmp___0; } if (1) { goto case_2; } else { goto switch_default; if (0) { *((u8 *)__gu_p) = (u8 )0U; goto ldv_51160; case_2: { put_unaligned_le16((u16 )0, __gu_p); } goto ldv_51160; { put_unaligned_le32(0U, __gu_p); } goto ldv_51160; { put_unaligned_le64(0ULL, __gu_p); } goto ldv_51160; switch_default: { __bad_unaligned_access_size(); } goto ldv_51160; } else { } } ldv_51160: ; return ((int )((unsigned int )((long )tl) - (unsigned int )((long )(& reply->tag_list)))); } } static int drbd_nl_start_ov(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { struct start_ov args ; int tmp ; int tmp___0 ; wait_queue_t __wait ; struct task_struct *tmp___1 ; int tmp___2 ; union drbd_state val ; union drbd_state mask ; { { args.start_sector = (unsigned long long )mdev->ov_start_sector; tmp = start_ov_from_tags(mdev, (unsigned short *)(& nlp->tag_list), & args); } if (tmp == 0) { reply->ret_code = 126; return (0); } else { } { tmp___0 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___0 == 0) { goto ldv_51171; } else { } { tmp___1 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___1; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; } ldv_51174: { prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___2 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); } if (tmp___2 == 0) { goto ldv_51173; } else { } { schedule(); } goto ldv_51174; ldv_51173: { finish_wait(& mdev->misc_wait, & __wait); } ldv_51171: { mdev->ov_start_sector = (sector_t )args.start_sector & 0x0ffffffffffffff7UL; val.i = 0U; val.ldv_38339.conn = (unsigned char)18; mask.i = 0U; mask.ldv_38339.conn = (unsigned char)31; reply->ret_code = drbd_request_state(mdev, mask, val); } return (0); } } static int drbd_nl_new_c_uuid(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { int retcode ; int skip_initial_sync ; int err ; struct new_c_uuid args ; int tmp ; int tmp___0 ; union drbd_state __ns ; { { retcode = 101; skip_initial_sync = 0; memset((void *)(& args), 0, 4UL); tmp = new_c_uuid_from_tags(mdev, (unsigned short *)(& nlp->tag_list), & args); } if (tmp == 0) { reply->ret_code = 126; return (0); } else { } { mutex_lock_nested(& mdev->state_mutex, 0U); tmp___0 = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp___0 == 0) { retcode = 138; goto out; } else { } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 160U) { if (mdev->agreed_pro_version > 89) { if ((mdev->ldev)->md.uuid[0] == 4ULL) { if ((unsigned int )*((unsigned char *)(& args) + 0UL) != 0U) { { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Preparing to skip initial sync\n"); skip_initial_sync = 1; } } else { goto _L___1; } } else { goto _L___1; } } else { goto _L___1; } } else _L___1: if ((unsigned int )*((unsigned short *)mdev + 1138UL) != 0U) { retcode = 151; goto out_dec; } else { } { drbd_uuid_set(mdev, 1, 0ULL); drbd_uuid_new_current(mdev); } if ((unsigned int )*((unsigned char *)(& args) + 0UL) != 0U) { { err = drbd_bitmap_io(mdev, & drbd_bmio_clear_n_write, (char *)"clear_n_write from new_c_uuid", (enum bm_flag )7); } if (err != 0) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Writing bitmap failed with %d\n", err); retcode = 118; } } else { } if (skip_initial_sync != 0) { { drbd_send_uuids_skip_initial_sync(mdev); _drbd_uuid_set(mdev, 1, 0ULL); drbd_print_uuids(mdev, "cleared bitmap UUID"); spin_lock_irq(& mdev->req_lock); __ns.i = mdev->state.i; __ns.ldv_38339.disk = (unsigned char)8; __ns.ldv_38339.pdsk = (unsigned char)8; _drbd_set_state(mdev, __ns, (enum chg_state_flags )2, (struct completion *)0); spin_unlock_irq(& mdev->req_lock); } } else { } } else { } { drbd_md_sync(mdev); } out_dec: { put_ldev(mdev); } out: { mutex_unlock(& mdev->state_mutex); reply->ret_code = retcode; } return (0); } } static struct cn_handler_struct cnd_table[27U] = { {(int (*)(struct drbd_conf * , struct drbd_nl_cfg_req * , struct drbd_nl_cfg_reply * ))0, 0}, {& drbd_nl_primary, 0}, {& drbd_nl_secondary, 0}, {& drbd_nl_disk_conf, 0}, {& drbd_nl_detach, 0}, {& drbd_nl_net_conf, 0}, {& drbd_nl_disconnect, 0}, {& drbd_nl_resize, 0}, {& drbd_nl_syncer_conf, 0}, {& drbd_nl_invalidate, 0}, {& drbd_nl_invalidate_peer, 0}, {& drbd_nl_pause_sync, 0}, {& drbd_nl_resume_sync, 0}, {& drbd_nl_suspend_io, 0}, {& drbd_nl_resume_io, 0}, {& drbd_nl_outdate, 0}, {& drbd_nl_get_config, 1312}, {& drbd_nl_get_state, 16}, {& drbd_nl_get_uuids, 48}, {& drbd_nl_get_timeout_flag, 8}, {(int (*)(struct drbd_conf * , struct drbd_nl_cfg_req * , struct drbd_nl_cfg_reply * ))0, 0}, {(int (*)(struct drbd_conf * , struct drbd_nl_cfg_req * , struct drbd_nl_cfg_reply * ))0, 0}, {(int (*)(struct drbd_conf * , struct drbd_nl_cfg_req * , struct drbd_nl_cfg_reply * ))0, 0}, {(int (*)(struct drbd_conf * , struct drbd_nl_cfg_req * , struct drbd_nl_cfg_reply * ))0, 0}, {(int (*)(struct drbd_conf * , struct drbd_nl_cfg_req * , struct drbd_nl_cfg_reply * ))0, 0}, {& drbd_nl_start_ov, 0}, {& drbd_nl_new_c_uuid, 0}}; static void drbd_connector_callback(struct cn_msg *req , struct netlink_skb_parms *nsp ) { struct drbd_nl_cfg_req *nlp ; struct cn_handler_struct *cm ; struct cn_msg *cn_reply ; struct drbd_nl_cfg_reply *reply ; struct drbd_conf *mdev ; int retcode ; int rr ; int reply_size ; int tmp ; struct task_struct *tmp___0 ; void *tmp___1 ; { { nlp = (struct drbd_nl_cfg_req *)(& req->data); reply_size = 34; tmp = ldv_try_module_get_1(& __this_module); } if (tmp == 0) { { printk("<3>drbd: try_module_get() failed!\n"); } return; } else { } { tmp___0 = get_current(); } if (((tmp___0->cred)->cap_effective.cap[0] & 2097152U) == 0U) { retcode = 152; goto fail; } else { } { mdev = ensure_mdev((int )nlp->drbd_minor, nlp->flags & 1); } if ((unsigned long )mdev == (unsigned long )((struct drbd_conf *)0)) { retcode = 127; goto fail; } else { } if (nlp->packet_type > 27) { retcode = 137; goto fail; } else if (nlp->packet_type == 27) { retcode = 137; goto fail; } else { } cm = (struct cn_handler_struct *)(& cnd_table) + (unsigned long )nlp->packet_type; if ((unsigned long )cm->function == (unsigned long )((int (*)(struct drbd_conf * , struct drbd_nl_cfg_req * , struct drbd_nl_cfg_reply * ))0)) { retcode = 137; goto fail; } else { } { reply_size = cm->reply_body_size + reply_size; tmp___1 = kzalloc((size_t )reply_size, 208U); cn_reply = (struct cn_msg *)tmp___1; } if ((unsigned long )cn_reply == (unsigned long )((struct cn_msg *)0)) { retcode = 122; goto fail; } else { } reply = (struct drbd_nl_cfg_reply *)(& cn_reply->data); if (cm->reply_body_size != 0) { reply->packet_type = nlp->packet_type; } else { reply->packet_type = 27; } { reply->minor = nlp->drbd_minor; reply->ret_code = 101; rr = (*(cm->function))(mdev, nlp, reply); cn_reply->id = req->id; cn_reply->seq = req->seq; cn_reply->ack = req->ack + 1U; cn_reply->len = (__u16 )((unsigned int )((__u16 )rr) + 12U); cn_reply->flags = (__u16 )0U; rr = cn_netlink_send(cn_reply, 8U, 208U); } if (rr != 0) { if (rr != -3) { { printk("<6>drbd: cn_netlink_send()=%d\n", rr); } } else { } } else { } { kfree((void const *)cn_reply); ldv_module_put_2(& __this_module); } return; fail: { drbd_nl_send_reply(req, retcode); ldv_module_put_3(& __this_module); } return; } } static atomic_t drbd_nl_seq = {2}; static unsigned short *__tl_add_blob(unsigned short *tl , enum drbd_tags tag , void const *data , unsigned short len , int nul_terminated ) { unsigned short l ; void *__gu_p ; unsigned short *tmp ; void *__gu_p___0 ; unsigned short *tmp___0 ; size_t __len ; void *__ret ; { l = (unsigned short )tag_descriptions[(unsigned int )tag & 8191U].max_len; if ((int )len < (int )l) { len = len; } else { len = l; } tmp = tl; tl = tl + 1; __gu_p = (void *)tmp; if (1) { goto case_2; } else { goto switch_default; if (0) { *((u8 *)__gu_p) = (unsigned char )tag; goto ldv_51223; case_2: { put_unaligned_le16((u16 )((int )((unsigned short )tag)), __gu_p); } goto ldv_51223; { put_unaligned_le32((unsigned int )tag, __gu_p); } goto ldv_51223; { put_unaligned_le64((unsigned long long )tag, __gu_p); } goto ldv_51223; switch_default: { __bad_unaligned_access_size(); } goto ldv_51223; } else { } } ldv_51223: tmp___0 = tl; tl = tl + 1; __gu_p___0 = (void *)tmp___0; if (1) { goto case_2___0; } else { goto switch_default___0; if (0) { *((u8 *)__gu_p___0) = (unsigned char )len; goto ldv_51230; case_2___0: { put_unaligned_le16((u16 )((int )len), __gu_p___0); } goto ldv_51230; { put_unaligned_le32((unsigned int )len, __gu_p___0); } goto ldv_51230; { put_unaligned_le64((unsigned long long )len, __gu_p___0); } goto ldv_51230; switch_default___0: { __bad_unaligned_access_size(); } goto ldv_51230; } else { } } ldv_51230: { __len = (size_t )len; __ret = __builtin_memcpy((void *)tl, data, __len); tl = tl + (unsigned long )len; } if (nul_terminated != 0) { *((char *)tl + 0x0fffffffffffffffUL) = (char)0; } else { } return (tl); } } static unsigned short *tl_add_blob(unsigned short *tl , enum drbd_tags tag , void const *data , int len ) { unsigned short *tmp ; { { tmp = __tl_add_blob(tl, tag, data, (unsigned short )((int )((unsigned short )len)), 0); } return (tmp); } } static unsigned short *tl_add_str(unsigned short *tl , enum drbd_tags tag , char const *str ) { size_t tmp ; unsigned short *tmp___0 ; { { tmp = strlen(str); tmp___0 = __tl_add_blob(tl, tag, (void const *)str, (unsigned short )((int )((unsigned int )((unsigned short )tmp) + 1U)), 0); } return (tmp___0); } } static unsigned short *tl_add_int(unsigned short *tl , enum drbd_tags tag , void const *val ) { void *__gu_p ; unsigned short *tmp ; void *__gu_p___0 ; unsigned short *tmp___0 ; void *__gu_p___1 ; void *__gu_p___2 ; unsigned short *tmp___1 ; void *__gu_p___3 ; { tmp = tl; tl = tl + 1; __gu_p = (void *)tmp; if (1) { goto case_2; } else { goto switch_default; if (0) { *((u8 *)__gu_p) = (unsigned char )tag; goto ldv_51256; case_2: { put_unaligned_le16((u16 )((int )((unsigned short )tag)), __gu_p); } goto ldv_51256; { put_unaligned_le32((unsigned int )tag, __gu_p); } goto ldv_51256; { put_unaligned_le64((unsigned long long )tag, __gu_p); } goto ldv_51256; switch_default: { __bad_unaligned_access_size(); } goto ldv_51256; } else { } } ldv_51256: ; if ((int )((unsigned int )tag & 49152U) == 0) { goto case_0; } else if ((int )((unsigned int )tag & 49152U) == 16384) { goto case_16384; } else { goto switch_default___4; if (0) { case_0: tmp___0 = tl; tl = tl + 1; __gu_p___0 = (void *)tmp___0; if (1) { goto case_2___0; } else { goto switch_default___0; if (0) { *((u8 *)__gu_p___0) = (u8 )4U; goto ldv_51264; case_2___0: { put_unaligned_le16((u16 )4, __gu_p___0); } goto ldv_51264; { put_unaligned_le32(4U, __gu_p___0); } goto ldv_51264; { put_unaligned_le64(4ULL, __gu_p___0); } goto ldv_51264; switch_default___0: { __bad_unaligned_access_size(); } goto ldv_51264; } else { } } ldv_51264: __gu_p___1 = (void *)tl; if (1) { goto case_4___1; } else { goto switch_default___1; if (0) { *((u8 *)__gu_p___1) = (unsigned char )*((int *)val); goto ldv_51271; { put_unaligned_le16((u16 )((int )((unsigned short )*((int *)val))), __gu_p___1); } goto ldv_51271; case_4___1: { put_unaligned_le32((unsigned int )*((int *)val), __gu_p___1); } goto ldv_51271; { put_unaligned_le64((unsigned long long )*((int *)val), __gu_p___1); } goto ldv_51271; switch_default___1: { __bad_unaligned_access_size(); } goto ldv_51271; } else { } } ldv_51271: tl = tl + 4U; goto ldv_51276; case_16384: tmp___1 = tl; tl = tl + 1; __gu_p___2 = (void *)tmp___1; if (1) { goto case_2___2; } else { goto switch_default___2; if (0) { *((u8 *)__gu_p___2) = (u8 )8U; goto ldv_51280; case_2___2: { put_unaligned_le16((u16 )8, __gu_p___2); } goto ldv_51280; { put_unaligned_le32(8U, __gu_p___2); } goto ldv_51280; { put_unaligned_le64(8ULL, __gu_p___2); } goto ldv_51280; switch_default___2: { __bad_unaligned_access_size(); } goto ldv_51280; } else { } } ldv_51280: __gu_p___3 = (void *)tl; if (1) { goto case_8___3; } else { goto switch_default___3; if (0) { *((u8 *)__gu_p___3) = (unsigned char )*((u64 *)val); goto ldv_51287; { put_unaligned_le16((u16 )((int )((unsigned short )*((u64 *)val))), __gu_p___3); } goto ldv_51287; { put_unaligned_le32((unsigned int )*((u64 *)val), __gu_p___3); } goto ldv_51287; case_8___3: { put_unaligned_le64(*((u64 *)val), __gu_p___3); } goto ldv_51287; switch_default___3: { __bad_unaligned_access_size(); } goto ldv_51287; } else { } } ldv_51287: tl = tl + 8U; goto ldv_51276; switch_default___4: ; } else { } } ldv_51276: ; return (tl); } } void drbd_bcast_state(struct drbd_conf *mdev , union drbd_state state ) { char buffer[42U] ; struct cn_msg *cn_reply ; struct drbd_nl_cfg_reply *reply ; unsigned short *tl ; void *__gu_p ; unsigned short *tmp ; int tmp___0 ; { { cn_reply = (struct cn_msg *)(& buffer); reply = (struct drbd_nl_cfg_reply *)(& cn_reply->data); tl = (unsigned short *)(& reply->tag_list); tl = get_state_to_tags(mdev, (struct get_state *)(& state), tl); tmp = tl; tl = tl + 1; __gu_p = (void *)tmp; } if (1) { goto case_2; } else { goto switch_default; if (0) { *((u8 *)__gu_p) = (u8 )0U; goto ldv_51303; case_2: { put_unaligned_le16((u16 )0, __gu_p); } goto ldv_51303; { put_unaligned_le32(0U, __gu_p); } goto ldv_51303; { put_unaligned_le64(0ULL, __gu_p); } goto ldv_51303; switch_default: { __bad_unaligned_access_size(); } goto ldv_51303; } else { } } ldv_51303: { cn_reply->id.idx = 8U; cn_reply->id.val = 1U; tmp___0 = atomic_add_return(1, & drbd_nl_seq); cn_reply->seq = (__u32 )tmp___0; cn_reply->ack = 0U; cn_reply->len = (__u16 )((unsigned int )((int )((__u16 )((long )tl)) - (int )((__u16 )((long )(& reply->tag_list)))) + 12U); cn_reply->flags = (__u16 )0U; reply->packet_type = 17; reply->minor = mdev_to_minor(mdev); reply->ret_code = 101; cn_netlink_send(cn_reply, 8U, 16U); } return; } } void drbd_bcast_ev_helper(struct drbd_conf *mdev , char *helper_name ) { char buffer[74U] ; struct cn_msg *cn_reply ; struct drbd_nl_cfg_reply *reply ; unsigned short *tl ; void *__gu_p ; unsigned short *tmp ; int tmp___0 ; { { cn_reply = (struct cn_msg *)(& buffer); reply = (struct drbd_nl_cfg_reply *)(& cn_reply->data); tl = (unsigned short *)(& reply->tag_list); tl = tl_add_str(tl, (enum drbd_tags )49190, (char const *)helper_name); tmp = tl; tl = tl + 1; __gu_p = (void *)tmp; } if (1) { goto case_2; } else { goto switch_default; if (0) { *((u8 *)__gu_p) = (u8 )0U; goto ldv_51318; case_2: { put_unaligned_le16((u16 )0, __gu_p); } goto ldv_51318; { put_unaligned_le32(0U, __gu_p); } goto ldv_51318; { put_unaligned_le64(0ULL, __gu_p); } goto ldv_51318; switch_default: { __bad_unaligned_access_size(); } goto ldv_51318; } else { } } ldv_51318: { cn_reply->id.idx = 8U; cn_reply->id.val = 1U; tmp___0 = atomic_add_return(1, & drbd_nl_seq); cn_reply->seq = (__u32 )tmp___0; cn_reply->ack = 0U; cn_reply->len = (__u16 )((unsigned int )((int )((__u16 )((long )tl)) - (int )((__u16 )((long )(& reply->tag_list)))) + 12U); cn_reply->flags = (__u16 )0U; reply->packet_type = 20; reply->minor = mdev_to_minor(mdev); reply->ret_code = 101; cn_netlink_send(cn_reply, 8U, 16U); } return; } } void drbd_bcast_ee(struct drbd_conf *mdev , char const *reason , int const dgs , char const *seen_hash , char const *calc_hash , struct drbd_epoch_entry const *e ) { struct cn_msg *cn_reply ; struct drbd_nl_cfg_reply *reply ; unsigned short *tl ; struct page *page ; unsigned int len ; void *tmp ; unsigned int __min1 ; unsigned int __min2 ; unsigned int tmp___0 ; void *__gu_p ; unsigned short *tmp___1 ; void *__gu_p___0 ; unsigned short *tmp___2 ; void *d ; void *tmp___3 ; unsigned int l ; unsigned int __min1___0 ; unsigned int __min2___0 ; unsigned int tmp___4 ; size_t __len ; void *__ret ; struct page *tmp___5 ; void *__gu_p___1 ; unsigned short *tmp___6 ; int tmp___7 ; { if ((unsigned long )e == (unsigned long )((struct drbd_epoch_entry const *)0)) { return; } else { } if ((unsigned long )reason == (unsigned long )((char const *)0)) { return; } else if ((int )((signed char )*reason) == 0) { return; } else { } { tmp = kzalloc(33026UL, 16U); cn_reply = (struct cn_msg *)tmp; } if ((unsigned long )cn_reply == (unsigned long )((struct cn_msg *)0)) { { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "could not kmalloc buffer for drbd_bcast_ee, sector %llu, size %u\n", (unsigned long long )e->sector, e->size); } return; } else { } { reply = (struct drbd_nl_cfg_reply *)(& cn_reply->data); tl = (unsigned short *)(& reply->tag_list); tl = tl_add_str(tl, (enum drbd_tags )49197, reason); tl = tl_add_blob(tl, (enum drbd_tags )49198, (void const *)seen_hash, (int )dgs); tl = tl_add_blob(tl, (enum drbd_tags )49199, (void const *)calc_hash, (int )dgs); tl = tl_add_int(tl, (enum drbd_tags )16432, (void const *)(& e->sector)); tl = tl_add_int(tl, (enum drbd_tags )16433, (void const *)(& e->ldv_46600.block_id)); __min1 = (unsigned int )e->size; __min2 = 32768U; } if (__min1 < __min2) { tmp___0 = __min1; } else { tmp___0 = __min2; } len = tmp___0; tmp___1 = tl; tl = tl + 1; __gu_p = (void *)tmp___1; if (1) { goto case_2; } else { goto switch_default; if (0) { *((u8 *)__gu_p) = (u8 )50U; goto ldv_51341; case_2: { put_unaligned_le16((u16 )49202, __gu_p); } goto ldv_51341; { put_unaligned_le32(49202U, __gu_p); } goto ldv_51341; { put_unaligned_le64(49202ULL, __gu_p); } goto ldv_51341; switch_default: { __bad_unaligned_access_size(); } goto ldv_51341; } else { } } ldv_51341: tmp___2 = tl; tl = tl + 1; __gu_p___0 = (void *)tmp___2; if (1) { goto case_2___0; } else { goto switch_default___0; if (0) { *((u8 *)__gu_p___0) = (unsigned char )len; goto ldv_51348; case_2___0: { put_unaligned_le16((u16 )((int )((unsigned short )len)), __gu_p___0); } goto ldv_51348; { put_unaligned_le32(len, __gu_p___0); } goto ldv_51348; { put_unaligned_le64((unsigned long long )len, __gu_p___0); } goto ldv_51348; switch_default___0: { __bad_unaligned_access_size(); } goto ldv_51348; } else { } } ldv_51348: page = (struct page *)e->pages; goto ldv_51364; ldv_51363: { tmp___3 = __kmap_atomic(page); d = tmp___3; __min1___0 = len; __min2___0 = 4096U; } if (__min1___0 < __min2___0) { tmp___4 = __min1___0; } else { tmp___4 = __min2___0; } { l = tmp___4; __len = (size_t )l; __ret = __builtin_memcpy((void *)tl, (void const *)d, __len); __kunmap_atomic(d); tl = tl + (unsigned long )l; len = len - l; } if (len == 0U) { goto ldv_51362; } else { } { page = page_chain_next(page); } ldv_51364: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { { tmp___5 = page_chain_next(page); __builtin_prefetch((void const *)tmp___5); } goto ldv_51363; } else { goto ldv_51362; } ldv_51362: tmp___6 = tl; tl = tl + 1; __gu_p___1 = (void *)tmp___6; if (1) { goto case_2___1; } else { goto switch_default___1; if (0) { *((u8 *)__gu_p___1) = (u8 )0U; goto ldv_51367; case_2___1: { put_unaligned_le16((u16 )0, __gu_p___1); } goto ldv_51367; { put_unaligned_le32(0U, __gu_p___1); } goto ldv_51367; { put_unaligned_le64(0ULL, __gu_p___1); } goto ldv_51367; switch_default___1: { __bad_unaligned_access_size(); } goto ldv_51367; } else { } } ldv_51367: { cn_reply->id.idx = 8U; cn_reply->id.val = 1U; tmp___7 = atomic_add_return(1, & drbd_nl_seq); cn_reply->seq = (__u32 )tmp___7; cn_reply->ack = 0U; cn_reply->len = (__u16 )((unsigned int )((int )((__u16 )((long )tl)) - (int )((__u16 )((long )(& reply->tag_list)))) + 12U); cn_reply->flags = (__u16 )0U; reply->packet_type = 24; reply->minor = mdev_to_minor(mdev); reply->ret_code = 101; cn_netlink_send(cn_reply, 8U, 16U); kfree((void const *)cn_reply); } return; } } void drbd_bcast_sync_progress(struct drbd_conf *mdev ) { char buffer[42U] ; struct cn_msg *cn_reply ; struct drbd_nl_cfg_reply *reply ; unsigned short *tl ; unsigned long rs_left ; unsigned int res ; int tmp ; void *__gu_p ; unsigned short *tmp___0 ; int tmp___1 ; { { cn_reply = (struct cn_msg *)(& buffer); reply = (struct drbd_nl_cfg_reply *)(& cn_reply->data); tl = (unsigned short *)(& reply->tag_list); tmp = _get_ldev_if_state(mdev, (enum drbd_disk_state )4); } if (tmp == 0) { return; } else { } { drbd_get_syncer_progress(mdev, & rs_left, & res); put_ldev(mdev); tl = tl_add_int(tl, (enum drbd_tags )43, (void const *)(& res)); tmp___0 = tl; tl = tl + 1; __gu_p = (void *)tmp___0; } if (1) { goto case_2; } else { goto switch_default; if (0) { *((u8 *)__gu_p) = (u8 )0U; goto ldv_51383; case_2: { put_unaligned_le16((u16 )0, __gu_p); } goto ldv_51383; { put_unaligned_le32(0U, __gu_p); } goto ldv_51383; { put_unaligned_le64(0ULL, __gu_p); } goto ldv_51383; switch_default: { __bad_unaligned_access_size(); } goto ldv_51383; } else { } } ldv_51383: { cn_reply->id.idx = 8U; cn_reply->id.val = 1U; tmp___1 = atomic_add_return(1, & drbd_nl_seq); cn_reply->seq = (__u32 )tmp___1; cn_reply->ack = 0U; cn_reply->len = (__u16 )((unsigned int )((int )((__u16 )((long )tl)) - (int )((__u16 )((long )(& reply->tag_list)))) + 12U); cn_reply->flags = (__u16 )0U; reply->packet_type = 23; reply->minor = mdev_to_minor(mdev); reply->ret_code = 101; cn_netlink_send(cn_reply, 8U, 16U); } return; } } int drbd_nl_init(void) { struct cb_id cn_id_drbd ; int err ; int try ; int tmp ; { try = 10; cn_id_drbd.val = 1U; ldv_51395: { cn_id_drbd.idx = cn_idx; err = cn_add_callback(& cn_id_drbd, "cn_drbd", & drbd_connector_callback); } if (err == 0) { goto ldv_51394; } else { } cn_idx = cn_idx + 6977U; tmp = try; try = try - 1; if (tmp != 0) { goto ldv_51395; } else { goto ldv_51394; } ldv_51394: ; if (err != 0) { { printk("<3>drbd: cn_drbd failed to register\n"); } return (err); } else { } return (0); } } void drbd_nl_cleanup(void) { struct cb_id cn_id_drbd ; { { cn_id_drbd.idx = cn_idx; cn_id_drbd.val = 1U; cn_del_callback(& cn_id_drbd); } return; } } void drbd_nl_send_reply(struct cn_msg *req , int ret_code ) { char buffer[32U] ; struct cn_msg *cn_reply ; struct drbd_nl_cfg_reply *reply ; int rr ; { { cn_reply = (struct cn_msg *)(& buffer); reply = (struct drbd_nl_cfg_reply *)(& cn_reply->data); memset((void *)(& buffer), 0, 32UL); cn_reply->id = req->id; cn_reply->seq = req->seq; cn_reply->ack = req->ack + 1U; cn_reply->len = (__u16 )12U; cn_reply->flags = (__u16 )0U; reply->packet_type = 27; reply->minor = ((struct drbd_nl_cfg_req *)(& req->data))->drbd_minor; reply->ret_code = ret_code; rr = cn_netlink_send(cn_reply, 8U, 16U); } if (rr != 0) { if (rr != -3) { { printk("<6>drbd: cn_netlink_send()=%d\n", rr); } } else { } } else { } return; } }