extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); void reach_error() { __assert_fail("0", "drivers--block--drbd--drbd.ko_180.8abfc6e.32_7a.cil_true-unreach-call.i", 3, "reach_error"); } /* Generated by CIL v. 1.5.1 */ /* print_CIL_Input is false */ 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 u64 dma_addr_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 __u16 __le16; 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; struct bug_entry { int bug_addr_disp ; int file_disp ; unsigned short line ; unsigned short flags ; }; struct completion; struct pt_regs; struct pid; struct task_struct; 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 ; }; typedef void (*ctor_fn_t)(void); 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_1880_8 { struct pt_regs *regs ; struct kernel_vm86_regs *vm86 ; }; struct math_emu_info { long ___orig_eip ; union __anonunion_ldv_1880_8 ldv_1880 ; }; typedef unsigned long pgdval_t; typedef unsigned long pgprotval_t; struct pgprot { pgprotval_t pgprot ; }; typedef struct pgprot pgprot_t; struct __anonstruct_pgd_t_11 { pgdval_t pgd ; }; typedef struct __anonstruct_pgd_t_11 pgd_t; struct page; struct file; struct seq_file; struct __anonstruct_ldv_2091_15 { unsigned int a ; unsigned int b ; }; struct __anonstruct_ldv_2106_16 { 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_2107_14 { struct __anonstruct_ldv_2091_15 ldv_2091 ; struct __anonstruct_ldv_2106_16 ldv_2106 ; }; struct desc_struct { union __anonunion_ldv_2107_14 ldv_2107 ; }; 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 exec_domain; 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_4686_20 { u64 rip ; u64 rdp ; }; struct __anonstruct_ldv_4692_21 { u32 fip ; u32 fcs ; u32 foo ; u32 fos ; }; union __anonunion_ldv_4693_19 { struct __anonstruct_ldv_4686_20 ldv_4686 ; struct __anonstruct_ldv_4692_21 ldv_4692 ; }; union __anonunion_ldv_4702_22 { u32 padding1[12U] ; u32 sw_reserved[12U] ; }; struct i387_fxsave_struct { u16 cwd ; u16 swd ; u16 twd ; u16 fop ; union __anonunion_ldv_4693_19 ldv_4693 ; u32 mxcsr ; u32 mxcsr_mask ; u32 st_space[32U] ; u32 xmm_space[64U] ; u32 padding[12U] ; union __anonunion_ldv_4702_22 ldv_4702 ; }; 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_24 { unsigned long seg ; }; typedef struct __anonstruct_mm_segment_t_24 mm_segment_t; struct arch_spinlock { unsigned int slock ; }; typedef struct arch_spinlock arch_spinlock_t; struct __anonstruct_arch_rwlock_t_25 { unsigned int lock ; }; typedef struct __anonstruct_arch_rwlock_t_25 arch_rwlock_t; struct lockdep_map; typedef atomic64_t atomic_long_t; struct stack_trace { unsigned int nr_entries ; unsigned int max_entries ; unsigned long *entries ; int skip ; }; struct lockdep_subclass_key { char __one_byte ; } __attribute__((__packed__)) ; 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_5619_27 { u8 __padding[1U] ; struct lockdep_map dep_map ; }; union __anonunion_ldv_5620_26 { struct raw_spinlock rlock ; struct __anonstruct_ldv_5619_27 ldv_5619 ; }; struct spinlock { union __anonunion_ldv_5620_26 ldv_5620 ; }; typedef struct spinlock spinlock_t; struct __anonstruct_rwlock_t_28 { arch_rwlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_rwlock_t_28 rwlock_t; struct thread_info; struct mutex { atomic_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct thread_info *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 timespec; struct compat_timespec; struct __anonstruct_ldv_5836_30 { unsigned long arg0 ; unsigned long arg1 ; unsigned long arg2 ; unsigned long arg3 ; }; struct __anonstruct_futex_31 { u32 *uaddr ; u32 val ; u32 flags ; u32 bitset ; u64 time ; u32 *uaddr2 ; }; struct __anonstruct_nanosleep_32 { clockid_t index ; struct timespec *rmtp ; struct compat_timespec *compat_rmtp ; u64 expires ; }; struct pollfd; struct __anonstruct_poll_33 { struct pollfd *ufds ; int nfds ; int has_timeout ; unsigned long tv_sec ; unsigned long tv_nsec ; }; union __anonunion_ldv_5859_29 { struct __anonstruct_ldv_5836_30 ldv_5836 ; struct __anonstruct_futex_31 futex ; struct __anonstruct_nanosleep_32 nanosleep ; struct __anonstruct_poll_33 poll ; }; struct restart_block { long (*fn)(struct restart_block * ) ; union __anonunion_ldv_5859_29 ldv_5859 ; }; 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 vm_area_struct; struct __anonstruct_seqlock_t_34 { unsigned int sequence ; spinlock_t lock ; }; typedef struct __anonstruct_seqlock_t_34 seqlock_t; struct timespec { __kernel_time_t tv_sec ; long tv_nsec ; }; 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 ; void *start_site ; char start_comm[16U] ; int start_pid ; struct lockdep_map lockdep_map ; }; struct hrtimer; 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 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 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_35 { unsigned long bits[16U] ; }; typedef struct __anonstruct_nodemask_t_35 nodemask_t; struct rw_semaphore; typedef long rwsem_count_t; struct rw_semaphore { rwsem_count_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct lockdep_map dep_map ; }; struct ctl_table; struct device; 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 dpm_state { DPM_INVALID = 0, DPM_ON = 1, DPM_PREPARING = 2, DPM_RESUMING = 3, DPM_SUSPENDING = 4, DPM_OFF = 5, DPM_OFF_IRQ = 6 } ; 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 ; enum dpm_state status ; 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 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 ; }; struct __anonstruct_mm_context_t_100 { void *ldt ; int size ; struct mutex lock ; void *vdso ; }; typedef struct __anonstruct_mm_context_t_100 mm_context_t; struct call_single_data { struct list_head list ; void (*func)(void * ) ; void *info ; u16 flags ; u16 priv ; }; struct key; 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 const *(*current_ns)(void) ; void const *(*netlink_ns)(struct sock * ) ; void const *(*initial_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 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_11177_110 { 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_11177_110 ldv_11177 ; }; struct kparam_string { unsigned int maxlen ; char *string ; }; struct kparam_array { unsigned int max ; unsigned int *num ; struct kernel_param_ops const *ops ; unsigned int elemsize ; void *elem ; }; struct rcu_head { struct rcu_head *next ; void (*func)(struct rcu_head * ) ; }; struct tracepoint; struct tracepoint_func { void *func ; void *data ; }; struct tracepoint { char const *name ; int state ; 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 ; 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 ; void *percpu ; unsigned int percpu_size ; char *args ; struct tracepoint *tracepoints ; unsigned int num_tracepoints ; char const **trace_bprintk_fmt_start ; unsigned int num_trace_bprintk_fmt ; struct ftrace_event_call *trace_events ; unsigned int num_trace_events ; 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 iovec { void *iov_base ; __kernel_size_t iov_len ; }; struct cred; 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_111 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; }; typedef struct __anonstruct_sync_serial_settings_111 sync_serial_settings; struct __anonstruct_te1_settings_112 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; unsigned int slot_map ; }; typedef struct __anonstruct_te1_settings_112 te1_settings; struct __anonstruct_raw_hdlc_proto_113 { unsigned short encoding ; unsigned short parity ; }; typedef struct __anonstruct_raw_hdlc_proto_113 raw_hdlc_proto; struct __anonstruct_fr_proto_114 { 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_114 fr_proto; struct __anonstruct_fr_proto_pvc_115 { unsigned int dlci ; }; typedef struct __anonstruct_fr_proto_pvc_115 fr_proto_pvc; struct __anonstruct_fr_proto_pvc_info_116 { unsigned int dlci ; char master[16U] ; }; typedef struct __anonstruct_fr_proto_pvc_info_116 fr_proto_pvc_info; struct __anonstruct_cisco_proto_117 { unsigned int interval ; unsigned int timeout ; }; typedef struct __anonstruct_cisco_proto_117 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_118 { 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_118 ifs_ifsu ; }; union __anonunion_ifr_ifrn_119 { char ifrn_name[16U] ; }; union __anonunion_ifr_ifru_120 { 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_119 ifr_ifrn ; union __anonunion_ifr_ifru_120 ifr_ifru ; }; 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_12342_123 { u16 inuse ; u16 objects ; }; union __anonunion_ldv_12343_122 { atomic_t _mapcount ; struct __anonstruct_ldv_12342_123 ldv_12342 ; }; struct __anonstruct_ldv_12348_125 { unsigned long private ; struct address_space *mapping ; }; union __anonunion_ldv_12351_124 { struct __anonstruct_ldv_12348_125 ldv_12348 ; struct kmem_cache *slab ; struct page *first_page ; }; union __anonunion_ldv_12355_126 { unsigned long index ; void *freelist ; }; struct page { unsigned long flags ; atomic_t _count ; union __anonunion_ldv_12343_122 ldv_12343 ; union __anonunion_ldv_12351_124 ldv_12351 ; union __anonunion_ldv_12355_126 ldv_12355 ; struct list_head lru ; }; struct __anonstruct_vm_set_128 { struct list_head list ; void *parent ; struct vm_area_struct *head ; }; union __anonunion_shared_127 { struct __anonstruct_vm_set_128 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_127 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 ; unsigned long vm_truncate_count ; 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 { unsigned long 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 ; struct rw_semaphore mmap_sem ; spinlock_t page_table_lock ; 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_t cpu_vm_mask ; mm_context_t context ; unsigned int faultstamp ; unsigned int token_priority ; unsigned int last_interval ; 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 ; }; enum ldv_12770 { SS_FREE = 0, SS_UNCONNECTED = 1, SS_CONNECTING = 2, SS_CONNECTED = 3, SS_DISCONNECTING = 4 } ; typedef enum ldv_12770 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 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 ctl_table_header { struct ctl_table *ctl_table ; struct list_head ctl_entry ; int used ; int count ; 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 ratelimit_state { spinlock_t lock ; int interval ; int burst ; int printed ; int missed ; unsigned long begin ; }; struct kmem_cache_cpu { void **freelist ; struct page *page ; int node ; unsigned int stat[18U] ; }; 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 ; 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 ; unsigned long min_partial ; 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 class_private; struct bus_type; struct bus_type_private; 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 bus_type_private *p ; }; struct device_driver { char const *name ; struct bus_type *bus ; struct module *owner ; char const *mod_name ; bool suppress_bind_attrs ; 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 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 class_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 *type ; struct mutex mutex ; struct bus_type *bus ; struct device_driver *driver ; void *platform_data ; struct dev_pm_info power ; 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 ; 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 hrtimer_clock_base; struct hrtimer_cpu_base; enum hrtimer_restart { HRTIMER_NORESTART = 0, HRTIMER_RESTART = 1 } ; struct hrtimer { struct rb_node node ; ktime_t _expires ; 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 ; clockid_t index ; struct rb_root active ; struct rb_node *first ; ktime_t resolution ; ktime_t (*get_time)(void) ; ktime_t softirq_time ; ktime_t offset ; }; struct hrtimer_cpu_base { raw_spinlock_t lock ; struct hrtimer_clock_base clock_base[2U] ; 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 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_19150_132 { __u16 csum_start ; __u16 csum_offset ; }; union __anonunion_ldv_19151_131 { __wsum csum ; struct __anonstruct_ldv_19150_132 ldv_19150 ; }; union __anonunion_ldv_19181_133 { __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_19151_131 ldv_19151 ; __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 deliver_no_wcard : 1 ; dma_cookie_t dma_cookie ; __u32 secmark ; union __anonunion_ldv_19181_133 ldv_19181 ; __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 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 prio_list ; struct list_head node_list ; raw_spinlock_t *rawlock ; spinlock_t *spinlock ; }; struct plist_node { int prio ; struct plist_head plist ; }; struct file_operations; struct pm_qos_request_list { struct plist_node list ; int pm_qos_class ; }; 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_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_rawip4_spec { __be32 ip4src ; __be32 ip4dst ; __u8 hdata[64U] ; }; struct ethtool_ether_spec { __be16 ether_type ; __u8 frame_size ; __u8 eframe[16U] ; }; struct ethtool_usrip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 l4_4_bytes ; __u8 tos ; __u8 ip_ver ; __u8 proto ; }; union __anonunion_h_u_135 { 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_rawip4_spec raw_ip4_spec ; struct ethtool_ether_spec ether_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; __u8 hdata[64U] ; }; union __anonunion_m_u_136 { 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_rawip4_spec raw_ip4_spec ; struct ethtool_ether_spec ether_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; __u8 hdata[64U] ; }; struct ethtool_rx_flow_spec { __u32 flow_type ; union __anonunion_h_u_135 h_u ; union __anonunion_m_u_136 m_u ; __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_137 { 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_rawip4_spec raw_ip4_spec ; struct ethtool_ether_spec ether_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; __u8 hdata[64U] ; }; union __anonunion_m_u_138 { 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_rawip4_spec raw_ip4_spec ; struct ethtool_ether_spec ether_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; __u8 hdata[64U] ; }; struct ethtool_rx_ntuple_flow_spec { __u32 flow_type ; union __anonunion_h_u_137 h_u ; union __anonunion_m_u_138 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_rx_ntuple_list { struct list_head list ; unsigned int count ; }; 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 (*phys_id)(struct net_device * , u32 ) ; 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 * ) ; }; 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[28U] ; }; struct icmpmsg_mib { unsigned long mibs[512U] ; }; struct icmpv6_mib { unsigned long mibs[5U] ; }; struct icmpv6msg_mib { unsigned long mibs[512U] ; }; struct tcp_mib { unsigned long mibs[15U] ; }; struct udp_mib { unsigned long mibs[7U] ; }; struct linux_mib { unsigned long mibs[79U] ; }; 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 nat_vmalloced ; 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 ; atomic_t rt_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 ) ; 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 * ) ; atomic_t entries ; struct kmem_cache *kmem_cachep ; }; 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_139 { __u8 u6_addr8[16U] ; __be16 u6_addr16[8U] ; __be32 u6_addr32[4U] ; }; struct in6_addr { union __anonunion_in6_u_139 in6_u ; }; struct flowi; struct __anonstruct_ip4_u_141 { __be32 daddr ; __be32 saddr ; __u8 tos ; __u8 scope ; }; struct __anonstruct_ip6_u_142 { struct in6_addr daddr ; struct in6_addr saddr ; __be32 flowlabel ; }; struct __anonstruct_dn_u_143 { __le16 daddr ; __le16 saddr ; __u8 scope ; }; union __anonunion_nl_u_140 { struct __anonstruct_ip4_u_141 ip4_u ; struct __anonstruct_ip6_u_142 ip6_u ; struct __anonstruct_dn_u_143 dn_u ; }; struct __anonstruct_ports_145 { __be16 sport ; __be16 dport ; }; struct __anonstruct_icmpt_146 { __u8 type ; __u8 code ; }; struct __anonstruct_dnports_147 { __le16 sport ; __le16 dport ; }; struct __anonstruct_mht_148 { __u8 type ; }; union __anonunion_uli_u_144 { struct __anonstruct_ports_145 ports ; struct __anonstruct_icmpt_146 icmpt ; struct __anonstruct_dnports_147 dnports ; __be32 spi ; struct __anonstruct_mht_148 mht ; }; struct flowi { int oif ; int iif ; __u32 mark ; union __anonunion_nl_u_140 nl_u ; __u8 proto ; __u8 flags ; union __anonunion_uli_u_144 uli_u ; __u32 secid ; }; 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 nameidata; struct path; struct vfsmount; struct qstr { unsigned int hash ; unsigned int len ; unsigned char const *name ; }; union __anonunion_d_u_149 { struct list_head d_child ; struct rcu_head d_rcu ; }; struct dentry_operations; struct super_block; struct dentry { atomic_t d_count ; unsigned int d_flags ; spinlock_t d_lock ; int d_mounted ; struct inode *d_inode ; struct hlist_node d_hash ; struct dentry *d_parent ; struct qstr d_name ; struct list_head d_lru ; union __anonunion_d_u_149 d_u ; struct list_head d_subdirs ; struct list_head d_alias ; unsigned long d_time ; struct dentry_operations const *d_op ; struct super_block *d_sb ; void *d_fsdata ; unsigned char d_iname[32U] ; }; struct dentry_operations { int (*d_revalidate)(struct dentry * , struct nameidata * ) ; int (*d_hash)(struct dentry * , struct qstr * ) ; int (*d_compare)(struct dentry * , struct qstr * , struct qstr * ) ; int (*d_delete)(struct dentry * ) ; void (*d_release)(struct dentry * ) ; void (*d_iput)(struct dentry * , struct inode * ) ; char *(*d_dname)(struct dentry * , char * , int ) ; }; 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 , char * ) ; 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_151 { char *buf ; void *data ; }; struct __anonstruct_read_descriptor_t_150 { size_t written ; size_t count ; union __anonunion_arg_151 arg ; int error ; }; typedef struct __anonstruct_read_descriptor_t_150 read_descriptor_t; struct address_space_operations { int (*writepage)(struct page * , struct writeback_control * ) ; int (*readpage)(struct file * , struct page * ) ; void (*sync_page)(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 ) ; 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 ; spinlock_t i_mmap_lock ; unsigned int truncate_count ; 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 ; struct inode *bd_inode ; struct super_block *bd_super ; int bd_openers ; struct mutex bd_mutex ; struct list_head bd_inodes ; void *bd_claiming ; void *bd_holder ; int bd_holders ; struct list_head bd_holder_list ; 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; struct file_lock; struct cdev; union __anonunion_ldv_23147_152 { struct pipe_inode_info *i_pipe ; struct block_device *i_bdev ; struct cdev *i_cdev ; }; struct inode { struct hlist_node i_hash ; struct list_head i_list ; struct list_head i_sb_list ; struct list_head i_dentry ; unsigned long i_ino ; atomic_t i_count ; unsigned int i_nlink ; uid_t i_uid ; gid_t i_gid ; 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 ; umode_t i_mode ; spinlock_t i_lock ; struct mutex i_mutex ; struct rw_semaphore i_alloc_sem ; struct inode_operations const *i_op ; struct file_operations const *i_fop ; struct super_block *i_sb ; 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_23147_152 ldv_23147 ; __u32 i_generation ; __u32 i_fsnotify_mask ; struct hlist_head i_fsnotify_marks ; unsigned long i_state ; unsigned long dirtied_when ; unsigned int i_flags ; atomic_t i_writecount ; void *i_security ; 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_153 { struct list_head fu_list ; struct rcu_head fu_rcuhead ; }; struct file { union __anonunion_f_u_153 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_copy_lock)(struct file_lock * , struct file_lock * ) ; void (*fl_release_private)(struct file_lock * ) ; void (*fl_break)(struct file_lock * ) ; int (*fl_mylease)(struct file_lock * , 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_155 { struct list_head link ; int state ; }; union __anonunion_fl_u_154 { struct nfs_lock_info nfs_fl ; struct nfs4_lock_info nfs4_fl ; struct __anonstruct_afs_155 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_154 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_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] ; 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 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 ** ) ; }; struct inode_operations { int (*create)(struct inode * , struct dentry * , int , struct nameidata * ) ; struct dentry *(*lookup)(struct inode * , struct dentry * , 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 * ) ; int (*readlink)(struct dentry * , char * , int ) ; void *(*follow_link)(struct dentry * , struct nameidata * ) ; void (*put_link)(struct dentry * , struct nameidata * , void * ) ; void (*truncate)(struct inode * ) ; int (*permission)(struct inode * , int ) ; int (*check_acl)(struct inode * , int ) ; 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 ) ; long (*fallocate)(struct inode * , int , 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 (*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_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 ; int (*get_sb)(struct file_system_type * , int , char const * , void * , struct vfsmount * ) ; 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 ; }; 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 short 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_checksum ; unsigned int sysctl_log_invalid ; struct ctl_table_header *sysctl_header ; struct ctl_table_header *acct_sysctl_header ; struct ctl_table_header *event_sysctl_header ; int hash_vmalloc ; int expect_vmalloc ; 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 dst_ops xfrm4_dst_ops ; struct dst_ops xfrm6_dst_ops ; 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 net_generic; struct net { atomic_t count ; 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 net_device *loopback_dev ; struct list_head dev_base_head ; struct hlist_head *dev_name_head ; struct hlist_head *dev_index_head ; struct list_head rules_ops ; spinlock_t rules_mod_lock ; struct sock *rtnl ; struct sock *genl_sock ; 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 netns_xfrm xfrm ; struct sk_buff_head wext_nlevents ; struct net_generic *gen ; }; 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 dcbnl_rtnl_ops { 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 ) ; }; 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 * ) ; }; typedef struct sk_buff *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 ; spinlock_t _xmit_lock ; int xmit_lock_owner ; unsigned long trans_start ; u64 tx_bytes ; u64 tx_packets ; u64 tx_dropped ; }; struct rps_map { unsigned int len ; struct rcu_head rcu ; u16 cpus[0U] ; }; struct rps_dev_flow { u16 cpu ; u16 fill ; 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 netdev_rx_queue *first ; atomic_t count ; }; 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_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_get_wwn)(struct net_device * , u64 * , int ) ; }; struct iw_handler_def; struct iw_public_data; 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 char if_port ; unsigned char dma ; unsigned long state ; struct list_head dev_list ; struct list_head napi_list ; struct list_head unreg_list ; unsigned long features ; int ifindex ; int iflink ; struct net_device_stats stats ; 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 short gflags ; unsigned short priv_flags ; unsigned short padded ; unsigned char operstate ; unsigned char link_mode ; unsigned int mtu ; unsigned short type ; unsigned short hard_header_len ; unsigned short needed_headroom ; unsigned short needed_tailroom ; struct net_device *master ; 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 ; void *dsa_ptr ; void *atalk_ptr ; void *ip_ptr ; void *dn_ptr ; void *ip6_ptr ; void *ec_ptr ; void *ax25_ptr ; struct wireless_dev *ieee80211_ptr ; unsigned long last_rx ; 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 ; struct netdev_queue rx_queue ; rx_handler_func_t *rx_handler ; void *rx_handler_data ; 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 ; unsigned long trans_start ; int watchdog_timeo ; struct timer_list watchdog_timer ; atomic_t refcnt ; struct list_head todo_list ; struct hlist_node index_hlist ; struct list_head link_watch_list ; unsigned short reg_state ; unsigned short rtnl_link_state ; void (*destructor)(struct net_device * ) ; struct netpoll_info *npinfo ; struct net *nd_net ; void *ml_priv ; struct garp_port *garp_port ; struct device dev ; struct attribute_group const *sysfs_groups[4U] ; struct rtnl_link_ops const *rtnl_link_ops ; unsigned long vlan_features ; unsigned int gso_max_size ; struct dcbnl_rtnl_ops const *dcbnl_ops ; unsigned int fcoe_ddp_xid ; struct ethtool_rx_ntuple_list ethtool_ntuple_list ; struct phy_device *phydev ; }; enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED = 1, IRQ_WAKE_THREAD = 2 } ; typedef enum irqreturn irqreturn_t; struct timer_rand_state; struct irqaction; struct irqaction { irqreturn_t (*handler)(int , void * ) ; unsigned long flags ; char const *name ; void *dev_id ; struct irqaction *next ; int irq ; struct proc_dir_entry *dir ; irqreturn_t (*thread_fn)(int , void * ) ; struct task_struct *thread ; unsigned long thread_flags ; }; typedef unsigned long cputime_t; 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 siginfo; struct __anonstruct_sigset_t_163 { unsigned long sig[1U] ; }; typedef struct __anonstruct_sigset_t_163 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_165 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; }; struct __anonstruct__timer_166 { __kernel_timer_t _tid ; int _overrun ; char _pad[0U] ; sigval_t _sigval ; int _sys_private ; }; struct __anonstruct__rt_167 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; sigval_t _sigval ; }; struct __anonstruct__sigchld_168 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; int _status ; __kernel_clock_t _utime ; __kernel_clock_t _stime ; }; struct __anonstruct__sigfault_169 { void *_addr ; short _addr_lsb ; }; struct __anonstruct__sigpoll_170 { long _band ; int _fd ; }; union __anonunion__sifields_164 { int _pad[28U] ; struct __anonstruct__kill_165 _kill ; struct __anonstruct__timer_166 _timer ; struct __anonstruct__rt_167 _rt ; struct __anonstruct__sigchld_168 _sigchld ; struct __anonstruct__sigfault_169 _sigfault ; struct __anonstruct__sigpoll_170 _sigpoll ; }; struct siginfo { int si_signo ; int si_errno ; int si_code ; union __anonunion__sifields_164 _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_173 { int mode ; }; typedef struct __anonstruct_seccomp_t_173 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 signal_struct; struct key_type; struct keyring_list; struct key_user; union __anonunion_ldv_29301_174 { time_t expiry ; time_t revoked_at ; }; union __anonunion_type_data_175 { struct list_head link ; unsigned long x[2U] ; void *p[2U] ; }; union __anonunion_payload_176 { 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_29301_174 ldv_29301 ; 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_175 type_data ; union __anonunion_payload_176 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 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 cfs_rq; struct user_namespace; struct io_event { __u64 data ; __u64 obj ; __s64 res ; __s64 res2 ; }; struct kioctx; union __anonunion_ki_obj_177 { 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_177 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 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 ; 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 ; int oom_adj ; int oom_score_adj ; }; 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 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 ; unsigned int bkl_count ; }; 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 * ) ; 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 rq * , struct task_struct * , int , int ) ; void (*pre_schedule)(struct rq * , struct task_struct * ) ; void (*post_schedule)(struct rq * ) ; void (*task_waking)(struct rq * , 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 * , int ) ; void (*switched_to)(struct rq * , struct task_struct * , int ) ; void (*prio_changed)(struct rq * , struct task_struct * , int , int ) ; unsigned int (*get_rr_interval)(struct rq * , struct task_struct * ) ; void (*moved_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 bytes ; unsigned long memsw_bytes ; }; struct css_set; struct compat_robust_list_head; struct task_struct { long volatile state ; void *stack ; atomic_t usage ; unsigned int flags ; unsigned int ptrace ; int lock_depth ; 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 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 ; int exit_state ; int exit_code ; int exit_signal ; int pdeath_signal ; 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 ; 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 mutex cred_guard_mutex ; 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 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 ; 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 ; unsigned long trace ; unsigned long trace_recursion ; struct memcg_batch_info memcg_batch ; }; struct linux_binprm { char buf[128U] ; struct vm_area_struct *vma ; 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 ; int hasvdso ; }; 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 ; 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 ; struct net_device *dev ; unsigned long used ; unsigned long confirmed ; unsigned long updated ; __u8 flags ; __u8 nud_state ; __u8 type ; __u8 dead ; atomic_t probes ; rwlock_t lock ; unsigned char ha[32U] ; struct hh_cache *hh ; atomic_t refcnt ; int (*output)(struct sk_buff * ) ; struct sk_buff_head arp_queue ; struct timer_list timer ; struct neigh_ops const *ops ; 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_table { struct neigh_table *next ; int family ; int entry_size ; int key_len ; __u32 (*hash)(void const * , struct net_device const * ) ; 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 neighbour **hash_buckets ; unsigned int hash_mask ; __u32 hash_rnd ; struct pneigh_entry **phash_buckets ; }; struct dn_route; union __anonunion_ldv_34230_182 { 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 ; short error ; short obsolete ; int flags ; unsigned long expires ; unsigned short header_len ; unsigned short trailer_len ; unsigned int rate_tokens ; unsigned long rate_last ; 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 * ) ; struct dst_ops *ops ; u32 metrics[14U] ; __u32 tclassid ; long __pad_to_align_refcnt[1U] ; atomic_t __refcnt ; int __use ; unsigned long lastuse ; union __anonunion_ldv_34230_182 ldv_34230 ; }; struct __anonstruct_socket_lock_t_183 { spinlock_t slock ; int owned ; wait_queue_head_t wq ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_socket_lock_t_183 socket_lock_t; struct proto; union __anonunion_ldv_34372_184 { struct hlist_node skc_node ; struct hlist_nulls_node skc_nulls_node ; }; union __anonunion_ldv_34378_185 { unsigned int skc_hash ; __u16 skc_u16hashes[2U] ; }; union __anonunion_ldv_34386_186 { struct hlist_node skc_bind_node ; struct hlist_nulls_node skc_portaddr_node ; }; struct sock_common { union __anonunion_ldv_34372_184 ldv_34372 ; atomic_t skc_refcnt ; int skc_tx_queue_mapping ; union __anonunion_ldv_34378_185 ldv_34378 ; unsigned short skc_family ; unsigned char volatile skc_state ; unsigned char skc_reuse ; int skc_bound_dev_if ; union __anonunion_ldv_34386_186 ldv_34386 ; struct proto *skc_prot ; struct net *skc_net ; }; struct __anonstruct_sk_backlog_187 { struct sk_buff *head ; struct sk_buff *tail ; int len ; }; struct sock { struct sock_common __sk_common ; 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_rcvbuf ; socket_lock_t sk_lock ; struct __anonstruct_sk_backlog_187 sk_backlog ; struct socket_wq *sk_wq ; struct dst_entry *sk_dst_cache ; struct xfrm_policy *sk_policy[2U] ; spinlock_t sk_dst_lock ; atomic_t sk_rmem_alloc ; atomic_t sk_wmem_alloc ; atomic_t sk_omem_alloc ; int sk_sndbuf ; struct sk_buff_head sk_receive_queue ; struct sk_buff_head sk_write_queue ; struct sk_buff_head sk_async_wait_queue ; int sk_wmem_queued ; int sk_forward_alloc ; 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 ; __u32 sk_rxhash ; unsigned long sk_flags ; 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 ; atomic_t sk_drops ; 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 ; struct sk_filter *sk_filter ; 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_188 { 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 (*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 ) ; unsigned int inuse_idx ; void (*enter_memory_pressure)(struct sock * ) ; atomic_t *memory_allocated ; struct percpu_counter *sockets_allocated ; int *memory_pressure ; int *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_188 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_35533_189 { 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_35533_189 ldv_35533 ; unsigned int i ; }; 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[] ; }; 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[] ; }; 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_190 { 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_190 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_191 { 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_191 crt_u ; void (*exit)(struct crypto_tfm * ) ; struct crypto_alg *__crt_alg ; void *__crt_ctx[] ; }; 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 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 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 * ) ; }; 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 ; int in_flight[2U] ; struct disk_stats *dkstats ; struct rcu_head rcu_head ; }; struct disk_part_tbl { struct rcu_head rcu_head ; int len ; struct hd_struct *last_lookup ; struct gendisk *disk ; struct hd_struct *part[] ; }; 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 * ) ; 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 work_struct async_notify ; 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 ; void (*unplug_io_fn)(struct backing_dev_info * , struct page * ) ; void *unplug_io_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 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_39156_199 { struct rb_node rb_node ; void *completion_data ; }; 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_39156_199 ldv_39156 ; void *elevator_private ; void *elevator_private2 ; void *elevator_private3 ; 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 int elevator_queue_empty_fn(struct request_queue * ); 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_queue_empty_fn *elevator_queue_empty_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 * ); typedef void unplug_fn(struct request_queue * ); 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 no_cluster ; signed 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 ; unplug_fn *unplug_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 timer_list unplug_timer ; int unplug_thresh ; unsigned long unplug_delay ; struct work_struct unplug_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 ; unsigned int ordered ; unsigned int next_ordered ; unsigned int ordseq ; int orderr ; int ordcolor ; struct request pre_flush_rq ; struct request bar_rq ; struct request post_flush_rq ; struct request *orig_bar_rq ; struct mutex sysfs_lock ; struct bsg_class_device bsg_dev ; }; 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 * ) ; 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 __anonstruct_ldv_40679_206 { atomic_t rid ; atomic_t ip_id_count ; __u32 tcp_ts ; __u32 tcp_ts_stamp ; }; union __anonunion_ldv_40681_205 { struct __anonstruct_ldv_40679_206 ldv_40679 ; struct rcu_head rcu ; }; struct inet_peer { struct inet_peer *avl_left ; struct inet_peer *avl_right ; __be32 v4daddr ; __u32 avl_height ; struct list_head unused ; __u32 dtime ; atomic_t refcnt ; union __anonunion_ldv_40681_205 ldv_40681 ; }; struct in_device; struct rtable { struct dst_entry dst ; struct flowi fl ; struct in_device *idev ; int rt_genid ; unsigned int rt_flags ; __u16 rt_type ; __be32 rt_dst ; __be32 rt_src ; int rt_iif ; __be32 rt_gateway ; __be32 rt_spec_dst ; struct inet_peer *peer ; }; 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_segment_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_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 ; }; 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_42995_209 { u64 block_id ; struct digest_info *digest ; }; struct drbd_epoch_entry { struct drbd_work w ; struct hlist_node colision ; 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_42995_209 ldv_42995 ; }; struct drbd_bitmap; 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 ; 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 file *lo_file ; struct file *md_file ; struct drbd_md md ; struct disk_conf dc ; sector_t known_size ; }; struct bm_io_work { struct drbd_work w ; char *why ; 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, WO_bio_barrier = 3 } ; 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 timer_list resync_timer ; struct timer_list md_sync_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 ; }; 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 ; atomic_t bm_async_io ; wait_queue_head_t bm_io_wait ; unsigned long bm_flags ; char *bm_why ; struct task_struct *bm_task ; }; typedef int ldv_func_ret_type___0; typedef int ldv_func_ret_type___5; enum hrtimer_restart; 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 ; 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_MASK = 31 } ; struct bm_extent { int rs_left ; int rs_failed ; unsigned long flags ; struct lc_element lce ; }; 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_MAX_CMD = 40, 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 colision ; 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; enum drbd_req_event; enum drbd_req_event { created = 0, to_be_send = 1, to_be_submitted = 2, queue_for_net_write = 3, queue_for_net_read = 4, send_canceled = 5, send_failed = 6, handed_over_to_network = 7, connection_lost_while_pending = 8, read_retry_remote_canceled = 9, recv_acked_by_peer = 10, write_acked_by_peer = 11, write_acked_by_peer_and_sis = 12, conflict_discarded_by_peer = 13, neg_acked = 14, barrier_acked = 15, data_received = 16, read_completed_with_error = 17, read_ahead_completed_with_error = 18, write_completed_with_error = 19, completed_ok = 20, resend = 21, fail_frozen_disk_io = 22, restart_frozen_disk_io = 23, nothing = 24 } ; struct bio_and_error { struct bio *bio ; int error ; }; 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 } ; enum drbd_state_ret_codes { 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 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_BARRIER_DONE = 2, EV_BECAME_LAST = 3, EV_CLEANUP = 32 } ; enum dds_flags { DDSF_FORCED = 1, DDSF_NO_RESYNC = 2 } ; enum drbd_req_event; enum drbd_req_event; 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 ; }; struct flush_work { struct drbd_work w ; struct drbd_epoch *epoch ; }; enum finish_epoch { FE_STILL_LIVE = 0, FE_DESTROYED = 1, FE_RECYCLED = 2 } ; enum receive_bitmap_ret { OK = 0, DONE = 1, FAILED = 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; 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 drbd_req_event; enum drbd_req_event; enum hrtimer_restart; struct __anonstruct_updates_210 { u32 pos ; u32 extent ; }; struct al_transaction { u32 magic ; u32 tr_number ; struct __anonstruct_updates_210 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 drbd_atodb_wait { atomic_t count ; struct completion io_done ; struct drbd_conf *mdev ; int error ; }; struct _ddebug { char const *modname ; char const *function ; char const *filename ; char const *format ; unsigned int lineno : 24 ; unsigned char flags ; char enabled ; }; struct notifier_block { int (*notifier_call)(struct notifier_block * , unsigned long , void * ) ; struct notifier_block *next ; int priority ; }; enum hrtimer_restart; typedef unsigned int pao_T_____3; typedef unsigned int pao_T_____4; typedef unsigned int pao_T_____5; typedef unsigned int pao_T_____6; 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 } ; enum drbd_uuid_index { UI_CURRENT = 0, UI_BITMAP = 1, UI_HISTORY_START = 2, UI_HISTORY_END = 3, UI_SIZE = 4, UI_FLAGS = 5, UI_EXTENDED_SIZE = 6 } ; enum drbd_req_event; enum drbd_req_event; 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 ; }; enum ldv_30403 { OK___0 = 0, FAILED___0 = 1, DONE___0 = 2 } ; 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 reserved_u32[4U] ; }; struct fault_random_state { unsigned long state ; unsigned long count ; }; enum hrtimer_restart; typedef __u32 __le32; typedef __u64 __le64; 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 * ) ; 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 ; kernel_cap_t eff_cap ; __u32 loginuid ; __u32 sessionid ; __u32 sid ; }; enum drbd_ret_codes { 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, AFTER_LAST_ERR_CODE = 155 } ; struct drbd_nl_cfg_req { int packet_type ; unsigned int drbd_minor ; int flags ; unsigned short tag_list[] ; }; struct drbd_nl_cfg_reply { int packet_type ; unsigned int minor ; int ret_code ; unsigned short tag_list[] ; }; struct primary { unsigned char primary_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_req_event; enum drbd_req_event; 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_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_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 ; }; long ldv__builtin_expect(long exp , long c ) ; __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 __set_bit(int nr , unsigned long volatile *addr ) { { __asm__ volatile ("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 void __clear_bit(int nr , unsigned long volatile *addr ) { { __asm__ volatile ("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__ ("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 hweight_long(unsigned long w ) { unsigned long tmp ; { tmp = __arch_hweight64((__u64 )w); return (tmp); } } extern void warn_slowpath_null(char const * , int const ) ; extern void __might_sleep(char const * , int , int ) ; extern int printk(char const * , ...) ; 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__ ; { switch (8UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& current_task)); goto ldv_1956; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_1956; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_1956; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_1956; default: __bad_percpu_size(); } ldv_1956: ; return (pfo_ret__); } } extern void *memset(void * , int , size_t ) ; __inline static int get_order(unsigned long size ) { int order ; { size = (size - 1UL) >> 11; order = -1; ldv_4360: size = size >> 1; order = order + 1; if (size != 0UL) { goto ldv_4360; } else { } return (order); } } __inline static int atomic_read(atomic_t const *v ) { { return ((int )*((int volatile *)(& v->counter))); } } __inline static void atomic_set(atomic_t *v , int i ) { { v->counter = 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 void lockdep_rcu_dereference(char const * , int const ) ; extern void __mutex_init(struct mutex * , char const * , struct lock_class_key * ) ; extern int mutex_trylock(struct mutex * ) ; int ldv_mutex_trylock_2(struct mutex *ldv_func_arg1 ) ; int ldv_mutex_trylock_7(struct mutex *ldv_func_arg1 ) ; extern void mutex_unlock(struct mutex * ) ; void ldv_mutex_unlock_3(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_5(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_6(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_9(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_11(struct mutex *ldv_func_arg1 ) ; extern void mutex_lock(struct mutex * ) ; void ldv_mutex_lock_1(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_4(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_8(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_10(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_bm_change_of_drbd_bitmap(struct mutex *lock ) ; int ldv_mutex_trylock_bm_change_of_drbd_bitmap(struct mutex *lock ) ; void ldv_mutex_unlock_bm_change_of_drbd_bitmap(struct mutex *lock ) ; void ldv_mutex_lock_md_io_mutex_of_drbd_conf(struct mutex *lock ) ; void ldv_mutex_unlock_md_io_mutex_of_drbd_conf(struct mutex *lock ) ; void ldv_mutex_lock_mutex_of_device(struct mutex *lock ) ; int ldv_mutex_trylock_mutex_of_device(struct mutex *lock ) ; void ldv_mutex_unlock_mutex_of_device(struct mutex *lock ) ; void ldv_mutex_lock_mutex_of_drbd_socket(struct mutex *lock ) ; void ldv_mutex_unlock_mutex_of_drbd_socket(struct mutex *lock ) ; extern unsigned long kernel_stack ; __inline static struct thread_info *current_thread_info(void) { struct thread_info *ti ; unsigned long pfo_ret__ ; { switch (8UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5880; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5880; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5880; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5880; default: __bad_percpu_size(); } ldv_5880: 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_5620.rlock); } } __inline static void spin_lock_irq(spinlock_t *lock ) { { _raw_spin_lock_irq(& lock->ldv_5620.rlock); return; } } __inline static void spin_unlock_irq(spinlock_t *lock ) { { _raw_spin_unlock_irq(& lock->ldv_5620.rlock); return; } } __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) { { _raw_spin_unlock_irqrestore(& lock->ldv_5620.rlock, flags); return; } } extern void *vmalloc(unsigned long ) ; extern void vfree(void const * ) ; extern unsigned long volatile jiffies ; 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 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 unsigned long __get_free_pages(gfp_t , unsigned int ) ; extern void __free_pages(struct page * , unsigned int ) ; extern int debug_lockdep_rcu_enabled(void) ; __inline static int rcu_read_lock_sched_held(void) { { return (1); } } __inline static void rcu_read_lock_sched_notrace(void) { { return; } } extern int ___ratelimit(struct ratelimit_state * , char const * ) ; extern void kfree(void const * ) ; __inline static void kmemleak_alloc(void const *ptr , size_t size , int min_count , gfp_t gfp ) { { return; } } extern struct tracepoint __tracepoint_kmalloc ; __inline static void trace_kmalloc(unsigned long call_site , void const *ptr , size_t bytes_req , size_t bytes_alloc , gfp_t gfp_flags ) { long tmp ; struct tracepoint_func *it_func_ptr ; void *it_func ; void *__data ; struct tracepoint_func *_________p1 ; bool __warned ; int tmp___0 ; int tmp___1 ; { tmp = ldv__builtin_expect(__tracepoint_kmalloc.state != 0, 0L); if (tmp != 0L) { goto do_trace; } else { } return; do_trace: rcu_read_lock_sched_notrace(); _________p1 = *((struct tracepoint_func * volatile *)(& __tracepoint_kmalloc.funcs)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { tmp___1 = rcu_read_lock_sched_held(); if (tmp___1 == 0 && 1) { __warned = 1; lockdep_rcu_dereference("include/trace/events/kmem.h", 51); } else { } } else { } it_func_ptr = _________p1; if ((unsigned long )it_func_ptr != (unsigned long )((struct tracepoint_func *)0)) { ldv_13817: it_func = it_func_ptr->func; __data = it_func_ptr->data; (*((void (*)(void * , unsigned long , void const * , size_t , size_t , gfp_t ))it_func))(__data, call_site, ptr, bytes_req, bytes_alloc, gfp_flags); it_func_ptr = it_func_ptr + 1; if ((unsigned long )it_func_ptr->func != (unsigned long )((void *)0)) { goto ldv_13817; } else { } } else { } rcu_read_lock_sched_notrace(); return; } } extern struct kmem_cache kmalloc_caches[28U] ; __inline static int kmalloc_index(size_t size ) { { if (size == 0UL) { return (0); } else { } if (size <= 8UL) { return (3); } else { } if (size > 64UL && size <= 96UL) { return (1); } else { } if (size > 128UL && size <= 192UL) { return (2); } else { } if (size <= 8UL) { return (3); } else { } if (size <= 16UL) { return (4); } else { } if (size <= 32UL) { return (5); } else { } if (size <= 64UL) { return (6); } else { } if (size <= 128UL) { return (7); } else { } if (size <= 256UL) { return (8); } else { } if (size <= 512UL) { return (9); } else { } if (size <= 1024UL) { return (10); } else { } if (size <= 2048UL) { return (11); } else { } if (size <= 4096UL) { return (12); } else { } if (size <= 8192UL) { return (13); } else { } if (size <= 16384UL) { return (14); } else { } if (size <= 32768UL) { return (15); } else { } if (size <= 65536UL) { return (16); } else { } if (size <= 131072UL) { return (17); } else { } if (size <= 262144UL) { return (18); } else { } if (size <= 524288UL) { return (19); } else { } if (size <= 1048576UL) { return (20); } else { } if (size <= 2097152UL) { return (21); } else { } return (-1); } } __inline static struct kmem_cache *kmalloc_slab(size_t size ) { int index ; int tmp ; { tmp = kmalloc_index(size); index = tmp; if (index == 0) { return (0); } else { } return ((struct kmem_cache *)(& kmalloc_caches) + (unsigned long )index); } } extern void *__kmalloc(size_t , gfp_t ) ; extern void *kmem_cache_alloc_notrace(struct kmem_cache * , gfp_t ) ; __inline static void *kmalloc_large(size_t size , gfp_t flags ) { unsigned int order ; int tmp ; void *ret ; unsigned long tmp___0 ; { tmp = get_order(size); order = (unsigned int )tmp; tmp___0 = __get_free_pages(flags | 16384U, order); ret = (void *)tmp___0; kmemleak_alloc((void const *)ret, size, 1, flags); trace_kmalloc((unsigned long )((void *)0), (void const *)ret, size, 4096UL << (int )order, flags); return (ret); } } __inline static void *kmalloc(size_t size , gfp_t flags ) { void *ret ; void *tmp ; struct kmem_cache *s ; struct kmem_cache *tmp___0 ; void *tmp___1 ; { if (0) { if (size > 8192UL) { tmp = kmalloc_large(size, flags); return (tmp); } else { } if ((flags & 1U) == 0U) { tmp___0 = kmalloc_slab(size); s = tmp___0; if ((unsigned long )s == (unsigned long )((struct kmem_cache *)0)) { return (16); } else { } ret = kmem_cache_alloc_notrace(s, flags); trace_kmalloc((unsigned long )((void *)0), (void const *)ret, size, (size_t )s->size, flags); return (ret); } else { } } else { } tmp___1 = __kmalloc(size, flags); return (tmp___1); } } __inline static void *kzalloc(size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc(size, flags | 32768U); return (tmp); } } 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 * , ...) ; __inline static void *lowmem_page_address(struct page *page ) { { return ((void *)((unsigned long )((unsigned long long )(((long )page + 24189255811072L) / 56L) << 12) + 0xffff880000000000UL)); } } 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; } } __inline static void *kmap_atomic(struct page *page , enum km_type idx ) { void *tmp ; { pagefault_disable(); tmp = lowmem_page_address(page); return (tmp); } } __inline static void kunmap_atomic_notypecheck(void *addr , enum km_type idx ) { { 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 ) ; __inline static struct request_queue *bdev_get_queue(struct block_device *bdev ) { { return ((bdev->bd_disk)->queue); } } extern int blkdev_issue_flush(struct block_device * , gfp_t , sector_t * , unsigned long ) ; 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 && (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; } return (tmp___0); } } struct ratelimit_state drbd_ratelimit_state ; int __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 ) ; 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 ) ; 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_sect(struct drbd_conf *mdev , unsigned long enr ) ; 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 ) ; void drbd_bm_unlock(struct drbd_conf *mdev ) ; int drbd_bm_count_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) ; rwlock_t global_state_lock ; char *ppsize(char *buf , unsigned long long size ) ; int drbd_md_sync_page_io(struct drbd_conf *mdev , struct drbd_backing_dev *bdev , sector_t sector , int rw ) ; __inline static int _drbd_set_state(struct drbd_conf *mdev , union drbd_state ns , enum chg_state_flags flags , struct completion *done ) { int 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 ; { switch ((mdev->ldev)->dc.on_io_error) { 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.Passing error on...\n", where); } else { } goto ldv_43978; } else { } case 2: ; case 1: ; if ((int )mdev->state.ldv_35533.disk > 2) { __ns.i = mdev->state.i; __ns.ldv_35533.disk = 2U; _drbd_set_state(mdev, __ns, CS_HARD, 0); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s.Detaching...\n", where); } else { } goto ldv_43978; } ldv_43978: ; 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 ) { { switch (bdev->dc.meta_dev_idx) { case -1: ; case -3: ; return ((sector_t )(bdev->md.md_offset + 7ULL)); case -2: ; default: ; return ((sector_t )(bdev->md.md_offset + (u64 )bdev->md.md_size_sect)); } } } __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 *)"/work/ldvuser/novikov/inst/current/envs/linux/linux/drivers/block/drbd/drbd_int.h", 2128); } else { } if (i == 0) { if ((unsigned int )*((unsigned char *)mdev + 2013UL) == 4U) { drbd_go_diskless(mdev); } else { } __wake_up(& mdev->misc_wait, 3U, 1, 0); } else { } return; } } __inline static int _get_ldev_if_state(struct drbd_conf *mdev , enum drbd_disk_state mins ) { int io_allowed ; { atomic_inc(& mdev->local_cnt); io_allowed = (unsigned int )mdev->state.ldv_35533.disk >= (unsigned int )mins; if (io_allowed == 0) { put_ldev(mdev); } else { } return (io_allowed); } } __inline static void drbd_blk_run_queue(struct request_queue *q ) { { if ((unsigned long )q != (unsigned long )((struct request_queue *)0) && (unsigned long )q->unplug_fn != (unsigned long )((unplug_fn *)0)) { (*(q->unplug_fn))(q); } else { } return; } } __inline static void drbd_md_flush(struct drbd_conf *mdev ) { int r ; int tmp ; { tmp = constant_test_bit(15U, (unsigned long const volatile *)(& mdev->flags)); if (tmp != 0) { return; } else { } r = blkdev_issue_flush((mdev->ldev)->md_bdev, 208U, 0, 1UL); if (r != 0) { set_bit(15U, (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 int __bm_change_bits_to(struct drbd_conf *mdev , unsigned long const s , unsigned long e , int val , enum km_type const km ) ; static int bm_is_locked(struct drbd_bitmap *b ) { int tmp ; { tmp = constant_test_bit(0U, (unsigned long const volatile *)(& b->bm_flags)); return (tmp); } } static void __bm_print_lock_info(struct drbd_conf *mdev , char const *func ) { struct drbd_bitmap *b ; int tmp ; struct task_struct *tmp___3 ; char *tmp___4 ; struct task_struct *tmp___5 ; char *tmp___6 ; struct task_struct *tmp___7 ; char *tmp___8 ; struct task_struct *tmp___9 ; { b = mdev->bitmap; tmp = ___ratelimit(& drbd_ratelimit_state, "__bm_print_lock_info"); if (tmp == 0) { return; } else { } tmp___9 = get_current(); if ((unsigned long )tmp___9 != (unsigned long )mdev->receiver.task) { tmp___7 = get_current(); if ((unsigned long )tmp___7 != (unsigned long )mdev->asender.task) { tmp___5 = get_current(); if ((unsigned long )tmp___5 != (unsigned long )mdev->worker.task) { tmp___3 = get_current(); tmp___4 = (char *)(& tmp___3->comm); } else { tmp___4 = (char *)"worker"; } tmp___6 = tmp___4; } else { tmp___6 = (char *)"asender"; } tmp___8 = tmp___6; } else { tmp___8 = (char *)"receiver"; } dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "FIXME %s in %s, bitmap locked for \'%s\' by %s\n", tmp___8, func, (unsigned long )b->bm_why != (unsigned long )((char *)0) ? b->bm_why : (char *)"?", (unsigned long )b->bm_task != (unsigned long )mdev->receiver.task ? ((unsigned long )b->bm_task != (unsigned long )mdev->asender.task ? ((unsigned long )b->bm_task == (unsigned long )mdev->worker.task ? (char *)"worker" : (char *)"?") : (char *)"asender") : (char *)"receiver"); return; } } void drbd_bm_lock(struct drbd_conf *mdev , char *why ) { struct drbd_bitmap *b ; int trylock_failed ; int tmp ; struct task_struct *tmp___3 ; char *tmp___4 ; struct task_struct *tmp___5 ; char *tmp___6 ; struct task_struct *tmp___7 ; char *tmp___8 ; struct task_struct *tmp___9 ; int tmp___10 ; { 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 = ldv_mutex_trylock_7(& b->bm_change); trylock_failed = tmp == 0; if (trylock_failed != 0) { tmp___9 = get_current(); if ((unsigned long )tmp___9 != (unsigned long )mdev->receiver.task) { tmp___7 = get_current(); if ((unsigned long )tmp___7 != (unsigned long )mdev->asender.task) { tmp___5 = get_current(); if ((unsigned long )tmp___5 != (unsigned long )mdev->worker.task) { tmp___3 = get_current(); tmp___4 = (char *)(& tmp___3->comm); } else { tmp___4 = (char *)"worker"; } tmp___6 = tmp___4; } else { tmp___6 = (char *)"asender"; } tmp___8 = tmp___6; } else { tmp___8 = (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___8, why, (unsigned long )b->bm_why != (unsigned long )((char *)0) ? b->bm_why : (char *)"?", (unsigned long )b->bm_task != (unsigned long )mdev->receiver.task ? ((unsigned long )b->bm_task != (unsigned long )mdev->asender.task ? ((unsigned long )b->bm_task == (unsigned long )mdev->worker.task ? (char *)"worker" : (char *)"?") : (char *)"asender") : (char *)"receiver"); ldv_mutex_lock_8(& b->bm_change); } else { } tmp___10 = __test_and_set_bit(0, (unsigned long volatile *)(& b->bm_flags)); if (tmp___10 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "FIXME bitmap already locked in bm_lock\n"); } else { } b->bm_why = why; b->bm_task = get_current(); return; } } void drbd_bm_unlock(struct drbd_conf *mdev ) { struct drbd_bitmap *b ; int tmp ; { 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 { } tmp = __test_and_clear_bit(0, (unsigned long volatile *)(& (mdev->bitmap)->bm_flags)); if (tmp == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "FIXME bitmap not locked in bm_unlock\n"); } else { } b->bm_why = 0; b->bm_task = 0; ldv_mutex_unlock_9(& b->bm_change); return; } } static unsigned long *__bm_map_paddr(struct drbd_bitmap *b , unsigned long offset , enum km_type const km ) { struct page *page ; unsigned long page_nr ; long tmp ; void *tmp___0 ; { page_nr = offset >> 9; tmp = ldv__builtin_expect(b->bm_number_of_pages <= page_nr, 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared"), "i" (220), "i" (12UL)); ldv_44255: ; goto ldv_44255; } else { } page = *(b->bm_pages + page_nr); tmp___0 = kmap_atomic(page, km); return ((unsigned long *)tmp___0); } } static unsigned long *bm_map_paddr(struct drbd_bitmap *b , unsigned long offset ) { unsigned long *tmp ; { tmp = __bm_map_paddr(b, offset, KM_IRQ1); return (tmp); } } static void __bm_unmap(unsigned long *p_addr , enum km_type const km ) { { kunmap_atomic_notypecheck((void *)p_addr, km); 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_44274; ldv_44273: ; 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_44272; } else { } __free_pages(*(pages + i), 0U); *(pages + i) = 0; ldv_44272: i = i + 1UL; ldv_44274: ; if (i < number) { goto ldv_44273; } else { } 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 = ldv__builtin_expect(have == 0UL, 0L); if (tmp != 0L) { tmp___0 = ldv__builtin_expect((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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared"), "i" (296), "i" (12UL)); ldv_44291: ; goto ldv_44291; } else { } } else { } tmp___1 = ldv__builtin_expect(have != 0UL, 0L); if (tmp___1 != 0L) { tmp___2 = ldv__builtin_expect((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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared"), "i" (297), "i" (12UL)); ldv_44292: ; goto ldv_44292; } 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 (0); } else { } vmalloced = 1U; } else { } memset((void *)new_pages, 0, (size_t )bytes); if (want >= have) { i = 0U; goto ldv_44294; ldv_44293: *(new_pages + (unsigned long )i) = *(old_pages + (unsigned long )i); i = i + 1U; ldv_44294: ; if ((unsigned long )i < have) { goto ldv_44293; } else { } goto ldv_44297; ldv_44296: 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 (0); } else { } *(new_pages + (unsigned long )i) = page; i = i + 1U; ldv_44297: ; if ((unsigned long )i < want) { goto ldv_44296; } else { } } else { i = 0U; goto ldv_44300; ldv_44299: *(new_pages + (unsigned long )i) = *(old_pages + (unsigned long )i); i = i + 1U; ldv_44300: ; if ((unsigned long )i < want) { goto ldv_44299; } else { } } if (vmalloced != 0U) { set_bit(2U, (unsigned long volatile *)(& b->bm_flags)); } else { clear_bit(2, (unsigned long volatile *)(& b->bm_flags)); } 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 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 352); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___0 = kzalloc(408UL, 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_5620.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), "%s: (%s) in %s:%d\n", "drbd_bm_capacity", (char *)"!mdev->bitmap", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 367); } else { } if (_b != 0) { return (0UL); } else { } return ((mdev->bitmap)->bm_dev_capacity); } } void drbd_bm_cleanup(struct drbd_conf *mdev ) { int _b ; int tmp ; { _b = (unsigned long )mdev->bitmap == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "drbd_bm_cleanup", (char *)"!mdev->bitmap", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 375); } else { } if (_b != 0) { return; } else { } bm_free_pages((mdev->bitmap)->bm_pages, (mdev->bitmap)->bm_number_of_pages); tmp = constant_test_bit(2U, (unsigned long const volatile *)(& (mdev->bitmap)->bm_flags)); bm_vk_free((void *)(mdev->bitmap)->bm_pages, tmp); kfree((void const *)mdev->bitmap); mdev->bitmap = 0; return; } } static int bm_clear_surplus(struct drbd_bitmap *b ) { unsigned long mask ; size_t w ; int cleared ; unsigned long *p_addr ; unsigned long *bm ; unsigned long tmp ; unsigned long tmp___0 ; { mask = (1UL << ((int )b->bm_bits & 63)) - 1UL; w = b->bm_bits >> 6; cleared = 0; p_addr = bm_map_paddr(b, w); bm = p_addr + (w & 511UL); if (b->bm_words > w) { tmp = hweight_long(*bm & ~ mask); cleared = (int )tmp; *bm = *bm & mask; w = w + (size_t )1; bm = bm + 1; } else { } if (b->bm_words > w) { tmp___0 = hweight_long(*bm); cleared = (int )((unsigned int )tmp___0 + (unsigned int )cleared); *bm = 0UL; } else { } bm_unmap(p_addr); return (cleared); } } static void bm_set_surplus(struct drbd_bitmap *b ) { unsigned long mask ; size_t w ; unsigned long *p_addr ; unsigned long *bm ; { mask = (1UL << ((int )b->bm_bits & 63)) - 1UL; w = b->bm_bits >> 6; p_addr = bm_map_paddr(b, w); bm = p_addr + (w & 511UL); if (b->bm_words > w) { *bm = *bm | ~ mask; bm = bm + 1; w = w + (size_t )1; } else { } if (b->bm_words > w) { *bm = 0xffffffffffffffffUL; } else { } bm_unmap(p_addr); return; } } static unsigned long __bm_count_bits(struct drbd_bitmap *b , int const swap_endian ) { unsigned long *p_addr ; unsigned long *bm ; unsigned long offset ; unsigned long bits ; unsigned long i ; unsigned long do_now ; size_t __min1 ; size_t __min2 ; unsigned long *tmp ; unsigned long tmp___0 ; unsigned long tmp___1 ; { offset = 0UL; bits = 0UL; goto ldv_44356; ldv_44355: __min1 = b->bm_words - offset; __min2 = 512UL; do_now = __min1 < __min2 ? __min1 : __min2; i = do_now; p_addr = __bm_map_paddr(b, offset, KM_USER0); bm = p_addr + (offset & 511UL); goto ldv_44352; ldv_44351: tmp = bm; bm = bm + 1; tmp___0 = hweight_long(*tmp); bits = tmp___0 + bits; ldv_44352: tmp___1 = i; i = i - 1UL; if (tmp___1 != 0UL) { goto ldv_44351; } else { } __bm_unmap(p_addr, KM_USER0); offset = offset + do_now; __might_sleep("/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 448, 0); _cond_resched(); ldv_44356: ; if (b->bm_words > offset) { goto ldv_44355; } else { } return (bits); } } static unsigned long bm_count_bits(struct drbd_bitmap *b ) { unsigned long tmp ; { tmp = __bm_count_bits(b, 0); return (tmp); } } static unsigned long bm_count_bits_swap_endian(struct drbd_bitmap *b ) { unsigned long tmp ; { tmp = __bm_count_bits(b, 1); return (tmp); } } static void bm_memset(struct drbd_bitmap *b , size_t offset , int c , size_t len ) { unsigned long *p_addr ; unsigned long *bm ; size_t do_now ; size_t end ; size_t __min1 ; size_t __min2 ; { end = offset + len; if (b->bm_words < end) { printk("<1>drbd: bm_memset end > bm_words\n"); return; } else { } goto ldv_44379; ldv_44378: __min1 = (offset + 512UL) & 0xfffffffffffffe00UL; __min2 = end; do_now = (__min1 < __min2 ? __min1 : __min2) - offset; p_addr = bm_map_paddr(b, offset); 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); goto ldv_44377; } else { } memset((void *)bm, c, do_now * 8UL); bm_unmap(p_addr); offset = offset + do_now; ldv_44379: ; if (offset < end) { goto ldv_44378; } else { } ldv_44377: ; 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 *p_addr ; unsigned long *bm ; 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 ; int tmp___3 ; int tmp___4 ; { b = mdev->bitmap; opages = 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), "%s: (%s) in %s:%d\n", "drbd_bm_resize", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 511); } else { } if (_b != 0) { return (-12); } else { } drbd_bm_lock(mdev, (char *)"resize"); _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 = constant_test_bit(2U, (unsigned long const volatile *)(& b->bm_flags)); 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 = 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, D_INCONSISTENT); if (tmp___3 != 0) { if (((unsigned long long )(mdev->ldev)->md.md_size_sect - 72ULL) << 12 < (unsigned long long )bits) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( (u64)bits <= (((u64)mdev->ldev->md.md_size_sect-MD_BM_OFFSET) << 12) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 549); } else { } put_ldev(mdev); } else { } want = ((words + 1UL) * 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 557); } else { } npages = b->bm_pages; } else { tmp___4 = drbd_insert_fault(mdev, 7U); if (tmp___4 != 0) { npages = 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) && growing != 0) && set_new_bits != 0) { bm_set_surplus(b); } 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 { } p_addr = bm_map_paddr(b, words); bm = p_addr + (words & 511UL); *bm = 2205418087UL; bm_unmap(p_addr); 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\n", bits, words); 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), "%s: (%s) in %s:%d\n", "_drbd_bm_total_weight", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 633); } 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), "%s: (%s) in %s:%d\n", "_drbd_bm_total_weight", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 634); } 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, D_NEGOTIATING); 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), "%s: (%s) in %s:%d\n", "drbd_bm_words", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 657); } 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), "%s: (%s) in %s:%d\n", "drbd_bm_words", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 658); } 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), "%s: (%s) in %s:%d\n", "drbd_bm_bits", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 666); } 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 ; 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 ; unsigned long *tmp___1 ; unsigned long *tmp___2 ; unsigned long tmp___3 ; size_t tmp___4 ; int tmp___5 ; { 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), "%s: (%s) in %s:%d\n", "drbd_bm_merge_lel", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 686); } 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), "%s: (%s) in %s:%d\n", "drbd_bm_merge_lel", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 687); } else { } if (_b___0 != 0) { return; } else { } if (number == 0UL) { return; } else { } __ret_warn_on = b->bm_words <= offset; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 690); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __ret_warn_on___0 = b->bm_words < end; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 691); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); spin_lock_irq(& b->bm_lock); goto ldv_44467; ldv_44466: __min1 = (offset + 512UL) & 0xfffffffffffffe00UL; __min2 = end; do_now = (__min1 < __min2 ? __min1 : __min2) - offset; p_addr = bm_map_paddr(b, offset); bm = p_addr + (offset & 511UL); offset = offset + do_now; goto ldv_44464; ldv_44463: bits = hweight_long(*bm); tmp___1 = buffer; buffer = buffer + 1; word = (unsigned long )((unsigned long long )*bm | (unsigned long long )*tmp___1); tmp___2 = bm; bm = bm + 1; *tmp___2 = word; tmp___3 = hweight_long(word); b->bm_set = b->bm_set + (tmp___3 - bits); ldv_44464: tmp___4 = do_now; do_now = do_now - (size_t )1; if (tmp___4 != 0UL) { goto ldv_44463; } else { } bm_unmap(p_addr); ldv_44467: ; if (offset < end) { goto ldv_44466; } else { } if (b->bm_words == end) { tmp___5 = bm_clear_surplus(b); b->bm_set = b->bm_set - (unsigned long )tmp___5; } 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 ; unsigned long *tmp ; unsigned long *tmp___0 ; size_t tmp___1 ; { 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), "%s: (%s) in %s:%d\n", "drbd_bm_get_lel", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 730); } 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), "%s: (%s) in %s:%d\n", "drbd_bm_get_lel", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 731); } else { } if (_b___0 != 0) { return; } else { } spin_lock_irq(& b->bm_lock); if ((b->bm_words <= offset || b->bm_words < end) || 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_44492; ldv_44491: __min1 = (offset + 512UL) & 0xfffffffffffffe00UL; __min2 = end; do_now = (__min1 < __min2 ? __min1 : __min2) - offset; p_addr = bm_map_paddr(b, offset); bm = p_addr + (offset & 511UL); offset = offset + do_now; goto ldv_44489; ldv_44488: tmp = buffer; buffer = buffer + 1; tmp___0 = bm; bm = bm + 1; *tmp = *tmp___0; ldv_44489: tmp___1 = do_now; do_now = do_now - (size_t )1; if (tmp___1 != 0UL) { goto ldv_44488; } else { } bm_unmap(p_addr); ldv_44492: ; if (offset < end) { goto ldv_44491; } else { } } 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), "%s: (%s) in %s:%d\n", "drbd_bm_set_all", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 759); } 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), "%s: (%s) in %s:%d\n", "drbd_bm_set_all", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 760); } 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), "%s: (%s) in %s:%d\n", "drbd_bm_clear_all", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 773); } 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), "%s: (%s) in %s:%d\n", "drbd_bm_clear_all", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 774); } 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 drbd_bitmap *b ; int uptodate ; int tmp ; { b = (struct drbd_bitmap *)bio->bi_private; uptodate = (int )bio->bi_flags & 1; if (error == 0 && uptodate == 0) { error = -5; } else { } if (error != 0) { __set_bit(1, (unsigned long volatile *)(& b->bm_flags)); } else { } tmp = atomic_dec_and_test(& b->bm_async_io); if (tmp != 0) { __wake_up(& b->bm_io_wait, 3U, 1, 0); } else { } bio_put(bio); return; } } static void bm_page_io_async(struct drbd_conf *mdev , struct drbd_bitmap *b , int page_nr , int rw ) { struct bio *bio ; struct bio *tmp ; unsigned int len ; sector_t on_disk_sector ; unsigned int __min1 ; unsigned int __min2 ; sector_t tmp___0 ; int tmp___1 ; { tmp = bio_alloc(208U, 1); bio = tmp; 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; len = __min1 < __min2 ? __min1 : __min2; bio->bi_bdev = (mdev->ldev)->md_bdev; bio->bi_sector = on_disk_sector; bio_add_page(bio, *(b->bm_pages + (unsigned long )page_nr), len, 0U); bio->bi_private = (void *)b; bio->bi_end_io = & bm_async_io_complete; tmp___1 = drbd_insert_fault(mdev, rw & 1 ? 0U : 1U); if (tmp___1 != 0) { bio->bi_rw = bio->bi_rw | (unsigned long )rw; bio_endio(bio, -5); } else { submit_bio(rw, bio); } return; } } static int bm_rw(struct drbd_conf *mdev , int rw ) { struct drbd_bitmap *b ; int bm_words ; int num_pages ; int i ; unsigned long now ; char ppb[10U] ; int err ; int __ret_warn_on ; int tmp ; long tmp___0 ; size_t tmp___1 ; struct request_queue *tmp___2 ; int tmp___3 ; wait_queue_t __wait ; struct task_struct *tmp___4 ; int tmp___5 ; int tmp___6 ; char *tmp___7 ; { b = mdev->bitmap; err = 0; tmp = bm_is_locked(b); __ret_warn_on = tmp == 0; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 879); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___1 = drbd_bm_words(mdev); bm_words = (int )tmp___1; num_pages = (int )((((unsigned long )bm_words + 512UL) * 8UL - 1UL) >> 12); now = jiffies; atomic_set(& b->bm_async_io, num_pages); __clear_bit(1, (unsigned long volatile *)(& b->bm_flags)); i = 0; goto ldv_44544; ldv_44543: bm_page_io_async(mdev, b, i, rw); i = i + 1; ldv_44544: ; if (i < num_pages) { goto ldv_44543; } else { } tmp___2 = bdev_get_queue((mdev->ldev)->md_bdev); drbd_blk_run_queue(tmp___2); tmp___3 = atomic_read((atomic_t const *)(& b->bm_async_io)); if (tmp___3 == 0) { goto ldv_44546; } 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_44549: prepare_to_wait(& b->bm_io_wait, & __wait, 2); tmp___5 = atomic_read((atomic_t const *)(& b->bm_async_io)); if (tmp___5 == 0) { goto ldv_44548; } else { } schedule(); goto ldv_44549; ldv_44548: finish_wait(& b->bm_io_wait, & __wait); ldv_44546: tmp___6 = constant_test_bit(1U, (unsigned long const volatile *)(& b->bm_flags)); if (tmp___6 != 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 = jiffies; if (rw == 1) { drbd_md_flush(mdev); } else { b->bm_set = bm_count_bits_swap_endian(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___7 = 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___7, now); return (err); } } int drbd_bm_read(struct drbd_conf *mdev ) { int tmp ; { tmp = bm_rw(mdev, 0); return (tmp); } } int drbd_bm_write(struct drbd_conf *mdev ) { int tmp ; { tmp = bm_rw(mdev, 1); return (tmp); } } int drbd_bm_write_sect(struct drbd_conf *mdev , unsigned long enr ) { sector_t on_disk_sector ; int bm_words ; int num_words ; int offset ; int err ; size_t tmp ; int _min1 ; int _min2 ; void *tmp___0 ; void *tmp___1 ; int i ; int tmp___2 ; { on_disk_sector = (sector_t )(((mdev->ldev)->md.md_offset + (unsigned long long )enr) + (unsigned long long )(mdev->ldev)->md.bm_offset); err = 0; ldv_mutex_lock_10(& mdev->md_io_mutex); tmp = drbd_bm_words(mdev); bm_words = (int )tmp; offset = (int )(enr << 6); _min1 = 64; _min2 = bm_words - offset; num_words = _min1 < _min2 ? _min1 : _min2; if (num_words <= 63) { tmp___0 = lowmem_page_address(mdev->md_io_page); memset(tmp___0, 0, 512UL); } else { } tmp___1 = lowmem_page_address(mdev->md_io_page); drbd_bm_get_lel(mdev, (size_t )offset, (size_t )num_words, (unsigned long *)tmp___1); tmp___2 = drbd_md_sync_page_io(mdev, mdev->ldev, on_disk_sector, 1); if (tmp___2 == 0) { err = -5; dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "IO ERROR writing bitmap sector %lu (meta-disk sector %llus)\n", enr, (unsigned long long )on_disk_sector); drbd_chk_io_error_(mdev, 1, 1, "drbd_bm_write_sect"); i = 0; goto ldv_44572; ldv_44571: drbd_bm_ALe_set_all(mdev, enr * 4UL + (unsigned long )i); i = i + 1; ldv_44572: ; if (i <= 3) { goto ldv_44571; } else { } } else { } mdev->bm_writ_cnt = mdev->bm_writ_cnt + 1U; ldv_mutex_unlock_11(& mdev->md_io_mutex); return (err); } } 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 i ; unsigned long *p_addr ; unsigned long bit_offset ; unsigned long offset ; { b = mdev->bitmap; i = 0xffffffffffffffffUL; 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); } else { goto ldv_44588; ldv_44587: bit_offset = bm_fo & 0xffffffffffff8000UL; offset = bit_offset >> 6; p_addr = __bm_map_paddr(b, offset, km); if ((int )find_zero_bit != 0) { i = find_next_zero_bit((unsigned long const *)p_addr, 32768UL, bm_fo & 32767UL); } else { i = find_next_bit((unsigned long const *)p_addr, 32768UL, bm_fo & 32767UL); } __bm_unmap(p_addr, km); if (i <= 32767UL) { i = bit_offset + i; if (b->bm_bits <= i) { goto ldv_44585; } else { } goto found; } else { } bm_fo = bit_offset + 32768UL; ldv_44588: ; if (b->bm_bits > bm_fo) { goto ldv_44587; } else { } ldv_44585: i = 0xffffffffffffffffUL; } found: ; return (i); } } 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 ; int tmp ; { b = mdev->bitmap; i = 0xffffffffffffffffUL; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "bm_find_next", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1034); } 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), "%s: (%s) in %s:%d\n", "bm_find_next", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1035); } else { } if (_b___0 != 0) { return (i); } else { } spin_lock_irq(& b->bm_lock); tmp = bm_is_locked(b); if (tmp != 0) { __bm_print_lock_info(mdev, "bm_find_next"); } else { } i = __bm_find_next(mdev, bm_fo, find_zero_bit, KM_IRQ1); 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, 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, 0, KM_USER1); 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, 1, KM_USER1); return (tmp); } } static int __bm_change_bits_to(struct drbd_conf *mdev , unsigned long const s , unsigned long e , int val , enum km_type const km ) { struct drbd_bitmap *b ; unsigned long *p_addr ; unsigned long bitnr ; unsigned long last_page_nr ; int c ; unsigned long offset ; unsigned long page_nr ; int tmp ; int tmp___0 ; { b = mdev->bitmap; p_addr = 0; last_page_nr = 0xffffffffffffffffUL; c = 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); e = b->bm_bits != 0UL ? b->bm_bits - 1UL : 0UL; } else { } bitnr = s; goto ldv_44628; ldv_44627: offset = bitnr >> 6; page_nr = offset >> 9; if (page_nr != last_page_nr) { if ((unsigned long )p_addr != (unsigned long )((unsigned long *)0)) { __bm_unmap(p_addr, km); } else { } p_addr = __bm_map_paddr(b, offset, km); last_page_nr = page_nr; } else { } if (val != 0) { tmp = __test_and_set_bit((int )bitnr & 32767, (unsigned long volatile *)p_addr); c = (tmp == 0) + c; } else { tmp___0 = __test_and_clear_bit((int )bitnr & 32767, (unsigned long volatile *)p_addr); c = c - (tmp___0 != 0); } bitnr = bitnr + 1UL; ldv_44628: ; if (bitnr <= e) { goto ldv_44627; } else { } if ((unsigned long )p_addr != (unsigned long )((unsigned long *)0)) { __bm_unmap(p_addr, km); } else { } b->bm_set = b->bm_set + (unsigned long )c; return (c); } } 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 ; 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), "%s: (%s) in %s:%d\n", "bm_change_bits_to", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1125); } 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), "%s: (%s) in %s:%d\n", "bm_change_bits_to", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1126); } else { } if (_b___0 != 0) { return (0); } else { } tmp = spinlock_check(& b->bm_lock); flags = _raw_spin_lock_irqsave(tmp); tmp___0 = bm_is_locked(b); if (tmp___0 != 0) { __bm_print_lock_info(mdev, "bm_change_bits_to"); } else { } c = __bm_change_bits_to(mdev, s, e, val, KM_IRQ1); 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), KM_USER0); paddr = (unsigned long *)tmp; i = first_word; goto ldv_44667; ldv_44666: tmp___0 = hweight_long(*(paddr + (unsigned long )i)); bits = (int )tmp___0; *(paddr + (unsigned long )i) = 0xffffffffffffffffUL; b->bm_set = b->bm_set + (unsigned long )(64 - bits); i = i + 1; ldv_44667: ; if (i < last_word) { goto ldv_44666; } else { } kunmap_atomic_notypecheck((void *)paddr, KM_USER0); return; } } void _drbd_bm_set_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) { unsigned long sl ; unsigned long el ; int first_page ; int last_page ; int page_nr ; int first_word ; int last_word ; { sl = ((unsigned long )s + 63UL) & 0xffffffffffffffc0UL; el = ((unsigned long )e + 1UL) & 0xffffffffffffffc0UL; if ((unsigned long )e - (unsigned long )s <= 192UL) { __bm_change_bits_to(mdev, s, e, 1, KM_USER0); return; } else { } if (sl != 0UL) { __bm_change_bits_to(mdev, s, sl - 1UL, 1, KM_USER0); } 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_44683; ldv_44682: bm_set_full_words_within_one_page(mdev->bitmap, page_nr, first_word, last_word); __might_sleep("/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1211, 0); _cond_resched(); first_word = 0; page_nr = page_nr + 1; ldv_44683: ; if (page_nr < last_page) { goto ldv_44682; } else { } 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, el, e, 1, KM_USER0); } else { } 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 ; int tmp___0 ; unsigned long offset ; 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), "%s: (%s) in %s:%d\n", "drbd_bm_test_bit", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1242); } 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), "%s: (%s) in %s:%d\n", "drbd_bm_test_bit", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1243); } else { } if (_b___0 != 0) { return (0); } else { } tmp = spinlock_check(& b->bm_lock); flags = _raw_spin_lock_irqsave(tmp); tmp___0 = bm_is_locked(b); if (tmp___0 != 0) { __bm_print_lock_info(mdev, "drbd_bm_test_bit"); } else { } if (b->bm_bits > (unsigned long )bitnr) { offset = bitnr >> 6; p_addr = bm_map_paddr(b, offset); tmp___1 = variable_test_bit((int )bitnr & 32767, (unsigned long const volatile *)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 page_nr ; unsigned long bitnr ; int c ; size_t w ; int _b ; int _b___0 ; raw_spinlock_t *tmp ; int tmp___0 ; int tmp___1 ; int _b___1 ; { b = mdev->bitmap; p_addr = 0; page_nr = 0xffffffffffffffffUL; c = 0; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "drbd_bm_count_bits", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1278); } 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), "%s: (%s) in %s:%d\n", "drbd_bm_count_bits", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1279); } else { } if (_b___0 != 0) { return (1); } else { } tmp = spinlock_check(& b->bm_lock); flags = _raw_spin_lock_irqsave(tmp); tmp___0 = bm_is_locked(b); if (tmp___0 != 0) { __bm_print_lock_info(mdev, "drbd_bm_count_bits"); } else { } bitnr = s; goto ldv_44725; ldv_44724: w = bitnr >> 6; if (w >> 9 != page_nr) { page_nr = w >> 9; if ((unsigned long )p_addr != (unsigned long )((unsigned long *)0)) { bm_unmap(p_addr); } else { } p_addr = bm_map_paddr(b, w); } else { } _b___1 = b->bm_bits <= bitnr; if (_b___1 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "drbd_bm_count_bits", (char *)"bitnr >= b->bm_bits", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1292); } 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 = variable_test_bit((int )((unsigned int )bitnr - ((unsigned int )page_nr << 15U)), (unsigned long const volatile *)p_addr); c = (tmp___1 != 0) + c; } bitnr = bitnr + 1UL; ldv_44725: ; if (bitnr <= (unsigned long )e) { goto ldv_44724; } else { } 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 ; int tmp___0 ; unsigned long _min1 ; size_t _min2 ; int n ; unsigned long *tmp___1 ; unsigned long 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), "%s: (%s) in %s:%d\n", "drbd_bm_e_weight", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1326); } 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), "%s: (%s) in %s:%d\n", "drbd_bm_e_weight", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1327); } else { } if (_b___0 != 0) { return (0); } else { } tmp = spinlock_check(& b->bm_lock); flags = _raw_spin_lock_irqsave(tmp); tmp___0 = bm_is_locked(b); if (tmp___0 != 0) { __bm_print_lock_info(mdev, "drbd_bm_e_weight"); } else { } s = (int )(enr << 6); _min1 = (enr + 1UL) << 6; _min2 = b->bm_words; e = (int )(_min1 < _min2 ? _min1 : _min2); count = 0; if ((size_t )s < b->bm_words) { n = e - s; p_addr = bm_map_paddr(b, (unsigned long )s); bm = p_addr + ((unsigned long )s & 511UL); goto ldv_44751; ldv_44750: tmp___1 = bm; bm = bm + 1; tmp___2 = hweight_long(*tmp___1); count = (int )((unsigned int )tmp___2 + (unsigned int )count); ldv_44751: tmp___3 = n; n = n - 1; if (tmp___3 != 0) { goto ldv_44750; } else { } 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 ; int count ; int s ; int e ; int i ; int do_now ; int _b ; int _b___0 ; int tmp ; size_t __min1 ; size_t __min2 ; unsigned long tmp___0 ; int tmp___1 ; int tmp___2 ; { 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), "%s: (%s) in %s:%d\n", "drbd_bm_ALe_set_all", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1357); } 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), "%s: (%s) in %s:%d\n", "drbd_bm_ALe_set_all", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1358); } else { } if (_b___0 != 0) { return (0UL); } else { } spin_lock_irq(& b->bm_lock); tmp = bm_is_locked(b); if (tmp != 0) { __bm_print_lock_info(mdev, "drbd_bm_ALe_set_all"); } else { } weight = b->bm_set; s = (int )((unsigned int )al_enr * 16U); __min1 = (size_t )(s + 16); __min2 = b->bm_words; e = (int )(__min1 < __min2 ? __min1 : __min2); if ((e + -1) >> 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1369); } else { } count = 0; if ((size_t )s < b->bm_words) { do_now = e - s; i = do_now; p_addr = bm_map_paddr(b, (unsigned long )s); bm = p_addr + ((unsigned long )s & 511UL); goto ldv_44775; ldv_44774: tmp___0 = hweight_long(*bm); count = (int )((unsigned int )tmp___0 + (unsigned int )count); *bm = 0xffffffffffffffffUL; bm = bm + 1; ldv_44775: tmp___1 = i; i = i - 1; if (tmp___1 != 0) { goto ldv_44774; } else { } bm_unmap(p_addr); b->bm_set = b->bm_set + (unsigned long )(do_now * 64 - count); if ((size_t )e == b->bm_words) { tmp___2 = bm_clear_surplus(b); b->bm_set = b->bm_set - (unsigned long )tmp___2; } else { } } else { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "start offset (%d) 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_mutex_lock_1(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_2(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_3(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_4(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_5(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_6(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_7(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___5 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_bm_change_of_drbd_bitmap(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_lock_8(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_bm_change_of_drbd_bitmap(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_9(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bm_change_of_drbd_bitmap(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_10(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_md_io_mutex_of_drbd_conf(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_11(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_md_io_mutex_of_drbd_conf(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_24(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_25(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_27(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_28(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_23(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_26(struct mutex *ldv_func_arg1 ) ; extern struct module __this_module ; __inline static struct proc_inode *PROC_I(struct inode const *inode ) { struct inode const *__mptr ; { __mptr = inode; return ((struct proc_inode *)__mptr + 0xffffffffffffffd0UL); } } __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 ; { mdev = minor < minor_count ? *(minor_table + (unsigned long )minor) : 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 long tmp___1 ; { 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_35533.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 { tmp___1 = 1000UL - ((*bits_left >> 10) * 1000UL) / ((mdev->rs_total >> 10) + 1UL); *per_mil_done = (unsigned int )tmp___1; } return; } } __inline static int is_susp(union drbd_state s ) { { return (((unsigned int )*((unsigned char *)(& s) + 2UL) != 0U || (unsigned int )*((unsigned char *)(& s) + 2UL) != 0U) || (unsigned int )*((unsigned char *)(& s) + 2UL) != 0U); } } static int drbd_proc_open(struct inode *inode , struct file *file ) ; struct file_operations const drbd_proc_fops = {& __this_module, & seq_lseek, & seq_read, 0, 0, 0, 0, 0, 0, 0, 0, & drbd_proc_open, 0, & single_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 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 ; { 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_44242; ldv_44241: seq_printf(seq, "="); i = i + 1; ldv_44242: ; if (i < x) { goto ldv_44241; } else { } seq_printf(seq, ">"); i = 0; goto ldv_44245; ldv_44244: seq_printf(seq, "."); i = i + 1; ldv_44245: ; if (i < y) { goto ldv_44244; } else { } seq_printf(seq, "] "); seq_printf(seq, "sync\'ed:%3u.%u%% ", res / 10U, res % 10U); if (mdev->rs_total > 1048576UL) { seq_printf(seq, "(%lu/%lu)M\n\t", (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; if (dbdt > 1000UL) { seq_printf(seq, " speed: %ld,%03ld", dbdt / 1000UL, dbdt % 1000UL); } else { seq_printf(seq, " speed: %ld", dbdt); } 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; if (dbdt > 1000UL) { seq_printf(seq, " (%ld,%03ld)", dbdt / 1000UL, dbdt % 1000UL); } else { seq_printf(seq, " (%ld)", dbdt); } if ((unsigned int )*((unsigned short *)mdev + 1006UL) == 272U) { if (mdev->c_sync_rate > 1000) { seq_printf(seq, " want: %d,%03d", mdev->c_sync_rate / 1000, mdev->c_sync_rate % 1000); } else { seq_printf(seq, " want: %d", mdev->c_sync_rate); } } else { } seq_printf(seq, " K/sec%s\n", stalled != 0 ? (char *)" (stalled)" : (char *)""); return; } } static void resync_dump_detail(struct seq_file *seq , struct lc_element *e ) { struct bm_extent *bme ; struct lc_element const *__mptr ; { __mptr = (struct lc_element const *)e; bme = (struct bm_extent *)__mptr + 0xfffffffffffffff0UL; seq_printf(seq, "%5d %s %s\n", bme->rs_left, (char *)"---------", (int )bme->flags & 1 ? (char *)"LOCKED" : (char *)"------"); 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[4U] ; char const *tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; char const *tmp___7 ; char const *tmp___8 ; char const *tmp___9 ; char const *tmp___10 ; unsigned long tmp___11 ; int tmp___12 ; { hole = 0; write_ordering_chars[0] = 110; write_ordering_chars[1] = 100; write_ordering_chars[2] = 102; write_ordering_chars[3] = 98; tmp = drbd_buildtag(); seq_printf(seq, "version: 8.3.9rc2 (api:%d/proto:%d-%d)\n%s\n", 88, 86, 95, tmp); i = 0; goto ldv_44265; ldv_44264: mdev = minor_to_mdev((unsigned int )i); if ((unsigned long )mdev == (unsigned long )((struct drbd_conf *)0)) { hole = 1; goto ldv_44263; } else { } if (hole != 0) { hole = 0; seq_printf(seq, "\n"); } else { } sn = drbd_conn_str((enum drbd_conns )mdev->state.ldv_35533.conn); if (((unsigned int )*((unsigned short *)mdev + 1006UL) == 0U && (unsigned int )*((unsigned char *)mdev + 2013UL) == 0U) && (unsigned int )*((unsigned char *)mdev + 2012UL) == 2U) { seq_printf(seq, "%2d: cs:Unconfigured\n", i); } else { 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___5 = constant_test_bit(28U, (unsigned long const volatile *)(& mdev->flags)); tmp___6 = is_susp(mdev->state); tmp___7 = drbd_disk_str((enum drbd_disk_state )mdev->state.ldv_35533.pdsk); tmp___8 = drbd_disk_str((enum drbd_disk_state )mdev->state.ldv_35533.disk); tmp___9 = drbd_role_str((enum drbd_role )mdev->state.ldv_35533.peer); tmp___10 = drbd_role_str((enum drbd_role )mdev->state.ldv_35533.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___10, tmp___9, tmp___8, tmp___7, (unsigned long )mdev->net_conf != (unsigned long )((struct net_conf *)0) ? (mdev->net_conf)->wire_protocol + 64 : 32, tmp___6 != 0 ? 115 : 114, (unsigned int )*((unsigned char *)mdev + 2014UL) != 0U ? 97 : 45, (unsigned int )*((unsigned char *)mdev + 2014UL) != 0U ? 112 : 45, (unsigned int )*((unsigned char *)mdev + 2014UL) != 0U ? 117 : 45, (int )mdev->congestion_reason != 0 ? (int )mdev->congestion_reason : 45, tmp___5 != 0 ? 115 : 45, 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___11 = drbd_bm_total_weight(mdev); seq_printf(seq, " oos:%lu\n", tmp___11 << 2); } if ((unsigned int )*((unsigned short *)mdev + 1006UL) == 256U || (unsigned int )*((unsigned short *)mdev + 1006UL) == 272U) { drbd_syncer_progress(mdev, seq); } else { } if ((unsigned int )*((unsigned short *)mdev + 1006UL) == 288U || (unsigned int )*((unsigned short *)mdev + 1006UL) == 304U) { seq_printf(seq, "\t%3d%% %lu/%lu\n", (int )((mdev->rs_total - mdev->ov_left) / (mdev->rs_total / 100UL + 1UL)), mdev->rs_total - mdev->ov_left, mdev->rs_total); } else { } if (proc_details > 0) { tmp___12 = _get_ldev_if_state(mdev, D_FAILED); if (tmp___12 != 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_44263: i = i + 1; ldv_44265: ; if ((unsigned int )i < minor_count) { goto ldv_44264; } else { } return (0); } } static int drbd_proc_open(struct inode *inode , struct file *file ) { struct proc_dir_entry *tmp ; int tmp___0 ; { tmp = PDE((struct inode const *)inode); tmp___0 = single_open(file, & drbd_seq_show, tmp->data); return (tmp___0); } } void ldv_check_final_state(void) ; extern void ldv_check_return_value(int ) ; void ldv_initialize(void) ; extern void ldv_handler_precall(void) ; extern int nondet_int(void) ; int LDV_IN_INTERRUPT ; int main(void) { struct inode *var_group1 ; struct file *var_group2 ; int res_drbd_proc_open_3 ; int ldv_s_drbd_proc_fops_file_operations ; int tmp ; int tmp___0 ; { ldv_s_drbd_proc_fops_file_operations = 0; LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_44296; ldv_44295: tmp = nondet_int(); switch (tmp) { case 0: ; if (ldv_s_drbd_proc_fops_file_operations == 0) { ldv_handler_precall(); res_drbd_proc_open_3 = drbd_proc_open(var_group1, var_group2); ldv_check_return_value(res_drbd_proc_open_3); if (res_drbd_proc_open_3 != 0) { goto ldv_module_exit; } else { } ldv_s_drbd_proc_fops_file_operations = 0; } else { } goto ldv_44293; default: ; goto ldv_44293; } ldv_44293: ; ldv_44296: tmp___0 = nondet_int(); if (tmp___0 != 0 || ldv_s_drbd_proc_fops_file_operations != 0) { goto ldv_44295; } else { } ldv_module_exit: ; ldv_check_final_state(); return 0; } } void ldv_mutex_lock_23(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_24(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_25(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_26(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_27(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_28(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void __builtin_prefetch(void const * , ...) ; __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_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); } } 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 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; } } __inline static void __list_del(struct list_head *prev , struct list_head *next ) { { next->prev = prev; prev->next = next; return; } } extern void list_del(struct list_head * ) ; __inline static void list_del_init(struct list_head *entry ) { { __list_del(entry->prev, entry->next); 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 = list->next; last = 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; } } __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_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; switch (4UL) { case 1UL: __ptr = (u8 volatile *)(& v->counter); __asm__ volatile ("xchgb %0,%1": "=q" (__x), "+m" (*__ptr): "0" (__x): "memory"); goto ldv_5206; case 2UL: __ptr___0 = (u16 volatile *)(& v->counter); __asm__ volatile ("xchgw %0,%1": "=r" (__x), "+m" (*__ptr___0): "0" (__x): "memory"); goto ldv_5206; case 4UL: __ptr___1 = (u32 volatile *)(& v->counter); __asm__ volatile ("xchgl %0,%1": "=r" (__x), "+m" (*__ptr___1): "0" (__x): "memory"); goto ldv_5206; case 8UL: __ptr___2 = (u64 volatile *)(& v->counter); __asm__ volatile ("xchgq %0,%1": "=r" (__x), "+m" (*__ptr___2): "0" (__x): "memory"); goto ldv_5206; default: __xchg_wrong_size(); } ldv_5206: ; return (__x); } } extern void lockdep_init_map(struct lockdep_map * , char const * , struct lock_class_key * , int ) ; int ldv_mutex_trylock_36(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_37(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_39(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_40(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_42(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_44(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_46(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_48(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_35(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_38(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_41(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_43(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_45(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_47(struct mutex *ldv_func_arg1 ) ; 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_5620.rlock); return; } } __inline static void spin_unlock(spinlock_t *lock ) { { _raw_spin_unlock(& lock->ldv_5620.rlock); return; } } extern int mod_timer(struct timer_list * , unsigned long ) ; extern void complete(struct completion * ) ; extern void get_random_bytes(void * , int ) ; __inline static void trace_kmalloc___0(unsigned long call_site , void const *ptr , size_t bytes_req , size_t bytes_alloc , gfp_t gfp_flags ) { long tmp ; struct tracepoint_func *it_func_ptr ; void *it_func ; void *__data ; struct tracepoint_func *_________p1 ; bool __warned ; int tmp___0 ; int tmp___1 ; { tmp = ldv__builtin_expect(__tracepoint_kmalloc.state != 0, 0L); if (tmp != 0L) { goto do_trace; } else { } return; do_trace: rcu_read_lock_sched_notrace(); _________p1 = *((struct tracepoint_func * volatile *)(& __tracepoint_kmalloc.funcs)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { tmp___1 = rcu_read_lock_sched_held(); if (tmp___1 == 0 && 1) { __warned = 1; lockdep_rcu_dereference("include/trace/events/kmem.h", 51); } else { } } else { } it_func_ptr = _________p1; if ((unsigned long )it_func_ptr != (unsigned long )((struct tracepoint_func *)0)) { ldv_13702: it_func = it_func_ptr->func; __data = it_func_ptr->data; (*((void (*)(void * , unsigned long , void const * , size_t , size_t , gfp_t ))it_func))(__data, call_site, ptr, bytes_req, bytes_alloc, gfp_flags); it_func_ptr = it_func_ptr + 1; if ((unsigned long )it_func_ptr->func != (unsigned long )((void *)0)) { goto ldv_13702; } else { } } else { } rcu_read_lock_sched_notrace(); return; } } __inline static void *kmalloc_large___0(size_t size , gfp_t flags ) { unsigned int order ; int tmp ; void *ret ; unsigned long tmp___0 ; { tmp = get_order(size); order = (unsigned int )tmp; tmp___0 = __get_free_pages(flags | 16384U, order); ret = (void *)tmp___0; kmemleak_alloc((void const *)ret, size, 1, flags); trace_kmalloc___0((unsigned long )((void *)0), (void const *)ret, size, 4096UL << (int )order, flags); return (ret); } } __inline static void *kmalloc___0(size_t size , gfp_t flags ) { void *ret ; void *tmp ; struct kmem_cache *s ; struct kmem_cache *tmp___0 ; void *tmp___1 ; { if (0) { if (size > 8192UL) { tmp = kmalloc_large___0(size, flags); return (tmp); } else { } if ((flags & 1U) == 0U) { tmp___0 = kmalloc_slab(size); s = tmp___0; if ((unsigned long )s == (unsigned long )((struct kmem_cache *)0)) { return (16); } else { } ret = kmem_cache_alloc_notrace(s, flags); trace_kmalloc___0((unsigned long )((void *)0), (void const *)ret, size, (size_t )s->size, flags); return (ret); } else { } } else { } tmp___1 = __kmalloc(size, flags); return (tmp___1); } } __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 = ldv__builtin_expect(tmp != 0, 0L); if (tmp___0 != 0L) { return (page->ldv_12351.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 = ldv__builtin_expect(((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_17878: ; goto ldv_17878; } else { } tmp___0 = ldv__builtin_expect(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_17879: ; goto ldv_17879; } else { } tmp___1 = ldv__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_17880: ; goto ldv_17880; } 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_5620.rlock.raw_lock.slock = 0U; __constr_expr_0.lock.ldv_5620.rlock.magic = 3735899821U; __constr_expr_0.lock.ldv_5620.rlock.owner_cpu = 4294967295U; __constr_expr_0.lock.ldv_5620.rlock.owner = 0xffffffffffffffffUL; __constr_expr_0.lock.ldv_5620.rlock.dep_map.key = 0; __constr_expr_0.lock.ldv_5620.rlock.dep_map.class_cache[0] = 0; __constr_expr_0.lock.ldv_5620.rlock.dep_map.class_cache[1] = 0; __constr_expr_0.lock.ldv_5620.rlock.dep_map.name = "(*sem).lock"; __constr_expr_0.lock.ldv_5620.rlock.dep_map.cpu = 0; __constr_expr_0.lock.ldv_5620.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_5620.ldv_5619.dep_map, "semaphore->lock", & __key, 0); return; } } extern int down_interruptible(struct semaphore * ) ; extern int down_trylock(struct semaphore * ) ; extern void up(struct semaphore * ) ; extern long schedule_timeout(long ) ; 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_segment_size(struct request_queue *q ) { { return (q->limits.max_segment_size); } } __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 ; { ldv_mutex_lock_38(& mdev->data.mutex); tmp = ldv__builtin_expect((unsigned long )mdev->data.socket == (unsigned long )((struct socket *)0), 0L); if (tmp != 0L) { ldv_mutex_unlock_39(& mdev->data.mutex); return (0); } else { } return (1); } } __inline static void drbd_put_data_sock(struct drbd_conf *mdev ) { { ldv_mutex_unlock_40(& 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_send_sync_uuid(struct drbd_conf *mdev , u64 val ) ; 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_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_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 ) ; void drbd_queue_bitmap_io(struct drbd_conf *mdev , int (*io_fn)(struct drbd_conf * ) , void (*done)(struct drbd_conf * , int ) , char *why ) ; 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 ) ; __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_inactive(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_make_resync_request(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_e_reissue(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 ) ; void resync_timer_fn(unsigned long data ) ; int drbd_rs_should_slow_down(struct drbd_conf *mdev ) ; 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_bump_write_ordering(struct drbd_conf *mdev , enum write_ordering_e wo ) ; 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_set_in_sync(struct drbd_conf *mdev , sector_t sector , int size , char const *file , unsigned int const line ) ; void __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_12351.ldv_12348.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_44554; ldv_44553: tmp = page_count(page); if (tmp > 1) { return (1); } else { } page = page_chain_next(page); ldv_44554: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { tmp___0 = page_chain_next(page); __builtin_prefetch((void const *)tmp___0); if (1 != 0) { goto ldv_44553; } else { goto ldv_44555; } } else { } ldv_44555: ; 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_44559; } 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_44562: 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_44561; } else { } schedule(); goto ldv_44562; ldv_44561: finish_wait(& mdev->misc_wait, & __wait); ldv_44559: ; 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, 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 ; { switch ((mdev->ldev)->dc.on_io_error) { 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.Passing error on...\n", where); } else { } goto ldv_44585; } else { } case 2: ; case 1: ; if ((int )mdev->state.ldv_35533.disk > 2) { __ns.i = mdev->state.i; __ns.ldv_35533.disk = 2U; _drbd_set_state(mdev, __ns, CS_HARD, 0); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s.Detaching...\n", where); } else { } goto ldv_44585; } ldv_44585: ; return; } } __inline static sector_t drbd_get_capacity(struct block_device *bdev ) { { return ((unsigned long )bdev != (unsigned long )((struct block_device *)0) ? (sector_t )((bdev->bd_inode)->i_size >> 9) : 0UL); } } __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; } } __inline static void drbd_kick_lo(struct drbd_conf *mdev ) { struct request_queue *tmp ; int tmp___0 ; { tmp___0 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___0 != 0) { tmp = bdev_get_queue((mdev->ldev)->backing_bdev); drbd_blk_run_queue(tmp); put_ldev(mdev); } else { } 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 = 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 ) { struct drbd_conf *mdev ; struct bio_and_error m ; int rv ; { mdev = req->mdev; spin_lock_irq(& mdev->req_lock); rv = __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 (rv); } } static int w_make_ov_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_42995.block_id == 0ULL) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( e->block_id != ID_VACANT ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 145); } 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, 0); } else { } tmp___1 = constant_test_bit(4U, (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 int is_failed_barrier(int ee_flags ) { { return ((ee_flags & 28) == 20); } } 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 ; raw_spinlock_t *tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { flags = 0UL; mdev = e->mdev; tmp___0 = is_failed_barrier((int )e->flags); if (tmp___0 != 0) { drbd_bump_write_ordering(mdev, WO_bdev_flush); tmp = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp); list_del(& e->w.list); e->flags = (e->flags & 0xffffffffffffffe7UL) | 8UL; e->w.cb = & w_e_reissue; spin_unlock_irqrestore(& mdev->req_lock, flags); drbd_queue_work(& mdev->data.work, & e->w); return; } else { } if (e->ldv_42995.block_id == 0ULL) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( e->block_id != ID_VACANT ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 192); } else { } e_sector = e->sector; do_al_complete_io = (int )e->flags & 1; is_syncer_req = e->ldv_42995.block_id == 0xffffffffffffffffULL; tmp___1 = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp___1); 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___2 = list_empty((struct list_head const *)(& mdev->sync_ee)); do_wake = tmp___2; } else { tmp___3 = list_empty((struct list_head const *)(& mdev->active_ee)); do_wake = tmp___3; } tmp___4 = constant_test_bit(4U, (unsigned long const volatile *)(& e->flags)); if (tmp___4 != 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, 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 ; int tmp ; { 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) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: error=%d s=%llus\n", is_write != 0 ? (char *)"write" : (char *)"read", error, (unsigned long long )e->sector); } else { } if (error == 0 && uptodate == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: setting error to -EIO s=%llus\n", is_write != 0 ? (char *)"write" : (char *)"read", (unsigned long long )e->sector); error = -5; } else { } if (error != 0) { set_bit(4U, (unsigned long volatile *)(& e->flags)); } else { } bio_put(bio); tmp = atomic_dec_and_test(& e->pending_bios); if (tmp != 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 ) { struct drbd_request *req ; struct drbd_conf *mdev ; enum drbd_req_event what ; int uptodate ; long tmp ; void *tmp___0 ; { req = (struct drbd_request *)bio->bi_private; mdev = req->mdev; uptodate = (int )bio->bi_flags & 1; if (error == 0 && uptodate == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "p %s: setting error to -EIO\n", (int )bio->bi_rw & 1 ? (char *)"write" : (char *)"read"); error = -5; } else { } tmp = ldv__builtin_expect(error != 0, 0L); if (tmp != 0L) { what = (int )bio->bi_rw & 1 ? write_completed_with_error : ((bio->bi_rw & 1025UL) == 0UL ? read_completed_with_error : read_ahead_completed_with_error); } else { what = completed_ok; } bio_put(req->private_bio); tmp___0 = ERR_PTR((long )error); req->private_bio = (struct bio *)tmp___0; req_mod(req, what); 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 || *((unsigned int *)mdev + 503UL) != 65536U) { _req_mod(req, read_retry_remote_canceled); 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); } } int w_resync_inactive(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { int _b ; { _b = cancel != 0; if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "w_resync_inactive", (char *)"cancel", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 324); } else { } if (_b != 0) { return (1); } else { } dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "resync inactive, but callback triggered??\n"); return (1); } } 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 ; { page = e->pages; desc.tfm = tfm; desc.flags = 0U; sg_init_table(& sg, 1U); crypto_hash_init(& desc); goto ldv_45045; ldv_45044: sg_set_page(& sg, page, 4096U, 0U); crypto_hash_update(& desc, & sg, sg.length); page = tmp; ldv_45045: tmp = page_chain_next(page); if ((unsigned long )tmp != (unsigned long )((struct page *)0)) { goto ldv_45044; } else { } len = e->size & 4095U; sg_set_page(& sg, page, len != 0U ? len : 4096U, 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_45058; ldv_45057: 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_45058: ; if ((int )bio->bi_vcnt > i) { goto ldv_45057; } else { } crypto_hash_final(& desc, (u8 *)digest); return; } } static 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 ; unsigned int tmp___0 ; long tmp___1 ; long tmp___2 ; { __mptr = (struct drbd_work const *)w; e = (struct drbd_epoch_entry *)__mptr; if (e->ldv_42995.block_id != 2205466966ULL) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( e->block_id == DRBD_MAGIC + 0xbeef ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 383); } else { } tmp = ldv__builtin_expect(cancel != 0, 0L); if (tmp != 0L) { drbd_free_some_ee(mdev, e, 0); return (1); } else { } tmp___1 = ldv__builtin_expect((e->flags & 16UL) == 0UL, 1L); if (tmp___1 != 0L) { tmp___0 = crypto_hash_digestsize(mdev->csums_tfm); digest_size = (int )tmp___0; digest = kmalloc___0((size_t )digest_size, 16U); if ((unsigned long )digest != (unsigned long )((void *)0)) { drbd_csum_ee(mdev, mdev->csums_tfm, e, digest); inc_rs_pending(mdev); ok = drbd_send_drequest_csum(mdev, e->sector, (int )e->size, digest, digest_size, P_CSUM_RS_REQUEST); kfree((void const *)digest); } else { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "kmalloc() of digest failed.\n"); ok = 0; } } else { ok = 1; } drbd_free_some_ee(mdev, e, 0); tmp___2 = ldv__builtin_expect(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, D_INCONSISTENT); if (tmp == 0) { return (-5); } else { } tmp___0 = drbd_rs_should_slow_down(mdev); 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, 0U, 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); } } void resync_timer_fn(unsigned long data ) { struct drbd_conf *mdev ; int queue ; int tmp ; { mdev = (struct drbd_conf *)data; queue = 1; switch ((int )mdev->state.ldv_35533.conn) { case 18: mdev->resync_work.cb = & w_make_ov_request; goto ldv_45084; case 17: mdev->resync_work.cb = & w_make_resync_request; goto ldv_45084; default: queue = 0; mdev->resync_work.cb = & w_resync_inactive; } ldv_45084: tmp = list_empty((struct list_head const *)(& mdev->resync_work.list)); if (tmp != 0 && queue != 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_45093; ldv_45092: *(fb->values + (unsigned long )i) = value; i = i + 1; ldv_45093: ; if ((unsigned int )i < fb->size) { goto ldv_45092; } else { } 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_45106; ldv_45105: *(fb->values + (unsigned long )i) = *(fb->values + (unsigned long )i) + value; i = i + 1; ldv_45106: ; if ((unsigned int )i < fb->size) { goto ldv_45105; } else { } return; } } 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 { want = mdev->sync_conf.c_fill_target != 0 ? (unsigned int )mdev->sync_conf.c_fill_target : (((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); } } 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_segment_size ; int number ; int rollback_i ; int size ; int pe ; int mx ; int align ; int queued ; int sndbuf ; int i ; long tmp___0 ; long tmp___1 ; char const *tmp___2 ; int tmp___3 ; unsigned int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; long tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; unsigned long tmp___15 ; { tmp = drbd_get_capacity(mdev->this_bdev); capacity = tmp; i = 0; tmp___0 = ldv__builtin_expect(cancel != 0, 0L); if (tmp___0 != 0L) { return (1); } else { } tmp___1 = ldv__builtin_expect((int )mdev->state.ldv_35533.conn <= 9, 0L); if (tmp___1 != 0L) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Confused in w_make_resync_request()! cstate < Connected"); return (0); } else { } if ((unsigned int )*((unsigned short *)mdev + 1006UL) != 272U) { tmp___2 = drbd_conn_str((enum drbd_conns )mdev->state.ldv_35533.conn); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s in w_make_resync_request\n", tmp___2); } else { } if (mdev->rs_total == 0UL) { drbd_resync_finished(mdev); return (1); } else { } tmp___3 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___3 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Disk broke down during resync!\n"); mdev->resync_work.cb = & w_resync_inactive; return (1); } else { } if (mdev->agreed_pro_version <= 93) { tmp___4 = queue_max_segment_size(mdev->rq_queue); max_segment_size = (int )tmp___4; } else { max_segment_size = mdev->agreed_pro_version <= 94 ? 32768 : 131072; } if (mdev->rs_plan_s.size != 0U) { tmp___5 = drbd_rs_controller(mdev); number = tmp___5 >> 3; mdev->c_sync_rate = (number * 1000) / 25; } else { mdev->c_sync_rate = mdev->sync_conf.rate; number = (mdev->c_sync_rate * 25) / 1000; } tmp___6 = drbd_rs_should_slow_down(mdev); if (tmp___6 != 0) { goto requeue; } else { } ldv_mutex_lock_41(& mdev->data.mutex); if ((unsigned long )mdev->data.socket != (unsigned long )((struct socket *)0)) { mx = (int )((unsigned long )((mdev->data.socket)->sk)->sk_rcvbuf / 32UL); } else { mx = 1; } ldv_mutex_unlock_42(& mdev->data.mutex); if (number > mx) { mx = number; } else { } pe = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); if (pe + number > mx) { number = mx - pe; } else { } i = 0; goto ldv_45152; ldv_45151: ldv_mutex_lock_43(& mdev->data.mutex); 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; } ldv_mutex_unlock_44(& 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 == 0xffffffffffffffffUL) { mdev->bm_resync_fo = drbd_bm_bits(mdev); mdev->resync_work.cb = & w_resync_inactive; put_ldev(mdev); return (1); } else { } sector = bit << 3; tmp___7 = drbd_try_rs_begin_io(mdev, sector); if (tmp___7 != 0) { mdev->bm_resync_fo = bit; goto requeue; } else { } mdev->bm_resync_fo = bit + 1UL; tmp___8 = drbd_bm_test_bit(mdev, bit); tmp___9 = ldv__builtin_expect(tmp___8 == 0, 0L); if (tmp___9 != 0L) { drbd_rs_complete_io(mdev, sector); goto next_sector; } else { } align = 1; rollback_i = i; ldv_45140: ; if (size + 4096 > max_segment_size) { goto ldv_45139; } else { } if (((sector_t )((1 << (align + 3)) + -1) & sector) != 0UL) { goto ldv_45139; } else { } if (((bit + 1UL) & 4095UL) == 0UL) { goto ldv_45139; } else { } tmp___10 = drbd_bm_test_bit(mdev, bit + 1UL); if (tmp___10 != 1) { goto ldv_45139; } else { } bit = bit + 1UL; size = size + 4096; if (4096 << align <= size) { align = align + 1; } else { } i = i + 1; goto ldv_45140; ldv_45139: ; 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 && (unsigned long )mdev->csums_tfm != (unsigned long )((struct crypto_hash *)0)) { tmp___11 = read_for_csum(mdev, sector, size); switch (tmp___11) { case -5: put_ldev(mdev); return (0); case -11: drbd_rs_complete_io(mdev, sector); mdev->bm_resync_fo = sector >> 3; i = rollback_i; goto requeue; case 0: ; goto ldv_45144; 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared"), "i" (736), "i" (12UL)); ldv_45146: ; goto ldv_45146; } ldv_45144: ; } else { inc_rs_pending(mdev); tmp___14 = drbd_send_drequest(mdev, 9, sector, size, 0xffffffffffffffffULL); if (tmp___14 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_send_drequest() failed, aborting...\n"); atomic_dec(& mdev->rs_pending_cnt); tmp___13 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); if (tmp___13 < 0) { tmp___12 = 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", 743, tmp___12); } else { } put_ldev(mdev); return (0); } else { } } i = i + 1; ldv_45152: ; if (i < number) { goto ldv_45151; } else { } tmp___15 = drbd_bm_bits(mdev); if (mdev->bm_resync_fo >= tmp___15) { mdev->resync_work.cb = & w_resync_inactive; 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 ; long tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; { tmp = drbd_get_capacity(mdev->this_bdev); capacity = tmp; tmp___0 = ldv__builtin_expect(cancel != 0, 0L); if (tmp___0 != 0L) { return (1); } else { } tmp___1 = ldv__builtin_expect((int )mdev->state.ldv_35533.conn <= 9, 0L); if (tmp___1 != 0L) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Confused in w_make_ov_request()! cstate < Connected"); return (0); } else { } number = (mdev->sync_conf.rate * 25) / 1000; tmp___2 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); if (tmp___2 > number) { goto requeue; } else { } tmp___3 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); number = number - tmp___3; sector = mdev->ov_position; i = 0; goto ldv_45170; ldv_45169: ; if (sector >= capacity) { mdev->resync_work.cb = & w_resync_inactive; return (1); } else { } size = 4096; tmp___4 = drbd_try_rs_begin_io(mdev, sector); if (tmp___4 != 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___7 = drbd_send_ov_request(mdev, sector, size); if (tmp___7 == 0) { atomic_dec(& mdev->rs_pending_cnt); tmp___6 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); if (tmp___6 < 0) { tmp___5 = 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", 808, tmp___5); } else { } return (0); } else { } sector = sector + 8UL; i = i + 1; ldv_45170: ; if (i < number) { goto ldv_45169; } else { } mdev->ov_position = sector; requeue: mod_timer(& mdev->resync_timer, (unsigned long )jiffies + 25UL); 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 || (int )mdev->state.ldv_35533.conn <= 9) { goto ldv_45185; } 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_45188: prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___1 = constant_test_bit(26U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___1 != 0 || (int )mdev->state.ldv_35533.conn <= 9) { goto ldv_45187; } else { } schedule(); goto ldv_45188; ldv_45187: finish_wait(& mdev->misc_wait, & __wait); ldv_45185: ; 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 ; struct task_struct *tmp ; void *tmp___0 ; int tmp___1 ; int tmp___2 ; unsigned long s ; unsigned long t ; int ratio ; int i ; int i___0 ; int tmp___3 ; { khelper_cmd = 0; tmp___1 = drbd_rs_del_all(mdev); if (tmp___1 != 0) { drbd_kick_lo(mdev); tmp = get_current(); tmp->state = 1L; schedule_timeout(25L); tmp___0 = kmalloc___0(24UL, 32U); w = (struct drbd_work *)tmp___0; 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___2 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___2 == 0) { goto out; } else { } ping_peer(mdev); spin_lock_irq(& mdev->req_lock); os = mdev->state; if ((int )os.ldv_35533.conn <= 10) { goto out_unlock; } else { } ns = os; ns.ldv_35533.conn = 10U; _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s done (total %lu sec; paused %lu sec; %lu K/sec)\n", (unsigned int )*((unsigned short *)(& os) + 0UL) == 288U || (unsigned int )*((unsigned short *)(& os) + 0UL) == 304U ? (char *)"Online verify " : (char *)"Resync", mdev->rs_paused + dt, mdev->rs_paused, dbdt); n_oos = drbd_bm_total_weight(mdev); if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 288U || (unsigned int )*((unsigned short *)(& os) + 0UL) == 304U) { 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 913); } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 272U || (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) && mdev->rs_total != 0UL) { s = mdev->rs_same_csum; t = mdev->rs_total; ratio = t != 0UL ? (t <= 99999UL ? (int const )((s * 100UL) / t) : (int const )(s / (t / 100UL))) : 0; _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "%u %% had equal check sums, 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 { } 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 || (unsigned int )*((unsigned short *)(& os) + 0UL) == 336U) { ns.ldv_35533.disk = 4U; ns.ldv_35533.pdsk = 8U; } else { ns.ldv_35533.disk = 8U; ns.ldv_35533.pdsk = 4U; } } else { ns.ldv_35533.disk = 8U; ns.ldv_35533.pdsk = 8U; if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 272U || (unsigned int )*((unsigned short *)(& os) + 0UL) == 336U) { if ((unsigned long )mdev->p_uuid != (unsigned long )((u64 *)0)) { i = 1; goto ldv_45207; ldv_45206: _drbd_uuid_set(mdev, i, *(mdev->p_uuid + (unsigned long )i)); i = i + 1; ldv_45207: ; if (i <= 3) { goto ldv_45206; } else { } 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 { } drbd_uuid_set_bm(mdev, 0ULL); if ((unsigned long )mdev->p_uuid != (unsigned long )((u64 *)0)) { i___0 = 0; goto ldv_45211; ldv_45210: *(mdev->p_uuid + (unsigned long )i___0) = (mdev->ldev)->md.uuid[i___0]; i___0 = i___0 + 1; ldv_45211: ; if (i___0 <= 3) { goto ldv_45210; } else { } } else { } } _drbd_set_state(mdev, ns, CS_VERBOSE, 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; mdev->ov_start_sector = 0UL; drbd_md_sync(mdev); tmp___3 = test_and_clear_bit(12, (unsigned long volatile *)(& mdev->flags)); if (tmp___3 != 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Writing the whole bitmap, due to failed kmalloc\n"); drbd_queue_bitmap_io(mdev, & drbd_bm_write, 0, (char *)"write from resync_finished"); } else { } 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, 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 = ldv__builtin_expect(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", 1022, tmp); } else { } return (1); } else { } tmp___3 = ldv__builtin_expect((e->flags & 16UL) == 0UL, 1L); if (tmp___3 != 0L) { ok = drbd_send_block(mdev, P_DATA_REPLY, 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, P_NEG_DREPLY, 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", 1036, tmp___4); } else { } move_to_net_ee_or_free(mdev, e); tmp___6 = ldv__builtin_expect(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 = ldv__builtin_expect(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", 1058, tmp); } else { } return (1); } else { } tmp___2 = _get_ldev_if_state(mdev, D_FAILED); if (tmp___2 != 0) { drbd_rs_complete_io(mdev, e->sector); put_ldev(mdev); } else { } tmp___6 = ldv__builtin_expect((e->flags & 16UL) == 0UL, 1L); if (tmp___6 != 0L) { tmp___4 = ldv__builtin_expect((int )mdev->state.ldv_35533.pdsk > 3, 1L); if (tmp___4 != 0L) { inc_rs_pending(mdev); ok = drbd_send_block(mdev, P_RS_DATA_REPLY, 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, P_NEG_RS_DREPLY, 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", 1088, tmp___7); } else { } move_to_net_ee_or_free(mdev, e); tmp___9 = ldv__builtin_expect(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 = 0; eq = 0; tmp___1 = ldv__builtin_expect(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", 1107, tmp); } else { } return (1); } else { } tmp___2 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___2 != 0) { drbd_rs_complete_io(mdev, e->sector); put_ldev(mdev); } else { } di = e->ldv_42995.digest; tmp___6 = ldv__builtin_expect((e->flags & 16UL) == 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1124); } else { } digest = kmalloc___0((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, "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1134U); mdev->rs_same_csum = mdev->rs_same_csum + (unsigned long )(e->size >> 12); ok = drbd_send_ack(mdev, P_RS_IS_IN_SYNC, e); } else { inc_rs_pending(mdev); e->ldv_42995.block_id = 0xffffffffffffffffULL; e->flags = e->flags & 0xffffffffffffffdfUL; kfree((void const *)di); ok = drbd_send_block(mdev, P_RS_DATA_REPLY, e); } } else { ok = drbd_send_ack(mdev, P_NEG_RS_DREPLY, 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", 1151, tmp___7); } else { } move_to_net_ee_or_free(mdev, e); tmp___9 = ldv__builtin_expect(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 ; int digest_size ; void *digest ; int ok ; long tmp ; long tmp___0 ; unsigned int 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; ok = 1; tmp = ldv__builtin_expect(cancel != 0, 0L); if (tmp != 0L) { goto out; } else { } tmp___0 = ldv__builtin_expect((e->flags & 16UL) != 0UL, 0L); if (tmp___0 != 0L) { goto out; } else { } tmp___1 = crypto_hash_digestsize(mdev->verify_tfm); digest_size = (int )tmp___1; digest = kmalloc___0((size_t )digest_size, 16U); if ((unsigned long )digest != (unsigned long )((void *)0)) { drbd_csum_ee(mdev, mdev->verify_tfm, e, digest); inc_rs_pending(mdev); ok = drbd_send_drequest_csum(mdev, e->sector, (int )e->size, digest, digest_size, P_OV_REPLY); 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", 1181, tmp___2); } else { } } else { } kfree((void const *)digest); } else { } out: drbd_free_some_ee(mdev, e, 0); 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", 1188, 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, "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1201U); set_bit(12U, (unsigned long volatile *)(& mdev->flags)); 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 ; 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 ; { __mptr = (struct drbd_work const *)w; e = (struct drbd_epoch_entry *)__mptr; eq = 0; tmp___1 = ldv__builtin_expect(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", 1215, tmp); } else { } return (1); } else { } tmp___2 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___2 != 0) { drbd_rs_complete_io(mdev, e->sector); put_ldev(mdev); } else { } di = e->ldv_42995.digest; tmp___6 = ldv__builtin_expect((e->flags & 16UL) == 0UL, 1L); if (tmp___6 != 0L) { tmp___3 = crypto_hash_digestsize(mdev->verify_tfm); digest_size = (int )tmp___3; digest = kmalloc___0((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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1234); } 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 { ok = drbd_send_ack(mdev, P_NEG_RS_DREPLY, e); tmp___5 = ___ratelimit(& drbd_ratelimit_state, "w_e_end_ov_reply"); 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_ov_reply", 1244, tmp___7); } else { } if (eq == 0) { drbd_ov_oos_found(mdev, e->sector, (int )e->size); } else { ov_oos_print(mdev); } ok = drbd_send_ack_ex(mdev, P_OV_RESULT, e->sector, (int )e->size, eq != 0 ? 4711ULL : 4712ULL); drbd_free_some_ee(mdev, e, 0); mdev->ov_left = mdev->ov_left - 1UL; 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) || (int )mdev->state.ldv_35533.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, P_BARRIER, (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, P_UNPLUG_REMOTE); return (tmp); } } 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 ; { __mptr = (struct drbd_work const *)w; req = (struct drbd_request *)__mptr; tmp = ldv__builtin_expect(cancel != 0, 0L); if (tmp != 0L) { req_mod(req, send_canceled); return (1); } else { } ok = drbd_send_dblock(mdev, req); req_mod(req, ok != 0 ? handed_over_to_network : send_failed); 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 ; { __mptr = (struct drbd_work const *)w; req = (struct drbd_request *)__mptr; tmp = ldv__builtin_expect(cancel != 0, 0L); if (tmp != 0L) { req_mod(req, send_canceled); return (1); } else { } ok = drbd_send_drequest(mdev, 8, req->sector, (int )req->size, (u64 )req); if (ok == 0) { if ((int )mdev->state.ldv_35533.conn > 9) { val.i = 0U; val.ldv_35533.conn = 5U; mask.i = 0U; mask.ldv_35533.conn = 31U; drbd_force_state(mdev, mask, val); } else { } } else { } req_mod(req, ok != 0 ? handed_over_to_network : send_failed); 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 && (req->rq_state & 2048UL) != 0UL) { drbd_al_begin_io(mdev, req->sector); } 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_45374: ; 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), "%s: (%s) in %s:%d\n", "_drbd_may_sync_now", (char *)"!odev", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1386); } else { } if (_b != 0) { return (1); } else { } if (((((int )odev->state.ldv_35533.conn > 15 && (int )odev->state.ldv_35533.conn <= 21) || (unsigned int )*((unsigned char *)odev + 2014UL) != 0U) || (unsigned int )*((unsigned char *)odev + 2014UL) != 0U) || (unsigned int )*((unsigned char *)odev + 2014UL) != 0U) { return (0); } else { } goto ldv_45374; } } static int _drbd_pause_after(struct drbd_conf *mdev ) { struct drbd_conf *odev ; int i ; int rv ; union drbd_state __ns ; int tmp ; int tmp___0 ; { rv = 0; i = 0; goto ldv_45385; ldv_45384: odev = minor_to_mdev((unsigned int )i); if ((unsigned long )odev == (unsigned long )((struct drbd_conf *)0)) { goto ldv_45381; } else { } if ((unsigned int )*((unsigned short *)odev + 1006UL) == 0U && (unsigned int )*((unsigned char *)odev + 2013UL) == 0U) { goto ldv_45381; } else { } tmp___0 = _drbd_may_sync_now(odev); if (tmp___0 == 0) { __ns.i = odev->state.i; __ns.ldv_35533.aftr_isp = 1U; tmp = __drbd_set_state(odev, __ns, CS_HARD, 0); rv = (tmp != 2) | rv; } else { } ldv_45381: i = i + 1; ldv_45385: ; if ((unsigned int )i < minor_count) { goto ldv_45384; } else { } return (rv); } } static int _drbd_resume_next(struct drbd_conf *mdev ) { struct drbd_conf *odev ; int i ; int rv ; union drbd_state __ns ; int tmp ; int tmp___0 ; { rv = 0; i = 0; goto ldv_45397; ldv_45396: odev = minor_to_mdev((unsigned int )i); if ((unsigned long )odev == (unsigned long )((struct drbd_conf *)0)) { goto ldv_45393; } else { } if ((unsigned int )*((unsigned short *)odev + 1006UL) == 0U && (unsigned int )*((unsigned char *)odev + 2013UL) == 0U) { goto ldv_45393; } else { } if ((unsigned int )*((unsigned char *)odev + 2014UL) != 0U) { tmp___0 = _drbd_may_sync_now(odev); if (tmp___0 != 0) { __ns.i = odev->state.i; __ns.ldv_35533.aftr_isp = 0U; tmp = __drbd_set_state(odev, __ns, CS_HARD, 0); rv = (tmp != 2) | rv; } else { } } else { } ldv_45393: i = i + 1; ldv_45397: ; if ((unsigned int )i < minor_count) { goto ldv_45396; } else { } 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_45410: ; 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_45410; } } 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_45417: changes = _drbd_pause_after(mdev); tmp = _drbd_resume_next(mdev); changes = tmp | changes; if (changes != 0) { goto ldv_45417; } else { } } else { } _raw_write_unlock_irq(& global_state_lock); return (retcode); } } 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 ; int tmp ; u64 uuid ; int tmp___0 ; unsigned long tw ; unsigned long tmp___1 ; unsigned long now ; int i ; char const *tmp___2 ; { if ((int )mdev->state.ldv_35533.conn > 15) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Resync already running!\n"); return; } else { } drbd_rs_cancel_all(mdev); 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_35533.conn = 1U; mask.i = 0U; mask.ldv_35533.conn = 31U; drbd_force_state(mdev, mask, val); return; } else { } } else { } drbd_state_lock(mdev); tmp = _get_ldev_if_state(mdev, D_NEGOTIATING); if (tmp == 0) { drbd_state_unlock(mdev); return; } else { } if ((unsigned int )side == 17U) { mdev->bm_resync_fo = 0UL; } else { get_random_bytes((void *)(& uuid), 8); drbd_uuid_set(mdev, 1, uuid); drbd_send_sync_uuid(mdev, uuid); if ((unsigned int )*((unsigned char *)mdev + 2013UL) != 16U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.disk == D_UP_TO_DATE ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1554); } else { } } _raw_write_lock_irq(& global_state_lock); ns = mdev->state; tmp___0 = _drbd_may_sync_now(mdev); ns.ldv_35533.aftr_isp = tmp___0 == 0; ns.ldv_35533.conn = (unsigned char )side; if ((unsigned int )side == 17U) { ns.ldv_35533.disk = 4U; } else { ns.ldv_35533.pdsk = 4U; } r = __drbd_set_state(mdev, ns, CS_VERBOSE, 0); ns = mdev->state; if ((int )ns.ldv_35533.conn <= 9) { r = 0; } else { } if (r == 1) { tmp___1 = drbd_bm_total_weight(mdev); tw = tmp___1; now = 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_45434; ldv_45433: mdev->rs_mark_left[i] = tw; mdev->rs_mark_time[i] = now; i = i + 1; ldv_45434: ; if (i <= 7) { goto ldv_45433; } else { } _drbd_pause_after(mdev); } else { } _raw_write_unlock_irq(& global_state_lock); put_ldev(mdev); if (r == 1) { tmp___2 = drbd_conn_str((enum drbd_conns )ns.ldv_35533.conn); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Began resync as %s (will sync %lu KB [%lu bits set]).\n", tmp___2, mdev->rs_total << 2, mdev->rs_total); if (mdev->agreed_pro_version <= 94 && 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 { } 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); if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 272U) { mod_timer(& mdev->resync_timer, jiffies); } else { } drbd_md_sync(mdev); } else { } 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 = 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_45447; ldv_45457: drbd_thread_current_set_cpu(mdev); tmp___1 = down_trylock(& mdev->data.work.s); if (tmp___1 != 0) { ldv_mutex_lock_45(& mdev->data.mutex); if ((unsigned long )mdev->data.socket != (unsigned long )((struct socket *)0) && (unsigned int )*((unsigned char *)mdev->net_conf + 528UL) == 0U) { drbd_tcp_uncork(mdev->data.socket); } else { } ldv_mutex_unlock_46(& mdev->data.mutex); intr = down_interruptible(& mdev->data.work.s); ldv_mutex_lock_47(& mdev->data.mutex); if ((unsigned long )mdev->data.socket != (unsigned long )((struct socket *)0) && (unsigned int )*((unsigned char *)mdev->net_conf + 528UL) == 0U) { drbd_tcp_cork(mdev->data.socket); } else { } ldv_mutex_unlock_48(& 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1666); } 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), "%s: (%s) in %s:%d\n", "drbd_worker", (char *)"get_t_state(thi) == Running", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1668); } else { } if (_b != 0) { goto ldv_45447; } else { } goto ldv_45448; } else { } tmp___4 = get_t_state(thi); if ((unsigned int )tmp___4 != 1U) { goto ldv_45448; } else { } w = 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), "%s: (%s) in %s:%d\n", "drbd_worker", (char *)"list_empty(&mdev->data.work.q)", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1681); } else { } if (_b___0 != 0) { spin_unlock_irq(& mdev->data.work.q_lock); goto ldv_45447; } 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_35533.conn <= 9); if (tmp___6 == 0) { if ((int )mdev->state.ldv_35533.conn > 9) { val.i = 0U; val.ldv_35533.conn = 5U; mask.i = 0U; mask.ldv_35533.conn = 31U; drbd_force_state(mdev, mask, val); } else { } } else { } ldv_45447: tmp___7 = get_t_state(thi); if ((unsigned int )tmp___7 == 1U) { goto ldv_45457; } else { } ldv_45448: 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1707); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1708); } else { } spin_lock_irq(& mdev->data.work.q_lock); i = 0; goto ldv_45464; ldv_45463: list_splice_init(& mdev->data.work.q, & work_list); spin_unlock_irq(& mdev->data.work.q_lock); goto ldv_45461; ldv_45460: __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_45461: tmp___10 = list_empty((struct list_head const *)(& work_list)); if (tmp___10 == 0) { goto ldv_45460; } else { } spin_lock_irq(& mdev->data.work.q_lock); ldv_45464: tmp___11 = list_empty((struct list_head const *)(& mdev->data.work.q)); if (tmp___11 == 0) { goto ldv_45463; } else { } sema_init(& mdev->data.work.s, 0); spin_unlock_irq(& mdev->data.work.q_lock); if ((unsigned int )*((unsigned char *)mdev + 2013UL) != 0U || (unsigned int )*((unsigned short *)mdev + 1006UL) != 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1733); } 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, 0); return (0); } } void ldv_mutex_lock_35(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_36(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_37(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_38(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_39(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_40(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_41(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_42(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_43(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_44(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_45(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_46(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_47(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_48(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void *memcpy(void * , void const * , unsigned long ) ; __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 void *memcpy(void * , void const * , size_t ) ; 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 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___1 != 0L) { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("include/linux/cpumask.h", 107); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__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 = ldv__builtin_expect((unsigned long )ptr > 0xfffffffffffff000UL, 0L); return (tmp); } } __inline static void list_move(struct list_head *list , struct list_head *head ) { { __list_del(list->prev, list->next); list_add(list, head); return; } } __inline static void INIT_HLIST_NODE(struct hlist_node *h ) { { h->next = 0; h->pprev = 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; } } int ldv_mutex_trylock_64(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_65(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_67(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_68(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_70(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_71(struct mutex *ldv_func_arg1 ) ; extern int mutex_lock_interruptible(struct mutex * ) ; int ldv_mutex_lock_interruptible_69(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_63(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_66(struct mutex *ldv_func_arg1 ) ; int ldv_mutex_lock_interruptible_mutex_of_drbd_socket(struct mutex *lock ) ; __inline static struct thread_info *current_thread_info___0(void) { struct thread_info *ti ; unsigned long pfo_ret__ ; { switch (8UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5903; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5903; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5903; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5903; default: __bad_percpu_size(); } ldv_5903: ti = (struct thread_info *)(pfo_ret__ - 8152UL); return (ti); } } __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 void msleep(unsigned int ) ; extern int del_timer_sync(struct timer_list * ) ; __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 free_pages(unsigned long , unsigned 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 trace_kmalloc___1(unsigned long call_site , void const *ptr , size_t bytes_req , size_t bytes_alloc , gfp_t gfp_flags ) { long tmp ; struct tracepoint_func *it_func_ptr ; void *it_func ; void *__data ; struct tracepoint_func *_________p1 ; bool __warned ; int tmp___0 ; int tmp___1 ; { tmp = ldv__builtin_expect(__tracepoint_kmalloc.state != 0, 0L); if (tmp != 0L) { goto do_trace; } else { } return; do_trace: rcu_read_lock_sched_notrace(); _________p1 = *((struct tracepoint_func * volatile *)(& __tracepoint_kmalloc.funcs)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { tmp___1 = rcu_read_lock_sched_held(); if (tmp___1 == 0 && 1) { __warned = 1; lockdep_rcu_dereference("include/trace/events/kmem.h", 51); } else { } } else { } it_func_ptr = _________p1; if ((unsigned long )it_func_ptr != (unsigned long )((struct tracepoint_func *)0)) { ldv_13830: it_func = it_func_ptr->func; __data = it_func_ptr->data; (*((void (*)(void * , unsigned long , void const * , size_t , size_t , gfp_t ))it_func))(__data, call_site, ptr, bytes_req, bytes_alloc, gfp_flags); it_func_ptr = it_func_ptr + 1; if ((unsigned long )it_func_ptr->func != (unsigned long )((void *)0)) { goto ldv_13830; } else { } } else { } rcu_read_lock_sched_notrace(); return; } } __inline static void *kmalloc_large___1(size_t size , gfp_t flags ) { unsigned int order ; int tmp ; void *ret ; unsigned long tmp___0 ; { tmp = get_order(size); order = (unsigned int )tmp; tmp___0 = __get_free_pages(flags | 16384U, order); ret = (void *)tmp___0; kmemleak_alloc((void const *)ret, size, 1, flags); trace_kmalloc___1((unsigned long )((void *)0), (void const *)ret, size, 4096UL << (int )order, flags); return (ret); } } __inline static void *kmalloc___1(size_t size , gfp_t flags ) { void *ret ; void *tmp ; struct kmem_cache *s ; struct kmem_cache *tmp___0 ; void *tmp___1 ; { if (0) { if (size > 8192UL) { tmp = kmalloc_large___1(size, flags); return (tmp); } else { } if ((flags & 1U) == 0U) { tmp___0 = kmalloc_slab(size); s = tmp___0; if ((unsigned long )s == (unsigned long )((struct kmem_cache *)0)) { return (16); } else { } ret = kmem_cache_alloc_notrace(s, flags); trace_kmalloc___1((unsigned long )((void *)0), (void const *)ret, size, (size_t )s->size, flags); return (ret); } else { } } else { } tmp___1 = __kmalloc(size, flags); return (tmp___1); } } __inline static void *kzalloc___0(size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc___1(size, flags | 32768U); return (tmp); } } extern void put_page(struct page * ) ; __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 = ldv__builtin_expect(((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_17848: ; goto ldv_17848; } else { } tmp___0 = ldv__builtin_expect(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_17849: ; goto ldv_17849; } else { } tmp___1 = ldv__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_17850: ; goto ldv_17850; } 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, 0xffffea0000000000UL + (tmp >> 12), buflen, (unsigned int )((long )buf) & 4095U); return; } } __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 = ldv__builtin_expect(tmp != 0, 0L); return ((int )tmp___0); } } char const *drbd_set_st_err_str(enum drbd_state_ret_codes 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", 61, 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 * ) ; __inline static char const *cmdname(enum drbd_packets cmd ) { char const *cmdnames[41U] ; { 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] = 0; cmdnames[38] = 0; cmdnames[39] = "DelayProbe"; cmdnames[40] = 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 > 39U) { 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); } } int drbd_change_state(struct drbd_conf *mdev , enum chg_state_flags f , union drbd_state mask , union drbd_state val ) ; int _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 , int retcode ) ; void drbd_uuid_new_current(struct drbd_conf *mdev ) ; int drbd_bmio_set_n_write(struct drbd_conf *mdev ) ; int drbd_bmio_clear_n_write(struct drbd_conf *mdev ) ; int drbd_bitmap_io(struct drbd_conf *mdev , int (*io_fn)(struct drbd_conf * ) , char *why ) ; 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_determin_dev_size(struct drbd_conf *mdev , enum dds_flags flags ) ; void resync_after_online_grow(struct drbd_conf *mdev ) ; void drbd_setup_queue_param(struct drbd_conf *mdev , unsigned int max_seg_s ) ; int 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; } } 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_44809; ldv_44808: tmp = page_count(page); if (tmp > 1) { return (1); } else { } page = page_chain_next(page); ldv_44809: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { tmp___0 = page_chain_next(page); __builtin_prefetch((void const *)tmp___0); if (1 != 0) { goto ldv_44808; } else { goto ldv_44810; } } else { } ldv_44810: ; return (0); } } __inline static int drbd_request_state(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val ) { int tmp ; { tmp = _drbd_request_state(mdev, mask, val, 14); return (tmp); } } __inline static sector_t drbd_md_first_sector(struct drbd_backing_dev *bdev ) { { switch (bdev->dc.meta_dev_idx) { case -1: ; case -3: ; return ((sector_t )(bdev->md.md_offset + (u64 )bdev->md.bm_offset)); case -2: ; default: ; return ((sector_t )bdev->md.md_offset); } } } __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 __min1___0 ; sector_t __min2___0 ; sector_t tmp___2 ; sector_t __min1___1 ; sector_t __min2___1 ; sector_t __min1___2 ; sector_t __min2___2 ; sector_t tmp___3 ; { switch (bdev->dc.meta_dev_idx) { case -1: ; case -3: tmp___1 = drbd_get_capacity(bdev->backing_bdev); if (tmp___1 != 0UL) { __min1 = 34359738368UL; tmp___0 = drbd_md_first_sector(bdev); __min2 = tmp___0; s = __min1 < __min2 ? __min1 : __min2; } else { s = 0UL; } goto ldv_44881; case -2: __min1___0 = 34359738368UL; tmp___2 = drbd_get_capacity(bdev->backing_bdev); __min2___0 = tmp___2; s = __min1___0 < __min2___0 ? __min1___0 : __min2___0; __min1___1 = s; __min2___1 = (unsigned long )(bdev->md.md_size_sect - (u32 )bdev->md.bm_offset) << 15; s = __min1___1 < __min2___1 ? __min1___1 : __min2___1; goto ldv_44881; default: __min1___2 = 8587575296UL; tmp___3 = drbd_get_capacity(bdev->backing_bdev); __min2___2 = tmp___3; s = __min1___2 < __min2___2 ? __min1___2 : __min2___2; } ldv_44881: ; 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, P_PING, & 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, P_PING_ACK, & 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, 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_35533.conn > 1; if (have_net_conf == 0) { put_net_conf(mdev); } else { } return (have_net_conf); } } __inline static void drbd_set_ed_uuid(struct drbd_conf *mdev , u64 val ) { { mdev->ed_uuid = val; return; } } __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 ; { spin_lock(& mdev->peer_seq_lock); tmp = seq_cmp(mdev->peer_seq, new_seq); m = tmp > 0 ? mdev->peer_seq : new_seq; mdev->peer_seq = m; spin_unlock(& mdev->peer_seq_lock); if (m == new_seq) { __wake_up(& mdev->seq_wait, 3U, 1, 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 = ldv__builtin_expect(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 *)"/work/ldvuser/novikov/inst/current/envs/linux/linux/drivers/block/drbd/drbd_req.h"), "i" (227), "i" (12UL)); ldv_45147: ; goto ldv_45147; } 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 = ldv__builtin_expect(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 *)"/work/ldvuser/novikov/inst/current/envs/linux/linux/drivers/block/drbd/drbd_req.h"), "i" (236), "i" (12UL)); ldv_45152: ; goto ldv_45152; } 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_45170; ldv_45169: ; 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 *)"/work/ldvuser/novikov/inst/current/envs/linux/linux/drivers/block/drbd/drbd_req.h", 259); } else { } return (req); } else { } n = n->next; ldv_45170: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __builtin_prefetch((void const *)n->next); if (1 != 0) { __mptr = (struct hlist_node const *)n; req = (struct drbd_request *)__mptr + 0xffffffffffffffd8UL; if (1 != 0) { goto ldv_45169; } else { goto ldv_45171; } } else { goto ldv_45171; } } else { } ldv_45171: ; return (0); } } __inline static int overlaps(sector_t s1 , int l1 , sector_t s2 , int l2 ) { { return ((sector_t )(l1 >> 9) + s1 > s2 && (sector_t )(l2 >> 9) + s2 > s1); } } __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 *)"/work/ldvuser/novikov/inst/current/envs/linux/linux/drivers/block/drbd/drbd_vli.h"), "i" (162), "i" (12UL)); ldv_45223: ; goto ldv_45223; } } __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 = 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 = (0xffffffffffffffffULL >> (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 drbd_epoch *previous_epoch(struct drbd_conf *mdev , struct drbd_epoch *epoch ) { struct drbd_epoch *prev ; struct list_head const *__mptr ; { spin_lock(& mdev->epoch_lock); __mptr = (struct list_head const *)epoch->list.prev; prev = (struct drbd_epoch *)__mptr; if ((unsigned long )prev == (unsigned long )epoch || (unsigned long )mdev->current_epoch == (unsigned long )prev) { prev = 0; } else { } spin_unlock(& mdev->epoch_lock); return (prev); } } 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 = ldv__builtin_expect(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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared"), "i" (152), "i" (12UL)); ldv_45313: ; goto ldv_45313; } else { } tmp___1 = ldv__builtin_expect((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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared"), "i" (153), "i" (12UL)); ldv_45314: ; goto ldv_45314; } else { } page = *head; if ((unsigned long )page == (unsigned long )((struct page *)0)) { return (0); } else { } goto ldv_45317; ldv_45316: tmp = page_chain_next(page); n = n - 1; if (n == 0) { goto ldv_45315; } else { } if ((unsigned long )tmp == (unsigned long )((struct page *)0)) { return (0); } else { } page = tmp; ldv_45317: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { goto ldv_45316; } else { } ldv_45315: page->ldv_12351.ldv_12348.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_45325; ldv_45324: i = i + 1; page = tmp; ldv_45325: tmp = page_chain_next(page); if ((unsigned long )tmp != (unsigned long )((struct page *)0)) { goto ldv_45324; } else { } 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_45334; ldv_45333: put_page(page); i = i + 1; page = tmp; ldv_45334: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { tmp = page_chain_next(page); if (1 != 0) { goto ldv_45333; } else { goto ldv_45335; } } else { } ldv_45335: ; 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, 0); tmp___0 = ldv__builtin_expect((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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared"), "i" (209), "i" (12UL)); ldv_45342: ; goto ldv_45342; } else { } chain_last->ldv_12351.ldv_12348.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 = 0; tmp = 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_45352; ldv_45351: tmp = alloc_pages(514U, 0U); if ((unsigned long )tmp == (unsigned long )((struct page *)0)) { goto ldv_45350; } else { } tmp->ldv_12351.ldv_12348.private = (unsigned long )page; page = tmp; i = i + 1; ldv_45352: ; if (i < number) { goto ldv_45351; } else { } ldv_45350: ; if (i == number) { return (page); } else { } if ((unsigned long )page != (unsigned long )((struct page *)0)) { tmp = page_chain_tail(page, 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 (0); } } static void maybe_kick_lo(struct drbd_conf *mdev ) { int tmp ; { tmp = atomic_read((atomic_t const *)(& mdev->local_cnt)); if (tmp >= (mdev->net_conf)->unplug_watermark) { drbd_kick_lo(mdev); } else { } return; } } 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_45367; ldv_45366: __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_45365; } else { } list_move(le, to_be_freed); le = tle; tle = le->next; ldv_45367: ; if ((unsigned long )(& mdev->net_ee) != (unsigned long )le) { goto ldv_45366; } else { } ldv_45365: ; 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; maybe_kick_lo(mdev); 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_45381; ldv_45380: 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_45381: ; if ((unsigned long )(& e->w.list) != (unsigned long )(& reclaimed)) { goto ldv_45380; } else { } 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 = 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_45392; ldv_45391: 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_45390; } else { } } else { } if (! retry) { goto ldv_45390; } 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_45390; } else { } schedule(); ldv_45392: ; if ((unsigned long )page == (unsigned long )((struct page *)0)) { goto ldv_45391; } else { } ldv_45390: 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 ; int i ; struct page *tmp ; { a = is_net != 0 ? & mdev->pp_in_use_by_net : & mdev->pp_in_use; if ((unsigned long )drbd_pp_vacant > (unsigned long )minor_count * 32UL) { i = page_chain_free(page); } else { tmp = page_chain_tail(page, & i); 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); } i = atomic_sub_return(i, a); if (i < 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERTION FAILED: %s: %d < 0\n", is_net != 0 ? (char *)"pp_in_use_by_net" : (char *)"pp_in_use", i); } else { } __wake_up(& drbd_pp_wait, 3U, 1, 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 (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 (0); } else { } page = drbd_pp_alloc(mdev, nr_pages, (gfp_mask & 16U) != 0U); if ((unsigned long )page == (unsigned long )((struct page *)0)) { goto fail; } else { } INIT_HLIST_NODE(& e->colision); e->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_42995.block_id = id; return (e); fail: mempool_free((void *)e, drbd_ee_mempool); return (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 & 32UL) != 0UL) { kfree((void const *)e->ldv_42995.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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 440); } else { } tmp___0 = hlist_unhashed((struct hlist_node const *)(& e->colision)); if (tmp___0 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( hlist_unhashed(&e->colision) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 441); } 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_45433; ldv_45432: 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_45433: ; if ((unsigned long )(& e->w.list) != (unsigned long )(& work_list)) { goto ldv_45432; } else { } 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 ; 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_35533.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_45450; ldv_45449: 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_45450: ; if ((unsigned long )(& e->w.list) != (unsigned long )(& reclaimed)) { goto ldv_45449; } else { } __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_45459; ldv_45458: tmp = (*(e->w.cb))(mdev, & e->w, ok == 0); ok = tmp != 0 && ok != 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_45459: ; if ((unsigned long )(& e->w.list) != (unsigned long )(& work_list)) { goto ldv_45458; } else { } __wake_up(& mdev->ee_wait, 3U, 1, 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_45467; ldv_45466: prepare_to_wait(& mdev->ee_wait, & wait, 2); spin_unlock_irq(& mdev->req_lock); drbd_kick_lo(mdev); schedule(); finish_wait(& mdev->ee_wait, & wait); spin_lock_irq(& mdev->req_lock); ldv_45467: tmp___0 = list_empty((struct list_head const *)head); if (tmp___0 == 0) { goto ldv_45466; } else { } 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 = 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 ; int rv ; struct thread_info *tmp ; struct thread_info *tmp___0 ; mm_segment_t __constr_expr_0 ; struct thread_info *tmp___1 ; { iov.iov_base = buf; iov.iov_len = size; msg.msg_name = 0; msg.msg_namelen = 0; msg.msg_iov = (struct iovec *)(& iov); msg.msg_iovlen = 1UL; msg.msg_control = 0; msg.msg_controllen = 0UL; msg.msg_flags = flags != 0 ? (unsigned int )flags : 16640U; tmp = current_thread_info___0(); oldfs = tmp->addr_limit; tmp___0 = current_thread_info___0(); __constr_expr_0.seg = 0xffffffffffffffffUL; tmp___0->addr_limit = __constr_expr_0; rv = sock_recvmsg(sock, & msg, size, (int )msg.msg_flags); tmp___1 = current_thread_info___0(); tmp___1->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 = 0; msg.msg_namelen = 0; msg.msg_iov = (struct iovec *)(& iov); msg.msg_iovlen = 1UL; msg.msg_control = 0; msg.msg_controllen = 0UL; msg.msg_flags = 16640U; tmp = current_thread_info___0(); oldfs = tmp->addr_limit; tmp___0 = current_thread_info___0(); __constr_expr_0.seg = 0xffffffffffffffffUL; tmp___0->addr_limit = __constr_expr_0; ldv_45505: rv = sock_recvmsg(mdev->data.socket, & msg, size, (int )msg.msg_flags); if ((size_t )rv == size) { goto ldv_45504; } 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_45504; } else if (rv == 0) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "sock was shut down by peer\n"); goto ldv_45504; } else { goto ldv_45504; } goto ldv_45505; ldv_45504: tmp___1 = current_thread_info___0(); tmp___1->addr_limit = oldfs; if ((size_t )rv != size) { val.i = 0U; val.ldv_35533.conn = 4U; mask.i = 0U; mask.ldv_35533.conn = 31U; 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 ; void *__ret ; union drbd_state val ; union drbd_state mask ; { disconnect_on_error = 1; tmp = get_net_conf(mdev); if (tmp == 0) { return (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 = 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; __len = (size_t )(__min1 < __min2 ? __min1 : __min2); __ret = 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 = 0U; } else { ((struct sockaddr_in *)(& src_in6))->sin_port = 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 = 0; } else { } switch (- err) { case 110: ; case 11: ; case 115: ; case 4: ; case 512: ; case 111: ; case 101: ; case 112: ; case 113: disconnect_on_error = 0; goto ldv_45542; default: dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s failed, err = %d\n", what, err); } ldv_45542: ; if (disconnect_on_error != 0) { val.i = 0U; val.ldv_35533.conn = 1U; mask.i = 0U; mask.ldv_35533.conn = 31U; 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 ; u32 tmp___0 ; union drbd_state val ; union drbd_state mask ; { s_estab = 0; tmp = get_net_conf(mdev); if (tmp == 0) { return (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 = 0; goto out; } else { } timeo = (mdev->net_conf)->try_connect_int * 250; tmp___0 = random32(); timeo = ((int )tmp___0 & 1 ? timeo / 7 : - timeo / 7) + timeo; (s_listen->sk)->__sk_common.skc_reuse = 1U; (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 && err != -4) && err != -512) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s failed, err = %d\n", what, err); val.i = 0U; val.ldv_35533.conn = 1U; mask.i = 0U; mask.ldv_35533.conn = 31U; drbd_force_state(mdev, mask, val); } 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 && h->magic == 1728214147U) { tmp = __fswab16((int )h->command); return ((enum drbd_packets )tmp); } else { } return (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 || rr == -11) { return (1); } else { sock_release(*sock); *sock = 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 ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; int tmp___2 ; enum drbd_packets tmp___3 ; u32 tmp___4 ; struct task_struct *tmp___5 ; enum drbd_thread_state tmp___6 ; struct task_struct *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 ; int tmp___14 ; { 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 837); } else { } val.i = 0U; val.ldv_35533.conn = 8U; mask.i = 0U; mask.ldv_35533.conn = 31U; tmp = drbd_request_state(mdev, mask, val); if (tmp <= 0) { return (-2); } else { } clear_bit(6, (unsigned long volatile *)(& mdev->flags)); sock = 0; msock = 0; ldv_45601: try = 0; ldv_45593: s = drbd_try_connect(mdev); if ((unsigned long )s != (unsigned long )((struct socket *)0)) { goto ldv_45592; } else { try = try + 1; if (try > 2) { goto ldv_45592; } else { } } tmp___0 = get_current(); tmp___0->state = 1L; schedule_timeout(25L); goto ldv_45593; ldv_45592: ; if ((unsigned long )s != (unsigned long )((struct socket *)0)) { if ((unsigned long )sock == (unsigned long )((struct socket *)0)) { drbd_send_fp(mdev, s, P_HAND_SHAKE_S); sock = s; s = 0; } else if ((unsigned long )msock == (unsigned long )((struct socket *)0)) { drbd_send_fp(mdev, s, P_HAND_SHAKE_M); msock = s; s = 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) && (unsigned long )msock != (unsigned long )((struct socket *)0)) { tmp___1 = get_current(); tmp___1->state = 1L; schedule_timeout(25L); ok = drbd_socket_okay(mdev, & sock); tmp___2 = drbd_socket_okay(mdev, & msock); ok = tmp___2 != 0 && ok != 0; if (ok != 0) { goto ldv_45595; } else { } } else { } retry: s = drbd_wait_for_connect(mdev); if ((unsigned long )s != (unsigned long )((struct socket *)0)) { tmp___3 = drbd_recv_fp(mdev, s); try = (int )tmp___3; drbd_socket_okay(mdev, & sock); drbd_socket_okay(mdev, & msock); switch (try) { 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_45598; 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_45598; default: dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Error receiving initial packet\n"); sock_release(s); tmp___4 = random32(); if ((int )tmp___4 & 1) { goto retry; } else { } } ldv_45598: ; } else { } if ((int )mdev->state.ldv_35533.conn <= 1) { goto out_release_sockets; } else { } tmp___7 = get_current(); tmp___8 = signal_pending(tmp___7); if (tmp___8 != 0) { tmp___5 = get_current(); flush_signals(tmp___5); __asm__ volatile ("": : : "memory"); tmp___6 = get_t_state(& mdev->receiver); if ((unsigned int )tmp___6 == 2U) { goto out_release_sockets; } else { } } else { } if ((unsigned long )sock != (unsigned long )((struct socket *)0) && (unsigned long )msock != (unsigned long )((struct socket *)0)) { ok = drbd_socket_okay(mdev, & sock); tmp___9 = drbd_socket_okay(mdev, & msock); ok = tmp___9 != 0 && ok != 0; if (ok != 0) { goto ldv_45595; } else { } } else { } goto ldv_45601; ldv_45595: (msock->sk)->__sk_common.skc_reuse = 1U; (sock->sk)->__sk_common.skc_reuse = 1U; (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 = 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 958); } 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); switch (tmp___11) { case -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 { } val___0.i = 0U; val___0.ldv_35533.conn = 9U; mask___0.i = 0U; mask___0.ldv_35533.conn = 31U; 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); if (mdev->agreed_pro_version <= 94) { tmp___13 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___13 != 0) { drbd_setup_queue_param(mdev, 32768U); put_ldev(mdev); } else { } } else { } tmp___14 = drbd_send_protocol(mdev); if (tmp___14 == 0) { return (-1); } else { } drbd_send_sync_param(mdev, & mdev->sync_conf); drbd_send_sizes(mdev, 0, 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)); 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 ; long tmp ; __u16 tmp___0 ; __u16 tmp___1 ; __u16 tmp___2 ; __u32 tmp___3 ; __u16 tmp___4 ; __u16 tmp___5 ; __u32 tmp___6 ; long tmp___7 ; { h = & mdev->data.rbuf.header; r = drbd_recv(mdev, (void *)h, 8UL); tmp = ldv__builtin_expect(r != 8, 0L); if (tmp != 0L) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read expecting header on sock: r=%d\n", r); return (0); } else { } tmp___7 = ldv__builtin_expect(h->h80.magic == 1728214147U, 1L); if (tmp___7 != 0L) { tmp___0 = __fswab16((int )h->h80.command); *cmd = (enum drbd_packets )tmp___0; tmp___1 = __fswab16((int )h->h80.length); *packet_size = (unsigned int )tmp___1; } else if ((unsigned int )h->h95.magic == 23171U) { tmp___2 = __fswab16((int )h->h95.command); *cmd = (enum drbd_packets )tmp___2; tmp___3 = __fswab32(h->h95.length); *packet_size = tmp___3; } else { tmp___4 = __fswab16((int )h->h80.length); tmp___5 = __fswab16((int )h->h80.command); tmp___6 = __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___6, (int )tmp___5, (int )tmp___4); return (0); } mdev->last_received = jiffies; return (1); } } static enum finish_epoch drbd_flush_after_epoch(struct drbd_conf *mdev , struct drbd_epoch *epoch ) { int rv ; int tmp ; enum finish_epoch tmp___0 ; { if ((unsigned int )mdev->write_ordering > 1U) { tmp = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp != 0) { rv = blkdev_issue_flush((mdev->ldev)->backing_bdev, 208U, 0, 1UL); 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, WO_drain_io); } else { } put_ldev(mdev); } else { } } else { } tmp___0 = drbd_may_finish_epoch(mdev, epoch, EV_BARRIER_DONE); return (tmp___0); } } static int w_flush(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct flush_work *fw ; struct drbd_epoch *epoch ; int tmp ; { fw = (struct flush_work *)w; epoch = fw->epoch; kfree((void const *)w); tmp = test_and_set_bit(0, (unsigned long volatile *)(& epoch->flags)); if (tmp == 0) { drbd_flush_after_epoch(mdev, epoch); } else { } drbd_may_finish_epoch(mdev, epoch, (int )mdev->state.ldv_35533.conn <= 9 ? EV_CLEANUP : EV_PUT); return (1); } } static enum finish_epoch drbd_may_finish_epoch(struct drbd_conf *mdev , struct drbd_epoch *epoch , enum epoch_event ev ) { int finish ; int epoch_size ; struct drbd_epoch *next_epoch ; int schedule_flush ; enum finish_epoch rv ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; struct list_head const *__mptr ; struct flush_work *fw ; void *tmp___8 ; { schedule_flush = 0; rv = FE_STILL_LIVE; spin_lock(& mdev->epoch_lock); ldv_45649: next_epoch = 0; finish = 0; epoch_size = atomic_read((atomic_t const *)(& epoch->epoch_size)); switch ((unsigned int )ev & 4294967263U) { case 0U: atomic_dec(& epoch->active); goto ldv_45638; case 1U: set_bit(3U, (unsigned long volatile *)(& epoch->flags)); tmp = constant_test_bit(2U, (unsigned long const volatile *)(& epoch->flags)); if (((tmp != 0 && epoch_size == 1) && (unsigned int )mdev->write_ordering != 3U) && (unsigned long )mdev->current_epoch == (unsigned long )epoch) { clear_bit(2, (unsigned long volatile *)(& epoch->flags)); } else { } goto ldv_45638; case 2U: set_bit(1U, (unsigned long volatile *)(& epoch->flags)); goto ldv_45638; case 3U: ; goto ldv_45638; } ldv_45638: ; if (epoch_size != 0) { tmp___3 = atomic_read((atomic_t const *)(& epoch->active)); if (tmp___3 == 0) { tmp___4 = constant_test_bit(3U, (unsigned long const volatile *)(& epoch->flags)); if (tmp___4 != 0) { if ((unsigned long )epoch->list.prev == (unsigned long )(& (mdev->current_epoch)->list)) { tmp___5 = constant_test_bit(4U, (unsigned long const volatile *)(& epoch->flags)); if (tmp___5 == 0) { tmp___1 = constant_test_bit(1U, (unsigned long const volatile *)(& epoch->flags)); if (tmp___1 != 0 || (unsigned int )mdev->write_ordering == 0U) { finish = 1; set_bit(4U, (unsigned long volatile *)(& epoch->flags)); } else if (epoch_size == 1) { tmp___2 = constant_test_bit(2U, (unsigned long const volatile *)(& epoch->flags)); if (tmp___2 != 0) { finish = 1; set_bit(4U, (unsigned long volatile *)(& epoch->flags)); } else { goto _L; } } else _L: /* CIL Label */ if (((unsigned int )ev & 32U) != 0U) { finish = 1; set_bit(4U, (unsigned long volatile *)(& epoch->flags)); } else { tmp___0 = constant_test_bit(0U, (unsigned long const volatile *)(& epoch->flags)); if (tmp___0 == 0 && (unsigned int )mdev->write_ordering == 3U) { atomic_inc(& epoch->active); schedule_flush = 1; } else { } } } else { } } else { } } else { } } else { } } else { } if (finish != 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___7 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); if (tmp___7 < 0) { tmp___6 = 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", 1144, tmp___6); } 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) | 3U); mdev->epochs = mdev->epochs - 1U; kfree((void const *)epoch); if ((unsigned int )rv == 0U) { rv = FE_DESTROYED; } else { } } else { epoch->flags = 0UL; atomic_set(& epoch->epoch_size, 0); if ((unsigned int )rv == 0U) { rv = FE_RECYCLED; } else { } } } else { } if ((unsigned long )next_epoch == (unsigned long )((struct drbd_epoch *)0)) { goto ldv_45648; } else { } epoch = next_epoch; goto ldv_45649; ldv_45648: spin_unlock(& mdev->epoch_lock); if (schedule_flush != 0) { tmp___8 = kmalloc___1(32UL, 32U); fw = (struct flush_work *)tmp___8; if ((unsigned long )fw != (unsigned long )((struct flush_work *)0)) { fw->w.cb = & w_flush; fw->epoch = epoch; drbd_queue_work(& mdev->data.work, & fw->w); } else { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Could not kmalloc a flush_work obj\n"); set_bit(0U, (unsigned long volatile *)(& epoch->flags)); drbd_may_finish_epoch(mdev, epoch, EV_BARRIER_DONE); drbd_may_finish_epoch(mdev, epoch, EV_PUT); } } else { } 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[4U] ; enum write_ordering_e _min1 ; enum write_ordering_e _min2 ; { write_ordering_str[0] = (char *)"none"; write_ordering_str[1] = (char *)"drain"; write_ordering_str[2] = (char *)"flush"; write_ordering_str[3] = (char *)"barrier"; pwo = mdev->write_ordering; _min1 = pwo; _min2 = wo; wo = (enum write_ordering_e )((unsigned int )_min1 < (unsigned int )_min2 ? (unsigned int )_min1 : (unsigned int )_min2); if ((unsigned int )wo == 3U && (unsigned int )*((unsigned char *)mdev->ldev + 396UL) != 0U) { wo = WO_bdev_flush; } else { } if ((unsigned int )wo == 2U && (unsigned int )*((unsigned char *)mdev->ldev + 388UL) != 0U) { wo = WO_drain_io; } else { } if ((unsigned int )wo == 1U && (unsigned int )*((unsigned char *)mdev->ldev + 396UL) != 0U) { wo = WO_none; } else { } mdev->write_ordering = wo; if ((unsigned int )mdev->write_ordering != (unsigned int )pwo || (unsigned int )wo == 3U) { _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 ; unsigned int len ; unsigned int __min1 ; unsigned int __min2 ; long tmp ; int tmp___0 ; struct page *tmp___1 ; { bios = 0; page = e->pages; sector = e->sector; ds = e->size; n_bios = 0U; nr_pages = (unsigned int )(((unsigned long )ds + 4095UL) >> 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_45682; ldv_45681: __min1 = ds; __min2 = 4096U; len = __min1 < __min2 ? __min1 : __min2; tmp___0 = bio_add_page(bio, page, len, 0U); if (tmp___0 == 0) { tmp = ldv__builtin_expect((unsigned int )bio->bi_vcnt == 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared"), "i" (1264), "i" (12UL)); ldv_45680: ; goto ldv_45680; } 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_45682: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { tmp___1 = page_chain_next(page); __builtin_prefetch((void const *)tmp___1); if (1 != 0) { goto ldv_45681; } else { goto ldv_45683; } } else { } ldv_45683: ; 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1271); } else { } if (ds != 0U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( ds == 0 ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1272); } else { } atomic_set(& e->pending_bios, (int )n_bios); ldv_45684: bio = bios; bios = bios->bi_next; bio->bi_next = 0; if ((unsigned long )bios != (unsigned long )((struct bio *)0)) { bio->bi_rw = bio->bi_rw & 0xfffffffffffffdffUL; } else { } drbd_generic_make_request(mdev, fault_type, bio); if ((unsigned long )bios != (unsigned long )((struct bio *)0) && (unsigned long )bios->bi_next != (unsigned long )((struct bio *)0)) { bios->bi_rw = bios->bi_rw & 0xffffffffffffffefUL; } else { } if ((unsigned long )bios != (unsigned long )((struct bio *)0)) { goto ldv_45684; } else { } maybe_kick_lo(mdev); return (0); fail: ; goto ldv_45687; ldv_45686: bio = bios; bios = bios->bi_next; bio_put(bio); ldv_45687: ; if ((unsigned long )bios != (unsigned long )((struct bio *)0)) { goto ldv_45686; } else { } return (-12); } } int w_e_reissue(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_epoch_entry *e ; struct drbd_epoch *tmp ; int tmp___0 ; { e = (struct drbd_epoch_entry *)w; tmp = previous_epoch(mdev, e->epoch); if ((unsigned long )tmp != (unsigned long )((struct drbd_epoch *)0)) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Write ordering was not enforced (one time event)\n"); } else { } e->w.cb = & e_end_block; tmp___0 = drbd_submit_ee(mdev, e, 1U, 4); if (tmp___0 != 0) { e->w.cb = & w_e_reissue; drbd_queue_work(& mdev->data.work, & e->w); } else { } return (1); } } static int receive_Barrier(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { int rv ; int issue_flush ; struct p_barrier *p ; struct drbd_epoch *epoch ; enum finish_epoch tmp ; enum finish_epoch tmp___0 ; void *tmp___1 ; int tmp___2 ; enum finish_epoch tmp___3 ; int tmp___4 ; { p = & mdev->data.rbuf.barrier; inc_unacked(mdev); if ((mdev->net_conf)->wire_protocol != 3) { drbd_kick_lo(mdev); } else { } (mdev->current_epoch)->barrier_nr = p->barrier; tmp = drbd_may_finish_epoch(mdev, mdev->current_epoch, EV_GOT_BARRIER_NR); rv = (int )tmp; switch ((unsigned int )mdev->write_ordering) { case 3U: ; case 0U: ; if (rv == 2) { return (1); } else { } goto ldv_45706; case 2U: ; case 1U: ; if (rv == 0) { set_bit(0U, (unsigned long volatile *)(& (mdev->current_epoch)->flags)); drbd_wait_ee_list_empty(mdev, & mdev->active_ee); tmp___0 = drbd_flush_after_epoch(mdev, mdev->current_epoch); rv = (int )tmp___0; } else { } if (rv == 2) { return (1); } else { } goto ldv_45706; } ldv_45706: tmp___1 = kmalloc___1(40UL, 16U); epoch = (struct drbd_epoch *)tmp___1; if ((unsigned long )epoch == (unsigned long )((struct drbd_epoch *)0)) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Allocation of an epoch failed, slowing down\n"); tmp___2 = test_and_set_bit(0, (unsigned long volatile *)(& (mdev->current_epoch)->flags)); issue_flush = tmp___2 == 0; drbd_wait_ee_list_empty(mdev, & mdev->active_ee); if (issue_flush != 0) { tmp___3 = drbd_flush_after_epoch(mdev, mdev->current_epoch); rv = (int )tmp___3; if (rv == 2) { return (1); } else { } } else { } drbd_wait_ee_list_empty(mdev, & mdev->done_ee); return (1); } else { } epoch->flags = 0UL; atomic_set(& epoch->epoch_size, 0); atomic_set(& epoch->active, 0); spin_lock(& mdev->epoch_lock); tmp___4 = atomic_read((atomic_t const *)(& (mdev->current_epoch)->epoch_size)); if (tmp___4 != 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 ; int _b ; int _b___0 ; unsigned int len ; int __min1 ; int __min2 ; void *tmp___1 ; int tmp___2 ; struct page *tmp___3 ; int tmp___4 ; { 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 && (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; } if (dgs != 0) { rr = drbd_recv(mdev, dig_in, (size_t )dgs); if (rr != dgs) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving data digest: read %d expected %d\n", rr, dgs); return (0); } else { } } else { } data_size = data_size - dgs; _b = (data_size & 511) != 0; if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "read_in_block", (char *)"data_size & 0x1ff", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1444); } else { } if (_b != 0) { return (0); } else { } _b___0 = (unsigned int )data_size > 131072U; if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "read_in_block", (char *)"data_size > DRBD_MAX_SEGMENT_SIZE", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1445); } else { } if (_b___0 != 0) { return (0); } else { } if ((sector_t )(data_size >> 9) + sector > capacity) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "capacity: %llus < sector: %llus + size: %u\n", (unsigned long long )capacity, (unsigned long long )sector, data_size); return (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 (0); } else { } ds = data_size; page = e->pages; goto ldv_45735; ldv_45734: __min1 = ds; __min2 = 4096; len = (unsigned int )(__min1 < __min2 ? __min1 : __min2); tmp___1 = kmap(page); data = (unsigned long *)tmp___1; rr = drbd_recv(mdev, (void *)data, (size_t )len); tmp___2 = drbd_insert_fault(mdev, 9U); if (tmp___2 != 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); dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving data: read %d expected %d\n", rr, len); return (0); } else { } ds = ds - rr; page = page_chain_next(page); ldv_45735: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { tmp___3 = page_chain_next(page); __builtin_prefetch((void const *)tmp___3); if (1 != 0) { goto ldv_45734; } else { goto ldv_45736; } } else { } ldv_45736: ; if (dgs != 0) { drbd_csum_ee(mdev, mdev->integrity_r_tfm, e, dig_vv); tmp___4 = memcmp((void const *)dig_in, (void const *)dig_vv, (size_t )dgs); if (tmp___4 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Digest integrity check FAILED.\n"); drbd_bcast_ee(mdev, "digest failed", dgs, (char const *)dig_in, (char const *)dig_vv, (struct drbd_epoch_entry const *)e); drbd_free_some_ee(mdev, e, 0); return (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 __min1___0 ; int __min2___0 ; int __min1___1 ; int __min2___1 ; { rv = 1; if (data_size == 0) { return (1); } else { } page = drbd_pp_alloc(mdev, 1U, 1); data = kmap(page); goto ldv_45756; ldv_45755: __min1 = data_size; __min2 = 4096; rr = drbd_recv(mdev, data, (size_t )(__min1 < __min2 ? __min1 : __min2)); __min1___1 = data_size; __min2___1 = 4096; if ((__min1___1 < __min2___1 ? __min1___1 : __min2___1) != rr) { rv = 0; __min1___0 = data_size; __min2___0 = 4096; dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving data: read %d expected %d\n", rr, __min1___0 < __min2___0 ? __min1___0 : __min2___0); goto ldv_45754; } else { } data_size = data_size - rr; ldv_45756: ; if (data_size != 0) { goto ldv_45755; } else { } ldv_45754: 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 ; int __min1 ; int __min2 ; void *tmp___0 ; int tmp___1 ; { dig_in = mdev->int_dig_in; dig_vv = mdev->int_dig_vv; if (mdev->agreed_pro_version > 86 && (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; } if (dgs != 0) { rr = drbd_recv(mdev, dig_in, (size_t )dgs); if (rr != dgs) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving data reply digest: read %d expected %d\n", rr, dgs); 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1555); } else { } bvec = bio->bi_io_vec + (unsigned long )bio->bi_idx; i = (int )bio->bi_idx; goto ldv_45775; ldv_45774: __min1 = data_size; __min2 = (int )bvec->bv_len; expect = __min1 < __min2 ? __min1 : __min2; tmp___0 = kmap(bvec->bv_page); rr = drbd_recv(mdev, tmp___0 + (unsigned long )bvec->bv_offset, (size_t )expect); kunmap(bvec->bv_page); if (rr != expect) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving data reply: read %d expected %d\n", rr, expect); return (0); } else { } data_size = data_size - rr; bvec = bvec + 1; i = i + 1; ldv_45775: ; if ((int )bio->bi_vcnt > i) { goto ldv_45774; } else { } if (dgs != 0) { drbd_csum_bio(mdev, mdev->integrity_r_tfm, bio, dig_vv); tmp___1 = memcmp((void const *)dig_in, (void const *)dig_vv, (size_t )dgs); if (tmp___1 != 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1580); } 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->colision)); if (tmp == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( hlist_unhashed(&e->colision) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1592); } else { } tmp___0 = ldv__builtin_expect((e->flags & 16UL) == 0UL, 1L); if (tmp___0 != 0L) { __drbd_set_in_sync(mdev, sector, (int )e->size, "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1595U); ok = drbd_send_ack(mdev, P_RS_WRITE_ACK, e); } else { drbd_rs_failed_io(mdev, sector, (int )e->size); ok = drbd_send_ack(mdev, P_NEG_ACK, 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", 1603, 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, 0xffffffffffffffffULL, 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", 1616, 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, 1U, 2); if (tmp___1 == 0) { return (1); } 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); 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 = ldv__builtin_expect((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, data_received); } 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 != 0xffffffffffffffffULL) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( p->block_id == ID_SYNCER ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1683); } else { } tmp___1 = _get_ldev_if_state(mdev, D_INCONSISTENT); 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, P_NEG_ACK, 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 ; struct drbd_epoch *epoch ; int ok ; int pcmd ; int tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { e = (struct drbd_epoch_entry *)w; sector = e->sector; ok = 1; if ((e->flags & 4UL) != 0UL) { epoch = previous_epoch(mdev, e->epoch); if ((unsigned long )epoch != (unsigned long )((struct drbd_epoch *)0)) { drbd_may_finish_epoch(mdev, epoch, cancel != 0 ? 34 : EV_BARRIER_DONE); } else { } } else { } if ((mdev->net_conf)->wire_protocol == 3) { tmp___0 = ldv__builtin_expect((e->flags & 16UL) == 0UL, 1L); if (tmp___0 != 0L) { pcmd = ((int )mdev->state.ldv_35533.conn > 15 && (int )mdev->state.ldv_35533.conn <= 21) && (e->flags & 2UL) != 0UL ? 23 : 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, "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1728U); } else { } } else { ok = drbd_send_ack(mdev, P_NEG_ACK, 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", 1734, tmp___1); } else { } } else { } if ((unsigned int )*((unsigned char *)mdev->net_conf + 528UL) != 0U) { spin_lock_irq(& mdev->req_lock); tmp___3 = hlist_unhashed((struct hlist_node const *)(& e->colision)); if (tmp___3 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !hlist_unhashed(&e->colision) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1740); } else { } hlist_del_init(& e->colision); spin_unlock_irq(& mdev->req_lock); } else { tmp___4 = hlist_unhashed((struct hlist_node const *)(& e->colision)); if (tmp___4 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( hlist_unhashed(&e->colision) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1744); } else { } } drbd_may_finish_epoch(mdev, e->epoch, cancel != 0 ? EV_CLEANUP : EV_PUT); 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1757); } else { } ok = drbd_send_ack(mdev, P_DISCARD_ACK, e); spin_lock_irq(& mdev->req_lock); tmp = hlist_unhashed((struct hlist_node const *)(& e->colision)); if (tmp != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !hlist_unhashed(&e->colision) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1761); } else { } hlist_del_init(& e->colision); 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", 1765, 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_45852: prepare_to_wait(& mdev->seq_wait, & wait, 1); tmp___0 = seq_cmp(packet_seq, mdev->peer_seq + 1U); if (tmp___0 <= 0) { goto ldv_45851; } else { } tmp___1 = get_current(); tmp___2 = signal_pending(tmp___1); if (tmp___2 != 0) { ret = -512; goto ldv_45851; } 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 && 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_45851; } else { } goto ldv_45852; ldv_45851: 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 write_flags_to_bio(struct drbd_conf *mdev , u32 dpf ) { { if (mdev->agreed_pro_version > 94) { return ((unsigned long )((((((dpf & 2U) != 0U ? 32 : 0) | ((dpf & 8U) != 0U ? 512 : 0)) | ((dpf & 16U) != 0U ? 16384 : 0)) | ((dpf & 32U) != 0U ? 16384 : 0)) | ((dpf & 64U) != 0U ? 128 : 0))); } else { return ((dpf & 2U) != 0U ? 544UL : 0UL); } } } 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 ; int tmp ; __u32 tmp___0 ; int tmp___1 ; int tmp___2 ; __u64 tmp___3 ; struct drbd_epoch *epoch ; struct list_head const *__mptr ; int tmp___4 ; int tmp___5 ; int tmp___6 ; __u32 tmp___7 ; unsigned long tmp___8 ; int size ; int discard ; int tmp___9 ; wait_queue_t wait ; struct task_struct *tmp___10 ; struct drbd_request *i ; struct hlist_node *n ; struct hlist_head *slot ; int first ; long tmp___11 ; long tmp___12 ; __u32 tmp___13 ; int tmp___14 ; struct hlist_head *tmp___15 ; int have_unacked ; int have_conflict ; struct task_struct *tmp___16 ; struct task_struct *tmp___17 ; int tmp___18 ; struct hlist_node const *__mptr___0 ; struct task_struct *tmp___19 ; int tmp___20 ; int tmp___21 ; { p = & mdev->data.rbuf.data; rw = 1; tmp___2 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___2 == 0) { tmp = ___ratelimit(& drbd_ratelimit_state, "receive_Data"); if (tmp != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Can not write mirrored data block to local disk.\n"); } else { } spin_lock(& mdev->peer_seq_lock); tmp___0 = __fswab32(p->seq_num); if (mdev->peer_seq + 1U == tmp___0) { mdev->peer_seq = mdev->peer_seq + 1U; } else { } spin_unlock(& mdev->peer_seq_lock); drbd_send_ack_dp(mdev, P_NEG_ACK, p, (int )data_size); atomic_inc(& (mdev->current_epoch)->epoch_size); tmp___1 = drbd_drain_block(mdev, (int )data_size); return (tmp___1); } else { } tmp___3 = __fswab64(p->sector); sector = (sector_t )tmp___3; 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; spin_lock(& mdev->epoch_lock); e->epoch = mdev->current_epoch; atomic_inc(& (e->epoch)->epoch_size); atomic_inc(& (e->epoch)->active); if ((unsigned int )mdev->write_ordering == 3U) { tmp___6 = atomic_read((atomic_t const *)(& (e->epoch)->epoch_size)); if (tmp___6 == 1) { __mptr = (struct list_head const *)(e->epoch)->list.prev; epoch = (struct drbd_epoch *)__mptr; if ((unsigned long )e->epoch == (unsigned long )epoch) { set_bit(2U, (unsigned long volatile *)(& (e->epoch)->flags)); rw = rw | 16; e->flags = e->flags | 4UL; } else { tmp___4 = atomic_read((atomic_t const *)(& epoch->epoch_size)); if (tmp___4 > 1) { set_bit(0U, (unsigned long volatile *)(& epoch->flags)); set_bit(2U, (unsigned long volatile *)(& (e->epoch)->flags)); rw = rw | 16; e->flags = e->flags | 4UL; } else { tmp___5 = constant_test_bit(2U, (unsigned long const volatile *)(& epoch->flags)); if (tmp___5 == 0) { set_bit(0U, (unsigned long volatile *)(& epoch->flags)); set_bit(2U, (unsigned long volatile *)(& (e->epoch)->flags)); rw = rw | 16; e->flags = e->flags | 4UL; } else { } } } } else { } } else { } spin_unlock(& mdev->epoch_lock); tmp___7 = __fswab32(p->dp_flags); dp_flags = tmp___7; tmp___8 = write_flags_to_bio(mdev, dp_flags); rw = (int )((unsigned int )tmp___8 | (unsigned int )rw); if ((dp_flags & 4U) != 0U) { e->flags = e->flags | 2UL; } else { } if ((unsigned int )*((unsigned char *)mdev->net_conf + 528UL) == 0U) { spin_lock_irq(& mdev->req_lock); } else { size = (int const )e->size; tmp___9 = constant_test_bit(6U, (unsigned long const volatile *)(& mdev->flags)); discard = tmp___9; tmp___10 = get_current(); wait.flags = 0U; wait.private = (void *)tmp___10; 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1919); } else { } tmp___11 = ldv__builtin_expect((unsigned long )mdev->ee_hash == (unsigned long )((struct hlist_head *)0), 0L); if (tmp___11 != 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared"), "i" (1920), "i" (12UL)); ldv_45878: ; goto ldv_45878; } else { } tmp___12 = ldv__builtin_expect((unsigned long )mdev->tl_hash == (unsigned long )((struct hlist_head *)0), 0L); if (tmp___12 != 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared"), "i" (1921), "i" (12UL)); ldv_45879: ; goto ldv_45879; } else { } tmp___13 = __fswab32(p->seq_num); tmp___14 = drbd_wait_peer_seq(mdev, tmp___13); if (tmp___14 != 0) { goto out_interrupted; } else { } spin_lock_irq(& mdev->req_lock); tmp___15 = ee_hash_slot(mdev, sector); hlist_add_head(& e->colision, tmp___15); slot = tl_hash_slot(mdev, sector); first = 1; ldv_45891: have_unacked = 0; have_conflict = 0; prepare_to_wait(& mdev->misc_wait, & wait, 1); n = slot->first; goto ldv_45888; ldv_45887: tmp___18 = overlaps(i->sector, (int )i->size, sector, size); if (tmp___18 != 0) { if (first != 0) { tmp___16 = get_current(); tmp___17 = 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___17->comm), tmp___16->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_45888: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __builtin_prefetch((void const *)n->next); if (1 != 0) { __mptr___0 = (struct hlist_node const *)n; i = (struct drbd_request *)__mptr___0 + 0xffffffffffffffd8UL; if (1 != 0) { goto ldv_45887; } else { goto ldv_45889; } } else { goto ldv_45889; } } else { } ldv_45889: ; if (have_conflict == 0) { goto ldv_45890; } else { } if ((first != 0 && discard != 0) && 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 { } tmp___19 = get_current(); tmp___20 = signal_pending(tmp___19); if (tmp___20 != 0) { hlist_del_init(& e->colision); 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2027); } else { } } else { } schedule(); spin_lock_irq(& mdev->req_lock); goto ldv_45891; ldv_45890: finish_wait(& mdev->misc_wait, & wait); } list_add(& e->w.list, & mdev->active_ee); spin_unlock_irq(& mdev->req_lock); switch ((mdev->net_conf)->wire_protocol) { case 3: inc_unacked(mdev); goto ldv_45893; case 2: drbd_send_ack(mdev, P_RECV_ACK, e); goto ldv_45893; case 1: ; goto ldv_45893; } ldv_45893: ; if (*((unsigned int *)mdev + 503UL) == 0U) { __drbd_set_out_of_sync(mdev, e->sector, (int )e->size, "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2056U); e->flags = e->flags | 1UL; drbd_al_begin_io(mdev, e->sector); } else { } tmp___21 = drbd_submit_ee(mdev, e, (unsigned int const )rw, 4); if (tmp___21 == 0) { return (1); } else { } spin_lock_irq(& mdev->req_lock); list_del(& e->w.list); hlist_del_init(& e->colision); spin_unlock_irq(& mdev->req_lock); if ((int )e->flags & 1) { drbd_al_complete_io(mdev, e->sector); } else { } out_interrupted: put_ldev(mdev); drbd_free_some_ee(mdev, e, 0); return (0); } } int drbd_rs_should_slow_down(struct drbd_conf *mdev ) { struct gendisk *disk ; unsigned long db ; unsigned long dt ; unsigned long dbdt ; int curr_events ; int throttle ; 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 ; unsigned long rs_left ; int i ; unsigned long tmp___0 ; { disk = (((mdev->ldev)->backing_bdev)->bd_contains)->bd_disk; throttle = 0; if (mdev->sync_conf.c_min_rate == 0) { return (0); } else { } res = 0UL; _cpu = 4294967295U; goto ldv_45912; ldv_45911: __vpp_verify = 0; __asm__ ("": "=r" (__ptr): "0" (disk->part0.dkstats)); res = ((struct disk_stats *)(__per_cpu_offset[_cpu] + __ptr))->sectors[0] + res; ldv_45912: _cpu = cpumask_next((int )_cpu, cpu_possible_mask); if ((unsigned int )nr_cpu_ids > _cpu) { goto ldv_45911; } else { } res___0 = 0UL; _cpu___0 = 4294967295U; goto ldv_45922; ldv_45921: __vpp_verify___0 = 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_45922: _cpu___0 = cpumask_next((int )_cpu___0, cpu_possible_mask); if ((unsigned int )nr_cpu_ids > _cpu___0) { goto ldv_45921; } else { } tmp = atomic_read((atomic_t const *)(& mdev->rs_sect_ev)); curr_events = ((int )res + (int )res___0) - tmp; if (mdev->rs_last_events == 0 || curr_events - mdev->rs_last_events > 64) { mdev->rs_last_events = curr_events; i = (mdev->rs_last_mark + 6) % 8; tmp___0 = drbd_bm_total_weight(mdev); rs_left = tmp___0 - 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 ; char const *tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; { tmp = drbd_get_capacity(mdev->this_bdev); capacity = tmp; di = 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 || (size & 511) != 0) || (unsigned int )size > 131072U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s:%d: sector: %llus, size: %u\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2146, (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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2151, (unsigned long long )sector, size); return (0); } else { } tmp___7 = _get_ldev_if_state(mdev, D_UP_TO_DATE); if (tmp___7 == 0) { verb = 1; switch ((unsigned int )cmd) { case 8U: drbd_send_ack_rp(mdev, P_NEG_DREPLY, p); goto ldv_45941; case 9U: ; case 33U: ; case 30U: drbd_send_ack_rp(mdev, P_NEG_RS_DREPLY, p); goto ldv_45941; case 31U: 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", 2169, tmp___2); } else { } drbd_send_ack_ex(mdev, P_OV_RESULT, sector, size, 4711ULL); goto ldv_45941; default: tmp___4 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "unexpected command (%s) in receive_DataRequest\n", tmp___4); } ldv_45941: ; 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 { } switch ((unsigned int )cmd) { case 8U: e->w.cb = & w_e_end_data_req; fault_type = 5U; goto submit; case 9U: e->w.cb = & w_e_end_rsdata_req; fault_type = 3U; goto ldv_45954; case 31U: ; case 33U: fault_type = 3U; tmp___8 = kmalloc___1((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_42995.digest = di; e->flags = e->flags | 32UL; 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2222); } else { } e->w.cb = & w_e_end_csum_rs_req; } else if ((unsigned int )cmd == 31U) { 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", 2226, tmp___10); } else { } goto submit_for_resync; } else { } goto ldv_45954; case 30U: ; if (mdev->ov_start_sector == 0xffffffffffffffffUL && mdev->agreed_pro_version > 89) { mdev->ov_start_sector = sector; mdev->ov_position = sector; mdev->ov_left = mdev->rs_total - (sector >> 3); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Online Verify start sector: %llu\n", (unsigned long long )sector); } else { } e->w.cb = & w_e_end_ov_req; fault_type = 3U; goto ldv_45954; default: tmp___12 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "unexpected command (%s) in receive_DataRequest\n", tmp___12); fault_type = 10U; goto out_free_e; } ldv_45954: ; if ((unsigned int )*((unsigned char *)mdev + 2012UL) != 4U) { tmp___13 = drbd_rs_should_slow_down(mdev); if (tmp___13 != 0) { msleep(100U); } else { } } else { } tmp___14 = drbd_rs_begin_io(mdev, e->sector); if (tmp___14 != 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___15 = drbd_submit_ee(mdev, e, 0U, (int const )fault_type); if (tmp___15 == 0) { return (1); } else { } 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 ; int tmp___0 ; { 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; switch ((mdev->net_conf)->after_sb_0p) { case 7: ; case 8: ; case 9: dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Configuration error.\n"); goto ldv_45975; case 0: ; goto ldv_45975; case 1: ; if (self == 0 && peer == 1) { rv = -1; goto ldv_45975; } else { } if (self == 1 && peer == 0) { rv = 1; goto ldv_45975; } else { } case 2: ; if (self == 0 && peer == 1) { rv = 1; goto ldv_45975; } else { } if (self == 1 && peer == 0) { rv = -1; goto ldv_45975; } 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 && ch_self == 0UL) { tmp = constant_test_bit(6U, (unsigned long const volatile *)(& mdev->flags)); rv = tmp != 0 ? -1 : 1; goto ldv_45975; } else { if (ch_peer == 0UL) { rv = 1; goto ldv_45975; } else { } if (ch_self == 0UL) { rv = -1; goto ldv_45975; } else { } } if ((mdev->net_conf)->after_sb_0p == 3) { goto ldv_45975; } else { } case 4: ; if (ch_self < ch_peer) { rv = -1; } else if (ch_self > ch_peer) { rv = 1; } else { tmp___0 = constant_test_bit(6U, (unsigned long const volatile *)(& mdev->flags)); rv = tmp___0 != 0 ? -1 : 1; } goto ldv_45975; case 5: rv = -1; goto ldv_45975; case 6: rv = 1; } ldv_45975: ; return (rv); } } static int drbd_asb_recover_1p(struct drbd_conf *mdev ) { int self ; int peer ; int hg ; int rv ; union drbd_state val ; union drbd_state mask ; { rv = -100; self = (int )(mdev->ldev)->md.uuid[1] & 1; peer = (int )*(mdev->p_uuid + 1UL) & 1; switch ((mdev->net_conf)->after_sb_1p) { case 1: ; case 2: ; case 4: ; case 5: ; case 6: dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Configuration error.\n"); goto ldv_45995; case 0: ; goto ldv_45995; case 7: hg = drbd_asb_recover_0p(mdev); if (hg == -1 && (unsigned int )*((unsigned char *)mdev + 2012UL) == 2U) { rv = hg; } else { } if (hg == 1 && (unsigned int )*((unsigned char *)mdev + 2012UL) == 1U) { rv = hg; } else { } goto ldv_45995; case 10: rv = drbd_asb_recover_0p(mdev); goto ldv_45995; case 8: ; return ((unsigned int )*((unsigned char *)mdev + 2012UL) == 1U ? 1 : -1); case 9: hg = drbd_asb_recover_0p(mdev); if (hg == -1 && (unsigned int )*((unsigned char *)mdev + 2012UL) == 1U) { self = drbd_set_role(mdev, R_SECONDARY, 0); val.i = 0U; val.ldv_35533.role = 2U; mask.i = 0U; mask.ldv_35533.role = 3U; self = drbd_change_state(mdev, CS_VERBOSE, mask, val); if (self != 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; } } ldv_45995: ; return (rv); } } static int drbd_asb_recover_2p(struct drbd_conf *mdev ) { int self ; int peer ; int hg ; int rv ; union drbd_state val ; union drbd_state mask ; { rv = -100; self = (int )(mdev->ldev)->md.uuid[1] & 1; peer = (int )*(mdev->p_uuid + 1UL) & 1; switch ((mdev->net_conf)->after_sb_2p) { 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_46019; case 10: rv = drbd_asb_recover_0p(mdev); goto ldv_46019; case 0: ; goto ldv_46019; case 9: hg = drbd_asb_recover_0p(mdev); if (hg == -1) { val.i = 0U; val.ldv_35533.role = 2U; mask.i = 0U; mask.ldv_35533.role = 3U; self = drbd_change_state(mdev, CS_VERBOSE, mask, val); if (self != 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; } } ldv_46019: ; 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 ; int tmp___1 ; unsigned long tmp___2 ; u64 tmp___3 ; { self = (mdev->ldev)->md.uuid[0] & 0xfffffffffffffffeULL; peer = *(mdev->p_uuid) & 0xfffffffffffffffeULL; *rule_nr = 10; if (self == 4ULL && peer == 4ULL) { return (0); } else { } *rule_nr = 20; if ((self == 4ULL || self == 0ULL) && peer != 4ULL) { return (-2); } else { } *rule_nr = 30; if (self != 4ULL && (peer == 4ULL || peer == 0ULL)) { return (2); } else { } if (self == peer) { if (*(mdev->p_uuid + 1UL) == 0ULL && (mdev->ldev)->md.uuid[1] != 0ULL) { if (mdev->agreed_pro_version <= 90) { return (-1001); } else { } if ((((mdev->ldev)->md.uuid[1] ^ *(mdev->p_uuid + 2UL)) & 0xfffffffffffffffeULL) == 0ULL && (((mdev->ldev)->md.uuid[2] ^ *(mdev->p_uuid + 3UL)) & 0xfffffffffffffffeULL) == 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_35533.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; } return (1); } else { } if ((mdev->ldev)->md.uuid[1] == 0ULL && *(mdev->p_uuid + 1UL) != 0ULL) { if (mdev->agreed_pro_version <= 90) { return (-1001); } else { } if ((((mdev->ldev)->md.uuid[2] ^ *(mdev->p_uuid + 1UL)) & 0xfffffffffffffffeULL) == 0ULL && (((mdev->ldev)->md.uuid[3] ^ *(mdev->p_uuid + 2UL)) & 0xfffffffffffffffeULL) == 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; } return (-1); } else { } tmp___1 = constant_test_bit(11U, (unsigned long const volatile *)(& mdev->flags)); rct = (int )((tmp___1 != 0 ? 1U : 0U) + ((unsigned int )*(mdev->p_uuid + 5UL) & 2U)); *rule_nr = 40; switch (rct) { 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)); return (dc != 0 ? -1 : 1); } } else { } *rule_nr = 50; peer = *(mdev->p_uuid + 1UL) & 0xfffffffffffffffeULL; if (self == peer) { return (-1); } else { } *rule_nr = 51; peer = *(mdev->p_uuid + 2UL) & 0xfffffffffffffffeULL; if (self == peer) { self = (mdev->ldev)->md.uuid[2] & 0xfffffffffffffffeULL; peer = *(mdev->p_uuid + 3UL) & 0xfffffffffffffffeULL; if (self == peer) { if (mdev->agreed_pro_version <= 90) { return (-1001); } else { } *(mdev->p_uuid + 1UL) = *(mdev->p_uuid + 2UL); *(mdev->p_uuid + 2UL) = *(mdev->p_uuid + 3UL); return (-1); } else { } } else { } *rule_nr = 60; self = (mdev->ldev)->md.uuid[0] & 0xfffffffffffffffeULL; i = 2; goto ldv_46049; ldv_46048: peer = *(mdev->p_uuid + (unsigned long )i) & 0xfffffffffffffffeULL; if (self == peer) { return (-2); } else { } i = i + 1; ldv_46049: ; if (i <= 3) { goto ldv_46048; } else { } *rule_nr = 70; self = (mdev->ldev)->md.uuid[1] & 0xfffffffffffffffeULL; peer = *(mdev->p_uuid) & 0xfffffffffffffffeULL; if (self == peer) { return (1); } else { } *rule_nr = 71; self = (mdev->ldev)->md.uuid[2] & 0xfffffffffffffffeULL; if (self == peer) { self = (mdev->ldev)->md.uuid[3] & 0xfffffffffffffffeULL; peer = *(mdev->p_uuid + 2UL) & 0xfffffffffffffffeULL; if (self == peer) { if (mdev->agreed_pro_version <= 90) { return (-1001); } 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), "Undid last start of resync:\n"); if ((int )mdev->state.ldv_35533.disk > 2) { tmp___2 = drbd_bm_total_weight(mdev); tmp___3 = (u64 )tmp___2; } else { tmp___3 = 0ULL; } drbd_uuid_dump(mdev, (char *)"self", (u64 *)(& (mdev->ldev)->md.uuid), tmp___3, 0ULL); return (1); } else { } } else { } *rule_nr = 80; peer = *(mdev->p_uuid) & 0xfffffffffffffffeULL; i = 2; goto ldv_46052; ldv_46051: self = (mdev->ldev)->md.uuid[i] & 0xfffffffffffffffeULL; if (self == peer) { return (2); } else { } i = i + 1; ldv_46052: ; if (i <= 3) { goto ldv_46051; } else { } *rule_nr = 90; self = (mdev->ldev)->md.uuid[1] & 0xfffffffffffffffeULL; peer = *(mdev->p_uuid + 1UL) & 0xfffffffffffffffeULL; if (self == peer && self != 0ULL) { return (100); } else { } *rule_nr = 100; i = 2; goto ldv_46058; ldv_46057: self = (mdev->ldev)->md.uuid[i] & 0xfffffffffffffffeULL; j = 2; goto ldv_46055; ldv_46054: peer = *(mdev->p_uuid + (unsigned long )j) & 0xfffffffffffffffeULL; if (self == peer) { return (-100); } else { } j = j + 1; ldv_46055: ; if (j <= 3) { goto ldv_46054; } else { } i = i + 1; ldv_46058: ; if (i <= 3) { goto ldv_46057; } else { } 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 __x ; int tmp ; long __x___0 ; int pcount ; int forced ; long __x___1 ; long __x___2 ; long __x___3 ; char const *tmp___0 ; int tmp___1 ; int tmp___2 ; long __x___4 ; unsigned long tmp___3 ; unsigned long tmp___4 ; { rv = C_MASK; mydisk = (enum drbd_disk_state )mdev->state.ldv_35533.disk; if ((unsigned int )mydisk == 3U) { mydisk = (enum drbd_disk_state )mdev->new_state_tmp.ldv_35533.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 (C_MASK); } else { } if (hg == -1001) { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "To resolve this both sides have to support at least protocol\n"); return (C_MASK); } else { } if (((unsigned int )mydisk == 4U && (unsigned int )peer_disk > 4U) || ((unsigned int )peer_disk == 4U && (unsigned int )mydisk > 4U)) { if (hg == -100) { tmp = 1; } else { __x = (long )hg; if ((__x < 0L ? - __x : __x) == 2L) { tmp = 1; } else { tmp = 0; } } f = tmp; hg = (unsigned int )mydisk > 4U ? 1 : -1; if (f != 0) { hg = hg * 2; } else { } _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Becoming sync %s due to disk states.\n", hg > 0 ? (char *)"source" : (char *)"target"); } else { } __x___0 = (long )hg; if ((__x___0 < 0L ? - __x___0 : __x___0) == 100L) { drbd_khelper(mdev, (char *)"initial-split-brain"); } else { } if (hg == 100 || (hg == -100 && (unsigned int )*((unsigned char *)mdev->net_conf + 528UL) != 0U)) { pcount = ((unsigned int )*((unsigned char *)mdev + 2012UL) == 1U) + ((unsigned int )peer_role == 1U); forced = hg == -100; switch (pcount) { case 0: hg = drbd_asb_recover_0p(mdev); goto ldv_46077; case 1: hg = drbd_asb_recover_1p(mdev); goto ldv_46077; case 2: hg = drbd_asb_recover_2p(mdev); goto ldv_46077; } ldv_46077: __x___1 = (long )hg; if ((__x___1 < 0L ? - __x___1 : __x___1) <= 99L) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Split-Brain detected, %d primaries, automatically solved. Sync from %s node\n", pcount, hg < 0 ? (char *)"peer" : (char *)"this"); 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 { } if (hg == -100) { if ((unsigned int )*((unsigned char *)mdev->net_conf + 528UL) != 0U && (*(mdev->p_uuid + 5UL) & 1ULL) == 0ULL) { hg = -1; } else { } if ((unsigned int )*((unsigned char *)mdev->net_conf + 528UL) == 0U && (int )*(mdev->p_uuid + 5UL) & 1) { hg = 1; } else { } __x___2 = (long )hg; if ((__x___2 < 0L ? - __x___2 : __x___2) <= 99L) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Split-Brain detected, manually solved. Sync from %s node\n", hg < 0 ? (char *)"peer" : (char *)"this"); } 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 (C_MASK); } else { } if (hg > 0 && (unsigned int )mydisk <= 4U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "I shall become SyncSource, but I am inconsistent!\n"); return (C_MASK); } else { } if ((hg < 0 && (unsigned int )*((unsigned char *)mdev + 2012UL) == 1U) && (int )mdev->state.ldv_35533.disk > 6) { switch ((mdev->net_conf)->rr_conflict) { case 9: drbd_khelper(mdev, (char *)"pri-lost"); case 0: dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "I shall become SyncTarget, but I am primary!\n"); return (C_MASK); case 10: dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Becoming SyncTarget, violating the stable-dataassumption\n"); } } else { } if ((unsigned int )*((unsigned char *)mdev->net_conf + 528UL) != 0U) { goto _L; } else { tmp___1 = constant_test_bit(25U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___1 != 0) { _L: /* CIL Label */ if (hg == 0) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "dry-run connect: No resync, would become Connected immediately.\n"); } else { __x___3 = (long )hg; tmp___0 = drbd_conn_str(hg > 0 ? C_SYNC_SOURCE : C_SYNC_TARGET); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "dry-run connect: Would become %s, doing a %s resync.", tmp___0, (__x___3 < 0L ? - __x___3 : __x___3) > 1L ? (char *)"full" : (char *)"bit-map based"); } return (C_MASK); } else { } } __x___4 = (long )hg; if ((__x___4 < 0L ? - __x___4 : __x___4) > 1L) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Writing the whole bitmap, full sync required after drbd_sync_handshake.\n"); tmp___2 = drbd_bitmap_io(mdev, & drbd_bmio_set_n_write, (char *)"set_n_write from sync_handshake"); if (tmp___2 != 0) { return (C_MASK); } else { } } else { } if (hg > 0) { rv = C_WF_BITMAP_S; } else if (hg < 0) { rv = C_WF_BITMAP_T; } else { rv = C_CONNECTED; tmp___4 = drbd_bm_total_weight(mdev); if (tmp___4 != 0UL) { tmp___3 = drbd_bm_total_weight(mdev); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "No resync, but %lu bits in bitmap!\n", tmp___3); } 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 && (unsigned int )self == 5U) || ((unsigned int )self == 6U && (unsigned int )peer == 5U)) { return (0); } else { } if ((((unsigned int )peer == 6U || (unsigned int )peer == 5U) || (unsigned int )self == 6U) || (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] ; unsigned int tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; unsigned char *my_alg ; int tmp___9 ; int tmp___10 ; union drbd_state val ; union drbd_state mask ; { p = & mdev->data.rbuf.protocol; p_integrity_alg[0] = '\000'; tmp = 1U; while (1) { if (tmp >= 64U) { break; } else { } p_integrity_alg[tmp] = (char)0; tmp = tmp + 1U; } tmp___0 = __fswab32(p->protocol); p_proto = (int )tmp___0; tmp___1 = __fswab32(p->after_sb_0p); p_after_sb_0p = (int )tmp___1; tmp___2 = __fswab32(p->after_sb_1p); p_after_sb_1p = (int )tmp___2; tmp___3 = __fswab32(p->after_sb_2p); p_after_sb_2p = (int )tmp___3; tmp___4 = __fswab32(p->two_primaries); p_two_primaries = (int )tmp___4; tmp___5 = __fswab32(p->conn_flags); cf = (int )tmp___5; 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___6 = 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___6 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "incompatible after-sb-0pri settings\n"); goto disconnect; } else { } tmp___7 = 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___7 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "incompatible after-sb-1pri settings\n"); goto disconnect; } else { } tmp___8 = 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___8 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "incompatible after-sb-2pri settings\n"); goto disconnect; } else { } if (p_want_lose != 0 && (unsigned int )*((unsigned char *)mdev->net_conf + 528UL) != 0U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "both sides have the \'want_lose\' flag set\n"); goto disconnect; } 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___9 = drbd_recv(mdev, (void *)(& p_integrity_alg), (size_t )data_size); if ((unsigned int )tmp___9 != data_size) { return (0); } else { } p_integrity_alg[63] = 0; tmp___10 = strcmp((char const *)(& p_integrity_alg), (char const *)my_alg); if (tmp___10 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "incompatible setting of the data-integrity-alg\n"); goto disconnect; } else { } _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "data-integrity-alg: %s\n", (unsigned int )*my_alg != 0U ? my_alg : (unsigned char *)""); } else { } return (1); disconnect: val.i = 0U; val.ldv_35533.conn = 1U; mask.i = 0U; mask.ldv_35533.conn = 31U; 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 (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 ; int tmp ; __u32 tmp___0 ; int tmp___1 ; long tmp___2 ; int tmp___3 ; long tmp___4 ; int tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; __u32 tmp___8 ; __u32 tmp___9 ; __u32 tmp___10 ; void *tmp___11 ; size_t tmp___12 ; size_t tmp___13 ; union drbd_state val ; union drbd_state mask ; { ok = 1; p = & mdev->data.rbuf.rs_param_95; verify_tfm = 0; csums_tfm = 0; apv = mdev->agreed_pro_version; rs_plan_s = 0; fifo_size = 0; exp_max_sz = apv > 87 ? (apv != 88 ? (apv <= 94 ? 140U : 156U) : 76U) : 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2967); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2971); } else { } } memset((void *)(& p->verify_alg), 0, 128UL); tmp = drbd_recv(mdev, (void *)(& p->head.payload), (size_t )header_size); if ((unsigned int )tmp != header_size) { return (0); } else { } tmp___0 = __fswab32(p->rate); mdev->sync_conf.rate = (int )tmp___0; 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___1 = drbd_recv(mdev, (void *)(& p->verify_alg), (size_t )data_size); if ((unsigned int )tmp___1 != 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2996); } else { } p->verify_alg[data_size - 1U] = 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 3002); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 3003); } else { } p->verify_alg[63] = 0; p->csums_alg[63] = 0; } tmp___3 = strcmp((char const *)(& mdev->sync_conf.verify_alg), (char const *)(& p->verify_alg)); if (tmp___3 != 0) { if ((unsigned int )*((unsigned short *)mdev + 1006UL) == 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___2 = IS_ERR((void const *)verify_tfm); if (tmp___2 != 0L) { verify_tfm = 0; goto disconnect; } else { } } else { } if (apv > 88) { tmp___5 = strcmp((char const *)(& mdev->sync_conf.csums_alg), (char const *)(& p->csums_alg)); if (tmp___5 != 0) { if ((unsigned int )*((unsigned short *)mdev + 1006UL) == 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___4 = IS_ERR((void const *)csums_tfm); if (tmp___4 != 0L) { csums_tfm = 0; goto disconnect; } else { } } else { } } else { } if (apv > 94) { tmp___6 = __fswab32(p->rate); mdev->sync_conf.rate = (int )tmp___6; tmp___7 = __fswab32(p->c_plan_ahead); mdev->sync_conf.c_plan_ahead = (int )tmp___7; tmp___8 = __fswab32(p->c_delay_target); mdev->sync_conf.c_delay_target = (int )tmp___8; tmp___9 = __fswab32(p->c_fill_target); mdev->sync_conf.c_fill_target = (int )tmp___9; tmp___10 = __fswab32(p->c_max_rate); mdev->sync_conf.c_max_rate = (int )tmp___10; fifo_size = (mdev->sync_conf.c_plan_ahead * 250) / 250; if ((unsigned int )fifo_size != mdev->rs_plan_s.size && fifo_size > 0) { tmp___11 = kzalloc___0((unsigned long )fifo_size * 4UL, 208U); rs_plan_s = (int *)tmp___11; 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 { } 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___12 = strlen((char const *)(& p->verify_alg)); mdev->sync_conf.verify_alg_len = (int )((unsigned int )tmp___12 + 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___13 = strlen((char const *)(& p->csums_alg)); mdev->sync_conf.csums_alg_len = (int )((unsigned int )tmp___13 + 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_35533.conn = 1U; mask.i = 0U; mask.ldv_35533.conn = 31U; drbd_force_state(mdev, mask, val); return (0); } } static void drbd_setup_order_type(struct drbd_conf *mdev , int peer ) { { return; } } 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 || b == 0UL) { return; } else { } d = a > b ? a - b : b - a; if (a >> 3 < d || 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 ; unsigned int max_seg_s ; 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 ; union drbd_state val___0 ; union drbd_state mask___0 ; sector_t tmp___4 ; sector_t tmp___5 ; int tmp___6 ; __u16 tmp___7 ; int tmp___8 ; sector_t tmp___9 ; __u32 tmp___10 ; unsigned int tmp___11 ; __u16 tmp___12 ; int tmp___13 ; __u64 tmp___14 ; sector_t tmp___15 ; int tmp___16 ; { p = & mdev->data.rbuf.sizes; dd = 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 && (unsigned int )*((unsigned char *)mdev + 2013UL) == 0U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "some backing storage is needed\n"); val.i = 0U; val.ldv_35533.conn = 1U; mask.i = 0U; mask.ldv_35533.conn = 31U; drbd_force_state(mdev, mask, val); return (0); } else { } mdev->p_size = p_size; tmp___6 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___6 != 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 + 1006UL) == 144U) { __x = (unsigned long )(mdev->ldev)->dc.disk_size; __y = p_usize; if (__x != 0UL) { if (__y != 0UL) { _min1 = __x; _min2 = __y; tmp___2 = _min1 < _min2 ? _min1 : _min2; } else { tmp___2 = __x; } tmp___3 = tmp___2; } else { tmp___3 = __y; } p_usize = tmp___3; } 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___4 = drbd_new_dev_size(mdev, mdev->ldev, 0); tmp___5 = drbd_get_capacity(mdev->this_bdev); if ((tmp___4 < tmp___5 && (int )mdev->state.ldv_35533.disk > 4) && (int )mdev->state.ldv_35533.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_35533.conn = 1U; mask___0.i = 0U; mask___0.ldv_35533.conn = 31U; drbd_force_state(mdev, mask___0, val___0); (mdev->ldev)->dc.disk_size = (__u64 )my_usize; put_ldev(mdev); return (0); } else { } put_ldev(mdev); } else { } tmp___7 = __fswab16((int )p->dds_flags); ddsf = (enum dds_flags )tmp___7; tmp___8 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___8 != 0) { dd = drbd_determin_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___13 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___13 != 0) { tmp___9 = drbd_get_capacity((mdev->ldev)->backing_bdev); if ((mdev->ldev)->known_size != tmp___9) { (mdev->ldev)->known_size = drbd_get_capacity((mdev->ldev)->backing_bdev); ldsc = 1; } else { } if (mdev->agreed_pro_version <= 93) { tmp___10 = __fswab32(p->max_segment_size); max_seg_s = tmp___10; } else if (mdev->agreed_pro_version == 94) { max_seg_s = 32768U; } else { max_seg_s = 131072U; } tmp___11 = queue_max_segment_size(mdev->rq_queue); if (tmp___11 != max_seg_s) { drbd_setup_queue_param(mdev, max_seg_s); } else { } tmp___12 = __fswab16((int )p->queue_order_type); drbd_setup_order_type(mdev, (int )tmp___12); put_ldev(mdev); } else { } if ((int )mdev->state.ldv_35533.conn > 9) { tmp___14 = __fswab64(p->c_size); tmp___15 = drbd_get_capacity(mdev->this_bdev); if (tmp___14 != (unsigned long long )tmp___15 || ldsc != 0) { drbd_send_sizes(mdev, 0, ddsf); } else { } tmp___16 = test_and_clear_bit(24, (unsigned long volatile *)(& mdev->flags)); if (tmp___16 != 0 || ((int )dd == 2 && (unsigned int )*((unsigned short *)mdev + 1006UL) == 160U)) { if ((int )mdev->state.ldv_35533.pdsk > 3 && (int )mdev->state.ldv_35533.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 { } } 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 ; void *tmp ; __u64 tmp___0 ; union drbd_state val ; union drbd_state mask ; int skip_initial_sync ; union drbd_state __ns ; int tmp___1 ; int tmp___2 ; wait_queue_t __wait ; struct task_struct *tmp___3 ; int tmp___4 ; { p = & mdev->data.rbuf.uuids; tmp = kmalloc___1(48UL, 16U); p_uuid = (u64 *)tmp; i = 0; goto ldv_46188; ldv_46187: tmp___0 = __fswab64(p->uuid[i]); *(p_uuid + (unsigned long )i) = tmp___0; i = i + 1; ldv_46188: ; if (i <= 5) { goto ldv_46187; } else { } kfree((void const *)mdev->p_uuid); mdev->p_uuid = p_uuid; if ((((int )mdev->state.ldv_35533.conn <= 9 && (int )mdev->state.ldv_35533.disk <= 3) && (unsigned int )*((unsigned char *)mdev + 2012UL) == 1U) && ((mdev->ed_uuid ^ *p_uuid) & 0xfffffffffffffffeULL) != 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_35533.conn = 1U; mask.i = 0U; mask.ldv_35533.conn = 31U; drbd_force_state(mdev, mask, val); return (0); } else { } tmp___1 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___1 != 0) { skip_initial_sync = (((unsigned int )*((unsigned short *)mdev + 1006UL) == 160U && mdev->agreed_pro_version > 89) && (mdev->ldev)->md.uuid[0] == 4ULL) && (*(p_uuid + 5UL) & 8ULL) != 0ULL; 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"); _drbd_uuid_set(mdev, 0, *p_uuid); _drbd_uuid_set(mdev, 1, 0ULL); __ns.i = mdev->state.i; __ns.ldv_35533.disk = 8U; __ns.ldv_35533.pdsk = 8U; _drbd_set_state(mdev, __ns, CS_VERBOSE, 0); drbd_md_sync(mdev); } else { } put_ldev(mdev); } else if ((int )mdev->state.ldv_35533.disk <= 3 && (unsigned int )*((unsigned char *)mdev + 2012UL) == 1U) { drbd_set_ed_uuid(mdev, *p_uuid); } else { } tmp___2 = constant_test_bit(8U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___2 == 0) { goto ldv_46197; } 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_46200: prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___4 = constant_test_bit(8U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___4 == 0) { goto ldv_46199; } else { } schedule(); goto ldv_46200; ldv_46199: finish_wait(& mdev->misc_wait, & __wait); ldv_46197: ; if ((int )mdev->state.ldv_35533.conn > 9 && (int )mdev->state.ldv_35533.disk <= 3) { drbd_set_ed_uuid(mdev, *p_uuid); } 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] = 0; c_tab[1] = C_TEAR_DOWN; c_tab[2] = 0; c_tab[3] = 0; c_tab[4] = 0; c_tab[5] = 0; c_tab[6] = 0; c_tab[7] = 0; c_tab[8] = 0; c_tab[9] = 0; c_tab[10] = C_CONNECTED; c_tab[11] = C_STARTING_SYNC_T; c_tab[12] = C_STARTING_SYNC_S; c_tab[13] = 0; c_tab[14] = 0; c_tab[15] = 0; c_tab[16] = 0; c_tab[17] = 0; c_tab[18] = C_VERIFY_T; c_tab[19] = 0; c_tab[20] = 0; c_tab[21] = 0; c_tab[22] = 0; c_tab[23] = 0; c_tab[24] = 0; c_tab[25] = 0; c_tab[26] = 0; c_tab[27] = 0; c_tab[28] = 0; c_tab[29] = 0; c_tab[30] = 0; c_tab[31] = C_MASK; ms.i = ps.i; ms.ldv_35533.conn = (unsigned char )c_tab[(int )ps.ldv_35533.conn]; ms.ldv_35533.peer = ps.ldv_35533.role; ms.ldv_35533.role = ps.ldv_35533.peer; ms.ldv_35533.pdsk = ps.ldv_35533.disk; ms.ldv_35533.disk = ps.ldv_35533.pdsk; ms.ldv_35533.peer_isp = (unsigned char )((int )ps.ldv_35533.aftr_isp | (int )ps.ldv_35533.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 ; int 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, -19); return (1); } else { } } else { } mask = convert_state(mask); val = convert_state(val); rv = drbd_change_state(mdev, CS_VERBOSE, 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 ; enum drbd_conns tmp___3 ; union drbd_state val ; union drbd_state mask ; int tmp___4 ; union drbd_state val___0 ; union drbd_state mask___0 ; int tmp___5 ; union drbd_state val___1 ; union drbd_state mask___1 ; int tmp___6 ; int tmp___7 ; 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_35533.disk; if ((unsigned int )*((unsigned char *)(& peer_state) + 1UL) == 6U) { real_peer_disk = (*(mdev->p_uuid + 5UL) & 4ULL) != 0ULL ? D_INCONSISTENT : D_CONSISTENT; 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 && (unsigned int )real_peer_disk == 8U) && (int )os.ldv_35533.conn > 10) && (unsigned int )*((unsigned char *)(& os) + 1UL) == 16U) { if ((int )peer_state.ldv_35533.conn > 10 && (int )peer_state.ldv_35533.conn <= 15) { real_peer_disk = D_INCONSISTENT; } else if ((int )os.ldv_35533.conn > 15 && (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 { } if (((*((unsigned int *)(& os) + 0UL) == 65536U && (unsigned int )real_peer_disk == 4U) && (unsigned int )*((unsigned short *)(& os) + 0UL) == 160U) && (int )peer_state.ldv_35533.conn > 16) { real_peer_disk = D_UP_TO_DATE; } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 144U) { ns.ldv_35533.conn = 10U; } else { } if ((unsigned long )mdev->p_uuid != (unsigned long )((u64 *)0) && (int )peer_state.ldv_35533.disk > 2) { tmp___5 = _get_ldev_if_state(mdev, D_NEGOTIATING); if (tmp___5 != 0) { cr = (int )os.ldv_35533.conn <= 9; cr = ((unsigned int )*((unsigned short *)(& os) + 0UL) == 160U && ((unsigned int )*((unsigned char *)(& peer_state) + 1UL) == 6U || (unsigned int )*((unsigned char *)(& os) + 1UL) == 6U)) | cr; tmp___2 = constant_test_bit(14U, (unsigned long const volatile *)(& mdev->flags)); cr = tmp___2 | cr; cr = ((unsigned int )*((unsigned short *)(& os) + 0UL) == 160U && ((int )peer_state.ldv_35533.conn > 10 && (int )peer_state.ldv_35533.conn <= 14)) | cr; if (cr != 0) { tmp___3 = drbd_sync_handshake(mdev, (enum drbd_role )peer_state.ldv_35533.role, real_peer_disk); ns.ldv_35533.conn = (unsigned char )tmp___3; } else { } put_ldev(mdev); if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 496U) { ns.ldv_35533.conn = 10U; if ((unsigned int )*((unsigned char *)mdev + 2013UL) == 6U) { val.i = 0U; val.ldv_35533.disk = 0U; mask.i = 0U; mask.ldv_35533.disk = 15U; 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_35533.disk = 0U; real_peer_disk = D_DISKLESS; } else { tmp___4 = test_and_clear_bit(25, (unsigned long volatile *)(& mdev->flags)); if (tmp___4 != 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 3429); } else { } val___0.i = 0U; val___0.ldv_35533.conn = 1U; mask___0.i = 0U; mask___0.ldv_35533.conn = 31U; drbd_force_state(mdev, mask___0, val___0); return (0); } } else { } } else { } } else { } spin_lock_irq(& mdev->req_lock); if (mdev->state.i != os.i) { goto retry; } else { } clear_bit(14, (unsigned long volatile *)(& mdev->flags)); ns.ldv_35533.peer = peer_state.ldv_35533.role; ns.ldv_35533.pdsk = (unsigned char )real_peer_disk; ns.ldv_35533.peer_isp = (unsigned char )((int )peer_state.ldv_35533.aftr_isp | (int )peer_state.ldv_35533.user_isp); if (((unsigned int )*((unsigned short *)(& ns) + 0UL) == 160U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 208U) && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 6U) { ns.ldv_35533.disk = mdev->new_state_tmp.ldv_35533.disk; } else { } cs_flags = (enum chg_state_flags )(((int )os.ldv_35533.conn > 9 || (int )ns.ldv_35533.conn <= 9) + 2); if (*((unsigned int *)(& ns) + 0UL) == 57344U) { tmp___6 = is_susp(ns); if (tmp___6 != 0) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 160U) { if ((int )os.ldv_35533.conn <= 9) { tmp___7 = constant_test_bit(27U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___7 != 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_35533.conn = 6U; val___1.ldv_35533.susp = 0U; mask___1.i = 0U; mask___1.ldv_35533.conn = 31U; mask___1.ldv_35533.susp = 1U; drbd_force_state(mdev, mask___1, val___1); return (0); } else { } } else { } } else { } } else { } } else { } rv = _drbd_set_state(mdev, ns, cs_flags, 0); ns = mdev->state; spin_unlock_irq(& mdev->req_lock); if (rv <= 0) { val___2.i = 0U; val___2.ldv_35533.conn = 1U; mask___2.i = 0U; mask___2.ldv_35533.conn = 31U; drbd_force_state(mdev, mask___2, val___2); return (0); } else { } if ((int )os.ldv_35533.conn > 9) { if (((int )ns.ldv_35533.conn > 10 && (int )peer_state.ldv_35533.conn <= 10) && (unsigned int )*((unsigned char *)(& peer_state) + 1UL) != 6U) { drbd_send_uuids(mdev); drbd_send_state(mdev); } else { } } else { } (mdev->net_conf)->want_lose = 0U; 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 + 1006UL) == 240U || (int )mdev->state.ldv_35533.conn <= 9) || (int )mdev->state.ldv_35533.disk <= 2) { goto ldv_46251; } 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_46254: prepare_to_wait(& mdev->misc_wait, & __wait, 2); if (((unsigned int )*((unsigned short *)mdev + 1006UL) == 240U || (int )mdev->state.ldv_35533.conn <= 9) || (int )mdev->state.ldv_35533.disk <= 2) { goto ldv_46253; } else { } schedule(); goto ldv_46254; ldv_46253: finish_wait(& mdev->misc_wait, & __wait); ldv_46251: tmp___1 = _get_ldev_if_state(mdev, D_NEGOTIATING); if (tmp___1 != 0) { tmp___0 = __fswab64(p->uuid); _drbd_uuid_set(mdev, 0, tmp___0); _drbd_uuid_set(mdev, 1, 0ULL); drbd_start_resync(mdev, C_SYNC_TARGET); put_ldev(mdev); } else { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Ignoring SyncUUID packet!\n"); } return (1); } } static enum receive_bitmap_ret 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 ; unsigned int want ; int tmp ; { __min1 = 511UL; __min2 = c->bm_words - c->word_offset; num_words = (unsigned int )(__min1 < __min2 ? __min1 : __min2); 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 (FAILED); } else { } if (want == 0U) { return (DONE); } else { } tmp = drbd_recv(mdev, (void *)buffer, (size_t )want); if ((unsigned int )tmp != want) { return (FAILED); } 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 (OK); } } static enum receive_bitmap_ret 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((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 (FAILED); } else { } have = bits; goto ldv_46287; ldv_46286: bits = vli_decode_bits(& rl, look_ahead); if (bits <= 0) { return (FAILED); } 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 (FAILED); } else { } _drbd_bm_set_bits(mdev, s, 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 (FAILED); } else { } look_ahead = look_ahead >> bits; have = have - bits; bits = bitstream_get_bits(& bs, & tmp, 64 - have); if (bits < 0) { return (FAILED); } else { } look_ahead = (tmp << have) | look_ahead; have = have + bits; s = (unsigned long )((unsigned long long )s + rl); toggle = toggle == 0; ldv_46287: ; if (have > 0) { goto ldv_46286; } else { } c->bit_offset = s; bm_xfer_ctx_bit_to_word_offset(c); return (c->bm_bits == s); } } static enum receive_bitmap_ret decode_bitmap_c(struct drbd_conf *mdev , struct p_compressed_bm *p , struct bm_xfer_ctx *c ) { enum receive_bitmap_ret 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_35533.conn = 6U; mask.i = 0U; mask.ldv_35533.conn = 31U; drbd_force_state(mdev, mask, val); return (FAILED); } } 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 { } r = total > 4294967U ? total / (plain / 1000U) : (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 ; enum receive_bitmap_ret ret ; int ok ; struct p_header80 *h ; int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; unsigned long tmp___2 ; struct bm_xfer_ctx __constr_expr_0 ; unsigned long tmp___3 ; size_t tmp___4 ; struct p_compressed_bm *p ; size_t __len ; void *__ret ; int tmp___5 ; int tmp___6 ; int tmp___7 ; union drbd_state val ; union drbd_state mask ; char const *tmp___8 ; { ok = 0; h = & mdev->data.rbuf.header.h80; tmp = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); if (tmp == 0) { goto ldv_46316; } 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_46319: prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___1 = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); if (tmp___1 == 0) { goto ldv_46318; } else { } schedule(); goto ldv_46319; ldv_46318: finish_wait(& mdev->misc_wait, & __wait); ldv_46316: drbd_bm_lock(mdev, (char *)"receive bitmap"); tmp___2 = __get_free_pages(16U, 0U); buffer = (void *)tmp___2; 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___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_46328: ; if ((unsigned int )cmd == 4U) { ret = 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 = memcpy((void *)p, (void const *)h, __len); } tmp___5 = drbd_recv(mdev, (void *)(& p->head.payload), (size_t )data_size); if ((unsigned int )tmp___5 != 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); return (2); } else { } ret = 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 ((unsigned int )ret != 0U) { goto ldv_46327; } else { } tmp___6 = drbd_recv_header(mdev, & cmd, & data_size); if (tmp___6 == 0) { goto out; } else { } if ((unsigned int )ret == 0U) { goto ldv_46328; } else { } ldv_46327: ; if ((unsigned int )ret == 2U) { goto out; } else { } INFO_bm_xfer_stats(mdev, "receive", & c); if ((unsigned int )*((unsigned short *)mdev + 1006UL) == 224U) { tmp___7 = drbd_send_bitmap(mdev); ok = tmp___7 == 0; if (ok == 0) { goto out; } else { } val.i = 0U; val.ldv_35533.conn = 15U; mask.i = 0U; mask.ldv_35533.conn = 31U; ok = _drbd_request_state(mdev, mask, val, CS_VERBOSE); if (ok != 1) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( ok == SS_SUCCESS ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 3729); } else { } } else if ((unsigned int )*((unsigned short *)mdev + 1006UL) != 208U) { tmp___8 = drbd_conn_str((enum drbd_conns )mdev->state.ldv_35533.conn); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "unexpected cstate (%s) in receive_bitmap\n", tmp___8); } else { } ok = 1; out: drbd_bm_unlock(mdev); if (ok != 0 && (unsigned int )*((unsigned short *)mdev + 1006UL) == 208U) { drbd_start_resync(mdev, C_SYNC_SOURCE); } 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 _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_46350; ldv_46349: __min1 = size; __min2 = 128; want = __min1 < __min2 ? __min1 : __min2; r = drbd_recv(mdev, (void *)(& sink), (size_t )want); _b = r <= 0; if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "receive_skip", (char *)"r <= 0", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 3759); } else { } if (_b != 0) { goto ldv_46348; } else { } size = size - r; ldv_46350: ; if (size > 0) { goto ldv_46349; } else { } ldv_46348: ; return (size == 0); } } static int receive_UnplugRemote(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { { if ((int )mdev->state.ldv_35533.disk > 3) { drbd_kick_lo(mdev); } else { } drbd_tcp_quickack(mdev->data.socket); return (1); } } static struct data_cmd drbd_cmd_handler[41U] = { {1, 32UL, & receive_Data}, {1, 32UL, & receive_DataReply}, {1, 32UL, & receive_RSDataReply}, {0, 16UL, & receive_Barrier}, {1, 8UL, & receive_bitmap}, {0, 0UL, 0}, {0, 0UL, 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, 0}, {0, 0UL, 0}, {0, 16UL, & receive_req_state}, {0, 0UL, 0}, {0, 0UL, 0}, {0, 0UL, 0}, {0, 0UL, 0}, {0, 0UL, 0}, {0, 0UL, 0}, {0, 0UL, 0}, {0, 0UL, 0}, {0, 0UL, 0}, {0, 0UL, 0}, {0, 0UL, 0}, {0, 32UL, & receive_DataRequest}, {1, 32UL, & receive_DataRequest}, {0, 0UL, 0}, {1, 32UL, & receive_DataRequest}, {0, 0UL, 0}, {1, 8UL, & receive_SyncParam}, {1, 8UL, & receive_bitmap}, {0, 0UL, 0}, {0, 0UL, 0}, {0, 16UL, & receive_skip}, {0, 0UL, 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 ; long tmp___2 ; char const *tmp___3 ; char const *tmp___4 ; long tmp___5 ; enum drbd_thread_state tmp___6 ; union drbd_state val ; union drbd_state mask ; { header = & mdev->data.rbuf.header; goto ldv_46375; ldv_46374: drbd_thread_current_set_cpu(mdev); tmp = drbd_recv_header(mdev, & cmd, & packet_size); if (tmp == 0) { goto err_out; } else { } tmp___0 = ldv__builtin_expect((unsigned int )cmd > 39U, 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 = ldv__builtin_expect((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; rv = drbd_recv(mdev, (void *)(& header->h80.payload), shs); tmp___2 = ldv__builtin_expect((size_t )rv != shs, 0L); if (tmp___2 != 0L) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read while reading sub header: rv=%d\n", rv); goto err_out; } else { } if ((size_t )packet_size != shs && drbd_cmd_handler[(unsigned int )cmd].expect_payload == 0) { tmp___3 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "No payload expected %s l:%d\n", tmp___3, packet_size); goto err_out; } else { } rv = (*(drbd_cmd_handler[(unsigned int )cmd].function))(mdev, cmd, packet_size - (unsigned int )shs); tmp___5 = ldv__builtin_expect(rv == 0, 0L); if (tmp___5 != 0L) { tmp___4 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "error receiving %s, l: %d!\n", tmp___4, packet_size); goto err_out; } else { } ldv_46375: tmp___6 = get_t_state(& mdev->receiver); if ((unsigned int )tmp___6 == 1U) { goto ldv_46374; } else { } if (0) { err_out: val.i = 0U; val.ldv_35533.conn = 6U; mask.i = 0U; mask.ldv_35533.conn = 31U; 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) || (unsigned int )*((unsigned short *)mdev + 1006UL) != 0U) { spin_unlock_irq(& mdev->req_lock); return; } else { } h = mdev->ee_hash; goto ldv_46390; ldv_46389: ; 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_46390: ; if ((unsigned long )(mdev->ee_hash + (unsigned long )mdev->ee_hash_s) > (unsigned long )h) { goto ldv_46389; } else { } kfree((void const *)mdev->ee_hash); mdev->ee_hash = 0; mdev->ee_hash_s = 0U; h = mdev->tl_hash; goto ldv_46393; ldv_46392: ; 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_46393: ; if ((unsigned long )(mdev->tl_hash + (unsigned long )mdev->tl_hash_s) > (unsigned long )h) { goto ldv_46392; } else { } kfree((void const *)mdev->tl_hash); mdev->tl_hash = 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 ; char const *tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; wait_queue_t __wait ; struct task_struct *tmp___3 ; int tmp___4 ; int tmp___5 ; wait_queue_t __wait___0 ; struct task_struct *tmp___6 ; int tmp___7 ; int tmp___8 ; union drbd_state val ; union drbd_state mask ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; { rv = 0; if ((unsigned int )*((unsigned short *)mdev + 1006UL) == 0U) { return; } else { } if ((int )mdev->state.ldv_35533.conn > 7) { tmp = drbd_conn_str((enum drbd_conns )mdev->state.ldv_35533.conn); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED cstate = %s, expected < WFConnection\n", tmp); } 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, 0); 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 = 0; tmp___0 = is_susp(mdev->state); if (tmp___0 == 0) { tl_clear(mdev); } else { } _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Connection closed\n"); drbd_md_sync(mdev); fp = FP_DONT_CARE; tmp___1 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___1 != 0) { fp = (enum drbd_fencing_p )(mdev->ldev)->dc.fencing; put_ldev(mdev); } else { } if (((unsigned int )*((unsigned char *)mdev + 2012UL) == 1U && (unsigned int )fp != 0U) && (int )mdev->state.ldv_35533.pdsk > 5) { drbd_try_outdate_peer_async(mdev); } else { } spin_lock_irq(& mdev->req_lock); os = mdev->state; if ((int )os.ldv_35533.conn > 1) { ns = os; ns.ldv_35533.conn = 2U; rv = _drbd_set_state(mdev, ns, CS_VERBOSE, 0); } 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_46403; } 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_46406: 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_46405; } else { } schedule(); goto ldv_46406; ldv_46405: finish_wait(& mdev->net_cnt_wait, & __wait); ldv_46403: tmp___8 = is_susp(mdev->state); if (tmp___8 == 0) { tmp___5 = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); if (tmp___5 == 0) { goto ldv_46407; } 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_46410: prepare_to_wait(& mdev->misc_wait, & __wait___0, 2); tmp___7 = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); if (tmp___7 == 0) { goto ldv_46409; } else { } schedule(); goto ldv_46410; ldv_46409: finish_wait(& mdev->misc_wait, & __wait___0); ldv_46407: drbd_free_tl_hash(mdev); } else { } crypto_free_hash(mdev->cram_hmac_tfm); mdev->cram_hmac_tfm = 0; kfree((void const *)mdev->net_conf); mdev->net_conf = 0; val.i = 0U; val.ldv_35533.conn = 0U; mask.i = 0U; mask.ldv_35533.conn = 31U; drbd_request_state(mdev, mask, val); } else { } tmp___9 = drbd_release_ee(mdev, & mdev->net_ee); i = (unsigned int )tmp___9; if (i != 0U) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "net_ee not empty, killed %u entries\n", i); } else { } tmp___10 = atomic_read((atomic_t const *)(& mdev->pp_in_use_by_net)); i = (unsigned int )tmp___10; if (i != 0U) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "pp_in_use_by_net = %d, expected 0\n", i); } else { } tmp___11 = atomic_read((atomic_t const *)(& mdev->pp_in_use)); i = (unsigned int )tmp___11; if (i != 0U) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "pp_in_use = %d, expected 0\n", i); } else { } tmp___12 = list_empty((struct list_head const *)(& mdev->read_ee)); if (tmp___12 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->read_ee) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4024); } else { } tmp___13 = list_empty((struct list_head const *)(& mdev->active_ee)); if (tmp___13 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->active_ee) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4025); } else { } tmp___14 = list_empty((struct list_head const *)(& mdev->sync_ee)); if (tmp___14 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->sync_ee) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4026); } else { } tmp___15 = list_empty((struct list_head const *)(& mdev->done_ee)); if (tmp___15 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->done_ee) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4027); } else { } atomic_set(& (mdev->current_epoch)->epoch_size, 0); tmp___16 = list_empty((struct list_head const *)(& (mdev->current_epoch)->list)); if (tmp___16 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->current_epoch->list) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4031); } 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 = ldv_mutex_lock_interruptible_69(& mdev->data.mutex); 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)) { ldv_mutex_unlock_70(& mdev->data.mutex); return (0); } else { } memset((void *)p, 0, 80UL); p->protocol_min = 1442840576U; p->protocol_max = 1593835520U; ok = _drbd_send_cmd(mdev, mdev->data.socket, P_HAND_SHAKE, (struct p_header80 *)p, 80UL, 0U); ldv_mutex_unlock_71(& 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 ; __u32 tmp___0 ; __u32 tmp___1 ; int __min1 ; int __min2 ; { 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) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving handshake packet: l=%u\n", rv); return (0); } else { } tmp___0 = __fswab32(p->protocol_min); p->protocol_min = tmp___0; tmp___1 = __fswab32(p->protocol_max); p->protocol_max = tmp___1; if (p->protocol_max == 0U) { p->protocol_max = p->protocol_min; } else { } if (p->protocol_min > 95U || p->protocol_max <= 85U) { goto incompat; } else { } __min1 = 95; __min2 = (int )p->protocol_max; mdev->agreed_pro_version = __min1 < __min2 ? __min1 : __min2; _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, 95, 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 ; void *tmp___2 ; char const *tmp___3 ; void *tmp___4 ; int tmp___5 ; { response = 0; right_response = 0; peers_ch = 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, P_AUTH_CHALLENGE, (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___1((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) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read AuthChallenge: l=%u\n", rv); rv = 0; goto fail; } else { } resp_size = crypto_hash_digestsize(mdev->cram_hmac_tfm); tmp___2 = kmalloc___1((size_t )resp_size, 16U); response = (char *)tmp___2; 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, P_AUTH_RESPONSE, 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___3 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "expected AuthResponse packet, received: %s (0x%04x)\n", tmp___3, (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) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving AuthResponse: l=%u\n", rv); rv = 0; goto fail; } else { } tmp___4 = kmalloc___1((size_t )resp_size, 16U); right_response = (char *)tmp___4; 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___5 = memcmp((void const *)response, (void const *)right_response, (size_t )resp_size); rv = tmp___5 == 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 ; struct task_struct *tmp___1 ; union drbd_state val ; union drbd_state mask ; int tmp___2 ; { 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_46457: h = drbd_connect(mdev); if (h == 0) { drbd_disconnect(mdev); tmp___1 = get_current(); tmp___1->state = 1L; schedule_timeout(250L); } else { } if (h == -1) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Discarding network configuration.\n"); val.i = 0U; val.ldv_35533.conn = 1U; mask.i = 0U; mask.ldv_35533.conn = 31U; drbd_force_state(mdev, mask, val); } else { } if (h == 0) { goto ldv_46457; } else { } if (h > 0) { tmp___2 = get_net_conf(mdev); if (tmp___2 != 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_ret_codes )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, 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, 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4372); } else { } tmp___1 = __fswab32(p->seq_num); update_peer_seq(mdev, tmp___1); tmp___2 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___2 != 0) { drbd_rs_complete_io(mdev, sector); __drbd_set_in_sync(mdev, sector, blksize, "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4378U); 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", 4383, 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_46498; ldv_46497: ; 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_46496; } else { } return (req); } else { } n = n->next; ldv_46498: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __builtin_prefetch((void const *)n->next); if (1 != 0) { __mptr = (struct hlist_node const *)n; req = (struct drbd_request *)__mptr + 0xffffffffffffffd8UL; if (1 != 0) { goto ldv_46497; } else { goto ldv_46496; } } else { goto ldv_46496; } } else { } ldv_46496: dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "_ack_id_to_req: failed to find req %p, sector %llus in list\n", (void *)id, (unsigned long long )sector); return (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 = ldv__builtin_expect((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: got a corrupt block_id/sector pair\n", func); 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 == 0xffffffffffffffffULL) { __drbd_set_in_sync(mdev, sector, blksize, "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4450U); 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", 4451, tmp___2); } else { } return (1); } else { } tmp___4 = __fswab16((int )h->command); switch ((int )tmp___4) { 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4456); } else { } what = write_acked_by_peer_and_sis; goto ldv_46526; 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4460); } else { } what = write_acked_by_peer; goto ldv_46526; 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4464); } else { } what = recv_acked_by_peer; goto ldv_46526; 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4468); } else { } what = conflict_discarded_by_peer; goto ldv_46526; default: dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( 0 ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4472); return (0); } ldv_46526: 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 tmp___0 ; __u32 tmp___1 ; int size ; __u32 tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { p = (struct p_block_ack *)h; tmp = __fswab64(p->sector); sector = (sector_t )tmp; tmp___0 = ___ratelimit(& drbd_ratelimit_state, "got_NegAck"); if (tmp___0 != 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Got NegAck packet. Peer is in troubles?\n"); } else { } tmp___1 = __fswab32(p->seq_num); update_peer_seq(mdev, tmp___1); if (p->block_id == 0xffffffffffffffffULL) { tmp___2 = __fswab32(p->blksize); size = (int )tmp___2; 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_NegAck", 4492, tmp___3); } else { } drbd_rs_failed_io(mdev, sector, size); return (1); } else { } tmp___5 = validate_req_change_req_state(mdev, p->block_id, sector, & _ack_id_to_req, "got_NegAck", neg_acked); return (tmp___5); } } 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", neg_acked); 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 ; int tmp___4 ; { 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", 4524, tmp___2); } else { } tmp___4 = _get_ldev_if_state(mdev, D_FAILED); if (tmp___4 != 0) { drbd_rs_complete_io(mdev, sector); drbd_rs_failed_io(mdev, sector, size); 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 ; { p = (struct p_barrier_ack *)h; tmp = __fswab32(p->set_size); tl_release(mdev, p->barrier, tmp); 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, D_INCONSISTENT); 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", 4565, tmp___4); } else { } mdev->ov_left = mdev->ov_left - 1UL; if (mdev->ov_left == 0UL) { tmp___6 = kmalloc___1(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[41U] ; { asender_tbl[0].pkt_size = 0UL; asender_tbl[0].process = 0; asender_tbl[1].pkt_size = 0UL; asender_tbl[1].process = 0; asender_tbl[2].pkt_size = 0UL; asender_tbl[2].process = 0; asender_tbl[3].pkt_size = 0UL; asender_tbl[3].process = 0; asender_tbl[4].pkt_size = 0UL; asender_tbl[4].process = 0; asender_tbl[5].pkt_size = 0UL; asender_tbl[5].process = 0; asender_tbl[6].pkt_size = 0UL; asender_tbl[6].process = 0; asender_tbl[7].pkt_size = 0UL; asender_tbl[7].process = 0; asender_tbl[8].pkt_size = 0UL; asender_tbl[8].process = 0; asender_tbl[9].pkt_size = 0UL; asender_tbl[9].process = 0; asender_tbl[10].pkt_size = 0UL; asender_tbl[10].process = 0; asender_tbl[11].pkt_size = 0UL; asender_tbl[11].process = 0; asender_tbl[12].pkt_size = 0UL; asender_tbl[12].process = 0; asender_tbl[13].pkt_size = 0UL; asender_tbl[13].process = 0; asender_tbl[14].pkt_size = 0UL; asender_tbl[14].process = 0; asender_tbl[15].pkt_size = 0UL; asender_tbl[15].process = 0; asender_tbl[16].pkt_size = 0UL; asender_tbl[16].process = 0; asender_tbl[17].pkt_size = 0UL; asender_tbl[17].process = 0; asender_tbl[18].pkt_size = 0UL; asender_tbl[18].process = 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 = 0; asender_tbl[31].pkt_size = 0UL; asender_tbl[31].process = 0; asender_tbl[32].pkt_size = 32UL; asender_tbl[32].process = & got_OVResult; asender_tbl[33].pkt_size = 0UL; asender_tbl[33].process = 0; asender_tbl[34].pkt_size = 32UL; asender_tbl[34].process = & got_IsInSync; asender_tbl[35].pkt_size = 0UL; asender_tbl[35].process = 0; asender_tbl[36].pkt_size = 0UL; asender_tbl[36].process = 0; asender_tbl[37].pkt_size = 0UL; asender_tbl[37].process = 0; asender_tbl[38].pkt_size = 0UL; asender_tbl[38].process = 0; asender_tbl[39].pkt_size = 16UL; asender_tbl[39].process = & got_skip; asender_tbl[40].pkt_size = 0UL; asender_tbl[40].process = 0; if (cmd > 40 || (unsigned long )asender_tbl[cmd].process == (unsigned long )((int (*)(struct drbd_conf * , struct p_header80 * ))0)) { return (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 ; 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 ; enum drbd_thread_state tmp___23 ; 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 = 0; buf = (void *)h; received = 0; expect = 8; 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_46608; ldv_46612: 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), "%s: (%s) in %s:%d\n", "drbd_asender", (char *)"!drbd_send_ping(mdev)", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4639); } else { } if (_b != 0) { goto reconnect; } else { } ((mdev->meta.socket)->sk)->sk_rcvtimeo = (long )(((mdev->net_conf)->ping_timeo * 250) / 10); } else { } if ((unsigned int )*((unsigned char *)mdev->net_conf + 528UL) == 0U) { tmp___5 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); if (tmp___5 > 3) { drbd_tcp_cork(mdev->meta.socket); } else { } } else { } ldv_46607: 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_46606; } else { } goto ldv_46607; ldv_46606: ; if ((unsigned int )*((unsigned char *)mdev->net_conf + 528UL) == 0U) { drbd_tcp_uncork(mdev->meta.socket); } else { } tmp___8 = get_current(); tmp___9 = signal_pending(tmp___8); if (tmp___9 != 0) { goto ldv_46608; } 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 = ldv__builtin_expect(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 (((mdev->meta.socket)->sk)->sk_rcvtimeo == (long )(((mdev->net_conf)->ping_timeo * 250) / 10)) { 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_46608; } else if (rv == -4) { goto ldv_46608; } else { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "sock_recvmsg returned %d\n", rv); goto reconnect; } if (received == expect && (unsigned long )cmd == (unsigned long )((struct asender_cmd *)0)) { tmp___15 = ldv__builtin_expect(h->magic != 1728214147U, 0L); if (tmp___15 != 0L) { tmp___12 = __fswab16((int )h->length); tmp___13 = __fswab16((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((int )h->command); cmd = get_asender_cmd((int )tmp___16); tmp___17 = __fswab16((int )h->length); len = (int )tmp___17; tmp___21 = ldv__builtin_expect((unsigned long )cmd == (unsigned long )((struct asender_cmd *)0), 0L); if (tmp___21 != 0L) { tmp___18 = __fswab16((int )h->length); tmp___19 = __fswab16((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), "%s: (%s) in %s:%d\n", "drbd_asender", (char *)"len != expect-sizeof(struct p_header80)", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4728); } else { } if (_b___0 != 0) { goto reconnect; } else { } } else { } if (received == expect) { 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4732); } else { } tmp___22 = (*(cmd->process))(mdev, h); if (tmp___22 == 0) { goto reconnect; } else { } buf = (void *)h; received = 0; expect = 8; cmd = 0; } else { } ldv_46608: tmp___23 = get_t_state(thi); if ((unsigned int )tmp___23 == 1U) { goto ldv_46612; } else { } if (0) { reconnect: val.i = 0U; val.ldv_35533.conn = 5U; mask.i = 0U; mask.ldv_35533.conn = 31U; drbd_force_state(mdev, mask, val); drbd_md_sync(mdev); } else { } if (0) { disconnect: val___0.i = 0U; val___0.ldv_35533.conn = 1U; mask___0.i = 0U; mask___0.ldv_35533.conn = 31U; 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_35533.conn > 9) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.conn < C_CONNECTED ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4755); } else { } _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "asender terminated\n"); return (0); } } void ldv_main3_sequence_infinite_withcheck_stateful(void) { int tmp ; int tmp___0 ; { LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_46641; ldv_46640: tmp = nondet_int(); switch (tmp) { default: ; goto ldv_46639; } ldv_46639: ; ldv_46641: tmp___0 = nondet_int(); if (tmp___0 != 0) { goto ldv_46640; } else { } ldv_check_final_state(); return; } } void ldv_mutex_lock_63(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_64(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_65(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_66(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_67(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_68(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_lock_interruptible_69(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___5 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_lock_interruptible(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_lock_interruptible_mutex_of_drbd_socket(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_70(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_71(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static void hlist_del(struct hlist_node *n ) { { __hlist_del(n); n->next = 0xdead000000100100UL; n->pprev = 0xdead000000200200UL; 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 ) ; int ldv_mutex_trylock_82(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_83(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_85(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_86(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_81(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_84(struct mutex *ldv_func_arg1 ) ; extern int del_timer(struct timer_list * ) ; extern int cpu_number ; extern struct lockdep_map rcu_lock_map ; __inline static void rcu_read_lock(void) { { rcu_read_lock_sched_notrace(); lock_acquire(& rcu_lock_map, 0U, 0, 2, 1, 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_sched_notrace(); return; } } __inline static void trace_kmalloc___2(unsigned long call_site , void const *ptr , size_t bytes_req , size_t bytes_alloc , gfp_t gfp_flags ) { long tmp ; struct tracepoint_func *it_func_ptr ; void *it_func ; void *__data ; struct tracepoint_func *_________p1 ; bool __warned ; int tmp___0 ; int tmp___1 ; { tmp = ldv__builtin_expect(__tracepoint_kmalloc.state != 0, 0L); if (tmp != 0L) { goto do_trace; } else { } return; do_trace: rcu_read_lock_sched_notrace(); _________p1 = *((struct tracepoint_func * volatile *)(& __tracepoint_kmalloc.funcs)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { tmp___1 = rcu_read_lock_sched_held(); if (tmp___1 == 0 && 1) { __warned = 1; lockdep_rcu_dereference("include/trace/events/kmem.h", 51); } else { } } else { } it_func_ptr = _________p1; if ((unsigned long )it_func_ptr != (unsigned long )((struct tracepoint_func *)0)) { ldv_11941: it_func = it_func_ptr->func; __data = it_func_ptr->data; (*((void (*)(void * , unsigned long , void const * , size_t , size_t , gfp_t ))it_func))(__data, call_site, ptr, bytes_req, bytes_alloc, gfp_flags); it_func_ptr = it_func_ptr + 1; if ((unsigned long )it_func_ptr->func != (unsigned long )((void *)0)) { goto ldv_11941; } else { } } else { } rcu_read_lock_sched_notrace(); return; } } __inline static void *kmalloc_large___2(size_t size , gfp_t flags ) { unsigned int order ; int tmp ; void *ret ; unsigned long tmp___0 ; { tmp = get_order(size); order = (unsigned int )tmp; tmp___0 = __get_free_pages(flags | 16384U, order); ret = (void *)tmp___0; kmemleak_alloc((void const *)ret, size, 1, flags); trace_kmalloc___2((unsigned long )((void *)0), (void const *)ret, size, 4096UL << (int )order, flags); return (ret); } } __inline static void *kmalloc___2(size_t size , gfp_t flags ) { void *ret ; void *tmp ; struct kmem_cache *s ; struct kmem_cache *tmp___0 ; void *tmp___1 ; { if (0) { if (size > 8192UL) { tmp = kmalloc_large___2(size, flags); return (tmp); } else { } if ((flags & 1U) == 0U) { tmp___0 = kmalloc_slab(size); s = tmp___0; if ((unsigned long )s == (unsigned long )((struct kmem_cache *)0)) { return (16); } else { } ret = kmem_cache_alloc_notrace(s, flags); trace_kmalloc___2((unsigned long )((void *)0), (void const *)ret, size, (size_t )s->size, flags); return (ret); } else { } } else { } tmp___1 = __kmalloc(size, flags); return (tmp___1); } } __inline static struct gendisk *part_to_disk(struct hd_struct *part ) { struct device const *__mptr ; struct device const *__mptr___0 ; long tmp ; { tmp = ldv__builtin_expect((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 + 0xffffffffffffffa0UL); } else { __mptr___0 = (struct device const *)(& part->__dev); return ((struct gendisk *)__mptr___0 + 0xffffffffffffffa0UL); } } else { } return (0); } } __inline static void part_inc_in_flight(struct hd_struct *part , int rw ) { struct gendisk *tmp ; { part->in_flight[rw] = part->in_flight[rw] + 1; if (part->partno != 0) { tmp = part_to_disk(part); tmp->part0.in_flight[rw] = tmp->part0.in_flight[rw] + 1; } else { } return; } } __inline static void part_dec_in_flight(struct hd_struct *part , int rw ) { struct gendisk *tmp ; { part->in_flight[rw] = part->in_flight[rw] - 1; if (part->partno != 0) { tmp = part_to_disk(part); tmp->part0.in_flight[rw] = tmp->part0.in_flight[rw] - 1; } 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 * ) ; extern void blk_plug_device(struct request_queue * ) ; 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_26(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 __drbd_chk_io_error____1(struct drbd_conf *mdev , int forcedetach , char const *where ) { int tmp ; union drbd_state __ns ; { switch ((mdev->ldev)->dc.on_io_error) { 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.Passing error on...\n", where); } else { } goto ldv_43958; } else { } case 2: ; case 1: ; if ((int )mdev->state.ldv_35533.disk > 2) { __ns.i = mdev->state.i; __ns.ldv_35533.disk = 2U; _drbd_set_state(mdev, __ns, CS_HARD, 0); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s.Detaching...\n", where); } else { } goto ldv_43958; } ldv_43958: ; return; } } __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(union drbd_state s ) { { switch ((unsigned int )s.ldv_35533.conn) { case 0U: ; case 8U: ; case 10U: ; case 16U: ; case 17U: ; case 18U: ; case 19U: ; case 20U: ; case 21U: ; goto ldv_44114; case 1U: ; case 2U: ; case 3U: ; case 4U: ; case 5U: ; case 6U: ; case 7U: ; case 9U: ; case 11U: ; case 12U: ; case 13U: ; case 14U: ; case 15U: ; case 31U: ; return (0); } ldv_44114: ; switch ((unsigned int )s.ldv_35533.disk) { case 0U: ; case 4U: ; case 5U: ; case 7U: ; case 8U: ; goto ldv_44134; case 1U: ; case 2U: ; case 3U: ; case 6U: ; case 15U: ; return (0); } ldv_44134: ; return (1); } } __inline static int __inc_ap_bio_cond(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 (0); } else { } tmp___1 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___1 != 0) { return (0); } else { } tmp___2 = drbd_state_is_stable(mdev->state); if (tmp___2 == 0) { return (0); } else { } tmp___3 = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); if (tmp___3 > mxb) { return (0); } else { } tmp___4 = constant_test_bit(17U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___4 != 0) { return (0); } else { } return (1); } } __inline static void inc_ap_bio(struct drbd_conf *mdev , int count ) { 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; spin_lock_irq(& mdev->req_lock); goto ldv_44153; ldv_44152: prepare_to_wait(& mdev->misc_wait, & wait, 2); spin_unlock_irq(& mdev->req_lock); schedule(); finish_wait(& mdev->misc_wait, & wait); spin_lock_irq(& mdev->req_lock); ldv_44153: tmp___0 = __inc_ap_bio_cond(mdev); if (tmp___0 == 0) { goto ldv_44152; } else { } atomic_add(count, & mdev->ap_bio_cnt); spin_unlock_irq(& mdev->req_lock); 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 *)"/work/ldvuser/novikov/inst/current/envs/linux/linux/drivers/block/drbd/drbd_int.h", 2330); } else { } if (ap_bio < mxb) { __wake_up(& mdev->misc_wait, 3U, 1, 0); } else { } if (ap_bio == 0) { tmp___2 = constant_test_bit(17U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___2 != 0) { tmp___1 = test_and_set_bit(18, (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 void drbd_plug_device(struct drbd_conf *mdev ) { struct request_queue *q ; int tmp ; { q = bdev_get_queue(mdev->this_bdev); spin_lock_irq(q->queue_lock); tmp = constant_test_bit(7U, (unsigned long const volatile *)(& q->queue_flags)); if (tmp == 0) { blk_plug_device(q); del_timer(& q->unplug_timer); } else { } spin_unlock_irq(q->queue_lock); return; } } __inline static struct hlist_head *ee_hash_slot___0(struct drbd_conf *mdev , sector_t sector ) { long tmp ; { tmp = ldv__builtin_expect(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 *)"/work/ldvuser/novikov/inst/current/envs/linux/linux/drivers/block/drbd/drbd_req.h"), "i" (227), "i" (12UL)); ldv_44265: ; goto ldv_44265; } 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 = ldv__builtin_expect(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 *)"/work/ldvuser/novikov/inst/current/envs/linux/linux/drivers/block/drbd/drbd_req.h"), "i" (236), "i" (12UL)); ldv_44270: ; goto ldv_44270; } 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 = ldv__builtin_expect((unsigned long )req != (unsigned long )((struct drbd_request *)0), 1L); if (tmp___0 != 0L) { drbd_req_make_private_bio(req, bio_src); req->rq_state = (int )bio_src->bi_rw & 1 ? 1024UL : 0UL; req->mdev = mdev; req->master_bio = bio_src; req->epoch = 0U; req->sector = bio_src->bi_sector; req->size = bio_src->bi_size; req->start_time = jiffies; INIT_HLIST_NODE(& req->colision); 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 ) ; 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 const )bio->bi_rw & (int const )1; rcu_read_lock(); switch (4UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "m" (cpu_number)); goto ldv_44345; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_44345; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_44345; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_44345; default: __bad_percpu_size(); } ldv_44345: cpu = pfo_ret__; __vpp_verify = 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 = 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 = 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 = 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(); switch (4UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "m" (cpu_number)); goto ldv_44378; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_44378; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_44378; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_44378; default: __bad_percpu_size(); } ldv_44378: cpu = pfo_ret__; __vpp_verify = 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 = 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 || (s & 4UL) == 0UL) { __drbd_set_out_of_sync(mdev, req->sector, (int )req->size, "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 135U); } else { } if (((s & 128UL) != 0UL && (s & 4UL) != 0UL) && (s & 256UL) != 0UL) { __drbd_set_in_sync(mdev, req->sector, (int )req->size, "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 138U); } else { } if ((s & 7UL) != 0UL) { tmp___0 = _get_ldev_if_state(mdev, D_FAILED); 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_35533.conn > 9 && req->epoch == (mdev->newest_tle)->br_number) { queue_barrier(mdev); } else { } if ((s & 64UL) != 0UL && (unsigned long )mdev->ee_hash != (unsigned long )((struct hlist_head *)0)) { sector = req->sector; size = (int const )req->size; slot = tl_hash_slot___0(mdev, sector); n = slot->first; goto ldv_44421; ldv_44420: 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_44421: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __builtin_prefetch((void const *)n->next); if (1 != 0) { __mptr = (struct hlist_node const *)n; i = (struct drbd_request *)__mptr + 0xffffffffffffffd8UL; if (1 != 0) { goto ldv_44420; } else { goto ldv_44422; } } else { goto ldv_44422; } } else { } ldv_44422: slot = ee_hash_slot___0(mdev, req->sector); n = slot->first; goto ldv_44429; ldv_44428: tmp___0 = overlaps(sector, size, e->sector, (int )e->size); if (tmp___0 != 0) { __wake_up(& mdev->misc_wait, 3U, 1, 0); goto ldv_44427; } else { } n = n->next; ldv_44429: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __builtin_prefetch((void const *)n->next); if (1 != 0) { __mptr___0 = (struct hlist_node const *)n; e = (struct drbd_epoch_entry *)__mptr___0 + 0xffffffffffffffe8UL; if (1 != 0) { goto ldv_44428; } else { goto ldv_44427; } } else { goto ldv_44427; } } else { } ldv_44427: ; } 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 ok ; int error ; long tmp ; int tmp___0 ; { s = req->rq_state; mdev = req->mdev; rw = (unsigned long )req->master_bio != (unsigned long )((struct bio *)0) ? (int )(req->master_bio)->bi_rw & 1 : 1; 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)) { ok = (s & 4UL) != 0UL || (s & 128UL) != 0UL; tmp = PTR_ERR((void const *)req->private_bio); error = (int )tmp; tmp___0 = hlist_unhashed((struct hlist_node const *)(& req->colision)); if (tmp___0 == 0) { hlist_del(& req->colision); } else if ((s & 504UL) != 0UL) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( (s & RQ_NET_MASK) == 0 ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 316); } else { } if (rw == 1) { _about_to_complete_local_write(mdev, req); } else { } _drbd_end_io_acct(mdev, req); m->error = ok == 0 ? (error != 0 ? error : -5) : 0; m->bio = req->master_bio; req->master_bio = 0; } else { } if ((s & 504UL) == 0UL || (s & 64UL) != 0UL) { _req_is_done(mdev, req, 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 const )req->size; tmp = hlist_unhashed((struct hlist_node const *)(& req->colision)); if (tmp == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( hlist_unhashed(&req->colision) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 382); } 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), "%s: (%s) in %s:%d\n", "_req_conflicts", (char *)"mdev->tl_hash_s == 0", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 388); } else { } if (_b != 0) { goto out_no_conflict; } else { } tmp___1 = ldv__builtin_expect((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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared"), "i" (390), "i" (12UL)); ldv_44462: ; goto ldv_44462; } else { } slot = tl_hash_slot___0(mdev, sector); n = slot->first; goto ldv_44469; ldv_44468: 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_44469: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __builtin_prefetch((void const *)n->next); if (1 != 0) { __mptr = (struct hlist_node const *)n; i = (struct drbd_request *)__mptr + 0xffffffffffffffd8UL; if (1 != 0) { goto ldv_44468; } else { goto ldv_44470; } } else { goto ldv_44470; } } else { } ldv_44470: ; if (mdev->ee_hash_s != 0U) { tmp___5 = ldv__builtin_expect((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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared"), "i" (408), "i" (12UL)); ldv_44471: ; goto ldv_44471; } else { } slot = ee_hash_slot___0(mdev, sector); n = slot->first; goto ldv_44477; ldv_44476: 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_44477: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __builtin_prefetch((void const *)n->next); if (1 != 0) { __mptr___0 = (struct hlist_node const *)n; e = (struct drbd_epoch_entry *)__mptr___0 + 0xffffffffffffffe8UL; if (1 != 0) { goto ldv_44476; } else { goto ldv_44478; } } else { goto ldv_44478; } } else { } ldv_44478: ; } 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 = 0; switch ((unsigned int )what) { default: dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "LOGIC BUG in %s:%u\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 458); goto ldv_44487; case 1U: ; 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 470); } else { } req->rq_state = req->rq_state | 8UL; inc_ap_pending(mdev); goto ldv_44487; case 2U: ; 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 477); } else { } req->rq_state = req->rq_state | 1UL; goto ldv_44487; case 20U: ; 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 & 0xfffffffffffffffeUL; _req_may_be_done_not_susp(req, m); put_ldev(mdev); goto ldv_44487; case 19U: req->rq_state = req->rq_state | 2UL; req->rq_state = req->rq_state & 0xfffffffffffffffeUL; __drbd_chk_io_error____1(mdev, 0, "__req_mod"); _req_may_be_done_not_susp(req, m); put_ldev(mdev); goto ldv_44487; case 18U: req->rq_state = req->rq_state | 2UL; req->rq_state = req->rq_state & 0xfffffffffffffffeUL; _req_may_be_done_not_susp(req, m); put_ldev(mdev); goto ldv_44487; case 17U: __drbd_set_out_of_sync(mdev, req->sector, (int )req->size, "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 512U); req->rq_state = req->rq_state | 2UL; req->rq_state = req->rq_state & 0xfffffffffffffffeUL; 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 517); } else { } __drbd_chk_io_error____1(mdev, 0, "__req_mod"); put_ldev(mdev); if (*((unsigned int *)mdev + 503UL) != 65536U) { _req_may_be_done_not_susp(req, m); goto ldv_44487; } else { } req->rq_state = req->rq_state | 8UL; inc_ap_pending(mdev); case 4U: tmp = ar_hash_slot___0(mdev, req->sector); hlist_add_head(& req->colision, 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 548); } else { } req->rq_state = req->rq_state | 16UL; req->w.cb = (req->rq_state & 7UL) != 0UL ? & w_read_retry_remote : & w_send_read_req; drbd_queue_work(& mdev->data.work, & req->w); goto ldv_44487; case 3U: tmp___0 = tl_hash_slot___0(mdev, req->sector); hlist_add_head(& req->colision, 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 584); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 592); } 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_44487; case 5U: ; case 6U: req->rq_state = req->rq_state & 0xffffffffffffffefUL; _req_may_be_done_not_susp(req, m); goto ldv_44487; case 7U: ; if ((int )(req->master_bio)->bi_rw & 1 && (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, 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", 621, tmp___3); } else { } req->rq_state = req->rq_state & 0xfffffffffffffff7UL; req->rq_state = req->rq_state | 128UL; } else { } } else { } req->rq_state = req->rq_state & 0xffffffffffffffefUL; req->rq_state = req->rq_state | 32UL; _req_may_be_done_not_susp(req, m); goto ldv_44487; case 9U: req->rq_state = req->rq_state & 0xffffffffffffffefUL; case 8U: ; 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, 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", 646, tmp___6); } else { } } else { } req->rq_state = req->rq_state & 0xffffffffffffff77UL; req->rq_state = req->rq_state | 64UL; if ((req->rq_state & 16UL) == 0UL) { _req_may_be_done(req, m); } else { } goto ldv_44487; case 12U: req->rq_state = req->rq_state | 256UL; case 13U: ; if ((unsigned int )what == 13U) { 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 11U: ; case 10U: 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 684); } else { } tmp___8 = atomic_dec_and_test(& mdev->ap_pending_cnt); if (tmp___8 != 0) { __wake_up(& mdev->misc_wait, 3U, 1, 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", 685, tmp___9); } else { } req->rq_state = req->rq_state & 0xfffffffffffffff7UL; _req_may_be_done_not_susp(req, m); goto ldv_44487; case 14U: ; 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, 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", 693, tmp___12); } else { } } else { } req->rq_state = req->rq_state & 0xffffffffffffff77UL; req->rq_state = req->rq_state | 64UL; _req_may_be_done_not_susp(req, m); goto ldv_44487; case 22U: ; if ((req->rq_state & 2UL) == 0UL) { goto ldv_44487; } else { } _req_may_be_done(req, m); goto ldv_44487; case 23U: ; if ((req->rq_state & 2UL) == 0UL) { goto ldv_44487; } else { } req->rq_state = req->rq_state & 0xfffffffffffffffdUL; rv = 2; if ((int )(req->master_bio)->bi_rw & 1) { rv = 1; } else { } _get_ldev_if_state(mdev, D_INCONSISTENT); req->w.cb = & w_restart_disk_io; drbd_queue_work(& mdev->data.work, & req->w); goto ldv_44487; case 21U: ; 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); rv = (req->rq_state & 1024UL) != 0UL ? 1 : 2; } else { } goto ldv_44487; } else { } case 15U: ; if ((req->rq_state & 1024UL) == 0UL) { goto ldv_44487; } 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 & 32UL) == 0UL) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( req->rq_state & RQ_NET_SENT ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 748); } else { } req->rq_state = req->rq_state | 64UL; _req_may_be_done(req, m); goto ldv_44487; case 16U: ; 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 754); } else { } tmp___14 = atomic_dec_and_test(& mdev->ap_pending_cnt); if (tmp___14 != 0) { __wake_up(& mdev->misc_wait, 3U, 1, 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", 755, tmp___15); } else { } req->rq_state = req->rq_state & 0xfffffffffffffff7UL; req->rq_state = req->rq_state | 192UL; _req_may_be_done_not_susp(req, m); goto ldv_44487; } ldv_44487: ; 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 + 2013UL) == 16U) { return (1); } else { } if ((int )mdev->state.ldv_35533.disk > 4) { return (0); } else { } if ((int )mdev->state.ldv_35533.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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 787); } else { } if (esector >= nr_sectors) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( esector < nr_sectors ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 788); } else { } sbnr = sector >> 3; ebnr = esector >> 3; tmp = drbd_bm_count_bits(mdev, sbnr, ebnr); return (tmp == 0); } } static int drbd_make_request_common(struct drbd_conf *mdev , struct bio *bio ) { int rw ; int size ; sector_t sector ; struct drbd_tl_epoch *b ; struct drbd_request *req ; int local ; int remote ; int err ; int ret ; int tmp ; int tmp___0 ; int tmp___1 ; void *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 ; { rw = (int const )bio->bi_rw & (int const )1025; size = (int const )bio->bi_size; sector = bio->bi_sector; b = 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 { } local = _get_ldev_if_state(mdev, D_INCONSISTENT); if (local == 0) { bio_put(req->private_bio); req->private_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 = 0; put_ldev(mdev); } else { } } else { } remote = local == 0 && (int )mdev->state.ldv_35533.pdsk > 7; } if ((rw == 1024 && (int )mdev->state.ldv_35533.disk > 3) && local == 0) { err = -11; goto fail_and_free_req; } else { } if (rw == 1 && local != 0) { tmp___0 = constant_test_bit(28U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___0 == 0) { req->rq_state = req->rq_state | 2048UL; drbd_al_begin_io(mdev, sector); } else { } } else { } remote = remote != 0 && (*((unsigned int *)mdev + 503UL) == 65536U || (*((unsigned int *)mdev + 503UL) == 32768U && (int )mdev->state.ldv_35533.conn > 9)); if (local == 0 && remote == 0) { tmp___1 = is_susp(mdev->state); if (tmp___1 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "IO ERROR: neither local nor remote disk\n"); goto fail_free_complete; } else { } } else { } if ((rw == 1 && remote != 0) && (unsigned long )mdev->unused_spare_tle == (unsigned long )((struct drbd_tl_epoch *)0)) { tmp___3 = constant_test_bit(0U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___3 != 0) { allocate_barrier: tmp___2 = kmalloc___2(56UL, 16U); b = (struct drbd_tl_epoch *)tmp___2; 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 { } spin_lock_irq(& mdev->req_lock); tmp___4 = is_susp(mdev->state); if (tmp___4 != 0) { ret = 1; spin_unlock_irq(& mdev->req_lock); goto fail_free_complete; } else { } if (remote != 0) { remote = *((unsigned int *)mdev + 503UL) == 65536U || (*((unsigned int *)mdev + 503UL) == 32768U && (int )mdev->state.ldv_35533.conn > 9); if (remote == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "lost connection while grabbing the req_lock!\n"); } else { } if (local == 0 && 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 { } if ((unsigned long )b != (unsigned long )((struct drbd_tl_epoch *)0) && (unsigned long )mdev->unused_spare_tle == (unsigned long )((struct drbd_tl_epoch *)0)) { mdev->unused_spare_tle = b; b = 0; } else { } if ((rw == 1 && remote != 0) && (unsigned long )mdev->unused_spare_tle == (unsigned long )((struct drbd_tl_epoch *)0)) { tmp___5 = constant_test_bit(0U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___5 != 0) { spin_unlock_irq(& mdev->req_lock); goto allocate_barrier; } else { } } else { } _drbd_start_io_acct(mdev, req, bio); if (remote != 0 && (unsigned long )mdev->unused_spare_tle != (unsigned long )((struct drbd_tl_epoch *)0)) { tmp___7 = test_and_clear_bit(0, (unsigned long volatile *)(& mdev->flags)); if (tmp___7 != 0) { _tl_add_barrier(mdev, mdev->unused_spare_tle); mdev->unused_spare_tle = 0; } else { goto _L; } } else _L: /* CIL Label */ if (remote != 0 && rw == 1) { tmp___6 = constant_test_bit(0U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___6 != 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 952); } else { } } else { } if (remote != 0) { _req_mod(req, to_be_send); } else { } if (local != 0) { _req_mod(req, to_be_submitted); } else { } if (rw == 1) { tmp___8 = _req_conflicts(req); if (tmp___8 != 0) { goto fail_conflicting; } else { } } else { } list_add_tail(& req->tl_requests, & (mdev->newest_tle)->requests); if (remote != 0) { _req_mod(req, rw == 1 ? queue_for_net_write : queue_for_net_read); } else { } spin_unlock_irq(& mdev->req_lock); kfree((void const *)b); if (local != 0) { (req->private_bio)->bi_bdev = (mdev->ldev)->backing_bdev; tmp___9 = drbd_insert_fault(mdev, rw != 1 ? (rw == 0 ? 5U : 6U) : 4U); if (tmp___9 != 0) { bio_endio(req->private_bio, -5); } else { generic_make_request(req->private_bio); } } else { } drbd_plug_device(mdev); return (0); fail_conflicting: _drbd_end_io_acct(mdev, req); spin_unlock_irq(& mdev->req_lock); if (remote != 0) { tmp___10 = atomic_dec_and_test(& mdev->ap_pending_cnt); if (tmp___10 != 0) { __wake_up(& mdev->misc_wait, 3U, 1, 0); } else { } tmp___12 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); if (tmp___12 < 0) { tmp___11 = 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", 1024, tmp___11); } else { } } else { } err = 0; fail_free_complete: ; if (rw == 1 && local != 0) { drbd_al_complete_io(mdev, sector); } else { } fail_and_free_req: ; if (local != 0) { bio_put(req->private_bio); req->private_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 ) { struct task_struct *tmp ; struct task_struct *tmp___0 ; int tmp___1 ; { if ((unsigned int )*((unsigned char *)mdev + 2012UL) != 1U && (allow_oos == 0 || is_write != 0)) { tmp___1 = ___ratelimit(& drbd_ratelimit_state, "drbd_fail_request_early"); if (tmp___1 != 0) { tmp = get_current(); tmp___0 = 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___0->comm), tmp->pid, is_write != 0 ? (char *)"WRITE" : (char *)"READ"); } else { } return (1); } else { } return (0); } } int drbd_make_request_26(struct request_queue *q , struct bio *bio ) { unsigned int s_enr ; unsigned int e_enr ; struct drbd_conf *mdev ; int tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; long tmp___3 ; struct bio_pair *bp ; sector_t sect ; int sps ; int mask ; sector_t first_sectors ; int tmp___4 ; int tmp___5 ; { 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 { } tmp___0 = ldv__builtin_expect((bio->bi_rw & 16UL) != 0UL, 0L); if (tmp___0 != 0L) { tmp___1 = constant_test_bit(13U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___1 != 0) { bio_endio(bio, -95); return (0); } else { } } else { } if (bio->bi_size == 0U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( bio->bi_size > 0 ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 1097); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 1098); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 1099); } 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___3 = ldv__builtin_expect(s_enr == e_enr, 1L); if (tmp___3 != 0L) { inc_ap_bio(mdev, 1); tmp___2 = drbd_make_request_common(mdev, bio); return (tmp___2); } else { } if (((unsigned int )bio->bi_vcnt != 1U || (unsigned int )bio->bi_idx != 0U) || 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 1148); } else { } goto ldv_44575; ldv_44574: inc_ap_bio(mdev, 1); ldv_44575: tmp___4 = drbd_make_request_common(mdev, & bp->bio1); if (tmp___4 != 0) { goto ldv_44574; } else { } goto ldv_44578; ldv_44577: inc_ap_bio(mdev, 1); ldv_44578: tmp___5 = drbd_make_request_common(mdev, & bp->bio2); if (tmp___5 != 0) { goto ldv_44577; } else { } 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 ; { 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 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp != 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; limit = _min1 < _min2 ? _min1 : _min2; } else { } put_ldev(mdev); } else { } } else { } } else { } return (limit); } } void ldv_mutex_lock_81(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_82(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_83(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_84(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_85(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_86(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); 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 int ldv_mutex_is_locked_99(struct mutex *lock ) ; int ldv_mutex_trylock_94(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_95(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_97(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_98(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_101(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_103(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_104(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_105(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_106(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_93(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_96(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_100(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_102(struct mutex *ldv_func_arg1 ) ; int ldv_mutex_is_locked_md_io_mutex_of_drbd_conf(struct mutex *lock ) ; __inline static void trace_kmalloc___3(unsigned long call_site , void const *ptr , size_t bytes_req , size_t bytes_alloc , gfp_t gfp_flags ) { long tmp ; struct tracepoint_func *it_func_ptr ; void *it_func ; void *__data ; struct tracepoint_func *_________p1 ; bool __warned ; int tmp___0 ; int tmp___1 ; { tmp = ldv__builtin_expect(__tracepoint_kmalloc.state != 0, 0L); if (tmp != 0L) { goto do_trace; } else { } return; do_trace: rcu_read_lock_sched_notrace(); _________p1 = *((struct tracepoint_func * volatile *)(& __tracepoint_kmalloc.funcs)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { tmp___1 = rcu_read_lock_sched_held(); if (tmp___1 == 0 && 1) { __warned = 1; lockdep_rcu_dereference("include/trace/events/kmem.h", 51); } else { } } else { } it_func_ptr = _________p1; if ((unsigned long )it_func_ptr != (unsigned long )((struct tracepoint_func *)0)) { ldv_10943: it_func = it_func_ptr->func; __data = it_func_ptr->data; (*((void (*)(void * , unsigned long , void const * , size_t , size_t , gfp_t ))it_func))(__data, call_site, ptr, bytes_req, bytes_alloc, gfp_flags); it_func_ptr = it_func_ptr + 1; if ((unsigned long )it_func_ptr->func != (unsigned long )((void *)0)) { goto ldv_10943; } else { } } else { } rcu_read_lock_sched_notrace(); return; } } __inline static void *kmalloc_large___3(size_t size , gfp_t flags ) { unsigned int order ; int tmp ; void *ret ; unsigned long tmp___0 ; { tmp = get_order(size); order = (unsigned int )tmp; tmp___0 = __get_free_pages(flags | 16384U, order); ret = (void *)tmp___0; kmemleak_alloc((void const *)ret, size, 1, flags); trace_kmalloc___3((unsigned long )((void *)0), (void const *)ret, size, 4096UL << (int )order, flags); return (ret); } } __inline static void *kmalloc___3(size_t size , gfp_t flags ) { void *ret ; void *tmp ; struct kmem_cache *s ; struct kmem_cache *tmp___0 ; void *tmp___1 ; { if (0) { if (size > 8192UL) { tmp = kmalloc_large___3(size, flags); return (tmp); } else { } if ((flags & 1U) == 0U) { tmp___0 = kmalloc_slab(size); s = tmp___0; if ((unsigned long )s == (unsigned long )((struct kmem_cache *)0)) { return (16); } else { } ret = kmem_cache_alloc_notrace(s, flags); trace_kmalloc___3((unsigned long )((void *)0), (void const *)ret, size, (size_t )s->size, flags); return (ret); } else { } } else { } tmp___1 = __kmalloc(size, flags); return (tmp___1); } } __inline static void *kzalloc___1(size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc___3(size, flags | 32768U); return (tmp); } } __inline static void get_page(struct page *page ) { int tmp ; long tmp___0 ; { page = compound_head(page); tmp = atomic_read((atomic_t const *)(& page->_count)); tmp___0 = ldv__builtin_expect(tmp == 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 *)"include/linux/mm.h"), "i" (322), "i" (12UL)); ldv_16289: ; goto ldv_16289; } else { } atomic_inc(& page->_count); return; } } __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) && (unsigned int )q->limits.logical_block_size != 0U) { retval = (int )q->limits.logical_block_size; } 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_find(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 ; { tmp = lc_find(lc, enr); e = tmp; return ((unsigned long )e != (unsigned long )((struct lc_element *)0) && e->refcnt != 0U); } } 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_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_to_on_disk_bm(struct drbd_conf *mdev ) ; void drbd_al_shrink(struct drbd_conf *mdev ) ; void drbd_bcast_sync_progress(struct drbd_conf *mdev ) ; __inline static void __drbd_chk_io_error____2(struct drbd_conf *mdev , int forcedetach , char const *where ) { int tmp ; union drbd_state __ns ; { switch ((mdev->ldev)->dc.on_io_error) { 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.Passing error on...\n", where); } else { } goto ldv_43991; } else { } case 2: ; case 1: ; if ((int )mdev->state.ldv_35533.disk > 2) { __ns.i = mdev->state.i; __ns.ldv_35533.disk = 2U; _drbd_set_state(mdev, __ns, CS_HARD, 0); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s.Detaching...\n", where); } else { } goto ldv_43991; } ldv_43991: ; return; } } __inline static void drbd_chk_io_error____0(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____2(mdev, forcedetach, where); spin_unlock_irqrestore(& mdev->req_lock, flags); } else { } return; } } 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 ; int tmp___1 ; long tmp___2 ; long tmp___3 ; { md_io.mdev = mdev; init_completion(& md_io.event); md_io.error = 0; if (rw & 1) { tmp = constant_test_bit(15U, (unsigned long const volatile *)(& mdev->flags)); if (tmp == 0) { rw = rw | 16; } else { } } else { } rw = rw | 544; retry: 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; tmp___1 = drbd_insert_fault(mdev, rw & 1 ? 0U : 1U); if (tmp___1 != 0) { bio_endio(bio, -5); } else { submit_bio(rw, bio); } wait_for_completion(& md_io.event); ok = (int )bio->bi_flags & 1 && md_io.error == 0; tmp___2 = ldv__builtin_expect((bio->bi_rw & 16UL) != 0UL, 0L); if (tmp___2 != 0L) { tmp___3 = ldv__builtin_expect(ok == 0, 0L); if (tmp___3 != 0L) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Barriers not supported on meta data device - disabling\n"); set_bit(15U, (unsigned long volatile *)(& mdev->flags)); rw = rw & -17; bio_put(bio); goto retry; } else { } } else { } 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 ; struct task_struct *tmp___5 ; struct task_struct *tmp___6 ; sector_t tmp___7 ; sector_t tmp___8 ; long tmp___9 ; void *p___0 ; void *tmp___10 ; void *hp___0 ; void *tmp___11 ; size_t __len___0 ; void *__ret___0 ; { offset = 0; iop = mdev->md_io_page; tmp = ldv_mutex_is_locked_99(& 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 181); } else { } tmp___0 = ldv__builtin_expect((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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared"), "i" (183), "i" (12UL)); ldv_44306: ; goto ldv_44306; } 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 && mask != 3) && mask != 7) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mask == 1 || mask == 3 || mask == 7 ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 192); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 193); } 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 = ldv__builtin_expect(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 = memcpy(hp + (unsigned long )(offset * 512), (void const *)p, __len); } } else { } } else { } tmp___7 = drbd_md_first_sector(bdev); if (tmp___7 > sector) { tmp___5 = get_current(); tmp___6 = get_current(); dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s [%d]:%s(,%llus,%s) out of range md access!\n", (char *)(& tmp___6->comm), tmp___5->pid, "drbd_md_sync_page_io", (unsigned long long )sector, rw & 1 ? (char *)"WRITE" : (char *)"READ"); } else { tmp___8 = drbd_md_last_sector(bdev); if (tmp___8 < sector) { tmp___5 = get_current(); tmp___6 = get_current(); dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s [%d]:%s(,%llus,%s) out of range md access!\n", (char *)(& tmp___6->comm), tmp___5->pid, "drbd_md_sync_page_io", (unsigned long long )sector, rw & 1 ? (char *)"WRITE" : (char *)"READ"); } else { } } ok = _drbd_md_sync_page_io(mdev, bdev, iop, sector, rw, logical_block_size); tmp___9 = ldv__builtin_expect(ok == 0, 0L); if (tmp___9 != 0L) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_md_sync_page_io(,%llus,%s) failed!\n", (unsigned long long )sector, rw & 1 ? (char *)"WRITE" : (char *)"READ"); return (0); } else { } if (logical_block_size != 512 && (rw & 1) == 0) { tmp___10 = lowmem_page_address(mdev->md_io_page); p___0 = tmp___10; tmp___11 = lowmem_page_address(mdev->md_io_tmpp); hp___0 = tmp___11; __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 = memcpy(p___0, (void const *)hp___0 + (unsigned long )(offset * 512), __len___0); } } 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 ; struct bm_extent *bm_ext ; struct lc_element const *__mptr ; int tmp___0 ; long tmp___1 ; { al_flags = 0UL; spin_lock_irq(& mdev->al_lock); tmp = lc_find(mdev->resync, enr / 4U); tmp___1 = ldv__builtin_expect((unsigned long )tmp != (unsigned long )((struct lc_element *)0), 0L); if (tmp___1 != 0L) { __mptr = (struct lc_element const *)tmp; bm_ext = (struct bm_extent *)__mptr + 0xfffffffffffffff0UL; tmp___0 = constant_test_bit(0U, (unsigned long const volatile *)(& bm_ext->flags)); if (tmp___0 != 0) { spin_unlock_irq(& mdev->al_lock); return (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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 278); } else { } al_ext = _al_get(mdev, enr); if ((unsigned long )al_ext != (unsigned long )((struct lc_element *)0)) { goto ldv_44335; } 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_44338: 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_44337; } else { } schedule(); goto ldv_44338; ldv_44337: finish_wait(& mdev->al_wait, & __wait); ldv_44335: ; 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, 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, 0); } else { } spin_unlock_irqrestore(& mdev->al_lock, flags); return; } } 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 ; int tmp ; void *tmp___0 ; __u32 tmp___1 ; unsigned int tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; int __min1 ; int __min2 ; unsigned int idx ; struct lc_element *tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; __u32 tmp___8 ; int tmp___9 ; { __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 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "get_ldev() failed in w_al_write_transaction\n"); complete(& ((struct update_al_work *)w)->event); return (1); } else { } if ((int )mdev->state.ldv_35533.conn <= 9 && evicted != 4294967295U) { drbd_bm_write_sect(mdev, (unsigned long )(evicted / 4U)); } else { } ldv_mutex_lock_100(& mdev->md_io_mutex); tmp___0 = lowmem_page_address(mdev->md_io_page); buffer = (struct al_transaction *)tmp___0; buffer->magic = 1728214147U; tmp___1 = __fswab32(mdev->al_tr_number); buffer->tr_number = tmp___1; tmp___2 = lc_index_of(mdev->act_log, updated); n = (int )tmp___2; tmp___3 = __fswab32((__u32 )n); buffer->updates[0].pos = tmp___3; tmp___4 = __fswab32(new_enr); buffer->updates[0].extent = tmp___4; xor_sum = xor_sum ^ new_enr; __min1 = 61; __min2 = (int )((mdev->act_log)->nr_elements - (unsigned int )mdev->al_tr_cycle); mx = __min1 < __min2 ? __min1 : __min2; i = 0; goto ldv_44372; ldv_44371: idx = (unsigned int )(mdev->al_tr_cycle + i); tmp___5 = lc_element_by_index(mdev->act_log, idx); extent_nr = tmp___5->lc_number; tmp___6 = __fswab32(idx); buffer->updates[i + 1].pos = tmp___6; tmp___7 = __fswab32(extent_nr); buffer->updates[i + 1].extent = tmp___7; xor_sum = xor_sum ^ extent_nr; i = i + 1; ldv_44372: ; if (i < mx) { goto ldv_44371; } else { } goto ldv_44375; ldv_44374: buffer->updates[i + 1].pos = 4294967295U; buffer->updates[i + 1].extent = 4294967295U; xor_sum = ~ xor_sum; i = i + 1; ldv_44375: ; if (i <= 60) { goto ldv_44374; } else { } 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___8 = __fswab32(xor_sum); buffer->xor_sum = tmp___8; sector = (sector_t )(((mdev->ldev)->md.md_offset + (u64 )(mdev->ldev)->md.al_offset) + (u64 )mdev->al_tr_pos); tmp___9 = drbd_md_sync_page_io(mdev, mdev->ldev, sector, 1); if (tmp___9 == 0) { drbd_chk_io_error____0(mdev, 1, 1, "w_al_write_transaction"); } else { } mdev->al_tr_pos = mdev->al_tr_pos + 1; if ((unsigned int )mdev->al_tr_pos > (mdev->act_log)->nr_elements / 61U + ((mdev->act_log)->nr_elements % 61U != 0U ? 1U : 0U)) { 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 396); } else { } mdev->al_tr_number = mdev->al_tr_number + 1U; ldv_mutex_unlock_101(& 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_44389; ldv_44388: tmp___1 = __fswab32(b->updates[i].extent); xor_sum = tmp___1 ^ xor_sum; i = i + 1; ldv_44389: ; if (i <= 61) { goto ldv_44388; } else { } 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 ; void *tmp ; __u32 tmp___0 ; int j ; int pos ; unsigned int extent_nr ; unsigned int trn ; int _b ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; { active_extents = 0; transactions = 0; found_valid = 0; from = 0; to = 0; from_tnr = 0U; to_tnr = 0U; mx = (int )((mdev->act_log)->nr_elements / 61U + ((mdev->act_log)->nr_elements % 61U != 0U ? 1U : 0U)); ldv_mutex_lock_102(& mdev->md_io_mutex); tmp = lowmem_page_address(mdev->md_io_page); buffer = (struct al_transaction *)tmp; i = 0; goto ldv_44409; ldv_44408: rv = drbd_al_read_tr(mdev, bdev, buffer, i); if (rv == 0) { goto ldv_44407; } else { } if (rv == -1) { ldv_mutex_unlock_103(& mdev->md_io_mutex); return (0); } else { } tmp___0 = __fswab32(buffer->tr_number); cnr = tmp___0; found_valid = found_valid + 1; if (found_valid == 1) { from = i; to = i; from_tnr = cnr; to_tnr = cnr; goto ldv_44407; } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 490); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 495); } else { } to = i; to_tnr = cnr; } else { } ldv_44407: i = i + 1; ldv_44409: ; if (i <= mx) { goto ldv_44408; } else { } if (found_valid == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "No usable activity log found.\n"); ldv_mutex_unlock_104(& mdev->md_io_mutex); return (1); } else { } i = from; ldv_44424: rv = drbd_al_read_tr(mdev, bdev, buffer, i); _b = rv == 0; if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "drbd_al_read_log", (char *)"rv == 0", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 516); } else { } if (_b != 0) { goto cancel; } else { } if (rv == -1) { ldv_mutex_unlock_105(& mdev->md_io_mutex); return (0); } else { } tmp___1 = __fswab32(buffer->tr_number); trn = tmp___1; spin_lock_irq(& mdev->al_lock); j = 61; goto ldv_44421; ldv_44420: tmp___2 = __fswab32(buffer->updates[j].pos); pos = (int )tmp___2; tmp___3 = __fswab32(buffer->updates[j].extent); extent_nr = tmp___3; if (extent_nr == 4294967295U) { goto ldv_44419; } else { } lc_set(mdev->act_log, extent_nr, pos); active_extents = active_extents + 1; ldv_44419: j = j - 1; ldv_44421: ; if (j >= 0) { goto ldv_44420; } else { } spin_unlock_irq(& mdev->al_lock); transactions = transactions + 1; cancel: ; if (i == to) { goto ldv_44423; } else { } i = i + 1; if (i > mx) { i = 0; } else { } goto ldv_44424; ldv_44423: mdev->al_tr_number = to_tnr + 1U; mdev->al_tr_pos = to; mdev->al_tr_pos = mdev->al_tr_pos + 1; if ((unsigned int )mdev->al_tr_pos > (mdev->act_log)->nr_elements / 61U + ((mdev->act_log)->nr_elements % 61U != 0U ? 1U : 0U)) { mdev->al_tr_pos = 0; } else { } ldv_mutex_unlock_106(& 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); } } static void atodb_endio(struct bio *bio , int error ) { struct drbd_atodb_wait *wc ; struct drbd_conf *mdev ; struct page *page ; int uptodate ; int tmp ; { wc = (struct drbd_atodb_wait *)bio->bi_private; mdev = wc->mdev; uptodate = (int )bio->bi_flags & 1; if (error == 0 && uptodate == 0) { error = -5; } else { } drbd_chk_io_error____0(mdev, error, 1, "atodb_endio"); if (error != 0 && wc->error == 0) { wc->error = error; } else { } tmp = atomic_dec_and_test(& wc->count); if (tmp != 0) { complete(& wc->io_done); } else { } page = (bio->bi_io_vec)->bv_page; put_page(page); bio_put(bio); mdev->bm_writ_cnt = mdev->bm_writ_cnt + 1U; put_ldev(mdev); return; } } static int atodb_prepare_unless_covered(struct drbd_conf *mdev , struct bio **bios , unsigned int enr , struct drbd_atodb_wait *wc ) { struct bio *bio ; struct page *page ; sector_t on_disk_sector ; unsigned int page_offset___0 ; int offset ; int i ; int err ; struct bio_vec const *prev_bv ; void *tmp ; size_t __min1 ; size_t __min2 ; size_t tmp___0 ; int tmp___1 ; { page_offset___0 = 4096U; i = 0; err = -12; enr = enr & 4294967288U; on_disk_sector = (sector_t )(((u64 )enr + (mdev->ldev)->md.md_offset) + (u64 )(mdev->ldev)->md.bm_offset); if ((on_disk_sector & 7UL) != 0UL) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !(on_disk_sector & 7U) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 618); } else { } goto ldv_44448; ldv_44447: ; if (bio->bi_sector == on_disk_sector) { return (0); } else { } i = i + 1; ldv_44448: bio = *(bios + (unsigned long )i); if ((unsigned long )bio != (unsigned long )((struct bio *)0)) { goto ldv_44447; } else { } bio = bio_alloc(208U, 1); if ((unsigned long )bio == (unsigned long )((struct bio *)0)) { return (-12); } else { } if (i > 0) { prev_bv = (struct bio_vec const *)(*(bios + ((unsigned long )i + 0xffffffffffffffffUL)))->bi_io_vec; page_offset___0 = (unsigned int )prev_bv->bv_offset + (unsigned int )prev_bv->bv_len; page = prev_bv->bv_page; } else { } if (page_offset___0 == 4096U) { page = alloc_pages(2U, 0U); if ((unsigned long )page == (unsigned long )((struct page *)0)) { goto out_bio_put; } else { } page_offset___0 = 0U; } else { get_page(page); } offset = (int )(enr << 6); tmp = kmap(page); __min1 = 512UL; tmp___0 = drbd_bm_words(mdev); __min2 = tmp___0 - (size_t )offset; drbd_bm_get_lel(mdev, (size_t )offset, __min1 < __min2 ? __min1 : __min2, (unsigned long *)tmp + (unsigned long )page_offset___0); kunmap(page); bio->bi_private = (void *)wc; bio->bi_end_io = & atodb_endio; bio->bi_bdev = (mdev->ldev)->md_bdev; bio->bi_sector = on_disk_sector; tmp___1 = bio_add_page(bio, page, 4096U, page_offset___0); if (tmp___1 != 4096) { goto out_put_page; } else { } atomic_inc(& wc->count); atomic_inc(& mdev->local_cnt); *(bios + (unsigned long )i) = bio; return (0); out_put_page: err = -22; put_page(page); out_bio_put: bio_put(bio); return (err); } } void drbd_al_to_on_disk_bm(struct drbd_conf *mdev ) { int i ; int nr_elements ; unsigned int enr ; struct bio **bios ; struct drbd_atodb_wait wc ; int _b ; int tmp ; int tmp___0 ; wait_queue_t __wait ; struct task_struct *tmp___1 ; int tmp___2 ; void *tmp___3 ; struct lc_element *tmp___4 ; int tmp___5 ; int tmp___6 ; struct request_queue *tmp___7 ; int tmp___8 ; struct lc_element *tmp___9 ; { tmp = _get_ldev_if_state(mdev, D_ATTACHING); _b = tmp == 0; if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "drbd_al_to_on_disk_bm", (char *)"!get_ldev_if_state(mdev, D_ATTACHING)", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 701); } else { } if (_b != 0) { return; } else { } tmp___0 = lc_try_lock(mdev->act_log); if (tmp___0 != 0) { goto ldv_44467; } 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_44470: prepare_to_wait(& mdev->al_wait, & __wait, 2); tmp___2 = lc_try_lock(mdev->act_log); if (tmp___2 != 0) { goto ldv_44469; } else { } schedule(); goto ldv_44470; ldv_44469: finish_wait(& mdev->al_wait, & __wait); ldv_44467: nr_elements = (int )(mdev->act_log)->nr_elements; tmp___3 = kzalloc___1((unsigned long )nr_elements * 8UL, 208U); bios = (struct bio **)tmp___3; if ((unsigned long )bios == (unsigned long )((struct bio **)0)) { goto submit_one_by_one; } else { } atomic_set(& wc.count, 0); init_completion(& wc.io_done); wc.mdev = mdev; wc.error = 0; i = 0; goto ldv_44475; ldv_44474: tmp___4 = lc_element_by_index(mdev->act_log, (unsigned int )i); enr = tmp___4->lc_number; if (enr == 4294967295U) { goto ldv_44472; } else { } tmp___5 = atodb_prepare_unless_covered(mdev, bios, enr / 4U, & wc); if (tmp___5 != 0) { goto free_bios_submit_one_by_one; } else { } ldv_44472: i = i + 1; ldv_44475: ; if (i < nr_elements) { goto ldv_44474; } else { } lc_unlock(mdev->act_log); __wake_up(& mdev->al_wait, 3U, 1, 0); i = 0; goto ldv_44479; ldv_44478: ; if ((unsigned long )*(bios + (unsigned long )i) == (unsigned long )((struct bio *)0)) { goto ldv_44477; } else { } tmp___6 = drbd_insert_fault(mdev, 0U); if (tmp___6 != 0) { (*(bios + (unsigned long )i))->bi_rw = 1UL; bio_endio(*(bios + (unsigned long )i), -5); } else { submit_bio(1, *(bios + (unsigned long )i)); } i = i + 1; ldv_44479: ; if (i < nr_elements) { goto ldv_44478; } else { } ldv_44477: tmp___7 = bdev_get_queue((mdev->ldev)->md_bdev); drbd_blk_run_queue(tmp___7); drbd_md_flush(mdev); tmp___8 = atomic_read((atomic_t const *)(& wc.count)); if (tmp___8 != 0) { wait_for_completion(& wc.io_done); } else { } put_ldev(mdev); kfree((void const *)bios); return; free_bios_submit_one_by_one: i = 0; goto ldv_44481; ldv_44480: bio_endio(*(bios + (unsigned long )i), 0); i = i + 1; ldv_44481: ; if (i < nr_elements && (unsigned long )*(bios + (unsigned long )i) != (unsigned long )((struct bio *)0)) { goto ldv_44480; } else { } kfree((void const *)bios); submit_one_by_one: dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Using the slow drbd_al_to_on_disk_bm()\n"); i = 0; goto ldv_44485; ldv_44484: tmp___9 = lc_element_by_index(mdev->act_log, (unsigned int )i); enr = tmp___9->lc_number; if (enr == 4294967295U) { goto ldv_44483; } else { } drbd_bm_write_sect(mdev, (unsigned long )(enr / 4U)); ldv_44483: i = i + 1; ldv_44485: ; if ((unsigned int )i < (mdev->act_log)->nr_elements) { goto ldv_44484; } else { } lc_unlock(mdev->act_log); __wake_up(& mdev->al_wait, 3U, 1, 0); put_ldev(mdev); return; } } void drbd_al_apply_to_bm(struct drbd_conf *mdev ) { unsigned int enr ; unsigned long add ; char ppb[10U] ; int i ; int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; struct lc_element *tmp___2 ; unsigned long tmp___3 ; char *tmp___4 ; { add = 0UL; tmp = lc_try_lock(mdev->act_log); if (tmp != 0) { goto ldv_44494; } 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_44497: prepare_to_wait(& mdev->al_wait, & __wait, 2); tmp___1 = lc_try_lock(mdev->act_log); if (tmp___1 != 0) { goto ldv_44496; } else { } schedule(); goto ldv_44497; ldv_44496: finish_wait(& mdev->al_wait, & __wait); ldv_44494: i = 0; goto ldv_44500; ldv_44499: tmp___2 = lc_element_by_index(mdev->act_log, (unsigned int )i); enr = tmp___2->lc_number; if (enr == 4294967295U) { goto ldv_44498; } else { } tmp___3 = drbd_bm_ALe_set_all(mdev, (unsigned long )enr); add = tmp___3 + add; ldv_44498: i = i + 1; ldv_44500: ; if ((unsigned int )i < (mdev->act_log)->nr_elements) { goto ldv_44499; } else { } lc_unlock(mdev->act_log); __wake_up(& mdev->al_wait, 3U, 1, 0); tmp___4 = 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___4); 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 = ldv__builtin_expect(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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 842); } else { } i = 0; goto ldv_44518; ldv_44517: al_ext = lc_element_by_index(mdev->act_log, (unsigned int )i); if (al_ext->lc_number == 4294967295U) { goto ldv_44512; } else { } tmp___0 = _try_lc_del(mdev, al_ext); if (tmp___0 != 0) { goto ldv_44513; } 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_44516: prepare_to_wait(& mdev->al_wait, & __wait, 2); tmp___2 = _try_lc_del(mdev, al_ext); if (tmp___2 != 0) { goto ldv_44515; } else { } schedule(); goto ldv_44516; ldv_44515: finish_wait(& mdev->al_wait, & __wait); ldv_44513: ; ldv_44512: i = i + 1; ldv_44518: ; if ((unsigned int )i < (mdev->act_log)->nr_elements) { goto ldv_44517; } else { } __wake_up(& mdev->al_wait, 3U, 1, 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 long tmp___1 ; { __mptr = (struct drbd_work const *)w; udw = (struct update_odbm_work *)__mptr; tmp___0 = _get_ldev_if_state(mdev, D_INCONSISTENT); 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 { } drbd_bm_write_sect(mdev, (unsigned long )udw->enr); put_ldev(mdev); kfree((void const *)udw); tmp___1 = drbd_bm_total_weight(mdev); if (tmp___1 <= mdev->rs_failed) { switch ((int )mdev->state.ldv_35533.conn) { case 16: ; case 17: ; case 20: ; case 21: drbd_resync_finished(mdev); default: ; goto ldv_44534; } ldv_44534: ; } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 900); } 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 + 0xfffffffffffffff0UL; 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_35533.conn = 1U; mask.i = 0U; mask.ldv_35533.conn = 31U; 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); set_bit(12U, (unsigned long volatile *)(& mdev->flags)); } else { } ext->rs_left = rs_left; ext->rs_failed = success == 0 ? count : 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___3(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"); set_bit(12U, (unsigned long volatile *)(& mdev->flags)); } } 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_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 now ; unsigned long last ; int next ; unsigned long tw ; unsigned long tmp___2 ; raw_spinlock_t *tmp___3 ; int tmp___4 ; { count = 0UL; wake_up = 0; if ((size <= 0 || (size & 511) != 0) || (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), "%s: (%s) in %s:%d\n", "__drbd_set_in_sync", (char *)"sector >= nr_sectors", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1000); } else { } if (_b != 0) { return; } else { } _b___0 = esector >= nr_sectors; if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "__drbd_set_in_sync", (char *)"esector >= nr_sectors", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1001); } else { } if (_b___0 != 0) { esector = nr_sectors - 1UL; } else { } lbnr = (nr_sectors - 1UL) >> 3; tmp = ldv__builtin_expect(esector <= 6UL, 0L); if (tmp != 0L) { return; } else { } tmp___0 = ldv__builtin_expect(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, D_INCONSISTENT); if (tmp___4 != 0) { now = jiffies; last = mdev->rs_mark_time[mdev->rs_last_mark]; next = (mdev->rs_last_mark + 1) % 8; if ((1 != 0 && 1 != 0) && (long )now - (long )(last + 750UL) >= 0L) { tmp___2 = drbd_bm_total_weight(mdev); tw = tmp___2; if ((mdev->rs_mark_left[mdev->rs_last_mark] != tw && (unsigned int )*((unsigned short *)mdev + 1006UL) != 336U) && (unsigned int )*((unsigned short *)mdev + 1006UL) != 320U) { mdev->rs_mark_time[next] = now; mdev->rs_mark_left[next] = tw; mdev->rs_last_mark = next; } else { } } else { } 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, 0); } else { } return; } } void __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 ; { if ((size <= 0 || (size & 511) != 0) || (unsigned int )size > 131072U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "sector: %llus, size: %d\n", (unsigned long long )sector, size); return; } else { } tmp = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp == 0) { 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), "%s: (%s) in %s:%d\n", "__drbd_set_out_of_sync", (char *)"sector >= nr_sectors", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1079); } 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), "%s: (%s) in %s:%d\n", "__drbd_set_out_of_sync", (char *)"esector >= nr_sectors", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1081); } 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 + 0xfffffffffffffff0UL)->rs_left = (int )((unsigned int )((struct bm_extent *)__mptr___0 + 0xfffffffffffffff0UL)->rs_left + count); } else { } spin_unlock_irqrestore(& mdev->al_lock, flags); out: put_ldev(mdev); return; } } 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 (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 + 0xfffffffffffffff0UL; } else { bm_ext = 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, 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 = ldv__builtin_expect((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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared"), "i" (1141), "i" (12UL)); ldv_44622: ; goto ldv_44622; } 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 = ldv__builtin_expect((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 __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 ; struct task_struct *tmp___5 ; int tmp___6 ; int tmp___7 ; unsigned int tmp___8 ; { enr = (unsigned int )(sector >> 15); __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_44641: 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_44639; } else { } tmp___0 = get_current(); tmp___1 = signal_pending(tmp___0); if (tmp___1 == 0) { schedule(); goto ldv_44640; } else { } __ret = -512; goto ldv_44639; ldv_44640: ; goto ldv_44641; ldv_44639: 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_44650; ldv_44649: __ret___0 = 0; tmp___7 = _is_in_al(mdev, enr * 4U + (unsigned int )i); if (tmp___7 != 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_44647: 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_44645; } else { } tmp___5 = get_current(); tmp___6 = signal_pending(tmp___5); if (tmp___6 == 0) { schedule(); goto ldv_44646; } else { } __ret___0 = -512; goto ldv_44645; ldv_44646: ; goto ldv_44647; ldv_44645: finish_wait(& mdev->al_wait, & __wait___0); } else { } sig = __ret___0; if (sig != 0) { spin_lock_irq(& mdev->al_lock); tmp___8 = lc_put(mdev->resync, & bm_ext->lce); if (tmp___8 == 0U) { clear_bit(0, (unsigned long volatile *)(& bm_ext->flags)); mdev->resync_locked = mdev->resync_locked - 1U; __wake_up(& mdev->al_wait, 3U, 1, 0); } else { } spin_unlock_irq(& mdev->al_lock); return (-4); } else { } i = i + 1; ldv_44650: ; if (i <= 3) { goto ldv_44649; } else { } 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 && 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 + 0xfffffffffffffff0UL; } else { bm_ext = 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1246); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1247); } 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, 0); } else { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "LOGIC BUG\n"); } } 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 + 0xfffffffffffffff0UL; } else { bm_ext = 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1271); } 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 + 0xfffffffffffffff0UL; } else { bm_ext = 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 = ldv__builtin_expect((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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared"), "i" (1286), "i" (12UL)); ldv_44671: ; goto ldv_44671; } 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, 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1294); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1297); } else { } mdev->resync_locked = mdev->resync_locked + 1U; goto check_al; } check_al: i = 0; goto ldv_44673; ldv_44672: tmp___6 = ldv__builtin_expect(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_44673: ; if (i <= 3) { goto ldv_44672; } else { } 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 + 0xfffffffffffffff0UL; } else { bm_ext = 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) { clear_bit(1, (unsigned long volatile *)(& bm_ext->flags)); clear_bit(0, (unsigned long volatile *)(& bm_ext->flags)); mdev->resync_locked = mdev->resync_locked - 1U; __wake_up(& mdev->al_wait, 3U, 1, 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, D_FAILED); 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, 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, D_FAILED); if (tmp___3 != 0) { i = 0; goto ldv_44702; ldv_44701: e = lc_element_by_index(mdev->resync, (unsigned int )i); __mptr = (struct lc_element const *)e; bm_ext = (struct bm_extent *)__mptr + 0xfffffffffffffff0UL; if (bm_ext->lce.lc_number == 4294967295U) { goto ldv_44700; } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1400); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1401); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1413); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1414); } else { } lc_del(mdev->resync, & bm_ext->lce); ldv_44700: i = i + 1; ldv_44702: ; if ((unsigned int )i < (mdev->resync)->nr_elements) { goto ldv_44701; } else { } if ((mdev->resync)->used != 0U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->resync->used == 0 ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1417); } 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 || (size & 511) != 0) || (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), "%s: (%s) in %s:%d\n", "drbd_rs_failed_io", (char *)"sector >= nr_sectors", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1447); } else { } if (_b != 0) { return; } else { } _b___0 = esector >= nr_sectors; if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "drbd_rs_failed_io", (char *)"esector >= nr_sectors", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1448); } else { } if (_b___0 != 0) { esector = nr_sectors - 1UL; } else { } lbnr = (nr_sectors - 1UL) >> 3; tmp = ldv__builtin_expect(esector <= 6UL, 0L); if (tmp != 0L) { return; } else { } tmp___0 = ldv__builtin_expect(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, sbnr, ebnr); count = (unsigned long )tmp___1; if (count != 0UL) { mdev->rs_failed = mdev->rs_failed + count; tmp___2 = _get_ldev_if_state(mdev, D_INCONSISTENT); 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, 0); } else { } return; } } void ldv_mutex_lock_93(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_94(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_95(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_96(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_97(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_98(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static int ldv_mutex_is_locked_99(struct mutex *lock ) { ldv_func_ret_type___5 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_is_locked(lock); ldv_func_res = tmp; tmp___0 = ldv_mutex_is_locked_md_io_mutex_of_drbd_conf(lock); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_lock_100(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_md_io_mutex_of_drbd_conf(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_101(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_md_io_mutex_of_drbd_conf(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_102(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_md_io_mutex_of_drbd_conf(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_103(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_md_io_mutex_of_drbd_conf(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_104(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_md_io_mutex_of_drbd_conf(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_105(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_md_io_mutex_of_drbd_conf(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_106(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_md_io_mutex_of_drbd_conf(ldv_func_arg1); mutex_unlock(ldv_func_arg1); 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); *(dst + (nlongs + 0xffffffffffffffffUL)) = ((unsigned int )nbits & 63U) != 0U ? (1UL << nbits % 64) - 1UL : 0xffffffffffffffffUL; return; } } __inline static int bitmap_weight(unsigned long const *src , int nbits ) { int tmp___0 ; { tmp___0 = __bitmap_weight(src, nbits); return (tmp___0); } } 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 ) ; __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; } } int ldv_mutex_trylock_122(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_123(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_125(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_126(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_128(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_131(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_132(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_134(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_136(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_138(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_140(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_142(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_144(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_146(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_148(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_150(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_121(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_124(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_127(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_129(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_130(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_133(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_135(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_137(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_139(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_141(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_143(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_145(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_147(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_149(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_drbd_main_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_drbd_main_mutex(struct mutex *lock ) ; void ldv_mutex_lock_state_mutex_of_drbd_conf(struct mutex *lock ) ; void ldv_mutex_unlock_state_mutex_of_drbd_conf(struct mutex *lock ) ; __inline static struct thread_info *current_thread_info___1(void) { struct thread_info *ti ; unsigned long pfo_ret__ ; { switch (8UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5987; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5987; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5987; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5987; default: __bad_percpu_size(); } ldv_5987: ti = (struct thread_info *)(pfo_ret__ - 8152UL); return (ti); } } 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 * ) ; extern void __bad_size_call_parameter(void) ; extern struct tracepoint __tracepoint_module_get ; __inline static void trace_module_get(struct module *mod , unsigned long ip ) { long tmp ; struct tracepoint_func *it_func_ptr ; void *it_func ; void *__data ; struct tracepoint_func *_________p1 ; bool __warned ; int tmp___0 ; int tmp___1 ; { tmp = ldv__builtin_expect(__tracepoint_module_get.state != 0, 0L); if (tmp != 0L) { goto do_trace; } else { } return; do_trace: rcu_read_lock_sched_notrace(); _________p1 = *((struct tracepoint_func * volatile *)(& __tracepoint_module_get.funcs)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { tmp___1 = rcu_read_lock_sched_held(); if (tmp___1 == 0 && 1) { __warned = 1; lockdep_rcu_dereference("include/trace/events/module.h", 84); } else { } } else { } it_func_ptr = _________p1; if ((unsigned long )it_func_ptr != (unsigned long )((struct tracepoint_func *)0)) { ldv_11485: it_func = it_func_ptr->func; __data = it_func_ptr->data; (*((void (*)(void * , struct module * , unsigned long ))it_func))(__data, mod, ip); it_func_ptr = it_func_ptr + 1; if ((unsigned long )it_func_ptr->func != (unsigned long )((void *)0)) { goto ldv_11485; } else { } } else { } rcu_read_lock_sched_notrace(); return; } } __inline static int module_is_live(struct module *mod ) { { return ((unsigned int )mod->state != 2U); } } __inline static int try_module_get(struct module *module ) { int ret ; void const *__vpp_verify ; int pao_ID__ ; int pao_ID_____0 ; int pao_ID_____1 ; int pao_ID_____2 ; int tmp ; long tmp___0 ; { ret = 1; if ((unsigned long )module != (unsigned long )((struct module *)0)) { tmp = module_is_live(module); tmp___0 = ldv__builtin_expect(tmp != 0, 1L); if (tmp___0 != 0L) { __vpp_verify = 0; switch (4UL) { case 1UL: pao_ID__ = 1; switch (4UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addb %1, %%gs:%P0": "+m" ((module->refptr)->incs): "qi" (1U)); } goto ldv_11850; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addw %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11850; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addl %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11850; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addq %1, %%gs:%P0": "+m" ((module->refptr)->incs): "re" (1U)); } goto ldv_11850; default: __bad_percpu_size(); } ldv_11850: ; goto ldv_11855; case 2UL: pao_ID_____0 = 1; switch (4UL) { case 1UL: ; if (pao_ID_____0 == 1) { __asm__ ("incb %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____0 == -1) { __asm__ ("decb %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addb %1, %%gs:%P0": "+m" ((module->refptr)->incs): "qi" (1U)); } goto ldv_11861; case 2UL: ; if (pao_ID_____0 == 1) { __asm__ ("incw %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____0 == -1) { __asm__ ("decw %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addw %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11861; case 4UL: ; if (pao_ID_____0 == 1) { __asm__ ("incl %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____0 == -1) { __asm__ ("decl %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addl %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11861; case 8UL: ; if (pao_ID_____0 == 1) { __asm__ ("incq %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____0 == -1) { __asm__ ("decq %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addq %1, %%gs:%P0": "+m" ((module->refptr)->incs): "re" (1U)); } goto ldv_11861; default: __bad_percpu_size(); } ldv_11861: ; goto ldv_11855; case 4UL: pao_ID_____1 = 1; switch (4UL) { case 1UL: ; if (pao_ID_____1 == 1) { __asm__ ("incb %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____1 == -1) { __asm__ ("decb %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addb %1, %%gs:%P0": "+m" ((module->refptr)->incs): "qi" (1U)); } goto ldv_11871; case 2UL: ; if (pao_ID_____1 == 1) { __asm__ ("incw %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____1 == -1) { __asm__ ("decw %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addw %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11871; case 4UL: ; if (pao_ID_____1 == 1) { __asm__ ("incl %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____1 == -1) { __asm__ ("decl %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addl %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11871; case 8UL: ; if (pao_ID_____1 == 1) { __asm__ ("incq %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____1 == -1) { __asm__ ("decq %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addq %1, %%gs:%P0": "+m" ((module->refptr)->incs): "re" (1U)); } goto ldv_11871; default: __bad_percpu_size(); } ldv_11871: ; goto ldv_11855; case 8UL: pao_ID_____2 = 1; switch (4UL) { case 1UL: ; if (pao_ID_____2 == 1) { __asm__ ("incb %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____2 == -1) { __asm__ ("decb %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addb %1, %%gs:%P0": "+m" ((module->refptr)->incs): "qi" (1U)); } goto ldv_11881; case 2UL: ; if (pao_ID_____2 == 1) { __asm__ ("incw %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____2 == -1) { __asm__ ("decw %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addw %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11881; case 4UL: ; if (pao_ID_____2 == 1) { __asm__ ("incl %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____2 == -1) { __asm__ ("decl %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addl %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11881; case 8UL: ; if (pao_ID_____2 == 1) { __asm__ ("incq %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____2 == -1) { __asm__ ("decq %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addq %1, %%gs:%P0": "+m" ((module->refptr)->incs): "re" (1U)); } goto ldv_11881; default: __bad_percpu_size(); } ldv_11881: ; goto ldv_11855; default: __bad_size_call_parameter(); goto ldv_11855; } ldv_11855: ; trace_module_get(module, (unsigned long )((void *)0)); } else { ret = 0; } } else { } return (ret); } } extern void module_put(struct module * ) ; 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 void trace_kmalloc___4(unsigned long call_site , void const *ptr , size_t bytes_req , size_t bytes_alloc , gfp_t gfp_flags ) { long tmp ; struct tracepoint_func *it_func_ptr ; void *it_func ; void *__data ; struct tracepoint_func *_________p1 ; bool __warned ; int tmp___0 ; int tmp___1 ; { tmp = ldv__builtin_expect(__tracepoint_kmalloc.state != 0, 0L); if (tmp != 0L) { goto do_trace; } else { } return; do_trace: rcu_read_lock_sched_notrace(); _________p1 = *((struct tracepoint_func * volatile *)(& __tracepoint_kmalloc.funcs)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { tmp___1 = rcu_read_lock_sched_held(); if (tmp___1 == 0 && 1) { __warned = 1; lockdep_rcu_dereference("include/trace/events/kmem.h", 51); } else { } } else { } it_func_ptr = _________p1; if ((unsigned long )it_func_ptr != (unsigned long )((struct tracepoint_func *)0)) { ldv_13766: it_func = it_func_ptr->func; __data = it_func_ptr->data; (*((void (*)(void * , unsigned long , void const * , size_t , size_t , gfp_t ))it_func))(__data, call_site, ptr, bytes_req, bytes_alloc, gfp_flags); it_func_ptr = it_func_ptr + 1; if ((unsigned long )it_func_ptr->func != (unsigned long )((void *)0)) { goto ldv_13766; } else { } } else { } rcu_read_lock_sched_notrace(); return; } } __inline static void *kmalloc_large___4(size_t size , gfp_t flags ) { unsigned int order ; int tmp ; void *ret ; unsigned long tmp___0 ; { tmp = get_order(size); order = (unsigned int )tmp; tmp___0 = __get_free_pages(flags | 16384U, order); ret = (void *)tmp___0; kmemleak_alloc((void const *)ret, size, 1, flags); trace_kmalloc___4((unsigned long )((void *)0), (void const *)ret, size, 4096UL << (int )order, flags); return (ret); } } __inline static void *kmalloc___4(size_t size , gfp_t flags ) { void *ret ; void *tmp ; struct kmem_cache *s ; struct kmem_cache *tmp___0 ; void *tmp___1 ; { if (0) { if (size > 8192UL) { tmp = kmalloc_large___4(size, flags); return (tmp); } else { } if ((flags & 1U) == 0U) { tmp___0 = kmalloc_slab(size); s = tmp___0; if ((unsigned long )s == (unsigned long )((struct kmem_cache *)0)) { return (16); } else { } ret = kmem_cache_alloc_notrace(s, flags); trace_kmalloc___4((unsigned long )((void *)0), (void const *)ret, size, (size_t )s->size, flags); return (ret); } else { } } else { } tmp___1 = __kmalloc(size, flags); return (tmp___1); } } __inline static void *kzalloc___2(size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc___4(size, flags | 32768U); return (tmp); } } extern int dev_printk(char const * , struct device const * , char const * , ...) ; __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 void bd_release(struct block_device * ) ; 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 set_cpus_allowed_ptr(struct task_struct * , struct cpumask const * ) ; extern int wake_up_process(struct task_struct * ) ; extern void fput(struct file * ) ; extern int register_reboot_notifier(struct notifier_block * ) ; extern int unregister_reboot_notifier(struct notifier_block * ) ; extern struct task_struct *kthread_create(int (*)(void * ) , void * , 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 int blk_remove_plug(struct request_queue * ) ; 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_segment_size(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 = ldv__builtin_expect(((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 *)"/work/ldvuser/novikov/inst/current/envs/linux/linux/drivers/block/drbd/drbd_int.h"), "i" (590), "i" (12UL)); ldv_43662: ; goto ldv_43662; } else { } p->encoding = ((unsigned int )p->encoding & 240U) | (unsigned int )((u8 )code); return; } } __inline static void DCBP_set_start(struct p_compressed_bm *p , int set ) { { p->encoding = (u8 )(((int )((signed char )p->encoding) & 127) | (set != 0 ? -128 : 0)); return; } } __inline static void DCBP_set_pad_bits(struct p_compressed_bm *p , int n ) { long tmp ; { tmp = ldv__builtin_expect((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 *)"/work/ldvuser/novikov/inst/current/envs/linux/linux/drivers/block/drbd/drbd_int.h"), "i" (615), "i" (12UL)); ldv_43677: ; goto ldv_43677; } else { } p->encoding = (u8 )(((int )((signed char )p->encoding) & -128) | (int )((signed char )(n << 4))); return; } } __inline static int drbd_get_data_sock___0(struct drbd_conf *mdev ) { long tmp ; { ldv_mutex_lock_124(& mdev->data.mutex); tmp = ldv__builtin_expect((unsigned long )mdev->data.socket == (unsigned long )((struct socket *)0), 0L); if (tmp != 0L) { ldv_mutex_unlock_125(& mdev->data.mutex); return (0); } else { } return (1); } } __inline static void drbd_put_data_sock___0(struct drbd_conf *mdev ) { { ldv_mutex_unlock_126(& mdev->data.mutex); 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 , int err ) ; void drbd_calc_cpu_mask(struct drbd_conf *mdev ) ; void drbd_free_resources(struct drbd_conf *mdev ) ; void tl_restart(struct drbd_conf *mdev , enum drbd_req_event what ) ; 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 ) ; 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_44733; } 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_44736: 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_44735; } else { } schedule(); goto ldv_44736; ldv_44735: finish_wait(& mdev->misc_wait, & __wait); ldv_44733: ; return; } } __inline static void __drbd_chk_io_error____3(struct drbd_conf *mdev , int forcedetach , char const *where ) { int tmp ; union drbd_state __ns ; { switch ((mdev->ldev)->dc.on_io_error) { 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.Passing error on...\n", where); } else { } goto ldv_44759; } else { } case 2: ; case 1: ; if ((int )mdev->state.ldv_35533.disk > 2) { __ns.i = mdev->state.i; __ns.ldv_35533.disk = 2U; _drbd_set_state(mdev, __ns, CS_HARD, 0); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s.Detaching...\n", where); } else { } goto ldv_44759; } ldv_44759: ; 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 __min1___0 ; sector_t __min2___0 ; sector_t tmp___2 ; sector_t __min1___1 ; sector_t __min2___1 ; sector_t __min1___2 ; sector_t __min2___2 ; sector_t tmp___3 ; { switch (bdev->dc.meta_dev_idx) { case -1: ; case -3: tmp___1 = drbd_get_capacity(bdev->backing_bdev); if (tmp___1 != 0UL) { __min1 = 34359738368UL; tmp___0 = drbd_md_first_sector(bdev); __min2 = tmp___0; s = __min1 < __min2 ? __min1 : __min2; } else { s = 0UL; } goto ldv_44800; case -2: __min1___0 = 34359738368UL; tmp___2 = drbd_get_capacity(bdev->backing_bdev); __min2___0 = tmp___2; s = __min1___0 < __min2___0 ? __min1___0 : __min2___0; __min1___1 = s; __min2___1 = (unsigned long )(bdev->md.md_size_sect - (u32 )bdev->md.bm_offset) << 15; s = __min1___1 < __min2___1 ? __min1___1 : __min2___1; goto ldv_44800; default: __min1___2 = 8587575296UL; tmp___3 = drbd_get_capacity(bdev->backing_bdev); __min2___2 = tmp___3; s = __min1___2 < __min2___2 ? __min1___2 : __min2___2; } ldv_44800: ; return (s); } } __inline static sector_t drbd_md_ss__(struct drbd_conf *mdev , struct drbd_backing_dev *bdev ) { int tmp ; sector_t tmp___0 ; { switch (bdev->dc.meta_dev_idx) { default: ; return ((unsigned long )bdev->dc.meta_dev_idx * 262144UL); case -1: ; case -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 & 0xfffffffffffffff8ULL) - 8ULL)); case -2: ; return (0UL); } } } __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(union drbd_state s ) { { switch ((unsigned int )s.ldv_35533.conn) { case 0U: ; case 8U: ; case 10U: ; case 16U: ; case 17U: ; case 18U: ; case 19U: ; case 20U: ; case 21U: ; goto ldv_44915; case 1U: ; case 2U: ; case 3U: ; case 4U: ; case 5U: ; case 6U: ; case 7U: ; case 9U: ; case 11U: ; case 12U: ; case 13U: ; case 14U: ; case 15U: ; case 31U: ; return (0); } ldv_44915: ; switch ((unsigned int )s.ldv_35533.disk) { case 0U: ; case 4U: ; case 5U: ; case 7U: ; case 8U: ; goto ldv_44935; case 1U: ; case 2U: ; case 3U: ; case 6U: ; case 15U: ; return (0); } ldv_44935: ; return (1); } } __inline static int __inc_ap_bio_cond___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 (0); } else { } tmp___1 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___1 != 0) { return (0); } else { } tmp___2 = drbd_state_is_stable___0(mdev->state); if (tmp___2 == 0) { return (0); } else { } tmp___3 = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); if (tmp___3 > mxb) { return (0); } else { } tmp___4 = constant_test_bit(17U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___4 != 0) { return (0); } else { } return (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); } } __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 = (0xffffffffffffffffULL >> (int )(64U - (unsigned int )bits)) & val; } else { } tmp___0 = b; b = b + 1; *tmp___0 = (int )*tmp___0 | (int )((unsigned char )((val & 255ULL) << (int )bs->cur.bit)); tmp = 8U - bs->cur.bit; goto ldv_45175; ldv_45174: tmp___1 = b; b = b + 1; *tmp___1 = (int )*tmp___1 | (int )((unsigned char )(val >> (int )tmp)); tmp = tmp + 8U; ldv_45175: ; if (tmp < (unsigned int )bits) { goto ldv_45174; } else { } bitstream_cursor_advance(& bs->cur, 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, 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, 0xffffffffffffffffUL, {0, {0, 0}, "drbd_main_mutex.wait_lock", 0, 0UL}}}}, {& drbd_main_mutex.wait_list, & drbd_main_mutex.wait_list}, 0, 0, (void *)(& drbd_main_mutex), {0, {0, 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] = { '/', 's', 'b', 'i', 'n', '/', 'd', 'r', 'b', 'd', 'a', 'd', 'm', '\000'}; struct ratelimit_state drbd_ratelimit_state = {{{{{0U}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "drbd_ratelimit_state.lock", 0, 0UL}}}}, 1250, 5, 0, 0, 0UL}; static struct block_device_operations const drbd_ops = {& drbd_open, & drbd_release, 0, 0, 0, 0, 0, 0, 0, 0, & __this_module}; static int tl_init(struct drbd_conf *mdev ) { struct drbd_tl_epoch *b ; void *tmp ; { tmp = kmalloc___4(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 = 0; b->br_number = 4711U; b->n_writes = 0; b->w.cb = 0; mdev->oldest_tle = b; mdev->newest_tle = b; INIT_LIST_HEAD(& mdev->out_of_sequence_requests); mdev->tl_hash = 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 275); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 276); } else { } kfree((void const *)mdev->oldest_tle); mdev->oldest_tle = 0; kfree((void const *)mdev->unused_spare_tle); mdev->unused_spare_tle = 0; kfree((void const *)mdev->tl_hash); mdev->tl_hash = 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 = 0; new->next = 0; new->n_writes = 0; newest_before = mdev->newest_tle; new->br_number = newest_before->br_number + 1U != 0U ? newest_before->br_number + 1U : 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_45403; ldv_45402: __mptr = (struct list_head const *)le; r = (struct drbd_request *)__mptr + 0xffffffffffffffb8UL; _req_mod(r, barrier_acked); le = tle; tle = le->next; ldv_45403: ; if ((unsigned long )(& b->requests) != (unsigned long )le) { goto ldv_45402; } else { } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 379); } 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, 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", 385, tmp___1); } else { } return; bail: spin_unlock_irq(& mdev->req_lock); val.i = 0U; val.ldv_35533.conn = 6U; mask.i = 0U; mask.ldv_35533.conn = 31U; 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_45438; ldv_45437: n_writes = 0; n_reads = 0; INIT_LIST_HEAD(& carry_reads); le = b->requests.next; tle = le->next; goto ldv_45430; ldv_45429: __mptr = (struct list_head const *)le; req = (struct drbd_request *)__mptr + 0xffffffffffffffb8UL; rv = _req_mod(req, what); n_writes = (rv & 1) + n_writes; n_reads = ((rv & 2) >> 1) + n_reads; le = tle; tle = le->next; ldv_45430: ; if ((unsigned long )(& b->requests) != (unsigned long )le) { goto ldv_45429; } else { } tmp = b->next; if (n_writes != 0) { if ((unsigned int )what == 21U) { 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, 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", 447, 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 451); } 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 = 0; b->br_number = random32(); b->n_writes = 0; *pn = b; goto ldv_45436; } else { } *pn = tmp; kfree((void const *)b); } b = tmp; list_splice((struct list_head const *)(& carry_reads), & b->requests); ldv_45438: ; if ((unsigned long )b != (unsigned long )((struct drbd_tl_epoch *)0)) { goto ldv_45437; } else { } ldv_45436: ; 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, connection_lost_while_pending); 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 489); } else { } le = mdev->out_of_sequence_requests.next; tle = le->next; goto ldv_45448; ldv_45447: __mptr = (struct list_head const *)le; r = (struct drbd_request *)__mptr + 0xffffffffffffffb8UL; _req_mod(r, connection_lost_while_pending); le = tle; tle = le->next; ldv_45448: ; if ((unsigned long )(& mdev->out_of_sequence_requests) != (unsigned long )le) { goto ldv_45447; } else { } 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 ) { { return (((((int )os.ldv_35533.conn > 9 && (int )ns.ldv_35533.conn > 9) && (((((unsigned int )*((unsigned char *)(& os) + 0UL) != 1U && (unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U) || ((unsigned int )*((unsigned short *)(& os) + 0UL) != 192U && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 192U)) || ((unsigned int )*((unsigned short *)(& os) + 0UL) != 176U && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 176U)) || ((unsigned int )*((unsigned char *)(& os) + 1UL) != 0U && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 0U))) || ((int )os.ldv_35533.conn > 9 && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 16U)) || ((unsigned int )*((unsigned short *)(& os) + 0UL) == 160U && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U)); } } int 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 ; int 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, 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, CS_HARD, mask, val); return; } } static int is_valid_state(struct drbd_conf *mdev , union drbd_state ns ) ; static int 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_ret_codes _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 ; int 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 (SS_CW_SUCCESS); } else { } tmp___0 = test_and_clear_bit(10, (unsigned long volatile *)(& mdev->flags)); if (tmp___0 != 0) { return (SS_CW_FAILED_BY_PEER); } else { } 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, 0); tmp___2 = cl_wide_st_chg(mdev, os, ns); if (tmp___2 == 0) { rv = 4; } else { } if (rv == 0) { rv = is_valid_state(mdev, ns); if (rv == 1) { rv = is_valid_state_transition(mdev, ns, os); if (rv == 1) { rv = 0; } else { } } else { } } else { } spin_unlock_irqrestore(& mdev->req_lock, flags); return ((enum drbd_state_ret_codes )rv); } } static int 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 ; int rv ; raw_spinlock_t *tmp ; int tmp___0 ; enum drbd_state_ret_codes tmp___1 ; wait_queue_t __wait ; struct task_struct *tmp___2 ; enum drbd_state_ret_codes tmp___3 ; raw_spinlock_t *tmp___4 ; int tmp___5 ; struct task_struct *tmp___6 ; { init_completion(& done); if (((unsigned int )f & 8U) != 0U) { ldv_mutex_lock_127(& mdev->state_mutex); } 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, 0); tmp___5 = cl_wide_st_chg(mdev, os, ns); if (tmp___5 != 0) { rv = is_valid_state(mdev, ns); if (rv == 1) { rv = is_valid_state_transition(mdev, ns, os); } else { } spin_unlock_irqrestore(& mdev->req_lock, flags); if (rv <= 0) { if (((unsigned int )f & 2U) != 0U) { print_st_err(mdev, os, ns, 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 = -10; if (((unsigned int )f & 2U) != 0U) { print_st_err(mdev, os, ns, rv); } else { } goto abort; } else { } tmp___1 = _req_st_cond(mdev, mask, val); rv = (int )tmp___1; if (rv != 0) { goto ldv_45520; } else { } 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_45523: prepare_to_wait(& mdev->state_wait, & __wait, 2); tmp___3 = _req_st_cond(mdev, mask, val); rv = (int )tmp___3; if (rv != 0) { goto ldv_45522; } else { } schedule(); goto ldv_45523; ldv_45522: finish_wait(& mdev->state_wait, & __wait); ldv_45520: ; if (rv <= 0) { drbd_state_unlock(mdev); if (((unsigned int )f & 2U) != 0U) { print_st_err(mdev, os, ns, rv); } else { } goto abort; } else { } tmp___4 = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp___4); 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 && rv == 1) { tmp___6 = get_current(); if ((unsigned long )tmp___6 == (unsigned long )mdev->worker.task) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( current != mdev->worker.task ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 674); } else { } wait_for_completion(& done); } else { } abort: ; if (((unsigned int )f & 8U) != 0U) { ldv_mutex_unlock_128(& mdev->state_mutex); } else { } return (rv); } } int _drbd_request_state(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val , enum chg_state_flags f ) { int rv ; wait_queue_t __wait ; struct task_struct *tmp ; { rv = drbd_req_state(mdev, mask, val, f); if (rv != -18) { goto ldv_45534; } 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_45537: prepare_to_wait(& mdev->state_wait, & __wait, 2); rv = drbd_req_state(mdev, mask, val, f); if (rv != -18) { goto ldv_45536; } else { } schedule(); goto ldv_45537; ldv_45536: finish_wait(& mdev->state_wait, & __wait); ldv_45534: ; return (rv); } } static void print_st(struct drbd_conf *mdev , char *name , union drbd_state ns ) { int tmp ; char const *tmp___0 ; char const *tmp___1 ; char const *tmp___2 ; char const *tmp___3 ; char const *tmp___4 ; { tmp = is_susp(ns); tmp___0 = drbd_disk_str((enum drbd_disk_state )ns.ldv_35533.pdsk); tmp___1 = drbd_disk_str((enum drbd_disk_state )ns.ldv_35533.disk); tmp___2 = drbd_role_str((enum drbd_role )ns.ldv_35533.peer); tmp___3 = drbd_role_str((enum drbd_role )ns.ldv_35533.role); tmp___4 = drbd_conn_str((enum drbd_conns )ns.ldv_35533.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___4, tmp___3, tmp___2, tmp___1, tmp___0, tmp != 0 ? 115 : 114, (unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U ? 97 : 45, (unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U ? 112 : 45, (unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U ? 117 : 45); return; } } void print_st_err(struct drbd_conf *mdev , union drbd_state os , union drbd_state ns , int err ) { char const *tmp ; { if (err == -18) { return; } else { } tmp = drbd_set_st_err_str((enum drbd_state_ret_codes )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 int is_valid_state(struct drbd_conf *mdev , union drbd_state ns ) { enum drbd_fencing_p fp ; int rv ; int tmp ; int tmp___0 ; { rv = 1; fp = FP_DONT_CARE; tmp = _get_ldev_if_state(mdev, D_INCONSISTENT); 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 + 528UL) == 0U && (unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U) && (unsigned int )*((unsigned char *)(& ns) + 0UL) == 4U) { rv = -1; } else { } put_net_conf(mdev); } else { } if (rv <= 0) { } else if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 2U && mdev->open_cnt != 0) { rv = -12; } else if (((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U && (int )ns.ldv_35533.conn <= 9) && (int )ns.ldv_35533.disk <= 7) { rv = -2; } else if ((((unsigned int )fp != 0U && (unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U) && (int )ns.ldv_35533.conn <= 9) && (int )ns.ldv_35533.pdsk > 5) { rv = -7; } else if (((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U && (int )ns.ldv_35533.disk <= 4) && (int )ns.ldv_35533.pdsk <= 4) { rv = -2; } else if ((int )ns.ldv_35533.conn > 10 && (int )ns.ldv_35533.disk <= 3) { rv = -4; } else if ((int )ns.ldv_35533.conn > 10 && (int )ns.ldv_35533.pdsk <= 3) { rv = -5; } else if (((int )ns.ldv_35533.conn > 10 && (int )ns.ldv_35533.disk <= 7) && (int )ns.ldv_35533.pdsk <= 7) { rv = -2; } else if (((((unsigned int )*((unsigned short *)(& ns) + 0UL) == 160U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 208U) || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 256U) || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 320U) && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 10U) { rv = -6; } else if (((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 304U) && (unsigned int )mdev->sync_conf.verify_alg[0] == 0U) { rv = -14; } else if (((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 304U) && mdev->agreed_pro_version <= 87) { rv = -17; } else { } return (rv); } } static int is_valid_state_transition(struct drbd_conf *mdev , union drbd_state ns , union drbd_state os ) { int rv ; { rv = 1; if (((unsigned int )*((unsigned short *)(& ns) + 0UL) == 192U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 176U) && (int )os.ldv_35533.conn > 10) { rv = -8; } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 16U && (unsigned int )*((unsigned short *)(& os) + 0UL) == 0U) { rv = -9; } else { } if ((int )ns.ldv_35533.disk > 1 && (unsigned int )*((unsigned char *)(& os) + 1UL) == 0U) { rv = -11; } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 128U && (int )os.ldv_35533.conn <= 1) { rv = -13; } else { } if (((unsigned int )*((unsigned char *)(& ns) + 1UL) == 10U && (int )os.ldv_35533.disk <= 4) && (unsigned int )*((unsigned char *)(& os) + 1UL) != 2U) { rv = -16; } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 16U && (unsigned int )*((unsigned short *)(& os) + 0UL) == 32U) { rv = -18; } else { } if ((int )ns.ldv_35533.conn == (int )os.ldv_35533.conn && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 144U) { rv = -18; } else { } if (((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 304U) && (int )os.ldv_35533.conn <= 9) { rv = -15; } else { } if ((((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 304U) && (int )ns.ldv_35533.conn != (int )os.ldv_35533.conn) && (int )os.ldv_35533.conn > 10) { rv = -8; } else { } if (((unsigned int )*((unsigned short *)(& ns) + 0UL) == 176U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 192U) && (int )os.ldv_35533.conn <= 9) { rv = -15; } 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 ; int tmp ; int tmp___0 ; { fp = FP_DONT_CARE; tmp = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp != 0) { fp = (enum drbd_fencing_p )(mdev->ldev)->dc.fencing; put_ldev(mdev); } else { } if (((int )ns.ldv_35533.conn > 2 && (int )ns.ldv_35533.conn <= 7) && (int )os.ldv_35533.conn <= 1) { ns.ldv_35533.conn = os.ldv_35533.conn; } else { } if (((((int )os.ldv_35533.conn > 2 && (int )os.ldv_35533.conn <= 7) && (unsigned int )*((unsigned short *)(& ns) + 0UL) != 32U) && (unsigned int )*((unsigned short *)(& ns) + 0UL) != 16U) && (int )ns.ldv_35533.conn <= 7) { ns.ldv_35533.conn = os.ldv_35533.conn; } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 16U && (unsigned int )*((unsigned short *)(& ns) + 0UL) != 0U) { ns.ldv_35533.conn = os.ldv_35533.conn; } else { } if ((int )ns.ldv_35533.conn <= 9) { ns.ldv_35533.peer_isp = 0U; ns.ldv_35533.peer = 0U; if ((int )ns.ldv_35533.pdsk > 6 || (int )ns.ldv_35533.pdsk <= 3) { ns.ldv_35533.pdsk = 6U; } else { } } else { } if (((unsigned int )*((unsigned short *)(& ns) + 0UL) == 0U && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 0U) && (unsigned int )*((unsigned char *)(& ns) + 0UL) == 2U) { ns.ldv_35533.aftr_isp = 0U; } else { } if (((int )os.ldv_35533.conn > 10 && (int )ns.ldv_35533.conn > 10) && ((int )ns.ldv_35533.disk <= 2 || (int )ns.ldv_35533.pdsk <= 2)) { if ((unsigned long )warn_sync_abort != (unsigned long )((char const **)0)) { *warn_sync_abort = (unsigned int )*((unsigned short *)(& os) + 0UL) == 288U || (unsigned int )*((unsigned short *)(& os) + 0UL) == 304U ? "Online-verify" : "Resync"; } else { } ns.ldv_35533.conn = 10U; } else { } if ((int )ns.ldv_35533.conn > 9 && (((unsigned int )*((unsigned char *)(& ns) + 1UL) == 14U || (unsigned int )*((unsigned char *)(& ns) + 1UL) == 10U) || ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 6U && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 224U))) { switch ((int )ns.ldv_35533.conn) { case 14: ; case 21: ns.ldv_35533.disk = 5U; goto ldv_45570; case 10: ; case 13: ; case 16: ; case 20: ns.ldv_35533.disk = 8U; goto ldv_45570; case 17: ns.ldv_35533.disk = 4U; dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Implicitly set disk state Inconsistent!\n"); goto ldv_45570; } ldv_45570: ; if ((unsigned int )*((unsigned char *)(& os) + 1UL) == 10U && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 16U) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Implicitly set disk from Outdated to UpToDate\n"); } else { } } else { } if ((int )ns.ldv_35533.conn > 9 && (*((unsigned int *)(& ns) + 0UL) == 57344U || *((unsigned int *)(& ns) + 0UL) == 40960U)) { switch ((int )ns.ldv_35533.conn) { case 10: ; case 14: ; case 21: ; case 17: ns.ldv_35533.pdsk = 8U; goto ldv_45580; case 13: ; case 20: ns.ldv_35533.pdsk = (int )os.ldv_35533.pdsk > 0 && (int )os.ldv_35533.pdsk <= 4 ? os.ldv_35533.pdsk : 5U; goto ldv_45580; case 16: ns.ldv_35533.pdsk = 4U; dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Implicitly set pdsk Inconsistent!\n"); goto ldv_45580; } ldv_45580: ; if (*((unsigned int *)(& os) + 0UL) == 40960U && *((unsigned int *)(& ns) + 0UL) == 65536U) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Implicitly set pdsk from Outdated to UpToDate\n"); } else { } } else { } if ((int )ns.ldv_35533.conn <= 9 && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 6U) { tmp___0 = _get_ldev_if_state(mdev, D_NEGOTIATING); if (tmp___0 != 0) { if (mdev->ed_uuid == (mdev->ldev)->md.uuid[0]) { ns.ldv_35533.disk = mdev->new_state_tmp.ldv_35533.disk; ns.ldv_35533.pdsk = mdev->new_state_tmp.ldv_35533.pdsk; } else { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "Connection lost while negotiating, no data!\n"); ns.ldv_35533.disk = 0U; ns.ldv_35533.pdsk = 6U; } put_ldev(mdev); } else { } } else { } if (((unsigned int )fp == 2U && (((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U && (int )ns.ldv_35533.conn <= 9) && (int )ns.ldv_35533.pdsk > 5)) && (((unsigned int )*((unsigned char *)(& os) + 0UL) != 1U || (int )os.ldv_35533.conn > 9) || (int )os.ldv_35533.pdsk <= 5)) { ns.ldv_35533.susp_fen = 1U; } else { } if ((mdev->sync_conf.on_no_data == 1 && (((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U && (int )ns.ldv_35533.disk <= 7) && (int )ns.ldv_35533.pdsk <= 7)) && (((unsigned int )*((unsigned char *)(& os) + 0UL) != 1U || (int )os.ldv_35533.disk > 7) || (int )os.ldv_35533.pdsk > 7)) { ns.ldv_35533.susp_nod = 1U; } else { } if (((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U || (unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) || (unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 256U) { ns.ldv_35533.conn = 20U; } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 272U) { ns.ldv_35533.conn = 21U; } else { } } else { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 320U) { ns.ldv_35533.conn = 16U; } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 336U) { ns.ldv_35533.conn = 17U; } else { } } return (ns); } } static void set_ov_position(struct drbd_conf *mdev , enum drbd_conns cs ) { unsigned long bit ; { if ((unsigned int )cs == 19U) { mdev->ov_start_sector = 0xffffffffffffffffUL; } else { bit = mdev->ov_start_sector >> 3; if (mdev->rs_total <= bit) { mdev->ov_start_sector = (mdev->rs_total - 1UL) << 3; } else { } mdev->ov_position = mdev->ov_start_sector; } 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; } } int __drbd_set_state(struct drbd_conf *mdev , union drbd_state ns , enum chg_state_flags flags , struct completion *done ) { union drbd_state os ; int rv ; char const *warn_sync_abort ; struct after_state_chg_work *ascw ; int 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 now ; int i ; u32 mdf ; int tmp___24 ; int tmp___25 ; void *tmp___26 ; { rv = 1; warn_sync_abort = 0; os = mdev->state; ns = sanitize_state(mdev, os, ns, & warn_sync_abort); if (ns.i == os.i) { return (2); } else { } if (((unsigned int )flags & 1U) == 0U) { rv = is_valid_state(mdev, ns); if (rv <= 0) { tmp = is_valid_state(mdev, os); if (tmp == rv) { rv = is_valid_state_transition(mdev, ns, os); } else { rv = is_valid_state_transition(mdev, ns, os); } } else { } } else { } if (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 = 0; if ((int )ns.ldv_35533.role != (int )os.ldv_35533.role) { tmp___0 = drbd_role_str((enum drbd_role )ns.ldv_35533.role); tmp___1 = drbd_role_str((enum drbd_role )os.ldv_35533.role); tmp___2 = sprintf(pbp, "role( %s -> %s ) ", tmp___1, tmp___0); pbp = pbp + (unsigned long )tmp___2; } else { } if ((int )ns.ldv_35533.peer != (int )os.ldv_35533.peer) { tmp___3 = drbd_role_str((enum drbd_role )ns.ldv_35533.peer); tmp___4 = drbd_role_str((enum drbd_role )os.ldv_35533.peer); tmp___5 = sprintf(pbp, "peer( %s -> %s ) ", tmp___4, tmp___3); pbp = pbp + (unsigned long )tmp___5; } else { } if ((int )ns.ldv_35533.conn != (int )os.ldv_35533.conn) { tmp___6 = drbd_conn_str((enum drbd_conns )ns.ldv_35533.conn); tmp___7 = drbd_conn_str((enum drbd_conns )os.ldv_35533.conn); tmp___8 = sprintf(pbp, "conn( %s -> %s ) ", tmp___7, tmp___6); pbp = pbp + (unsigned long )tmp___8; } else { } if ((int )ns.ldv_35533.disk != (int )os.ldv_35533.disk) { tmp___9 = drbd_disk_str((enum drbd_disk_state )ns.ldv_35533.disk); tmp___10 = drbd_disk_str((enum drbd_disk_state )os.ldv_35533.disk); tmp___11 = sprintf(pbp, "disk( %s -> %s ) ", tmp___10, tmp___9); pbp = pbp + (unsigned long )tmp___11; } else { } if ((int )ns.ldv_35533.pdsk != (int )os.ldv_35533.pdsk) { tmp___12 = drbd_disk_str((enum drbd_disk_state )ns.ldv_35533.pdsk); tmp___13 = drbd_disk_str((enum drbd_disk_state )os.ldv_35533.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( %s -> %s ) ", tmp___16 != 0 ? (char *)"1" : (char *)"0", tmp___15 != 0 ? (char *)"1" : (char *)"0"); pbp = pbp + (unsigned long )tmp___17; } else { } if ((int )ns.ldv_35533.aftr_isp != (int )os.ldv_35533.aftr_isp) { tmp___20 = sprintf(pbp, "aftr_isp( %s -> %s ) ", (unsigned int )*((unsigned char *)(& os) + 2UL) != 0U ? (char *)"1" : (char *)"0", (unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U ? (char *)"1" : (char *)"0"); pbp = pbp + (unsigned long )tmp___20; } else { } if ((int )ns.ldv_35533.peer_isp != (int )os.ldv_35533.peer_isp) { tmp___21 = sprintf(pbp, "peer_isp( %s -> %s ) ", (unsigned int )*((unsigned char *)(& os) + 2UL) != 0U ? (char *)"1" : (char *)"0", (unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U ? (char *)"1" : (char *)"0"); pbp = pbp + (unsigned long )tmp___21; } else { } if ((int )ns.ldv_35533.user_isp != (int )os.ldv_35533.user_isp) { tmp___22 = sprintf(pbp, "user_isp( %s -> %s ) ", (unsigned int )*((unsigned char *)(& os) + 2UL) != 0U ? (char *)"1" : (char *)"0", (unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U ? (char *)"1" : (char *)"0"); 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 && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 0U) && (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 { } mdev->state.i = ns.i; __wake_up(& mdev->misc_wait, 3U, 1, 0); __wake_up(& mdev->state_wait, 3U, 1, 0); if (((unsigned int )*((unsigned short *)(& os) + 0UL) == 288U || (unsigned int )*((unsigned short *)(& os) + 0UL) == 304U) && (int )ns.ldv_35533.conn <= 9) { mdev->ov_start_sector = (mdev->rs_total - 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 { } if (((unsigned int )*((unsigned short *)(& os) + 0UL) == 336U || (unsigned int )*((unsigned short *)(& os) + 0UL) == 320U) && ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 272U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 256U)) { _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, jiffies); } else { } } else { } if (((unsigned int )*((unsigned short *)(& os) + 0UL) == 272U || (unsigned int )*((unsigned short *)(& os) + 0UL) == 256U) && ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 336U || (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] = jiffies; } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 160U && ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 304U)) { now = jiffies; mdev->ov_position = 0UL; mdev->rs_total = drbd_bm_bits(mdev); if (mdev->agreed_pro_version > 89) { set_ov_position(mdev, (enum drbd_conns )ns.ldv_35533.conn); } else { mdev->ov_start_sector = 0UL; } mdev->ov_left = mdev->rs_total - (mdev->ov_position >> 3); 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_45607; ldv_45606: mdev->rs_mark_left[i] = mdev->rs_total; mdev->rs_mark_time[i] = now; i = i + 1; ldv_45607: ; if (i <= 7) { goto ldv_45606; } else { } 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, jiffies); } else { } } else { } tmp___25 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___25 != 0) { mdf = (mdev->ldev)->md.flags & 4294967176U; tmp___24 = constant_test_bit(11U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___24 != 0) { mdf = mdf | 64U; } else { } if ((unsigned int )*((unsigned char *)mdev + 2012UL) == 1U || ((int )mdev->state.ldv_35533.pdsk <= 3 && (unsigned int )*((unsigned char *)mdev + 2012UL) == 4U)) { mdf = mdf | 2U; } else { } if ((int )mdev->state.ldv_35533.conn > 9) { mdf = mdf | 4U; } else { } if ((int )mdev->state.ldv_35533.disk > 4) { mdf = mdf | 1U; } else { } if ((int )mdev->state.ldv_35533.disk > 5) { mdf = mdf | 16U; } else { } if ((int )mdev->state.ldv_35533.pdsk <= 5 && (int )mdev->state.ldv_35533.pdsk > 3) { mdf = mdf | 32U; } else { } if ((mdev->ldev)->md.flags != mdf) { (mdev->ldev)->md.flags = mdf; drbd_md_mark_dirty(mdev); } else { } if ((int )os.ldv_35533.disk <= 6 && (int )ns.ldv_35533.disk > 6) { drbd_set_ed_uuid(mdev, (mdev->ldev)->md.uuid[0]); } else { } put_ldev(mdev); } else { } if ((((unsigned int )*((unsigned char *)(& os) + 1UL) == 8U && *((unsigned int *)(& os) + 0UL) == 32768U) && (unsigned int )*((unsigned char *)(& os) + 0UL) == 8U) && (unsigned int )*((unsigned char *)(& ns) + 0UL) == 4U) { set_bit(14U, (unsigned long volatile *)(& mdev->flags)); } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 16U && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 16U) { drbd_thread_stop_nowait(& mdev->receiver); } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 0U && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 0U) { drbd_thread_stop_nowait(& mdev->receiver); } else { } if (((int )os.ldv_35533.conn > 7 && (int )ns.ldv_35533.conn <= 7) && (int )ns.ldv_35533.conn > 2) { drbd_thread_restart_nowait(& mdev->receiver); } else { } if ((int )os.ldv_35533.conn <= 9 && (int )ns.ldv_35533.conn > 9) { drbd_resume_al(mdev); } else { } tmp___26 = kmalloc___4(48UL, 32U); ascw = (struct after_state_chg_work *)tmp___26; 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 1244); } 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_35533.conn = 10U; mask.i = 0U; mask.ldv_35533.conn = 31U; _drbd_request_state(mdev, mask, val, CS_VERBOSE); return; } else { } switch ((int )mdev->state.ldv_35533.conn) { case 12: val___0.i = 0U; val___0.ldv_35533.conn = 15U; mask___0.i = 0U; mask___0.ldv_35533.conn = 31U; _drbd_request_state(mdev, mask___0, val___0, CS_VERBOSE); goto ldv_45631; case 11: drbd_start_resync(mdev, C_SYNC_SOURCE); goto ldv_45631; } ldv_45631: ; return; } } 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 ; enum drbd_io_error_p eh ; int tmp___4 ; int tmp___5 ; char const *tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; { what = nothing; nsm.i = 4294967295U; if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 160U && (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) & 0xfffffffffffffffdULL; } else { } } else { } fp = FP_DONT_CARE; tmp = _get_ldev_if_state(mdev, D_INCONSISTENT); 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 || (int )os.ldv_35533.disk > 7) || (int )os.ldv_35533.pdsk > 7) && (((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U && (int )ns.ldv_35533.disk <= 7) && (int )ns.ldv_35533.pdsk <= 7)) { drbd_khelper(mdev, (char *)"pri-on-incon-degr"); } else { } nsm.i = 4294967295U; if ((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { if ((int )os.ldv_35533.conn <= 9 && (int )ns.ldv_35533.conn > 9) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 160U) { what = resend; nsm.ldv_35533.susp_nod = 0U; } else { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unexpected Resynd going on!\n"); } } else { } if ((unsigned int )*((unsigned char *)(& os) + 1UL) == 2U && (int )ns.ldv_35533.disk > 1) { what = restart_frozen_disk_io; nsm.ldv_35533.susp_nod = 0U; } else { } } else { } if ((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { if ((int )os.ldv_35533.pdsk > 5 && (int )ns.ldv_35533.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)); drbd_md_sync(mdev); } else { } spin_lock_irq(& mdev->req_lock); __ns.i = mdev->state.i; __ns.ldv_35533.susp_fen = 0U; _drbd_set_state(mdev, __ns, CS_VERBOSE, 0); spin_unlock_irq(& mdev->req_lock); } else { } if ((int )os.ldv_35533.conn <= 9 && (int )ns.ldv_35533.conn > 9) { clear_bit(27, (unsigned long volatile *)(& mdev->flags)); what = resend; nsm.ldv_35533.susp_fen = 0U; } else { } } else { } if ((unsigned int )what != 24U) { spin_lock_irq(& mdev->req_lock); _tl_restart(mdev, what); nsm.i = nsm.i & mdev->state.i; _drbd_set_state(mdev, nsm, CS_VERBOSE, 0); spin_unlock_irq(& mdev->req_lock); } else { } if (*((unsigned int *)(& os) + 0UL) == 0U && (int )ns.ldv_35533.pdsk > 0) { drbd_send_uuids(mdev); drbd_send_state(mdev); } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 208U && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 208U) { drbd_queue_bitmap_io(mdev, & drbd_send_bitmap, 0, (char *)"send_bitmap (WFBitMapS)"); } else { } if ((((int )os.ldv_35533.pdsk > 3 && *((unsigned int *)(& os) + 0UL) != 49152U) && *((unsigned int *)(& os) + 0UL) != 40960U) && (((int )ns.ldv_35533.pdsk <= 3 || *((unsigned int *)(& ns) + 0UL) == 49152U) || *((unsigned int *)(& ns) + 0UL) == 40960U)) { tmp___2 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___2 != 0) { if ((((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U || (unsigned int )*((unsigned char *)(& ns) + 0UL) == 4U) && (mdev->ldev)->md.uuid[1] == 0ULL) && (int )ns.ldv_35533.disk > 7) { tmp___1 = is_susp(mdev->state); if (tmp___1 != 0) { set_bit(27U, (unsigned long volatile *)(& mdev->flags)); } else { drbd_uuid_new_current(mdev); drbd_send_uuids(mdev); } } else { } put_ldev(mdev); } else { } } else { } if ((int )ns.ldv_35533.pdsk <= 3) { tmp___3 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___3 != 0) { if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 4U && (mdev->ldev)->md.uuid[1] == 0ULL) { drbd_uuid_new_current(mdev); drbd_send_uuids(mdev); } else { } if ((unsigned int )*((unsigned char *)(& os) + 0UL) == 4U && (unsigned int )*((unsigned char *)(& ns) + 0UL) == 8U) { drbd_al_to_on_disk_bm(mdev); } else { } put_ldev(mdev); } else { } } else { } if (((int )ns.ldv_35533.conn > 9 && (unsigned int )*((unsigned char *)(& os) + 1UL) == 2U) && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 6U) { drbd_send_sizes(mdev, 0, 0); drbd_send_uuids(mdev); drbd_send_state(mdev); } else { } if ((int )ns.ldv_35533.conn > 9 && ((int )os.ldv_35533.aftr_isp != (int )ns.ldv_35533.aftr_isp || (int )os.ldv_35533.user_isp != (int )ns.ldv_35533.user_isp)) { drbd_send_state(mdev); } else { } if ((((unsigned int )*((unsigned char *)(& os) + 2UL) == 0U && (unsigned int )*((unsigned char *)(& os) + 2UL) == 0U) && (unsigned int )*((unsigned char *)(& os) + 2UL) == 0U) && (((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U || (unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) || (unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U)) { suspend_other_sg(mdev); } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 144U && (int )ns.ldv_35533.conn > 9) { drbd_send_state(mdev); } else { } if (((unsigned int )*((unsigned short *)(& os) + 0UL) != 192U && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 192U) || ((unsigned int )*((unsigned short *)(& os) + 0UL) != 176U && (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"); } else { } if ((((int )os.ldv_35533.conn <= 9 && (int )ns.ldv_35533.conn <= 9) && (int )os.ldv_35533.disk > 4) && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 8U) { drbd_queue_bitmap_io(mdev, & drbd_bmio_set_n_write, 0, (char *)"set_n_write from invalidate"); } else { } if ((int )os.ldv_35533.disk > 2 && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 4U) { eh = EP_PASS_ON; tmp___4 = drbd_send_state(mdev); if (tmp___4 != 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Notified peer that my disk is broken.\n"); } else { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Sending state for drbd_io_error() failed\n"); } drbd_rs_cancel_all(mdev); tmp___5 = _get_ldev_if_state(mdev, D_FAILED); if (tmp___5 != 0) { eh = (enum drbd_io_error_p )(mdev->ldev)->dc.on_io_error; put_ldev(mdev); } else { } if ((unsigned int )eh == 1U) { drbd_khelper(mdev, (char *)"local-io-error"); } else { } } else { } if ((unsigned int )*((unsigned char *)(& os) + 1UL) == 4U && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 0U) { mdev->rs_total = 0UL; mdev->rs_failed = 0UL; atomic_set(& mdev->rs_pending_cnt, 0); } else { } if ((int )os.ldv_35533.disk > 0 && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 0U) { if ((unsigned int )*((unsigned char *)mdev + 2013UL) != 0U) { tmp___6 = drbd_disk_str((enum drbd_disk_state )mdev->state.ldv_35533.disk); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: disk is %s while going diskless\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 detached my disk.\n"); } else { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Sending state for detach failed\n"); } lc_destroy(mdev->resync); mdev->resync = 0; lc_destroy(mdev->act_log); mdev->act_log = 0; drbd_free_bc(mdev->ldev); mdev->ldev = 0; if ((unsigned long )mdev->md_io_tmpp != (unsigned long )((struct page *)0)) { __free_pages(mdev->md_io_tmpp, 0U); mdev->md_io_tmpp = 0; } else { } } else { } if ((int )ns.ldv_35533.disk > 3 && (int )ns.ldv_35533.pdsk > 3) { tmp___8 = test_and_clear_bit(20, (unsigned long volatile *)(& mdev->flags)); if (tmp___8 != 0) { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 160U) { resync_after_online_grow(mdev); } else { } } else { } } else { } if ((((int )os.ldv_35533.conn > 10 && (int )ns.ldv_35533.conn <= 10) || ((unsigned int )*((unsigned char *)(& os) + 2UL) != 0U && (unsigned int )*((unsigned char *)(& ns) + 2UL) == 0U)) || ((unsigned int )*((unsigned char *)(& os) + 2UL) != 0U && (unsigned int )*((unsigned char *)(& ns) + 2UL) == 0U)) { resume_next_sg(mdev); } else { } if (((int )os.ldv_35533.disk <= 7 && (int )os.ldv_35533.conn > 15) && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 160U) { drbd_send_state(mdev); } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 0U) { tmp___9 = is_susp(ns); if (tmp___9 == 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 && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 32U) { drbd_thread_start(& mdev->receiver); } else { } if (((unsigned int )*((unsigned char *)(& ns) + 1UL) == 0U && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 0U) && (unsigned int )*((unsigned char *)(& ns) + 0UL) == 2U) { if ((int )os.ldv_35533.aftr_isp != (int )ns.ldv_35533.aftr_isp) { resume_next_sg(mdev); } else { } tmp___10 = constant_test_bit(23U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___10 != 0) { drbd_thread_stop_nowait(& mdev->worker); } 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 = Running; spin_unlock_irqrestore(& thi->t_lock, flags); goto restart; } else { } thi->task = 0; thi->t_state = None; __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)); module_put(& __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_5620.rlock, "&(&thi->t_lock)->rlock", & __key); thi->task = 0; thi->t_state = None; 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 ; raw_spinlock_t *tmp ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; int tmp___2 ; struct task_struct *tmp___3 ; unsigned int tmp___4 ; long tmp___5 ; raw_spinlock_t *tmp___6 ; struct task_struct *tmp___7 ; struct task_struct *tmp___8 ; { mdev = thi->mdev; me = (unsigned long )(& mdev->receiver) != (unsigned long )thi ? ((unsigned long )(& mdev->asender) != (unsigned long )thi ? ((unsigned long )(& mdev->worker) == (unsigned long )thi ? "worker" : "NONSENSE") : "asender") : "receiver"; tmp = spinlock_check(& thi->t_lock); flags = _raw_spin_lock_irqsave(tmp); switch ((unsigned int )thi->t_state) { case 0U: tmp___0 = get_current(); tmp___1 = get_current(); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Starting %s thread (from %s [%d])\n", me, (char *)(& tmp___1->comm), tmp___0->pid); tmp___2 = try_module_get(& __this_module); if (tmp___2 == 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 1605); } else { } thi->reset_cpu_mask = 1; thi->t_state = Running; spin_unlock_irqrestore(& thi->t_lock, flags); tmp___3 = get_current(); flush_signals(tmp___3); tmp___4 = mdev_to_minor(mdev); nt = kthread_create(& drbd_thread_setup, (void *)thi, "drbd%d_%s", tmp___4, me); tmp___5 = IS_ERR((void const *)nt); if (tmp___5 != 0L) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Couldn\'t start thread\n"); module_put(& __this_module); return (0); } else { } tmp___6 = spinlock_check(& thi->t_lock); flags = _raw_spin_lock_irqsave(tmp___6); thi->task = nt; thi->t_state = Running; spin_unlock_irqrestore(& thi->t_lock, flags); wake_up_process(nt); goto ldv_45678; case 2U: thi->t_state = Restarting; tmp___7 = get_current(); tmp___8 = get_current(); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Restarting %s thread (from %s [%d])\n", me, (char *)(& tmp___8->comm), tmp___7->pid); case 1U: ; case 3U: ; default: spin_unlock_irqrestore(& thi->t_lock, flags); goto ldv_45678; } ldv_45678: ; return (1); } } void _drbd_thread_stop(struct drbd_thread *thi , int restart , int wait ) { unsigned long flags ; enum drbd_thread_state ns ; raw_spinlock_t *tmp ; struct task_struct *tmp___0 ; { ns = restart != 0 ? Restarting : Exiting; tmp = spinlock_check(& thi->t_lock); flags = _raw_spin_lock_irqsave(tmp); 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___0 = get_current(); if ((unsigned long )thi->task != (unsigned long )tmp___0) { 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(cpu_online_mask); ord = (int )(tmp___0 % tmp___1); cpu = -1; goto ldv_45699; ldv_45698: tmp___2 = ord; ord = ord - 1; if (tmp___2 == 0) { cpumask_set_cpu((unsigned int )cpu, mdev->cpu_mask); return; } else { } ldv_45699: tmp___3 = cpumask_next(cpu, cpu_online_mask); cpu = (int )tmp___3; if (cpu < nr_cpu_ids) { goto ldv_45698; } else { } 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 ; int _b ; { tmp = get_current(); p = tmp; thi = (unsigned long )mdev->asender.task == (unsigned long )p ? & mdev->asender : ((unsigned long )mdev->receiver.task == (unsigned long )p ? & mdev->receiver : ((unsigned long )mdev->worker.task == (unsigned long )p ? & mdev->worker : 0)); _b = (unsigned long )thi == (unsigned long )((struct drbd_thread *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "drbd_thread_current_set_cpu", (char *)"thi == NULL", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 1720); } 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 ; { _b = (unsigned long )h == (unsigned long )((struct p_header80 *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "_drbd_send_cmd", (char *)"!h", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 1736); } else { } if (_b != 0) { return (0); } else { } _b___0 = size == 0UL; if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "_drbd_send_cmd", (char *)"!size", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 1737); } else { } if (_b___0 != 0) { return (0); } else { } h->magic = 1728214147U; tmp = __fswab16((int )((__u16 )cmd)); h->command = tmp; tmp___0 = __fswab16((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___1 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "short sent %s size=%d sent=%d\n", tmp___1, (int )size, sent); } 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) { ldv_mutex_lock_129(& mdev->data.mutex); sock = mdev->data.socket; } else { ldv_mutex_lock_130(& mdev->meta.mutex); sock = mdev->meta.socket; } tmp = ldv__builtin_expect((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) { ldv_mutex_unlock_131(& mdev->data.mutex); } else { ldv_mutex_unlock_132(& 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((int )((__u16 )cmd)); h.command = tmp; tmp___0 = __fswab16((int )((__u16 )size)); h.length = tmp___0; tmp___1 = drbd_get_data_sock___0(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___0(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 ; enum drbd_packets cmd ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; long tmp___6 ; { apv = mdev->agreed_pro_version; if (apv > 87) { if (apv == 88) { tmp = strlen((char const *)(& mdev->sync_conf.verify_alg)); tmp___0 = (int )((unsigned int )tmp + 13U); } else { tmp___0 = apv <= 94 ? 140 : 156; } size = tmp___0; } else { size = 12; } ldv_mutex_lock_133(& mdev->data.mutex); sock = mdev->data.socket; tmp___6 = ldv__builtin_expect((unsigned long )sock != (unsigned long )((struct socket *)0), 1L); if (tmp___6 != 0L) { cmd = apv > 88 ? P_SYNC_PARAM89 : P_SYNC_PARAM; p = & mdev->data.sbuf.rs_param_95; memset((void *)(& p->verify_alg), 0, 128UL); tmp___1 = __fswab32((__u32 )sc->rate); p->rate = tmp___1; tmp___2 = __fswab32((__u32 )sc->c_plan_ahead); p->c_plan_ahead = tmp___2; tmp___3 = __fswab32((__u32 )sc->c_delay_target); p->c_delay_target = tmp___3; tmp___4 = __fswab32((__u32 )sc->c_fill_target); p->c_fill_target = tmp___4; tmp___5 = __fswab32((__u32 )sc->c_max_rate); p->c_max_rate = tmp___5; 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; } ldv_mutex_unlock_134(& 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___4((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 + 528UL) != 0U) { cf = cf | 1; } else { } if ((unsigned int )*((unsigned char *)mdev->net_conf + 528UL) != 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 (0); } } 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, P_PROTOCOL, (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 ; int tmp___2 ; __u64 tmp___3 ; int tmp___4 ; { tmp = _get_ldev_if_state(mdev, D_NEGOTIATING); if (tmp == 0) { return (1); } else { } i = 0; goto ldv_45765; ldv_45764: ; 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_45765: ; if (i <= 3) { goto ldv_45764; } else { } mdev->comm_bm_set = drbd_bm_total_weight(mdev); tmp___1 = __fswab64((__u64 )mdev->comm_bm_set); p.uuid[4] = tmp___1; uuid_flags = ((unsigned int )*((unsigned char *)mdev->net_conf + 528UL) != 0U ? 1ULL : 0ULL) | uuid_flags; tmp___2 = constant_test_bit(11U, (unsigned long const volatile *)(& mdev->flags)); uuid_flags = (tmp___2 != 0 ? 2ULL : 0ULL) | uuid_flags; uuid_flags = ((unsigned int )*((unsigned char *)mdev + 2009UL) == 8U ? 4ULL : 0ULL) | uuid_flags; tmp___3 = __fswab64(uuid_flags); p.uuid[5] = tmp___3; put_ldev(mdev); tmp___4 = drbd_send_cmd(mdev, 1, P_UUIDS, (struct p_header80 *)(& p), 56UL); return (tmp___4); } } 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); } } int drbd_send_sync_uuid(struct drbd_conf *mdev , u64 val ) { struct p_rs_uuid p ; __u64 tmp ; int tmp___0 ; { tmp = __fswab64(val); p.uuid = tmp; tmp___0 = drbd_send_cmd(mdev, 1, P_SYNC_UUID, (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 ok ; int tmp ; __u64 tmp___0 ; __u64 tmp___1 ; sector_t tmp___2 ; __u64 tmp___3 ; __u64 tmp___4 ; unsigned int tmp___5 ; __u32 tmp___6 ; __u16 tmp___7 ; __u16 tmp___8 ; { tmp = _get_ldev_if_state(mdev, D_NEGOTIATING); if (tmp != 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 1949); } 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); put_ldev(mdev); } else { d_size = 0UL; u_size = 0UL; q_order_type = 0; } tmp___0 = __fswab64((__u64 )d_size); p.d_size = tmp___0; tmp___1 = __fswab64((__u64 )u_size); p.u_size = tmp___1; if (trigger_reply == 0) { tmp___2 = drbd_get_capacity(mdev->this_bdev); tmp___3 = (__u64 )tmp___2; } else { tmp___3 = 0ULL; } tmp___4 = __fswab64(tmp___3); p.c_size = tmp___4; tmp___5 = queue_max_segment_size(mdev->rq_queue); tmp___6 = __fswab32(tmp___5); p.max_segment_size = tmp___6; tmp___7 = __fswab16((int )((__u16 )q_order_type)); p.queue_order_type = tmp___7; tmp___8 = __fswab16((int )((__u16 )flags)); p.dds_flags = tmp___8; ok = drbd_send_cmd(mdev, 1, P_SIZES, (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); ldv_mutex_lock_135(& mdev->data.mutex); tmp = __fswab32(mdev->state.i); p.state = tmp; sock = mdev->data.socket; tmp___0 = ldv__builtin_expect((unsigned long )sock != (unsigned long )((struct socket *)0), 1L); if (tmp___0 != 0L) { ok = _drbd_send_cmd(mdev, sock, P_STATE, (struct p_header80 *)(& p), 12UL, 0U); } else { } ldv_mutex_unlock_136(& 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, P_STATE_CHG_REQ, (struct p_header80 *)(& p), 16UL); return (tmp___1); } } int drbd_send_sr_reply(struct drbd_conf *mdev , int 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, P_STATE_CHG_REPLY, (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 || 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_45819: ; 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 == 0xffffffffffffffffUL) { tmp = c->bm_bits; } else { } rl = tmp - c->bit_offset; if (toggle == 2U) { if (rl == 0UL) { DCBP_set_start(p, 1); toggle = toggle == 0U; goto ldv_45817; } 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_45818; } else { } if (bits <= 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "error while encoding bitmap: %d\n", bits); return (0); } else { } toggle = toggle == 0U; plain_bits = plain_bits + rl; c->bit_offset = tmp; ldv_45817: ; if (c->bit_offset < c->bm_bits) { goto ldv_45819; } else { } ldv_45818: 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); } } enum ldv_30403 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 ; { p = (struct p_compressed_bm *)h; len = fill_bitmap_rle_bits(mdev, p, c); if (len < 0) { return (FAILED); } else { } if (len != 0) { DCBP_set_code(p, RLE_VLI_Bits); ok = _drbd_send_cmd(mdev, mdev->data.socket, P_COMPRESSED_BITMAP, 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; num_words = __min1 < __min2 ? __min1 : __min2; 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, P_BITMAP, 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 { } } ok = ok != 0 ? (len == 0 ? 2 : 0) : 1; if (ok == 2) { INFO_bm_xfer_stats(mdev, "send", c); } else { } return ((enum ldv_30403 )ok); } } int _drbd_send_bitmap(struct drbd_conf *mdev ) { struct bm_xfer_ctx c ; struct p_header80 *p ; int ret ; 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 ; enum ldv_30403 tmp___5 ; { _b = (unsigned long )mdev->bitmap == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "_drbd_send_bitmap", (char *)"!mdev->bitmap", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2174); } 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, D_INCONSISTENT); 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_45846: tmp___5 = send_bitmap_rle_or_plain(mdev, p, & c); ret = (int )tmp___5; if (ret == 0) { goto ldv_45846; } else { } free_pages((unsigned long )p, 0U); return (ret == 2); } } int drbd_send_bitmap(struct drbd_conf *mdev ) { int err ; int tmp ; int tmp___0 ; { tmp = drbd_get_data_sock___0(mdev); if (tmp == 0) { return (-1); } else { } tmp___0 = _drbd_send_bitmap(mdev); err = tmp___0 == 0; drbd_put_data_sock___0(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_35533.conn <= 9) { return (0); } else { } ok = drbd_send_cmd(mdev, 0, P_BARRIER_ACK, (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) || (int )mdev->state.ldv_35533.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 && (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; } 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_42995.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((int )((__u16 )cmd)); p.head.command = tmp___1; tmp___2 = __fswab16((int )((unsigned int )((__u16 )digest_size) + 24U)); p.head.length = tmp___2; ldv_mutex_lock_137(& mdev->data.mutex); 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; ldv_mutex_unlock_138(& 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, P_OV_REQUEST, (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 || (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_35533.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___1(); 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___1(); __constr_expr_0.seg = 0xffffffffffffffffUL; tmp___3->addr_limit = __constr_expr_0; ldv_45945: 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_45942; } else { goto ldv_45943; } } 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_45942; } else { } len = len - sent; offset = offset + sent; ldv_45943: ; if (len > 0) { goto ldv_45945; } else { } ldv_45942: tmp___6 = current_thread_info___1(); tmp___6->addr_limit = oldfs; clear_bit(21, (unsigned long volatile *)(& mdev->flags)); ok = len == 0; tmp___7 = ldv__builtin_expect(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 ; int tmp ; { bvec = bio->bi_io_vec; i = 0; goto ldv_45953; ldv_45952: tmp = _drbd_no_send_page(mdev, bvec->bv_page, (int )bvec->bv_offset, (size_t )bvec->bv_len, (int )bio->bi_vcnt + -1 == i ? 0U : 32768U); if (tmp == 0) { return (0); } else { } bvec = bvec + 1; i = i + 1; ldv_45953: ; if ((int )bio->bi_vcnt > i) { goto ldv_45952; } else { } return (1); } } static int _drbd_send_zc_bio(struct drbd_conf *mdev , struct bio *bio ) { struct bio_vec *bvec ; int i ; int tmp ; { bvec = bio->bi_io_vec; i = 0; goto ldv_45962; ldv_45961: tmp = _drbd_send_page(mdev, bvec->bv_page, (int )bvec->bv_offset, (size_t )bvec->bv_len, (int )bio->bi_vcnt + -1 == i ? 0U : 32768U); if (tmp == 0) { return (0); } else { } bvec = bvec + 1; i = i + 1; ldv_45962: ; if ((int )bio->bi_vcnt > i) { goto ldv_45961; } else { } 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 ; struct page *tmp ; int tmp___0 ; struct page *tmp___1 ; { page = e->pages; len = e->size; goto ldv_45976; ldv_45975: __min1 = len; __min2 = 4096U; l = __min1 < __min2 ? __min1 : __min2; tmp = page_chain_next(page); tmp___0 = _drbd_send_page(mdev, page, 0, (size_t )l, (unsigned long )tmp != (unsigned long )((struct page *)0) ? 32768U : 0U); if (tmp___0 == 0) { return (0); } else { } len = len - l; page = page_chain_next(page); ldv_45976: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { tmp___1 = page_chain_next(page); __builtin_prefetch((void const *)tmp___1); if (1 != 0) { goto ldv_45975; } else { goto ldv_45977; } } else { } ldv_45977: ; return (1); } } static u32 bio_flags_to_wire(struct drbd_conf *mdev , unsigned long bi_rw ) { { if (mdev->agreed_pro_version > 94) { return ((u32 )((((((bi_rw & 32UL) != 0UL ? 2 : 0) | ((bi_rw & 512UL) != 0UL ? 8 : 0)) | ((bi_rw & 16384UL) != 0UL ? 16 : 0)) | ((bi_rw & 67108864UL) != 0UL ? 32 : 0)) | ((bi_rw & 128UL) != 0UL ? 64 : 0))); } else { return ((bi_rw & 544UL) != 0UL ? 2U : 0U); } } } 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 ; int tmp___7 ; { ok = 1; dp_flags = 0U; tmp = drbd_get_data_sock___0(mdev); if (tmp == 0) { return (0); } else { } if (mdev->agreed_pro_version > 86 && (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; } if (req->size <= 32768U) { p.head.h80.magic = 1728214147U; p.head.h80.command = 0U; tmp___1 = __fswab16((int )((unsigned int )((int )((__u16 )dgs) + (int )((__u16 )req->size)) + 24U)); p.head.h80.length = tmp___1; } else { p.head.h95.magic = 23171U; p.head.h95.command = 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_35533.conn > 15 && (int )mdev->state.ldv_35533.conn <= 21) { dp_flags = dp_flags | 4U; } else { } tmp___6 = __fswab32(dp_flags); p.dp_flags = tmp___6; set_bit(4U, (unsigned long volatile *)(& mdev->flags)); tmp___7 = drbd_send(mdev, mdev->data.socket, (void *)(& p), 32UL, dgs != 0 ? 32768U : 0U); ok = tmp___7 == 32; if (ok != 0 && dgs != 0) { dgb = mdev->int_dig_out; drbd_csum_bio(mdev, mdev->integrity_w_tfm, req->master_bio, dgb); ok = drbd_send(mdev, mdev->data.socket, dgb, (size_t )dgs, 0U); } else { } if (ok != 0) { if ((mdev->net_conf)->wire_protocol == 1) { ok = _drbd_send_bio(mdev, req->master_bio); } else { ok = _drbd_send_zc_bio(mdev, req->master_bio); } } else { } drbd_put_data_sock___0(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 ; int tmp___6 ; { if (mdev->agreed_pro_version > 86 && (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; } if (e->size <= 32768U) { p.head.h80.magic = 1728214147U; tmp___0 = __fswab16((int )((__u16 )cmd)); p.head.h80.command = tmp___0; tmp___1 = __fswab16((int )((unsigned int )((int )((__u16 )dgs) + (int )((__u16 )e->size)) + 24U)); p.head.h80.length = tmp___1; } else { p.head.h95.magic = 23171U; tmp___2 = __fswab16((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_42995.block_id; tmp___5 = drbd_get_data_sock___0(mdev); if (tmp___5 == 0) { return (0); } else { } tmp___6 = drbd_send(mdev, mdev->data.socket, (void *)(& p), 32UL, dgs != 0 ? 32768U : 0U); ok = tmp___6 == 32; if (ok != 0 && dgs != 0) { dgb = mdev->int_dig_out; drbd_csum_ee(mdev, mdev->integrity_w_tfm, e, dgb); ok = drbd_send(mdev, mdev->data.socket, dgb, (size_t )dgs, 0U); } else { } if (ok != 0) { ok = _drbd_send_zc_ee(mdev, e); } else { } drbd_put_data_sock___0(mdev); return (ok); } } 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 ; 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 = 0; msg.msg_namelen = 0; msg.msg_control = 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_46013: rv = kernel_sendmsg(sock, & msg, & iov, 1UL, size); if (rv == -11) { tmp = we_should_drop_the_connection(mdev, sock); if (tmp != 0) { goto ldv_46011; } else { goto ldv_46012; } } else { } if (rv == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( rv != 0 ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2698); } else { } if (rv == -4) { tmp___0 = get_current(); flush_signals(tmp___0); rv = 0; } else { } if (rv < 0) { goto ldv_46011; } else { } sent = sent + rv; iov.iov_base = iov.iov_base + (unsigned long )rv; iov.iov_len = iov.iov_len - (size_t )rv; ldv_46012: ; if ((size_t )sent < size) { goto ldv_46013; } else { } ldv_46011: ; if ((unsigned long )mdev->data.socket == (unsigned long )sock) { clear_bit(21, (unsigned long volatile *)(& mdev->flags)); } else { } if (rv <= 0) { if (rv != -11) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s_sendmsg returned %d\n", (unsigned long )mdev->meta.socket == (unsigned long )sock ? (char *)"msock" : (char *)"sock", rv); val.i = 0U; val.ldv_35533.conn = 4U; mask.i = 0U; mask.ldv_35533.conn = 31U; drbd_force_state(mdev, mask, val); } else { val___0.i = 0U; val___0.ldv_35533.conn = 3U; mask___0.i = 0U; mask___0.ldv_35533.conn = 31U; 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; ldv_mutex_lock_139(& drbd_main_mutex); tmp = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp); if ((unsigned int )*((unsigned char *)mdev + 2012UL) != 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); ldv_mutex_unlock_140(& 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; ldv_mutex_lock_141(& drbd_main_mutex); mdev->open_cnt = mdev->open_cnt - 1; ldv_mutex_unlock_142(& drbd_main_mutex); return (0); } } static void drbd_unplug_fn(struct request_queue *q ) { struct drbd_conf *mdev ; int tmp ; int tmp___0 ; { mdev = (struct drbd_conf *)q->queuedata; spin_lock_irq(q->queue_lock); blk_remove_plug(q); spin_unlock_irq(q->queue_lock); spin_lock_irq(& mdev->req_lock); if ((int )mdev->state.ldv_35533.pdsk > 3 && (int )mdev->state.ldv_35533.conn > 9) { if ((unsigned int )*((unsigned char *)mdev + 2012UL) != 1U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.role == R_PRIMARY ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2773); } else { } tmp___0 = test_and_clear_bit(4, (unsigned long volatile *)(& mdev->flags)); if (tmp___0 != 0) { tmp = list_empty((struct list_head const *)(& mdev->unplug_work.list)); if (tmp != 0) { drbd_queue_work(& mdev->data.work, & mdev->unplug_work); } else { } } else { } } else { } spin_unlock_irq(& mdev->req_lock); if ((int )mdev->state.ldv_35533.disk > 3) { drbd_kick_lo(mdev); } else { } return; } } 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 = 0U; __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_35533.role = 2U; __constr_expr_1.ldv_35533.peer = 0U; __constr_expr_1.ldv_35533.conn = 0U; __constr_expr_1.ldv_35533.disk = 0U; __constr_expr_1.ldv_35533.pdsk = 6U; __constr_expr_1.ldv_35533.susp = 0U; __constr_expr_1.ldv_35533.aftr_isp = (unsigned char)0; __constr_expr_1.ldv_35533.peer_isp = (unsigned char)0; __constr_expr_1.ldv_35533.user_isp = (unsigned char)0; __constr_expr_1.ldv_35533.susp_nod = 0U; __constr_expr_1.ldv_35533.susp_fen = 0U; __constr_expr_1.ldv_35533._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 ; { drbd_set_defaults(mdev); set_bit(13U, (unsigned long volatile *)(& mdev->flags)); 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); __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_5620.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_5620.rlock, "&(&mdev->meta.work.q_lock)->rlock", & __key___4); spinlock_check(& mdev->al_lock); __raw_spin_lock_init(& mdev->al_lock.ldv_5620.rlock, "&(&mdev->al_lock)->rlock", & __key___5); spinlock_check(& mdev->req_lock); __raw_spin_lock_init(& mdev->req_lock.ldv_5620.rlock, "&(&mdev->req_lock)->rlock", & __key___6); spinlock_check(& mdev->peer_seq_lock); __raw_spin_lock_init(& mdev->peer_seq_lock.ldv_5620.rlock, "&(&mdev->peer_seq_lock)->rlock", & __key___7); spinlock_check(& mdev->epoch_lock); __raw_spin_lock_init(& mdev->epoch_lock.ldv_5620.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->bm_io_work.w.list); mdev->resync_work.cb = & w_resync_inactive; 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; init_timer_key(& mdev->resync_timer, "&mdev->resync_timer", & __key___9); init_timer_key(& mdev->md_sync_timer, "&mdev->md_sync_timer", & __key___10); 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; __init_waitqueue_head(& mdev->misc_wait, & __key___11); __init_waitqueue_head(& mdev->state_wait, & __key___12); __init_waitqueue_head(& mdev->net_cnt_wait, & __key___13); __init_waitqueue_head(& mdev->ee_wait, & __key___14); __init_waitqueue_head(& mdev->al_wait, & __key___15); __init_waitqueue_head(& mdev->seq_wait, & __key___16); 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 = 95; mdev->write_ordering = WO_bio_barrier; mdev->resync_wenr = 4294967295U; 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_46072; ldv_46071: mdev->rs_mark_left[i] = 0UL; mdev->rs_mark_time[i] = 0UL; i = i + 1; ldv_46072: ; if (i <= 7) { goto ldv_46071; } else { } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2931); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2947); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2948); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2949); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2950); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2951); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2952); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2953); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2954); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2955); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2956); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2957); } else { } return; } } static void drbd_destroy_mempools(void) { struct page *page ; { goto ldv_46079; ldv_46078: page = drbd_pp_pool; drbd_pp_pool = (struct page *)page->ldv_12351.ldv_12348.private; __free_pages(page, 0U); drbd_pp_vacant = drbd_pp_vacant - 1; ldv_46079: ; if ((unsigned long )drbd_pp_pool != (unsigned long )((struct page *)0)) { goto ldv_46078; } else { } 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 = 0; drbd_request_mempool = 0; drbd_ee_cache = 0; drbd_request_cache = 0; drbd_bm_ext_cache = 0; drbd_al_ext_cache = 0; return; } } static int drbd_create_mempools(void) { struct page *page ; int number ; int i ; struct lock_class_key __key ; { number = (int const )(minor_count * 32U); drbd_request_mempool = 0; drbd_ee_cache = 0; drbd_request_cache = 0; drbd_bm_ext_cache = 0; drbd_al_ext_cache = 0; drbd_pp_pool = 0; drbd_request_cache = kmem_cache_create("drbd_req", 120UL, 0UL, 0UL, 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, 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, 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, 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_request_mempool == (unsigned long )((mempool_t *)0)) { goto Enomem; } else { } spinlock_check(& drbd_pp_lock); __raw_spin_lock_init(& drbd_pp_lock.ldv_5620.rlock, "&(&drbd_pp_lock)->rlock", & __key); i = 0; goto ldv_46090; ldv_46089: page = alloc_pages(131282U, 0U); if ((unsigned long )page == (unsigned long )((struct page *)0)) { goto Enomem; } else { } page->ldv_12351.ldv_12348.private = (unsigned long )drbd_pp_pool; drbd_pp_pool = page; i = i + 1; ldv_46090: ; if (i < number) { goto ldv_46089; } else { } 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, 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3114); } 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), "%s: (%s) in %s:%d\n", "drbd_delete_device", (char *)"!list_empty(&mdev->data.work.q)", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3116); } else { } if (_b != 0) { lp = mdev->data.work.q.next; goto ldv_46111; ldv_46110: dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "lp = %p\n", lp); lp = lp->next; ldv_46111: __builtin_prefetch((void const *)lp->next); if ((unsigned long )(& mdev->data.work.q) != (unsigned long )lp) { goto ldv_46110; } else { } } 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); drbd_nl_cleanup(); if ((unsigned long )minor_table != (unsigned long )((struct drbd_conf **)0)) { if ((unsigned long )drbd_proc != (unsigned long )((struct proc_dir_entry *)0)) { remove_proc_entry("drbd", 0); } else { } i = minor_count; goto ldv_46118; ldv_46117: drbd_delete_device(i); ldv_46118: tmp = i; i = i - 1U; if (tmp != 0U) { goto ldv_46117; } else { } 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 ; int tmp ; int tmp___0 ; int tmp___1 ; { mdev = (struct drbd_conf *)congested_data; reason = 45; r = 0; tmp = __inc_ap_bio_cond___0(mdev); if (tmp == 0) { r = bdi_bits; reason = 100; goto out; } else { } tmp___0 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___0 != 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 = 98; } else { } } else { } if ((bdi_bits & 4) != 0) { tmp___1 = constant_test_bit(21U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___1 != 0) { r = r | 4; reason = (int )((signed char )reason) == 98 ? 97 : 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___2(4560UL, 208U); mdev = (struct drbd_conf *)tmp; if ((unsigned long )mdev == (unsigned long )((struct drbd_conf *)0)) { return (0); } else { } tmp___0 = zalloc_cpumask_var(& 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_26); blk_queue_max_segment_size(q, 131072U); blk_queue_bounce_limit(q, 0xffffffffffffffffULL); blk_queue_merge_bvec(q, & drbd_merge_bvec); q->queue_lock = & mdev->req_lock; q->unplug_fn = & drbd_unplug_fn; 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___2(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___2(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 (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); 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 || minor_count > 255U) { 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 = 0; tmp = kzalloc___2((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, 0, & drbd_proc_fops, 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.9rc2 (api:%d/proto:%d-%d)\n", 88, 86, 95); 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 { } bd_release(ldev->backing_bdev); bd_release(ldev->md_bdev); fput(ldev->lo_file); fput(ldev->md_file); kfree((void const *)ldev); return; } } void drbd_free_sock(struct drbd_conf *mdev ) { { if ((unsigned long )mdev->data.socket != (unsigned long )((struct socket *)0)) { ldv_mutex_lock_143(& mdev->data.mutex); kernel_sock_shutdown(mdev->data.socket, SHUT_RDWR); sock_release(mdev->data.socket); mdev->data.socket = 0; ldv_mutex_unlock_144(& mdev->data.mutex); } else { } if ((unsigned long )mdev->meta.socket != (unsigned long )((struct socket *)0)) { ldv_mutex_lock_145(& mdev->meta.mutex); kernel_sock_shutdown(mdev->meta.socket, SHUT_RDWR); sock_release(mdev->meta.socket); mdev->meta.socket = 0; ldv_mutex_unlock_146(& mdev->meta.mutex); } else { } return; } } void drbd_free_resources(struct drbd_conf *mdev ) { { crypto_free_hash(mdev->csums_tfm); mdev->csums_tfm = 0; crypto_free_hash(mdev->verify_tfm); mdev->verify_tfm = 0; crypto_free_hash(mdev->cram_hmac_tfm); mdev->cram_hmac_tfm = 0; crypto_free_hash(mdev->integrity_w_tfm); mdev->integrity_w_tfm = 0; crypto_free_hash(mdev->integrity_r_tfm); mdev->integrity_r_tfm = 0; drbd_free_sock(mdev); drbd_free_bc(mdev->ldev); mdev->ldev = 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 ; sector_t tmp___11 ; int tmp___12 ; sector_t tmp___13 ; { 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, D_FAILED); if (tmp___0 == 0) { return; } else { } ldv_mutex_lock_147(& mdev->md_io_mutex); 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_46182; ldv_46181: tmp___4 = __fswab64((mdev->ldev)->md.uuid[i]); buffer->uuid[i] = tmp___4; i = i + 1; ldv_46182: ; if (i <= 3) { goto ldv_46181; } else { } 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 = drbd_md_ss__(mdev, mdev->ldev); if ((unsigned long long )tmp___11 != (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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3525); } else { } sector = (sector_t )(mdev->ldev)->md.md_offset; tmp___12 = drbd_md_sync_page_io(mdev, mdev->ldev, sector, 1); if (tmp___12 == 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___13 = drbd_get_capacity(mdev->this_bdev); (mdev->ldev)->md.la_size_sect = (u64 )tmp___13; ldv_mutex_unlock_148(& 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 ; { rv = 101; tmp = _get_ldev_if_state(mdev, D_ATTACHING); if (tmp == 0) { return (118); } else { } ldv_mutex_lock_149(& mdev->md_io_mutex); 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_46194; ldv_46193: tmp___12 = __fswab64(buffer->uuid[i]); bdev->md.uuid[i] = tmp___12; i = i + 1; ldv_46194: ; if (i <= 3) { goto ldv_46193; } else { } 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; if (mdev->sync_conf.al_extents <= 6) { mdev->sync_conf.al_extents = 127; } else { } err: ldv_mutex_unlock_150(& mdev->md_io_mutex); put_ldev(mdev); return (rv); } } static void debug_drbd_uuid(struct drbd_conf *mdev , enum drbd_uuid_index index ) { char *uuid_str[6U] ; struct _ddebug descriptor ; long tmp ; { uuid_str[0] = (char *)"CURRENT"; uuid_str[1] = (char *)"BITMAP"; uuid_str[2] = (char *)"HISTORY_START"; uuid_str[3] = (char *)"HISTORY_END"; uuid_str[4] = (char *)"SIZE"; uuid_str[5] = (char *)"FLAGS"; if ((unsigned int )index > 5U) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), " uuid_index >= EXTENDED_SIZE\n"); return; } else { } descriptor.modname = "drbd"; descriptor.function = "debug_drbd_uuid"; descriptor.filename = "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared"; descriptor.format = " uuid[%s] now %016llX\n"; descriptor.lineno = 3635U; descriptor.flags = 0U; descriptor.enabled = (char)0; tmp = ldv__builtin_expect((int )((signed char )descriptor.enabled) != 0, 0L); if (tmp != 0L) { goto do_printk___0; } else { } goto out___0; do_printk___0: dev_printk("<7>", (struct device const *)(& (mdev->vdisk)->part0.__dev), " uuid[%s] now %016llX\n", uuid_str[(unsigned int )index], (mdev->ldev)->md.uuid[(unsigned int )index]); out___0: ; return; } } 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_46213; ldv_46212: (mdev->ldev)->md.uuid[i + 1] = (mdev->ldev)->md.uuid[i]; debug_drbd_uuid(mdev, (enum drbd_uuid_index )(i + 1)); i = i + 1; ldv_46213: ; if (i <= 2) { goto ldv_46212; } else { } return; } } void _drbd_uuid_set(struct drbd_conf *mdev , int idx , u64 val ) { { if (idx == 0) { if ((unsigned int )*((unsigned char *)mdev + 2012UL) == 1U) { val = val | 1ULL; } else { val = val & 0xfffffffffffffffeULL; } drbd_set_ed_uuid(mdev, val); } else { } (mdev->ldev)->md.uuid[idx] = val; debug_drbd_uuid(mdev, (enum drbd_uuid_index )idx); 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]; debug_drbd_uuid(mdev, UI_HISTORY_START); } else { } _drbd_uuid_set(mdev, idx, val); return; } } void drbd_uuid_new_current(struct drbd_conf *mdev ) { u64 val ; { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Creating new current UUID\n"); if ((mdev->ldev)->md.uuid[1] != 0ULL) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->ldev->md.uuid[UI_BITMAP] == 0 ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3713); } else { } (mdev->ldev)->md.uuid[1] = (mdev->ldev)->md.uuid[0]; debug_drbd_uuid(mdev, UI_BITMAP); get_random_bytes((void *)(& val), 8); _drbd_uuid_set(mdev, 0, val); return; } } void drbd_uuid_set_bm(struct drbd_conf *mdev , u64 val ) { { if ((mdev->ldev)->md.uuid[1] == 0ULL && val == 0ULL) { return; } 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; debug_drbd_uuid(mdev, UI_HISTORY_START); debug_drbd_uuid(mdev, UI_BITMAP); } else { if ((mdev->ldev)->md.uuid[1] != 0ULL) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "bm UUID already set"); } else { } (mdev->ldev)->md.uuid[1] = val; (mdev->ldev)->md.uuid[1] = (mdev->ldev)->md.uuid[1] & 0xfffffffffffffffeULL; debug_drbd_uuid(mdev, UI_BITMAP); } 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, D_ATTACHING); 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, D_ATTACHING); 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 ; { __mptr = (struct drbd_work const *)w; work = (struct bm_io_work *)__mptr; 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3797); } else { } drbd_bm_lock(mdev, work->why); rv = (*(work->io_fn))(mdev); drbd_bm_unlock(mdev); clear_bit(17, (unsigned long volatile *)(& mdev->flags)); __wake_up(& mdev->misc_wait, 3U, 1, 0); if ((unsigned long )work->done != (unsigned long )((void (*)(struct drbd_conf * , int ))0)) { (*(work->done))(mdev, rv); } else { } clear_bit(18, (unsigned long volatile *)(& mdev->flags)); work->why = 0; return (1); } } static int w_go_diskless(struct drbd_conf *mdev , struct drbd_work *w , int unused ) { union drbd_state val ; union drbd_state mask ; int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; { if ((unsigned int )*((unsigned char *)mdev + 2013UL) != 4U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.disk == D_FAILED ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3817); } else { } val.i = 0U; val.ldv_35533.disk = 0U; mask.i = 0U; mask.ldv_35533.disk = 15U; drbd_force_state(mdev, mask, val); tmp = atomic_read((atomic_t const *)(& mdev->local_cnt)); if (tmp == 0) { goto ldv_46259; } 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_46262: prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___1 = atomic_read((atomic_t const *)(& mdev->local_cnt)); if (tmp___1 == 0) { goto ldv_46261; } else { } schedule(); goto ldv_46262; ldv_46261: finish_wait(& mdev->misc_wait, & __wait); ldv_46259: clear_bit(19, (unsigned long volatile *)(& mdev->flags)); return (1); } } void drbd_go_diskless(struct drbd_conf *mdev ) { int tmp ; { if ((unsigned int )*((unsigned char *)mdev + 2013UL) != 4U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.disk == D_FAILED ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3833); } else { } tmp = test_and_set_bit(19, (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 ) { 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3858); } else { } tmp___0 = constant_test_bit(18U, (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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3860); } else { } tmp___1 = constant_test_bit(17U, (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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3861); } 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3862); } 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; set_bit(17U, (unsigned long volatile *)(& mdev->flags)); tmp___4 = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); if (tmp___4 == 0) { tmp___3 = list_empty((struct list_head const *)(& mdev->bm_io_work.w.list)); if (tmp___3 != 0) { set_bit(18U, (unsigned long volatile *)(& mdev->flags)); drbd_queue_work(& mdev->data.work, & mdev->bm_io_work.w); } else { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "FIXME avoided double queuing bm_io_work\n"); } } else { } return; } } int drbd_bitmap_io(struct drbd_conf *mdev , int (*io_fn)(struct drbd_conf * ) , char *why ) { 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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3894); } else { } drbd_suspend_io(mdev); drbd_bm_lock(mdev, why); rv = (*io_fn)(mdev); drbd_bm_unlock(mdev); drbd_resume_io(mdev); 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] ; { _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"; return (type <= 9U ? _faults[type] : (char *)"**Unknown**"); } } 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: /* CIL Label */ 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] ; unsigned int tmp ; { buildtag[0] = '\000'; tmp = 1U; while (1) { if (tmp >= 38U) { break; } else { } buildtag[tmp] = (char)0; tmp = tmp + 1U; } 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] = 98; } } else { } return ((char const *)(& buildtag)); } } void ldv_main6_sequence_infinite_withcheck_stateful(void) { struct block_device *var_group1 ; fmode_t var_drbd_open_65_p1 ; int res_drbd_open_65 ; struct gendisk *var_group2 ; fmode_t var_drbd_release_66_p1 ; struct notifier_block *var_group3 ; unsigned long var_drbd_notify_sys_73_p1 ; void *var_drbd_notify_sys_73_p2 ; unsigned long var_md_sync_timer_fn_102_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(); ldv_handler_precall(); tmp = drbd_init(); if (tmp != 0) { goto ldv_final; } else { } goto ldv_46390; ldv_46389: tmp___0 = nondet_int(); switch (tmp___0) { case 0: ; if (ldv_s_drbd_ops_block_device_operations == 0) { ldv_handler_precall(); res_drbd_open_65 = drbd_open(var_group1, var_drbd_open_65_p1); ldv_check_return_value(res_drbd_open_65); if (res_drbd_open_65 != 0) { goto ldv_module_exit; } else { } ldv_s_drbd_ops_block_device_operations = ldv_s_drbd_ops_block_device_operations + 1; } else { } goto ldv_46384; case 1: ; if (ldv_s_drbd_ops_block_device_operations == 1) { ldv_handler_precall(); drbd_release(var_group2, var_drbd_release_66_p1); ldv_s_drbd_ops_block_device_operations = 0; } else { } goto ldv_46384; case 2: ldv_handler_precall(); drbd_notify_sys(var_group3, var_drbd_notify_sys_73_p1, var_drbd_notify_sys_73_p2); goto ldv_46384; case 3: ldv_handler_precall(); md_sync_timer_fn(var_md_sync_timer_fn_102_p0); goto ldv_46384; default: ; goto ldv_46384; } ldv_46384: ; ldv_46390: tmp___1 = nondet_int(); if (tmp___1 != 0 || ldv_s_drbd_ops_block_device_operations != 0) { goto ldv_46389; } else { } ldv_module_exit: ldv_handler_precall(); drbd_cleanup(); ldv_final: ldv_check_final_state(); return; } } void ldv_mutex_lock_121(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_122(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_123(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_124(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_125(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_126(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_127(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_state_mutex_of_drbd_conf(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_128(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_state_mutex_of_drbd_conf(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_129(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_lock_130(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_131(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_132(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_133(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_134(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_135(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_136(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_137(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_138(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_139(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_drbd_main_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_140(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_drbd_main_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_141(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_drbd_main_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_142(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_drbd_main_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_143(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_144(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_145(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_146(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_147(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_md_io_mutex_of_drbd_conf(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_148(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_md_io_mutex_of_drbd_conf(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_149(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_md_io_mutex_of_drbd_conf(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_150(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_md_io_mutex_of_drbd_conf(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_182(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_183(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_181(struct mutex *ldv_func_arg1 ) ; static char const *drbd_conn_s_names[22U] = { "StandAlone", "Disconnecting", "Unconnected", "Timeout", "BrokenPipe", "NetworkFailure", "ProtocolError", "TearDown", "WFConnection", "WFReportParams", "Connected", "StartingSyncS", "StartingSyncT", "WFBitMapS", "WFBitMapT", "WFSyncUUID", "SyncSource", "SyncTarget", "VerifyS", "VerifyT", "PausedSyncS", "PausedSyncT"}; 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] = { 0, "Multiple primaries not allowed by config", "Need access to UpToDate data", 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 ) { { return ((unsigned int )s <= 21U ? drbd_conn_s_names[(unsigned int )s] : "TOO_LARGE"); } } char const *drbd_role_str(enum drbd_role s ) { { return ((unsigned int )s <= 2U ? drbd_role_s_names[(unsigned int )s] : "TOO_LARGE"); } } char const *drbd_disk_str(enum drbd_disk_state s ) { { return ((unsigned int )s <= 8U ? drbd_disk_s_names[(unsigned int )s] : "TOO_LARGE"); } } char const *drbd_set_st_err_str(enum drbd_state_ret_codes err ) { { return ((int )err >= -19 ? ((int )err < 0 ? drbd_state_sw_errors[- ((int )err)] : "TOO_LARGE") : "TOO_SMALL"); } } void ldv_mutex_lock_181(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_182(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_183(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __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 = 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 ; { tmp = __bitmap_equal(src1, src2, nbits); return (tmp); } } __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 (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; } } int ldv_mutex_trylock_188(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_189(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_191(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_192(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_194(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_196(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_187(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_190(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_193(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_195(struct mutex *ldv_func_arg1 ) ; __inline static struct thread_info *current_thread_info___2(void) { struct thread_info *ti ; unsigned long pfo_ret__ ; { switch (8UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5907; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5907; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5907; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5907; default: __bad_percpu_size(); } ldv_5907: ti = (struct thread_info *)(pfo_ret__ - 8152UL); return (ti); } } extern struct subprocess_info *call_usermodehelper_setup(char * , char ** , char ** , gfp_t ) ; extern void call_usermodehelper_setfns(struct subprocess_info * , int (*)(struct subprocess_info * ) , 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 * ) , void (*cleanup)(struct subprocess_info * ) , void *data ) { struct subprocess_info *info ; gfp_t gfp_mask ; int tmp ; { gfp_mask = (int )wait == -1 ? 32U : 208U; 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 = call_usermodehelper_exec(info, wait); return (tmp); } } __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, 0, 0, 0); return (tmp); } } extern int kobject_uevent(struct kobject * , enum kobject_action ) ; __inline static void trace_module_get___0(struct module *mod , unsigned long ip ) { long tmp ; struct tracepoint_func *it_func_ptr ; void *it_func ; void *__data ; struct tracepoint_func *_________p1 ; bool __warned ; int tmp___0 ; int tmp___1 ; { tmp = ldv__builtin_expect(__tracepoint_module_get.state != 0, 0L); if (tmp != 0L) { goto do_trace; } else { } return; do_trace: rcu_read_lock_sched_notrace(); _________p1 = *((struct tracepoint_func * volatile *)(& __tracepoint_module_get.funcs)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { tmp___1 = rcu_read_lock_sched_held(); if (tmp___1 == 0 && 1) { __warned = 1; lockdep_rcu_dereference("include/trace/events/module.h", 84); } else { } } else { } it_func_ptr = _________p1; if ((unsigned long )it_func_ptr != (unsigned long )((struct tracepoint_func *)0)) { ldv_11405: it_func = it_func_ptr->func; __data = it_func_ptr->data; (*((void (*)(void * , struct module * , unsigned long ))it_func))(__data, mod, ip); it_func_ptr = it_func_ptr + 1; if ((unsigned long )it_func_ptr->func != (unsigned long )((void *)0)) { goto ldv_11405; } else { } } else { } rcu_read_lock_sched_notrace(); return; } } __inline static int try_module_get___0(struct module *module ) { int ret ; void const *__vpp_verify ; int pao_ID__ ; int pao_ID_____0 ; int pao_ID_____1 ; int pao_ID_____2 ; int tmp ; long tmp___0 ; { ret = 1; if ((unsigned long )module != (unsigned long )((struct module *)0)) { tmp = module_is_live(module); tmp___0 = ldv__builtin_expect(tmp != 0, 1L); if (tmp___0 != 0L) { __vpp_verify = 0; switch (4UL) { case 1UL: pao_ID__ = 1; switch (4UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addb %1, %%gs:%P0": "+m" ((module->refptr)->incs): "qi" (1U)); } goto ldv_11770; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addw %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11770; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addl %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11770; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addq %1, %%gs:%P0": "+m" ((module->refptr)->incs): "re" (1U)); } goto ldv_11770; default: __bad_percpu_size(); } ldv_11770: ; goto ldv_11775; case 2UL: pao_ID_____0 = 1; switch (4UL) { case 1UL: ; if (pao_ID_____0 == 1) { __asm__ ("incb %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____0 == -1) { __asm__ ("decb %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addb %1, %%gs:%P0": "+m" ((module->refptr)->incs): "qi" (1U)); } goto ldv_11781; case 2UL: ; if (pao_ID_____0 == 1) { __asm__ ("incw %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____0 == -1) { __asm__ ("decw %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addw %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11781; case 4UL: ; if (pao_ID_____0 == 1) { __asm__ ("incl %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____0 == -1) { __asm__ ("decl %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addl %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11781; case 8UL: ; if (pao_ID_____0 == 1) { __asm__ ("incq %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____0 == -1) { __asm__ ("decq %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addq %1, %%gs:%P0": "+m" ((module->refptr)->incs): "re" (1U)); } goto ldv_11781; default: __bad_percpu_size(); } ldv_11781: ; goto ldv_11775; case 4UL: pao_ID_____1 = 1; switch (4UL) { case 1UL: ; if (pao_ID_____1 == 1) { __asm__ ("incb %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____1 == -1) { __asm__ ("decb %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addb %1, %%gs:%P0": "+m" ((module->refptr)->incs): "qi" (1U)); } goto ldv_11791; case 2UL: ; if (pao_ID_____1 == 1) { __asm__ ("incw %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____1 == -1) { __asm__ ("decw %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addw %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11791; case 4UL: ; if (pao_ID_____1 == 1) { __asm__ ("incl %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____1 == -1) { __asm__ ("decl %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addl %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11791; case 8UL: ; if (pao_ID_____1 == 1) { __asm__ ("incq %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____1 == -1) { __asm__ ("decq %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addq %1, %%gs:%P0": "+m" ((module->refptr)->incs): "re" (1U)); } goto ldv_11791; default: __bad_percpu_size(); } ldv_11791: ; goto ldv_11775; case 8UL: pao_ID_____2 = 1; switch (4UL) { case 1UL: ; if (pao_ID_____2 == 1) { __asm__ ("incb %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____2 == -1) { __asm__ ("decb %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addb %1, %%gs:%P0": "+m" ((module->refptr)->incs): "qi" (1U)); } goto ldv_11801; case 2UL: ; if (pao_ID_____2 == 1) { __asm__ ("incw %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____2 == -1) { __asm__ ("decw %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addw %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11801; case 4UL: ; if (pao_ID_____2 == 1) { __asm__ ("incl %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____2 == -1) { __asm__ ("decl %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addl %1, %%gs:%P0": "+m" ((module->refptr)->incs): "ri" (1U)); } goto ldv_11801; case 8UL: ; if (pao_ID_____2 == 1) { __asm__ ("incq %%gs:%P0": "+m" ((module->refptr)->incs)); } else if (pao_ID_____2 == -1) { __asm__ ("decq %%gs:%P0": "+m" ((module->refptr)->incs)); } else { __asm__ ("addq %1, %%gs:%P0": "+m" ((module->refptr)->incs): "re" (1U)); } goto ldv_11801; default: __bad_percpu_size(); } ldv_11801: ; goto ldv_11775; default: __bad_size_call_parameter(); goto ldv_11775; } ldv_11775: ; trace_module_get___0(module, (unsigned long )((void *)0)); } else { ret = 0; } } else { } return (ret); } } __inline static void trace_kmalloc___5(unsigned long call_site , void const *ptr , size_t bytes_req , size_t bytes_alloc , gfp_t gfp_flags ) { long tmp ; struct tracepoint_func *it_func_ptr ; void *it_func ; void *__data ; struct tracepoint_func *_________p1 ; bool __warned ; int tmp___0 ; int tmp___1 ; { tmp = ldv__builtin_expect(__tracepoint_kmalloc.state != 0, 0L); if (tmp != 0L) { goto do_trace; } else { } return; do_trace: rcu_read_lock_sched_notrace(); _________p1 = *((struct tracepoint_func * volatile *)(& __tracepoint_kmalloc.funcs)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { tmp___1 = rcu_read_lock_sched_held(); if (tmp___1 == 0 && 1) { __warned = 1; lockdep_rcu_dereference("include/trace/events/kmem.h", 51); } else { } } else { } it_func_ptr = _________p1; if ((unsigned long )it_func_ptr != (unsigned long )((struct tracepoint_func *)0)) { ldv_13686: it_func = it_func_ptr->func; __data = it_func_ptr->data; (*((void (*)(void * , unsigned long , void const * , size_t , size_t , gfp_t ))it_func))(__data, call_site, ptr, bytes_req, bytes_alloc, gfp_flags); it_func_ptr = it_func_ptr + 1; if ((unsigned long )it_func_ptr->func != (unsigned long )((void *)0)) { goto ldv_13686; } else { } } else { } rcu_read_lock_sched_notrace(); return; } } __inline static void *kmalloc_large___5(size_t size , gfp_t flags ) { unsigned int order ; int tmp ; void *ret ; unsigned long tmp___0 ; { tmp = get_order(size); order = (unsigned int )tmp; tmp___0 = __get_free_pages(flags | 16384U, order); ret = (void *)tmp___0; kmemleak_alloc((void const *)ret, size, 1, flags); trace_kmalloc___5((unsigned long )((void *)0), (void const *)ret, size, 4096UL << (int )order, flags); return (ret); } } __inline static void *kmalloc___5(size_t size , gfp_t flags ) { void *ret ; void *tmp ; struct kmem_cache *s ; struct kmem_cache *tmp___0 ; void *tmp___1 ; { if (0) { if (size > 8192UL) { tmp = kmalloc_large___5(size, flags); return (tmp); } else { } if ((flags & 1U) == 0U) { tmp___0 = kmalloc_slab(size); s = tmp___0; if ((unsigned long )s == (unsigned long )((struct kmem_cache *)0)) { return (16); } else { } ret = kmem_cache_alloc_notrace(s, flags); trace_kmalloc___5((unsigned long )((void *)0), (void const *)ret, size, (size_t )s->size, flags); return (ret); } else { } } else { } tmp___1 = __kmalloc(size, flags); return (tmp___1); } } __inline static void *kzalloc___3(size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc___5(size, flags | 32768U); return (tmp); } } extern struct file *filp_open(char const * , int , int ) ; extern int bd_claim(struct block_device * , void * ) ; extern int cn_add_callback(struct cb_id * , char * , 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 ) ; __inline static void pagefault_disable___0(void) { struct thread_info *tmp ; { tmp = current_thread_info___2(); tmp->preempt_count = tmp->preempt_count + 1; __asm__ volatile ("": : : "memory"); return; } } __inline static void pagefault_enable___0(void) { struct thread_info *tmp ; { __asm__ volatile ("": : : "memory"); tmp = current_thread_info___2(); tmp->preempt_count = tmp->preempt_count + -1; __asm__ volatile ("": : : "memory"); return; } } extern void add_disk(struct gendisk * ) ; __inline static void *kmap_atomic___0(struct page *page , enum km_type idx ) { void *tmp ; { pagefault_disable___0(); tmp = lowmem_page_address(page); return (tmp); } } __inline static void kunmap_atomic_notypecheck___0(void *addr , enum km_type idx ) { { pagefault_enable___0(); return; } } extern void blk_queue_max_hw_sectors(struct request_queue * , unsigned int ) ; extern void blk_queue_max_segments(struct request_queue * , unsigned short ) ; extern void blk_queue_logical_block_size(struct request_queue * , unsigned short ) ; extern int blk_stack_limits(struct queue_limits * , struct queue_limits * , sector_t ) ; extern void blk_queue_segment_boundary(struct request_queue * , unsigned long ) ; __inline static unsigned int queue_max_sectors(struct request_queue *q ) { { return (q->limits.max_sectors); } } 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 __min1___0 ; sector_t __min2___0 ; sector_t tmp___2 ; sector_t __min1___1 ; sector_t __min2___1 ; sector_t __min1___2 ; sector_t __min2___2 ; sector_t tmp___3 ; { switch (bdev->dc.meta_dev_idx) { case -1: ; case -3: tmp___1 = drbd_get_capacity(bdev->backing_bdev); if (tmp___1 != 0UL) { __min1 = 34359738368UL; tmp___0 = drbd_md_first_sector(bdev); __min2 = tmp___0; s = __min1 < __min2 ? __min1 : __min2; } else { s = 0UL; } goto ldv_44058; case -2: __min1___0 = 34359738368UL; tmp___2 = drbd_get_capacity(bdev->backing_bdev); __min2___0 = tmp___2; s = __min1___0 < __min2___0 ? __min1___0 : __min2___0; __min1___1 = s; __min2___1 = (unsigned long )(bdev->md.md_size_sect - (u32 )bdev->md.bm_offset) << 15; s = __min1___1 < __min2___1 ? __min1___1 : __min2___1; goto ldv_44058; default: __min1___2 = 8587575296UL; tmp___3 = drbd_get_capacity(bdev->backing_bdev); __min2___2 = tmp___3; s = __min1___2 < __min2___2 ? __min1___2 : __min2___2; } ldv_44058: ; 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[81U] = { {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}, {0, 0, 0}, {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}, {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}, {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}, {0, 0, 0}, {"max_bio_bvecs", 0, 4}, {"no_disk_barrier", 32768, 4}, {"no_disk_drain", 32768, 4}, {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}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {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}}; 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_44801; ldv_44800: tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; switch (tag & 8191) { case 1: arg->primary_force = (int )((signed char )*((char *)tags)) != 0; goto ldv_44798; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_44798: tags = tags + (unsigned long )dlen; ldv_44801: tmp___1 = tags; tags = tags + 1; tmp___2 = get_unaligned_le16((void const *)tmp___1); tag = (int )tmp___2; if (tag != 0) { goto ldv_44800; } else { } 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 ; void *__ret ; size_t __len___0 ; size_t __min1___0 ; size_t __min2___0 ; void *__ret___0 ; u32 tmp___1 ; u32 tmp___2 ; u32 tmp___3 ; u32 tmp___4 ; unsigned short *tmp___5 ; u16 tmp___6 ; { goto ldv_44862; ldv_44861: tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; switch (tag & 8191) { case 2: arg->disk_size = get_unaligned_le64((void const *)tags); goto ldv_44830; 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; __len = __min1 < __min2 ? __min1 : __min2; __ret = memcpy((void *)(& arg->backing_dev), (void const *)tags, __len); goto ldv_44830; 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; __len___0 = __min1___0 < __min2___0 ? __min1___0 : __min2___0; __ret___0 = memcpy((void *)(& arg->meta_dev), (void const *)tags, __len___0); goto ldv_44830; case 5: tmp___1 = get_unaligned_le32((void const *)tags); arg->meta_dev_idx = (int )tmp___1; goto ldv_44830; case 6: tmp___2 = get_unaligned_le32((void const *)tags); arg->on_io_error = (int )tmp___2; goto ldv_44830; case 7: tmp___3 = get_unaligned_le32((void const *)tags); arg->fencing = (int )tmp___3; goto ldv_44830; case 37: arg->use_bmbv = (int )((signed char )*((char *)tags)) != 0; goto ldv_44830; case 53: arg->no_disk_flush = (int )((signed char )*((char *)tags)) != 0; goto ldv_44830; case 54: arg->no_md_flush = (int )((signed char )*((char *)tags)) != 0; goto ldv_44830; case 56: tmp___4 = get_unaligned_le32((void const *)tags); arg->max_bio_bvecs = (int )tmp___4; goto ldv_44830; case 57: arg->no_disk_barrier = (int )((signed char )*((char *)tags)) != 0; goto ldv_44830; case 58: arg->no_disk_drain = (int )((signed char )*((char *)tags)) != 0; goto ldv_44830; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_44830: tags = tags + (unsigned long )dlen; ldv_44862: tmp___5 = tags; tags = tags + 1; tmp___6 = get_unaligned_le16((void const *)tmp___5); tag = (int )tmp___6; if (tag != 0) { goto ldv_44861; } else { } 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 ; void *__ret ; size_t __len___0 ; size_t __min1___0 ; size_t __min2___0 ; void *__ret___0 ; size_t __len___1 ; size_t __min1___1 ; size_t __min2___1 ; void *__ret___1 ; size_t __len___2 ; size_t __min1___2 ; size_t __min2___2 ; void *__ret___2 ; size_t __len___3 ; size_t __min1___3 ; size_t __min2___3 ; void *__ret___3 ; u32 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 ; u32 tmp___11 ; u32 tmp___12 ; u32 tmp___13 ; u32 tmp___14 ; u32 tmp___15 ; unsigned short *tmp___16 ; u16 tmp___17 ; { goto ldv_44965; ldv_44964: tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; switch (tag & 8191) { 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; __len = __min1 < __min2 ? __min1 : __min2; __ret = memcpy((void *)(& arg->my_addr), (void const *)tags, __len); goto ldv_44900; 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; __len___0 = __min1___0 < __min2___0 ? __min1___0 : __min2___0; __ret___0 = memcpy((void *)(& arg->peer_addr), (void const *)tags, __len___0); goto ldv_44900; 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; __len___1 = __min1___1 < __min2___1 ? __min1___1 : __min2___1; __ret___1 = memcpy((void *)(& arg->shared_secret), (void const *)tags, __len___1); goto ldv_44900; 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; __len___2 = __min1___2 < __min2___2 ? __min1___2 : __min2___2; __ret___2 = memcpy((void *)(& arg->cram_hmac_alg), (void const *)tags, __len___2); goto ldv_44900; 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; __len___3 = __min1___3 < __min2___3 ? __min1___3 : __min2___3; __ret___3 = memcpy((void *)(& arg->integrity_alg), (void const *)tags, __len___3); goto ldv_44900; case 14: tmp___1 = get_unaligned_le32((void const *)tags); arg->timeout = (int )tmp___1; goto ldv_44900; case 15: tmp___2 = get_unaligned_le32((void const *)tags); arg->wire_protocol = (int )tmp___2; goto ldv_44900; case 16: tmp___3 = get_unaligned_le32((void const *)tags); arg->try_connect_int = (int )tmp___3; goto ldv_44900; case 17: tmp___4 = get_unaligned_le32((void const *)tags); arg->ping_int = (int )tmp___4; goto ldv_44900; case 18: tmp___5 = get_unaligned_le32((void const *)tags); arg->max_epoch_size = (int )tmp___5; goto ldv_44900; case 19: tmp___6 = get_unaligned_le32((void const *)tags); arg->max_buffers = (int )tmp___6; goto ldv_44900; case 20: tmp___7 = get_unaligned_le32((void const *)tags); arg->unplug_watermark = (int )tmp___7; goto ldv_44900; case 21: tmp___8 = get_unaligned_le32((void const *)tags); arg->sndbuf_size = (int )tmp___8; goto ldv_44900; case 22: tmp___9 = get_unaligned_le32((void const *)tags); arg->ko_count = (int )tmp___9; goto ldv_44900; case 24: tmp___10 = get_unaligned_le32((void const *)tags); arg->after_sb_0p = (int )tmp___10; goto ldv_44900; case 25: tmp___11 = get_unaligned_le32((void const *)tags); arg->after_sb_1p = (int )tmp___11; goto ldv_44900; case 26: tmp___12 = get_unaligned_le32((void const *)tags); arg->after_sb_2p = (int )tmp___12; goto ldv_44900; case 39: tmp___13 = get_unaligned_le32((void const *)tags); arg->rr_conflict = (int )tmp___13; goto ldv_44900; case 40: tmp___14 = get_unaligned_le32((void const *)tags); arg->ping_timeo = (int )tmp___14; goto ldv_44900; case 67: tmp___15 = get_unaligned_le32((void const *)tags); arg->rcvbuf_size = (int )tmp___15; goto ldv_44900; case 60: arg->mind_af = (int )((signed char )*((char *)tags)) != 0; goto ldv_44900; case 27: arg->want_lose = (int )((signed char )*((char *)tags)) != 0; goto ldv_44900; case 28: arg->two_primaries = (int )((signed char )*((char *)tags)) != 0; goto ldv_44900; case 41: arg->always_asbp = (int )((signed char )*((char *)tags)) != 0; goto ldv_44900; case 61: arg->no_cork = (int )((signed char )*((char *)tags)) != 0; goto ldv_44900; case 62: arg->auto_sndbuf_size = (int )((signed char )*((char *)tags)) != 0; goto ldv_44900; case 70: arg->dry_run = (int )((signed char )*((char *)tags)) != 0; goto ldv_44900; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_44900: tags = tags + (unsigned long )dlen; ldv_44965: tmp___16 = tags; tags = tags + 1; tmp___17 = get_unaligned_le16((void const *)tmp___16); tag = (int )tmp___17; if (tag != 0) { goto ldv_44964; } else { } 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_44999; ldv_44998: tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; switch (tag & 8191) { case 29: arg->resize_size = get_unaligned_le64((void const *)tags); goto ldv_44994; case 68: arg->resize_force = (int )((signed char )*((char *)tags)) != 0; goto ldv_44994; case 69: arg->no_resync = (int )((signed char )*((char *)tags)) != 0; goto ldv_44994; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_44994: tags = tags + (unsigned long )dlen; ldv_44999: tmp___1 = tags; tags = tags + 1; tmp___2 = get_unaligned_le16((void const *)tmp___1); tag = (int )tmp___2; if (tag != 0) { goto ldv_44998; } else { } 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 ; void *__ret ; size_t __len___0 ; size_t __min1___0 ; size_t __min2___0 ; void *__ret___0 ; size_t __len___1 ; size_t __min1___1 ; size_t __min2___1 ; void *__ret___1 ; u32 tmp___4 ; u32 tmp___5 ; u32 tmp___6 ; u32 tmp___7 ; u32 tmp___8 ; u32 tmp___9 ; unsigned short *tmp___10 ; u16 tmp___11 ; { goto ldv_45055; ldv_45054: tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; switch (tag & 8191) { case 30: tmp___1 = get_unaligned_le32((void const *)tags); arg->rate = (int )tmp___1; goto ldv_45013; case 31: tmp___2 = get_unaligned_le32((void const *)tags); arg->after = (int )tmp___2; goto ldv_45013; case 32: tmp___3 = get_unaligned_le32((void const *)tags); arg->al_extents = (int )tmp___3; goto ldv_45013; 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; __len = __min1 < __min2 ? __min1 : __min2; __ret = memcpy((void *)(& arg->verify_alg), (void const *)tags, __len); goto ldv_45013; 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; __len___0 = __min1___0 < __min2___0 ? __min1___0 : __min2___0; __ret___0 = memcpy((void *)(& arg->cpu_mask), (void const *)tags, __len___0); goto ldv_45013; 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; __len___1 = __min1___1 < __min2___1 ? __min1___1 : __min2___1; __ret___1 = memcpy((void *)(& arg->csums_alg), (void const *)tags, __len___1); goto ldv_45013; case 65: arg->use_rle = (int )((signed char )*((char *)tags)) != 0; goto ldv_45013; case 75: tmp___4 = get_unaligned_le32((void const *)tags); arg->on_no_data = (int )tmp___4; goto ldv_45013; case 76: tmp___5 = get_unaligned_le32((void const *)tags); arg->c_plan_ahead = (int )tmp___5; goto ldv_45013; case 77: tmp___6 = get_unaligned_le32((void const *)tags); arg->c_delay_target = (int )tmp___6; goto ldv_45013; case 78: tmp___7 = get_unaligned_le32((void const *)tags); arg->c_fill_target = (int )tmp___7; goto ldv_45013; case 79: tmp___8 = get_unaligned_le32((void const *)tags); arg->c_max_rate = (int )tmp___8; goto ldv_45013; case 80: tmp___9 = get_unaligned_le32((void const *)tags); arg->c_min_rate = (int )tmp___9; goto ldv_45013; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_45013: tags = tags + (unsigned long )dlen; ldv_45055: tmp___10 = tags; tags = tags + 1; tmp___11 = get_unaligned_le16((void const *)tmp___10); tag = (int )tmp___11; if (tag != 0) { goto ldv_45054; } else { } 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_45354; ldv_45353: tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; switch (tag & 8191) { case 66: arg->start_sector = get_unaligned_le64((void const *)tags); goto ldv_45351; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_45351: tags = tags + (unsigned long )dlen; ldv_45354: tmp___1 = tags; tags = tags + 1; tmp___2 = get_unaligned_le16((void const *)tmp___1); tag = (int )tmp___2; if (tag != 0) { goto ldv_45353; } else { } 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_45371; ldv_45370: tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; switch (tag & 8191) { case 63: arg->clear_bm = (int )((signed char )*((char *)tags)) != 0; goto ldv_45368; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_45368: tags = tags + (unsigned long )dlen; ldv_45371: tmp___1 = tags; tags = tags + 1; tmp___2 = get_unaligned_le16((void const *)tmp___1); tag = (int )tmp___2; if (tag != 0) { goto ldv_45370; } else { } 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; switch (2UL) { case 1UL: *((u8 *)__gu_p) = 2U; goto ldv_45416; case 2UL: put_unaligned_le16(16386, __gu_p); goto ldv_45416; case 4UL: put_unaligned_le32(16386U, __gu_p); goto ldv_45416; case 8UL: put_unaligned_le64(16386ULL, __gu_p); goto ldv_45416; default: __bad_unaligned_access_size(); goto ldv_45416; } ldv_45416: tmp___0 = tags; tags = tags + 1; __gu_p___0 = (void *)tmp___0; switch (2UL) { case 1UL: *((u8 *)__gu_p___0) = 8U; goto ldv_45423; case 2UL: put_unaligned_le16(8, __gu_p___0); goto ldv_45423; case 4UL: put_unaligned_le32(8U, __gu_p___0); goto ldv_45423; case 8UL: put_unaligned_le64(8ULL, __gu_p___0); goto ldv_45423; default: __bad_unaligned_access_size(); goto ldv_45423; } ldv_45423: __gu_p___1 = (void *)tags; switch (8UL) { case 1UL: *((u8 *)__gu_p___1) = (unsigned char )arg->disk_size; goto ldv_45430; case 2UL: put_unaligned_le16((int )((unsigned short )arg->disk_size), __gu_p___1); goto ldv_45430; case 4UL: put_unaligned_le32((unsigned int )arg->disk_size, __gu_p___1); goto ldv_45430; case 8UL: put_unaligned_le64(arg->disk_size, __gu_p___1); goto ldv_45430; default: __bad_unaligned_access_size(); goto ldv_45430; } ldv_45430: tags = tags + 8U; tmp___1 = tags; tags = tags + 1; __gu_p___2 = (void *)tmp___1; switch (2UL) { case 1UL: *((u8 *)__gu_p___2) = 3U; goto ldv_45437; case 2UL: put_unaligned_le16(57347, __gu_p___2); goto ldv_45437; case 4UL: put_unaligned_le32(57347U, __gu_p___2); goto ldv_45437; case 8UL: put_unaligned_le64(57347ULL, __gu_p___2); goto ldv_45437; default: __bad_unaligned_access_size(); goto ldv_45437; } ldv_45437: tmp___2 = tags; tags = tags + 1; __gu_p___3 = (void *)tmp___2; switch (2UL) { case 1UL: *((u8 *)__gu_p___3) = (unsigned char )arg->backing_dev_len; goto ldv_45444; case 2UL: put_unaligned_le16((int )((unsigned short )arg->backing_dev_len), __gu_p___3); goto ldv_45444; case 4UL: put_unaligned_le32((unsigned int )arg->backing_dev_len, __gu_p___3); goto ldv_45444; case 8UL: put_unaligned_le64((unsigned long long )arg->backing_dev_len, __gu_p___3); goto ldv_45444; default: __bad_unaligned_access_size(); goto ldv_45444; } ldv_45444: __len = (size_t )arg->backing_dev_len; __ret = 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; switch (2UL) { case 1UL: *((u8 *)__gu_p___4) = 4U; goto ldv_45454; case 2UL: put_unaligned_le16(57348, __gu_p___4); goto ldv_45454; case 4UL: put_unaligned_le32(57348U, __gu_p___4); goto ldv_45454; case 8UL: put_unaligned_le64(57348ULL, __gu_p___4); goto ldv_45454; default: __bad_unaligned_access_size(); goto ldv_45454; } ldv_45454: tmp___4 = tags; tags = tags + 1; __gu_p___5 = (void *)tmp___4; switch (2UL) { case 1UL: *((u8 *)__gu_p___5) = (unsigned char )arg->meta_dev_len; goto ldv_45461; case 2UL: put_unaligned_le16((int )((unsigned short )arg->meta_dev_len), __gu_p___5); goto ldv_45461; case 4UL: put_unaligned_le32((unsigned int )arg->meta_dev_len, __gu_p___5); goto ldv_45461; case 8UL: put_unaligned_le64((unsigned long long )arg->meta_dev_len, __gu_p___5); goto ldv_45461; default: __bad_unaligned_access_size(); goto ldv_45461; } ldv_45461: __len___0 = (size_t )arg->meta_dev_len; __ret___0 = 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; switch (2UL) { case 1UL: *((u8 *)__gu_p___6) = 5U; goto ldv_45471; case 2UL: put_unaligned_le16(8197, __gu_p___6); goto ldv_45471; case 4UL: put_unaligned_le32(8197U, __gu_p___6); goto ldv_45471; case 8UL: put_unaligned_le64(8197ULL, __gu_p___6); goto ldv_45471; default: __bad_unaligned_access_size(); goto ldv_45471; } ldv_45471: tmp___6 = tags; tags = tags + 1; __gu_p___7 = (void *)tmp___6; switch (2UL) { case 1UL: *((u8 *)__gu_p___7) = 4U; goto ldv_45478; case 2UL: put_unaligned_le16(4, __gu_p___7); goto ldv_45478; case 4UL: put_unaligned_le32(4U, __gu_p___7); goto ldv_45478; case 8UL: put_unaligned_le64(4ULL, __gu_p___7); goto ldv_45478; default: __bad_unaligned_access_size(); goto ldv_45478; } ldv_45478: __gu_p___8 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___8) = (unsigned char )arg->meta_dev_idx; goto ldv_45485; case 2UL: put_unaligned_le16((int )((unsigned short )arg->meta_dev_idx), __gu_p___8); goto ldv_45485; case 4UL: put_unaligned_le32((unsigned int )arg->meta_dev_idx, __gu_p___8); goto ldv_45485; case 8UL: put_unaligned_le64((unsigned long long )arg->meta_dev_idx, __gu_p___8); goto ldv_45485; default: __bad_unaligned_access_size(); goto ldv_45485; } ldv_45485: tags = tags + 4U; tmp___7 = tags; tags = tags + 1; __gu_p___9 = (void *)tmp___7; switch (2UL) { case 1UL: *((u8 *)__gu_p___9) = 6U; goto ldv_45492; case 2UL: put_unaligned_le16(6, __gu_p___9); goto ldv_45492; case 4UL: put_unaligned_le32(6U, __gu_p___9); goto ldv_45492; case 8UL: put_unaligned_le64(6ULL, __gu_p___9); goto ldv_45492; default: __bad_unaligned_access_size(); goto ldv_45492; } ldv_45492: tmp___8 = tags; tags = tags + 1; __gu_p___10 = (void *)tmp___8; switch (2UL) { case 1UL: *((u8 *)__gu_p___10) = 4U; goto ldv_45499; case 2UL: put_unaligned_le16(4, __gu_p___10); goto ldv_45499; case 4UL: put_unaligned_le32(4U, __gu_p___10); goto ldv_45499; case 8UL: put_unaligned_le64(4ULL, __gu_p___10); goto ldv_45499; default: __bad_unaligned_access_size(); goto ldv_45499; } ldv_45499: __gu_p___11 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___11) = (unsigned char )arg->on_io_error; goto ldv_45506; case 2UL: put_unaligned_le16((int )((unsigned short )arg->on_io_error), __gu_p___11); goto ldv_45506; case 4UL: put_unaligned_le32((unsigned int )arg->on_io_error, __gu_p___11); goto ldv_45506; case 8UL: put_unaligned_le64((unsigned long long )arg->on_io_error, __gu_p___11); goto ldv_45506; default: __bad_unaligned_access_size(); goto ldv_45506; } ldv_45506: tags = tags + 4U; tmp___9 = tags; tags = tags + 1; __gu_p___12 = (void *)tmp___9; switch (2UL) { case 1UL: *((u8 *)__gu_p___12) = 7U; goto ldv_45513; case 2UL: put_unaligned_le16(7, __gu_p___12); goto ldv_45513; case 4UL: put_unaligned_le32(7U, __gu_p___12); goto ldv_45513; case 8UL: put_unaligned_le64(7ULL, __gu_p___12); goto ldv_45513; default: __bad_unaligned_access_size(); goto ldv_45513; } ldv_45513: tmp___10 = tags; tags = tags + 1; __gu_p___13 = (void *)tmp___10; switch (2UL) { case 1UL: *((u8 *)__gu_p___13) = 4U; goto ldv_45520; case 2UL: put_unaligned_le16(4, __gu_p___13); goto ldv_45520; case 4UL: put_unaligned_le32(4U, __gu_p___13); goto ldv_45520; case 8UL: put_unaligned_le64(4ULL, __gu_p___13); goto ldv_45520; default: __bad_unaligned_access_size(); goto ldv_45520; } ldv_45520: __gu_p___14 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___14) = (unsigned char )arg->fencing; goto ldv_45527; case 2UL: put_unaligned_le16((int )((unsigned short )arg->fencing), __gu_p___14); goto ldv_45527; case 4UL: put_unaligned_le32((unsigned int )arg->fencing, __gu_p___14); goto ldv_45527; case 8UL: put_unaligned_le64((unsigned long long )arg->fencing, __gu_p___14); goto ldv_45527; default: __bad_unaligned_access_size(); goto ldv_45527; } ldv_45527: tags = tags + 4U; tmp___11 = tags; tags = tags + 1; __gu_p___15 = (void *)tmp___11; switch (2UL) { case 1UL: *((u8 *)__gu_p___15) = 37U; goto ldv_45534; case 2UL: put_unaligned_le16(32805, __gu_p___15); goto ldv_45534; case 4UL: put_unaligned_le32(32805U, __gu_p___15); goto ldv_45534; case 8UL: put_unaligned_le64(32805ULL, __gu_p___15); goto ldv_45534; default: __bad_unaligned_access_size(); goto ldv_45534; } ldv_45534: tmp___12 = tags; tags = tags + 1; __gu_p___16 = (void *)tmp___12; switch (2UL) { case 1UL: *((u8 *)__gu_p___16) = 1U; goto ldv_45541; case 2UL: put_unaligned_le16(1, __gu_p___16); goto ldv_45541; case 4UL: put_unaligned_le32(1U, __gu_p___16); goto ldv_45541; case 8UL: put_unaligned_le64(1ULL, __gu_p___16); goto ldv_45541; default: __bad_unaligned_access_size(); goto ldv_45541; } ldv_45541: *((char *)tags) = (char )arg->use_bmbv; tags = tags + 1U; tmp___13 = tags; tags = tags + 1; __gu_p___17 = (void *)tmp___13; switch (2UL) { case 1UL: *((u8 *)__gu_p___17) = 53U; goto ldv_45548; case 2UL: put_unaligned_le16(32821, __gu_p___17); goto ldv_45548; case 4UL: put_unaligned_le32(32821U, __gu_p___17); goto ldv_45548; case 8UL: put_unaligned_le64(32821ULL, __gu_p___17); goto ldv_45548; default: __bad_unaligned_access_size(); goto ldv_45548; } ldv_45548: tmp___14 = tags; tags = tags + 1; __gu_p___18 = (void *)tmp___14; switch (2UL) { case 1UL: *((u8 *)__gu_p___18) = 1U; goto ldv_45555; case 2UL: put_unaligned_le16(1, __gu_p___18); goto ldv_45555; case 4UL: put_unaligned_le32(1U, __gu_p___18); goto ldv_45555; case 8UL: put_unaligned_le64(1ULL, __gu_p___18); goto ldv_45555; default: __bad_unaligned_access_size(); goto ldv_45555; } ldv_45555: *((char *)tags) = (char )arg->no_disk_flush; tags = tags + 1U; tmp___15 = tags; tags = tags + 1; __gu_p___19 = (void *)tmp___15; switch (2UL) { case 1UL: *((u8 *)__gu_p___19) = 54U; goto ldv_45562; case 2UL: put_unaligned_le16(32822, __gu_p___19); goto ldv_45562; case 4UL: put_unaligned_le32(32822U, __gu_p___19); goto ldv_45562; case 8UL: put_unaligned_le64(32822ULL, __gu_p___19); goto ldv_45562; default: __bad_unaligned_access_size(); goto ldv_45562; } ldv_45562: tmp___16 = tags; tags = tags + 1; __gu_p___20 = (void *)tmp___16; switch (2UL) { case 1UL: *((u8 *)__gu_p___20) = 1U; goto ldv_45569; case 2UL: put_unaligned_le16(1, __gu_p___20); goto ldv_45569; case 4UL: put_unaligned_le32(1U, __gu_p___20); goto ldv_45569; case 8UL: put_unaligned_le64(1ULL, __gu_p___20); goto ldv_45569; default: __bad_unaligned_access_size(); goto ldv_45569; } ldv_45569: *((char *)tags) = (char )arg->no_md_flush; tags = tags + 1U; tmp___17 = tags; tags = tags + 1; __gu_p___21 = (void *)tmp___17; switch (2UL) { case 1UL: *((u8 *)__gu_p___21) = 56U; goto ldv_45576; case 2UL: put_unaligned_le16(56, __gu_p___21); goto ldv_45576; case 4UL: put_unaligned_le32(56U, __gu_p___21); goto ldv_45576; case 8UL: put_unaligned_le64(56ULL, __gu_p___21); goto ldv_45576; default: __bad_unaligned_access_size(); goto ldv_45576; } ldv_45576: tmp___18 = tags; tags = tags + 1; __gu_p___22 = (void *)tmp___18; switch (2UL) { case 1UL: *((u8 *)__gu_p___22) = 4U; goto ldv_45583; case 2UL: put_unaligned_le16(4, __gu_p___22); goto ldv_45583; case 4UL: put_unaligned_le32(4U, __gu_p___22); goto ldv_45583; case 8UL: put_unaligned_le64(4ULL, __gu_p___22); goto ldv_45583; default: __bad_unaligned_access_size(); goto ldv_45583; } ldv_45583: __gu_p___23 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___23) = (unsigned char )arg->max_bio_bvecs; goto ldv_45590; case 2UL: put_unaligned_le16((int )((unsigned short )arg->max_bio_bvecs), __gu_p___23); goto ldv_45590; case 4UL: put_unaligned_le32((unsigned int )arg->max_bio_bvecs, __gu_p___23); goto ldv_45590; case 8UL: put_unaligned_le64((unsigned long long )arg->max_bio_bvecs, __gu_p___23); goto ldv_45590; default: __bad_unaligned_access_size(); goto ldv_45590; } ldv_45590: tags = tags + 4U; tmp___19 = tags; tags = tags + 1; __gu_p___24 = (void *)tmp___19; switch (2UL) { case 1UL: *((u8 *)__gu_p___24) = 57U; goto ldv_45597; case 2UL: put_unaligned_le16(32825, __gu_p___24); goto ldv_45597; case 4UL: put_unaligned_le32(32825U, __gu_p___24); goto ldv_45597; case 8UL: put_unaligned_le64(32825ULL, __gu_p___24); goto ldv_45597; default: __bad_unaligned_access_size(); goto ldv_45597; } ldv_45597: tmp___20 = tags; tags = tags + 1; __gu_p___25 = (void *)tmp___20; switch (2UL) { case 1UL: *((u8 *)__gu_p___25) = 1U; goto ldv_45604; case 2UL: put_unaligned_le16(1, __gu_p___25); goto ldv_45604; case 4UL: put_unaligned_le32(1U, __gu_p___25); goto ldv_45604; case 8UL: put_unaligned_le64(1ULL, __gu_p___25); goto ldv_45604; default: __bad_unaligned_access_size(); goto ldv_45604; } ldv_45604: *((char *)tags) = (char )arg->no_disk_barrier; tags = tags + 1U; tmp___21 = tags; tags = tags + 1; __gu_p___26 = (void *)tmp___21; switch (2UL) { case 1UL: *((u8 *)__gu_p___26) = 58U; goto ldv_45611; case 2UL: put_unaligned_le16(32826, __gu_p___26); goto ldv_45611; case 4UL: put_unaligned_le32(32826U, __gu_p___26); goto ldv_45611; case 8UL: put_unaligned_le64(32826ULL, __gu_p___26); goto ldv_45611; default: __bad_unaligned_access_size(); goto ldv_45611; } ldv_45611: tmp___22 = tags; tags = tags + 1; __gu_p___27 = (void *)tmp___22; switch (2UL) { case 1UL: *((u8 *)__gu_p___27) = 1U; goto ldv_45618; case 2UL: put_unaligned_le16(1, __gu_p___27); goto ldv_45618; case 4UL: put_unaligned_le32(1U, __gu_p___27); goto ldv_45618; case 8UL: put_unaligned_le64(1ULL, __gu_p___27); goto ldv_45618; default: __bad_unaligned_access_size(); goto ldv_45618; } ldv_45618: *((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 ; unsigned short *tmp___41 ; void *__gu_p___57 ; unsigned short *tmp___42 ; void *__gu_p___58 ; unsigned short *tmp___43 ; void *__gu_p___59 ; unsigned short *tmp___44 ; void *__gu_p___60 ; unsigned short *tmp___45 ; void *__gu_p___61 ; unsigned short *tmp___46 ; void *__gu_p___62 ; unsigned short *tmp___47 ; void *__gu_p___63 ; unsigned short *tmp___48 ; void *__gu_p___64 ; unsigned short *tmp___49 ; void *__gu_p___65 ; unsigned short *tmp___50 ; void *__gu_p___66 ; unsigned short *tmp___51 ; void *__gu_p___67 ; unsigned short *tmp___52 ; { tmp = tags; tags = tags + 1; __gu_p = (void *)tmp; switch (2UL) { case 1UL: *((u8 *)__gu_p) = 8U; goto ldv_45643; case 2UL: put_unaligned_le16(57352, __gu_p); goto ldv_45643; case 4UL: put_unaligned_le32(57352U, __gu_p); goto ldv_45643; case 8UL: put_unaligned_le64(57352ULL, __gu_p); goto ldv_45643; default: __bad_unaligned_access_size(); goto ldv_45643; } ldv_45643: tmp___0 = tags; tags = tags + 1; __gu_p___0 = (void *)tmp___0; switch (2UL) { case 1UL: *((u8 *)__gu_p___0) = (unsigned char )arg->my_addr_len; goto ldv_45650; case 2UL: put_unaligned_le16((int )((unsigned short )arg->my_addr_len), __gu_p___0); goto ldv_45650; case 4UL: put_unaligned_le32((unsigned int )arg->my_addr_len, __gu_p___0); goto ldv_45650; case 8UL: put_unaligned_le64((unsigned long long )arg->my_addr_len, __gu_p___0); goto ldv_45650; default: __bad_unaligned_access_size(); goto ldv_45650; } ldv_45650: __len = (size_t )arg->my_addr_len; __ret = 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; switch (2UL) { case 1UL: *((u8 *)__gu_p___1) = 9U; goto ldv_45660; case 2UL: put_unaligned_le16(57353, __gu_p___1); goto ldv_45660; case 4UL: put_unaligned_le32(57353U, __gu_p___1); goto ldv_45660; case 8UL: put_unaligned_le64(57353ULL, __gu_p___1); goto ldv_45660; default: __bad_unaligned_access_size(); goto ldv_45660; } ldv_45660: tmp___2 = tags; tags = tags + 1; __gu_p___2 = (void *)tmp___2; switch (2UL) { case 1UL: *((u8 *)__gu_p___2) = (unsigned char )arg->peer_addr_len; goto ldv_45667; case 2UL: put_unaligned_le16((int )((unsigned short )arg->peer_addr_len), __gu_p___2); goto ldv_45667; case 4UL: put_unaligned_le32((unsigned int )arg->peer_addr_len, __gu_p___2); goto ldv_45667; case 8UL: put_unaligned_le64((unsigned long long )arg->peer_addr_len, __gu_p___2); goto ldv_45667; default: __bad_unaligned_access_size(); goto ldv_45667; } ldv_45667: __len___0 = (size_t )arg->peer_addr_len; __ret___0 = 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; switch (2UL) { case 1UL: *((u8 *)__gu_p___3) = 10U; goto ldv_45677; case 2UL: put_unaligned_le16(49162, __gu_p___3); goto ldv_45677; case 4UL: put_unaligned_le32(49162U, __gu_p___3); goto ldv_45677; case 8UL: put_unaligned_le64(49162ULL, __gu_p___3); goto ldv_45677; default: __bad_unaligned_access_size(); goto ldv_45677; } ldv_45677: tmp___4 = tags; tags = tags + 1; __gu_p___4 = (void *)tmp___4; switch (2UL) { case 1UL: *((u8 *)__gu_p___4) = (unsigned char )arg->shared_secret_len; goto ldv_45684; case 2UL: put_unaligned_le16((int )((unsigned short )arg->shared_secret_len), __gu_p___4); goto ldv_45684; case 4UL: put_unaligned_le32((unsigned int )arg->shared_secret_len, __gu_p___4); goto ldv_45684; case 8UL: put_unaligned_le64((unsigned long long )arg->shared_secret_len, __gu_p___4); goto ldv_45684; default: __bad_unaligned_access_size(); goto ldv_45684; } ldv_45684: __len___1 = (size_t )arg->shared_secret_len; __ret___1 = 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; switch (2UL) { case 1UL: *((u8 *)__gu_p___5) = 11U; goto ldv_45694; case 2UL: put_unaligned_le16(49163, __gu_p___5); goto ldv_45694; case 4UL: put_unaligned_le32(49163U, __gu_p___5); goto ldv_45694; case 8UL: put_unaligned_le64(49163ULL, __gu_p___5); goto ldv_45694; default: __bad_unaligned_access_size(); goto ldv_45694; } ldv_45694: tmp___6 = tags; tags = tags + 1; __gu_p___6 = (void *)tmp___6; switch (2UL) { case 1UL: *((u8 *)__gu_p___6) = (unsigned char )arg->cram_hmac_alg_len; goto ldv_45701; case 2UL: put_unaligned_le16((int )((unsigned short )arg->cram_hmac_alg_len), __gu_p___6); goto ldv_45701; case 4UL: put_unaligned_le32((unsigned int )arg->cram_hmac_alg_len, __gu_p___6); goto ldv_45701; case 8UL: put_unaligned_le64((unsigned long long )arg->cram_hmac_alg_len, __gu_p___6); goto ldv_45701; default: __bad_unaligned_access_size(); goto ldv_45701; } ldv_45701: __len___2 = (size_t )arg->cram_hmac_alg_len; __ret___2 = 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; switch (2UL) { case 1UL: *((u8 *)__gu_p___7) = 44U; goto ldv_45711; case 2UL: put_unaligned_le16(49196, __gu_p___7); goto ldv_45711; case 4UL: put_unaligned_le32(49196U, __gu_p___7); goto ldv_45711; case 8UL: put_unaligned_le64(49196ULL, __gu_p___7); goto ldv_45711; default: __bad_unaligned_access_size(); goto ldv_45711; } ldv_45711: tmp___8 = tags; tags = tags + 1; __gu_p___8 = (void *)tmp___8; switch (2UL) { case 1UL: *((u8 *)__gu_p___8) = (unsigned char )arg->integrity_alg_len; goto ldv_45718; case 2UL: put_unaligned_le16((int )((unsigned short )arg->integrity_alg_len), __gu_p___8); goto ldv_45718; case 4UL: put_unaligned_le32((unsigned int )arg->integrity_alg_len, __gu_p___8); goto ldv_45718; case 8UL: put_unaligned_le64((unsigned long long )arg->integrity_alg_len, __gu_p___8); goto ldv_45718; default: __bad_unaligned_access_size(); goto ldv_45718; } ldv_45718: __len___3 = (size_t )arg->integrity_alg_len; __ret___3 = 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; switch (2UL) { case 1UL: *((u8 *)__gu_p___9) = 14U; goto ldv_45728; case 2UL: put_unaligned_le16(14, __gu_p___9); goto ldv_45728; case 4UL: put_unaligned_le32(14U, __gu_p___9); goto ldv_45728; case 8UL: put_unaligned_le64(14ULL, __gu_p___9); goto ldv_45728; default: __bad_unaligned_access_size(); goto ldv_45728; } ldv_45728: tmp___10 = tags; tags = tags + 1; __gu_p___10 = (void *)tmp___10; switch (2UL) { case 1UL: *((u8 *)__gu_p___10) = 4U; goto ldv_45735; case 2UL: put_unaligned_le16(4, __gu_p___10); goto ldv_45735; case 4UL: put_unaligned_le32(4U, __gu_p___10); goto ldv_45735; case 8UL: put_unaligned_le64(4ULL, __gu_p___10); goto ldv_45735; default: __bad_unaligned_access_size(); goto ldv_45735; } ldv_45735: __gu_p___11 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___11) = (unsigned char )arg->timeout; goto ldv_45742; case 2UL: put_unaligned_le16((int )((unsigned short )arg->timeout), __gu_p___11); goto ldv_45742; case 4UL: put_unaligned_le32((unsigned int )arg->timeout, __gu_p___11); goto ldv_45742; case 8UL: put_unaligned_le64((unsigned long long )arg->timeout, __gu_p___11); goto ldv_45742; default: __bad_unaligned_access_size(); goto ldv_45742; } ldv_45742: tags = tags + 4U; tmp___11 = tags; tags = tags + 1; __gu_p___12 = (void *)tmp___11; switch (2UL) { case 1UL: *((u8 *)__gu_p___12) = 15U; goto ldv_45749; case 2UL: put_unaligned_le16(8207, __gu_p___12); goto ldv_45749; case 4UL: put_unaligned_le32(8207U, __gu_p___12); goto ldv_45749; case 8UL: put_unaligned_le64(8207ULL, __gu_p___12); goto ldv_45749; default: __bad_unaligned_access_size(); goto ldv_45749; } ldv_45749: tmp___12 = tags; tags = tags + 1; __gu_p___13 = (void *)tmp___12; switch (2UL) { case 1UL: *((u8 *)__gu_p___13) = 4U; goto ldv_45756; case 2UL: put_unaligned_le16(4, __gu_p___13); goto ldv_45756; case 4UL: put_unaligned_le32(4U, __gu_p___13); goto ldv_45756; case 8UL: put_unaligned_le64(4ULL, __gu_p___13); goto ldv_45756; default: __bad_unaligned_access_size(); goto ldv_45756; } ldv_45756: __gu_p___14 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___14) = (unsigned char )arg->wire_protocol; goto ldv_45763; case 2UL: put_unaligned_le16((int )((unsigned short )arg->wire_protocol), __gu_p___14); goto ldv_45763; case 4UL: put_unaligned_le32((unsigned int )arg->wire_protocol, __gu_p___14); goto ldv_45763; case 8UL: put_unaligned_le64((unsigned long long )arg->wire_protocol, __gu_p___14); goto ldv_45763; default: __bad_unaligned_access_size(); goto ldv_45763; } ldv_45763: tags = tags + 4U; tmp___13 = tags; tags = tags + 1; __gu_p___15 = (void *)tmp___13; switch (2UL) { case 1UL: *((u8 *)__gu_p___15) = 16U; goto ldv_45770; case 2UL: put_unaligned_le16(16, __gu_p___15); goto ldv_45770; case 4UL: put_unaligned_le32(16U, __gu_p___15); goto ldv_45770; case 8UL: put_unaligned_le64(16ULL, __gu_p___15); goto ldv_45770; default: __bad_unaligned_access_size(); goto ldv_45770; } ldv_45770: tmp___14 = tags; tags = tags + 1; __gu_p___16 = (void *)tmp___14; switch (2UL) { case 1UL: *((u8 *)__gu_p___16) = 4U; goto ldv_45777; case 2UL: put_unaligned_le16(4, __gu_p___16); goto ldv_45777; case 4UL: put_unaligned_le32(4U, __gu_p___16); goto ldv_45777; case 8UL: put_unaligned_le64(4ULL, __gu_p___16); goto ldv_45777; default: __bad_unaligned_access_size(); goto ldv_45777; } ldv_45777: __gu_p___17 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___17) = (unsigned char )arg->try_connect_int; goto ldv_45784; case 2UL: put_unaligned_le16((int )((unsigned short )arg->try_connect_int), __gu_p___17); goto ldv_45784; case 4UL: put_unaligned_le32((unsigned int )arg->try_connect_int, __gu_p___17); goto ldv_45784; case 8UL: put_unaligned_le64((unsigned long long )arg->try_connect_int, __gu_p___17); goto ldv_45784; default: __bad_unaligned_access_size(); goto ldv_45784; } ldv_45784: tags = tags + 4U; tmp___15 = tags; tags = tags + 1; __gu_p___18 = (void *)tmp___15; switch (2UL) { case 1UL: *((u8 *)__gu_p___18) = 17U; goto ldv_45791; case 2UL: put_unaligned_le16(17, __gu_p___18); goto ldv_45791; case 4UL: put_unaligned_le32(17U, __gu_p___18); goto ldv_45791; case 8UL: put_unaligned_le64(17ULL, __gu_p___18); goto ldv_45791; default: __bad_unaligned_access_size(); goto ldv_45791; } ldv_45791: tmp___16 = tags; tags = tags + 1; __gu_p___19 = (void *)tmp___16; switch (2UL) { case 1UL: *((u8 *)__gu_p___19) = 4U; goto ldv_45798; case 2UL: put_unaligned_le16(4, __gu_p___19); goto ldv_45798; case 4UL: put_unaligned_le32(4U, __gu_p___19); goto ldv_45798; case 8UL: put_unaligned_le64(4ULL, __gu_p___19); goto ldv_45798; default: __bad_unaligned_access_size(); goto ldv_45798; } ldv_45798: __gu_p___20 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___20) = (unsigned char )arg->ping_int; goto ldv_45805; case 2UL: put_unaligned_le16((int )((unsigned short )arg->ping_int), __gu_p___20); goto ldv_45805; case 4UL: put_unaligned_le32((unsigned int )arg->ping_int, __gu_p___20); goto ldv_45805; case 8UL: put_unaligned_le64((unsigned long long )arg->ping_int, __gu_p___20); goto ldv_45805; default: __bad_unaligned_access_size(); goto ldv_45805; } ldv_45805: tags = tags + 4U; tmp___17 = tags; tags = tags + 1; __gu_p___21 = (void *)tmp___17; switch (2UL) { case 1UL: *((u8 *)__gu_p___21) = 18U; goto ldv_45812; case 2UL: put_unaligned_le16(18, __gu_p___21); goto ldv_45812; case 4UL: put_unaligned_le32(18U, __gu_p___21); goto ldv_45812; case 8UL: put_unaligned_le64(18ULL, __gu_p___21); goto ldv_45812; default: __bad_unaligned_access_size(); goto ldv_45812; } ldv_45812: tmp___18 = tags; tags = tags + 1; __gu_p___22 = (void *)tmp___18; switch (2UL) { case 1UL: *((u8 *)__gu_p___22) = 4U; goto ldv_45819; case 2UL: put_unaligned_le16(4, __gu_p___22); goto ldv_45819; case 4UL: put_unaligned_le32(4U, __gu_p___22); goto ldv_45819; case 8UL: put_unaligned_le64(4ULL, __gu_p___22); goto ldv_45819; default: __bad_unaligned_access_size(); goto ldv_45819; } ldv_45819: __gu_p___23 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___23) = (unsigned char )arg->max_epoch_size; goto ldv_45826; case 2UL: put_unaligned_le16((int )((unsigned short )arg->max_epoch_size), __gu_p___23); goto ldv_45826; case 4UL: put_unaligned_le32((unsigned int )arg->max_epoch_size, __gu_p___23); goto ldv_45826; case 8UL: put_unaligned_le64((unsigned long long )arg->max_epoch_size, __gu_p___23); goto ldv_45826; default: __bad_unaligned_access_size(); goto ldv_45826; } ldv_45826: tags = tags + 4U; tmp___19 = tags; tags = tags + 1; __gu_p___24 = (void *)tmp___19; switch (2UL) { case 1UL: *((u8 *)__gu_p___24) = 19U; goto ldv_45833; case 2UL: put_unaligned_le16(19, __gu_p___24); goto ldv_45833; case 4UL: put_unaligned_le32(19U, __gu_p___24); goto ldv_45833; case 8UL: put_unaligned_le64(19ULL, __gu_p___24); goto ldv_45833; default: __bad_unaligned_access_size(); goto ldv_45833; } ldv_45833: tmp___20 = tags; tags = tags + 1; __gu_p___25 = (void *)tmp___20; switch (2UL) { case 1UL: *((u8 *)__gu_p___25) = 4U; goto ldv_45840; case 2UL: put_unaligned_le16(4, __gu_p___25); goto ldv_45840; case 4UL: put_unaligned_le32(4U, __gu_p___25); goto ldv_45840; case 8UL: put_unaligned_le64(4ULL, __gu_p___25); goto ldv_45840; default: __bad_unaligned_access_size(); goto ldv_45840; } ldv_45840: __gu_p___26 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___26) = (unsigned char )arg->max_buffers; goto ldv_45847; case 2UL: put_unaligned_le16((int )((unsigned short )arg->max_buffers), __gu_p___26); goto ldv_45847; case 4UL: put_unaligned_le32((unsigned int )arg->max_buffers, __gu_p___26); goto ldv_45847; case 8UL: put_unaligned_le64((unsigned long long )arg->max_buffers, __gu_p___26); goto ldv_45847; default: __bad_unaligned_access_size(); goto ldv_45847; } ldv_45847: tags = tags + 4U; tmp___21 = tags; tags = tags + 1; __gu_p___27 = (void *)tmp___21; switch (2UL) { case 1UL: *((u8 *)__gu_p___27) = 20U; goto ldv_45854; case 2UL: put_unaligned_le16(20, __gu_p___27); goto ldv_45854; case 4UL: put_unaligned_le32(20U, __gu_p___27); goto ldv_45854; case 8UL: put_unaligned_le64(20ULL, __gu_p___27); goto ldv_45854; default: __bad_unaligned_access_size(); goto ldv_45854; } ldv_45854: tmp___22 = tags; tags = tags + 1; __gu_p___28 = (void *)tmp___22; switch (2UL) { case 1UL: *((u8 *)__gu_p___28) = 4U; goto ldv_45861; case 2UL: put_unaligned_le16(4, __gu_p___28); goto ldv_45861; case 4UL: put_unaligned_le32(4U, __gu_p___28); goto ldv_45861; case 8UL: put_unaligned_le64(4ULL, __gu_p___28); goto ldv_45861; default: __bad_unaligned_access_size(); goto ldv_45861; } ldv_45861: __gu_p___29 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___29) = (unsigned char )arg->unplug_watermark; goto ldv_45868; case 2UL: put_unaligned_le16((int )((unsigned short )arg->unplug_watermark), __gu_p___29); goto ldv_45868; case 4UL: put_unaligned_le32((unsigned int )arg->unplug_watermark, __gu_p___29); goto ldv_45868; case 8UL: put_unaligned_le64((unsigned long long )arg->unplug_watermark, __gu_p___29); goto ldv_45868; default: __bad_unaligned_access_size(); goto ldv_45868; } ldv_45868: tags = tags + 4U; tmp___23 = tags; tags = tags + 1; __gu_p___30 = (void *)tmp___23; switch (2UL) { case 1UL: *((u8 *)__gu_p___30) = 21U; goto ldv_45875; case 2UL: put_unaligned_le16(21, __gu_p___30); goto ldv_45875; case 4UL: put_unaligned_le32(21U, __gu_p___30); goto ldv_45875; case 8UL: put_unaligned_le64(21ULL, __gu_p___30); goto ldv_45875; default: __bad_unaligned_access_size(); goto ldv_45875; } ldv_45875: tmp___24 = tags; tags = tags + 1; __gu_p___31 = (void *)tmp___24; switch (2UL) { case 1UL: *((u8 *)__gu_p___31) = 4U; goto ldv_45882; case 2UL: put_unaligned_le16(4, __gu_p___31); goto ldv_45882; case 4UL: put_unaligned_le32(4U, __gu_p___31); goto ldv_45882; case 8UL: put_unaligned_le64(4ULL, __gu_p___31); goto ldv_45882; default: __bad_unaligned_access_size(); goto ldv_45882; } ldv_45882: __gu_p___32 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___32) = (unsigned char )arg->sndbuf_size; goto ldv_45889; case 2UL: put_unaligned_le16((int )((unsigned short )arg->sndbuf_size), __gu_p___32); goto ldv_45889; case 4UL: put_unaligned_le32((unsigned int )arg->sndbuf_size, __gu_p___32); goto ldv_45889; case 8UL: put_unaligned_le64((unsigned long long )arg->sndbuf_size, __gu_p___32); goto ldv_45889; default: __bad_unaligned_access_size(); goto ldv_45889; } ldv_45889: tags = tags + 4U; tmp___25 = tags; tags = tags + 1; __gu_p___33 = (void *)tmp___25; switch (2UL) { case 1UL: *((u8 *)__gu_p___33) = 22U; goto ldv_45896; case 2UL: put_unaligned_le16(22, __gu_p___33); goto ldv_45896; case 4UL: put_unaligned_le32(22U, __gu_p___33); goto ldv_45896; case 8UL: put_unaligned_le64(22ULL, __gu_p___33); goto ldv_45896; default: __bad_unaligned_access_size(); goto ldv_45896; } ldv_45896: tmp___26 = tags; tags = tags + 1; __gu_p___34 = (void *)tmp___26; switch (2UL) { case 1UL: *((u8 *)__gu_p___34) = 4U; goto ldv_45903; case 2UL: put_unaligned_le16(4, __gu_p___34); goto ldv_45903; case 4UL: put_unaligned_le32(4U, __gu_p___34); goto ldv_45903; case 8UL: put_unaligned_le64(4ULL, __gu_p___34); goto ldv_45903; default: __bad_unaligned_access_size(); goto ldv_45903; } ldv_45903: __gu_p___35 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___35) = (unsigned char )arg->ko_count; goto ldv_45910; case 2UL: put_unaligned_le16((int )((unsigned short )arg->ko_count), __gu_p___35); goto ldv_45910; case 4UL: put_unaligned_le32((unsigned int )arg->ko_count, __gu_p___35); goto ldv_45910; case 8UL: put_unaligned_le64((unsigned long long )arg->ko_count, __gu_p___35); goto ldv_45910; default: __bad_unaligned_access_size(); goto ldv_45910; } ldv_45910: tags = tags + 4U; tmp___27 = tags; tags = tags + 1; __gu_p___36 = (void *)tmp___27; switch (2UL) { case 1UL: *((u8 *)__gu_p___36) = 24U; goto ldv_45917; case 2UL: put_unaligned_le16(24, __gu_p___36); goto ldv_45917; case 4UL: put_unaligned_le32(24U, __gu_p___36); goto ldv_45917; case 8UL: put_unaligned_le64(24ULL, __gu_p___36); goto ldv_45917; default: __bad_unaligned_access_size(); goto ldv_45917; } ldv_45917: tmp___28 = tags; tags = tags + 1; __gu_p___37 = (void *)tmp___28; switch (2UL) { case 1UL: *((u8 *)__gu_p___37) = 4U; goto ldv_45924; case 2UL: put_unaligned_le16(4, __gu_p___37); goto ldv_45924; case 4UL: put_unaligned_le32(4U, __gu_p___37); goto ldv_45924; case 8UL: put_unaligned_le64(4ULL, __gu_p___37); goto ldv_45924; default: __bad_unaligned_access_size(); goto ldv_45924; } ldv_45924: __gu_p___38 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___38) = (unsigned char )arg->after_sb_0p; goto ldv_45931; case 2UL: put_unaligned_le16((int )((unsigned short )arg->after_sb_0p), __gu_p___38); goto ldv_45931; case 4UL: put_unaligned_le32((unsigned int )arg->after_sb_0p, __gu_p___38); goto ldv_45931; case 8UL: put_unaligned_le64((unsigned long long )arg->after_sb_0p, __gu_p___38); goto ldv_45931; default: __bad_unaligned_access_size(); goto ldv_45931; } ldv_45931: tags = tags + 4U; tmp___29 = tags; tags = tags + 1; __gu_p___39 = (void *)tmp___29; switch (2UL) { case 1UL: *((u8 *)__gu_p___39) = 25U; goto ldv_45938; case 2UL: put_unaligned_le16(25, __gu_p___39); goto ldv_45938; case 4UL: put_unaligned_le32(25U, __gu_p___39); goto ldv_45938; case 8UL: put_unaligned_le64(25ULL, __gu_p___39); goto ldv_45938; default: __bad_unaligned_access_size(); goto ldv_45938; } ldv_45938: tmp___30 = tags; tags = tags + 1; __gu_p___40 = (void *)tmp___30; switch (2UL) { case 1UL: *((u8 *)__gu_p___40) = 4U; goto ldv_45945; case 2UL: put_unaligned_le16(4, __gu_p___40); goto ldv_45945; case 4UL: put_unaligned_le32(4U, __gu_p___40); goto ldv_45945; case 8UL: put_unaligned_le64(4ULL, __gu_p___40); goto ldv_45945; default: __bad_unaligned_access_size(); goto ldv_45945; } ldv_45945: __gu_p___41 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___41) = (unsigned char )arg->after_sb_1p; goto ldv_45952; case 2UL: put_unaligned_le16((int )((unsigned short )arg->after_sb_1p), __gu_p___41); goto ldv_45952; case 4UL: put_unaligned_le32((unsigned int )arg->after_sb_1p, __gu_p___41); goto ldv_45952; case 8UL: put_unaligned_le64((unsigned long long )arg->after_sb_1p, __gu_p___41); goto ldv_45952; default: __bad_unaligned_access_size(); goto ldv_45952; } ldv_45952: tags = tags + 4U; tmp___31 = tags; tags = tags + 1; __gu_p___42 = (void *)tmp___31; switch (2UL) { case 1UL: *((u8 *)__gu_p___42) = 26U; goto ldv_45959; case 2UL: put_unaligned_le16(26, __gu_p___42); goto ldv_45959; case 4UL: put_unaligned_le32(26U, __gu_p___42); goto ldv_45959; case 8UL: put_unaligned_le64(26ULL, __gu_p___42); goto ldv_45959; default: __bad_unaligned_access_size(); goto ldv_45959; } ldv_45959: tmp___32 = tags; tags = tags + 1; __gu_p___43 = (void *)tmp___32; switch (2UL) { case 1UL: *((u8 *)__gu_p___43) = 4U; goto ldv_45966; case 2UL: put_unaligned_le16(4, __gu_p___43); goto ldv_45966; case 4UL: put_unaligned_le32(4U, __gu_p___43); goto ldv_45966; case 8UL: put_unaligned_le64(4ULL, __gu_p___43); goto ldv_45966; default: __bad_unaligned_access_size(); goto ldv_45966; } ldv_45966: __gu_p___44 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___44) = (unsigned char )arg->after_sb_2p; goto ldv_45973; case 2UL: put_unaligned_le16((int )((unsigned short )arg->after_sb_2p), __gu_p___44); goto ldv_45973; case 4UL: put_unaligned_le32((unsigned int )arg->after_sb_2p, __gu_p___44); goto ldv_45973; case 8UL: put_unaligned_le64((unsigned long long )arg->after_sb_2p, __gu_p___44); goto ldv_45973; default: __bad_unaligned_access_size(); goto ldv_45973; } ldv_45973: tags = tags + 4U; tmp___33 = tags; tags = tags + 1; __gu_p___45 = (void *)tmp___33; switch (2UL) { case 1UL: *((u8 *)__gu_p___45) = 39U; goto ldv_45980; case 2UL: put_unaligned_le16(39, __gu_p___45); goto ldv_45980; case 4UL: put_unaligned_le32(39U, __gu_p___45); goto ldv_45980; case 8UL: put_unaligned_le64(39ULL, __gu_p___45); goto ldv_45980; default: __bad_unaligned_access_size(); goto ldv_45980; } ldv_45980: tmp___34 = tags; tags = tags + 1; __gu_p___46 = (void *)tmp___34; switch (2UL) { case 1UL: *((u8 *)__gu_p___46) = 4U; goto ldv_45987; case 2UL: put_unaligned_le16(4, __gu_p___46); goto ldv_45987; case 4UL: put_unaligned_le32(4U, __gu_p___46); goto ldv_45987; case 8UL: put_unaligned_le64(4ULL, __gu_p___46); goto ldv_45987; default: __bad_unaligned_access_size(); goto ldv_45987; } ldv_45987: __gu_p___47 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___47) = (unsigned char )arg->rr_conflict; goto ldv_45994; case 2UL: put_unaligned_le16((int )((unsigned short )arg->rr_conflict), __gu_p___47); goto ldv_45994; case 4UL: put_unaligned_le32((unsigned int )arg->rr_conflict, __gu_p___47); goto ldv_45994; case 8UL: put_unaligned_le64((unsigned long long )arg->rr_conflict, __gu_p___47); goto ldv_45994; default: __bad_unaligned_access_size(); goto ldv_45994; } ldv_45994: tags = tags + 4U; tmp___35 = tags; tags = tags + 1; __gu_p___48 = (void *)tmp___35; switch (2UL) { case 1UL: *((u8 *)__gu_p___48) = 40U; goto ldv_46001; case 2UL: put_unaligned_le16(40, __gu_p___48); goto ldv_46001; case 4UL: put_unaligned_le32(40U, __gu_p___48); goto ldv_46001; case 8UL: put_unaligned_le64(40ULL, __gu_p___48); goto ldv_46001; default: __bad_unaligned_access_size(); goto ldv_46001; } ldv_46001: tmp___36 = tags; tags = tags + 1; __gu_p___49 = (void *)tmp___36; switch (2UL) { case 1UL: *((u8 *)__gu_p___49) = 4U; goto ldv_46008; case 2UL: put_unaligned_le16(4, __gu_p___49); goto ldv_46008; case 4UL: put_unaligned_le32(4U, __gu_p___49); goto ldv_46008; case 8UL: put_unaligned_le64(4ULL, __gu_p___49); goto ldv_46008; default: __bad_unaligned_access_size(); goto ldv_46008; } ldv_46008: __gu_p___50 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___50) = (unsigned char )arg->ping_timeo; goto ldv_46015; case 2UL: put_unaligned_le16((int )((unsigned short )arg->ping_timeo), __gu_p___50); goto ldv_46015; case 4UL: put_unaligned_le32((unsigned int )arg->ping_timeo, __gu_p___50); goto ldv_46015; case 8UL: put_unaligned_le64((unsigned long long )arg->ping_timeo, __gu_p___50); goto ldv_46015; default: __bad_unaligned_access_size(); goto ldv_46015; } ldv_46015: tags = tags + 4U; tmp___37 = tags; tags = tags + 1; __gu_p___51 = (void *)tmp___37; switch (2UL) { case 1UL: *((u8 *)__gu_p___51) = 67U; goto ldv_46022; case 2UL: put_unaligned_le16(67, __gu_p___51); goto ldv_46022; case 4UL: put_unaligned_le32(67U, __gu_p___51); goto ldv_46022; case 8UL: put_unaligned_le64(67ULL, __gu_p___51); goto ldv_46022; default: __bad_unaligned_access_size(); goto ldv_46022; } ldv_46022: tmp___38 = tags; tags = tags + 1; __gu_p___52 = (void *)tmp___38; switch (2UL) { case 1UL: *((u8 *)__gu_p___52) = 4U; goto ldv_46029; case 2UL: put_unaligned_le16(4, __gu_p___52); goto ldv_46029; case 4UL: put_unaligned_le32(4U, __gu_p___52); goto ldv_46029; case 8UL: put_unaligned_le64(4ULL, __gu_p___52); goto ldv_46029; default: __bad_unaligned_access_size(); goto ldv_46029; } ldv_46029: __gu_p___53 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___53) = (unsigned char )arg->rcvbuf_size; goto ldv_46036; case 2UL: put_unaligned_le16((int )((unsigned short )arg->rcvbuf_size), __gu_p___53); goto ldv_46036; case 4UL: put_unaligned_le32((unsigned int )arg->rcvbuf_size, __gu_p___53); goto ldv_46036; case 8UL: put_unaligned_le64((unsigned long long )arg->rcvbuf_size, __gu_p___53); goto ldv_46036; default: __bad_unaligned_access_size(); goto ldv_46036; } ldv_46036: tags = tags + 4U; tmp___39 = tags; tags = tags + 1; __gu_p___54 = (void *)tmp___39; switch (2UL) { case 1UL: *((u8 *)__gu_p___54) = 60U; goto ldv_46043; case 2UL: put_unaligned_le16(41020, __gu_p___54); goto ldv_46043; case 4UL: put_unaligned_le32(41020U, __gu_p___54); goto ldv_46043; case 8UL: put_unaligned_le64(41020ULL, __gu_p___54); goto ldv_46043; default: __bad_unaligned_access_size(); goto ldv_46043; } ldv_46043: tmp___40 = tags; tags = tags + 1; __gu_p___55 = (void *)tmp___40; switch (2UL) { case 1UL: *((u8 *)__gu_p___55) = 1U; goto ldv_46050; case 2UL: put_unaligned_le16(1, __gu_p___55); goto ldv_46050; case 4UL: put_unaligned_le32(1U, __gu_p___55); goto ldv_46050; case 8UL: put_unaligned_le64(1ULL, __gu_p___55); goto ldv_46050; default: __bad_unaligned_access_size(); goto ldv_46050; } ldv_46050: *((char *)tags) = (char )arg->mind_af; tags = tags + 1U; tmp___41 = tags; tags = tags + 1; __gu_p___56 = (void *)tmp___41; switch (2UL) { case 1UL: *((u8 *)__gu_p___56) = 27U; goto ldv_46057; case 2UL: put_unaligned_le16(32795, __gu_p___56); goto ldv_46057; case 4UL: put_unaligned_le32(32795U, __gu_p___56); goto ldv_46057; case 8UL: put_unaligned_le64(32795ULL, __gu_p___56); goto ldv_46057; default: __bad_unaligned_access_size(); goto ldv_46057; } ldv_46057: tmp___42 = tags; tags = tags + 1; __gu_p___57 = (void *)tmp___42; switch (2UL) { case 1UL: *((u8 *)__gu_p___57) = 1U; goto ldv_46064; case 2UL: put_unaligned_le16(1, __gu_p___57); goto ldv_46064; case 4UL: put_unaligned_le32(1U, __gu_p___57); goto ldv_46064; case 8UL: put_unaligned_le64(1ULL, __gu_p___57); goto ldv_46064; default: __bad_unaligned_access_size(); goto ldv_46064; } ldv_46064: *((char *)tags) = (char )arg->want_lose; tags = tags + 1U; tmp___43 = tags; tags = tags + 1; __gu_p___58 = (void *)tmp___43; switch (2UL) { case 1UL: *((u8 *)__gu_p___58) = 28U; goto ldv_46071; case 2UL: put_unaligned_le16(32796, __gu_p___58); goto ldv_46071; case 4UL: put_unaligned_le32(32796U, __gu_p___58); goto ldv_46071; case 8UL: put_unaligned_le64(32796ULL, __gu_p___58); goto ldv_46071; default: __bad_unaligned_access_size(); goto ldv_46071; } ldv_46071: tmp___44 = tags; tags = tags + 1; __gu_p___59 = (void *)tmp___44; switch (2UL) { case 1UL: *((u8 *)__gu_p___59) = 1U; goto ldv_46078; case 2UL: put_unaligned_le16(1, __gu_p___59); goto ldv_46078; case 4UL: put_unaligned_le32(1U, __gu_p___59); goto ldv_46078; case 8UL: put_unaligned_le64(1ULL, __gu_p___59); goto ldv_46078; default: __bad_unaligned_access_size(); goto ldv_46078; } ldv_46078: *((char *)tags) = (char )arg->two_primaries; tags = tags + 1U; tmp___45 = tags; tags = tags + 1; __gu_p___60 = (void *)tmp___45; switch (2UL) { case 1UL: *((u8 *)__gu_p___60) = 41U; goto ldv_46085; case 2UL: put_unaligned_le16(32809, __gu_p___60); goto ldv_46085; case 4UL: put_unaligned_le32(32809U, __gu_p___60); goto ldv_46085; case 8UL: put_unaligned_le64(32809ULL, __gu_p___60); goto ldv_46085; default: __bad_unaligned_access_size(); goto ldv_46085; } ldv_46085: tmp___46 = tags; tags = tags + 1; __gu_p___61 = (void *)tmp___46; switch (2UL) { case 1UL: *((u8 *)__gu_p___61) = 1U; goto ldv_46092; case 2UL: put_unaligned_le16(1, __gu_p___61); goto ldv_46092; case 4UL: put_unaligned_le32(1U, __gu_p___61); goto ldv_46092; case 8UL: put_unaligned_le64(1ULL, __gu_p___61); goto ldv_46092; default: __bad_unaligned_access_size(); goto ldv_46092; } ldv_46092: *((char *)tags) = (char )arg->always_asbp; tags = tags + 1U; tmp___47 = tags; tags = tags + 1; __gu_p___62 = (void *)tmp___47; switch (2UL) { case 1UL: *((u8 *)__gu_p___62) = 61U; goto ldv_46099; case 2UL: put_unaligned_le16(32829, __gu_p___62); goto ldv_46099; case 4UL: put_unaligned_le32(32829U, __gu_p___62); goto ldv_46099; case 8UL: put_unaligned_le64(32829ULL, __gu_p___62); goto ldv_46099; default: __bad_unaligned_access_size(); goto ldv_46099; } ldv_46099: tmp___48 = tags; tags = tags + 1; __gu_p___63 = (void *)tmp___48; switch (2UL) { case 1UL: *((u8 *)__gu_p___63) = 1U; goto ldv_46106; case 2UL: put_unaligned_le16(1, __gu_p___63); goto ldv_46106; case 4UL: put_unaligned_le32(1U, __gu_p___63); goto ldv_46106; case 8UL: put_unaligned_le64(1ULL, __gu_p___63); goto ldv_46106; default: __bad_unaligned_access_size(); goto ldv_46106; } ldv_46106: *((char *)tags) = (char )arg->no_cork; tags = tags + 1U; tmp___49 = tags; tags = tags + 1; __gu_p___64 = (void *)tmp___49; switch (2UL) { case 1UL: *((u8 *)__gu_p___64) = 62U; goto ldv_46113; case 2UL: put_unaligned_le16(41022, __gu_p___64); goto ldv_46113; case 4UL: put_unaligned_le32(41022U, __gu_p___64); goto ldv_46113; case 8UL: put_unaligned_le64(41022ULL, __gu_p___64); goto ldv_46113; default: __bad_unaligned_access_size(); goto ldv_46113; } ldv_46113: tmp___50 = tags; tags = tags + 1; __gu_p___65 = (void *)tmp___50; switch (2UL) { case 1UL: *((u8 *)__gu_p___65) = 1U; goto ldv_46120; case 2UL: put_unaligned_le16(1, __gu_p___65); goto ldv_46120; case 4UL: put_unaligned_le32(1U, __gu_p___65); goto ldv_46120; case 8UL: put_unaligned_le64(1ULL, __gu_p___65); goto ldv_46120; default: __bad_unaligned_access_size(); goto ldv_46120; } ldv_46120: *((char *)tags) = (char )arg->auto_sndbuf_size; tags = tags + 1U; tmp___51 = tags; tags = tags + 1; __gu_p___66 = (void *)tmp___51; switch (2UL) { case 1UL: *((u8 *)__gu_p___66) = 70U; goto ldv_46127; case 2UL: put_unaligned_le16(41030, __gu_p___66); goto ldv_46127; case 4UL: put_unaligned_le32(41030U, __gu_p___66); goto ldv_46127; case 8UL: put_unaligned_le64(41030ULL, __gu_p___66); goto ldv_46127; default: __bad_unaligned_access_size(); goto ldv_46127; } ldv_46127: tmp___52 = tags; tags = tags + 1; __gu_p___67 = (void *)tmp___52; switch (2UL) { case 1UL: *((u8 *)__gu_p___67) = 1U; goto ldv_46134; case 2UL: put_unaligned_le16(1, __gu_p___67); goto ldv_46134; case 4UL: put_unaligned_le32(1U, __gu_p___67); goto ldv_46134; case 8UL: put_unaligned_le64(1ULL, __gu_p___67); goto ldv_46134; default: __bad_unaligned_access_size(); goto ldv_46134; } ldv_46134: *((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; switch (2UL) { case 1UL: *((u8 *)__gu_p) = 30U; goto ldv_46217; case 2UL: put_unaligned_le16(30, __gu_p); goto ldv_46217; case 4UL: put_unaligned_le32(30U, __gu_p); goto ldv_46217; case 8UL: put_unaligned_le64(30ULL, __gu_p); goto ldv_46217; default: __bad_unaligned_access_size(); goto ldv_46217; } ldv_46217: tmp___0 = tags; tags = tags + 1; __gu_p___0 = (void *)tmp___0; switch (2UL) { case 1UL: *((u8 *)__gu_p___0) = 4U; goto ldv_46224; case 2UL: put_unaligned_le16(4, __gu_p___0); goto ldv_46224; case 4UL: put_unaligned_le32(4U, __gu_p___0); goto ldv_46224; case 8UL: put_unaligned_le64(4ULL, __gu_p___0); goto ldv_46224; default: __bad_unaligned_access_size(); goto ldv_46224; } ldv_46224: __gu_p___1 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___1) = (unsigned char )arg->rate; goto ldv_46231; case 2UL: put_unaligned_le16((int )((unsigned short )arg->rate), __gu_p___1); goto ldv_46231; case 4UL: put_unaligned_le32((unsigned int )arg->rate, __gu_p___1); goto ldv_46231; case 8UL: put_unaligned_le64((unsigned long long )arg->rate, __gu_p___1); goto ldv_46231; default: __bad_unaligned_access_size(); goto ldv_46231; } ldv_46231: tags = tags + 4U; tmp___1 = tags; tags = tags + 1; __gu_p___2 = (void *)tmp___1; switch (2UL) { case 1UL: *((u8 *)__gu_p___2) = 31U; goto ldv_46238; case 2UL: put_unaligned_le16(31, __gu_p___2); goto ldv_46238; case 4UL: put_unaligned_le32(31U, __gu_p___2); goto ldv_46238; case 8UL: put_unaligned_le64(31ULL, __gu_p___2); goto ldv_46238; default: __bad_unaligned_access_size(); goto ldv_46238; } ldv_46238: tmp___2 = tags; tags = tags + 1; __gu_p___3 = (void *)tmp___2; switch (2UL) { case 1UL: *((u8 *)__gu_p___3) = 4U; goto ldv_46245; case 2UL: put_unaligned_le16(4, __gu_p___3); goto ldv_46245; case 4UL: put_unaligned_le32(4U, __gu_p___3); goto ldv_46245; case 8UL: put_unaligned_le64(4ULL, __gu_p___3); goto ldv_46245; default: __bad_unaligned_access_size(); goto ldv_46245; } ldv_46245: __gu_p___4 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___4) = (unsigned char )arg->after; goto ldv_46252; case 2UL: put_unaligned_le16((int )((unsigned short )arg->after), __gu_p___4); goto ldv_46252; case 4UL: put_unaligned_le32((unsigned int )arg->after, __gu_p___4); goto ldv_46252; case 8UL: put_unaligned_le64((unsigned long long )arg->after, __gu_p___4); goto ldv_46252; default: __bad_unaligned_access_size(); goto ldv_46252; } ldv_46252: tags = tags + 4U; tmp___3 = tags; tags = tags + 1; __gu_p___5 = (void *)tmp___3; switch (2UL) { case 1UL: *((u8 *)__gu_p___5) = 32U; goto ldv_46259; case 2UL: put_unaligned_le16(32, __gu_p___5); goto ldv_46259; case 4UL: put_unaligned_le32(32U, __gu_p___5); goto ldv_46259; case 8UL: put_unaligned_le64(32ULL, __gu_p___5); goto ldv_46259; default: __bad_unaligned_access_size(); goto ldv_46259; } ldv_46259: tmp___4 = tags; tags = tags + 1; __gu_p___6 = (void *)tmp___4; switch (2UL) { case 1UL: *((u8 *)__gu_p___6) = 4U; goto ldv_46266; case 2UL: put_unaligned_le16(4, __gu_p___6); goto ldv_46266; case 4UL: put_unaligned_le32(4U, __gu_p___6); goto ldv_46266; case 8UL: put_unaligned_le64(4ULL, __gu_p___6); goto ldv_46266; default: __bad_unaligned_access_size(); goto ldv_46266; } ldv_46266: __gu_p___7 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___7) = (unsigned char )arg->al_extents; goto ldv_46273; case 2UL: put_unaligned_le16((int )((unsigned short )arg->al_extents), __gu_p___7); goto ldv_46273; case 4UL: put_unaligned_le32((unsigned int )arg->al_extents, __gu_p___7); goto ldv_46273; case 8UL: put_unaligned_le64((unsigned long long )arg->al_extents, __gu_p___7); goto ldv_46273; default: __bad_unaligned_access_size(); goto ldv_46273; } ldv_46273: tags = tags + 4U; tmp___5 = tags; tags = tags + 1; __gu_p___8 = (void *)tmp___5; switch (2UL) { case 1UL: *((u8 *)__gu_p___8) = 52U; goto ldv_46280; case 2UL: put_unaligned_le16(49204, __gu_p___8); goto ldv_46280; case 4UL: put_unaligned_le32(49204U, __gu_p___8); goto ldv_46280; case 8UL: put_unaligned_le64(49204ULL, __gu_p___8); goto ldv_46280; default: __bad_unaligned_access_size(); goto ldv_46280; } ldv_46280: tmp___6 = tags; tags = tags + 1; __gu_p___9 = (void *)tmp___6; switch (2UL) { case 1UL: *((u8 *)__gu_p___9) = (unsigned char )arg->verify_alg_len; goto ldv_46287; case 2UL: put_unaligned_le16((int )((unsigned short )arg->verify_alg_len), __gu_p___9); goto ldv_46287; case 4UL: put_unaligned_le32((unsigned int )arg->verify_alg_len, __gu_p___9); goto ldv_46287; case 8UL: put_unaligned_le64((unsigned long long )arg->verify_alg_len, __gu_p___9); goto ldv_46287; default: __bad_unaligned_access_size(); goto ldv_46287; } ldv_46287: __len = (size_t )arg->verify_alg_len; __ret = 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; switch (2UL) { case 1UL: *((u8 *)__gu_p___10) = 51U; goto ldv_46297; case 2UL: put_unaligned_le16(49203, __gu_p___10); goto ldv_46297; case 4UL: put_unaligned_le32(49203U, __gu_p___10); goto ldv_46297; case 8UL: put_unaligned_le64(49203ULL, __gu_p___10); goto ldv_46297; default: __bad_unaligned_access_size(); goto ldv_46297; } ldv_46297: tmp___8 = tags; tags = tags + 1; __gu_p___11 = (void *)tmp___8; switch (2UL) { case 1UL: *((u8 *)__gu_p___11) = (unsigned char )arg->cpu_mask_len; goto ldv_46304; case 2UL: put_unaligned_le16((int )((unsigned short )arg->cpu_mask_len), __gu_p___11); goto ldv_46304; case 4UL: put_unaligned_le32((unsigned int )arg->cpu_mask_len, __gu_p___11); goto ldv_46304; case 8UL: put_unaligned_le64((unsigned long long )arg->cpu_mask_len, __gu_p___11); goto ldv_46304; default: __bad_unaligned_access_size(); goto ldv_46304; } ldv_46304: __len___0 = (size_t )arg->cpu_mask_len; __ret___0 = 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; switch (2UL) { case 1UL: *((u8 *)__gu_p___12) = 64U; goto ldv_46314; case 2UL: put_unaligned_le16(49216, __gu_p___12); goto ldv_46314; case 4UL: put_unaligned_le32(49216U, __gu_p___12); goto ldv_46314; case 8UL: put_unaligned_le64(49216ULL, __gu_p___12); goto ldv_46314; default: __bad_unaligned_access_size(); goto ldv_46314; } ldv_46314: tmp___10 = tags; tags = tags + 1; __gu_p___13 = (void *)tmp___10; switch (2UL) { case 1UL: *((u8 *)__gu_p___13) = (unsigned char )arg->csums_alg_len; goto ldv_46321; case 2UL: put_unaligned_le16((int )((unsigned short )arg->csums_alg_len), __gu_p___13); goto ldv_46321; case 4UL: put_unaligned_le32((unsigned int )arg->csums_alg_len, __gu_p___13); goto ldv_46321; case 8UL: put_unaligned_le64((unsigned long long )arg->csums_alg_len, __gu_p___13); goto ldv_46321; default: __bad_unaligned_access_size(); goto ldv_46321; } ldv_46321: __len___1 = (size_t )arg->csums_alg_len; __ret___1 = 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; switch (2UL) { case 1UL: *((u8 *)__gu_p___14) = 65U; goto ldv_46331; case 2UL: put_unaligned_le16(32833, __gu_p___14); goto ldv_46331; case 4UL: put_unaligned_le32(32833U, __gu_p___14); goto ldv_46331; case 8UL: put_unaligned_le64(32833ULL, __gu_p___14); goto ldv_46331; default: __bad_unaligned_access_size(); goto ldv_46331; } ldv_46331: tmp___12 = tags; tags = tags + 1; __gu_p___15 = (void *)tmp___12; switch (2UL) { case 1UL: *((u8 *)__gu_p___15) = 1U; goto ldv_46338; case 2UL: put_unaligned_le16(1, __gu_p___15); goto ldv_46338; case 4UL: put_unaligned_le32(1U, __gu_p___15); goto ldv_46338; case 8UL: put_unaligned_le64(1ULL, __gu_p___15); goto ldv_46338; default: __bad_unaligned_access_size(); goto ldv_46338; } ldv_46338: *((char *)tags) = (char )arg->use_rle; tags = tags + 1U; tmp___13 = tags; tags = tags + 1; __gu_p___16 = (void *)tmp___13; switch (2UL) { case 1UL: *((u8 *)__gu_p___16) = 75U; goto ldv_46345; case 2UL: put_unaligned_le16(75, __gu_p___16); goto ldv_46345; case 4UL: put_unaligned_le32(75U, __gu_p___16); goto ldv_46345; case 8UL: put_unaligned_le64(75ULL, __gu_p___16); goto ldv_46345; default: __bad_unaligned_access_size(); goto ldv_46345; } ldv_46345: tmp___14 = tags; tags = tags + 1; __gu_p___17 = (void *)tmp___14; switch (2UL) { case 1UL: *((u8 *)__gu_p___17) = 4U; goto ldv_46352; case 2UL: put_unaligned_le16(4, __gu_p___17); goto ldv_46352; case 4UL: put_unaligned_le32(4U, __gu_p___17); goto ldv_46352; case 8UL: put_unaligned_le64(4ULL, __gu_p___17); goto ldv_46352; default: __bad_unaligned_access_size(); goto ldv_46352; } ldv_46352: __gu_p___18 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___18) = (unsigned char )arg->on_no_data; goto ldv_46359; case 2UL: put_unaligned_le16((int )((unsigned short )arg->on_no_data), __gu_p___18); goto ldv_46359; case 4UL: put_unaligned_le32((unsigned int )arg->on_no_data, __gu_p___18); goto ldv_46359; case 8UL: put_unaligned_le64((unsigned long long )arg->on_no_data, __gu_p___18); goto ldv_46359; default: __bad_unaligned_access_size(); goto ldv_46359; } ldv_46359: tags = tags + 4U; tmp___15 = tags; tags = tags + 1; __gu_p___19 = (void *)tmp___15; switch (2UL) { case 1UL: *((u8 *)__gu_p___19) = 76U; goto ldv_46366; case 2UL: put_unaligned_le16(76, __gu_p___19); goto ldv_46366; case 4UL: put_unaligned_le32(76U, __gu_p___19); goto ldv_46366; case 8UL: put_unaligned_le64(76ULL, __gu_p___19); goto ldv_46366; default: __bad_unaligned_access_size(); goto ldv_46366; } ldv_46366: tmp___16 = tags; tags = tags + 1; __gu_p___20 = (void *)tmp___16; switch (2UL) { case 1UL: *((u8 *)__gu_p___20) = 4U; goto ldv_46373; case 2UL: put_unaligned_le16(4, __gu_p___20); goto ldv_46373; case 4UL: put_unaligned_le32(4U, __gu_p___20); goto ldv_46373; case 8UL: put_unaligned_le64(4ULL, __gu_p___20); goto ldv_46373; default: __bad_unaligned_access_size(); goto ldv_46373; } ldv_46373: __gu_p___21 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___21) = (unsigned char )arg->c_plan_ahead; goto ldv_46380; case 2UL: put_unaligned_le16((int )((unsigned short )arg->c_plan_ahead), __gu_p___21); goto ldv_46380; case 4UL: put_unaligned_le32((unsigned int )arg->c_plan_ahead, __gu_p___21); goto ldv_46380; case 8UL: put_unaligned_le64((unsigned long long )arg->c_plan_ahead, __gu_p___21); goto ldv_46380; default: __bad_unaligned_access_size(); goto ldv_46380; } ldv_46380: tags = tags + 4U; tmp___17 = tags; tags = tags + 1; __gu_p___22 = (void *)tmp___17; switch (2UL) { case 1UL: *((u8 *)__gu_p___22) = 77U; goto ldv_46387; case 2UL: put_unaligned_le16(77, __gu_p___22); goto ldv_46387; case 4UL: put_unaligned_le32(77U, __gu_p___22); goto ldv_46387; case 8UL: put_unaligned_le64(77ULL, __gu_p___22); goto ldv_46387; default: __bad_unaligned_access_size(); goto ldv_46387; } ldv_46387: tmp___18 = tags; tags = tags + 1; __gu_p___23 = (void *)tmp___18; switch (2UL) { case 1UL: *((u8 *)__gu_p___23) = 4U; goto ldv_46394; case 2UL: put_unaligned_le16(4, __gu_p___23); goto ldv_46394; case 4UL: put_unaligned_le32(4U, __gu_p___23); goto ldv_46394; case 8UL: put_unaligned_le64(4ULL, __gu_p___23); goto ldv_46394; default: __bad_unaligned_access_size(); goto ldv_46394; } ldv_46394: __gu_p___24 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___24) = (unsigned char )arg->c_delay_target; goto ldv_46401; case 2UL: put_unaligned_le16((int )((unsigned short )arg->c_delay_target), __gu_p___24); goto ldv_46401; case 4UL: put_unaligned_le32((unsigned int )arg->c_delay_target, __gu_p___24); goto ldv_46401; case 8UL: put_unaligned_le64((unsigned long long )arg->c_delay_target, __gu_p___24); goto ldv_46401; default: __bad_unaligned_access_size(); goto ldv_46401; } ldv_46401: tags = tags + 4U; tmp___19 = tags; tags = tags + 1; __gu_p___25 = (void *)tmp___19; switch (2UL) { case 1UL: *((u8 *)__gu_p___25) = 78U; goto ldv_46408; case 2UL: put_unaligned_le16(78, __gu_p___25); goto ldv_46408; case 4UL: put_unaligned_le32(78U, __gu_p___25); goto ldv_46408; case 8UL: put_unaligned_le64(78ULL, __gu_p___25); goto ldv_46408; default: __bad_unaligned_access_size(); goto ldv_46408; } ldv_46408: tmp___20 = tags; tags = tags + 1; __gu_p___26 = (void *)tmp___20; switch (2UL) { case 1UL: *((u8 *)__gu_p___26) = 4U; goto ldv_46415; case 2UL: put_unaligned_le16(4, __gu_p___26); goto ldv_46415; case 4UL: put_unaligned_le32(4U, __gu_p___26); goto ldv_46415; case 8UL: put_unaligned_le64(4ULL, __gu_p___26); goto ldv_46415; default: __bad_unaligned_access_size(); goto ldv_46415; } ldv_46415: __gu_p___27 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___27) = (unsigned char )arg->c_fill_target; goto ldv_46422; case 2UL: put_unaligned_le16((int )((unsigned short )arg->c_fill_target), __gu_p___27); goto ldv_46422; case 4UL: put_unaligned_le32((unsigned int )arg->c_fill_target, __gu_p___27); goto ldv_46422; case 8UL: put_unaligned_le64((unsigned long long )arg->c_fill_target, __gu_p___27); goto ldv_46422; default: __bad_unaligned_access_size(); goto ldv_46422; } ldv_46422: tags = tags + 4U; tmp___21 = tags; tags = tags + 1; __gu_p___28 = (void *)tmp___21; switch (2UL) { case 1UL: *((u8 *)__gu_p___28) = 79U; goto ldv_46429; case 2UL: put_unaligned_le16(79, __gu_p___28); goto ldv_46429; case 4UL: put_unaligned_le32(79U, __gu_p___28); goto ldv_46429; case 8UL: put_unaligned_le64(79ULL, __gu_p___28); goto ldv_46429; default: __bad_unaligned_access_size(); goto ldv_46429; } ldv_46429: tmp___22 = tags; tags = tags + 1; __gu_p___29 = (void *)tmp___22; switch (2UL) { case 1UL: *((u8 *)__gu_p___29) = 4U; goto ldv_46436; case 2UL: put_unaligned_le16(4, __gu_p___29); goto ldv_46436; case 4UL: put_unaligned_le32(4U, __gu_p___29); goto ldv_46436; case 8UL: put_unaligned_le64(4ULL, __gu_p___29); goto ldv_46436; default: __bad_unaligned_access_size(); goto ldv_46436; } ldv_46436: __gu_p___30 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___30) = (unsigned char )arg->c_max_rate; goto ldv_46443; case 2UL: put_unaligned_le16((int )((unsigned short )arg->c_max_rate), __gu_p___30); goto ldv_46443; case 4UL: put_unaligned_le32((unsigned int )arg->c_max_rate, __gu_p___30); goto ldv_46443; case 8UL: put_unaligned_le64((unsigned long long )arg->c_max_rate, __gu_p___30); goto ldv_46443; default: __bad_unaligned_access_size(); goto ldv_46443; } ldv_46443: tags = tags + 4U; tmp___23 = tags; tags = tags + 1; __gu_p___31 = (void *)tmp___23; switch (2UL) { case 1UL: *((u8 *)__gu_p___31) = 80U; goto ldv_46450; case 2UL: put_unaligned_le16(80, __gu_p___31); goto ldv_46450; case 4UL: put_unaligned_le32(80U, __gu_p___31); goto ldv_46450; case 8UL: put_unaligned_le64(80ULL, __gu_p___31); goto ldv_46450; default: __bad_unaligned_access_size(); goto ldv_46450; } ldv_46450: tmp___24 = tags; tags = tags + 1; __gu_p___32 = (void *)tmp___24; switch (2UL) { case 1UL: *((u8 *)__gu_p___32) = 4U; goto ldv_46457; case 2UL: put_unaligned_le16(4, __gu_p___32); goto ldv_46457; case 4UL: put_unaligned_le32(4U, __gu_p___32); goto ldv_46457; case 8UL: put_unaligned_le64(4ULL, __gu_p___32); goto ldv_46457; default: __bad_unaligned_access_size(); goto ldv_46457; } ldv_46457: __gu_p___33 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___33) = (unsigned char )arg->c_min_rate; goto ldv_46464; case 2UL: put_unaligned_le16((int )((unsigned short )arg->c_min_rate), __gu_p___33); goto ldv_46464; case 4UL: put_unaligned_le32((unsigned int )arg->c_min_rate, __gu_p___33); goto ldv_46464; case 8UL: put_unaligned_le64((unsigned long long )arg->c_min_rate, __gu_p___33); goto ldv_46464; default: __bad_unaligned_access_size(); goto ldv_46464; } ldv_46464: 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; switch (2UL) { case 1UL: *((u8 *)__gu_p) = 33U; goto ldv_46552; case 2UL: put_unaligned_le16(33, __gu_p); goto ldv_46552; case 4UL: put_unaligned_le32(33U, __gu_p); goto ldv_46552; case 8UL: put_unaligned_le64(33ULL, __gu_p); goto ldv_46552; default: __bad_unaligned_access_size(); goto ldv_46552; } ldv_46552: tmp___0 = tags; tags = tags + 1; __gu_p___0 = (void *)tmp___0; switch (2UL) { case 1UL: *((u8 *)__gu_p___0) = 4U; goto ldv_46559; case 2UL: put_unaligned_le16(4, __gu_p___0); goto ldv_46559; case 4UL: put_unaligned_le32(4U, __gu_p___0); goto ldv_46559; case 8UL: put_unaligned_le64(4ULL, __gu_p___0); goto ldv_46559; default: __bad_unaligned_access_size(); goto ldv_46559; } ldv_46559: __gu_p___1 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___1) = (unsigned char )arg->state_i; goto ldv_46566; case 2UL: put_unaligned_le16((int )((unsigned short )arg->state_i), __gu_p___1); goto ldv_46566; case 4UL: put_unaligned_le32((unsigned int )arg->state_i, __gu_p___1); goto ldv_46566; case 8UL: put_unaligned_le64((unsigned long long )arg->state_i, __gu_p___1); goto ldv_46566; default: __bad_unaligned_access_size(); goto ldv_46566; } ldv_46566: 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] = 0; envp[4] = 0; envp[5] = 0; argv[0] = (char *)(& usermode_helper); argv[1] = cmd; argv[2] = (char *)(& mb); argv[3] = 0; tmp = mdev_to_minor(mdev); snprintf((char *)(& mb), 12UL, "minor-%d", tmp); tmp___0 = get_net_conf(mdev); if (tmp___0 != 0) { switch ((int )((struct sockaddr *)(& (mdev->net_conf)->peer_addr))->sa_family) { 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_46887; 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_46887; default: afs = (char *)"ssocks"; snprintf((char *)(& ad), 60UL, "DRBD_PEER_ADDRESS=%pI4", & ((struct sockaddr_in *)(& (mdev->net_conf)->peer_addr))->sin_addr); } ldv_46887: 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), UMH_WAIT_PROC); 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 + 503UL) != 49152U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.pdsk == D_UNKNOWN ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_nl.c.prepared", 260); } else { } tmp = _get_ldev_if_state(mdev, D_CONSISTENT); 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_35533.pdsk; goto out; } r = drbd_khelper(mdev, (char *)"fence-peer"); switch ((r >> 8) & 255) { case 3: ex_to_string = (char *)"peer is inconsistent or worse"; nps = D_INCONSISTENT; goto ldv_46899; case 4: ex_to_string = (char *)"peer was fenced"; nps = D_OUTDATED; goto ldv_46899; case 5: ; if ((unsigned int )*((unsigned char *)mdev + 2013UL) == 16U) { ex_to_string = (char *)"peer is unreachable, assumed to be dead"; nps = D_OUTDATED; } else { ex_to_string = (char *)"peer unreachable, doing nothing since disk != UpToDate"; nps = (enum drbd_disk_state )mdev->state.ldv_35533.pdsk; } goto ldv_46899; 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 = D_UNKNOWN; val.i = 0U; val.ldv_35533.disk = 5U; mask.i = 0U; mask.ldv_35533.disk = 15U; _drbd_request_state(mdev, mask, val, CS_WAIT_COMPLETE); goto ldv_46899; 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 = D_OUTDATED; goto ldv_46899; default: nps = D_UNKNOWN; dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "fence-peer helper broken, returned %d\n", (r >> 8) & 255); return (nps); } ldv_46899: _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 + 2014UL) != 0U && (unsigned int )nps > 5U) { val___0.i = 0U; val___0.ldv_35533.susp_fen = 0U; mask___0.i = 0U; mask___0.ldv_35533.susp_fen = 1U; _drbd_request_state(mdev, mask___0, val___0, CS_VERBOSE); } else { } return (nps); } } static int _try_outdate_peer_async(void *data ) { struct drbd_conf *mdev ; enum drbd_disk_state nps ; union drbd_state val ; union drbd_state mask ; { mdev = (struct drbd_conf *)data; nps = drbd_try_outdate_peer(mdev); val.i = 0U; val.ldv_35533.pdsk = (unsigned char )nps; mask.i = 0U; mask.ldv_35533.pdsk = 15U; drbd_request_state(mdev, mask, val); 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(& _try_outdate_peer_async, (void *)mdev, "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; } } int drbd_set_role(struct drbd_conf *mdev , enum drbd_role new_role , int force ) { int max_tries ; int r ; int try ; int forced ; union drbd_state mask ; union drbd_state val ; enum drbd_disk_state nps ; struct task_struct *tmp ; int tmp___0 ; int tmp___1 ; wait_queue_t __wait ; struct task_struct *tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; { max_tries = 4; r = 0; try = 0; forced = 0; if ((unsigned int )new_role == 1U) { request_ping(mdev); } else { } ldv_mutex_lock_193(& mdev->state_mutex); mask.i = 0U; mask.ldv_35533.role = 3U; val.i = 0U; val.ldv_35533.role = (unsigned char )new_role; goto ldv_46940; ldv_46943: r = _drbd_request_state(mdev, mask, val, CS_WAIT_COMPLETE); if (r == -10 && *((unsigned int *)(& mask) + 0UL) != 0U) { val.ldv_35533.pdsk = 0U; mask.ldv_35533.pdsk = 0U; goto ldv_46940; } else { } if ((r == -2 && force != 0) && ((int )mdev->state.ldv_35533.disk <= 7 && (int )mdev->state.ldv_35533.disk > 3)) { mask.ldv_35533.disk = 15U; val.ldv_35533.disk = 8U; forced = 1; goto ldv_46940; } else { } if ((r == -2 && (unsigned int )*((unsigned char *)mdev + 2013UL) == 14U) && *((unsigned int *)(& mask) + 0UL) == 0U) { if (*((unsigned int *)mdev + 503UL) != 49152U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.pdsk == D_UNKNOWN ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_nl.c.prepared", 385); } else { } nps = drbd_try_outdate_peer(mdev); if ((unsigned int )nps == 5U || (unsigned int )nps == 4U) { val.ldv_35533.disk = 8U; mask.ldv_35533.disk = 15U; } else { } val.ldv_35533.pdsk = (unsigned char )nps; mask.ldv_35533.pdsk = 15U; goto ldv_46940; } else { } if (r == 2) { goto fail; } else { } if (r == -7 && *((unsigned int *)(& mask) + 0UL) == 0U) { nps = drbd_try_outdate_peer(mdev); if (force != 0 && (unsigned int )nps > 5U) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Forced into split brain situation!\n"); nps = D_OUTDATED; } else { } mask.ldv_35533.pdsk = 15U; val.ldv_35533.pdsk = (unsigned char )nps; goto ldv_46940; } else { } if (r == -1) { tmp = get_current(); tmp->state = 1L; schedule_timeout((long )((((mdev->net_conf)->ping_timeo + 1) * 250) / 10)); if (try < max_tries) { try = max_tries + -1; } else { } goto ldv_46940; } else { } if (r <= 0) { r = _drbd_request_state(mdev, mask, val, 6); if (r <= 0) { goto fail; } else { } } else { } goto ldv_46942; ldv_46940: tmp___0 = try; try = try + 1; if (tmp___0 < max_tries) { goto ldv_46943; } else { } ldv_46942: ; if (r <= 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___1 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); if (tmp___1 == 0) { goto ldv_46944; } else { } 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_46947: prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___3 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); if (tmp___3 == 0) { goto ldv_46946; } else { } schedule(); goto ldv_46947; ldv_46946: finish_wait(& mdev->misc_wait, & __wait); ldv_46944: ; if ((unsigned int )new_role == 2U) { set_disk_ro(mdev->vdisk, 1); tmp___4 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___4 != 0) { (mdev->ldev)->md.uuid[0] = (mdev->ldev)->md.uuid[0] & 0xfffffffffffffffeULL; put_ldev(mdev); } else { } } else { tmp___5 = get_net_conf(mdev); if (tmp___5 != 0) { (mdev->net_conf)->want_lose = 0U; put_net_conf(mdev); } else { } set_disk_ro(mdev->vdisk, 0); tmp___6 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___6 != 0) { if ((((int )mdev->state.ldv_35533.conn <= 9 || (int )mdev->state.ldv_35533.pdsk <= 2) && (mdev->ldev)->md.uuid[1] == 0ULL) || forced != 0) { drbd_uuid_new_current(mdev); } else { } (mdev->ldev)->md.uuid[0] = (mdev->ldev)->md.uuid[0] | 1ULL; put_ldev(mdev); } else { } } if ((unsigned int )new_role == 2U) { tmp___7 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___7 != 0) { drbd_al_to_on_disk_bm(mdev); put_ldev(mdev); } else { } } else { } if ((int )mdev->state.ldv_35533.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, KOBJ_CHANGE); fail: ldv_mutex_unlock_194(& mdev->state_mutex); return (r); } } static struct drbd_conf *ensure_mdev(int minor , int create ) { struct drbd_conf *mdev ; struct gendisk *disk ; { if ((unsigned int )minor >= minor_count) { return (0); } else { } mdev = minor_to_mdev((unsigned int )minor); if ((unsigned long )mdev == (unsigned long )((struct drbd_conf *)0) && create != 0) { disk = 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 = 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 { } 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 ; { 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 { } reply->ret_code = drbd_set_role(mdev, R_PRIMARY, (int )primary_args.primary_force); return (0); } } static int drbd_nl_secondary(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { { reply->ret_code = drbd_set_role(mdev, R_SECONDARY, 0); 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; switch (bdev->dc.meta_dev_idx) { 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_46971; case -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_46971; case -1: ; case -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) & 0xffffffffffff8000UL; md_size_sect = md_size_sect >> 15; md_size_sect = (md_size_sect + 7UL) & 0xfffffffffffffff8UL; 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_46971; } ldv_46971: ; return; } } char *ppsize(char *buf , unsigned long long size ) { char units[6U] ; int base ; { units[0] = 75; units[1] = 77; units[2] = 71; units[3] = 84; units[4] = 80; units[5] = 69; base = 0; goto ldv_46982; ldv_46981: size = (size >> 10) + (unsigned long long )((size & 512ULL) != 0ULL); base = base + 1; ldv_46982: ; if (size > 9999ULL) { goto ldv_46981; } else { } sprintf(buf, "%lu %cB", (long )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(16U, (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_46987; } 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_46990: 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_46989; } else { } schedule(); goto ldv_46990; ldv_46989: finish_wait(& mdev->misc_wait, & __wait); ldv_46987: ; return; } } void drbd_resume_io(struct drbd_conf *mdev ) { { clear_bit(16, (unsigned long volatile *)(& mdev->flags)); __wake_up(& mdev->misc_wait, 3U, 1, 0); return; } } enum determine_dev_size drbd_determin_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 ; { rv = 0; drbd_suspend_io(mdev); tmp = lc_try_lock(mdev->act_log); if (tmp != 0) { goto ldv_47006; } 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_47009: prepare_to_wait(& mdev->al_wait, & __wait, 2); tmp___1 = lc_try_lock(mdev->act_log); if (tmp___1 != 0) { goto ldv_47008; } else { } schedule(); goto ldv_47009; ldv_47008: finish_wait(& mdev->al_wait, & __wait); ldv_47006: 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: /* CIL Label */ err = drbd_bm_resize(mdev, size, ((unsigned int )flags & 2U) == 0U); tmp___3 = ldv__builtin_expect(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 = dev_size_error; } 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); md_moved = tmp___7 != prev_first_sect || (sector_t )(mdev->ldev)->md.md_size_sect != prev_size; if (la_size_changed != 0 || md_moved != 0) { drbd_al_shrink(mdev); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Writing the whole bitmap, %s\n", la_size_changed == 0 || md_moved == 0 ? (la_size_changed != 0 ? (char *)"size changed" : (char *)"md moved") : (char *)"size changed and md moved"); tmp___8 = drbd_bitmap_io(mdev, & drbd_bm_write, (char *)"size changed"); rv = (enum determine_dev_size )tmp___8; drbd_md_mark_dirty(mdev); } else { } if (size > la_size) { rv = grew; } else { } if (size < la_size) { rv = shrunk; } else { } out: lc_unlock(mdev->act_log); __wake_up(& mdev->al_wait, 3U, 1, 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 ; { 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_35533.conn <= 9 && 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 { } if (p_size != 0UL && m_size != 0UL) { __min1 = p_size; __min2 = m_size; size = __min1 < __min2 ? __min1 : __min2; } else if (la_size != 0UL) { size = la_size; if (m_size != 0UL && m_size < size) { size = m_size; } else { } if (p_size != 0UL && p_size < size) { size = p_size; } 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), "%s: (%s) in %s:%d\n", "drbd_check_al_size", (char *)"mdev->sync_conf.al_extents < 7", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_nl.c.prepared", 782); } else { } if (_b != 0) { mdev->sync_conf.al_extents = 127; } else { } if ((unsigned long )mdev->act_log != (unsigned long )((struct lru_cache *)0) && (mdev->act_log)->nr_elements == (unsigned int )mdev->sync_conf.al_extents) { return (0); } 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_47037; ldv_47036: 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_47037: ; if ((unsigned int )i < t->nr_elements) { goto ldv_47036; } else { } } 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); } } void drbd_setup_queue_param(struct drbd_conf *mdev , unsigned int max_seg_s ) { struct request_queue *q ; struct request_queue *b ; int max_segments ; unsigned int _min1 ; unsigned int tmp ; unsigned short tmp___0 ; unsigned int _min2 ; unsigned int tmp___1 ; { q = mdev->rq_queue; b = (((mdev->ldev)->backing_bdev)->bd_disk)->queue; max_segments = (mdev->ldev)->dc.max_bio_bvecs; tmp = queue_max_sectors(b); tmp___0 = queue_logical_block_size(b); _min1 = tmp * (unsigned int )tmp___0; _min2 = max_seg_s; max_seg_s = _min1 < _min2 ? _min1 : _min2; blk_queue_max_hw_sectors(q, max_seg_s >> 9); blk_queue_max_segments(q, max_segments != 0 ? (int )((unsigned short )max_segments) : 128); blk_queue_max_segment_size(q, max_seg_s); blk_queue_logical_block_size(q, 512); blk_queue_segment_boundary(q, 4095UL); blk_stack_limits(& q->limits, & b->limits, 0UL); tmp___1 = queue_max_segment_size(q); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "max_segment_size ( = BIO size ) = %u\n", tmp___1); if (q->backing_dev_info.ra_pages != b->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->backing_dev_info.ra_pages); q->backing_dev_info.ra_pages = b->backing_dev_info.ra_pages; } else { } 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_47052; } 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_47055: 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_47054; } else { } schedule(); goto ldv_47055; ldv_47054: finish_wait(& mdev->state_wait, & __wait); ldv_47052: tmp___2 = constant_test_bit(23U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___2 == 0) { goto ldv_47056; } 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_47059: 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_47058; } else { } schedule(); goto ldv_47059; ldv_47058: finish_wait(& mdev->state_wait, & __wait___0); ldv_47056: 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 + 2013UL) == 0U && (unsigned int )*((unsigned short *)mdev + 1006UL) == 0U) && (unsigned int )*((unsigned char *)mdev + 2012UL) == 2U) { set_bit(23U, (unsigned long volatile *)(& mdev->flags)); drbd_thread_stop_nowait(& mdev->worker); } else { clear_bit(22, (unsigned long volatile *)(& mdev->flags)); } spin_unlock_irq(& mdev->req_lock); __wake_up(& mdev->state_wait, 3U, 1, 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_35533.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_codes retcode ; enum determine_dev_size dd ; sector_t max_possible_sectors ; sector_t min_md_device_sectors ; struct drbd_backing_dev *nbc ; struct inode *inode ; struct inode *inode2 ; struct lru_cache *resync_lru ; union drbd_state ns ; union drbd_state os ; unsigned int max_seg_s ; int rv ; int cp_discovered ; int logical_block_size ; void *tmp ; int tmp___0 ; int prot ; int tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; int tmp___6 ; int tmp___7 ; sector_t tmp___8 ; sector_t tmp___9 ; sector_t tmp___10 ; sector_t tmp___11 ; sector_t tmp___12 ; int tmp___13 ; int tmp___14 ; wait_queue_t __wait ; struct task_struct *tmp___15 ; int tmp___16 ; int tmp___17 ; union drbd_state val ; union drbd_state mask ; int tmp___18 ; int tmp___19 ; unsigned short tmp___20 ; struct page *page ; struct page *tmp___21 ; int tmp___22 ; int tmp___23 ; int tmp___24 ; int tmp___25 ; sector_t tmp___26 ; int tmp___27 ; int tmp___28 ; int tmp___29 ; int tmp___30 ; int tmp___31 ; int tmp___32 ; int tmp___33 ; int tmp___34 ; unsigned long tmp___35 ; unsigned long tmp___36 ; int tmp___37 ; int tmp___38 ; int tmp___39 ; union drbd_state val___0 ; union drbd_state mask___0 ; { nbc = 0; resync_lru = 0; cp_discovered = 0; drbd_reconfig_start(mdev); if ((int )mdev->state.ldv_35533.disk > 0) { retcode = ERR_DISK_CONFIGURED; goto fail; } else { } tmp = kzalloc___3(408UL, 208U); nbc = (struct drbd_backing_dev *)tmp; if ((unsigned long )nbc == (unsigned long )((struct drbd_backing_dev *)0)) { retcode = ERR_NOMEM; 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___0 = disk_conf_from_tags(mdev, (unsigned short *)(& nlp->tag_list), & nbc->dc); if (tmp___0 == 0) { retcode = ERR_MANDATORY_TAG; goto fail; } else { } if (nbc->dc.meta_dev_idx < -3) { retcode = ERR_MD_IDX_INVALID; goto fail; } else { } tmp___1 = get_net_conf(mdev); if (tmp___1 != 0) { prot = (mdev->net_conf)->wire_protocol; put_net_conf(mdev); if (nbc->dc.fencing == 2 && prot == 1) { retcode = ERR_STONITH_AND_PROT_A; goto fail; } else { } } else { } nbc->lo_file = filp_open((char const *)(& nbc->dc.backing_dev), 2, 0); tmp___3 = IS_ERR((void const *)nbc->lo_file); if (tmp___3 != 0L) { tmp___2 = PTR_ERR((void const *)nbc->lo_file); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "open(\"%s\") failed with %ld\n", (unsigned char *)(& nbc->dc.backing_dev), tmp___2); nbc->lo_file = 0; retcode = ERR_OPEN_DISK; goto fail; } else { } inode = ((nbc->lo_file)->f_path.dentry)->d_inode; if (((int )inode->i_mode & 61440) != 24576) { retcode = ERR_DISK_NOT_BDEV; goto fail; } else { } nbc->md_file = filp_open((char const *)(& nbc->dc.meta_dev), 2, 0); tmp___5 = IS_ERR((void const *)nbc->md_file); if (tmp___5 != 0L) { tmp___4 = PTR_ERR((void const *)nbc->md_file); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "open(\"%s\") failed with %ld\n", (unsigned char *)(& nbc->dc.meta_dev), tmp___4); nbc->md_file = 0; retcode = ERR_OPEN_MD_DISK; goto fail; } else { } inode2 = ((nbc->md_file)->f_path.dentry)->d_inode; if (((int )inode2->i_mode & 61440) != 24576) { retcode = ERR_MD_NOT_BDEV; goto fail; } else { } nbc->backing_bdev = inode->ldv_23147.i_bdev; tmp___6 = bd_claim(nbc->backing_bdev, (void *)mdev); if (tmp___6 != 0) { printk("<3>drbd: bd_claim(%p,%p); failed [%p;%p;%u]\n", nbc->backing_bdev, mdev, (nbc->backing_bdev)->bd_holder, ((nbc->backing_bdev)->bd_contains)->bd_holder, (nbc->backing_bdev)->bd_holders); retcode = ERR_BDCLAIM_DISK; 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 = ERR_NOMEM; goto release_bdev_fail; } else { } nbc->md_bdev = inode2->ldv_23147.i_bdev; tmp___7 = bd_claim(nbc->md_bdev, nbc->dc.meta_dev_idx < 0 ? (void *)mdev : (void *)drbd_m_holder); if (tmp___7 != 0) { retcode = ERR_BDCLAIM_MD_DISK; goto release_bdev_fail; } else { } if (((unsigned long )nbc->backing_bdev == (unsigned long )nbc->md_bdev) ^ (int )((_Bool )(nbc->dc.meta_dev_idx == -1 || nbc->dc.meta_dev_idx == -3))) { retcode = ERR_MD_IDX_INVALID; goto release_bdev2_fail; } else { } drbd_md_set_sector_offsets(mdev, nbc); tmp___9 = drbd_get_max_capacity___1(nbc); if ((unsigned long long )tmp___9 < nbc->dc.disk_size) { tmp___8 = 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___8, nbc->dc.disk_size); retcode = ERR_DISK_TO_SMALL; goto release_bdev2_fail; } else { } if (nbc->dc.meta_dev_idx < 0) { max_possible_sectors = 34359738368UL; min_md_device_sectors = 2048UL; } else { max_possible_sectors = 8587575296UL; min_md_device_sectors = (unsigned long )(nbc->dc.meta_dev_idx + 1) * 262144UL; } tmp___10 = drbd_get_capacity(nbc->md_bdev); if (tmp___10 < min_md_device_sectors) { retcode = ERR_MD_DISK_TO_SMALL; 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 release_bdev2_fail; } else { } tmp___11 = drbd_get_max_capacity___1(nbc); tmp___12 = drbd_get_capacity(mdev->this_bdev); if (tmp___11 < tmp___12) { retcode = ERR_DISK_TO_SMALL; goto release_bdev2_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___13 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); if (tmp___13 == 0) { goto ldv_47090; } else { tmp___14 = is_susp(mdev->state); if (tmp___14 != 0) { goto ldv_47090; } else { } } tmp___15 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___15; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_47093: prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___16 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); if (tmp___16 == 0) { goto ldv_47092; } else { tmp___17 = is_susp(mdev->state); if (tmp___17 != 0) { goto ldv_47092; } else { } } schedule(); goto ldv_47093; ldv_47092: finish_wait(& mdev->misc_wait, & __wait); ldv_47090: drbd_flush_workqueue(mdev); val.i = 0U; val.ldv_35533.disk = 1U; mask.i = 0U; mask.ldv_35533.disk = 15U; tmp___18 = _drbd_request_state(mdev, mask, val, CS_VERBOSE); retcode = (enum drbd_ret_codes )tmp___18; drbd_resume_io(mdev); if ((unsigned int )retcode == 0U) { goto release_bdev2_fail; } else { } tmp___19 = _get_ldev_if_state(mdev, D_ATTACHING); if (tmp___19 == 0) { goto force_diskless; } else { } drbd_md_set_sector_offsets(mdev, nbc); tmp___20 = bdev_logical_block_size(nbc->md_bdev); logical_block_size = (int )tmp___20; 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___21 = alloc_pages(16U, 0U); page = tmp___21; 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___22 = drbd_bm_init(mdev); if (tmp___22 != 0) { retcode = ERR_NOMEM; goto force_diskless_dec; } else { } } else { } tmp___23 = drbd_md_read(mdev, nbc); retcode = (enum drbd_ret_codes )tmp___23; if ((unsigned int )retcode != 101U) { goto force_diskless_dec; } else { } if (((int )mdev->state.ldv_35533.conn <= 9 && (unsigned int )*((unsigned char *)mdev + 2012UL) == 1U) && ((mdev->ed_uuid ^ nbc->md.uuid[0]) & 0xfffffffffffffffeULL) != 0ULL) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Can only attach to data with current UUID=%016llX\n", mdev->ed_uuid); retcode = ERR_DATA_NOT_CURRENT; goto force_diskless_dec; } else { } tmp___24 = drbd_check_al_size(mdev); if (tmp___24 != 0) { retcode = ERR_NOMEM; goto force_diskless_dec; } else { } tmp___25 = drbd_md_test_flag(nbc, 1); if (tmp___25 != 0) { tmp___26 = drbd_new_dev_size(mdev, nbc, 0); if ((unsigned long long )tmp___26 < nbc->md.la_size_sect) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "refusing to truncate a consistent device\n"); retcode = ERR_DISK_TO_SMALL; goto force_diskless_dec; } else { } } else { } tmp___27 = drbd_al_read_log(mdev, nbc); if (tmp___27 == 0) { retcode = ERR_IO_MD_DISK; goto force_diskless_dec; } else { } if ((unsigned int )*((unsigned char *)nbc + 388UL) != 0U) { set_bit(15U, (unsigned long volatile *)(& mdev->flags)); } else { clear_bit(15, (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 *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_nl.c.prepared", 1164); } else { } mdev->ldev = nbc; mdev->resync = resync_lru; nbc = 0; resync_lru = 0; mdev->write_ordering = WO_bio_barrier; drbd_bump_write_ordering(mdev, WO_bio_barrier); tmp___28 = drbd_md_test_flag(mdev->ldev, 64); if (tmp___28 != 0) { set_bit(11U, (unsigned long volatile *)(& mdev->flags)); } else { clear_bit(11, (unsigned long volatile *)(& mdev->flags)); } tmp___29 = drbd_md_test_flag(mdev->ldev, 2); if (tmp___29 != 0 && ((unsigned int )*((unsigned char *)mdev + 2012UL) != 1U || (unsigned int )*((unsigned char *)mdev + 2014UL) == 0U)) { set_bit(11U, (unsigned long volatile *)(& mdev->flags)); cp_discovered = 1; } else { } mdev->send_cnt = 0U; mdev->recv_cnt = 0U; mdev->read_cnt = 0U; mdev->writ_cnt = 0U; max_seg_s = 131072U; if ((unsigned int )*((unsigned short *)mdev + 1006UL) == 160U) { if (mdev->agreed_pro_version <= 93) { max_seg_s = queue_max_segment_size(mdev->rq_queue); } else if (mdev->agreed_pro_version == 94) { max_seg_s = 32768U; } else { } } else { } drbd_setup_queue_param(mdev, max_seg_s); clear_bit(7, (unsigned long volatile *)(& mdev->flags)); if ((unsigned int )*((unsigned char *)mdev + 2012UL) != 1U) { tmp___30 = drbd_md_test_flag(mdev->ldev, 2); if (tmp___30 != 0) { tmp___31 = drbd_md_test_flag(mdev->ldev, 4); if (tmp___31 == 0) { set_bit(7U, (unsigned long volatile *)(& mdev->flags)); } else { } } else { } } else { } dd = drbd_determin_dev_size(mdev, 0); if ((int )dd == -1) { retcode = ERR_NOMEM_BITMAP; goto force_diskless_dec; } else if ((int )dd == 2) { set_bit(20U, (unsigned long volatile *)(& mdev->flags)); } else { } tmp___34 = drbd_md_test_flag(mdev->ldev, 8); if (tmp___34 != 0) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Assuming that all blocks are out of sync (aka FullSync)\n"); tmp___32 = drbd_bitmap_io(mdev, & drbd_bmio_set_n_write, (char *)"set_n_write from attaching"); if (tmp___32 != 0) { retcode = ERR_IO_MD_DISK; goto force_diskless_dec; } else { } } else { tmp___33 = drbd_bitmap_io(mdev, & drbd_bm_read, (char *)"read from attaching"); if (tmp___33 < 0) { retcode = ERR_IO_MD_DISK; goto force_diskless_dec; } else { } } if (cp_discovered != 0) { drbd_al_apply_to_bm(mdev); drbd_al_to_on_disk_bm(mdev); } else { } tmp___35 = _drbd_bm_total_weight(mdev); tmp___36 = drbd_bm_bits(mdev); if (tmp___35 == tmp___36) { drbd_suspend_al(mdev); } else { } spin_lock_irq(& mdev->req_lock); os = mdev->state; ns.i = os.i; tmp___38 = drbd_md_test_flag(mdev->ldev, 1); if (tmp___38 != 0) { tmp___37 = drbd_md_test_flag(mdev->ldev, 16); if (tmp___37 != 0) { ns.ldv_35533.disk = 7U; } else { ns.ldv_35533.disk = 5U; } } else { ns.ldv_35533.disk = 4U; } tmp___39 = drbd_md_test_flag(mdev->ldev, 32); if (tmp___39 != 0) { ns.ldv_35533.pdsk = 5U; } else { } if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 14U && (*((unsigned int *)(& ns) + 0UL) == 40960U || (mdev->ldev)->dc.fencing == 0)) { ns.ldv_35533.disk = 8U; } else { } if ((unsigned int )*((unsigned short *)mdev + 1006UL) == 160U) { mdev->new_state_tmp.i = ns.i; ns.i = os.i; ns.ldv_35533.disk = 3U; kfree((void const *)mdev->p_uuid); mdev->p_uuid = 0; } else { } rv = _drbd_set_state(mdev, ns, CS_VERBOSE, 0); ns = mdev->state; spin_unlock_irq(& mdev->req_lock); if (rv <= 0) { goto force_diskless_dec; } else { } if ((unsigned int )*((unsigned char *)mdev + 2012UL) == 1U) { (mdev->ldev)->md.uuid[0] = (mdev->ldev)->md.uuid[0] | 1ULL; } else { (mdev->ldev)->md.uuid[0] = (mdev->ldev)->md.uuid[0] & 0xfffffffffffffffeULL; } drbd_md_mark_dirty(mdev); drbd_md_sync(mdev); kobject_uevent(& (mdev->vdisk)->part0.__dev.kobj, KOBJ_CHANGE); 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_35533.disk = 0U; mask___0.i = 0U; mask___0.ldv_35533.disk = 15U; drbd_force_state(mdev, mask___0, val___0); drbd_md_sync(mdev); release_bdev2_fail: ; if ((unsigned long )nbc != (unsigned long )((struct drbd_backing_dev *)0)) { bd_release(nbc->md_bdev); } else { } release_bdev_fail: ; if ((unsigned long )nbc != (unsigned long )((struct drbd_backing_dev *)0)) { bd_release(nbc->backing_bdev); } else { } fail: ; if ((unsigned long )nbc != (unsigned long )((struct drbd_backing_dev *)0)) { if ((unsigned long )nbc->lo_file != (unsigned long )((struct file *)0)) { fput(nbc->lo_file); } else { } if ((unsigned long )nbc->md_file != (unsigned long )((struct file *)0)) { fput(nbc->md_file); } 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 ) { union drbd_state val ; union drbd_state mask ; { val.i = 0U; val.ldv_35533.disk = 0U; mask.i = 0U; mask.ldv_35533.disk = 15U; reply->ret_code = drbd_request_state(mdev, mask, val); 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_codes 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 ; int tmp___16 ; { new_conf = 0; tfm = 0; integrity_w_tfm = 0; integrity_r_tfm = 0; new_tl_hash = 0; new_ee_hash = 0; int_dig_out = 0; int_dig_in = 0; int_dig_vv = 0; drbd_reconfig_start(mdev); if ((int )mdev->state.ldv_35533.conn > 0) { retcode = ERR_NET_CONFIGURED; goto fail; } else { } tmp = kzalloc___3(532UL, 208U); new_conf = (struct net_conf *)tmp; if ((unsigned long )new_conf == (unsigned long )((struct net_conf *)0)) { retcode = ERR_NOMEM; 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 = 0U; new_conf->two_primaries = 0U; new_conf->wire_protocol = 3; new_conf->ping_timeo = 5; new_conf->rr_conflict = 0; tmp___0 = net_conf_from_tags(mdev, (unsigned short *)(& nlp->tag_list), new_conf); if (tmp___0 == 0) { retcode = ERR_MANDATORY_TAG; goto fail; } else { } if ((unsigned int )*((unsigned char *)new_conf + 528UL) != 0U && new_conf->wire_protocol != 3) { retcode = ERR_NOT_PROTO_C; goto fail; } else { } tmp___1 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___1 != 0) { fp = (enum drbd_fencing_p )(mdev->ldev)->dc.fencing; put_ldev(mdev); if (new_conf->wire_protocol == 1 && (unsigned int )fp == 2U) { retcode = ERR_STONITH_AND_PROT_A; goto fail; } else { } } else { } if ((unsigned int )*((unsigned char *)mdev + 2012UL) == 1U && (unsigned int )*((unsigned char *)new_conf + 528UL) != 0U) { retcode = ERR_DISCARD; goto fail; } else { } retcode = NO_ERROR; new_my_addr = (struct sockaddr *)(& new_conf->my_addr); new_peer_addr = (struct sockaddr *)(& new_conf->peer_addr); i = 0; goto ldv_47140; ldv_47139: odev = minor_to_mdev((unsigned int )i); if ((unsigned long )odev == (unsigned long )((struct drbd_conf *)0) || (unsigned long )odev == (unsigned long )mdev) { goto ldv_47138; } 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 = ERR_LOCAL_ADDR; } 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 = ERR_PEER_ADDR; } else { } } else { } put_net_conf(odev); if ((unsigned int )retcode != 101U) { goto fail; } else { } } else { } ldv_47138: i = i + 1; ldv_47140: ; if ((unsigned int )i < minor_count) { goto ldv_47139; } else { } 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 = 0; retcode = ERR_AUTH_ALG; goto fail; } else { } tmp___6 = crypto_hash_tfm(tfm); tmp___7 = drbd_crypto_is_hash(tmp___6); if (tmp___7 == 0) { retcode = ERR_AUTH_ALG_ND; 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 = 0; retcode = ERR_INTEGRITY_ALG; goto fail; } else { } tmp___9 = crypto_hash_tfm(integrity_w_tfm); tmp___10 = drbd_crypto_is_hash(tmp___9); if (tmp___10 == 0) { retcode = ERR_INTEGRITY_ALG_ND; 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 = 0; retcode = ERR_INTEGRITY_ALG; goto fail; } else { } } else { } ns = new_conf->max_epoch_size / 8; if (mdev->tl_hash_s != (unsigned int )ns) { tmp___12 = kzalloc___3((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 = ERR_NOMEM; goto fail; } else { } } else { } ns = new_conf->max_buffers / 8; if ((unsigned int )*((unsigned char *)new_conf + 528UL) != 0U && mdev->ee_hash_s != (unsigned int )ns) { tmp___13 = kzalloc___3((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 = ERR_NOMEM; goto fail; } else { } } else { } *((char *)(& new_conf->shared_secret) + 63UL) = 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___5((size_t )i, 208U); if ((unsigned long )int_dig_out == (unsigned long )((void *)0)) { retcode = ERR_NOMEM; goto fail; } else { } int_dig_in = kmalloc___5((size_t )i, 208U); if ((unsigned long )int_dig_in == (unsigned long )((void *)0)) { retcode = ERR_NOMEM; goto fail; } else { } int_dig_vv = kmalloc___5((size_t )i, 208U); if ((unsigned long )int_dig_vv == (unsigned long )((void *)0)) { retcode = ERR_NOMEM; 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 = ERR_NOMEM; 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 = ERR_NET_CONFIGURED; 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_35533.conn = 2U; tmp___16 = _drbd_set_state(mdev, __ns, CS_VERBOSE, 0); retcode = (enum drbd_ret_codes )tmp___16; spin_unlock_irq(& mdev->req_lock); kobject_uevent(& (mdev->vdisk)->part0.__dev.kobj, KOBJ_CHANGE); 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 ; union drbd_state val ; union drbd_state mask ; union drbd_state val___0 ; union drbd_state mask___0 ; union drbd_state val___1 ; union drbd_state mask___1 ; union drbd_state val___2 ; union drbd_state mask___2 ; int __ret ; wait_queue_t __wait ; struct task_struct *tmp ; struct task_struct *tmp___0 ; int tmp___1 ; { val.i = 0U; val.ldv_35533.conn = 1U; mask.i = 0U; mask.ldv_35533.conn = 31U; retcode = _drbd_request_state(mdev, mask, val, CS_ORDERED); if (retcode == 2) { goto done; } else if (retcode == -9) { goto done; } else if (retcode == -7) { val___0.i = 0U; val___0.ldv_35533.conn = 1U; val___0.ldv_35533.pdsk = 5U; mask___0.i = 0U; mask___0.ldv_35533.conn = 31U; mask___0.ldv_35533.pdsk = 15U; retcode = drbd_request_state(mdev, mask___0, val___0); } else if (retcode == -10) { val___1.i = 0U; val___1.ldv_35533.conn = 1U; val___1.ldv_35533.disk = 5U; mask___1.i = 0U; mask___1.ldv_35533.conn = 31U; mask___1.ldv_35533.disk = 15U; retcode = _drbd_request_state(mdev, mask___1, val___1, CS_ORDERED); if (retcode == -11 || retcode == -16) { val___2.i = 0U; val___2.ldv_35533.conn = 1U; mask___2.i = 0U; mask___2.ldv_35533.conn = 31U; 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 + 1006UL) == 16U) { 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_47172: prepare_to_wait(& mdev->state_wait, & __wait, 1); if ((unsigned int )*((unsigned short *)mdev + 1006UL) != 16U) { goto ldv_47170; } else { } tmp___0 = get_current(); tmp___1 = signal_pending(tmp___0); if (tmp___1 == 0) { schedule(); goto ldv_47171; } else { } __ret = -512; goto ldv_47170; ldv_47171: ; goto ldv_47172; ldv_47170: 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_35533.role != (int )mdev->state.ldv_35533.peer) { iass = (unsigned int )*((unsigned char *)mdev + 2012UL) == 1U; } else { iass = constant_test_bit(6U, (unsigned long const volatile *)(& mdev->flags)); } if (iass != 0) { drbd_start_resync(mdev, C_SYNC_SOURCE); } else { val.i = 0U; val.ldv_35533.conn = 15U; mask.i = 0U; mask.ldv_35533.conn = 31U; _drbd_request_state(mdev, mask, val, 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_35533.conn > 10) { retcode = 130; goto fail; } else { } if ((unsigned int )*((unsigned char *)mdev + 2012UL) == 2U && (unsigned int )*((unsigned char *)mdev + 2012UL) == 8U) { retcode = 131; goto fail; } else { } tmp___0 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___0 == 0) { retcode = 138; goto fail; } else { } if ((unsigned int )*((unsigned char *)(& rs) + 8UL) != 0U && mdev->agreed_pro_version <= 92) { retcode = 153; goto fail; } 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_determin_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 + 1006UL) == 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 ; long tmp___3 ; struct crypto_tfm *tmp___4 ; int tmp___5 ; int tmp___6 ; long tmp___7 ; struct crypto_tfm *tmp___8 ; int tmp___9 ; int _b ; int _b___0 ; void *tmp___10 ; int tmp___11 ; wait_queue_t __wait ; struct task_struct *tmp___12 ; int tmp___13 ; int tmp___14 ; bool tmp___15 ; int tmp___16 ; { retcode = 101; verify_tfm = 0; csums_tfm = 0; rs_plan_s = 0; tmp = zalloc_cpumask_var(& 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 = 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 { } rsr = (((unsigned int )*((unsigned short *)mdev + 1006UL) == 256U || (unsigned int )*((unsigned short *)mdev + 1006UL) == 272U) || (unsigned int )*((unsigned short *)mdev + 1006UL) == 320U) || (unsigned int )*((unsigned short *)mdev + 1006UL) == 336U; if (rsr != 0) { tmp___2 = strcmp((char const *)(& sc.csums_alg), (char const *)(& mdev->sync_conf.csums_alg)); if (tmp___2 != 0) { retcode = 148; goto fail; } else { } } else { } if (rsr == 0 && (unsigned int )sc.csums_alg[0] != 0U) { csums_tfm = crypto_alloc_hash((char const *)(& sc.csums_alg), 0U, 128U); tmp___3 = IS_ERR((void const *)csums_tfm); if (tmp___3 != 0L) { csums_tfm = 0; retcode = 144; goto fail; } else { } tmp___4 = crypto_hash_tfm(csums_tfm); tmp___5 = drbd_crypto_is_hash(tmp___4); if (tmp___5 == 0) { retcode = 145; goto fail; } else { } } else { } ovr = (unsigned int )*((unsigned short *)mdev + 1006UL) == 288U || (unsigned int )*((unsigned short *)mdev + 1006UL) == 304U; if (ovr != 0) { tmp___6 = strcmp((char const *)(& sc.verify_alg), (char const *)(& mdev->sync_conf.verify_alg)); if (tmp___6 != 0) { retcode = 149; goto fail; } else { } } else { } if (ovr == 0 && (unsigned int )sc.verify_alg[0] != 0U) { verify_tfm = crypto_alloc_hash((char const *)(& sc.verify_alg), 0U, 128U); tmp___7 = IS_ERR((void const *)verify_tfm); if (tmp___7 != 0L) { verify_tfm = 0; retcode = 146; goto fail; } else { } tmp___8 = crypto_hash_tfm(verify_tfm); tmp___9 = drbd_crypto_is_hash(tmp___8); if (tmp___9 == 0) { retcode = 147; goto fail; } else { } } else { } if (nr_cpu_ids > 1 && (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 { } _b = sc.rate <= 0; if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: (%s) in %s:%d\n", "drbd_nl_syncer_conf", (char *)"sc.rate < 1", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_nl.c.prepared", 1816); } 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), "%s: (%s) in %s:%d\n", "drbd_nl_syncer_conf", (char *)"sc.al_extents < 7", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/19/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_nl.c.prepared", 1817); } 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 && fifo_size > 0) { tmp___10 = kzalloc___3((unsigned long )fifo_size * 4UL, 208U); rs_plan_s = (int *)tmp___10; 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 { } 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 = 0; } else { } if (ovr == 0) { crypto_free_hash(mdev->verify_tfm); mdev->verify_tfm = verify_tfm; verify_tfm = 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 = 0; } else { } spin_unlock(& mdev->peer_seq_lock); tmp___14 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___14 != 0) { tmp___11 = lc_try_lock(mdev->act_log); if (tmp___11 != 0) { goto ldv_47216; } else { } tmp___12 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___12; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_47219: prepare_to_wait(& mdev->al_wait, & __wait, 2); tmp___13 = lc_try_lock(mdev->act_log); if (tmp___13 != 0) { goto ldv_47218; } else { } schedule(); goto ldv_47219; ldv_47218: finish_wait(& mdev->al_wait, & __wait); ldv_47216: drbd_al_shrink(mdev); err = drbd_check_al_size(mdev); lc_unlock(mdev->act_log); __wake_up(& mdev->al_wait, 3U, 1, 0); put_ldev(mdev); drbd_md_sync(mdev); if (err != 0) { retcode = 122; goto fail; } else { } } else { } if ((int )mdev->state.ldv_35533.conn > 9) { drbd_send_sync_param(mdev, & sc); } else { } tmp___15 = cpumask_equal((struct cpumask const *)mdev->cpu_mask, (struct cpumask const *)new_cpu_mask); if (tmp___15) { tmp___16 = 0; } else { tmp___16 = 1; } if (tmp___16) { 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, KOBJ_CHANGE); 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 ; union drbd_state val ; union drbd_state mask ; union drbd_state val___0 ; union drbd_state mask___0 ; union drbd_state __ns ; union drbd_state val___1 ; union drbd_state mask___1 ; { val.i = 0U; val.ldv_35533.conn = 12U; mask.i = 0U; mask.ldv_35533.conn = 31U; retcode = _drbd_request_state(mdev, mask, val, CS_ORDERED); if (retcode <= 0 && retcode != -15) { val___0.i = 0U; val___0.ldv_35533.conn = 12U; mask___0.i = 0U; mask___0.ldv_35533.conn = 31U; retcode = drbd_request_state(mdev, mask___0, val___0); } else { } goto ldv_47242; ldv_47241: spin_lock_irq(& mdev->req_lock); if ((int )mdev->state.ldv_35533.conn <= 9) { __ns.i = mdev->state.i; __ns.ldv_35533.disk = 4U; retcode = _drbd_set_state(mdev, __ns, CS_VERBOSE, 0); } else { } spin_unlock_irq(& mdev->req_lock); if (retcode != -15) { goto ldv_47236; } else { } val___1.i = 0U; val___1.ldv_35533.conn = 12U; mask___1.i = 0U; mask___1.ldv_35533.conn = 31U; retcode = drbd_request_state(mdev, mask___1, val___1); ldv_47242: ; if (retcode == -15) { goto ldv_47241; } else { } ldv_47236: 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 ; union drbd_state val ; union drbd_state mask ; union drbd_state val___0 ; union drbd_state mask___0 ; int tmp ; union drbd_state val___1 ; union drbd_state mask___1 ; { val.i = 0U; val.ldv_35533.conn = 11U; mask.i = 0U; mask.ldv_35533.conn = 31U; retcode = _drbd_request_state(mdev, mask, val, CS_ORDERED); if (retcode <= 0) { if (retcode == -15 && (unsigned int )*((unsigned char *)mdev + 2012UL) == 1U) { val___0.i = 0U; val___0.ldv_35533.pdsk = 4U; mask___0.i = 0U; mask___0.ldv_35533.pdsk = 15U; retcode = drbd_request_state(mdev, mask___0, val___0); if (retcode > 0) { tmp = drbd_bitmap_io(mdev, & drbd_bmio_set_susp_al, (char *)"set_n_write from invalidate_peer"); if (tmp != 0) { retcode = 118; } else { } } else { } } else { val___1.i = 0U; val___1.ldv_35533.conn = 11U; mask___1.i = 0U; mask___1.ldv_35533.conn = 31U; 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_35533.user_isp = 1U; mask.i = 0U; mask.ldv_35533.user_isp = 1U; 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 val ; union drbd_state mask ; int tmp ; { retcode = 101; val.i = 0U; val.ldv_35533.user_isp = 0U; mask.i = 0U; mask.ldv_35533.user_isp = 1U; tmp = drbd_request_state(mdev, mask, val); if (tmp == 2) { 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_35533.susp = 1U; mask.i = 0U; mask.ldv_35533.susp = 1U; 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)); drbd_md_sync(mdev); } else { } drbd_suspend_io(mdev); val.i = 0U; val.ldv_35533.susp = 0U; val.ldv_35533.susp_nod = 0U; val.ldv_35533.susp_fen = 0U; mask.i = 0U; mask.ldv_35533.susp = 1U; mask.ldv_35533.susp_nod = 1U; mask.ldv_35533.susp_fen = 1U; reply->ret_code = drbd_request_state(mdev, mask, val); if (reply->ret_code == 1) { if ((int )mdev->state.ldv_35533.conn <= 9) { tl_clear(mdev); } else { } if ((unsigned int )*((unsigned char *)mdev + 2013UL) == 0U || (unsigned int )*((unsigned char *)mdev + 2013UL) == 4U) { tl_restart(mdev, fail_frozen_disk_io); } 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_35533.disk = 5U; mask.i = 0U; mask.ldv_35533.disk = 15U; 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, D_INCONSISTENT); 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; switch (2UL) { case 1UL: *((u8 *)__gu_p) = 0U; goto ldv_47320; case 2UL: put_unaligned_le16(0, __gu_p); goto ldv_47320; case 4UL: put_unaligned_le32(0U, __gu_p); goto ldv_47320; case 8UL: put_unaligned_le64(0ULL, __gu_p); goto ldv_47320; default: __bad_unaligned_access_size(); goto ldv_47320; } ldv_47320: ; 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_35533.conn > 15 && (int )s.ldv_35533.conn <= 21) { tmp = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp != 0) { drbd_get_syncer_progress(mdev, & rs_left, & res); tl = tl_add_int(tl, T_sync_progress, (void const *)(& res)); put_ldev(mdev); } else { } } else { } tmp___0 = tl; tl = tl + 1; __gu_p = (void *)tmp___0; switch (2UL) { case 1UL: *((u8 *)__gu_p) = 0U; goto ldv_47336; case 2UL: put_unaligned_le16(0, __gu_p); goto ldv_47336; case 4UL: put_unaligned_le32(0U, __gu_p); goto ldv_47336; case 8UL: put_unaligned_le64(0ULL, __gu_p); goto ldv_47336; default: __bad_unaligned_access_size(); goto ldv_47336; } ldv_47336: ; 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, D_INCONSISTENT); if (tmp != 0) { tl = tl_add_blob(tl, T_uuids, (void const *)(& (mdev->ldev)->md.uuid), 32); tl = tl_add_int(tl, T_uuids_flags, (void const *)(& (mdev->ldev)->md.flags)); put_ldev(mdev); } else { } tmp___0 = tl; tl = tl + 1; __gu_p = (void *)tmp___0; switch (2UL) { case 1UL: *((u8 *)__gu_p) = 0U; goto ldv_47349; case 2UL: put_unaligned_le16(0, __gu_p); goto ldv_47349; case 4UL: put_unaligned_le32(0U, __gu_p); goto ldv_47349; case 8UL: put_unaligned_le64(0ULL, __gu_p); goto ldv_47349; default: __bad_unaligned_access_size(); goto ldv_47349; } ldv_47349: ; 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 + 503UL) != 40960U) { tmp = constant_test_bit(7U, (unsigned long const volatile *)(& mdev->flags)); rv = tmp != 0; } else { rv = 2; } tl = tl_add_blob(tl, T_use_degraded, (void const *)(& rv), 1); tmp___0 = tl; tl = tl + 1; __gu_p = (void *)tmp___0; switch (2UL) { case 1UL: *((u8 *)__gu_p) = 0U; goto ldv_47363; case 2UL: put_unaligned_le16(0, __gu_p); goto ldv_47363; case 4UL: put_unaligned_le32(0U, __gu_p); goto ldv_47363; case 8UL: put_unaligned_le64(0ULL, __gu_p); goto ldv_47363; default: __bad_unaligned_access_size(); goto ldv_47363; } ldv_47363: ; 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 ; 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 { } mdev->ov_start_sector = (sector_t )args.start_sector & 0xfffffffffffffff7UL; val.i = 0U; val.ldv_35533.conn = 18U; mask.i = 0U; mask.ldv_35533.conn = 31U; 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 { } ldv_mutex_lock_195(& mdev->state_mutex); tmp___0 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___0 == 0) { retcode = 138; goto out; } else { } if ((((unsigned int )*((unsigned short *)mdev + 1006UL) == 160U && mdev->agreed_pro_version > 89) && (mdev->ldev)->md.uuid[0] == 4ULL) && (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 if ((unsigned int )*((unsigned short *)mdev + 1006UL) != 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"); 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); spin_lock_irq(& mdev->req_lock); __ns.i = mdev->state.i; __ns.ldv_35533.disk = 8U; __ns.ldv_35533.pdsk = 8U; _drbd_set_state(mdev, __ns, CS_VERBOSE, 0); spin_unlock_irq(& mdev->req_lock); } else { } } else { } drbd_md_sync(mdev); out_dec: put_ldev(mdev); out: ldv_mutex_unlock_196(& mdev->state_mutex); reply->ret_code = retcode; return (0); } } static struct cn_handler_struct cnd_table[27U] = { {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, 1288}, {& drbd_nl_get_state, 16}, {& drbd_nl_get_uuids, 48}, {& drbd_nl_get_timeout_flag, 8}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {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 ; void *tmp___0 ; { nlp = (struct drbd_nl_cfg_req *)(& req->data); reply_size = 34; tmp = try_module_get___0(& __this_module); if (tmp == 0) { printk("<3>drbd: try_module_get() failed!\n"); return; } else { } if ((nsp->eff_cap.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 > 26) { 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___0 = kmalloc___5((size_t )reply_size, 208U); cn_reply = (struct cn_msg *)tmp___0; 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); reply->packet_type = cm->reply_body_size != 0 ? nlp->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 = (unsigned int )((__u16 )rr) + 12U; cn_reply->flags = 0U; rr = cn_netlink_send(cn_reply, 8U, 208U); if (rr != 0 && rr != -3) { printk("<6>drbd: cn_netlink_send()=%d\n", rr); } else { } kfree((void const *)cn_reply); module_put(& __this_module); return; fail: drbd_nl_send_reply(req, retcode); module_put(& __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; len = (int )len < (int )l ? len : l; tmp = tl; tl = tl + 1; __gu_p = (void *)tmp; switch (2UL) { case 1UL: *((u8 *)__gu_p) = (unsigned char )tag; goto ldv_47422; case 2UL: put_unaligned_le16((int )((unsigned short )tag), __gu_p); goto ldv_47422; case 4UL: put_unaligned_le32((unsigned int )tag, __gu_p); goto ldv_47422; case 8UL: put_unaligned_le64((unsigned long long )tag, __gu_p); goto ldv_47422; default: __bad_unaligned_access_size(); goto ldv_47422; } ldv_47422: tmp___0 = tl; tl = tl + 1; __gu_p___0 = (void *)tmp___0; switch (2UL) { case 1UL: *((u8 *)__gu_p___0) = (unsigned char )len; goto ldv_47429; case 2UL: put_unaligned_le16((int )len, __gu_p___0); goto ldv_47429; case 4UL: put_unaligned_le32((unsigned int )len, __gu_p___0); goto ldv_47429; case 8UL: put_unaligned_le64((unsigned long long )len, __gu_p___0); goto ldv_47429; default: __bad_unaligned_access_size(); goto ldv_47429; } ldv_47429: __len = (size_t )len; __ret = memcpy((void *)tl, data, __len); tl = tl + (unsigned long )len; if (nul_terminated != 0) { *((char *)tl + 0xffffffffffffffffUL) = 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, (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, (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; switch (2UL) { case 1UL: *((u8 *)__gu_p) = (unsigned char )tag; goto ldv_47455; case 2UL: put_unaligned_le16((int )((unsigned short )tag), __gu_p); goto ldv_47455; case 4UL: put_unaligned_le32((unsigned int )tag, __gu_p); goto ldv_47455; case 8UL: put_unaligned_le64((unsigned long long )tag, __gu_p); goto ldv_47455; default: __bad_unaligned_access_size(); goto ldv_47455; } ldv_47455: ; switch ((unsigned int )tag & 49152U) { case 0U: tmp___0 = tl; tl = tl + 1; __gu_p___0 = (void *)tmp___0; switch (2UL) { case 1UL: *((u8 *)__gu_p___0) = 4U; goto ldv_47463; case 2UL: put_unaligned_le16(4, __gu_p___0); goto ldv_47463; case 4UL: put_unaligned_le32(4U, __gu_p___0); goto ldv_47463; case 8UL: put_unaligned_le64(4ULL, __gu_p___0); goto ldv_47463; default: __bad_unaligned_access_size(); goto ldv_47463; } ldv_47463: __gu_p___1 = (void *)tl; switch (4UL) { case 1UL: *((u8 *)__gu_p___1) = (unsigned char )*((int *)val); goto ldv_47470; case 2UL: put_unaligned_le16((int )((unsigned short )*((int *)val)), __gu_p___1); goto ldv_47470; case 4UL: put_unaligned_le32((unsigned int )*((int *)val), __gu_p___1); goto ldv_47470; case 8UL: put_unaligned_le64((unsigned long long )*((int *)val), __gu_p___1); goto ldv_47470; default: __bad_unaligned_access_size(); goto ldv_47470; } ldv_47470: tl = tl + 4U; goto ldv_47475; case 16384U: tmp___1 = tl; tl = tl + 1; __gu_p___2 = (void *)tmp___1; switch (2UL) { case 1UL: *((u8 *)__gu_p___2) = 8U; goto ldv_47479; case 2UL: put_unaligned_le16(8, __gu_p___2); goto ldv_47479; case 4UL: put_unaligned_le32(8U, __gu_p___2); goto ldv_47479; case 8UL: put_unaligned_le64(8ULL, __gu_p___2); goto ldv_47479; default: __bad_unaligned_access_size(); goto ldv_47479; } ldv_47479: __gu_p___3 = (void *)tl; switch (8UL) { case 1UL: *((u8 *)__gu_p___3) = (unsigned char )*((u64 *)val); goto ldv_47486; case 2UL: put_unaligned_le16((int )((unsigned short )*((u64 *)val)), __gu_p___3); goto ldv_47486; case 4UL: put_unaligned_le32((unsigned int )*((u64 *)val), __gu_p___3); goto ldv_47486; case 8UL: put_unaligned_le64(*((u64 *)val), __gu_p___3); goto ldv_47486; default: __bad_unaligned_access_size(); goto ldv_47486; } ldv_47486: tl = tl + 8U; goto ldv_47475; default: ; } ldv_47475: ; 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; switch (2UL) { case 1UL: *((u8 *)__gu_p) = 0U; goto ldv_47502; case 2UL: put_unaligned_le16(0, __gu_p); goto ldv_47502; case 4UL: put_unaligned_le32(0U, __gu_p); goto ldv_47502; case 8UL: put_unaligned_le64(0ULL, __gu_p); goto ldv_47502; default: __bad_unaligned_access_size(); goto ldv_47502; } ldv_47502: 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 = (unsigned int )((int )((__u16 )((long )tl)) - (int )((__u16 )((long )(& reply->tag_list)))) + 12U; cn_reply->flags = 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, T_helper, (char const *)helper_name); tmp = tl; tl = tl + 1; __gu_p = (void *)tmp; switch (2UL) { case 1UL: *((u8 *)__gu_p) = 0U; goto ldv_47517; case 2UL: put_unaligned_le16(0, __gu_p); goto ldv_47517; case 4UL: put_unaligned_le32(0U, __gu_p); goto ldv_47517; case 8UL: put_unaligned_le64(0ULL, __gu_p); goto ldv_47517; default: __bad_unaligned_access_size(); goto ldv_47517; } ldv_47517: 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 = (unsigned int )((int )((__u16 )((long )tl)) - (int )((__u16 )((long )(& reply->tag_list)))) + 12U; cn_reply->flags = 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 ; void *__gu_p ; unsigned short *tmp___0 ; void *__gu_p___0 ; unsigned short *tmp___1 ; void *d ; void *tmp___2 ; unsigned int l ; unsigned int __min1 ; unsigned int __min2 ; size_t __len ; void *__ret ; struct page *tmp___3 ; void *__gu_p___1 ; unsigned short *tmp___4 ; int tmp___5 ; { if ((unsigned long )e == (unsigned long )((struct drbd_epoch_entry const *)0)) { return; } else { } if ((unsigned long )reason == (unsigned long )((char const *)0) || (int )((signed char )*reason) == 0) { return; } else { } tmp = kmalloc___5(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, T_dump_ee_reason, reason); tl = tl_add_blob(tl, T_seen_digest, (void const *)seen_hash, dgs); tl = tl_add_blob(tl, T_calc_digest, (void const *)calc_hash, dgs); tl = tl_add_int(tl, T_ee_sector, (void const *)(& e->sector)); tl = tl_add_int(tl, T_ee_block_id, (void const *)(& e->ldv_42995.block_id)); tmp___0 = tl; tl = tl + 1; __gu_p = (void *)tmp___0; switch (2UL) { case 1UL: *((u8 *)__gu_p) = 50U; goto ldv_47537; case 2UL: put_unaligned_le16(49202, __gu_p); goto ldv_47537; case 4UL: put_unaligned_le32(49202U, __gu_p); goto ldv_47537; case 8UL: put_unaligned_le64(49202ULL, __gu_p); goto ldv_47537; default: __bad_unaligned_access_size(); goto ldv_47537; } ldv_47537: tmp___1 = tl; tl = tl + 1; __gu_p___0 = (void *)tmp___1; switch (2UL) { case 1UL: *((u8 *)__gu_p___0) = (unsigned char )e->size; goto ldv_47544; case 2UL: put_unaligned_le16((int )((unsigned short )e->size), __gu_p___0); goto ldv_47544; case 4UL: put_unaligned_le32(e->size, __gu_p___0); goto ldv_47544; case 8UL: put_unaligned_le64((unsigned long long )e->size, __gu_p___0); goto ldv_47544; default: __bad_unaligned_access_size(); goto ldv_47544; } ldv_47544: len = e->size; page = e->pages; goto ldv_47559; ldv_47558: tmp___2 = kmap_atomic___0(page, KM_USER0); d = tmp___2; __min1 = len; __min2 = 4096U; l = __min1 < __min2 ? __min1 : __min2; __len = (size_t )l; __ret = memcpy((void *)tl, (void const *)d, __len); kunmap_atomic_notypecheck___0(d, KM_USER0); tl = tl + (unsigned long )l; len = len - l; page = page_chain_next(page); ldv_47559: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { tmp___3 = page_chain_next(page); __builtin_prefetch((void const *)tmp___3); if (1 != 0) { goto ldv_47558; } else { goto ldv_47560; } } else { } ldv_47560: tmp___4 = tl; tl = tl + 1; __gu_p___1 = (void *)tmp___4; switch (2UL) { case 1UL: *((u8 *)__gu_p___1) = 0U; goto ldv_47563; case 2UL: put_unaligned_le16(0, __gu_p___1); goto ldv_47563; case 4UL: put_unaligned_le32(0U, __gu_p___1); goto ldv_47563; case 8UL: put_unaligned_le64(0ULL, __gu_p___1); goto ldv_47563; default: __bad_unaligned_access_size(); goto ldv_47563; } ldv_47563: cn_reply->id.idx = 8U; cn_reply->id.val = 1U; tmp___5 = atomic_add_return(1, & drbd_nl_seq); cn_reply->seq = (__u32 )tmp___5; cn_reply->ack = 0U; cn_reply->len = (unsigned int )((int )((__u16 )((long )tl)) - (int )((__u16 )((long )(& reply->tag_list)))) + 12U; cn_reply->flags = 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, D_INCONSISTENT); if (tmp == 0) { return; } else { } drbd_get_syncer_progress(mdev, & rs_left, & res); put_ldev(mdev); tl = tl_add_int(tl, T_sync_progress, (void const *)(& res)); tmp___0 = tl; tl = tl + 1; __gu_p = (void *)tmp___0; switch (2UL) { case 1UL: *((u8 *)__gu_p) = 0U; goto ldv_47579; case 2UL: put_unaligned_le16(0, __gu_p); goto ldv_47579; case 4UL: put_unaligned_le32(0U, __gu_p); goto ldv_47579; case 8UL: put_unaligned_le64(0ULL, __gu_p); goto ldv_47579; default: __bad_unaligned_access_size(); goto ldv_47579; } ldv_47579: 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 = (unsigned int )((int )((__u16 )((long )tl)) - (int )((__u16 )((long )(& reply->tag_list)))) + 12U; cn_reply->flags = 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_47591: cn_id_drbd.idx = cn_idx; err = cn_add_callback(& cn_id_drbd, (char *)"cn_drbd", & drbd_connector_callback); if (err == 0) { goto ldv_47590; } else { } cn_idx = cn_idx + 6977U; tmp = try; try = try - 1; if (tmp != 0) { goto ldv_47591; } else { } ldv_47590: ; 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); cn_reply->id = req->id; cn_reply->seq = req->seq; cn_reply->ack = req->ack + 1U; cn_reply->len = 12U; cn_reply->flags = 0U; 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 && rr != -3) { printk("<6>drbd: cn_netlink_send()=%d\n", rr); } else { } return; } } void ldv_mutex_lock_187(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_188(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_189(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_190(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_191(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_192(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_193(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_state_mutex_of_drbd_conf(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_194(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_state_mutex_of_drbd_conf(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_195(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_state_mutex_of_drbd_conf(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_196(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_state_mutex_of_drbd_conf(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static void ldv_error(void) { { LDV_ERROR: {reach_error();abort();} } } extern int ldv_undef_int(void) ; long ldv__builtin_expect(long exp , long c ) { { return (exp); } } static int ldv_mutex_bm_change_of_drbd_bitmap ; int ldv_mutex_lock_interruptible_bm_change_of_drbd_bitmap(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_bm_change_of_drbd_bitmap == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex_bm_change_of_drbd_bitmap = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_bm_change_of_drbd_bitmap(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_bm_change_of_drbd_bitmap == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex_bm_change_of_drbd_bitmap = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_bm_change_of_drbd_bitmap(struct mutex *lock ) { { if (ldv_mutex_bm_change_of_drbd_bitmap == 1) { } else { ldv_error(); } ldv_mutex_bm_change_of_drbd_bitmap = 2; return; } } int ldv_mutex_trylock_bm_change_of_drbd_bitmap(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_bm_change_of_drbd_bitmap == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = ldv_undef_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_bm_change_of_drbd_bitmap = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_bm_change_of_drbd_bitmap(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_bm_change_of_drbd_bitmap == 1) { } else { ldv_error(); } atomic_value_after_dec = ldv_undef_int(); if (atomic_value_after_dec == 0) { ldv_mutex_bm_change_of_drbd_bitmap = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_bm_change_of_drbd_bitmap(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_bm_change_of_drbd_bitmap == 1) { nondetermined = ldv_undef_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_bm_change_of_drbd_bitmap(struct mutex *lock ) { { if (ldv_mutex_bm_change_of_drbd_bitmap == 2) { } else { ldv_error(); } ldv_mutex_bm_change_of_drbd_bitmap = 1; return; } } static int ldv_mutex_drbd_main_mutex ; int ldv_mutex_lock_interruptible_drbd_main_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_drbd_main_mutex == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex_drbd_main_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_drbd_main_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_drbd_main_mutex == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex_drbd_main_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_drbd_main_mutex(struct mutex *lock ) { { if (ldv_mutex_drbd_main_mutex == 1) { } else { ldv_error(); } ldv_mutex_drbd_main_mutex = 2; return; } } int ldv_mutex_trylock_drbd_main_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_drbd_main_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = ldv_undef_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_drbd_main_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_drbd_main_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_drbd_main_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = ldv_undef_int(); if (atomic_value_after_dec == 0) { ldv_mutex_drbd_main_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_drbd_main_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_drbd_main_mutex == 1) { nondetermined = ldv_undef_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_drbd_main_mutex(struct mutex *lock ) { { if (ldv_mutex_drbd_main_mutex == 2) { } else { ldv_error(); } ldv_mutex_drbd_main_mutex = 1; return; } } static int ldv_mutex_md_io_mutex_of_drbd_conf ; int ldv_mutex_lock_interruptible_md_io_mutex_of_drbd_conf(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_md_io_mutex_of_drbd_conf == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex_md_io_mutex_of_drbd_conf = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_md_io_mutex_of_drbd_conf(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_md_io_mutex_of_drbd_conf == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex_md_io_mutex_of_drbd_conf = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_md_io_mutex_of_drbd_conf(struct mutex *lock ) { { if (ldv_mutex_md_io_mutex_of_drbd_conf == 1) { } else { ldv_error(); } ldv_mutex_md_io_mutex_of_drbd_conf = 2; return; } } int ldv_mutex_trylock_md_io_mutex_of_drbd_conf(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_md_io_mutex_of_drbd_conf == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = ldv_undef_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_md_io_mutex_of_drbd_conf = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_md_io_mutex_of_drbd_conf(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_md_io_mutex_of_drbd_conf == 1) { } else { ldv_error(); } atomic_value_after_dec = ldv_undef_int(); if (atomic_value_after_dec == 0) { ldv_mutex_md_io_mutex_of_drbd_conf = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_md_io_mutex_of_drbd_conf(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_md_io_mutex_of_drbd_conf == 1) { nondetermined = ldv_undef_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_md_io_mutex_of_drbd_conf(struct mutex *lock ) { { if (ldv_mutex_md_io_mutex_of_drbd_conf == 2) { } else { ldv_error(); } ldv_mutex_md_io_mutex_of_drbd_conf = 1; return; } } static int ldv_mutex_mutex_of_device ; int ldv_mutex_lock_interruptible_mutex_of_device(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mutex_of_device == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex_mutex_of_device = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_mutex_of_device(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mutex_of_device == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex_mutex_of_device = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_mutex_of_device(struct mutex *lock ) { { if (ldv_mutex_mutex_of_device == 1) { } else { ldv_error(); } ldv_mutex_mutex_of_device = 2; return; } } int ldv_mutex_trylock_mutex_of_device(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_mutex_of_device == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = ldv_undef_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_mutex_of_device = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_mutex_of_device(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_mutex_of_device == 1) { } else { ldv_error(); } atomic_value_after_dec = ldv_undef_int(); if (atomic_value_after_dec == 0) { ldv_mutex_mutex_of_device = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_mutex_of_device(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mutex_of_device == 1) { nondetermined = ldv_undef_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_mutex_of_device(struct mutex *lock ) { { if (ldv_mutex_mutex_of_device == 2) { } else { ldv_error(); } ldv_mutex_mutex_of_device = 1; return; } } static int ldv_mutex_mutex_of_drbd_socket ; int ldv_mutex_lock_interruptible_mutex_of_drbd_socket(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mutex_of_drbd_socket == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex_mutex_of_drbd_socket = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_mutex_of_drbd_socket(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mutex_of_drbd_socket == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex_mutex_of_drbd_socket = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_mutex_of_drbd_socket(struct mutex *lock ) { { if (ldv_mutex_mutex_of_drbd_socket == 1) { } else { ldv_error(); } ldv_mutex_mutex_of_drbd_socket = 2; return; } } int ldv_mutex_trylock_mutex_of_drbd_socket(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_mutex_of_drbd_socket == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = ldv_undef_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_mutex_of_drbd_socket = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_mutex_of_drbd_socket(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_mutex_of_drbd_socket == 1) { } else { ldv_error(); } atomic_value_after_dec = ldv_undef_int(); if (atomic_value_after_dec == 0) { ldv_mutex_mutex_of_drbd_socket = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_mutex_of_drbd_socket(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mutex_of_drbd_socket == 1) { nondetermined = ldv_undef_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_mutex_of_drbd_socket(struct mutex *lock ) { { if (ldv_mutex_mutex_of_drbd_socket == 2) { } else { ldv_error(); } ldv_mutex_mutex_of_drbd_socket = 1; return; } } static int ldv_mutex_state_mutex_of_drbd_conf ; int ldv_mutex_lock_interruptible_state_mutex_of_drbd_conf(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_state_mutex_of_drbd_conf == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex_state_mutex_of_drbd_conf = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_state_mutex_of_drbd_conf(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_state_mutex_of_drbd_conf == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex_state_mutex_of_drbd_conf = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_state_mutex_of_drbd_conf(struct mutex *lock ) { { if (ldv_mutex_state_mutex_of_drbd_conf == 1) { } else { ldv_error(); } ldv_mutex_state_mutex_of_drbd_conf = 2; return; } } int ldv_mutex_trylock_state_mutex_of_drbd_conf(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_state_mutex_of_drbd_conf == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = ldv_undef_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_state_mutex_of_drbd_conf = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_state_mutex_of_drbd_conf(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_state_mutex_of_drbd_conf == 1) { } else { ldv_error(); } atomic_value_after_dec = ldv_undef_int(); if (atomic_value_after_dec == 0) { ldv_mutex_state_mutex_of_drbd_conf = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_state_mutex_of_drbd_conf(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_state_mutex_of_drbd_conf == 1) { nondetermined = ldv_undef_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_state_mutex_of_drbd_conf(struct mutex *lock ) { { if (ldv_mutex_state_mutex_of_drbd_conf == 2) { } else { ldv_error(); } ldv_mutex_state_mutex_of_drbd_conf = 1; return; } } void ldv_initialize(void) { { ldv_mutex_bm_change_of_drbd_bitmap = 1; ldv_mutex_drbd_main_mutex = 1; ldv_mutex_md_io_mutex_of_drbd_conf = 1; ldv_mutex_mutex_of_device = 1; ldv_mutex_mutex_of_drbd_socket = 1; ldv_mutex_state_mutex_of_drbd_conf = 1; return; } } void ldv_check_final_state(void) { { if (ldv_mutex_bm_change_of_drbd_bitmap == 1) { } else { ldv_error(); } if (ldv_mutex_drbd_main_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_md_io_mutex_of_drbd_conf == 1) { } else { ldv_error(); } if (ldv_mutex_mutex_of_device == 1) { } else { ldv_error(); } if (ldv_mutex_mutex_of_drbd_socket == 1) { } else { ldv_error(); } if (ldv_mutex_state_mutex_of_drbd_conf == 1) { } else { ldv_error(); } return; } }