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_410.a70f35a.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 signed char s8; 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 long __kernel_long_t; typedef unsigned long __kernel_ulong_t; typedef __kernel_ulong_t __kernel_nlink_t; typedef int __kernel_pid_t; typedef unsigned int __kernel_uid32_t; typedef unsigned int __kernel_gid32_t; typedef __kernel_ulong_t __kernel_size_t; typedef __kernel_long_t __kernel_ssize_t; typedef __kernel_long_t __kernel_off_t; typedef long long __kernel_loff_t; typedef __kernel_long_t __kernel_time_t; typedef __kernel_long_t __kernel_clock_t; typedef int __kernel_timer_t; typedef int __kernel_clockid_t; typedef __u32 __kernel_dev_t; typedef __kernel_dev_t dev_t; typedef unsigned short umode_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 __u8 uint8_t; typedef __u32 uint32_t; typedef __u64 uint64_t; typedef unsigned long sector_t; typedef unsigned long blkcnt_t; typedef u64 dma_addr_t; typedef __u16 __be16; typedef __u32 __be32; typedef __u32 __wsum; typedef unsigned int gfp_t; typedef unsigned int fmode_t; struct __anonstruct_atomic_t_6 { int counter ; }; typedef struct __anonstruct_atomic_t_6 atomic_t; struct __anonstruct_atomic64_t_7 { long counter ; }; typedef struct __anonstruct_atomic64_t_7 atomic64_t; struct list_head { struct list_head *next ; struct list_head *prev ; }; struct hlist_node; struct hlist_head { struct hlist_node *first ; }; struct hlist_node { struct hlist_node *next ; struct hlist_node **pprev ; }; struct rcu_head { struct rcu_head *next ; void (*func)(struct rcu_head * ) ; }; struct module; struct file_operations; struct _ddebug { char const *modname ; char const *function ; char const *filename ; char const *format ; unsigned int lineno : 18 ; unsigned char flags ; }; struct device; struct net_device; struct completion; struct pt_regs; struct pid; typedef u16 __ticket_t; typedef u32 __ticketpair_t; struct __raw_tickets { __ticket_t head ; __ticket_t tail ; }; union __anonunion_ldv_2009_8 { __ticketpair_t head_tail ; struct __raw_tickets tickets ; }; struct arch_spinlock { union __anonunion_ldv_2009_8 ldv_2009 ; }; typedef struct arch_spinlock arch_spinlock_t; struct __anonstruct_ldv_2016_10 { u32 read ; s32 write ; }; union __anonunion_arch_rwlock_t_9 { s64 lock ; struct __anonstruct_ldv_2016_10 ldv_2016 ; }; typedef union __anonunion_arch_rwlock_t_9 arch_rwlock_t; struct task_struct; struct lockdep_map; struct mm_struct; struct pt_regs { unsigned long r15 ; unsigned long r14 ; unsigned long r13 ; unsigned long r12 ; unsigned long bp ; unsigned long bx ; unsigned long r11 ; unsigned long r10 ; unsigned long r9 ; unsigned long r8 ; unsigned long ax ; unsigned long cx ; unsigned long dx ; unsigned long si ; unsigned long di ; unsigned long orig_ax ; unsigned long ip ; unsigned long cs ; unsigned long flags ; unsigned long sp ; unsigned long ss ; }; struct __anonstruct_ldv_2133_12 { unsigned int a ; unsigned int b ; }; struct __anonstruct_ldv_2148_13 { 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_2149_11 { struct __anonstruct_ldv_2133_12 ldv_2133 ; struct __anonstruct_ldv_2148_13 ldv_2148 ; }; struct desc_struct { union __anonunion_ldv_2149_11 ldv_2149 ; }; typedef unsigned long pgdval_t; typedef unsigned long pgprotval_t; struct pgprot { pgprotval_t pgprot ; }; typedef struct pgprot pgprot_t; struct __anonstruct_pgd_t_15 { pgdval_t pgd ; }; typedef struct __anonstruct_pgd_t_15 pgd_t; struct page; typedef struct page *pgtable_t; struct file; struct seq_file; struct thread_struct; struct cpumask; 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_2777_18 { struct pt_regs *regs ; struct kernel_vm86_regs *vm86 ; }; struct math_emu_info { long ___orig_eip ; union __anonunion_ldv_2777_18 ldv_2777 ; }; 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_5151_23 { u64 rip ; u64 rdp ; }; struct __anonstruct_ldv_5157_24 { u32 fip ; u32 fcs ; u32 foo ; u32 fos ; }; union __anonunion_ldv_5158_22 { struct __anonstruct_ldv_5151_23 ldv_5151 ; struct __anonstruct_ldv_5157_24 ldv_5157 ; }; union __anonunion_ldv_5167_25 { u32 padding1[12U] ; u32 sw_reserved[12U] ; }; struct i387_fxsave_struct { u16 cwd ; u16 swd ; u16 twd ; u16 fop ; union __anonunion_ldv_5158_22 ldv_5158 ; u32 mxcsr ; u32 mxcsr_mask ; u32 st_space[32U] ; u32 xmm_space[64U] ; u32 padding[12U] ; union __anonunion_ldv_5167_25 ldv_5167 ; }; 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 { unsigned int last_cpu ; unsigned int has_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_nr ; 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_27 { unsigned long seg ; }; typedef struct __anonstruct_mm_segment_t_27 mm_segment_t; 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_5989_29 { u8 __padding[24U] ; struct lockdep_map dep_map ; }; union __anonunion_ldv_5990_28 { struct raw_spinlock rlock ; struct __anonstruct_ldv_5989_29 ldv_5989 ; }; struct spinlock { union __anonunion_ldv_5990_28 ldv_5990 ; }; typedef struct spinlock spinlock_t; struct __anonstruct_rwlock_t_30 { arch_rwlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_rwlock_t_30 rwlock_t; struct mutex { atomic_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct task_struct *owner ; char const *name ; void *magic ; struct lockdep_map dep_map ; }; struct mutex_waiter { struct list_head list ; struct task_struct *task ; void *magic ; }; struct timespec; struct compat_timespec; struct __anonstruct_futex_32 { u32 *uaddr ; u32 val ; u32 flags ; u32 bitset ; u64 time ; u32 *uaddr2 ; }; struct __anonstruct_nanosleep_33 { clockid_t clockid ; struct timespec *rmtp ; struct compat_timespec *compat_rmtp ; u64 expires ; }; struct pollfd; struct __anonstruct_poll_34 { struct pollfd *ufds ; int nfds ; int has_timeout ; unsigned long tv_sec ; unsigned long tv_nsec ; }; union __anonunion_ldv_6225_31 { struct __anonstruct_futex_32 futex ; struct __anonstruct_nanosleep_33 nanosleep ; struct __anonstruct_poll_34 poll ; }; struct restart_block { long (*fn)(struct restart_block * ) ; union __anonunion_ldv_6225_31 ldv_6225 ; }; 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 ; unsigned char sig_on_uaccess_error : 1 ; unsigned char uaccess_err : 1 ; }; struct vm_area_struct; struct __anonstruct_seqlock_t_35 { unsigned int sequence ; spinlock_t lock ; }; typedef struct __anonstruct_seqlock_t_35 seqlock_t; struct seqcount { unsigned int sequence ; }; typedef struct seqcount seqcount_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 ; int start_pid ; void *start_site ; char start_comm[16U] ; 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 call_single_data { struct list_head list ; void (*func)(void * ) ; void *info ; u16 flags ; u16 priv ; }; 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 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_late)(struct device * ) ; int (*resume_early)(struct device * ) ; int (*freeze_late)(struct device * ) ; int (*thaw_early)(struct device * ) ; int (*poweroff_late)(struct device * ) ; int (*restore_early)(struct device * ) ; int (*suspend_noirq)(struct device * ) ; int (*resume_noirq)(struct device * ) ; int (*freeze_noirq)(struct device * ) ; int (*thaw_noirq)(struct device * ) ; int (*poweroff_noirq)(struct device * ) ; int (*restore_noirq)(struct device * ) ; int (*runtime_suspend)(struct device * ) ; int (*runtime_resume)(struct device * ) ; int (*runtime_idle)(struct device * ) ; }; enum rpm_status { RPM_ACTIVE = 0, RPM_RESUMING = 1, RPM_SUSPENDED = 2, RPM_SUSPENDING = 3 } ; enum rpm_request { RPM_REQ_NONE = 0, RPM_REQ_IDLE = 1, RPM_REQ_SUSPEND = 2, RPM_REQ_AUTOSUSPEND = 3, RPM_REQ_RESUME = 4 } ; struct wakeup_source; struct pm_subsys_data { spinlock_t lock ; unsigned int refcount ; }; struct dev_pm_qos_request; struct pm_qos_constraints; struct dev_pm_info { pm_message_t power_state ; unsigned char can_wakeup : 1 ; unsigned char async_suspend : 1 ; bool is_prepared ; bool is_suspended ; bool ignore_children ; spinlock_t lock ; struct list_head entry ; struct completion completion ; struct wakeup_source *wakeup ; bool wakeup_path ; 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 idle_notification : 1 ; unsigned char request_pending : 1 ; unsigned char deferred_resume : 1 ; unsigned char run_wake : 1 ; unsigned char runtime_auto : 1 ; unsigned char no_callbacks : 1 ; unsigned char irq_safe : 1 ; unsigned char use_autosuspend : 1 ; unsigned char timer_autosuspends : 1 ; enum rpm_request request ; enum rpm_status runtime_status ; int runtime_error ; int autosuspend_delay ; unsigned long last_busy ; unsigned long active_jiffies ; unsigned long suspended_jiffies ; unsigned long accounting_timestamp ; struct dev_pm_qos_request *pq_req ; struct pm_subsys_data *subsys_data ; struct pm_qos_constraints *constraints ; }; struct dev_pm_domain { struct dev_pm_ops ops ; }; struct __anonstruct_nodemask_t_100 { unsigned long bits[16U] ; }; typedef struct __anonstruct_nodemask_t_100 nodemask_t; struct __anonstruct_mm_context_t_101 { void *ldt ; int size ; unsigned short ia32_compat ; struct mutex lock ; void *vdso ; }; typedef struct __anonstruct_mm_context_t_101 mm_context_t; struct rw_semaphore; struct rw_semaphore { long count ; raw_spinlock_t wait_lock ; struct list_head wait_list ; struct lockdep_map dep_map ; }; struct notifier_block; struct notifier_block { int (*notifier_call)(struct notifier_block * , unsigned long , void * ) ; struct notifier_block *next ; int priority ; }; struct blocking_notifier_head { struct rw_semaphore rwsem ; struct notifier_block *head ; }; struct ctl_table; struct proc_dir_entry; struct timer_rand_state; 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 ; }; typedef unsigned short __kernel_sa_family_t; struct iovec { void *iov_base ; __kernel_size_t iov_len ; }; struct cred; typedef __kernel_sa_family_t 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_107 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; }; typedef struct __anonstruct_sync_serial_settings_107 sync_serial_settings; struct __anonstruct_te1_settings_108 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; unsigned int slot_map ; }; typedef struct __anonstruct_te1_settings_108 te1_settings; struct __anonstruct_raw_hdlc_proto_109 { unsigned short encoding ; unsigned short parity ; }; typedef struct __anonstruct_raw_hdlc_proto_109 raw_hdlc_proto; struct __anonstruct_fr_proto_110 { 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_110 fr_proto; struct __anonstruct_fr_proto_pvc_111 { unsigned int dlci ; }; typedef struct __anonstruct_fr_proto_pvc_111 fr_proto_pvc; struct __anonstruct_fr_proto_pvc_info_112 { unsigned int dlci ; char master[16U] ; }; typedef struct __anonstruct_fr_proto_pvc_info_112 fr_proto_pvc_info; struct __anonstruct_cisco_proto_113 { unsigned int interval ; unsigned int timeout ; }; typedef struct __anonstruct_cisco_proto_113 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_114 { 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_114 ifs_ifsu ; }; union __anonunion_ifr_ifrn_115 { char ifrn_name[16U] ; }; union __anonunion_ifr_ifru_116 { 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_115 ifr_ifrn ; union __anonunion_ifr_ifru_116 ifr_ifru ; }; struct ethhdr { unsigned char h_dest[6U] ; unsigned char h_source[6U] ; __be16 h_proto ; }; struct prio_tree_node; struct raw_prio_tree_node { struct prio_tree_node *left ; struct prio_tree_node *right ; struct prio_tree_node *parent ; }; struct prio_tree_node { struct prio_tree_node *left ; struct prio_tree_node *right ; struct prio_tree_node *parent ; unsigned long start ; unsigned long last ; }; struct prio_tree_root { struct prio_tree_node *prio_tree_node ; unsigned short index_bits ; unsigned short raw ; }; struct rb_node { unsigned long rb_parent_color ; struct rb_node *rb_right ; struct rb_node *rb_left ; }; struct rb_root { struct rb_node *rb_node ; }; struct inode; struct arch_uprobe_task { unsigned long saved_trap_nr ; unsigned long saved_scratch_register ; }; enum uprobe_task_state { UTASK_RUNNING = 0, UTASK_BP_HIT = 1, UTASK_SSTEP = 2, UTASK_SSTEP_ACK = 3, UTASK_SSTEP_TRAPPED = 4 } ; struct uprobe; struct uprobe_task { enum uprobe_task_state state ; struct arch_uprobe_task autask ; struct uprobe *active_uprobe ; unsigned long xol_vaddr ; unsigned long vaddr ; }; struct xol_area { wait_queue_head_t wq ; atomic_t slot_count ; unsigned long *bitmap ; struct page *page ; unsigned long vaddr ; }; struct uprobes_state { struct xol_area *xol_area ; atomic_t count ; }; struct address_space; union __anonunion_ldv_12886_119 { unsigned long index ; void *freelist ; }; struct __anonstruct_ldv_12896_123 { unsigned short inuse ; unsigned short objects : 15 ; unsigned char frozen : 1 ; }; union __anonunion_ldv_12897_122 { atomic_t _mapcount ; struct __anonstruct_ldv_12896_123 ldv_12896 ; }; struct __anonstruct_ldv_12899_121 { union __anonunion_ldv_12897_122 ldv_12897 ; atomic_t _count ; }; union __anonunion_ldv_12900_120 { unsigned long counters ; struct __anonstruct_ldv_12899_121 ldv_12899 ; }; struct __anonstruct_ldv_12901_118 { union __anonunion_ldv_12886_119 ldv_12886 ; union __anonunion_ldv_12900_120 ldv_12900 ; }; struct __anonstruct_ldv_12908_125 { struct page *next ; int pages ; int pobjects ; }; union __anonunion_ldv_12909_124 { struct list_head lru ; struct __anonstruct_ldv_12908_125 ldv_12908 ; }; union __anonunion_ldv_12914_126 { unsigned long private ; struct kmem_cache *slab ; struct page *first_page ; }; struct page { unsigned long flags ; struct address_space *mapping ; struct __anonstruct_ldv_12901_118 ldv_12901 ; union __anonunion_ldv_12909_124 ldv_12909 ; union __anonunion_ldv_12914_126 ldv_12914 ; unsigned long debug_flags ; }; 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 ; struct mempolicy *vm_policy ; }; struct core_thread { struct task_struct *task ; struct core_thread *next ; }; struct core_state { atomic_t nr_threads ; struct core_thread dumper ; struct completion startup ; }; struct mm_rss_stat { atomic_long_t count[3U] ; }; struct linux_binfmt; struct mmu_notifier_mm; struct mm_struct { struct vm_area_struct *mmap ; struct rb_root mm_rb ; struct vm_area_struct *mmap_cache ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; void (*unmap_area)(struct mm_struct * , unsigned long ) ; unsigned long mmap_base ; unsigned long task_size ; unsigned long cached_hole_size ; unsigned long free_area_cache ; pgd_t *pgd ; atomic_t mm_users ; atomic_t mm_count ; int map_count ; spinlock_t page_table_lock ; struct rw_semaphore mmap_sem ; struct list_head mmlist ; unsigned long hiwater_rss ; unsigned long hiwater_vm ; unsigned long total_vm ; unsigned long locked_vm ; unsigned long pinned_vm ; unsigned long shared_vm ; unsigned long exec_vm ; unsigned long stack_vm ; unsigned long reserved_vm ; unsigned long def_flags ; unsigned long nr_ptes ; unsigned long start_code ; unsigned long end_code ; unsigned long start_data ; unsigned long end_data ; unsigned long start_brk ; unsigned long brk ; unsigned long start_stack ; unsigned long arg_start ; unsigned long arg_end ; unsigned long env_start ; unsigned long env_end ; unsigned long saved_auxv[44U] ; struct mm_rss_stat rss_stat ; struct linux_binfmt *binfmt ; cpumask_var_t cpu_vm_mask_var ; mm_context_t context ; unsigned long flags ; struct core_state *core_state ; spinlock_t ioctx_lock ; struct hlist_head ioctx_list ; struct task_struct *owner ; struct file *exe_file ; unsigned long num_exe_file_vmas ; struct mmu_notifier_mm *mmu_notifier_mm ; pgtable_t pmd_huge_pte ; struct cpumask cpumask_allocation ; struct uprobes_state uprobes_state ; }; enum ldv_13901 { SS_FREE = 0, SS_UNCONNECTED = 1, SS_CONNECTING = 2, SS_CONNECTED = 3, SS_DISCONNECTING = 4 } ; typedef enum ldv_13901 socket_state; struct poll_table_struct; struct pipe_inode_info; struct net; struct fasync_struct; struct socket_wq { wait_queue_head_t wait ; struct fasync_struct *fasync_list ; struct rcu_head rcu ; }; struct sock; 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 ) ; void (*set_peek_off)(struct sock * , int ) ; }; struct kobject; enum kobj_ns_type { KOBJ_NS_TYPE_NONE = 0, KOBJ_NS_TYPE_NET = 1, KOBJ_NS_TYPES = 2 } ; struct kobj_ns_type_operations { enum kobj_ns_type type ; void *(*grab_current_ns)(void) ; void const *(*netlink_ns)(struct sock * ) ; void const *(*initial_ns)(void) ; void (*drop_ns)(void * ) ; }; struct attribute { char const *name ; umode_t mode ; bool ignore_lockdep ; struct lock_class_key *key ; struct lock_class_key skey ; }; struct attribute_group { char const *name ; umode_t (*is_visible)(struct kobject * , struct attribute * , int ) ; struct attribute **attrs ; }; struct bin_attribute { struct attribute attr ; size_t size ; void *private ; ssize_t (*read)(struct file * , struct kobject * , struct bin_attribute * , char * , loff_t , size_t ) ; ssize_t (*write)(struct file * , struct kobject * , struct bin_attribute * , char * , loff_t , size_t ) ; int (*mmap)(struct file * , struct kobject * , struct bin_attribute * , struct vm_area_struct * ) ; }; struct sysfs_ops { ssize_t (*show)(struct kobject * , struct attribute * , char * ) ; ssize_t (*store)(struct kobject * , struct attribute * , char const * , size_t ) ; void const *(*namespace)(struct kobject * , struct attribute const * ) ; }; 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 kmem_cache_cpu { void **freelist ; unsigned long tid ; struct page *page ; struct page *partial ; int node ; unsigned int stat[26U] ; }; struct kmem_cache_node { spinlock_t list_lock ; unsigned long nr_partial ; struct list_head partial ; atomic_long_t nr_slabs ; atomic_long_t total_objects ; struct list_head full ; }; struct kmem_cache_order_objects { unsigned long x ; }; struct kmem_cache { struct kmem_cache_cpu *cpu_slab ; unsigned long flags ; unsigned long min_partial ; int size ; int objsize ; int offset ; int cpu_partial ; struct kmem_cache_order_objects oo ; struct kmem_cache_order_objects max ; struct kmem_cache_order_objects min ; gfp_t allocflags ; int refcount ; void (*ctor)(void * ) ; int inuse ; int align ; int reserved ; char const *name ; struct list_head list ; struct kobject kobj ; int remote_node_defrag_ratio ; struct kmem_cache_node *node[1024U] ; }; struct in6_addr; struct sk_buff; struct klist_node; struct klist_node { void *n_klist ; struct list_head n_node ; struct kref n_ref ; }; struct ratelimit_state { raw_spinlock_t lock ; int interval ; int burst ; int printed ; int missed ; unsigned long begin ; }; struct dma_map_ops; struct dev_archdata { void *acpi_handle ; struct dma_map_ops *dma_ops ; void *iommu ; }; struct device_private; struct device_driver; struct driver_private; struct class; struct subsys_private; struct bus_type; struct device_node; struct iommu_ops; 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 ; char const *dev_name ; struct device *dev_root ; 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 iommu_ops *iommu_ops ; struct subsys_private *p ; }; struct device_type; struct of_device_id; struct device_driver { char const *name ; struct bus_type *bus ; struct module *owner ; char const *mod_name ; bool suppress_bind_attrs ; struct of_device_id const *of_match_table ; int (*probe)(struct device * ) ; int (*remove)(struct device * ) ; void (*shutdown)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct attribute_group const **groups ; struct dev_pm_ops const *pm ; struct driver_private *p ; }; struct driver_attribute { struct attribute attr ; ssize_t (*show)(struct device_driver * , char * ) ; ssize_t (*store)(struct device_driver * , char const * , size_t ) ; }; struct class_attribute; struct class { char const *name ; struct module *owner ; struct class_attribute *class_attrs ; struct device_attribute *dev_attrs ; struct bin_attribute *dev_bin_attrs ; struct kobject *dev_kobj ; int (*dev_uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , umode_t * ) ; void (*class_release)(struct class * ) ; void (*dev_release)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct kobj_ns_type_operations const *ns_type ; void const *(*namespace)(struct device * ) ; struct dev_pm_ops const *pm ; struct subsys_private *p ; }; struct 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 ) ; void const *(*namespace)(struct class * , struct class_attribute const * ) ; }; struct device_type { char const *name ; struct attribute_group const **groups ; int (*uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , umode_t * ) ; void (*release)(struct device * ) ; struct dev_pm_ops const *pm ; }; struct device_attribute { struct attribute attr ; ssize_t (*show)(struct device * , struct device_attribute * , char * ) ; ssize_t (*store)(struct device * , struct device_attribute * , char const * , size_t ) ; }; struct device_dma_parameters { unsigned int max_segment_size ; unsigned long segment_boundary_mask ; }; struct dma_coherent_mem; struct device { struct device *parent ; struct device_private *p ; struct kobject kobj ; char const *init_name ; struct device_type const *type ; struct mutex mutex ; struct bus_type *bus ; struct device_driver *driver ; void *platform_data ; struct dev_pm_info power ; struct dev_pm_domain *pm_domain ; int numa_node ; u64 *dma_mask ; u64 coherent_dma_mask ; struct device_dma_parameters *dma_parms ; struct list_head dma_pools ; struct dma_coherent_mem *dma_mem ; struct dev_archdata archdata ; struct device_node *of_node ; dev_t devt ; u32 id ; 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 const *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 ; ktime_t start_prevent_time ; ktime_t prevent_sleep_time ; unsigned long event_count ; unsigned long active_count ; unsigned long relax_count ; unsigned long expire_count ; unsigned long wakeup_count ; bool active ; bool autosleep_enabled ; }; struct shrink_control { gfp_t gfp_mask ; unsigned long nr_to_scan ; }; struct shrinker { int (*shrink)(struct shrinker * , struct shrink_control * ) ; int seeks ; long batch ; struct list_head list ; atomic_long_t nr_in_batch ; }; 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 ) ; }; 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 bio_vec; typedef s32 dma_cookie_t; struct timerqueue_node { struct rb_node node ; ktime_t expires ; }; struct timerqueue_head { struct rb_root head ; struct timerqueue_node *next ; }; struct hrtimer_clock_base; struct hrtimer_cpu_base; enum hrtimer_restart { HRTIMER_NORESTART = 0, HRTIMER_RESTART = 1 } ; struct hrtimer { struct timerqueue_node node ; ktime_t _softexpires ; enum hrtimer_restart (*function)(struct hrtimer * ) ; struct hrtimer_clock_base *base ; unsigned long state ; int start_pid ; void *start_site ; char start_comm[16U] ; }; struct hrtimer_clock_base { struct hrtimer_cpu_base *cpu_base ; int index ; clockid_t clockid ; struct timerqueue_head active ; ktime_t resolution ; ktime_t (*get_time)(void) ; ktime_t softirq_time ; ktime_t offset ; }; struct hrtimer_cpu_base { raw_spinlock_t lock ; unsigned long active_bases ; ktime_t expires_next ; int hres_active ; int hang_detected ; unsigned long nr_events ; unsigned long nr_retries ; unsigned long nr_hangs ; ktime_t max_hang_time ; struct hrtimer_clock_base clock_base[3U] ; }; struct dma_attrs { unsigned long flags[1U] ; }; enum dma_data_direction { DMA_BIDIRECTIONAL = 0, DMA_TO_DEVICE = 1, DMA_FROM_DEVICE = 2, DMA_NONE = 3 } ; struct dma_map_ops { void *(*alloc)(struct device * , size_t , dma_addr_t * , gfp_t , struct dma_attrs * ) ; void (*free)(struct device * , size_t , void * , dma_addr_t , struct dma_attrs * ) ; int (*mmap)(struct device * , struct vm_area_struct * , void * , dma_addr_t , size_t , struct dma_attrs * ) ; 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 u64 netdev_features_t; struct nf_conntrack { atomic_t use ; }; struct nf_bridge_info { atomic_t use ; unsigned int mask ; struct net_device *physindev ; struct net_device *physoutdev ; 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_19506_154 { __u16 csum_start ; __u16 csum_offset ; }; union __anonunion_ldv_19507_153 { __wsum csum ; struct __anonstruct_ldv_19506_154 ldv_19506 ; }; union __anonunion_ldv_19544_155 { __u32 mark ; __u32 dropcount ; __u32 avail_size ; }; 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_19507_153 ldv_19507 ; __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 ; __u32 rxhash ; __u16 vlan_tci ; __u16 tc_index ; __u16 tc_verd ; __u16 queue_mapping ; unsigned char ndisc_nodetype : 2 ; unsigned char ooo_okay : 1 ; unsigned char l4_rxhash : 1 ; unsigned char wifi_acked_valid : 1 ; unsigned char wifi_acked : 1 ; unsigned char no_fcs : 1 ; unsigned char head_frag : 1 ; dma_cookie_t dma_cookie ; __u32 secmark ; union __anonunion_ldv_19544_155 ldv_19544 ; 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 nlmsghdr { __u32 nlmsg_len ; __u16 nlmsg_type ; __u16 nlmsg_flags ; __u32 nlmsg_seq ; __u32 nlmsg_pid ; }; struct nlattr { __u16 nla_len ; __u16 nla_type ; }; struct kernel_cap_struct { __u32 cap[2U] ; }; typedef struct kernel_cap_struct kernel_cap_t; struct dentry; struct user_namespace; struct netlink_callback { struct sk_buff *skb ; struct nlmsghdr const *nlh ; int (*dump)(struct sk_buff * , struct netlink_callback * ) ; int (*done)(struct netlink_callback * ) ; void *data ; u16 family ; u16 min_dump_alloc ; unsigned int prev_seq ; unsigned int seq ; long args[6U] ; }; 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 ; __u32 spoofchk ; }; struct plist_head { struct list_head node_list ; }; struct plist_node { int prio ; struct list_head prio_list ; struct list_head node_list ; }; struct pm_qos_request { struct plist_node node ; int pm_qos_class ; struct delayed_work work ; }; struct dev_pm_qos_request { struct plist_node node ; struct device *dev ; }; enum pm_qos_type { PM_QOS_UNITIALIZED = 0, PM_QOS_MAX = 1, PM_QOS_MIN = 2 } ; struct pm_qos_constraints { struct plist_head list ; s32 target_value ; s32 default_value ; enum pm_qos_type type ; struct blocking_notifier_head *notifiers ; }; struct dql { unsigned int num_queued ; unsigned int adj_limit ; unsigned int last_obj_cnt ; unsigned int limit ; unsigned int num_completed ; unsigned int prev_ovlimit ; unsigned int prev_num_queued ; unsigned int prev_last_obj_cnt ; unsigned int lowest_slack ; unsigned long slack_start_time ; unsigned int max_limit ; unsigned int min_limit ; unsigned int slack_hold_time ; }; typedef uid_t kuid_t; typedef gid_t kgid_t; struct kstat { u64 ino ; dev_t dev ; umode_t mode ; unsigned int nlink ; kuid_t uid ; kgid_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 sem_undo_list; struct sysv_sem { struct sem_undo_list *undo_list ; }; struct bio; struct bio_integrity_payload; struct block_device; struct io_context; struct cgroup_subsys_state; 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 ; atomic_t bi_cnt ; struct bio_vec *bi_io_vec ; bio_end_io_t *bi_end_io ; void *bi_private ; struct io_context *bi_ioc ; struct cgroup_subsys_state *bi_css ; struct bio_integrity_payload *bi_integrity ; bio_destructor_t *bi_destructor ; struct bio_vec bi_inline_vecs[0U] ; }; struct hlist_bl_node; struct hlist_bl_head { struct hlist_bl_node *first ; }; struct hlist_bl_node { struct hlist_bl_node *next ; struct hlist_bl_node **pprev ; }; struct nameidata; struct path; struct vfsmount; struct __anonstruct_ldv_21797_160 { u32 hash ; u32 len ; }; union __anonunion_ldv_21799_159 { struct __anonstruct_ldv_21797_160 ldv_21797 ; u64 hash_len ; }; struct qstr { union __anonunion_ldv_21799_159 ldv_21799 ; unsigned char const *name ; }; struct dentry_operations; struct super_block; union __anonunion_d_u_161 { struct list_head d_child ; struct rcu_head d_rcu ; }; struct dentry { unsigned int d_flags ; seqcount_t d_seq ; struct hlist_bl_node d_hash ; struct dentry *d_parent ; struct qstr d_name ; struct inode *d_inode ; unsigned char d_iname[32U] ; unsigned int d_count ; spinlock_t d_lock ; struct dentry_operations const *d_op ; struct super_block *d_sb ; unsigned long d_time ; void *d_fsdata ; struct list_head d_lru ; union __anonunion_d_u_161 d_u ; struct list_head d_subdirs ; struct list_head d_alias ; }; struct dentry_operations { int (*d_revalidate)(struct dentry * , struct nameidata * ) ; int (*d_hash)(struct dentry const * , struct inode const * , struct qstr * ) ; int (*d_compare)(struct dentry const * , struct inode const * , struct dentry const * , struct inode const * , unsigned int , char const * , struct qstr const * ) ; int (*d_delete)(struct dentry const * ) ; void (*d_release)(struct dentry * ) ; void (*d_prune)(struct dentry * ) ; void (*d_iput)(struct dentry * , struct inode * ) ; char *(*d_dname)(struct dentry * , char * , int ) ; struct vfsmount *(*d_automount)(struct path * ) ; int (*d_manage)(struct dentry * , bool ) ; }; struct path { struct vfsmount *mnt ; struct dentry *dentry ; }; struct radix_tree_node; struct radix_tree_root { unsigned int height ; gfp_t gfp_mask ; struct radix_tree_node *rnode ; }; enum pid_type { PIDTYPE_PID = 0, PIDTYPE_PGID = 1, PIDTYPE_SID = 2, PIDTYPE_MAX = 3 } ; struct pid_namespace; struct upid { int nr ; struct pid_namespace *ns ; struct hlist_node pid_chain ; }; struct pid { atomic_t count ; unsigned int level ; struct hlist_head tasks[3U] ; struct rcu_head rcu ; struct upid numbers[1U] ; }; struct pid_link { struct hlist_node node ; struct pid *pid ; }; struct semaphore { raw_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] ; }; enum migrate_mode { MIGRATE_ASYNC = 0, MIGRATE_SYNC_LIGHT = 1, MIGRATE_SYNC = 2 } ; struct export_operations; struct hd_geometry; struct kstatfs; struct iattr { unsigned int ia_valid ; umode_t ia_mode ; kuid_t ia_uid ; kgid_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 { raw_spinlock_t lock ; s64 count ; struct list_head list ; s32 *counters ; }; struct fs_disk_quota { __s8 d_version ; __s8 d_flags ; __u16 d_fieldmask ; __u32 d_id ; __u64 d_blk_hardlimit ; __u64 d_blk_softlimit ; __u64 d_ino_hardlimit ; __u64 d_ino_softlimit ; __u64 d_bcount ; __u64 d_icount ; __s32 d_itimer ; __s32 d_btimer ; __u16 d_iwarns ; __u16 d_bwarns ; __s32 d_padding2 ; __u64 d_rtb_hardlimit ; __u64 d_rtb_softlimit ; __u64 d_rtbcount ; __s32 d_rtbtimer ; __u16 d_rtbwarns ; __s16 d_padding3 ; char d_padding4[8U] ; }; struct fs_qfilestat { __u64 qfs_ino ; __u64 qfs_nblks ; __u32 qfs_nextents ; }; typedef struct fs_qfilestat fs_qfilestat_t; struct fs_quota_stat { __s8 qs_version ; __u16 qs_flags ; __s8 qs_pad ; fs_qfilestat_t qs_uquota ; fs_qfilestat_t qs_gquota ; __u32 qs_incoredqs ; __s32 qs_btimelimit ; __s32 qs_itimelimit ; __s32 qs_rtbtimelimit ; __u16 qs_bwarnlimit ; __u16 qs_iwarnlimit ; }; struct dquot; typedef __kernel_uid32_t qid_t; typedef long long qsize_t; struct mem_dqblk { qsize_t dqb_bhardlimit ; qsize_t dqb_bsoftlimit ; qsize_t dqb_curspace ; qsize_t dqb_rsvspace ; qsize_t dqb_ihardlimit ; qsize_t dqb_isoftlimit ; qsize_t dqb_curinodes ; time_t dqb_btime ; time_t dqb_itime ; }; struct quota_format_type; struct mem_dqinfo { struct quota_format_type *dqi_format ; int dqi_fmt_id ; struct list_head dqi_dirty_list ; unsigned long dqi_flags ; unsigned int dqi_bgrace ; unsigned int dqi_igrace ; qsize_t dqi_maxblimit ; qsize_t dqi_maxilimit ; void *dqi_priv ; }; struct dquot { struct hlist_node dq_hash ; struct list_head dq_inuse ; struct list_head dq_free ; struct list_head dq_dirty ; struct mutex dq_lock ; atomic_t dq_count ; wait_queue_head_t dq_wait_unused ; struct super_block *dq_sb ; unsigned int dq_id ; loff_t dq_off ; unsigned long dq_flags ; short dq_type ; struct mem_dqblk dq_dqb ; }; struct quota_format_ops { int (*check_quota_file)(struct super_block * , int ) ; int (*read_file_info)(struct super_block * , int ) ; int (*write_file_info)(struct super_block * , int ) ; int (*free_file_info)(struct super_block * , int ) ; int (*read_dqblk)(struct dquot * ) ; int (*commit_dqblk)(struct dquot * ) ; int (*release_dqblk)(struct dquot * ) ; }; struct dquot_operations { int (*write_dquot)(struct dquot * ) ; struct dquot *(*alloc_dquot)(struct super_block * , int ) ; void (*destroy_dquot)(struct dquot * ) ; int (*acquire_dquot)(struct dquot * ) ; int (*release_dquot)(struct dquot * ) ; int (*mark_dirty)(struct dquot * ) ; int (*write_info)(struct super_block * , int ) ; qsize_t *(*get_reserved_space)(struct inode * ) ; }; struct quotactl_ops { int (*quota_on)(struct super_block * , int , int , struct path * ) ; int (*quota_on_meta)(struct super_block * , int , int ) ; int (*quota_off)(struct super_block * , int ) ; int (*quota_sync)(struct super_block * , int , int ) ; int (*get_info)(struct super_block * , int , struct if_dqinfo * ) ; int (*set_info)(struct super_block * , int , struct if_dqinfo * ) ; int (*get_dqblk)(struct super_block * , int , qid_t , struct fs_disk_quota * ) ; int (*set_dqblk)(struct super_block * , int , qid_t , struct fs_disk_quota * ) ; int (*get_xstate)(struct super_block * , struct fs_quota_stat * ) ; int (*set_xstate)(struct super_block * , unsigned int , int ) ; }; struct quota_format_type { int qf_fmt_id ; struct quota_format_ops const *qf_ops ; struct module *qf_owner ; struct quota_format_type *qf_next ; }; struct quota_info { unsigned int flags ; struct mutex dqio_mutex ; struct mutex dqonoff_mutex ; struct rw_semaphore dqptr_sem ; struct inode *files[2U] ; struct mem_dqinfo info[2U] ; struct quota_format_ops const *ops[2U] ; }; union __anonunion_arg_163 { char *buf ; void *data ; }; struct __anonstruct_read_descriptor_t_162 { size_t written ; size_t count ; union __anonunion_arg_163 arg ; int error ; }; typedef struct __anonstruct_read_descriptor_t_162 read_descriptor_t; struct address_space_operations { int (*writepage)(struct page * , struct writeback_control * ) ; int (*readpage)(struct file * , struct page * ) ; int (*writepages)(struct address_space * , struct writeback_control * ) ; int (*set_page_dirty)(struct page * ) ; int (*readpages)(struct file * , struct address_space * , struct list_head * , unsigned int ) ; int (*write_begin)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page ** , void ** ) ; int (*write_end)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page * , void * ) ; sector_t (*bmap)(struct address_space * , sector_t ) ; void (*invalidatepage)(struct page * , unsigned long ) ; int (*releasepage)(struct page * , gfp_t ) ; void (*freepage)(struct page * ) ; ssize_t (*direct_IO)(int , struct kiocb * , struct iovec const * , loff_t , unsigned long ) ; int (*get_xip_mem)(struct address_space * , unsigned long , int , void ** , unsigned long * ) ; int (*migratepage)(struct address_space * , struct page * , struct page * , enum migrate_mode ) ; int (*launder_page)(struct page * ) ; int (*is_partially_uptodate)(struct page * , read_descriptor_t * , unsigned long ) ; int (*error_remove_page)(struct address_space * , struct page * ) ; }; struct backing_dev_info; struct address_space { struct inode *host ; struct radix_tree_root page_tree ; spinlock_t tree_lock ; unsigned int i_mmap_writable ; struct prio_tree_root i_mmap ; struct list_head i_mmap_nonlinear ; struct mutex i_mmap_mutex ; unsigned long nrpages ; unsigned long writeback_index ; struct address_space_operations const *a_ops ; unsigned long flags ; struct backing_dev_info *backing_dev_info ; spinlock_t private_lock ; struct list_head private_list ; struct address_space *assoc_mapping ; }; struct request_queue; struct hd_struct; struct gendisk; struct block_device { dev_t bd_dev ; int bd_openers ; struct inode *bd_inode ; struct super_block *bd_super ; struct mutex bd_mutex ; struct list_head bd_inodes ; void *bd_claiming ; void *bd_holder ; int bd_holders ; bool bd_write_holder ; struct list_head bd_holder_disks ; struct block_device *bd_contains ; unsigned int bd_block_size ; struct hd_struct *bd_part ; unsigned int bd_part_count ; int bd_invalidated ; struct gendisk *bd_disk ; struct request_queue *bd_queue ; struct list_head bd_list ; unsigned long bd_private ; int bd_fsfreeze_count ; struct mutex bd_fsfreeze_mutex ; }; struct posix_acl; struct inode_operations; union __anonunion_ldv_22913_164 { unsigned int const i_nlink ; unsigned int __i_nlink ; }; union __anonunion_ldv_22932_165 { struct list_head i_dentry ; struct rcu_head i_rcu ; }; struct file_lock; struct cdev; union __anonunion_ldv_22949_166 { struct pipe_inode_info *i_pipe ; struct block_device *i_bdev ; struct cdev *i_cdev ; }; struct inode { umode_t i_mode ; unsigned short i_opflags ; kuid_t i_uid ; kgid_t i_gid ; unsigned int i_flags ; struct posix_acl *i_acl ; struct posix_acl *i_default_acl ; struct inode_operations const *i_op ; struct super_block *i_sb ; struct address_space *i_mapping ; void *i_security ; unsigned long i_ino ; union __anonunion_ldv_22913_164 ldv_22913 ; dev_t i_rdev ; struct timespec i_atime ; struct timespec i_mtime ; struct timespec i_ctime ; spinlock_t i_lock ; unsigned short i_bytes ; blkcnt_t i_blocks ; loff_t i_size ; unsigned long i_state ; struct mutex i_mutex ; unsigned long dirtied_when ; struct hlist_node i_hash ; struct list_head i_wb_list ; struct list_head i_lru ; struct list_head i_sb_list ; union __anonunion_ldv_22932_165 ldv_22932 ; atomic_t i_count ; unsigned int i_blkbits ; u64 i_version ; atomic_t i_dio_count ; atomic_t i_writecount ; struct file_operations const *i_fop ; struct file_lock *i_flock ; struct address_space i_data ; struct dquot *i_dquot[2U] ; struct list_head i_devices ; union __anonunion_ldv_22949_166 ldv_22949 ; __u32 i_generation ; __u32 i_fsnotify_mask ; struct hlist_head i_fsnotify_marks ; atomic_t i_readcount ; void *i_private ; }; struct fown_struct { rwlock_t lock ; struct pid *pid ; enum pid_type pid_type ; kuid_t uid ; kuid_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_167 { struct list_head fu_list ; struct rcu_head fu_rcuhead ; }; struct file { union __anonunion_f_u_167 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 list_head f_tfile_llink ; 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 (*lm_compare_owner)(struct file_lock * , struct file_lock * ) ; void (*lm_notify)(struct file_lock * ) ; int (*lm_grant)(struct file_lock * , struct file_lock * , int ) ; void (*lm_release_private)(struct file_lock * ) ; void (*lm_break)(struct file_lock * ) ; int (*lm_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_169 { struct list_head link ; int state ; }; union __anonunion_fl_u_168 { struct nfs_lock_info nfs_fl ; struct nfs4_lock_info nfs4_fl ; struct __anonstruct_afs_169 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 int 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 ; unsigned long fl_downgrade_time ; struct file_lock_operations const *fl_ops ; struct lock_manager_operations const *fl_lmops ; union __anonunion_fl_u_168 fl_u ; }; struct fasync_struct { spinlock_t fa_lock ; int magic ; int fa_fd ; struct fasync_struct *fa_next ; struct file *fa_file ; struct rcu_head fa_rcu ; }; struct file_system_type; struct super_operations; struct xattr_handler; struct mtd_info; struct super_block { struct list_head s_list ; dev_t s_dev ; unsigned char s_dirt ; unsigned char s_blocksize_bits ; unsigned long s_blocksize ; loff_t s_maxbytes ; struct file_system_type *s_type ; struct super_operations const *s_op ; struct dquot_operations const *dq_op ; struct quotactl_ops const *s_qcop ; struct export_operations const *s_export_op ; unsigned long s_flags ; unsigned long s_magic ; struct dentry *s_root ; struct rw_semaphore s_umount ; struct mutex s_lock ; int s_count ; atomic_t s_active ; void *s_security ; struct xattr_handler const **s_xattr ; struct list_head s_inodes ; struct hlist_bl_head s_anon ; struct list_head *s_files ; struct list_head s_mounts ; struct list_head s_dentry_lru ; int s_nr_dentry_unused ; spinlock_t s_inode_lru_lock ; struct list_head s_inode_lru ; int s_nr_inodes_unused ; struct block_device *s_bdev ; struct backing_dev_info *s_bdi ; struct mtd_info *s_mtd ; struct hlist_node s_instances ; struct quota_info s_dquot ; int s_frozen ; wait_queue_head_t s_wait_unfrozen ; char s_id[32U] ; u8 s_uuid[16U] ; void *s_fs_info ; unsigned int s_max_links ; fmode_t s_mode ; u32 s_time_gran ; struct mutex s_vfs_rename_mutex ; char *s_subtype ; char *s_options ; struct dentry_operations const *s_d_op ; int cleancache_poolid ; struct shrinker s_shrink ; atomic_long_t s_remove_count ; int s_readonly_remount ; }; 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 * , loff_t , loff_t , int ) ; int (*aio_fsync)(struct kiocb * , int ) ; int (*fasync)(int , struct file * , int ) ; int (*lock)(struct file * , int , struct file_lock * ) ; ssize_t (*sendpage)(struct file * , struct page * , int , size_t , loff_t * , int ) ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; int (*check_flags)(int ) ; int (*flock)(struct file * , int , struct file_lock * ) ; ssize_t (*splice_write)(struct pipe_inode_info * , struct file * , loff_t * , size_t , unsigned int ) ; ssize_t (*splice_read)(struct file * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ) ; int (*setlease)(struct file * , long , struct file_lock ** ) ; long (*fallocate)(struct file * , int , loff_t , loff_t ) ; }; struct inode_operations { struct dentry *(*lookup)(struct inode * , struct dentry * , struct nameidata * ) ; void *(*follow_link)(struct dentry * , struct nameidata * ) ; int (*permission)(struct inode * , int ) ; struct posix_acl *(*get_acl)(struct inode * , int ) ; int (*readlink)(struct dentry * , char * , int ) ; void (*put_link)(struct dentry * , struct nameidata * , void * ) ; int (*create)(struct inode * , struct dentry * , umode_t , 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 * , umode_t ) ; int (*rmdir)(struct inode * , struct dentry * ) ; int (*mknod)(struct inode * , struct dentry * , umode_t , dev_t ) ; int (*rename)(struct inode * , struct dentry * , struct inode * , struct dentry * ) ; void (*truncate)(struct inode * ) ; int (*setattr)(struct dentry * , struct iattr * ) ; int (*getattr)(struct vfsmount * , struct dentry * , struct kstat * ) ; int (*setxattr)(struct dentry * , char const * , void const * , size_t , int ) ; ssize_t (*getxattr)(struct dentry * , char const * , void * , size_t ) ; ssize_t (*listxattr)(struct dentry * , char * , size_t ) ; int (*removexattr)(struct dentry * , char const * ) ; int (*fiemap)(struct inode * , struct fiemap_extent_info * , u64 , u64 ) ; }; struct super_operations { struct inode *(*alloc_inode)(struct super_block * ) ; void (*destroy_inode)(struct inode * ) ; void (*dirty_inode)(struct inode * , int ) ; int (*write_inode)(struct inode * , struct writeback_control * ) ; int (*drop_inode)(struct inode * ) ; void (*evict_inode)(struct inode * ) ; void (*put_super)(struct super_block * ) ; void (*write_super)(struct super_block * ) ; int (*sync_fs)(struct super_block * , int ) ; int (*freeze_fs)(struct super_block * ) ; int (*unfreeze_fs)(struct super_block * ) ; int (*statfs)(struct dentry * , struct kstatfs * ) ; int (*remount_fs)(struct super_block * , int * , char * ) ; void (*umount_begin)(struct super_block * ) ; int (*show_options)(struct seq_file * , struct dentry * ) ; int (*show_devname)(struct seq_file * , struct dentry * ) ; int (*show_path)(struct seq_file * , struct dentry * ) ; int (*show_stats)(struct seq_file * , struct dentry * ) ; 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 ) ; int (*nr_cached_objects)(struct super_block * ) ; void (*free_cached_objects)(struct super_block * , int ) ; }; struct file_system_type { char const *name ; int fs_flags ; struct dentry *(*mount)(struct file_system_type * , int , char const * , void * ) ; void (*kill_sb)(struct super_block * ) ; struct module *owner ; struct file_system_type *next ; struct hlist_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 io_event { __u64 data ; __u64 obj ; __s64 res ; __s64 res2 ; }; typedef unsigned long cputime_t; struct siginfo; struct __anonstruct_sigset_t_170 { unsigned long sig[1U] ; }; typedef struct __anonstruct_sigset_t_170 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_172 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; }; struct __anonstruct__timer_173 { __kernel_timer_t _tid ; int _overrun ; char _pad[0U] ; sigval_t _sigval ; int _sys_private ; }; struct __anonstruct__rt_174 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; sigval_t _sigval ; }; struct __anonstruct__sigchld_175 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; int _status ; __kernel_clock_t _utime ; __kernel_clock_t _stime ; }; struct __anonstruct__sigfault_176 { void *_addr ; short _addr_lsb ; }; struct __anonstruct__sigpoll_177 { long _band ; int _fd ; }; struct __anonstruct__sigsys_178 { void *_call_addr ; int _syscall ; unsigned int _arch ; }; union __anonunion__sifields_171 { int _pad[28U] ; struct __anonstruct__kill_172 _kill ; struct __anonstruct__timer_173 _timer ; struct __anonstruct__rt_174 _rt ; struct __anonstruct__sigchld_175 _sigchld ; struct __anonstruct__sigfault_176 _sigfault ; struct __anonstruct__sigpoll_177 _sigpoll ; struct __anonstruct__sigsys_178 _sigsys ; }; struct siginfo { int si_signo ; int si_errno ; int si_code ; union __anonunion__sifields_171 _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 ; raw_spinlock_t lock ; }; struct seccomp_filter; struct seccomp { int mode ; struct seccomp_filter *filter ; }; 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 ; }; struct nsproxy; struct ctl_table_root; struct ctl_table_header; struct ctl_dir; typedef int proc_handler(struct ctl_table * , int , void * , size_t * , loff_t * ); struct ctl_table_poll { atomic_t event ; wait_queue_head_t wait ; }; struct ctl_table { char const *procname ; void *data ; int maxlen ; umode_t mode ; struct ctl_table *child ; proc_handler *proc_handler ; struct ctl_table_poll *poll ; void *extra1 ; void *extra2 ; }; struct ctl_node { struct rb_node node ; struct ctl_table_header *header ; }; struct __anonstruct_ldv_26177_182 { struct ctl_table *ctl_table ; int used ; int count ; int nreg ; }; union __anonunion_ldv_26179_181 { struct __anonstruct_ldv_26177_182 ldv_26177 ; struct rcu_head rcu ; }; struct ctl_table_set; struct ctl_table_header { union __anonunion_ldv_26179_181 ldv_26179 ; struct completion *unregistering ; struct ctl_table *ctl_table_arg ; struct ctl_table_root *root ; struct ctl_table_set *set ; struct ctl_dir *parent ; struct ctl_node *node ; }; struct ctl_dir { struct ctl_table_header header ; struct rb_root root ; }; struct ctl_table_set { int (*is_seen)(struct ctl_table_set * ) ; struct ctl_dir dir ; }; struct ctl_table_root { 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 * ) ; }; typedef int32_t key_serial_t; typedef uint32_t key_perm_t; struct key; struct signal_struct; struct key_type; struct keyring_list; union __anonunion_ldv_26258_183 { struct list_head graveyard_link ; struct rb_node serial_node ; }; struct key_user; union __anonunion_ldv_26267_184 { time_t expiry ; time_t revoked_at ; }; union __anonunion_type_data_185 { struct list_head link ; unsigned long x[2U] ; void *p[2U] ; int reject_error ; }; union __anonunion_payload_186 { unsigned long value ; void *rcudata ; void *data ; struct keyring_list *subscriptions ; }; struct key { atomic_t usage ; key_serial_t serial ; union __anonunion_ldv_26258_183 ldv_26258 ; struct key_type *type ; struct rw_semaphore sem ; struct key_user *user ; void *security ; union __anonunion_ldv_26267_184 ldv_26267 ; time_t last_used_at ; 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_185 type_data ; union __anonunion_payload_186 payload ; }; struct audit_context; struct group_info { atomic_t usage ; int ngroups ; int nblocks ; kgid_t small_block[32U] ; kgid_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 ; kuid_t uid ; kgid_t gid ; kuid_t suid ; kgid_t sgid ; kuid_t euid ; kgid_t egid ; kuid_t fsuid ; kgid_t fsgid ; unsigned int securebits ; kernel_cap_t cap_inheritable ; kernel_cap_t cap_permitted ; kernel_cap_t cap_effective ; kernel_cap_t cap_bset ; unsigned char jit_keyring ; struct key *thread_keyring ; struct key *request_key_auth ; struct thread_group_cred *tgcred ; void *security ; struct user_struct *user ; struct user_namespace *user_ns ; struct group_info *group_info ; struct rcu_head rcu ; }; struct llist_node; struct llist_node { struct llist_node *next ; }; struct futex_pi_state; struct robust_list_head; struct bio_list; struct fs_struct; struct perf_event_context; struct blk_plug; struct cfs_rq; struct kioctx; union __anonunion_ki_obj_187 { 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_187 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 list_head ki_batch ; 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 ; raw_spinlock_t lock ; }; struct autogroup; struct tty_struct; struct taskstats; struct tty_audit_buf; struct signal_struct { atomic_t sigcnt ; atomic_t live ; int nr_threads ; wait_queue_head_t wait_chldexit ; struct task_struct *curr_target ; struct sigpending shared_pending ; int group_exit_code ; int notify_count ; struct task_struct *group_exit_task ; int group_stop_count ; unsigned int flags ; unsigned char is_child_subreaper : 1 ; unsigned char has_child_subreaper : 1 ; struct list_head posix_timers ; struct hrtimer real_timer ; struct pid *leader_pid ; ktime_t it_real_incr ; struct cpu_itimer it[2U] ; struct thread_group_cputimer cputimer ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct pid *tty_old_pgrp ; int leader ; struct tty_struct *tty ; struct autogroup *autogroup ; cputime_t utime ; cputime_t stime ; cputime_t cutime ; cputime_t cstime ; cputime_t gtime ; cputime_t cgtime ; cputime_t prev_utime ; cputime_t prev_stime ; unsigned long nvcsw ; unsigned long nivcsw ; unsigned long cnvcsw ; unsigned long cnivcsw ; unsigned long min_flt ; unsigned long maj_flt ; unsigned long cmin_flt ; unsigned long cmaj_flt ; unsigned long inblock ; unsigned long oublock ; unsigned long cinblock ; unsigned long coublock ; unsigned long maxrss ; unsigned long cmaxrss ; struct task_io_accounting ioac ; unsigned long long sum_sched_runtime ; struct rlimit rlim[16U] ; struct pacct_struct pacct ; struct taskstats *stats ; unsigned int audit_tty ; struct tty_audit_buf *tty_audit_buf ; struct rw_semaphore group_rwsem ; int oom_adj ; int oom_score_adj ; int oom_score_adj_min ; struct mutex cred_guard_mutex ; }; struct user_struct { atomic_t __count ; atomic_t processes ; atomic_t files ; atomic_t sigpending ; atomic_t inotify_watches ; atomic_t inotify_devs ; atomic_t fanotify_listeners ; atomic_long_t epoll_watches ; unsigned long mq_bytes ; unsigned long locked_shm ; struct key *uid_keyring ; struct key *session_keyring ; struct hlist_node uidhash_node ; kuid_t uid ; atomic_long_t locked_vm ; }; struct reclaim_state; struct sched_info { unsigned long pcount ; unsigned long long run_delay ; unsigned long long last_arrival ; unsigned long long last_queued ; }; struct task_delay_info { spinlock_t lock ; unsigned int flags ; struct timespec blkio_start ; struct timespec blkio_end ; u64 blkio_delay ; u64 swapin_delay ; u32 blkio_count ; u32 swapin_count ; struct timespec freepages_start ; struct timespec freepages_end ; u64 freepages_delay ; u32 freepages_count ; }; struct rq; struct sched_class { struct sched_class const *next ; void (*enqueue_task)(struct rq * , struct task_struct * , int ) ; void (*dequeue_task)(struct rq * , struct task_struct * , int ) ; void (*yield_task)(struct rq * ) ; bool (*yield_to_task)(struct rq * , struct task_struct * , bool ) ; void (*check_preempt_curr)(struct rq * , struct task_struct * , int ) ; struct task_struct *(*pick_next_task)(struct rq * ) ; void (*put_prev_task)(struct rq * , struct task_struct * ) ; int (*select_task_rq)(struct task_struct * , int , int ) ; void (*pre_schedule)(struct rq * , struct task_struct * ) ; void (*post_schedule)(struct rq * ) ; void (*task_waking)(struct task_struct * ) ; void (*task_woken)(struct rq * , struct task_struct * ) ; void (*set_cpus_allowed)(struct task_struct * , struct cpumask const * ) ; void (*rq_online)(struct rq * ) ; void (*rq_offline)(struct rq * ) ; void (*set_curr_task)(struct rq * ) ; void (*task_tick)(struct rq * , struct task_struct * , int ) ; void (*task_fork)(struct task_struct * ) ; void (*switched_from)(struct rq * , struct task_struct * ) ; void (*switched_to)(struct rq * , struct task_struct * ) ; void (*prio_changed)(struct rq * , struct task_struct * , int ) ; unsigned int (*get_rr_interval)(struct rq * , struct task_struct * ) ; void (*task_move_group)(struct task_struct * , int ) ; }; struct load_weight { unsigned long weight ; unsigned long inv_weight ; }; struct sched_statistics { u64 wait_start ; u64 wait_max ; u64 wait_count ; u64 wait_sum ; u64 iowait_count ; u64 iowait_sum ; u64 sleep_start ; u64 sleep_max ; s64 sum_sleep_runtime ; u64 block_start ; u64 block_max ; u64 exec_max ; u64 slice_max ; u64 nr_migrations_cold ; u64 nr_failed_migrations_affine ; u64 nr_failed_migrations_running ; u64 nr_failed_migrations_hot ; u64 nr_forced_migrations ; u64 nr_wakeups ; u64 nr_wakeups_sync ; u64 nr_wakeups_migrate ; u64 nr_wakeups_local ; u64 nr_wakeups_remote ; u64 nr_wakeups_affine ; u64 nr_wakeups_affine_attempts ; u64 nr_wakeups_passive ; u64 nr_wakeups_idle ; }; struct sched_entity { struct load_weight load ; struct rb_node run_node ; struct list_head group_node ; unsigned int on_rq ; u64 exec_start ; u64 sum_exec_runtime ; u64 vruntime ; u64 prev_sum_exec_runtime ; u64 nr_migrations ; struct sched_statistics statistics ; struct sched_entity *parent ; struct cfs_rq *cfs_rq ; struct cfs_rq *my_q ; }; struct rt_rq; struct sched_rt_entity { struct list_head run_list ; unsigned long timeout ; unsigned int time_slice ; int nr_cpus_allowed ; struct sched_rt_entity *back ; struct sched_rt_entity *parent ; struct rt_rq *rt_rq ; struct rt_rq *my_q ; }; struct mem_cgroup; struct memcg_batch_info { int do_batch ; struct mem_cgroup *memcg ; unsigned long nr_pages ; unsigned long memsw_nr_pages ; }; struct css_set; struct compat_robust_list_head; struct task_struct { long volatile state ; void *stack ; atomic_t usage ; unsigned int flags ; unsigned int ptrace ; struct llist_node wake_entry ; int on_cpu ; int on_rq ; int prio ; int static_prio ; int normal_prio ; unsigned int rt_priority ; struct sched_class const *sched_class ; struct sched_entity se ; struct sched_rt_entity rt ; struct hlist_head preempt_notifiers ; unsigned char fpu_counter ; unsigned int policy ; cpumask_t cpus_allowed ; struct sched_info sched_info ; struct list_head tasks ; struct plist_node pushable_tasks ; struct mm_struct *mm ; struct mm_struct *active_mm ; unsigned char brk_randomized : 1 ; int exit_state ; int exit_code ; int exit_signal ; int pdeath_signal ; unsigned int jobctl ; unsigned int personality ; unsigned char did_exec : 1 ; unsigned char in_execve : 1 ; unsigned char in_iowait : 1 ; unsigned char no_new_privs : 1 ; unsigned char sched_reset_on_fork : 1 ; unsigned char sched_contributes_to_load : 1 ; unsigned char irq_thread : 1 ; pid_t pid ; pid_t tgid ; unsigned long stack_canary ; struct task_struct *real_parent ; struct task_struct *parent ; struct list_head children ; struct list_head sibling ; struct task_struct *group_leader ; struct list_head ptraced ; struct list_head ptrace_entry ; struct pid_link pids[3U] ; struct list_head thread_group ; struct completion *vfork_done ; int *set_child_tid ; int *clear_child_tid ; cputime_t utime ; cputime_t stime ; cputime_t utimescaled ; cputime_t stimescaled ; cputime_t gtime ; cputime_t prev_utime ; cputime_t prev_stime ; unsigned long nvcsw ; unsigned long nivcsw ; struct timespec start_time ; struct timespec real_start_time ; unsigned long min_flt ; unsigned long maj_flt ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct cred const *real_cred ; struct cred const *cred ; struct cred *replacement_session_keyring ; char comm[16U] ; int link_count ; int total_link_count ; struct sysv_sem sysvsem ; unsigned long last_switch_count ; struct thread_struct thread ; struct fs_struct *fs ; struct files_struct *files ; struct nsproxy *nsproxy ; struct signal_struct *signal ; struct sighand_struct *sighand ; sigset_t blocked ; sigset_t real_blocked ; sigset_t saved_sigmask ; struct sigpending pending ; unsigned long sas_ss_sp ; size_t sas_ss_size ; int (*notifier)(void * ) ; void *notifier_data ; sigset_t *notifier_mask ; struct audit_context *audit_context ; uid_t loginuid ; unsigned int sessionid ; struct seccomp seccomp ; u32 parent_exec_id ; u32 self_exec_id ; spinlock_t alloc_lock ; raw_spinlock_t pi_lock ; struct plist_head pi_waiters ; struct rt_mutex_waiter *pi_blocked_on ; struct mutex_waiter *blocked_on ; unsigned int irq_events ; unsigned long hardirq_enable_ip ; unsigned long hardirq_disable_ip ; unsigned int hardirq_enable_event ; unsigned int hardirq_disable_event ; int hardirqs_enabled ; int hardirq_context ; unsigned long softirq_disable_ip ; unsigned long softirq_enable_ip ; unsigned int softirq_disable_event ; unsigned int softirq_enable_event ; int softirqs_enabled ; int softirq_context ; u64 curr_chain_key ; int lockdep_depth ; unsigned int lockdep_recursion ; struct held_lock held_locks[48U] ; gfp_t lockdep_reclaim_gfp ; void *journal_info ; struct bio_list *bio_list ; struct blk_plug *plug ; struct reclaim_state *reclaim_state ; struct backing_dev_info *backing_dev_info ; struct io_context *io_context ; unsigned long ptrace_message ; siginfo_t *last_siginfo ; struct task_io_accounting ioac ; u64 acct_rss_mem1 ; u64 acct_vm_mem1 ; cputime_t acct_timexpd ; nodemask_t mems_allowed ; seqcount_t mems_allowed_seq ; int cpuset_mem_spread_rotor ; int cpuset_slab_spread_rotor ; struct css_set *cgroups ; struct list_head cg_list ; struct robust_list_head *robust_list ; struct compat_robust_list_head *compat_robust_list ; struct list_head pi_state_list ; struct futex_pi_state *pi_state_cache ; struct perf_event_context *perf_event_ctxp[2U] ; struct mutex perf_event_mutex ; struct list_head perf_event_list ; struct mempolicy *mempolicy ; short il_next ; short pref_node_fork ; struct rcu_head rcu ; struct pipe_inode_info *splice_pipe ; struct task_delay_info *delays ; int make_it_fail ; int nr_dirtied ; int nr_dirtied_pause ; unsigned long dirty_paused_when ; 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 ; atomic_t ptrace_bp_refcnt ; struct uprobe_task *utask ; int uprobe_srcu_id ; }; typedef s32 compat_time_t; typedef s32 compat_long_t; struct compat_timespec { compat_time_t tv_sec ; s32 tv_nsec ; }; typedef u32 compat_uptr_t; struct compat_robust_list { compat_uptr_t next ; }; struct compat_robust_list_head { struct compat_robust_list list ; compat_long_t futex_offset ; compat_uptr_t list_op_pending ; }; struct ethtool_cmd { __u32 cmd ; __u32 supported ; __u32 advertising ; __u16 speed ; __u8 duplex ; __u8 port ; __u8 phy_address ; __u8 transceiver ; __u8 autoneg ; __u8 mdio_support ; __u32 maxtxpkt ; __u32 maxrxpkt ; __u16 speed_hi ; __u8 eth_tp_mdix ; __u8 reserved2 ; __u32 lp_advertising ; __u32 reserved[2U] ; }; struct ethtool_drvinfo { __u32 cmd ; char driver[32U] ; char version[32U] ; char fw_version[32U] ; char bus_info[32U] ; char reserved1[32U] ; char reserved2[12U] ; __u32 n_priv_flags ; __u32 n_stats ; __u32 testinfo_len ; __u32 eedump_len ; __u32 regdump_len ; }; struct ethtool_wolinfo { __u32 cmd ; __u32 supported ; __u32 wolopts ; __u8 sopass[6U] ; }; struct ethtool_regs { __u32 cmd ; __u32 version ; __u32 len ; __u8 data[0U] ; }; struct ethtool_eeprom { __u32 cmd ; __u32 magic ; __u32 offset ; __u32 len ; __u8 data[0U] ; }; struct ethtool_modinfo { __u32 cmd ; __u32 type ; __u32 eeprom_len ; __u32 reserved[8U] ; }; struct ethtool_coalesce { __u32 cmd ; __u32 rx_coalesce_usecs ; __u32 rx_max_coalesced_frames ; __u32 rx_coalesce_usecs_irq ; __u32 rx_max_coalesced_frames_irq ; __u32 tx_coalesce_usecs ; __u32 tx_max_coalesced_frames ; __u32 tx_coalesce_usecs_irq ; __u32 tx_max_coalesced_frames_irq ; __u32 stats_block_coalesce_usecs ; __u32 use_adaptive_rx_coalesce ; __u32 use_adaptive_tx_coalesce ; __u32 pkt_rate_low ; __u32 rx_coalesce_usecs_low ; __u32 rx_max_coalesced_frames_low ; __u32 tx_coalesce_usecs_low ; __u32 tx_max_coalesced_frames_low ; __u32 pkt_rate_high ; __u32 rx_coalesce_usecs_high ; __u32 rx_max_coalesced_frames_high ; __u32 tx_coalesce_usecs_high ; __u32 tx_max_coalesced_frames_high ; __u32 rate_sample_interval ; }; struct ethtool_ringparam { __u32 cmd ; __u32 rx_max_pending ; __u32 rx_mini_max_pending ; __u32 rx_jumbo_max_pending ; __u32 tx_max_pending ; __u32 rx_pending ; __u32 rx_mini_pending ; __u32 rx_jumbo_pending ; __u32 tx_pending ; }; struct ethtool_channels { __u32 cmd ; __u32 max_rx ; __u32 max_tx ; __u32 max_other ; __u32 max_combined ; __u32 rx_count ; __u32 tx_count ; __u32 other_count ; __u32 combined_count ; }; struct ethtool_pauseparam { __u32 cmd ; __u32 autoneg ; __u32 rx_pause ; __u32 tx_pause ; }; struct ethtool_test { __u32 cmd ; __u32 flags ; __u32 reserved ; __u32 len ; __u64 data[0U] ; }; struct ethtool_stats { __u32 cmd ; __u32 n_stats ; __u64 data[0U] ; }; struct ethtool_tcpip4_spec { __be32 ip4src ; __be32 ip4dst ; __be16 psrc ; __be16 pdst ; __u8 tos ; }; struct ethtool_ah_espip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 spi ; __u8 tos ; }; struct ethtool_usrip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 l4_4_bytes ; __u8 tos ; __u8 ip_ver ; __u8 proto ; }; union ethtool_flow_union { struct ethtool_tcpip4_spec tcp_ip4_spec ; struct ethtool_tcpip4_spec udp_ip4_spec ; struct ethtool_tcpip4_spec sctp_ip4_spec ; struct ethtool_ah_espip4_spec ah_ip4_spec ; struct ethtool_ah_espip4_spec esp_ip4_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; struct ethhdr ether_spec ; __u8 hdata[60U] ; }; struct ethtool_flow_ext { __be16 vlan_etype ; __be16 vlan_tci ; __be32 data[2U] ; }; struct ethtool_rx_flow_spec { __u32 flow_type ; union ethtool_flow_union h_u ; struct ethtool_flow_ext h_ext ; union ethtool_flow_union m_u ; struct ethtool_flow_ext m_ext ; __u64 ring_cookie ; __u32 location ; }; struct ethtool_rxnfc { __u32 cmd ; __u32 flow_type ; __u64 data ; struct ethtool_rx_flow_spec fs ; __u32 rule_cnt ; __u32 rule_locs[0U] ; }; struct ethtool_flash { __u32 cmd ; __u32 region ; char data[128U] ; }; struct ethtool_dump { __u32 cmd ; __u32 version ; __u32 flag ; __u32 len ; __u8 data[0U] ; }; struct ethtool_ts_info { __u32 cmd ; __u32 so_timestamping ; __s32 phc_index ; __u32 tx_types ; __u32 tx_reserved[3U] ; __u32 rx_filters ; __u32 rx_reserved[3U] ; }; enum ethtool_phys_id_state { ETHTOOL_ID_INACTIVE = 0, ETHTOOL_ID_ACTIVE = 1, ETHTOOL_ID_ON = 2, ETHTOOL_ID_OFF = 3 } ; struct ethtool_ops { int (*get_settings)(struct net_device * , struct ethtool_cmd * ) ; int (*set_settings)(struct net_device * , struct ethtool_cmd * ) ; void (*get_drvinfo)(struct net_device * , struct ethtool_drvinfo * ) ; int (*get_regs_len)(struct net_device * ) ; void (*get_regs)(struct net_device * , struct ethtool_regs * , void * ) ; void (*get_wol)(struct net_device * , struct ethtool_wolinfo * ) ; int (*set_wol)(struct net_device * , struct ethtool_wolinfo * ) ; u32 (*get_msglevel)(struct net_device * ) ; void (*set_msglevel)(struct net_device * , u32 ) ; int (*nway_reset)(struct net_device * ) ; u32 (*get_link)(struct net_device * ) ; int (*get_eeprom_len)(struct net_device * ) ; int (*get_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*set_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*get_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; int (*set_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; void (*get_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; int (*set_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; void (*get_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) ; int (*set_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) ; void (*self_test)(struct net_device * , struct ethtool_test * , u64 * ) ; void (*get_strings)(struct net_device * , u32 , u8 * ) ; int (*set_phys_id)(struct net_device * , enum ethtool_phys_id_state ) ; void (*get_ethtool_stats)(struct net_device * , struct ethtool_stats * , u64 * ) ; int (*begin)(struct net_device * ) ; void (*complete)(struct net_device * ) ; u32 (*get_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 * , u32 * ) ; int (*set_rxnfc)(struct net_device * , struct ethtool_rxnfc * ) ; int (*flash_device)(struct net_device * , struct ethtool_flash * ) ; int (*reset)(struct net_device * , u32 * ) ; u32 (*get_rxfh_indir_size)(struct net_device * ) ; int (*get_rxfh_indir)(struct net_device * , u32 * ) ; int (*set_rxfh_indir)(struct net_device * , u32 const * ) ; void (*get_channels)(struct net_device * , struct ethtool_channels * ) ; int (*set_channels)(struct net_device * , struct ethtool_channels * ) ; int (*get_dump_flag)(struct net_device * , struct ethtool_dump * ) ; int (*get_dump_data)(struct net_device * , struct ethtool_dump * , void * ) ; int (*set_dump)(struct net_device * , struct ethtool_dump * ) ; int (*get_ts_info)(struct net_device * , struct ethtool_ts_info * ) ; int (*get_module_info)(struct net_device * , struct ethtool_modinfo * ) ; int (*get_module_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; }; struct prot_inuse; struct netns_core { struct ctl_table_header *sysctl_hdr ; int sysctl_somaxconn ; struct prot_inuse *inuse ; }; struct u64_stats_sync { }; struct ipstats_mib { u64 mibs[31U] ; struct u64_stats_sync syncp ; }; struct icmp_mib { unsigned long mibs[27U] ; }; struct icmpmsg_mib { atomic_long_t mibs[512U] ; }; struct icmpv6_mib { unsigned long mibs[5U] ; }; struct icmpv6_mib_device { atomic_long_t mibs[5U] ; }; struct icmpv6msg_mib { atomic_long_t mibs[512U] ; }; struct icmpv6msg_mib_device { atomic_long_t mibs[512U] ; }; struct tcp_mib { unsigned long mibs[15U] ; }; struct udp_mib { unsigned long mibs[7U] ; }; struct linux_mib { unsigned long mibs[83U] ; }; struct linux_xfrm_mib { unsigned long mibs[27U] ; }; struct netns_mib { struct tcp_mib *tcp_statistics[1U] ; struct ipstats_mib *ip_statistics[1U] ; struct linux_mib *net_statistics[1U] ; struct udp_mib *udp_statistics[1U] ; struct udp_mib *udplite_statistics[1U] ; struct icmp_mib *icmp_statistics[1U] ; struct icmpmsg_mib *icmpmsg_statistics ; struct proc_dir_entry *proc_net_devsnmp6 ; struct udp_mib *udp_stats_in6[1U] ; struct udp_mib *udplite_stats_in6[1U] ; struct ipstats_mib *ipv6_statistics[1U] ; struct icmpv6_mib *icmpv6_statistics[1U] ; struct icmpv6msg_mib *icmpv6msg_statistics ; struct linux_xfrm_mib *xfrm_statistics[1U] ; }; struct netns_unix { int sysctl_max_dgram_qlen ; struct ctl_table_header *ctl ; }; struct netns_packet { spinlock_t sklist_lock ; struct hlist_head sklist ; }; struct netns_frags { int nqueues ; atomic_t mem ; struct list_head lru_list ; int timeout ; int high_thresh ; int low_thresh ; }; struct ipv4_devconf; struct fib_rules_ops; struct xt_table; struct netns_ipv4 { struct ctl_table_header *forw_hdr ; struct ctl_table_header *frags_hdr ; struct ctl_table_header *ipv4_hdr ; struct ctl_table_header *route_hdr ; struct ipv4_devconf *devconf_all ; struct ipv4_devconf *devconf_dflt ; struct fib_rules_ops *rules_ops ; struct hlist_head *fib_table_hash ; struct sock *fibnl ; struct sock **icmp_sk ; struct sock *tcp_sock ; struct netns_frags frags ; struct xt_table *iptable_filter ; struct xt_table *iptable_mangle ; struct xt_table *iptable_raw ; struct xt_table *arptable_filter ; struct xt_table *iptable_security ; struct xt_table *nat_table ; struct hlist_head *nat_bysource ; unsigned int nat_htable_size ; int sysctl_icmp_echo_ignore_all ; int sysctl_icmp_echo_ignore_broadcasts ; int sysctl_icmp_ignore_bogus_error_responses ; int sysctl_icmp_ratelimit ; int sysctl_icmp_ratemask ; int sysctl_icmp_errors_use_inbound_ifaddr ; int sysctl_rt_cache_rebuild_count ; int current_rt_cache_rebuild_count ; unsigned int sysctl_ping_group_range[2U] ; long sysctl_tcp_mem[3U] ; atomic_t rt_genid ; atomic_t dev_addr_genid ; struct list_head mr_tables ; struct fib_rules_ops *mr_rules_ops ; }; struct neighbour; struct dst_ops { unsigned short family ; __be16 protocol ; unsigned int gc_thresh ; int (*gc)(struct dst_ops * ) ; struct dst_entry *(*check)(struct dst_entry * , __u32 ) ; unsigned int (*default_advmss)(struct dst_entry const * ) ; unsigned int (*mtu)(struct dst_entry const * ) ; u32 *(*cow_metrics)(struct dst_entry * , unsigned long ) ; void (*destroy)(struct dst_entry * ) ; void (*ifdown)(struct dst_entry * , struct net_device * , int ) ; struct dst_entry *(*negative_advice)(struct dst_entry * ) ; void (*link_failure)(struct sk_buff * ) ; void (*update_pmtu)(struct dst_entry * , u32 ) ; int (*local_out)(struct sk_buff * ) ; struct neighbour *(*neigh_lookup)(struct dst_entry const * , void const * ) ; struct kmem_cache *kmem_cachep ; struct percpu_counter pcpuc_entries ; }; struct netns_sysctl_ipv6 { struct ctl_table_header *hdr ; struct ctl_table_header *route_hdr ; struct ctl_table_header *icmp_hdr ; 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_196 { __u8 u6_addr8[16U] ; __be16 u6_addr16[8U] ; __be32 u6_addr32[4U] ; }; struct in6_addr { union __anonunion_in6_u_196 in6_u ; }; typedef int read_proc_t(char * , char ** , off_t , int , int * , void * ); typedef int write_proc_t(struct file * , char const * , unsigned long , void * ); struct proc_dir_entry { unsigned int low_ino ; umode_t mode ; nlink_t nlink ; kuid_t uid ; kgid_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 ; struct completion *pde_unload_completion ; struct list_head pde_openers ; spinlock_t pde_unload_lock ; u8 namelen ; char name[] ; }; 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 nf_ct_event_notifier; struct nf_exp_event_notifier; 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 ; struct nf_ct_event_notifier *nf_conntrack_event_cb ; struct nf_exp_event_notifier *nf_expect_event_cb ; int sysctl_events ; unsigned int sysctl_events_retry_timeout ; int sysctl_acct ; int sysctl_tstamp ; int sysctl_checksum ; unsigned int sysctl_log_invalid ; int sysctl_auto_assign_helper ; bool auto_assign_helper_warned ; struct ctl_table_header *sysctl_header ; struct ctl_table_header *acct_sysctl_header ; struct ctl_table_header *tstamp_sysctl_header ; struct ctl_table_header *event_sysctl_header ; struct ctl_table_header *helper_sysctl_header ; char *slabname ; }; struct xfrm_policy_hash { struct hlist_head *table ; unsigned int hmask ; }; struct netns_xfrm { struct list_head state_all ; struct hlist_head *state_bydst ; struct hlist_head *state_bysrc ; struct hlist_head *state_byspi ; unsigned int state_hmask ; unsigned int state_num ; struct work_struct state_hash_work ; struct hlist_head state_gc_list ; struct work_struct state_gc_work ; wait_queue_head_t km_waitq ; struct list_head policy_all ; struct hlist_head *policy_byidx ; unsigned int policy_idx_hmask ; struct hlist_head policy_inexact[6U] ; struct xfrm_policy_hash policy_bydst[6U] ; unsigned int policy_count[6U] ; struct work_struct policy_hash_work ; struct sock *nlsk ; struct sock *nlsk_stash ; u32 sysctl_aevent_etime ; u32 sysctl_aevent_rseqth ; int sysctl_larval_drop ; u32 sysctl_acq_expires ; struct ctl_table_header *sysctl_hdr ; struct dst_ops xfrm4_dst_ops ; struct dst_ops xfrm6_dst_ops ; }; struct net_generic; struct netns_ipvs; struct net { atomic_t passive ; atomic_t count ; spinlock_t rules_mod_lock ; struct list_head list ; struct list_head cleanup_list ; struct list_head exit_list ; struct proc_dir_entry *proc_net ; struct proc_dir_entry *proc_net_stat ; struct ctl_table_set sysctls ; struct sock *rtnl ; struct sock *genl_sock ; struct list_head dev_base_head ; struct hlist_head *dev_name_head ; struct hlist_head *dev_index_head ; unsigned int dev_base_seq ; struct list_head rules_ops ; struct net_device *loopback_dev ; struct netns_core core ; struct netns_mib mib ; struct netns_packet packet ; struct netns_unix unx ; struct netns_ipv4 ipv4 ; struct netns_ipv6 ipv6 ; struct netns_dccp dccp ; struct netns_xt xt ; struct netns_ct ct ; struct sock *nfnl ; struct sock *nfnl_stash ; struct sk_buff_head wext_nlevents ; struct net_generic *gen ; struct netns_xfrm xfrm ; struct netns_ipvs *ipvs ; }; struct seq_file { char *buf ; size_t size ; size_t from ; size_t count ; loff_t index ; loff_t read_pos ; u64 version ; struct mutex lock ; struct seq_operations const *op ; int poll_event ; 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 dsa_chip_data { struct device *mii_bus ; int sw_addr ; char *port_names[12U] ; s8 *rtable ; }; struct dsa_platform_data { struct device *netdev ; int nr_chips ; struct dsa_chip_data *chip ; }; struct dsa_switch; struct dsa_switch_tree { struct dsa_platform_data *pd ; struct net_device *master_netdev ; __be16 tag_protocol ; s8 cpu_switch ; s8 cpu_port ; int link_poll_needed ; struct work_struct link_poll_work ; struct timer_list link_poll_timer ; struct dsa_switch *ds[4U] ; }; struct dsa_switch_driver; struct mii_bus; struct dsa_switch { struct dsa_switch_tree *dst ; int index ; struct dsa_chip_data *pd ; struct dsa_switch_driver *drv ; struct mii_bus *master_mii_bus ; u32 dsa_port_mask ; u32 phys_port_mask ; struct mii_bus *slave_mii_bus ; struct net_device *ports[12U] ; }; struct dsa_switch_driver { struct list_head list ; __be16 tag_protocol ; int priv_size ; char *(*probe)(struct mii_bus * , int ) ; int (*setup)(struct dsa_switch * ) ; int (*set_addr)(struct dsa_switch * , u8 * ) ; int (*phy_read)(struct dsa_switch * , int , int ) ; int (*phy_write)(struct dsa_switch * , int , int , u16 ) ; void (*poll_link)(struct dsa_switch * ) ; void (*get_strings)(struct dsa_switch * , int , uint8_t * ) ; void (*get_ethtool_stats)(struct dsa_switch * , int , uint64_t * ) ; int (*get_sset_count)(struct dsa_switch * ) ; }; struct ieee_ets { __u8 willing ; __u8 ets_cap ; __u8 cbs ; __u8 tc_tx_bw[8U] ; __u8 tc_rx_bw[8U] ; __u8 tc_tsa[8U] ; __u8 prio_tc[8U] ; __u8 tc_reco_bw[8U] ; __u8 tc_reco_tsa[8U] ; __u8 reco_prio_tc[8U] ; }; struct ieee_maxrate { __u64 tc_maxrate[8U] ; }; struct ieee_pfc { __u8 pfc_cap ; __u8 pfc_en ; __u8 mbc ; __u16 delay ; __u64 requests[8U] ; __u64 indications[8U] ; }; struct cee_pg { __u8 willing ; __u8 error ; __u8 pg_en ; __u8 tcs_supported ; __u8 pg_bw[8U] ; __u8 prio_pg[8U] ; }; struct cee_pfc { __u8 willing ; __u8 error ; __u8 pfc_en ; __u8 tcs_supported ; }; struct dcb_app { __u8 selector ; __u8 priority ; __u16 protocol ; }; struct dcb_peer_app_info { __u8 willing ; __u8 error ; }; struct dcbnl_rtnl_ops { int (*ieee_getets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_setets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_getmaxrate)(struct net_device * , struct ieee_maxrate * ) ; int (*ieee_setmaxrate)(struct net_device * , struct ieee_maxrate * ) ; int (*ieee_getpfc)(struct net_device * , struct ieee_pfc * ) ; int (*ieee_setpfc)(struct net_device * , struct ieee_pfc * ) ; int (*ieee_getapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_setapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_delapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_peer_getets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_peer_getpfc)(struct net_device * , struct ieee_pfc * ) ; u8 (*getstate)(struct net_device * ) ; u8 (*setstate)(struct net_device * , u8 ) ; void (*getpermhwaddr)(struct net_device * , u8 * ) ; void (*setpgtccfgtx)(struct net_device * , int , u8 , u8 , u8 , u8 ) ; void (*setpgbwgcfgtx)(struct net_device * , int , u8 ) ; void (*setpgtccfgrx)(struct net_device * , int , u8 , u8 , u8 , u8 ) ; void (*setpgbwgcfgrx)(struct net_device * , int , u8 ) ; void (*getpgtccfgtx)(struct net_device * , int , u8 * , u8 * , u8 * , u8 * ) ; void (*getpgbwgcfgtx)(struct net_device * , int , u8 * ) ; void (*getpgtccfgrx)(struct net_device * , int , u8 * , u8 * , u8 * , u8 * ) ; void (*getpgbwgcfgrx)(struct net_device * , int , u8 * ) ; void (*setpfccfg)(struct net_device * , int , u8 ) ; void (*getpfccfg)(struct net_device * , int , u8 * ) ; u8 (*setall)(struct net_device * ) ; u8 (*getcap)(struct net_device * , int , u8 * ) ; int (*getnumtcs)(struct net_device * , int , u8 * ) ; int (*setnumtcs)(struct net_device * , int , u8 ) ; u8 (*getpfcstate)(struct net_device * ) ; void (*setpfcstate)(struct net_device * , u8 ) ; void (*getbcncfg)(struct net_device * , int , u32 * ) ; void (*setbcncfg)(struct net_device * , int , u32 ) ; void (*getbcnrp)(struct net_device * , int , u8 * ) ; void (*setbcnrp)(struct net_device * , int , u8 ) ; u8 (*setapp)(struct net_device * , u8 , u16 , u8 ) ; u8 (*getapp)(struct net_device * , u8 , u16 ) ; u8 (*getfeatcfg)(struct net_device * , int , u8 * ) ; u8 (*setfeatcfg)(struct net_device * , int , u8 ) ; u8 (*getdcbx)(struct net_device * ) ; u8 (*setdcbx)(struct net_device * , u8 ) ; int (*peer_getappinfo)(struct net_device * , struct dcb_peer_app_info * , u16 * ) ; int (*peer_getapptable)(struct net_device * , struct dcb_app * ) ; int (*cee_peer_getpg)(struct net_device * , struct cee_pg * ) ; int (*cee_peer_getpfc)(struct net_device * , struct cee_pfc * ) ; }; struct 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 idr_layer { unsigned long bitmap ; struct idr_layer *ary[64U] ; int count ; int layer ; struct rcu_head rcu_head ; }; struct idr { struct idr_layer *top ; struct idr_layer *id_free ; int layers ; int id_free_cnt ; spinlock_t lock ; }; struct cgroupfs_root; struct cgroup_subsys; struct cgroup; struct css_id; struct cgroup_subsys_state { struct cgroup *cgroup ; atomic_t refcnt ; unsigned long flags ; struct css_id *id ; struct work_struct dput_work ; }; struct cgroup { unsigned long flags ; atomic_t count ; struct list_head sibling ; struct list_head children ; struct list_head files ; 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 allcg_node ; struct list_head cft_q_node ; 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 ; }; struct cgroup_map_cb { int (*fill)(struct cgroup_map_cb * , char const * , u64 ) ; void *state ; }; struct cftype { char name[64U] ; int private ; umode_t mode ; size_t max_write_len ; unsigned int flags ; int (*open)(struct inode * , struct file * ) ; ssize_t (*read)(struct cgroup * , struct cftype * , struct file * , char * , size_t , loff_t * ) ; u64 (*read_u64)(struct cgroup * , struct cftype * ) ; s64 (*read_s64)(struct cgroup * , struct cftype * ) ; int (*read_map)(struct cgroup * , struct cftype * , struct cgroup_map_cb * ) ; int (*read_seq_string)(struct cgroup * , struct cftype * , struct seq_file * ) ; ssize_t (*write)(struct cgroup * , struct cftype * , struct file * , char const * , size_t , loff_t * ) ; int (*write_u64)(struct cgroup * , struct cftype * , u64 ) ; int (*write_s64)(struct cgroup * , struct cftype * , s64 ) ; int (*write_string)(struct cgroup * , struct cftype * , char const * ) ; int (*trigger)(struct cgroup * , unsigned int ) ; int (*release)(struct inode * , struct file * ) ; int (*register_event)(struct cgroup * , struct cftype * , struct eventfd_ctx * , char const * ) ; void (*unregister_event)(struct cgroup * , struct cftype * , struct eventfd_ctx * ) ; }; struct cftype_set { struct list_head node ; struct cftype const *cfts ; }; struct cgroup_taskset; struct cgroup_subsys { struct cgroup_subsys_state *(*create)(struct cgroup * ) ; int (*pre_destroy)(struct cgroup * ) ; void (*destroy)(struct cgroup * ) ; int (*can_attach)(struct cgroup * , struct cgroup_taskset * ) ; void (*cancel_attach)(struct cgroup * , struct cgroup_taskset * ) ; void (*attach)(struct cgroup * , struct cgroup_taskset * ) ; void (*fork)(struct task_struct * ) ; void (*exit)(struct cgroup * , struct cgroup * , struct task_struct * ) ; void (*post_clone)(struct cgroup * ) ; void (*bind)(struct cgroup * ) ; int subsys_id ; int active ; int disabled ; int early_init ; bool use_id ; bool __DEPRECATED_clear_css_refs ; char const *name ; struct mutex hierarchy_mutex ; struct lock_class_key subsys_key ; struct cgroupfs_root *root ; struct list_head sibling ; struct idr idr ; spinlock_t id_lock ; struct list_head cftsets ; struct cftype *base_cftypes ; struct cftype_set base_cftset ; struct module *module ; }; struct netprio_map { struct rcu_head rcu ; u32 priomap_len ; u32 priomap[] ; }; struct ndmsg { __u8 ndm_family ; __u8 ndm_pad1 ; __u16 ndm_pad2 ; __s32 ndm_ifindex ; __u16 ndm_state ; __u8 ndm_flags ; __u8 ndm_type ; }; 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 neigh_parms; struct netdev_hw_addr_list { struct list_head list ; int count ; }; struct hh_cache { u16 hh_len ; u16 __pad ; 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 * , __be16 ) ; void (*cache_update)(struct hh_cache * , struct net_device const * , unsigned char const * ) ; }; enum rx_handler_result { RX_HANDLER_CONSUMED = 0, RX_HANDLER_ANOTHER = 1, RX_HANDLER_EXACT = 2, RX_HANDLER_PASS = 3 } ; typedef enum rx_handler_result rx_handler_result_t; typedef rx_handler_result_t rx_handler_func_t(struct sk_buff ** ); struct Qdisc; struct netdev_queue { struct net_device *dev ; struct Qdisc *qdisc ; struct Qdisc *qdisc_sleeping ; struct kobject kobj ; int numa_node ; spinlock_t _xmit_lock ; int xmit_lock_owner ; unsigned long trans_start ; unsigned long trans_timeout ; unsigned long state ; struct dql dql ; }; struct rps_map { unsigned int len ; struct rcu_head rcu ; u16 cpus[0U] ; }; struct rps_dev_flow { u16 cpu ; u16 filter ; unsigned int last_qtail ; }; struct rps_dev_flow_table { unsigned int mask ; struct rcu_head rcu ; struct work_struct free_work ; struct rps_dev_flow flows[0U] ; }; struct netdev_rx_queue { struct rps_map *rps_map ; struct rps_dev_flow_table *rps_flow_table ; struct kobject kobj ; struct net_device *dev ; }; struct xps_map { unsigned int len ; unsigned int alloc_len ; struct rcu_head rcu ; u16 queues[0U] ; }; struct xps_dev_maps { struct rcu_head rcu ; struct xps_map *cpu_map[0U] ; }; struct netdev_tc_txq { u16 count ; u16 offset ; }; struct netdev_fcoe_hbainfo { char manufacturer[64U] ; char serial_number[64U] ; char hardware_version[64U] ; char driver_version[64U] ; char optionrom_version[64U] ; char firmware_version[64U] ; char model[256U] ; char model_description[256U] ; }; 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 * ) ; 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 * ) ; int (*ndo_vlan_rx_add_vid)(struct net_device * , unsigned short ) ; int (*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_set_vf_spoofchk)(struct net_device * , int , bool ) ; int (*ndo_get_vf_config)(struct net_device * , int , struct ifla_vf_info * ) ; int (*ndo_set_vf_port)(struct net_device * , int , struct nlattr ** ) ; int (*ndo_get_vf_port)(struct net_device * , int , struct sk_buff * ) ; int (*ndo_setup_tc)(struct net_device * , u8 ) ; int (*ndo_fcoe_enable)(struct net_device * ) ; int (*ndo_fcoe_disable)(struct net_device * ) ; int (*ndo_fcoe_ddp_setup)(struct net_device * , u16 , struct scatterlist * , unsigned int ) ; int (*ndo_fcoe_ddp_done)(struct net_device * , u16 ) ; int (*ndo_fcoe_ddp_target)(struct net_device * , u16 , struct scatterlist * , unsigned int ) ; int (*ndo_fcoe_get_hbainfo)(struct net_device * , struct netdev_fcoe_hbainfo * ) ; int (*ndo_fcoe_get_wwn)(struct net_device * , u64 * , int ) ; int (*ndo_rx_flow_steer)(struct net_device * , struct sk_buff const * , u16 , u32 ) ; int (*ndo_add_slave)(struct net_device * , struct net_device * ) ; int (*ndo_del_slave)(struct net_device * , struct net_device * ) ; netdev_features_t (*ndo_fix_features)(struct net_device * , netdev_features_t ) ; int (*ndo_set_features)(struct net_device * , netdev_features_t ) ; int (*ndo_neigh_construct)(struct neighbour * ) ; void (*ndo_neigh_destroy)(struct neighbour * ) ; int (*ndo_fdb_add)(struct ndmsg * , struct net_device * , unsigned char * , u16 ) ; int (*ndo_fdb_del)(struct ndmsg * , struct net_device * , unsigned char * ) ; int (*ndo_fdb_dump)(struct sk_buff * , struct netlink_callback * , struct net_device * , int ) ; }; struct iw_handler_def; struct iw_public_data; struct vlan_info; struct in_device; struct dn_dev; struct inet6_dev; struct cpu_rmap; struct pcpu_lstats; struct pcpu_tstats; struct pcpu_dstats; union __anonunion_ldv_32977_203 { void *ml_priv ; struct pcpu_lstats *lstats ; struct pcpu_tstats *tstats ; struct pcpu_dstats *dstats ; }; struct garp_port; struct rtnl_link_ops; struct net_device { char name[16U] ; struct pm_qos_request pm_qos_req ; struct hlist_node name_hlist ; char *ifalias ; unsigned long mem_end ; unsigned long mem_start ; unsigned long base_addr ; unsigned int irq ; unsigned long state ; struct list_head dev_list ; struct list_head napi_list ; struct list_head unreg_list ; netdev_features_t features ; netdev_features_t hw_features ; netdev_features_t wanted_features ; netdev_features_t vlan_features ; int ifindex ; int iflink ; struct net_device_stats stats ; atomic_long_t rx_dropped ; struct iw_handler_def const *wireless_handlers ; struct iw_public_data *wireless_data ; struct net_device_ops const *netdev_ops ; struct ethtool_ops const *ethtool_ops ; struct header_ops const *header_ops ; unsigned int flags ; unsigned int priv_flags ; unsigned short gflags ; unsigned short padded ; unsigned char operstate ; unsigned char link_mode ; unsigned char if_port ; unsigned char dma ; unsigned int mtu ; unsigned short type ; unsigned short hard_header_len ; unsigned short needed_headroom ; unsigned short needed_tailroom ; unsigned char perm_addr[32U] ; unsigned char addr_assign_type ; unsigned char addr_len ; unsigned char neigh_priv_len ; unsigned short dev_id ; spinlock_t addr_list_lock ; struct netdev_hw_addr_list uc ; struct netdev_hw_addr_list mc ; bool uc_promisc ; unsigned int promiscuity ; unsigned int allmulti ; struct vlan_info *vlan_info ; struct dsa_switch_tree *dsa_ptr ; void *atalk_ptr ; struct in_device *ip_ptr ; struct dn_dev *dn_ptr ; struct inet6_dev *ip6_ptr ; void *ax25_ptr ; struct wireless_dev *ieee80211_ptr ; unsigned long last_rx ; struct net_device *master ; unsigned char *dev_addr ; struct netdev_hw_addr_list dev_addrs ; unsigned char broadcast[32U] ; struct kset *queues_kset ; struct netdev_rx_queue *_rx ; unsigned int num_rx_queues ; unsigned int real_num_rx_queues ; struct cpu_rmap *rx_cpu_rmap ; rx_handler_func_t *rx_handler ; void *rx_handler_data ; struct netdev_queue *ingress_queue ; struct netdev_queue *_tx ; unsigned int num_tx_queues ; unsigned int real_num_tx_queues ; struct Qdisc *qdisc ; unsigned long tx_queue_len ; spinlock_t tx_global_lock ; struct xps_dev_maps *xps_maps ; unsigned long trans_start ; int watchdog_timeo ; struct timer_list watchdog_timer ; int *pcpu_refcnt ; struct list_head todo_list ; struct hlist_node index_hlist ; struct list_head link_watch_list ; unsigned char reg_state ; bool dismantle ; unsigned short rtnl_link_state ; void (*destructor)(struct net_device * ) ; struct netpoll_info *npinfo ; struct net *nd_net ; union __anonunion_ldv_32977_203 ldv_32977 ; struct garp_port *garp_port ; struct device dev ; struct attribute_group const *sysfs_groups[4U] ; struct rtnl_link_ops const *rtnl_link_ops ; unsigned int gso_max_size ; struct dcbnl_rtnl_ops const *dcbnl_ops ; u8 num_tc ; struct netdev_tc_txq tc_to_txq[16U] ; u8 prio_tc_map[16U] ; unsigned int fcoe_ddp_xid ; struct netprio_map *priomap ; struct phy_device *phydev ; int group ; }; struct xfrm_policy; struct xfrm_state; struct request_sock; struct res_counter { unsigned long long usage ; unsigned long long max_usage ; unsigned long long limit ; unsigned long long soft_limit ; unsigned long long failcnt ; spinlock_t lock ; struct res_counter *parent ; }; struct sock_filter { __u16 code ; __u8 jt ; __u8 jf ; __u32 k ; }; struct sk_filter { atomic_t refcnt ; unsigned int len ; unsigned int (*bpf_func)(struct sk_buff const * , struct sock_filter const * ) ; struct rcu_head rcu ; struct sock_filter insns[0U] ; }; struct pollfd { int fd ; short events ; short revents ; }; struct poll_table_struct { void (*_qproc)(struct file * , wait_queue_head_t * , struct poll_table_struct * ) ; unsigned long _key ; }; struct nla_policy { u16 type ; u16 len ; }; struct rtnl_link_ops { struct list_head list ; char const *kind ; size_t priv_size ; void (*setup)(struct net_device * ) ; int maxtype ; struct nla_policy const *policy ; int (*validate)(struct nlattr ** , struct nlattr ** ) ; int (*newlink)(struct net * , struct net_device * , struct nlattr ** , struct nlattr ** ) ; int (*changelink)(struct net_device * , struct nlattr ** , struct nlattr ** ) ; void (*dellink)(struct net_device * , struct list_head * ) ; size_t (*get_size)(struct net_device const * ) ; int (*fill_info)(struct sk_buff * , struct net_device const * ) ; size_t (*get_xstats_size)(struct net_device const * ) ; int (*fill_xstats)(struct sk_buff * , struct net_device const * ) ; int (*get_tx_queues)(struct net * , struct nlattr ** ) ; }; 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_bytes ; int ucast_probes ; int app_probes ; int mcast_probes ; int anycast_delay ; int proxy_delay ; int proxy_qlen ; int locktime ; }; struct neigh_statistics { unsigned long allocs ; unsigned long destroys ; unsigned long hash_grows ; unsigned long res_failed ; unsigned long lookups ; unsigned long hits ; unsigned long rcv_probes_mcast ; unsigned long rcv_probes_ucast ; unsigned long periodic_gc_runs ; unsigned long forced_gc_runs ; unsigned long unres_discards ; }; struct neigh_ops; struct neighbour { struct neighbour *next ; struct neigh_table *tbl ; struct neigh_parms *parms ; unsigned long confirmed ; unsigned long updated ; rwlock_t lock ; atomic_t refcnt ; struct sk_buff_head arp_queue ; unsigned int arp_queue_len_bytes ; struct timer_list timer ; unsigned long used ; atomic_t probes ; __u8 flags ; __u8 nud_state ; __u8 type ; __u8 dead ; seqlock_t ha_lock ; unsigned char ha[32U] ; struct hh_cache hh ; int (*output)(struct neighbour * , struct sk_buff * ) ; struct neigh_ops const *ops ; struct rcu_head rcu ; struct net_device *dev ; u8 primary_key[0U] ; }; struct neigh_ops { int family ; void (*solicit)(struct neighbour * , struct sk_buff * ) ; void (*error_report)(struct neighbour * , struct sk_buff * ) ; int (*output)(struct neighbour * , struct sk_buff * ) ; int (*connected_output)(struct neighbour * , struct sk_buff * ) ; }; struct pneigh_entry { struct pneigh_entry *next ; struct net *net ; struct net_device *dev ; u8 flags ; u8 key[0U] ; }; struct neigh_hash_table { struct neighbour **hash_buckets ; unsigned int hash_shift ; __u32 hash_rnd[4U] ; struct rcu_head rcu ; }; struct neigh_table { struct neigh_table *next ; int family ; int entry_size ; int key_len ; __u32 (*hash)(void const * , struct net_device const * , __u32 * ) ; int (*constructor)(struct neighbour * ) ; int (*pconstructor)(struct pneigh_entry * ) ; void (*pdestructor)(struct pneigh_entry * ) ; void (*proxy_redo)(struct sk_buff * ) ; char *id ; struct neigh_parms parms ; int gc_interval ; int gc_thresh1 ; int gc_thresh2 ; int gc_thresh3 ; unsigned long last_flush ; struct delayed_work gc_work ; struct timer_list proxy_timer ; struct sk_buff_head proxy_queue ; atomic_t entries ; rwlock_t lock ; unsigned long last_rand ; struct neigh_statistics *stats ; struct neigh_hash_table *nht ; struct pneigh_entry **phash_buckets ; }; union __anonunion_ldv_37150_208 { unsigned long expires ; struct dst_entry *from ; }; struct dn_route; union __anonunion_ldv_37174_209 { struct dst_entry *next ; struct rtable *rt_next ; struct rt6_info *rt6_next ; struct dn_route *dn_next ; }; struct dst_entry { struct rcu_head rcu_head ; struct dst_entry *child ; struct net_device *dev ; struct dst_ops *ops ; unsigned long _metrics ; union __anonunion_ldv_37150_208 ldv_37150 ; struct dst_entry *path ; struct neighbour *_neighbour ; struct xfrm_state *xfrm ; int (*input)(struct sk_buff * ) ; int (*output)(struct sk_buff * ) ; int flags ; short error ; short obsolete ; unsigned short header_len ; unsigned short trailer_len ; __u32 tclassid ; long __pad_to_align_refcnt[2U] ; atomic_t __refcnt ; int __use ; unsigned long lastuse ; union __anonunion_ldv_37174_209 ldv_37174 ; }; struct __anonstruct_socket_lock_t_210 { spinlock_t slock ; int owned ; wait_queue_head_t wq ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_socket_lock_t_210 socket_lock_t; struct proto; union __anonunion_ldv_37401_211 { unsigned int skc_hash ; __u16 skc_u16hashes[2U] ; }; union __anonunion_ldv_37409_212 { struct hlist_node skc_bind_node ; struct hlist_nulls_node skc_portaddr_node ; }; union __anonunion_ldv_37416_213 { struct hlist_node skc_node ; struct hlist_nulls_node skc_nulls_node ; }; struct sock_common { __be32 skc_daddr ; __be32 skc_rcv_saddr ; union __anonunion_ldv_37401_211 ldv_37401 ; unsigned short skc_family ; unsigned char volatile skc_state ; unsigned char skc_reuse ; int skc_bound_dev_if ; union __anonunion_ldv_37409_212 ldv_37409 ; struct proto *skc_prot ; struct net *skc_net ; int skc_dontcopy_begin[0U] ; union __anonunion_ldv_37416_213 ldv_37416 ; int skc_tx_queue_mapping ; atomic_t skc_refcnt ; int skc_dontcopy_end[0U] ; }; struct cg_proto; struct __anonstruct_sk_backlog_214 { atomic_t rmem_alloc ; int len ; struct sk_buff *head ; struct sk_buff *tail ; }; struct sock { struct sock_common __sk_common ; socket_lock_t sk_lock ; struct sk_buff_head sk_receive_queue ; struct __anonstruct_sk_backlog_214 sk_backlog ; int sk_forward_alloc ; __u32 sk_rxhash ; atomic_t sk_drops ; int sk_rcvbuf ; struct sk_filter *sk_filter ; struct socket_wq *sk_wq ; struct sk_buff_head sk_async_wait_queue ; struct xfrm_policy *sk_policy[2U] ; unsigned long sk_flags ; struct dst_entry *sk_dst_cache ; spinlock_t sk_dst_lock ; atomic_t sk_wmem_alloc ; atomic_t sk_omem_alloc ; int sk_sndbuf ; struct sk_buff_head sk_write_queue ; unsigned char sk_shutdown : 2 ; unsigned char sk_no_check : 2 ; unsigned char sk_userlocks : 4 ; unsigned char sk_protocol ; unsigned short sk_type ; int sk_wmem_queued ; gfp_t sk_allocation ; netdev_features_t sk_route_caps ; netdev_features_t sk_route_nocaps ; int sk_gso_type ; unsigned int sk_gso_max_size ; int sk_rcvlowat ; unsigned long sk_lingertime ; struct sk_buff_head sk_error_queue ; struct proto *sk_prot_creator ; rwlock_t sk_callback_lock ; int sk_err ; int sk_err_soft ; unsigned short sk_ack_backlog ; unsigned short sk_max_ack_backlog ; __u32 sk_priority ; __u32 sk_cgrp_prioidx ; struct pid *sk_peer_pid ; struct cred const *sk_peer_cred ; long sk_rcvtimeo ; long sk_sndtimeo ; void *sk_protinfo ; struct timer_list sk_timer ; ktime_t sk_stamp ; struct socket *sk_socket ; void *sk_user_data ; struct page *sk_sndmsg_page ; struct sk_buff *sk_send_head ; __u32 sk_sndmsg_off ; __s32 sk_peek_off ; int sk_write_pending ; void *sk_security ; __u32 sk_mark ; u32 sk_classid ; struct cg_proto *sk_cgrp ; 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_215 { struct inet_hashinfo *hashinfo ; struct udp_table *udp_table ; struct raw_hashinfo *raw_hash ; }; struct proto { void (*close)(struct sock * , long ) ; int (*connect)(struct sock * , struct sockaddr * , int ) ; int (*disconnect)(struct sock * , int ) ; struct sock *(*accept)(struct sock * , int , int * ) ; int (*ioctl)(struct sock * , int , unsigned long ) ; int (*init)(struct sock * ) ; void (*destroy)(struct sock * ) ; void (*shutdown)(struct sock * , int ) ; int (*setsockopt)(struct sock * , int , int , char * , unsigned int ) ; int (*getsockopt)(struct sock * , int , int , char * , int * ) ; int (*compat_setsockopt)(struct sock * , int , int , char * , unsigned int ) ; int (*compat_getsockopt)(struct sock * , int , int , char * , int * ) ; int (*compat_ioctl)(struct sock * , unsigned int , unsigned long ) ; int (*sendmsg)(struct kiocb * , struct sock * , struct msghdr * , size_t ) ; int (*recvmsg)(struct kiocb * , struct sock * , struct msghdr * , size_t , int , int , int * ) ; int (*sendpage)(struct sock * , struct page * , int , size_t , int ) ; int (*bind)(struct sock * , struct sockaddr * , int ) ; int (*backlog_rcv)(struct sock * , struct sk_buff * ) ; void (*hash)(struct sock * ) ; void (*unhash)(struct sock * ) ; void (*rehash)(struct sock * ) ; int (*get_port)(struct sock * , unsigned short ) ; void (*clear_sk)(struct sock * , int ) ; unsigned int inuse_idx ; void (*enter_memory_pressure)(struct sock * ) ; atomic_long_t *memory_allocated ; struct percpu_counter *sockets_allocated ; int *memory_pressure ; long *sysctl_mem ; int *sysctl_wmem ; int *sysctl_rmem ; int max_header ; bool no_autobind ; struct kmem_cache *slab ; unsigned int obj_size ; int slab_flags ; struct percpu_counter *orphan_count ; struct request_sock_ops *rsk_prot ; struct timewait_sock_ops *twsk_prot ; union __anonunion_h_215 h ; struct module *owner ; char name[32U] ; struct list_head node ; int (*init_cgroup)(struct mem_cgroup * , struct cgroup_subsys * ) ; void (*destroy_cgroup)(struct mem_cgroup * ) ; struct cg_proto *(*proto_cgroup)(struct mem_cgroup * ) ; }; struct cg_proto { void (*enter_memory_pressure)(struct sock * ) ; struct res_counter *memory_allocated ; struct percpu_counter *sockets_allocated ; int *memory_pressure ; long *sysctl_mem ; unsigned long flags ; struct mem_cgroup *memcg ; }; 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_38745_216 { 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_38745_216 ldv_38745 ; unsigned int i ; }; enum drbd_state_rv { SS_CW_NO_NEED = 4, SS_CW_SUCCESS = 3, SS_NOTHING_TO_DO = 2, SS_SUCCESS = 1, SS_UNKNOWN_ERROR = 0, SS_TWO_PRIMARIES = -1, SS_NO_UP_TO_DATE_DISK = -2, SS_NO_LOCAL_DISK = -4, SS_NO_REMOTE_DISK = -5, SS_CONNECTED_OUTDATES = -6, SS_PRIMARY_NOP = -7, SS_RESYNC_RUNNING = -8, SS_ALREADY_STANDALONE = -9, SS_CW_FAILED_BY_PEER = -10, SS_IS_DISKLESS = -11, SS_DEVICE_IN_USE = -12, SS_NO_NET_CONFIG = -13, SS_NO_VERIFY_ALG = -14, SS_NEED_CONNECTION = -15, SS_LOWER_THAN_OUTDATED = -16, SS_NOT_SUPPORTED = -17, SS_IN_TRANSIENT_STATE = -18, SS_CONCURRENT_ST_CHG = -19, SS_AFTER_LAST_ERROR = -20 } ; struct crypto_ablkcipher; struct crypto_async_request; struct crypto_aead; struct crypto_blkcipher; struct crypto_hash; struct crypto_rng; struct crypto_tfm; struct crypto_type; struct aead_givcrypt_request; struct skcipher_givcrypt_request; struct crypto_async_request { struct list_head list ; void (*complete)(struct crypto_async_request * , int ) ; void *data ; struct crypto_tfm *tfm ; u32 flags ; }; struct ablkcipher_request { struct crypto_async_request base ; unsigned int nbytes ; void *info ; struct scatterlist *src ; struct scatterlist *dst ; void *__ctx[] ; }; 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_217 { 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_217 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_218 { 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_218 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 inet_peer; struct timewait_sock_ops { struct kmem_cache *twsk_slab ; char *twsk_slab_name ; unsigned int twsk_obj_size ; int (*twsk_unique)(struct sock * , struct sock * , void * ) ; void (*twsk_destructor)(struct sock * ) ; void *(*twsk_getpeer)(struct sock * ) ; }; struct disk_stats { unsigned long sectors[2U] ; unsigned long ios[2U] ; unsigned long merges[2U] ; unsigned long ticks[2U] ; unsigned long io_ticks ; unsigned long time_in_queue ; }; struct partition_meta_info { u8 uuid[16U] ; u8 volname[64U] ; }; struct hd_struct { sector_t start_sect ; sector_t nr_sects ; sector_t alignment_offset ; unsigned int discard_alignment ; struct device __dev ; struct kobject *holder_dir ; int policy ; int partno ; struct partition_meta_info *info ; int make_it_fail ; unsigned long stamp ; atomic_t in_flight[2U] ; struct disk_stats *dkstats ; atomic_t ref ; struct rcu_head rcu_head ; }; struct disk_part_tbl { struct rcu_head rcu_head ; int len ; struct hd_struct *last_lookup ; struct hd_struct *part[] ; }; struct disk_events; struct blk_integrity; struct gendisk { int major ; int first_minor ; int minors ; char disk_name[32U] ; char *(*devnode)(struct gendisk * , umode_t * ) ; unsigned int events ; unsigned int async_events ; struct disk_part_tbl *part_tbl ; struct hd_struct part0 ; struct block_device_operations const *fops ; struct request_queue *queue ; void *private_data ; int flags ; struct device *driverfs_dev ; struct kobject *slave_dir ; struct timer_rand_state *random ; atomic_t sync_io ; struct disk_events *ev ; struct blk_integrity *integrity ; int node_id ; }; enum writeback_sync_modes { WB_SYNC_NONE = 0, WB_SYNC_ALL = 1 } ; struct writeback_control { long nr_to_write ; long pages_skipped ; loff_t range_start ; loff_t range_end ; enum writeback_sync_modes sync_mode ; unsigned char for_kupdate : 1 ; unsigned char for_background : 1 ; unsigned char tagged_writepages : 1 ; unsigned char for_reclaim : 1 ; unsigned char range_cyclic : 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 ; spinlock_t list_lock ; }; struct backing_dev_info { struct list_head bdi_list ; unsigned long ra_pages ; unsigned long state ; unsigned int capabilities ; congested_fn *congested_fn ; void *congested_data ; char *name ; struct percpu_counter bdi_stat[4U] ; unsigned long bw_time_stamp ; unsigned long dirtied_stamp ; unsigned long written_stamp ; unsigned long write_bandwidth ; unsigned long avg_write_bandwidth ; unsigned long dirty_ratelimit ; unsigned long balanced_dirty_ratelimit ; 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; union __anonunion_ldv_42056_225 { struct list_head q_node ; struct kmem_cache *__rcu_icq_cache ; }; union __anonunion_ldv_42060_226 { struct hlist_node ioc_node ; struct rcu_head __rcu_head ; }; struct io_cq { struct request_queue *q ; struct io_context *ioc ; union __anonunion_ldv_42056_225 ldv_42056 ; union __anonunion_ldv_42060_226 ldv_42060 ; unsigned int flags ; }; struct io_context { atomic_long_t refcount ; atomic_t active_ref ; atomic_t nr_tasks ; spinlock_t lock ; unsigned short ioprio ; int nr_batch_requests ; unsigned long last_waited ; struct radix_tree_root icq_tree ; struct io_cq *icq_hint ; struct hlist_head icq_list ; struct work_struct release_work ; }; 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; struct bsg_job; struct blkcg_gq; 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_42496_227 { struct rb_node rb_node ; void *completion_data ; }; struct __anonstruct_elv_229 { struct io_cq *icq ; void *priv[2U] ; }; struct __anonstruct_flush_230 { unsigned int seq ; struct list_head list ; rq_end_io_fn *saved_end_io ; }; union __anonunion_ldv_42507_228 { struct __anonstruct_elv_229 elv ; struct __anonstruct_flush_230 flush ; }; struct request { struct list_head queuelist ; struct call_single_data csd ; struct request_queue *q ; unsigned int cmd_flags ; enum rq_cmd_type_bits cmd_type ; unsigned long atomic_flags ; int cpu ; unsigned int __data_len ; sector_t __sector ; struct bio *bio ; struct bio *biotail ; struct hlist_node hash ; union __anonunion_ldv_42496_227 ldv_42496 ; union __anonunion_ldv_42507_228 ldv_42507 ; struct gendisk *rq_disk ; struct hd_struct *part ; unsigned long start_time ; unsigned long long start_time_ns ; unsigned long long io_start_time_ns ; unsigned short nr_phys_segments ; unsigned short nr_integrity_segments ; unsigned short ioprio ; int ref_count ; void *special ; char *buffer ; int tag ; int errors ; unsigned char __cmd[16U] ; unsigned char *cmd ; unsigned short cmd_len ; unsigned int extra_len ; unsigned int sense_len ; unsigned int resid_len ; void *sense ; unsigned long deadline ; struct list_head timeout_list ; unsigned int timeout ; int retries ; rq_end_io_fn *end_io ; void *end_io_data ; struct request *next_rq ; }; typedef int elevator_merge_fn(struct request_queue * , struct request ** , struct bio * ); typedef void elevator_merge_req_fn(struct request_queue * , struct request * , struct request * ); typedef void elevator_merged_fn(struct request_queue * , struct request * , int ); typedef int elevator_allow_merge_fn(struct request_queue * , struct request * , struct bio * ); typedef void elevator_bio_merged_fn(struct request_queue * , struct request * , struct bio * ); typedef int elevator_dispatch_fn(struct request_queue * , int ); typedef void elevator_add_req_fn(struct request_queue * , struct request * ); typedef struct request *elevator_request_list_fn(struct request_queue * , struct request * ); typedef void elevator_completed_req_fn(struct request_queue * , struct request * ); typedef int elevator_may_queue_fn(struct request_queue * , int ); typedef void elevator_init_icq_fn(struct io_cq * ); typedef void elevator_exit_icq_fn(struct io_cq * ); typedef int elevator_set_req_fn(struct request_queue * , struct request * , struct bio * , 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 int elevator_init_fn(struct request_queue * ); typedef void elevator_exit_fn(struct elevator_queue * ); struct elevator_ops { elevator_merge_fn *elevator_merge_fn ; elevator_merged_fn *elevator_merged_fn ; elevator_merge_req_fn *elevator_merge_req_fn ; elevator_allow_merge_fn *elevator_allow_merge_fn ; elevator_bio_merged_fn *elevator_bio_merged_fn ; elevator_dispatch_fn *elevator_dispatch_fn ; elevator_add_req_fn *elevator_add_req_fn ; elevator_activate_req_fn *elevator_activate_req_fn ; elevator_deactivate_req_fn *elevator_deactivate_req_fn ; elevator_completed_req_fn *elevator_completed_req_fn ; elevator_request_list_fn *elevator_former_req_fn ; elevator_request_list_fn *elevator_latter_req_fn ; elevator_init_icq_fn *elevator_init_icq_fn ; elevator_exit_icq_fn *elevator_exit_icq_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 ; }; 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 kmem_cache *icq_cache ; struct elevator_ops ops ; size_t icq_size ; size_t icq_align ; struct elv_fs_entry *elevator_attrs ; char elevator_name[16U] ; struct module *elevator_owner ; char icq_cache_name[21U] ; struct list_head list ; }; struct elevator_queue { struct elevator_type *type ; void *elevator_data ; struct kobject kobj ; struct mutex sysfs_lock ; struct hlist_head *hash ; unsigned char registered : 1 ; }; typedef void request_fn_proc(struct request_queue * ); typedef void make_request_fn(struct request_queue * , struct bio * ); typedef int prep_rq_fn(struct request_queue * , struct request * ); typedef void unprep_rq_fn(struct request_queue * , struct request * ); struct bvec_merge_data { struct block_device *bi_bdev ; sector_t bi_sector ; unsigned int bi_size ; unsigned long bi_rw ; }; typedef int merge_bvec_fn(struct request_queue * , struct bvec_merge_data * , struct bio_vec * ); typedef void softirq_done_fn(struct request * ); typedef int dma_drain_needed_fn(struct request * ); typedef int lld_busy_fn(struct request_queue * ); typedef int bsg_job_fn(struct bsg_job * ); enum blk_eh_timer_return { BLK_EH_NOT_HANDLED = 0, BLK_EH_HANDLED = 1, BLK_EH_RESET_TIMER = 2 } ; typedef enum blk_eh_timer_return rq_timed_out_fn(struct request * ); struct blk_queue_tag { struct request **tag_index ; unsigned long *tag_map ; int busy ; int max_depth ; int real_max_depth ; atomic_t refcnt ; }; struct queue_limits { unsigned long bounce_pfn ; unsigned long seg_boundary_mask ; unsigned int max_hw_sectors ; unsigned int max_sectors ; unsigned int max_segment_size ; unsigned int physical_block_size ; unsigned int alignment_offset ; unsigned int io_min ; unsigned int io_opt ; unsigned int max_discard_sectors ; unsigned int discard_granularity ; unsigned int discard_alignment ; unsigned short logical_block_size ; unsigned short max_segments ; unsigned short max_integrity_segments ; unsigned char misaligned ; unsigned char discard_misaligned ; unsigned char cluster ; unsigned char discard_zeroes_data ; }; struct throtl_data; struct request_queue { struct list_head queue_head ; struct request *last_merge ; struct elevator_queue *elevator ; struct request_list rq ; request_fn_proc *request_fn ; make_request_fn *make_request_fn ; prep_rq_fn *prep_rq_fn ; unprep_rq_fn *unprep_rq_fn ; merge_bvec_fn *merge_bvec_fn ; softirq_done_fn *softirq_done_fn ; rq_timed_out_fn *rq_timed_out_fn ; dma_drain_needed_fn *dma_drain_needed ; lld_busy_fn *lld_busy_fn ; sector_t end_sector ; struct request *boundary_rq ; struct delayed_work delay_work ; struct backing_dev_info backing_dev_info ; void *queuedata ; unsigned long queue_flags ; int id ; gfp_t bounce_gfp ; 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 ; unsigned int dma_drain_size ; void *dma_drain_buffer ; 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 list_head icq_list ; unsigned long blkcg_pols[1U] ; struct blkcg_gq *root_blkg ; struct list_head blkg_list ; struct queue_limits limits ; unsigned int sg_timeout ; unsigned int sg_reserved_size ; int node ; unsigned int flush_flags ; unsigned char flush_not_queueable : 1 ; unsigned char flush_queue_delayed : 1 ; unsigned char flush_pending_idx : 1 ; unsigned char flush_running_idx : 1 ; unsigned long flush_pending_since ; struct list_head flush_queue[2U] ; struct list_head flush_data_in_flight ; struct request flush_rq ; struct mutex sysfs_lock ; int bypass_depth ; bsg_job_fn *bsg_job_fn ; int bsg_job_size ; struct bsg_class_device bsg_dev ; struct list_head all_q_node ; struct throtl_data *td ; }; struct blk_plug { unsigned long magic ; struct list_head list ; struct list_head cb_list ; unsigned int should_sort ; }; struct blk_integrity_exchg { void *prot_buf ; void *data_buf ; sector_t sector ; unsigned int data_size ; unsigned short sector_size ; char const *disk_name ; }; typedef void integrity_gen_fn(struct blk_integrity_exchg * ); typedef int integrity_vrfy_fn(struct blk_integrity_exchg * ); typedef void integrity_set_tag_fn(void * , void * , unsigned int ); typedef void integrity_get_tag_fn(void * , void * , unsigned int ); struct blk_integrity { integrity_gen_fn *generate_fn ; integrity_vrfy_fn *verify_fn ; integrity_set_tag_fn *set_tag_fn ; integrity_get_tag_fn *get_tag_fn ; unsigned short flags ; unsigned short tuple_size ; unsigned short sector_size ; unsigned short tag_size ; char const *name ; struct kobject kobj ; }; struct block_device_operations { int (*open)(struct block_device * , fmode_t ) ; int (*release)(struct gendisk * , fmode_t ) ; int (*ioctl)(struct block_device * , fmode_t , unsigned int , unsigned long ) ; int (*compat_ioctl)(struct block_device * , fmode_t , unsigned int , unsigned long ) ; int (*direct_access)(struct block_device * , sector_t , void ** , unsigned long * ) ; unsigned int (*check_events)(struct gendisk * , unsigned int ) ; int (*media_changed)(struct gendisk * ) ; void (*unlock_native_capacity)(struct gendisk * ) ; int (*revalidate_disk)(struct gendisk * ) ; int (*getgeo)(struct block_device * , struct hd_geometry * ) ; void (*swap_slot_free_notify)(struct block_device * , unsigned long ) ; struct module *owner ; }; struct ipv6_devconf { __s32 forwarding ; __s32 hop_limit ; __s32 mtu6 ; __s32 accept_ra ; __s32 accept_redirects ; __s32 autoconf ; __s32 dad_transmits ; __s32 rtr_solicits ; __s32 rtr_solicit_interval ; __s32 rtr_solicit_delay ; __s32 force_mld_version ; __s32 use_tempaddr ; __s32 temp_valid_lft ; __s32 temp_prefered_lft ; __s32 regen_max_retry ; __s32 max_desync_factor ; __s32 max_addresses ; __s32 accept_ra_defrtr ; __s32 accept_ra_pinfo ; __s32 accept_ra_rtr_pref ; __s32 rtr_probe_interval ; __s32 accept_ra_rt_info_max_plen ; __s32 proxy_ndp ; __s32 accept_source_route ; __s32 optimistic_dad ; __s32 mc_forwarding ; __s32 disable_ipv6 ; __s32 accept_dad ; __s32 force_tllao ; void *sysctl ; }; struct ip6_sf_list { struct ip6_sf_list *sf_next ; struct in6_addr sf_addr ; unsigned long sf_count[2U] ; unsigned char sf_gsresp ; unsigned char sf_oldin ; unsigned char sf_crcount ; }; struct ifmcaddr6 { struct in6_addr mca_addr ; struct inet6_dev *idev ; struct ifmcaddr6 *next ; struct ip6_sf_list *mca_sources ; struct ip6_sf_list *mca_tomb ; unsigned int mca_sfmode ; unsigned char mca_crcount ; unsigned long mca_sfcount[2U] ; struct timer_list mca_timer ; unsigned int mca_flags ; int mca_users ; atomic_t mca_refcnt ; spinlock_t mca_lock ; unsigned long mca_cstamp ; unsigned long mca_tstamp ; }; struct ifacaddr6 { struct in6_addr aca_addr ; struct inet6_dev *aca_idev ; struct rt6_info *aca_rt ; struct ifacaddr6 *aca_next ; int aca_users ; atomic_t aca_refcnt ; spinlock_t aca_lock ; unsigned long aca_cstamp ; unsigned long aca_tstamp ; }; struct ipv6_devstat { struct proc_dir_entry *proc_dir_entry ; struct ipstats_mib *ipv6[1U] ; struct icmpv6_mib_device *icmpv6dev ; struct icmpv6msg_mib_device *icmpv6msgdev ; }; struct inet6_dev { struct net_device *dev ; struct list_head addr_list ; struct ifmcaddr6 *mc_list ; struct ifmcaddr6 *mc_tomb ; spinlock_t mc_lock ; unsigned char mc_qrv ; unsigned char mc_gq_running ; unsigned char mc_ifc_count ; unsigned long mc_v1_seen ; unsigned long mc_maxdelay ; struct timer_list mc_gq_timer ; struct timer_list mc_ifc_timer ; struct ifacaddr6 *ac_list ; rwlock_t lock ; atomic_t refcnt ; __u32 if_flags ; int dead ; u8 rndid[8U] ; struct timer_list regen_timer ; struct list_head tempaddr_list ; struct neigh_parms *nd_parms ; struct inet6_dev *next ; struct ipv6_devconf cnf ; struct ipv6_devstat stats ; unsigned long tstamp ; struct rcu_head rcu ; }; union __anonunion_ldv_45012_236 { __be32 a4 ; __be32 a6[4U] ; }; struct inetpeer_addr_base { union __anonunion_ldv_45012_236 ldv_45012 ; }; struct inetpeer_addr { struct inetpeer_addr_base addr ; __u16 family ; }; struct __anonstruct_ldv_45034_238 { atomic_t rid ; atomic_t ip_id_count ; __u32 tcp_ts ; __u32 tcp_ts_stamp ; }; union __anonunion_ldv_45037_237 { struct __anonstruct_ldv_45034_238 ldv_45034 ; struct rcu_head rcu ; struct inet_peer *gc_next ; }; struct inet_peer { struct inet_peer *avl_left ; struct inet_peer *avl_right ; struct inetpeer_addr daddr ; __u32 avl_height ; u32 metrics[14U] ; u32 rate_tokens ; unsigned long rate_last ; unsigned long pmtu_expires ; u32 pmtu_orig ; u32 pmtu_learned ; struct inetpeer_addr_base redirect_learned ; struct list_head gc_list ; union __anonunion_ldv_45037_237 ldv_45037 ; __u32 dtime ; atomic_t refcnt ; }; struct fib_info; struct rtable { struct dst_entry dst ; __be32 rt_key_dst ; __be32 rt_key_src ; int rt_genid ; unsigned int rt_flags ; __u16 rt_type ; __u8 rt_key_tos ; __be32 rt_dst ; __be32 rt_src ; int rt_route_iif ; int rt_iif ; int rt_oif ; __u32 rt_mark ; __be32 rt_gateway ; __be32 rt_spec_dst ; u32 rt_peer_genid ; struct inet_peer *peer ; struct fib_info *fi ; }; struct inet_ehash_bucket { struct hlist_nulls_head chain ; struct hlist_nulls_head twchain ; }; struct inet_bind_hashbucket { spinlock_t lock ; struct hlist_head chain ; }; struct inet_listen_hashbucket { spinlock_t lock ; struct hlist_nulls_head head ; }; struct inet_hashinfo { struct inet_ehash_bucket *ehash ; spinlock_t *ehash_locks ; unsigned int ehash_mask ; unsigned int ehash_locks_mask ; struct inet_bind_hashbucket *bhash ; unsigned int bhash_size ; struct kmem_cache *bind_bucket_cachep ; struct inet_listen_hashbucket listening_hash[32U] ; atomic_t bsockets ; }; struct lc_element { struct hlist_node colision ; struct list_head list ; unsigned int refcnt ; unsigned int lc_index ; unsigned int lc_number ; }; struct lru_cache { struct list_head lru ; struct list_head free ; struct list_head in_use ; struct kmem_cache *lc_cache ; size_t element_size ; size_t element_off ; unsigned int nr_elements ; unsigned int used ; unsigned long hits ; unsigned long misses ; unsigned long starving ; unsigned long dirty ; unsigned long changed ; unsigned long flags ; unsigned int new_number ; struct lc_element *changing_element ; void *lc_private ; char const *name ; struct hlist_head *lc_slot ; struct lc_element **lc_element ; }; struct drbd_conf; struct p_header80 { u32 magic ; u16 command ; u16 length ; u8 payload[0U] ; }; struct p_header95 { u16 magic ; u16 command ; u32 length ; u8 payload[0U] ; }; union p_header { struct p_header80 h80 ; struct p_header95 h95 ; }; struct p_data { union p_header head ; u64 sector ; u64 block_id ; u32 seq_num ; u32 dp_flags ; }; struct p_block_ack { struct p_header80 head ; u64 sector ; u64 block_id ; u32 blksize ; u32 seq_num ; }; struct p_block_req { struct p_header80 head ; u64 sector ; u64 block_id ; u32 blksize ; u32 pad ; }; struct p_handshake { struct p_header80 head ; u32 protocol_min ; u32 feature_flags ; u32 protocol_max ; u32 _pad ; u64 reserverd[7U] ; }; struct p_barrier { struct p_header80 head ; u32 barrier ; u32 pad ; }; struct p_barrier_ack { struct p_header80 head ; u32 barrier ; u32 set_size ; }; struct p_rs_param_89 { struct p_header80 head ; u32 rate ; char verify_alg[64U] ; char csums_alg[64U] ; }; struct p_rs_param_95 { struct p_header80 head ; u32 rate ; char verify_alg[64U] ; char csums_alg[64U] ; u32 c_plan_ahead ; u32 c_delay_target ; u32 c_fill_target ; u32 c_max_rate ; }; struct p_protocol { struct p_header80 head ; u32 protocol ; u32 after_sb_0p ; u32 after_sb_1p ; u32 after_sb_2p ; u32 conn_flags ; u32 two_primaries ; char integrity_alg[0U] ; }; struct p_uuids { struct p_header80 head ; u64 uuid[6U] ; }; struct p_rs_uuid { struct p_header80 head ; u64 uuid ; }; struct p_sizes { struct p_header80 head ; u64 d_size ; u64 u_size ; u64 c_size ; u32 max_bio_size ; u16 queue_order_type ; u16 dds_flags ; }; struct p_state { struct p_header80 head ; u32 state ; }; struct p_req_state { struct p_header80 head ; u32 mask ; u32 val ; }; struct p_req_state_reply { struct p_header80 head ; u32 retcode ; }; struct p_block_desc { struct p_header80 head ; u64 sector ; u32 blksize ; u32 pad ; }; struct p_delay_probe93 { struct p_header80 head ; u32 seq_num ; u32 offset ; }; union p_polymorph { union p_header header ; struct p_handshake handshake ; struct p_data data ; struct p_block_ack block_ack ; struct p_barrier barrier ; struct p_barrier_ack barrier_ack ; struct p_rs_param_89 rs_param_89 ; struct p_rs_param_95 rs_param_95 ; struct p_protocol protocol ; struct p_sizes sizes ; struct p_uuids uuids ; struct p_state state ; struct p_req_state req_state ; struct p_req_state_reply req_state_reply ; struct p_block_req block_req ; struct p_delay_probe93 delay_probe93 ; struct p_rs_uuid rs_uuid ; struct p_block_desc block_desc ; }; enum drbd_thread_state { None = 0, Running = 1, Exiting = 2, Restarting = 3 } ; struct drbd_thread { spinlock_t t_lock ; struct task_struct *task ; struct completion stop ; enum drbd_thread_state t_state ; int (*function)(struct drbd_thread * ) ; struct drbd_conf *mdev ; int reset_cpu_mask ; }; struct drbd_work; struct drbd_work { struct list_head list ; int (*cb)(struct drbd_conf * , struct drbd_work * , int ) ; }; struct drbd_tl_epoch; struct drbd_tl_epoch { struct drbd_work w ; struct list_head requests ; struct drbd_tl_epoch *next ; unsigned int br_number ; int n_writes ; }; struct drbd_epoch { struct list_head list ; unsigned int barrier_nr ; atomic_t epoch_size ; atomic_t active ; unsigned long flags ; }; struct digest_info { int digest_size ; void *digest ; }; union __anonunion_ldv_47524_241 { u64 block_id ; struct digest_info *digest ; }; struct drbd_epoch_entry { struct drbd_work w ; struct hlist_node collision ; struct drbd_epoch *epoch ; struct drbd_conf *mdev ; struct page *pages ; atomic_t pending_bios ; unsigned int size ; unsigned long flags ; sector_t sector ; union __anonunion_ldv_47524_241 ldv_47524 ; }; struct drbd_bitmap; enum bm_flag { BM_P_VMALLOCED = 65536, BM_LOCKED_MASK = 15, BM_DONT_CLEAR = 1, BM_DONT_SET = 2, BM_DONT_TEST = 4, BM_IS_LOCKED = 8, BM_LOCKED_TEST_ALLOWED = 11, BM_LOCKED_SET_ALLOWED = 9, BM_LOCKED_CHANGE_ALLOWED = 8 } ; 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 ; int disk_timeout ; }; struct net_conf { unsigned char my_addr[128U] ; int my_addr_len ; unsigned char peer_addr[128U] ; int peer_addr_len ; unsigned char shared_secret[64U] ; int shared_secret_len ; unsigned char cram_hmac_alg[64U] ; int cram_hmac_alg_len ; unsigned char integrity_alg[64U] ; int integrity_alg_len ; int timeout ; int wire_protocol ; int try_connect_int ; int ping_int ; int max_epoch_size ; int max_buffers ; int unplug_watermark ; int sndbuf_size ; int ko_count ; int after_sb_0p ; int after_sb_1p ; int after_sb_2p ; int rr_conflict ; int ping_timeo ; int rcvbuf_size ; int on_congestion ; int cong_fill ; int cong_extents ; unsigned char mind_af : 1 ; unsigned char want_lose : 1 ; unsigned char two_primaries : 1 ; unsigned char always_asbp : 1 ; unsigned char no_cork : 1 ; unsigned char auto_sndbuf_size : 1 ; unsigned char dry_run : 1 ; }; struct syncer_conf { int rate ; int after ; int al_extents ; unsigned char verify_alg[64U] ; int verify_alg_len ; unsigned char cpu_mask[32U] ; int cpu_mask_len ; unsigned char csums_alg[64U] ; int csums_alg_len ; unsigned char use_rle : 1 ; int on_no_data ; int c_plan_ahead ; int c_delay_target ; int c_fill_target ; int c_max_rate ; int c_min_rate ; }; struct drbd_backing_dev { struct block_device *backing_bdev ; struct block_device *md_bdev ; struct drbd_md md ; struct disk_conf dc ; sector_t known_size ; }; struct drbd_md_io { unsigned int done ; int error ; }; struct bm_io_work { struct drbd_work w ; char *why ; enum bm_flag flags ; int (*io_fn)(struct drbd_conf * ) ; void (*done)(struct drbd_conf * , int ) ; }; enum write_ordering_e { WO_none = 0, WO_drain_io = 1, WO_bdev_flush = 2 } ; struct fifo_buffer { int *values ; unsigned int head_index ; unsigned int size ; }; struct drbd_conf { unsigned long flags ; struct net_conf *net_conf ; struct syncer_conf sync_conf ; struct drbd_backing_dev *ldev ; sector_t p_size ; struct request_queue *rq_queue ; struct block_device *this_bdev ; struct gendisk *vdisk ; struct drbd_socket data ; struct drbd_socket meta ; int agreed_pro_version ; unsigned long last_received ; unsigned int ko_count ; struct drbd_work resync_work ; struct drbd_work unplug_work ; struct drbd_work go_diskless ; struct drbd_work md_sync_work ; struct drbd_work start_resync_work ; struct timer_list resync_timer ; struct timer_list md_sync_timer ; struct timer_list start_resync_timer ; struct timer_list request_timer ; union drbd_state new_state_tmp ; union drbd_state state ; wait_queue_head_t misc_wait ; wait_queue_head_t state_wait ; wait_queue_head_t net_cnt_wait ; unsigned int send_cnt ; unsigned int recv_cnt ; unsigned int read_cnt ; unsigned int writ_cnt ; unsigned int al_writ_cnt ; unsigned int bm_writ_cnt ; atomic_t ap_bio_cnt ; atomic_t ap_pending_cnt ; atomic_t rs_pending_cnt ; atomic_t unacked_cnt ; atomic_t local_cnt ; atomic_t net_cnt ; spinlock_t req_lock ; struct drbd_tl_epoch *unused_spare_tle ; struct drbd_tl_epoch *newest_tle ; struct drbd_tl_epoch *oldest_tle ; struct list_head out_of_sequence_requests ; struct list_head barrier_acked_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 ; unsigned long last_reattach_jif ; unsigned long last_reconnect_jif ; 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 drbd_md_io md_io ; atomic_t md_io_in_use ; spinlock_t al_lock ; wait_queue_head_t al_wait ; struct lru_cache *act_log ; unsigned int al_tr_number ; int al_tr_cycle ; int al_tr_pos ; struct crypto_hash *cram_hmac_tfm ; struct crypto_hash *integrity_w_tfm ; struct crypto_hash *integrity_r_tfm ; void *int_dig_out ; void *int_dig_in ; void *int_dig_vv ; wait_queue_head_t seq_wait ; atomic_t packet_seq ; unsigned int peer_seq ; spinlock_t peer_seq_lock ; unsigned int minor ; unsigned long comm_bm_set ; cpumask_var_t cpu_mask ; struct bm_io_work bm_io_work ; u64 ed_uuid ; struct mutex state_mutex ; char congestion_reason ; atomic_t rs_sect_in ; atomic_t rs_sect_ev ; int rs_last_sect_ev ; int rs_last_events ; int c_sync_rate ; struct fifo_buffer rs_plan_s ; int rs_in_flight ; int rs_planed ; atomic_t ap_in_flight ; int peer_max_bio_size ; int local_max_bio_size ; }; enum chg_state_flags { CS_HARD = 1, CS_VERBOSE = 2, CS_WAIT_COMPLETE = 4, CS_SERIALIZE = 8, CS_ORDERED = 12 } ; struct drbd_bitmap { struct page **bm_pages ; spinlock_t bm_lock ; unsigned long bm_set ; unsigned long bm_bits ; size_t bm_words ; size_t bm_number_of_pages ; sector_t bm_dev_capacity ; struct mutex bm_change ; wait_queue_head_t bm_io_wait ; enum bm_flag bm_flags ; char *bm_why ; struct task_struct *bm_task ; }; struct bm_aio_ctx { struct drbd_conf *mdev ; atomic_t in_flight ; unsigned int done ; unsigned int flags ; int error ; struct kref kref ; }; typedef int ldv_func_ret_type___0; typedef int ldv_func_ret_type___7; typedef short s16; typedef void (*ctor_fn_t)(void); struct bug_entry { int bug_addr_disp ; int file_disp ; unsigned short line ; unsigned short flags ; }; struct static_key; enum hrtimer_restart; 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 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_12961_112 { 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 ; s16 level ; union __anonunion_ldv_12961_112 ldv_12961 ; }; struct kparam_string { unsigned int maxlen ; char *string ; }; struct kparam_array { unsigned int max ; unsigned int elemsize ; unsigned int *num ; struct kernel_param_ops const *ops ; void *elem ; }; struct static_key { atomic_t enabled ; }; struct tracepoint; struct tracepoint_func { void *func ; void *data ; }; struct tracepoint { char const *name ; struct static_key key ; void (*regfunc)(void) ; void (*unregfunc)(void) ; struct tracepoint_func *funcs ; }; struct kernel_symbol { unsigned long value ; char const *name ; }; struct mod_arch_specific { }; struct module_param_attrs; struct module_kobject { struct kobject kobj ; struct module *mod ; struct kobject *drivers_dir ; struct module_param_attrs *mp ; }; struct module_attribute { struct attribute attr ; ssize_t (*show)(struct module_attribute * , struct module_kobject * , char * ) ; ssize_t (*store)(struct module_attribute * , struct module_kobject * , char const * , size_t ) ; void (*setup)(struct module * , char const * ) ; int (*test)(struct module * ) ; void (*free)(struct module * ) ; }; struct exception_table_entry; enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2 } ; struct module_ref { unsigned long incs ; unsigned long decs ; }; struct module_sect_attrs; struct module_notes_attrs; struct ftrace_event_call; struct module { enum module_state state ; struct list_head list ; char name[56U] ; struct module_kobject mkobj ; struct module_attribute *modinfo_attrs ; char const *version ; char const *srcversion ; struct kobject *holders_dir ; struct kernel_symbol const *syms ; unsigned long const *crcs ; unsigned int num_syms ; struct kernel_param *kp ; unsigned int num_kp ; unsigned int num_gpl_syms ; struct kernel_symbol const *gpl_syms ; unsigned long const *gpl_crcs ; struct kernel_symbol const *unused_syms ; unsigned long const *unused_crcs ; unsigned int num_unused_syms ; unsigned int num_unused_gpl_syms ; struct kernel_symbol const *unused_gpl_syms ; unsigned long const *unused_gpl_crcs ; struct kernel_symbol const *gpl_future_syms ; unsigned long const *gpl_future_crcs ; unsigned int num_gpl_future_syms ; unsigned int num_exentries ; struct exception_table_entry *extable ; int (*init)(void) ; void *module_init ; void *module_core ; unsigned int init_size ; unsigned int core_size ; unsigned int init_text_size ; unsigned int core_text_size ; unsigned int init_ro_size ; unsigned int core_ro_size ; struct mod_arch_specific arch ; unsigned int taints ; unsigned int num_bugs ; struct list_head bug_list ; struct bug_entry *bug_table ; Elf64_Sym *symtab ; Elf64_Sym *core_symtab ; unsigned int num_symtab ; unsigned int core_num_syms ; char *strtab ; char *core_strtab ; struct module_sect_attrs *sect_attrs ; struct module_notes_attrs *notes_attrs ; char *args ; void *percpu ; unsigned int percpu_size ; unsigned int num_tracepoints ; struct tracepoint * const *tracepoints_ptrs ; unsigned int num_trace_bprintk_fmt ; char const **trace_bprintk_fmt_start ; struct ftrace_event_call **trace_events ; unsigned int num_trace_events ; 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 exception_table_entry { int insn ; int fixup ; }; struct proc_ns_operations { char const *name ; int type ; void *(*get)(struct task_struct * ) ; void (*put)(void * ) ; int (*install)(struct nsproxy * , void * ) ; }; union proc_op { int (*proc_get_link)(struct dentry * , struct path * ) ; int (*proc_read)(struct task_struct * , char * ) ; int (*proc_show)(struct seq_file * , struct pid_namespace * , struct pid * , struct task_struct * ) ; }; struct proc_inode { struct pid *pid ; int fd ; union proc_op op ; struct proc_dir_entry *pde ; struct ctl_table_header *sysctl ; struct ctl_table *sysctl_entry ; void *ns ; struct proc_ns_operations const *ns_ops ; struct inode vfs_inode ; }; enum drbd_role { R_UNKNOWN = 0, R_PRIMARY = 1, R_SECONDARY = 2, R_MASK = 3 } ; enum drbd_conns { C_STANDALONE = 0, C_DISCONNECTING = 1, C_UNCONNECTED = 2, C_TIMEOUT = 3, C_BROKEN_PIPE = 4, C_NETWORK_FAILURE = 5, C_PROTOCOL_ERROR = 6, C_TEAR_DOWN = 7, C_WF_CONNECTION = 8, C_WF_REPORT_PARAMS = 9, C_CONNECTED = 10, C_STARTING_SYNC_S = 11, C_STARTING_SYNC_T = 12, C_WF_BITMAP_S = 13, C_WF_BITMAP_T = 14, C_WF_SYNC_UUID = 15, C_SYNC_SOURCE = 16, C_SYNC_TARGET = 17, C_VERIFY_S = 18, C_VERIFY_T = 19, C_PAUSED_SYNC_S = 20, C_PAUSED_SYNC_T = 21, C_AHEAD = 22, C_BEHIND = 23, C_MASK = 31 } ; struct bm_extent { int rs_left ; int rs_failed ; unsigned long flags ; struct lc_element lce ; }; enum hrtimer_restart; enum drbd_packets { P_DATA = 0, P_DATA_REPLY = 1, P_RS_DATA_REPLY = 2, P_BARRIER = 3, P_BITMAP = 4, P_BECOME_SYNC_TARGET = 5, P_BECOME_SYNC_SOURCE = 6, P_UNPLUG_REMOTE = 7, P_DATA_REQUEST = 8, P_RS_DATA_REQUEST = 9, P_SYNC_PARAM = 10, P_PROTOCOL = 11, P_UUIDS = 12, P_SIZES = 13, P_STATE = 14, P_SYNC_UUID = 15, P_AUTH_CHALLENGE = 16, P_AUTH_RESPONSE = 17, P_STATE_CHG_REQ = 18, P_PING = 19, P_PING_ACK = 20, P_RECV_ACK = 21, P_WRITE_ACK = 22, P_RS_WRITE_ACK = 23, P_DISCARD_ACK = 24, P_NEG_ACK = 25, P_NEG_DREPLY = 26, P_NEG_RS_DREPLY = 27, P_BARRIER_ACK = 28, P_STATE_CHG_REPLY = 29, P_OV_REQUEST = 30, P_OV_REPLY = 31, P_OV_RESULT = 32, P_CSUM_RS_REQUEST = 33, P_RS_IS_IN_SYNC = 34, P_SYNC_PARAM89 = 35, P_COMPRESSED_BITMAP = 36, P_DELAY_PROBE = 39, P_OUT_OF_SYNC = 40, P_RS_CANCEL = 41, P_MAX_CMD = 42, P_MAY_IGNORE = 256, P_MAX_OPT_CMD = 257, P_HAND_SHAKE_M = 65521, P_HAND_SHAKE_S = 65522, P_HAND_SHAKE = 65534 } ; struct drbd_request { struct drbd_work w ; struct drbd_conf *mdev ; struct bio *private_bio ; struct hlist_node collision ; sector_t sector ; unsigned int size ; unsigned int epoch ; struct list_head tl_requests ; struct bio *master_bio ; unsigned long rq_state ; unsigned long start_time ; }; struct drbd_wq_barrier { struct drbd_work w ; struct completion done ; }; enum drbd_req_event { created = 0, to_be_send = 1, to_be_submitted = 2, queue_for_net_write = 3, queue_for_net_read = 4, queue_for_send_oos = 5, send_canceled = 6, send_failed = 7, handed_over_to_network = 8, oos_handed_to_network = 9, connection_lost_while_pending = 10, read_retry_remote_canceled = 11, recv_acked_by_peer = 12, write_acked_by_peer = 13, write_acked_by_peer_and_sis = 14, conflict_discarded_by_peer = 15, neg_acked = 16, barrier_acked = 17, data_received = 18, read_completed_with_error = 19, read_ahead_completed_with_error = 20, write_completed_with_error = 21, abort_disk_io = 22, completed_ok = 23, resend = 24, fail_frozen_disk_io = 25, restart_frozen_disk_io = 26, nothing = 27 } ; 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 { __kernel_sa_family_t sin_family ; __be16 sin_port ; struct in_addr sin_addr ; unsigned char __pad[8U] ; }; struct sockaddr_in6 { unsigned short sin6_family ; __be16 sin6_port ; __be32 sin6_flowinfo ; struct in6_addr sin6_addr ; __u32 sin6_scope_id ; }; enum drbd_fencing_p { FP_DONT_CARE = 0, FP_RESOURCE = 1, FP_STONITH = 2 } ; enum drbd_after_sb_p { ASB_DISCONNECT = 0, ASB_DISCARD_YOUNGER_PRI = 1, ASB_DISCARD_OLDER_PRI = 2, ASB_DISCARD_ZERO_CHG = 3, ASB_DISCARD_LEAST_CHG = 4, ASB_DISCARD_LOCAL = 5, ASB_DISCARD_REMOTE = 6, ASB_CONSENSUS = 7, ASB_DISCARD_SECONDARY = 8, ASB_CALL_HELPER = 9, ASB_VIOLENTLY = 10 } ; struct bm_xfer_ctx { unsigned long bm_bits ; unsigned long bm_words ; unsigned long bit_offset ; unsigned long word_offset ; unsigned int packets[2U] ; unsigned int bytes[2U] ; }; enum drbd_bitmap_code { RLE_VLI_Bits = 2 } ; struct p_compressed_bm { struct p_header80 head ; u8 encoding ; u8 code[0U] ; }; enum epoch_event { EV_PUT = 0, EV_GOT_BARRIER_NR = 1, EV_BECAME_LAST = 2, EV_CLEANUP = 32 } ; enum dds_flags { DDSF_FORCED = 1, DDSF_NO_RESYNC = 2 } ; enum determine_dev_size { dev_size_error = -1, unchanged = 0, shrunk = 1, grew = 2 } ; struct bitstream_cursor { u8 *b ; unsigned int bit ; }; struct bitstream { struct bitstream_cursor cur ; unsigned char *buf ; size_t buf_len ; unsigned int pad_bits ; }; enum finish_epoch { FE_STILL_LIVE = 0, FE_DESTROYED = 1, FE_RECYCLED = 2 } ; struct data_cmd { int expect_payload ; size_t pkt_size ; int (*function)(struct drbd_conf * , enum drbd_packets , unsigned int ) ; }; typedef struct drbd_request *req_validator_fn(struct drbd_conf * , u64 , sector_t ); struct asender_cmd { size_t pkt_size ; int (*process)(struct drbd_conf * , struct p_header80 * ) ; }; enum hrtimer_restart; struct bio_pair { struct bio bio1 ; struct bio bio2 ; struct bio_vec bv1 ; struct bio_vec bv2 ; struct bio_integrity_payload bip1 ; struct bio_integrity_payload bip2 ; struct bio_vec iv1 ; struct bio_vec iv2 ; atomic_t cnt ; int error ; }; enum hrtimer_restart; struct __anonstruct_updates_242 { u32 pos ; u32 extent ; }; struct al_transaction { u32 magic ; u32 tr_number ; struct __anonstruct_updates_242 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 ; }; enum hrtimer_restart; enum sock_shutdown_cmd { SHUT_RD = 0, SHUT_WR = 1, SHUT_RDWR = 2 } ; struct bio_set; enum drbd_io_error_p { EP_PASS_ON = 0, EP_CALL_HELPER = 1, EP_DETACH = 2 } ; struct bio_set { struct kmem_cache *bio_slab ; unsigned int front_pad ; mempool_t *bio_pool ; mempool_t *bio_integrity_pool ; mempool_t *bvec_pool ; }; 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 sanitize_state_warnings { NO_WARNING = 0, ABORTED_ONLINE_VERIFY = 1, ABORTED_RESYNC = 2, CONNECTION_LOST_NEGOTIATING = 3, IMPLICITLY_UPGRADED_DISK = 4, IMPLICITLY_UPGRADED_PDSK = 5 } ; struct meta_data_on_disk { u64 la_size ; u64 uuid[4U] ; u64 device_uuid ; u64 reserved_u64_1 ; u32 flags ; u32 magic ; u32 md_size_sect ; u32 al_offset ; u32 al_nr_extents ; u32 bm_offset ; u32 bm_bytes_per_bit ; u32 la_peer_max_bio_size ; u32 reserved_u32[3U] ; }; struct fault_random_state { unsigned long state ; unsigned long count ; }; enum hrtimer_restart; typedef __u16 __le16; typedef __u32 __le32; typedef __u64 __le64; enum hrtimer_restart; struct subprocess_info { struct work_struct work ; struct completion *complete ; char *path ; char **argv ; char **envp ; int wait ; int retval ; int (*init)(struct subprocess_info * , struct cred * ) ; void (*cleanup)(struct subprocess_info * ) ; void *data ; }; enum kobject_action { KOBJ_ADD = 0, KOBJ_REMOVE = 1, KOBJ_CHANGE = 2, KOBJ_MOVE = 3, KOBJ_ONLINE = 4, KOBJ_OFFLINE = 5, KOBJ_MAX = 6 } ; struct cb_id { __u32 idx ; __u32 val ; }; struct cn_msg { struct cb_id id ; __u32 seq ; __u32 ack ; __u16 len ; __u16 flags ; __u8 data[0U] ; }; struct ucred { __u32 pid ; __u32 uid ; __u32 gid ; }; struct netlink_skb_parms { struct ucred creds ; __u32 pid ; __u32 dst_group ; }; enum drbd_ret_code { ERR_CODE_BASE = 100, NO_ERROR = 101, ERR_LOCAL_ADDR = 102, ERR_PEER_ADDR = 103, ERR_OPEN_DISK = 104, ERR_OPEN_MD_DISK = 105, ERR_DISK_NOT_BDEV = 107, ERR_MD_NOT_BDEV = 108, ERR_DISK_TOO_SMALL = 111, ERR_MD_DISK_TOO_SMALL = 112, ERR_BDCLAIM_DISK = 114, ERR_BDCLAIM_MD_DISK = 115, ERR_MD_IDX_INVALID = 116, ERR_IO_MD_DISK = 118, ERR_MD_INVALID = 119, ERR_AUTH_ALG = 120, ERR_AUTH_ALG_ND = 121, ERR_NOMEM = 122, ERR_DISCARD = 123, ERR_DISK_CONFIGURED = 124, ERR_NET_CONFIGURED = 125, ERR_MANDATORY_TAG = 126, ERR_MINOR_INVALID = 127, ERR_INTR = 129, ERR_RESIZE_RESYNC = 130, ERR_NO_PRIMARY = 131, ERR_SYNC_AFTER = 132, ERR_SYNC_AFTER_CYCLE = 133, ERR_PAUSE_IS_SET = 134, ERR_PAUSE_IS_CLEAR = 135, ERR_PACKET_NR = 137, ERR_NO_DISK = 138, ERR_NOT_PROTO_C = 139, ERR_NOMEM_BITMAP = 140, ERR_INTEGRITY_ALG = 141, ERR_INTEGRITY_ALG_ND = 142, ERR_CPU_MASK_PARSE = 143, ERR_CSUMS_ALG = 144, ERR_CSUMS_ALG_ND = 145, ERR_VERIFY_ALG = 146, ERR_VERIFY_ALG_ND = 147, ERR_CSUMS_RESYNC_RUNNING = 148, ERR_VERIFY_RUNNING = 149, ERR_DATA_NOT_CURRENT = 150, ERR_CONNECTED = 151, ERR_PERM = 152, ERR_NEED_APV_93 = 153, ERR_STONITH_AND_PROT_A = 154, ERR_CONG_NOT_PROTO_A = 155, ERR_PIC_AFTER_DEP = 156, ERR_PIC_PEER_DEP = 157, AFTER_LAST_ERR_CODE = 158 } ; struct drbd_nl_cfg_req { int packet_type ; unsigned int drbd_minor ; int flags ; unsigned short tag_list[] ; }; 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 detach { unsigned char detach_force : 1 ; }; struct disconnect { unsigned char force : 1 ; }; struct resize { __u64 resize_size ; unsigned char resize_force : 1 ; unsigned char no_resync : 1 ; }; struct get_state { int state_i ; }; struct start_ov { __u64 start_sector ; }; struct new_c_uuid { unsigned char clear_bm : 1 ; }; enum drbd_tags { T_primary_force = 32769, T_disk_size = 16386, T_backing_dev = 57347, T_meta_dev = 57348, T_meta_dev_idx = 8197, T_on_io_error = 6, T_fencing = 7, T_use_bmbv = 32805, T_no_disk_flush = 32821, T_no_md_flush = 32822, T_max_bio_bvecs = 56, T_no_disk_barrier = 32825, T_no_disk_drain = 32826, T_disk_timeout = 89, T_detach_force = 41048, T_my_addr = 57352, T_peer_addr = 57353, T_shared_secret = 49162, T_cram_hmac_alg = 49163, T_integrity_alg = 49196, T_timeout = 14, T_wire_protocol = 8207, T_try_connect_int = 16, T_ping_int = 17, T_max_epoch_size = 18, T_max_buffers = 19, T_unplug_watermark = 20, T_sndbuf_size = 21, T_ko_count = 22, T_after_sb_0p = 24, T_after_sb_1p = 25, T_after_sb_2p = 26, T_rr_conflict = 39, T_ping_timeo = 40, T_rcvbuf_size = 67, T_on_congestion = 81, T_cong_fill = 82, T_cong_extents = 83, T_mind_af = 41020, T_want_lose = 32795, T_two_primaries = 32796, T_always_asbp = 32809, T_no_cork = 32829, T_auto_sndbuf_size = 41022, T_dry_run = 41030, T_force = 32852, T_resize_size = 16413, T_resize_force = 32836, T_no_resync = 41029, T_rate = 30, T_after = 31, T_al_extents = 32, T_verify_alg = 49204, T_cpu_mask = 49203, T_csums_alg = 49216, T_use_rle = 32833, T_on_no_data = 75, T_c_plan_ahead = 76, T_c_delay_target = 77, T_c_fill_target = 78, T_c_max_rate = 79, T_c_min_rate = 80, T_state_i = 33, T_uuids = 49186, T_uuids_flags = 35, T_use_degraded = 32804, T_helper = 49190, T_sync_progress = 43, T_dump_ee_reason = 49197, T_seen_digest = 49198, T_calc_digest = 49199, T_ee_sector = 16432, T_ee_block_id = 16433, T_ee_data = 49202, T_start_sector = 16450, T_clear_bm = 41023 } ; struct tag { char const *name ; int type_n_flags ; int max_len ; }; struct cn_handler_struct { int (*function)(struct drbd_conf * , struct drbd_nl_cfg_req * , struct drbd_nl_cfg_reply * ) ; int reply_body_size ; }; void *memcpy(void * , void const * , unsigned long ) ; 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 clear_bit(int nr , unsigned long volatile *addr ) { { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; btr %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr)); return; } } __inline static int test_and_set_bit(int nr , unsigned long volatile *addr ) { int oldbit ; { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; bts %2,%1\n\tsbb %0,%0": "=r" (oldbit), "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return (oldbit); } } __inline static int __test_and_set_bit(int nr , unsigned long volatile *addr ) { int oldbit ; { __asm__ ("bts %2,%1\n\tsbb %0,%0": "=r" (oldbit), "+m" (*((long volatile *)addr)): "Ir" (nr)); return (oldbit); } } __inline static int __test_and_clear_bit(int nr , unsigned long volatile *addr ) { int oldbit ; { __asm__ volatile ("btr %2,%1\n\tsbb %0,%0": "=r" (oldbit), "+m" (*((long volatile *)addr)): "Ir" (nr)); return (oldbit); } } __inline static int constant_test_bit(unsigned int nr , unsigned long const volatile *addr ) { { return ((int )((unsigned long )*(addr + (unsigned long )(nr / 64U)) >> ((int )nr & 63)) & 1); } } __inline static int variable_test_bit(int nr , unsigned long const volatile *addr ) { int oldbit ; { __asm__ volatile ("bt %2,%1\n\tsbb %0,%0": "=r" (oldbit): "m" (*((unsigned long *)addr)), "Ir" (nr)); return (oldbit); } } extern unsigned long find_next_bit(unsigned long const * , unsigned long , unsigned long ) ; extern unsigned long find_next_zero_bit(unsigned long const * , unsigned long , unsigned long ) ; __inline static unsigned long __arch_hweight64(__u64 w ) { unsigned long res ; { res = 0UL; __asm__ ("661:\n\tcall __sw_hweight64\n662:\n.section .altinstructions,\"a\"\n\t .long 661b - .\n\t .long 663f - .\n\t .word (4*32+23)\n\t .byte 662b-661b\n\t .byte 664f-663f\n.previous\n.section .discard,\"aw\",@progbits\n\t .byte 0xff + (664f-663f) - (662b-661b)\n.previous\n.section .altinstr_replacement, \"ax\"\n663:\n\t.byte 0xf3,0x48,0x0f,0xb8,0xc7\n664:\n.previous": "=a" (res): "D" (w)); return (res); } } __inline static unsigned long find_next_zero_bit_le(void const *addr , unsigned long size , unsigned long offset ) { unsigned long tmp ; { tmp = find_next_zero_bit((unsigned long const *)addr, size, offset); return (tmp); } } __inline static unsigned long find_next_bit_le(void const *addr , unsigned long size , unsigned long offset ) { unsigned long tmp ; { tmp = find_next_bit((unsigned long const *)addr, size, offset); return (tmp); } } __inline static int test_bit_le(int nr , void const *addr ) { int tmp ; { tmp = variable_test_bit(nr, (unsigned long const volatile *)addr); return (tmp); } } __inline static int __test_and_set_bit_le(int nr , void *addr ) { int tmp ; { tmp = __test_and_set_bit(nr, (unsigned long volatile *)addr); return (tmp); } } __inline static int __test_and_clear_bit_le(int nr , void *addr ) { int tmp ; { tmp = __test_and_clear_bit(nr, (unsigned long volatile *)addr); return (tmp); } } __inline static unsigned long hweight_long(unsigned long w ) { unsigned long tmp ; { tmp = __arch_hweight64((__u64 )w); return (tmp); } } extern int printk(char const * , ...) ; extern int __dynamic_dev_dbg(struct _ddebug * , struct device const * , char const * , ...) ; extern void __might_sleep(char const * , int , int ) ; extern void __bad_percpu_size(void) ; extern struct task_struct *current_task ; __inline static struct task_struct *get_current(void) { struct task_struct *pfo_ret__ ; { switch (8UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& current_task)); goto ldv_2871; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_2871; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_2871; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_2871; default: __bad_percpu_size(); } ldv_2871: ; return (pfo_ret__); } } extern void *memcpy(void * , void const * , size_t ) ; extern void *memset(void * , int , size_t ) ; extern void warn_slowpath_null(char const * , int const ) ; extern void __xadd_wrong_size(void) ; __inline static int atomic_read(atomic_t const *v ) { { return ((int )*((int volatile *)(& v->counter))); } } __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 int atomic_sub_and_test(int i , atomic_t *v ) { unsigned char c ; { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; subl %2,%0; sete %1": "+m" (v->counter), "=qm" (c): "ir" (i): "memory"); return ((int )c); } } __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 __ret ; { __ret = i; switch (4UL) { case 1UL: __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; xaddb %b0, %1\n": "+q" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5503; case 2UL: __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; xaddw %w0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5503; case 4UL: __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; xaddl %0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5503; case 8UL: __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; xaddq %q0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5503; default: __xadd_wrong_size(); } ldv_5503: ; return (__ret + i); } } __inline static int atomic_sub_return(int i , atomic_t *v ) { int tmp ; { tmp = atomic_add_return(- i, v); return (tmp); } } 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_9(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_7(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_8(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_6(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_cred_guard_mutex_of_signal_struct(struct mutex *lock ) ; void ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(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_6248; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6248; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6248; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6248; default: __bad_percpu_size(); } ldv_6248: 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_5990.rlock); } } __inline static void spin_lock_irq(spinlock_t *lock ) { { _raw_spin_lock_irq(& lock->ldv_5990.rlock); return; } } __inline static void spin_unlock_irq(spinlock_t *lock ) { { _raw_spin_unlock_irq(& lock->ldv_5990.rlock); return; } } __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) { { _raw_spin_unlock_irqrestore(& lock->ldv_5990.rlock, flags); return; } } extern void *vzalloc(unsigned long ) ; extern void vfree(void const * ) ; extern unsigned long volatile jiffies ; extern void __init_waitqueue_head(wait_queue_head_t * , char const * , 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 void __free_pages(struct page * , unsigned int ) ; extern void kfree(void const * ) ; __inline static int kref_sub(struct kref *kref , unsigned int count , void (*release)(struct kref * ) ) { int __ret_warn_on ; long tmp ; int tmp___0 ; { __ret_warn_on = (unsigned long )release == (unsigned long )((void (*)(struct kref * ))0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("include/linux/kref.h", 66); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___0 = atomic_sub_and_test((int )count, & kref->refcount); if (tmp___0 != 0) { (*release)(kref); return (1); } else { } return (0); } } __inline static int kref_put(struct kref *kref , void (*release)(struct kref * ) ) { int tmp ; { tmp = kref_sub(kref, 1U, release); return (tmp); } } extern void *__kmalloc(size_t , gfp_t ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) { void *tmp___2 ; { tmp___2 = __kmalloc(size, flags); return (tmp___2); } } __inline static void *kzalloc(size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc(size, flags | 32768U); return (tmp); } } extern int ___ratelimit(struct ratelimit_state * , char const * ) ; extern int dev_alert(struct device const * , char const * , ...) ; extern int dev_err(struct device const * , char const * , ...) ; extern int dev_warn(struct device const * , char const * , ...) ; extern int _dev_info(struct device const * , char const * , ...) ; __inline static void *lowmem_page_address(struct page const *page ) { { return ((void *)((unsigned long )((unsigned long long )(((long )page + 24189255811072L) / 64L) << 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 ) { void *tmp ; { pagefault_disable(); tmp = lowmem_page_address((struct page const *)page); return (tmp); } } __inline static void __kunmap_atomic(void *addr ) { { pagefault_enable(); return; } } extern void *mempool_alloc(mempool_t * , gfp_t ) ; extern void mempool_free(void * , mempool_t * ) ; extern void bio_put(struct bio * ) ; extern void bio_endio(struct bio * , int ) ; extern int bio_add_page(struct bio * , struct page * , unsigned int , unsigned int ) ; extern int blkdev_issue_flush(struct block_device * , gfp_t , sector_t * ) ; int enable_faults ; int fault_rate ; unsigned int _drbd_insert_fault(struct drbd_conf *mdev , unsigned int type ) ; __inline static int drbd_insert_fault(struct drbd_conf *mdev , unsigned int type ) { unsigned int tmp ; int tmp___0 ; { if (fault_rate != 0 && (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 ; enum drbd_state_rv __drbd_set_state(struct drbd_conf *mdev , union drbd_state ns , enum chg_state_flags flags , struct completion *done ) ; void drbd_go_diskless(struct drbd_conf *mdev ) ; void drbd_ldev_destroy(struct drbd_conf *mdev ) ; int drbd_bm_init(struct drbd_conf *mdev ) ; int drbd_bm_resize(struct drbd_conf *mdev , sector_t capacity , int set_new_bits ) ; void drbd_bm_cleanup(struct drbd_conf *mdev ) ; void drbd_bm_set_all(struct drbd_conf *mdev ) ; void drbd_bm_clear_all(struct drbd_conf *mdev ) ; int drbd_bm_set_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) ; int drbd_bm_clear_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) ; int drbd_bm_count_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) ; void _drbd_bm_set_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) ; int drbd_bm_test_bit(struct drbd_conf *mdev , unsigned long const bitnr ) ; int drbd_bm_e_weight(struct drbd_conf *mdev , unsigned long enr ) ; int drbd_bm_write_page(struct drbd_conf *mdev , unsigned int idx ) ; int drbd_bm_read(struct drbd_conf *mdev ) ; int drbd_bm_write(struct drbd_conf *mdev ) ; int drbd_bm_write_copy_pages(struct drbd_conf *mdev ) ; unsigned long drbd_bm_ALe_set_all(struct drbd_conf *mdev , unsigned long al_enr ) ; size_t drbd_bm_words(struct drbd_conf *mdev ) ; unsigned long drbd_bm_bits(struct drbd_conf *mdev ) ; sector_t drbd_bm_capacity(struct drbd_conf *mdev ) ; unsigned long drbd_bm_find_next(struct drbd_conf *mdev , unsigned long bm_fo ) ; unsigned long _drbd_bm_find_next(struct drbd_conf *mdev , unsigned long bm_fo ) ; unsigned long _drbd_bm_find_next_zero(struct drbd_conf *mdev , unsigned long bm_fo ) ; unsigned long _drbd_bm_total_weight(struct drbd_conf *mdev ) ; unsigned long drbd_bm_total_weight(struct drbd_conf *mdev ) ; void drbd_bm_merge_lel(struct drbd_conf *mdev , size_t offset , size_t number , unsigned long *buffer ) ; void drbd_bm_get_lel(struct drbd_conf *mdev , size_t offset , size_t number , unsigned long *buffer ) ; void drbd_bm_lock(struct drbd_conf *mdev , char *why , enum bm_flag flags ) ; void drbd_bm_unlock(struct drbd_conf *mdev ) ; mempool_t *drbd_md_io_page_pool ; struct bio *bio_alloc_drbd(gfp_t gfp_mask ) ; rwlock_t global_state_lock ; char *ppsize(char *buf , unsigned long long size ) ; void wait_until_done_or_disk_failure(struct drbd_conf *mdev , struct drbd_backing_dev *bdev , unsigned int *done ) ; __inline static enum drbd_state_rv _drbd_set_state(struct drbd_conf *mdev , union drbd_state ns , enum chg_state_flags flags , struct completion *done ) { enum drbd_state_rv rv ; { _raw_read_lock(& global_state_lock); rv = __drbd_set_state(mdev, ns, flags, done); _raw_read_unlock(& global_state_lock); return (rv); } } __inline static void __drbd_chk_io_error_(struct drbd_conf *mdev , int forcedetach , char const *where ) { int tmp ; union drbd_state __ns ; union drbd_state __ns___0 ; { 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.\n", where); } else { } if ((int )mdev->state.ldv_38745.disk > 4) { __ns.i = mdev->state.i; __ns.ldv_38745.disk = 4U; _drbd_set_state(mdev, __ns, CS_HARD, 0); } else { } goto ldv_48552; } else { } case 2: ; case 1: set_bit(19U, (unsigned long volatile *)(& mdev->flags)); if ((int )mdev->state.ldv_38745.disk > 2) { __ns___0.i = mdev->state.i; __ns___0.ldv_38745.disk = 2U; _drbd_set_state(mdev, __ns___0, CS_HARD, 0); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s. Detaching...\n", where); } else { } goto ldv_48552; } ldv_48552: ; 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", 2183); } else { } if (i == 0) { if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 0U) { drbd_ldev_destroy(mdev); } else { } if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 4U) { drbd_go_diskless(mdev); } else { } __wake_up(& mdev->misc_wait, 3U, 1, 0); } else { } return; } } __inline static int _get_ldev_if_state(struct drbd_conf *mdev , enum drbd_disk_state mins ) { int io_allowed ; { if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 0U) { return (0); } else { } atomic_inc(& mdev->local_cnt); io_allowed = (unsigned int )mdev->state.ldv_38745.disk >= (unsigned int )mins; if (io_allowed == 0) { put_ldev(mdev); } else { } return (io_allowed); } } __inline static void drbd_md_flush(struct drbd_conf *mdev ) { int r ; int tmp ; { tmp = constant_test_bit(14U, (unsigned long const volatile *)(& mdev->flags)); if (tmp != 0) { return; } else { } r = blkdev_issue_flush((mdev->ldev)->md_bdev, 208U, 0); if (r != 0) { set_bit(14U, (unsigned long volatile *)(& mdev->flags)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "meta data flush failed with status %d, disabling md-flushes\n", r); } else { } return; } } static void __bm_print_lock_info(struct drbd_conf *mdev , char const *func ) { struct drbd_bitmap *b ; int tmp ; 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 , enum bm_flag flags ) { 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 ; { 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_9(& 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_10(& b->bm_change); } else { } if (((unsigned int )b->bm_flags & 15U) != 0U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "FIXME bitmap already locked in bm_lock\n"); } else { } b->bm_flags = (enum bm_flag )((unsigned int )b->bm_flags | ((unsigned int )flags & 15U)); b->bm_why = why; b->bm_task = get_current(); return; } } void drbd_bm_unlock(struct drbd_conf *mdev ) { struct drbd_bitmap *b ; { b = mdev->bitmap; if ((unsigned long )b == (unsigned long )((struct drbd_bitmap *)0)) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "FIXME no bitmap in drbd_bm_unlock!?\n"); return; } else { } if (((unsigned int )(mdev->bitmap)->bm_flags & 15U) == 0U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "FIXME bitmap not locked in bm_unlock\n"); } else { } b->bm_flags = (enum bm_flag )((unsigned int )b->bm_flags & 4294967280U); b->bm_why = 0; b->bm_task = 0; ldv_mutex_unlock_11(& b->bm_change); return; } } static void bm_store_page_idx(struct page *page , unsigned long idx ) { long tmp ; { tmp = ldv__builtin_expect((idx & 0xffffffffff000000UL) != 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared"), "i" (262), "i" (12UL)); ldv_48823: ; goto ldv_48823; } else { } page->ldv_12914.private = idx; return; } } static unsigned long bm_page_to_idx(struct page *page ) { { return (page->ldv_12914.private & 16777215UL); } } static void bm_page_lock_io(struct drbd_conf *mdev , int page_nr ) { struct drbd_bitmap *b ; void *addr ; int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; { b = mdev->bitmap; addr = (void *)(& (*(b->bm_pages + (unsigned long )page_nr))->ldv_12914.private); tmp = test_and_set_bit(31, (unsigned long volatile *)addr); if (tmp == 0) { goto ldv_48833; } 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_48836: prepare_to_wait(& b->bm_io_wait, & __wait, 2); tmp___1 = test_and_set_bit(31, (unsigned long volatile *)addr); if (tmp___1 == 0) { goto ldv_48835; } else { } schedule(); goto ldv_48836; ldv_48835: finish_wait(& b->bm_io_wait, & __wait); ldv_48833: ; return; } } static void bm_page_unlock_io(struct drbd_conf *mdev , int page_nr ) { struct drbd_bitmap *b ; void *addr ; { b = mdev->bitmap; addr = (void *)(& (*(b->bm_pages + (unsigned long )page_nr))->ldv_12914.private); clear_bit(31, (unsigned long volatile *)addr); __asm__ volatile ("": : : "memory"); __wake_up(& (mdev->bitmap)->bm_io_wait, 3U, 1, 0); return; } } static void bm_set_page_unchanged(struct page *page ) { { clear_bit(29, (unsigned long volatile *)(& page->ldv_12914.private)); clear_bit(28, (unsigned long volatile *)(& page->ldv_12914.private)); return; } } static void bm_set_page_need_writeout(struct page *page ) { { set_bit(29U, (unsigned long volatile *)(& page->ldv_12914.private)); return; } } static int bm_test_page_unchanged(struct page *page ) { unsigned long const volatile *addr ; { addr = (unsigned long const volatile *)(& page->ldv_12914.private); return (((unsigned long )*addr & 805306368UL) == 0UL); } } static void bm_set_page_io_err(struct page *page ) { { set_bit(30U, (unsigned long volatile *)(& page->ldv_12914.private)); return; } } static void bm_clear_page_io_err(struct page *page ) { { clear_bit(30, (unsigned long volatile *)(& page->ldv_12914.private)); return; } } static void bm_set_page_lazy_writeout(struct page *page ) { { set_bit(28U, (unsigned long volatile *)(& page->ldv_12914.private)); return; } } static int bm_test_page_lazy_writeout(struct page *page ) { int tmp ; { tmp = constant_test_bit(28U, (unsigned long const volatile *)(& page->ldv_12914.private)); return (tmp); } } static unsigned int bm_word_to_page_idx(struct drbd_bitmap *b , unsigned long long_nr ) { unsigned int page_nr ; long tmp ; { page_nr = (unsigned int )(long_nr >> 9); tmp = ldv__builtin_expect((size_t )page_nr >= b->bm_number_of_pages, 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared"), "i" (335), "i" (12UL)); ldv_48870: ; goto ldv_48870; } else { } return (page_nr); } } static unsigned int bm_bit_to_page_idx(struct drbd_bitmap *b , u64 bitnr ) { unsigned int page_nr ; long tmp ; { page_nr = (unsigned int )(bitnr >> 15); tmp = ldv__builtin_expect((size_t )page_nr >= b->bm_number_of_pages, 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared"), "i" (343), "i" (12UL)); ldv_48876: ; goto ldv_48876; } else { } return (page_nr); } } static unsigned long *__bm_map_pidx(struct drbd_bitmap *b , unsigned int idx ) { struct page *page ; void *tmp ; { page = *(b->bm_pages + (unsigned long )idx); tmp = kmap_atomic(page); return ((unsigned long *)tmp); } } static unsigned long *bm_map_pidx(struct drbd_bitmap *b , unsigned int idx ) { unsigned long *tmp ; { tmp = __bm_map_pidx(b, idx); return (tmp); } } static void __bm_unmap(unsigned long *p_addr ) { { __kunmap_atomic((void *)p_addr); return; } } static void bm_unmap(unsigned long *p_addr ) { { return; } } static void bm_free_pages(struct page **pages , unsigned long number ) { unsigned long i ; { if ((unsigned long )pages == (unsigned long )((struct page **)0)) { return; } else { } i = 0UL; goto ldv_48899; ldv_48898: ; 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_48897; } else { } __free_pages(*(pages + i), 0U); *(pages + i) = 0; ldv_48897: i = i + 1UL; ldv_48899: ; if (i < number) { goto ldv_48898; } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared"), "i" (424), "i" (12UL)); ldv_48916: ; goto ldv_48916; } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared"), "i" (425), "i" (12UL)); ldv_48917: ; goto ldv_48917; } else { } } else { } if (have == want) { return (old_pages); } else { } bytes = (unsigned int )want * 8U; tmp___3 = kzalloc((size_t )bytes, 208U); new_pages = (struct page **)tmp___3; if ((unsigned long )new_pages == (unsigned long )((struct page **)0)) { tmp___4 = vzalloc((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 { } if (want >= have) { i = 0U; goto ldv_48919; ldv_48918: *(new_pages + (unsigned long )i) = *(old_pages + (unsigned long )i); i = i + 1U; ldv_48919: ; if ((unsigned long )i < have) { goto ldv_48918; } else { } goto ldv_48922; ldv_48921: 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 { } bm_store_page_idx(page, (unsigned long )i); *(new_pages + (unsigned long )i) = page; i = i + 1U; ldv_48922: ; if ((unsigned long )i < want) { goto ldv_48921; } else { } } else { i = 0U; goto ldv_48925; ldv_48924: *(new_pages + (unsigned long )i) = *(old_pages + (unsigned long )i); i = i + 1U; ldv_48925: ; if ((unsigned long )i < want) { goto ldv_48924; } else { } } if (vmalloced != 0U) { b->bm_flags = (enum bm_flag )((unsigned int )b->bm_flags | 65536U); } else { b->bm_flags = (enum bm_flag )((unsigned int )b->bm_flags & 4294901759U); } return (new_pages); } } int drbd_bm_init(struct drbd_conf *mdev ) { struct drbd_bitmap *b ; int __ret_warn_on ; long tmp ; void *tmp___0 ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; { b = mdev->bitmap; __ret_warn_on = (unsigned long )b != (unsigned long )((struct drbd_bitmap *)0); tmp = 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 482); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___0 = kzalloc(400UL, 208U); b = (struct drbd_bitmap *)tmp___0; if ((unsigned long )b == (unsigned long )((struct drbd_bitmap *)0)) { return (-12); } else { } spinlock_check(& b->bm_lock); __raw_spin_lock_init(& b->bm_lock.ldv_5990.rlock, "&(&b->bm_lock)->rlock", & __key); __mutex_init(& b->bm_change, "&b->bm_change", & __key___0); __init_waitqueue_head(& b->bm_io_wait, "&b->bm_io_wait", & __key___1); mdev->bitmap = b; return (0); } } sector_t drbd_bm_capacity(struct drbd_conf *mdev ) { int _b ; { _b = (unsigned long )mdev->bitmap == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_capacity", (char *)"!mdev->bitmap", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 497); } else { } if (_b != 0) { return (0UL); } else { } return ((mdev->bitmap)->bm_dev_capacity); } } void drbd_bm_cleanup(struct drbd_conf *mdev ) { int _b ; { _b = (unsigned long )mdev->bitmap == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_cleanup", (char *)"!mdev->bitmap", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 505); } else { } if (_b != 0) { return; } else { } bm_free_pages((mdev->bitmap)->bm_pages, (mdev->bitmap)->bm_number_of_pages); bm_vk_free((void *)(mdev->bitmap)->bm_pages, (int )(mdev->bitmap)->bm_flags & 65536); kfree((void const *)mdev->bitmap); mdev->bitmap = 0; return; } } static int bm_clear_surplus(struct drbd_bitmap *b ) { unsigned long mask ; unsigned long *p_addr ; unsigned long *bm ; int tmp ; int cleared ; unsigned long tmp___0 ; { cleared = 0; tmp = (int )b->bm_bits & 32767; mask = (1UL << (tmp & 63)) - 1UL; mask = mask; p_addr = bm_map_pidx(b, (unsigned int )b->bm_number_of_pages - 1U); bm = p_addr + (unsigned long )(tmp / 64); if (mask != 0UL) { tmp___0 = hweight_long(*bm & ~ mask); cleared = (int )tmp___0; *bm = *bm & mask; bm = bm + 1; } else { } bm_unmap(p_addr); return (cleared); } } static void bm_set_surplus(struct drbd_bitmap *b ) { unsigned long mask ; unsigned long *p_addr ; unsigned long *bm ; int tmp ; { tmp = (int )b->bm_bits & 32767; mask = (1UL << (tmp & 63)) - 1UL; mask = mask; p_addr = bm_map_pidx(b, (unsigned int )b->bm_number_of_pages - 1U); bm = p_addr + (unsigned long )(tmp / 64); if (mask != 0UL) { *bm = *bm | ~ mask; bm = bm + 1; } else { } bm_unmap(p_addr); return; } } static unsigned long bm_count_bits(struct drbd_bitmap *b ) { unsigned long *p_addr ; unsigned long bits ; unsigned long mask ; int idx ; int i ; int last_word ; unsigned long tmp ; unsigned long tmp___0 ; unsigned long tmp___1 ; { bits = 0UL; mask = (1UL << ((int )b->bm_bits & 63)) - 1UL; idx = 0; goto ldv_48977; ldv_48976: p_addr = __bm_map_pidx(b, (unsigned int )idx); i = 0; goto ldv_48973; ldv_48972: tmp = hweight_long(*(p_addr + (unsigned long )i)); bits = tmp + bits; i = i + 1; ldv_48973: ; if ((unsigned int )i <= 511U) { goto ldv_48972; } else { } __bm_unmap(p_addr); __might_sleep("/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 605, 0); _cond_resched(); idx = idx + 1; ldv_48977: ; if ((size_t )idx < b->bm_number_of_pages - 1UL) { goto ldv_48976; } else { } last_word = (int )(((b->bm_bits - 1UL) & 32767UL) >> 6); p_addr = __bm_map_pidx(b, (unsigned int )idx); i = 0; goto ldv_48980; ldv_48979: tmp___0 = hweight_long(*(p_addr + (unsigned long )i)); bits = tmp___0 + bits; i = i + 1; ldv_48980: ; if (i < last_word) { goto ldv_48979; } else { } *(p_addr + (unsigned long )last_word) = (unsigned long )((unsigned long long )*(p_addr + (unsigned long )last_word) & (unsigned long long )mask); tmp___1 = hweight_long(*(p_addr + (unsigned long )last_word)); bits = tmp___1 + bits; __bm_unmap(p_addr); return (bits); } } static void bm_memset(struct drbd_bitmap *b , size_t offset , int c , size_t len ) { unsigned long *p_addr ; unsigned long *bm ; unsigned int idx ; size_t do_now ; size_t end ; size_t __min1 ; size_t __min2 ; { end = offset + len; if (b->bm_words < end) { printk("<1>drbd: bm_memset end > bm_words\n"); return; } else { } goto ldv_48997; ldv_48996: __min1 = (offset + 512UL) & 0xfffffffffffffe00UL; __min2 = end; do_now = (__min1 < __min2 ? __min1 : __min2) - offset; idx = bm_word_to_page_idx(b, offset); p_addr = bm_map_pidx(b, idx); bm = p_addr + (offset & 511UL); if ((unsigned long )(bm + do_now) > (unsigned long )(p_addr + 512UL)) { printk("<1>drbd: BUG BUG BUG! p_addr:%p bm:%p do_now:%d\n", p_addr, bm, (int )do_now); } else { memset((void *)bm, c, do_now * 8UL); } bm_unmap(p_addr); bm_set_page_need_writeout(*(b->bm_pages + (unsigned long )idx)); offset = offset + do_now; ldv_48997: ; if (offset < end) { goto ldv_48996; } else { } return; } } int drbd_bm_resize(struct drbd_conf *mdev , sector_t capacity , int set_new_bits ) { struct drbd_bitmap *b ; unsigned long bits ; unsigned long words ; unsigned long owords ; unsigned long obits ; unsigned long want ; unsigned long have ; unsigned long onpages ; struct page **npages ; struct page **opages ; int err ; int growing ; int opages_vmalloced ; int _b ; unsigned long tmp ; unsigned long tmp___0 ; size_t tmp___1 ; sector_t tmp___2 ; u64 bits_on_disk ; int tmp___3 ; int tmp___4 ; { b = mdev->bitmap; opages = 0; err = 0; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_resize", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 668); } else { } if (_b != 0) { return (-12); } else { } drbd_bm_lock(mdev, (char *)"resize", BM_LOCKED_MASK); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_bm_resize called with capacity == %llu\n", (unsigned long long )capacity); if (b->bm_dev_capacity == capacity) { goto out; } else { } opages_vmalloced = (int )b->bm_flags & 65536; if (capacity == 0UL) { spin_lock_irq(& b->bm_lock); opages = b->bm_pages; onpages = b->bm_number_of_pages; owords = b->bm_words; b->bm_pages = 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) { bits_on_disk = ((unsigned long long )(mdev->ldev)->md.md_size_sect - 72ULL) << 12; put_ldev(mdev); if ((unsigned long long )bits > bits_on_disk) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "bits = %lu\n", bits); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "bits_on_disk = %llu\n", bits_on_disk); err = -28; goto out; } else { } } else { } want = (words * 8UL + 4095UL) >> 12; have = b->bm_number_of_pages; if (want == have) { if ((unsigned long )b->bm_pages == (unsigned long )((struct page **)0)) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( b->bm_pages != NULL ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 719); } 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 { } bm_clear_surplus(b); spin_unlock_irq(& b->bm_lock); if ((unsigned long )opages != (unsigned long )npages) { bm_vk_free((void *)opages, opages_vmalloced); } else { } if (growing == 0) { b->bm_set = bm_count_bits(b); } else { } _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "resync bitmap: bits=%lu words=%lu pages=%lu\n", bits, words, want); out: drbd_bm_unlock(mdev); return (err); } } unsigned long _drbd_bm_total_weight(struct drbd_conf *mdev ) { struct drbd_bitmap *b ; unsigned long s ; unsigned long flags ; int _b ; int _b___0 ; raw_spinlock_t *tmp ; { b = mdev->bitmap; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "_drbd_bm_total_weight", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 790); } else { } if (_b != 0) { return (0UL); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "_drbd_bm_total_weight", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 791); } 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), "ASSERT FAILED: %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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 814); } else { } if (_b != 0) { return (0UL); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_words", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 815); } else { } if (_b___0 != 0) { return (0UL); } else { } return (b->bm_words); } } unsigned long drbd_bm_bits(struct drbd_conf *mdev ) { struct drbd_bitmap *b ; int _b ; { b = mdev->bitmap; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_bits", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 823); } else { } if (_b != 0) { return (0UL); } else { } return (b->bm_bits); } } void drbd_bm_merge_lel(struct drbd_conf *mdev , size_t offset , size_t number , unsigned long *buffer ) { struct drbd_bitmap *b ; unsigned long *p_addr ; unsigned long *bm ; unsigned long word ; unsigned long bits ; unsigned int idx ; size_t end ; size_t do_now ; int _b ; int _b___0 ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; size_t __min1 ; size_t __min2 ; 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), "ASSERT FAILED: %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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 844); } else { } if (_b != 0) { return; } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_merge_lel", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 845); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 848); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 849); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); spin_lock_irq(& b->bm_lock); goto ldv_49086; ldv_49085: __min1 = (offset + 512UL) & 0xfffffffffffffe00UL; __min2 = end; do_now = (__min1 < __min2 ? __min1 : __min2) - offset; idx = bm_word_to_page_idx(b, offset); p_addr = bm_map_pidx(b, idx); bm = p_addr + (offset & 511UL); offset = offset + do_now; goto ldv_49083; ldv_49082: bits = hweight_long(*bm); tmp___1 = buffer; buffer = buffer + 1; word = *bm | *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_49083: tmp___4 = do_now; do_now = do_now - (size_t )1; if (tmp___4 != 0UL) { goto ldv_49082; } else { } bm_unmap(p_addr); bm_set_page_need_writeout(*(b->bm_pages + (unsigned long )idx)); ldv_49086: ; if (offset < end) { goto ldv_49085; } 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 int tmp ; unsigned long *tmp___0 ; unsigned long *tmp___1 ; size_t tmp___2 ; { b = mdev->bitmap; end = offset + number; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_get_lel", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 889); } else { } if (_b != 0) { return; } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_get_lel", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 890); } 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_49111; ldv_49110: __min1 = (offset + 512UL) & 0xfffffffffffffe00UL; __min2 = end; do_now = (__min1 < __min2 ? __min1 : __min2) - offset; tmp = bm_word_to_page_idx(b, offset); p_addr = bm_map_pidx(b, tmp); bm = p_addr + (offset & 511UL); offset = offset + do_now; goto ldv_49108; ldv_49107: tmp___0 = buffer; buffer = buffer + 1; tmp___1 = bm; bm = bm + 1; *tmp___0 = *tmp___1; ldv_49108: tmp___2 = do_now; do_now = do_now - (size_t )1; if (tmp___2 != 0UL) { goto ldv_49107; } else { } bm_unmap(p_addr); ldv_49111: ; if (offset < end) { goto ldv_49110; } 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), "ASSERT FAILED: %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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 918); } else { } if (_b != 0) { return; } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_set_all", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 919); } else { } if (_b___0 != 0) { return; } else { } spin_lock_irq(& b->bm_lock); bm_memset(b, 0UL, 255, b->bm_words); bm_clear_surplus(b); b->bm_set = b->bm_bits; spin_unlock_irq(& b->bm_lock); return; } } void drbd_bm_clear_all(struct drbd_conf *mdev ) { struct drbd_bitmap *b ; int _b ; int _b___0 ; { b = mdev->bitmap; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_clear_all", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 932); } else { } if (_b != 0) { return; } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_clear_all", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 933); } 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_aio_ctx_destroy(struct kref *kref ) { struct bm_aio_ctx *ctx ; struct kref const *__mptr ; { __mptr = (struct kref const *)kref; ctx = (struct bm_aio_ctx *)__mptr + 0xffffffffffffffe8UL; put_ldev(ctx->mdev); kfree((void const *)ctx); return; } } static void bm_async_io_complete(struct bio *bio , int error ) { struct bm_aio_ctx *ctx ; struct drbd_conf *mdev ; struct drbd_bitmap *b ; unsigned int idx ; unsigned long tmp ; int uptodate ; int tmp___0 ; int tmp___1 ; struct _ddebug descriptor ; long tmp___2 ; int tmp___3 ; { ctx = (struct bm_aio_ctx *)bio->bi_private; mdev = ctx->mdev; b = mdev->bitmap; tmp = bm_page_to_idx((bio->bi_io_vec)->bv_page); idx = (unsigned int )tmp; uptodate = (int )bio->bi_flags & 1; if (error == 0 && uptodate == 0) { error = -5; } else { } if ((ctx->flags & 1U) == 0U) { tmp___0 = bm_test_page_unchanged(*(b->bm_pages + (unsigned long )idx)); if (tmp___0 == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "bitmap page idx %u changed during IO!\n", idx); } else { } } else { } if (error != 0) { ctx->error = error; bm_set_page_io_err(*(b->bm_pages + (unsigned long )idx)); tmp___1 = ___ratelimit(& drbd_ratelimit_state, "bm_async_io_complete"); if (tmp___1 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "IO ERROR %d on bitmap page idx %u\n", error, idx); } else { } } else { bm_clear_page_io_err(*(b->bm_pages + (unsigned long )idx)); descriptor.modname = "drbd"; descriptor.function = "bm_async_io_complete"; descriptor.filename = "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared"; descriptor.format = "bitmap page idx %u completed\n"; descriptor.lineno = 992U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& (mdev->vdisk)->part0.__dev), "bitmap page idx %u completed\n", idx); } else { } } bm_page_unlock_io(mdev, (int )idx); if ((int )ctx->flags & 1) { mempool_free((void *)(bio->bi_io_vec)->bv_page, drbd_md_io_page_pool); } else { } bio_put(bio); tmp___3 = atomic_dec_and_test(& ctx->in_flight); if (tmp___3 != 0) { ctx->done = 1U; __wake_up(& mdev->misc_wait, 3U, 1, 0); kref_put(& ctx->kref, & bm_aio_ctx_destroy); } else { } return; } } static void bm_page_io_async(struct bm_aio_ctx *ctx , int page_nr , int rw ) { struct bio *bio ; struct bio *tmp ; struct drbd_conf *mdev ; struct drbd_bitmap *b ; struct page *page ; unsigned int len ; sector_t on_disk_sector ; unsigned int __min1 ; unsigned int __min2 ; sector_t tmp___0 ; void *src ; void *dest ; void *tmp___1 ; size_t __len ; void *__ret ; int tmp___2 ; { tmp = bio_alloc_drbd(16U); bio = tmp; mdev = ctx->mdev; b = mdev->bitmap; on_disk_sector = (sector_t )((mdev->ldev)->md.md_offset + (u64 )(mdev->ldev)->md.bm_offset); on_disk_sector = ((unsigned long )page_nr << 3) + on_disk_sector; __min1 = 4096U; tmp___0 = drbd_md_last_sector(mdev->ldev); __min2 = (((unsigned int )tmp___0 - (unsigned int )on_disk_sector) + 1U) << 9U; len = __min1 < __min2 ? __min1 : __min2; bm_page_lock_io(mdev, page_nr); bm_set_page_unchanged(*(b->bm_pages + (unsigned long )page_nr)); if ((int )ctx->flags & 1) { tmp___1 = mempool_alloc(drbd_md_io_page_pool, 18U); page = (struct page *)tmp___1; dest = kmap_atomic(page); src = kmap_atomic(*(b->bm_pages + (unsigned long )page_nr)); __len = 4096UL; if (__len > 63UL) { __ret = memcpy(dest, (void const *)src, __len); } else { __ret = memcpy(dest, (void const *)src, __len); } __kunmap_atomic(src); __kunmap_atomic(dest); bm_store_page_idx(page, (unsigned long )page_nr); } else { page = *(b->bm_pages + (unsigned long )page_nr); } bio->bi_bdev = (mdev->ldev)->md_bdev; bio->bi_sector = on_disk_sector; bio_add_page(bio, page, len, 0U); bio->bi_private = (void *)ctx; bio->bi_end_io = & bm_async_io_complete; tmp___2 = drbd_insert_fault(mdev, rw & 1 ? 0U : 1U); if (tmp___2 != 0) { bio->bi_rw = bio->bi_rw | (unsigned long )rw; bio_endio(bio, -5); } else { submit_bio(rw, bio); atomic_add((int )(len >> 9), & mdev->rs_sect_ev); } return; } } static int bm_rw(struct drbd_conf *mdev , int rw , unsigned int flags , unsigned int lazy_writeout_upper_idx ) { struct bm_aio_ctx *ctx ; struct drbd_bitmap *b ; int num_pages ; int i ; int count ; unsigned long now ; char ppb[10U] ; int err ; void *tmp ; struct bm_aio_ctx __constr_expr_0 ; int tmp___0 ; int __ret_warn_on ; long tmp___1 ; struct _ddebug descriptor ; long tmp___2 ; int tmp___3 ; struct _ddebug descriptor___0 ; long tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; char *tmp___8 ; { b = mdev->bitmap; count = 0; err = 0; tmp = kmalloc(32UL, 16U); ctx = (struct bm_aio_ctx *)tmp; if ((unsigned long )ctx == (unsigned long )((struct bm_aio_ctx *)0)) { return (-12); } else { } __constr_expr_0.mdev = mdev; __constr_expr_0.in_flight.counter = 1; __constr_expr_0.done = 0U; __constr_expr_0.flags = flags; __constr_expr_0.error = 0; __constr_expr_0.kref.refcount.counter = 2; *ctx = __constr_expr_0; tmp___0 = _get_ldev_if_state(mdev, D_ATTACHING); if (tmp___0 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: get_ldev_if_state() == 1 in bm_rw()\n"); kfree((void const *)ctx); return (-19); } else { } if (ctx->flags == 0U) { __ret_warn_on = ((unsigned int )b->bm_flags & 15U) == 0U; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1105); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } else { } num_pages = (int )b->bm_number_of_pages; now = jiffies; i = 0; goto ldv_49198; ldv_49197: ; if (lazy_writeout_upper_idx != 0U && (unsigned int )i == lazy_writeout_upper_idx) { goto ldv_49191; } else { } if (rw & 1) { tmp___3 = bm_test_page_unchanged(*(b->bm_pages + (unsigned long )i)); if (tmp___3 != 0) { descriptor.modname = "drbd"; descriptor.function = "bm_rw"; descriptor.filename = "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared"; descriptor.format = "skipped bm write for idx %u\n"; descriptor.lineno = 1118U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& (mdev->vdisk)->part0.__dev), "skipped bm write for idx %u\n", i); } else { } goto ldv_49194; } else { } if (lazy_writeout_upper_idx != 0U) { tmp___5 = bm_test_page_lazy_writeout(*(b->bm_pages + (unsigned long )i)); if (tmp___5 == 0) { descriptor___0.modname = "drbd"; descriptor___0.function = "bm_rw"; descriptor___0.filename = "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared"; descriptor___0.format = "skipped bm lazy write for idx %u\n"; descriptor___0.lineno = 1125U; descriptor___0.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___4 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)(& (mdev->vdisk)->part0.__dev), "skipped bm lazy write for idx %u\n", i); } else { } goto ldv_49194; } else { } } else { } } else { } atomic_inc(& ctx->in_flight); bm_page_io_async(ctx, i, rw); count = count + 1; __might_sleep("/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1132, 0); _cond_resched(); ldv_49194: i = i + 1; ldv_49198: ; if (i < num_pages) { goto ldv_49197; } else { } ldv_49191: tmp___6 = atomic_dec_and_test(& ctx->in_flight); if (tmp___6 == 0) { wait_until_done_or_disk_failure(mdev, mdev->ldev, & ctx->done); } else { kref_put(& ctx->kref, & bm_aio_ctx_destroy); } _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "bitmap %s of %u pages took %lu jiffies\n", rw == 1 ? (char *)"WRITE" : (char *)"READ", count, (unsigned long )jiffies - now); if (ctx->error != 0) { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "we had at least one MD IO ERROR during bitmap IO\n"); drbd_chk_io_error_(mdev, 1, 1, "bm_rw"); err = -5; } else { } tmp___7 = atomic_read((atomic_t const *)(& ctx->in_flight)); if (tmp___7 != 0) { err = -5; } else { } now = jiffies; if (rw == 1) { drbd_md_flush(mdev); } else { b->bm_set = bm_count_bits(b); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "recounting of set bits took additional %lu jiffies\n", (unsigned long )jiffies - now); } now = b->bm_set; tmp___8 = 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___8, now); kref_put(& ctx->kref, & bm_aio_ctx_destroy); return (err); } } int drbd_bm_read(struct drbd_conf *mdev ) { int tmp ; { tmp = bm_rw(mdev, 0, 0U, 0U); return (tmp); } } int drbd_bm_write(struct drbd_conf *mdev ) { int tmp ; { tmp = bm_rw(mdev, 1, 0U, 0U); return (tmp); } } int drbd_bm_write_lazy(struct drbd_conf *mdev , unsigned int upper_idx ) { int tmp ; { tmp = bm_rw(mdev, 1, 1U, upper_idx); return (tmp); } } int drbd_bm_write_copy_pages(struct drbd_conf *mdev ) { int tmp ; { tmp = bm_rw(mdev, 1, 1U, 0U); return (tmp); } } int drbd_bm_write_page(struct drbd_conf *mdev , unsigned int idx ) { struct bm_aio_ctx *ctx ; int err ; struct _ddebug descriptor ; long tmp ; int tmp___0 ; void *tmp___1 ; struct bm_aio_ctx __constr_expr_0 ; int tmp___2 ; int tmp___3 ; { tmp___0 = bm_test_page_unchanged(*((mdev->bitmap)->bm_pages + (unsigned long )idx)); if (tmp___0 != 0) { descriptor.modname = "drbd"; descriptor.function = "drbd_bm_write_page"; descriptor.filename = "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared"; descriptor.format = "skipped bm page write for idx %u\n"; descriptor.lineno = 1243U; descriptor.flags = 0U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& (mdev->vdisk)->part0.__dev), "skipped bm page write for idx %u\n", idx); } else { } return (0); } else { } tmp___1 = kmalloc(32UL, 16U); ctx = (struct bm_aio_ctx *)tmp___1; if ((unsigned long )ctx == (unsigned long )((struct bm_aio_ctx *)0)) { return (-12); } else { } __constr_expr_0.mdev = mdev; __constr_expr_0.in_flight.counter = 1; __constr_expr_0.done = 0U; __constr_expr_0.flags = 1U; __constr_expr_0.error = 0; __constr_expr_0.kref.refcount.counter = 2; *ctx = __constr_expr_0; tmp___2 = _get_ldev_if_state(mdev, D_ATTACHING); if (tmp___2 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: get_ldev_if_state() == 1 in drbd_bm_write_page()\n"); kfree((void const *)ctx); return (-19); } else { } bm_page_io_async(ctx, (int )idx, 529); wait_until_done_or_disk_failure(mdev, mdev->ldev, & ctx->done); if (ctx->error != 0) { drbd_chk_io_error_(mdev, 1, 1, "drbd_bm_write_page"); } else { } mdev->bm_writ_cnt = mdev->bm_writ_cnt + 1U; tmp___3 = atomic_read((atomic_t const *)(& ctx->in_flight)); err = tmp___3 == 0 ? ctx->error : -5; kref_put(& ctx->kref, & bm_aio_ctx_destroy); return (err); } } 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 *p_addr ; unsigned long bit_offset ; unsigned int i ; unsigned int tmp ; unsigned long tmp___0 ; unsigned long tmp___1 ; { b = mdev->bitmap; if (b->bm_bits < bm_fo) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "bm_fo=%lu bm_bits=%lu\n", bm_fo, b->bm_bits); bm_fo = 0xffffffffffffffffUL; } else { goto ldv_49233; ldv_49232: bit_offset = bm_fo & 0xffffffffffff8000UL; tmp = bm_bit_to_page_idx(b, (u64 )bm_fo); p_addr = __bm_map_pidx(b, tmp); if ((int )find_zero_bit != 0) { tmp___0 = find_next_zero_bit_le((void const *)p_addr, 32768UL, bm_fo & 32767UL); i = (unsigned int )tmp___0; } else { tmp___1 = find_next_bit_le((void const *)p_addr, 32768UL, bm_fo & 32767UL); i = (unsigned int )tmp___1; } __bm_unmap(p_addr); if (i <= 32767U) { bm_fo = (unsigned long )i + bit_offset; if (b->bm_bits <= bm_fo) { goto ldv_49230; } else { } goto found; } else { } bm_fo = bit_offset + 32768UL; ldv_49233: ; if (b->bm_bits > bm_fo) { goto ldv_49232; } else { } ldv_49230: bm_fo = 0xffffffffffffffffUL; } found: ; return (bm_fo); } } static unsigned long bm_find_next(struct drbd_conf *mdev , unsigned long bm_fo , int const find_zero_bit ) { struct drbd_bitmap *b ; unsigned long i ; int _b ; int _b___0 ; { b = mdev->bitmap; i = 0xffffffffffffffffUL; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "bm_find_next", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1334); } else { } if (_b != 0) { return (i); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "bm_find_next", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1335); } else { } if (_b___0 != 0) { return (i); } else { } spin_lock_irq(& b->bm_lock); if (((unsigned int )b->bm_flags & 4U) != 0U) { __bm_print_lock_info(mdev, "bm_find_next"); } else { } i = __bm_find_next(mdev, bm_fo, find_zero_bit); 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); 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); return (tmp); } } static int __bm_change_bits_to(struct drbd_conf *mdev , unsigned long const s , unsigned long e , int val ) { struct drbd_bitmap *b ; unsigned long *p_addr ; unsigned long bitnr ; unsigned int last_page_nr ; int c ; int changed_total ; unsigned int page_nr ; unsigned int tmp ; int tmp___0 ; int tmp___1 ; { b = mdev->bitmap; p_addr = 0; last_page_nr = 4294967295U; c = 0; changed_total = 0; if (b->bm_bits <= e) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: bit_s=%lu bit_e=%lu bm_bits=%lu\n", s, e, b->bm_bits); e = b->bm_bits != 0UL ? b->bm_bits - 1UL : 0UL; } else { } bitnr = s; goto ldv_49272; ldv_49271: tmp = bm_bit_to_page_idx(b, (u64 )bitnr); page_nr = tmp; if (page_nr != last_page_nr) { if ((unsigned long )p_addr != (unsigned long )((unsigned long *)0)) { __bm_unmap(p_addr); } else { } if (c < 0) { bm_set_page_lazy_writeout(*(b->bm_pages + (unsigned long )last_page_nr)); } else if (c > 0) { bm_set_page_need_writeout(*(b->bm_pages + (unsigned long )last_page_nr)); } else { } changed_total = changed_total + c; c = 0; p_addr = __bm_map_pidx(b, page_nr); last_page_nr = page_nr; } else { } if (val != 0) { tmp___0 = __test_and_set_bit_le((int )bitnr & 32767, (void *)p_addr); c = (tmp___0 == 0) + c; } else { tmp___1 = __test_and_clear_bit_le((int )bitnr & 32767, (void *)p_addr); c = c - (tmp___1 != 0); } bitnr = bitnr + 1UL; ldv_49272: ; if (bitnr <= e) { goto ldv_49271; } else { } if ((unsigned long )p_addr != (unsigned long )((unsigned long *)0)) { __bm_unmap(p_addr); } else { } if (c < 0) { bm_set_page_lazy_writeout(*(b->bm_pages + (unsigned long )last_page_nr)); } else if (c > 0) { bm_set_page_need_writeout(*(b->bm_pages + (unsigned long )last_page_nr)); } else { } changed_total = changed_total + c; b->bm_set = b->bm_set + (unsigned long )changed_total; return (changed_total); } } static int bm_change_bits_to(struct drbd_conf *mdev , unsigned long const s , unsigned long const e , int val ) { unsigned long flags ; struct drbd_bitmap *b ; int c ; int _b ; int _b___0 ; raw_spinlock_t *tmp ; { b = mdev->bitmap; c = 0; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "bm_change_bits_to", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1436); } else { } if (_b != 0) { return (1); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "bm_change_bits_to", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1437); } else { } if (_b___0 != 0) { return (0); } else { } tmp = spinlock_check(& b->bm_lock); flags = _raw_spin_lock_irqsave(tmp); if (((val != 0 ? 2U : 1U) & (unsigned int )b->bm_flags) != 0U) { __bm_print_lock_info(mdev, "bm_change_bits_to"); } else { } c = __bm_change_bits_to(mdev, s, e, val); spin_unlock_irqrestore(& b->bm_lock, flags); return (c); } } int drbd_bm_set_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) { int tmp ; { tmp = bm_change_bits_to(mdev, s, e, 1); return (tmp); } } int drbd_bm_clear_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) { int tmp ; { tmp = bm_change_bits_to(mdev, s, e, 0); return (- tmp); } } __inline static void bm_set_full_words_within_one_page(struct drbd_bitmap *b , int page_nr , int first_word , int last_word ) { int i ; int bits ; unsigned long *paddr ; void *tmp ; unsigned long tmp___0 ; { tmp = kmap_atomic(*(b->bm_pages + (unsigned long )page_nr)); paddr = (unsigned long *)tmp; i = first_word; goto ldv_49311; ldv_49310: 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_49311: ; if (i < last_word) { goto ldv_49310; } else { } __kunmap_atomic((void *)paddr); return; } } void _drbd_bm_set_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) { struct drbd_bitmap *b ; unsigned long sl ; unsigned long el ; int first_page ; int last_page ; int page_nr ; int first_word ; int last_word ; { b = mdev->bitmap; sl = ((unsigned long )s + 63UL) & 0xffffffffffffffc0UL; el = ((unsigned long )e + 1UL) & 0xffffffffffffffc0UL; if ((unsigned long )e - (unsigned long )s <= 192UL) { spin_lock_irq(& b->bm_lock); __bm_change_bits_to(mdev, s, e, 1); spin_unlock_irq(& b->bm_lock); return; } else { } spin_lock_irq(& b->bm_lock); if (sl != 0UL) { __bm_change_bits_to(mdev, s, sl - 1UL, 1); } else { } first_page = (int )(sl >> 15); last_page = (int )(el >> 15); first_word = (int )(sl >> 6) & 511; last_word = 512; page_nr = first_page; goto ldv_49328; ldv_49327: bm_set_full_words_within_one_page(mdev->bitmap, page_nr, first_word, last_word); spin_unlock_irq(& b->bm_lock); __might_sleep("/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1529, 0); _cond_resched(); first_word = 0; spin_lock_irq(& b->bm_lock); page_nr = page_nr + 1; ldv_49328: ; if (page_nr < last_page) { goto ldv_49327; } 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); } else { } spin_unlock_irq(& b->bm_lock); return; } } int drbd_bm_test_bit(struct drbd_conf *mdev , unsigned long const bitnr ) { unsigned long flags ; struct drbd_bitmap *b ; unsigned long *p_addr ; int i ; int _b ; int _b___0 ; raw_spinlock_t *tmp ; unsigned int tmp___0 ; int tmp___1 ; { b = mdev->bitmap; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_test_bit", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1562); } else { } if (_b != 0) { return (0); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_test_bit", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1563); } else { } if (_b___0 != 0) { return (0); } else { } tmp = spinlock_check(& b->bm_lock); flags = _raw_spin_lock_irqsave(tmp); if (((unsigned int )b->bm_flags & 4U) != 0U) { __bm_print_lock_info(mdev, "drbd_bm_test_bit"); } else { } if (b->bm_bits > (unsigned long )bitnr) { tmp___0 = bm_bit_to_page_idx(b, (u64 )bitnr); p_addr = bm_map_pidx(b, tmp___0); tmp___1 = test_bit_le((int )bitnr & 32767, (void const *)p_addr); i = tmp___1 != 0; bm_unmap(p_addr); } else if (b->bm_bits == (unsigned long )bitnr) { i = -1; } else { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "bitnr=%lu > bm_bits=%lu\n", bitnr, b->bm_bits); i = 0; } spin_unlock_irqrestore(& b->bm_lock, flags); return (i); } } int drbd_bm_count_bits(struct drbd_conf *mdev , unsigned long const s , unsigned long const e ) { unsigned long flags ; struct drbd_bitmap *b ; unsigned long *p_addr ; unsigned long bitnr ; unsigned int page_nr ; int c ; int _b ; int _b___0 ; raw_spinlock_t *tmp ; unsigned int idx ; unsigned int tmp___0 ; int tmp___1 ; int _b___1 ; { b = mdev->bitmap; p_addr = 0; page_nr = 4294967295U; c = 0; _b = (unsigned long )b == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_count_bits", (char *)"!b", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1597); } else { } if (_b != 0) { return (1); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_count_bits", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1598); } else { } if (_b___0 != 0) { return (1); } else { } tmp = spinlock_check(& b->bm_lock); flags = _raw_spin_lock_irqsave(tmp); if (((unsigned int )b->bm_flags & 4U) != 0U) { __bm_print_lock_info(mdev, "drbd_bm_count_bits"); } else { } bitnr = s; goto ldv_49369; ldv_49368: tmp___0 = bm_bit_to_page_idx(b, (u64 )bitnr); idx = tmp___0; if (page_nr != idx) { page_nr = idx; if ((unsigned long )p_addr != (unsigned long )((unsigned long *)0)) { bm_unmap(p_addr); } else { } p_addr = bm_map_pidx(b, idx); } else { } _b___1 = b->bm_bits <= bitnr; if (_b___1 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_count_bits", (char *)"bitnr >= b->bm_bits", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1611); } else { } if (_b___1 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "bitnr=%lu bm_bits=%lu\n", bitnr, b->bm_bits); } else { tmp___1 = test_bit_le((int )((unsigned int )bitnr - (page_nr << 15)), (void const *)p_addr); c = (tmp___1 != 0) + c; } bitnr = bitnr + 1UL; ldv_49369: ; if (bitnr <= (unsigned long )e) { goto ldv_49368; } 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 ; unsigned long _min1 ; size_t _min2 ; int n ; unsigned int tmp___0 ; 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), "ASSERT FAILED: %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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1645); } else { } if (_b != 0) { return (0); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_e_weight", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1646); } else { } if (_b___0 != 0) { return (0); } else { } tmp = spinlock_check(& b->bm_lock); flags = _raw_spin_lock_irqsave(tmp); if (((unsigned int )b->bm_flags & 4U) != 0U) { __bm_print_lock_info(mdev, "drbd_bm_e_weight"); } else { } s = (int )(enr << 6); _min1 = (enr + 1UL) << 6; _min2 = b->bm_words; e = (int )(_min1 < _min2 ? _min1 : _min2); count = 0; if ((size_t )s < b->bm_words) { n = e - s; tmp___0 = bm_word_to_page_idx(b, (unsigned long )s); p_addr = bm_map_pidx(b, tmp___0); bm = p_addr + ((unsigned long )s & 511UL); goto ldv_49395; ldv_49394: tmp___1 = bm; bm = bm + 1; tmp___2 = hweight_long(*tmp___1); count = (int )((unsigned int )tmp___2 + (unsigned int )count); ldv_49395: tmp___3 = n; n = n - 1; if (tmp___3 != 0) { goto ldv_49394; } 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 ; unsigned long s ; unsigned long e ; int count ; int i ; int do_now ; int _b ; int _b___0 ; size_t __min1 ; size_t __min2 ; unsigned int tmp ; 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), "ASSERT FAILED: %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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1678); } else { } if (_b != 0) { return (0UL); } else { } _b___0 = (unsigned long )b->bm_pages == (unsigned long )((struct page **)0); if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_bm_ALe_set_all", (char *)"!b->bm_pages", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1679); } else { } if (_b___0 != 0) { return (0UL); } else { } spin_lock_irq(& b->bm_lock); if (((unsigned int )b->bm_flags & 2U) != 0U) { __bm_print_lock_info(mdev, "drbd_bm_ALe_set_all"); } else { } weight = b->bm_set; s = al_enr * 16UL; __min1 = s + 16UL; __min2 = b->bm_words; e = __min1 < __min2 ? __min1 : __min2; if ((e - 1UL) >> 9 != s >> 9) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( (e-1) >> (PAGE_SHIFT - LN2_BPL + 3) == s >> (PAGE_SHIFT - LN2_BPL + 3) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_bitmap.c.prepared", 1690); } else { } count = 0; if (b->bm_words > s) { do_now = (int )((unsigned int )e - (unsigned int )s); i = do_now; tmp = bm_word_to_page_idx(b, s); p_addr = bm_map_pidx(b, tmp); bm = p_addr + (s & 511UL); goto ldv_49419; ldv_49418: tmp___0 = hweight_long(*bm); count = (int )((unsigned int )tmp___0 + (unsigned int )count); *bm = 0xffffffffffffffffUL; bm = bm + 1; ldv_49419: tmp___1 = i; i = i - 1; if (tmp___1 != 0) { goto ldv_49418; } else { } bm_unmap(p_addr); b->bm_set = b->bm_set + (unsigned long )(do_now * 64 - count); if (b->bm_words == e) { 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 (%lu) too large in drbd_bm_ALe_set_all\n", s); } weight = b->bm_set - weight; spin_unlock_irq(& b->bm_lock); return (weight); } } void ldv_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_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_5(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_6(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_7(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_8(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_9(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___7 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_10(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_11(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bm_change_of_drbd_bitmap(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_29(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_30(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 ) ; void ldv_mutex_lock_28(struct mutex *ldv_func_arg1 ) ; extern struct module __this_module ; extern bool try_module_get(struct module * ) ; extern void module_put(struct module * ) ; __inline static struct proc_inode *PROC_I(struct inode const *inode ) { struct inode const *__mptr ; { __mptr = inode; return ((struct proc_inode *)__mptr + 0xffffffffffffffc0UL); } } __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 int shift ; unsigned long left ; unsigned long total ; unsigned long tmp___1 ; { if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 288U || (unsigned int )*((unsigned short *)mdev + 1138UL) == 304U) { *bits_left = mdev->ov_left; } else { tmp = drbd_bm_total_weight(mdev); *bits_left = tmp - mdev->rs_failed; } if (*bits_left > mdev->rs_total) { __asm__ volatile ("": : : "memory"); tmp___0 = drbd_conn_str((enum drbd_conns )mdev->state.ldv_38745.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 { shift = mdev->rs_total > 4294967295UL ? 16U : 10U; left = *bits_left >> (int )shift; total = (mdev->rs_total >> (int )shift) + 1UL; tmp___1 = 1000UL - (left * 1000UL) / total; *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 ) ; static int drbd_proc_release(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, & drbd_proc_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void seq_printf_with_thousands_grouping(struct seq_file *seq , long v ) { long tmp ; long tmp___0 ; { tmp___0 = ldv__builtin_expect(v > 999999L, 0L); if (tmp___0 != 0L) { seq_printf(seq, "%ld,", v / 1000000L); v = v % 1000000L; seq_printf(seq, "%03ld,%03ld", v / 1000L, v % 1000L); } else { tmp = ldv__builtin_expect(v > 999L, 1L); if (tmp != 0L) { seq_printf(seq, "%ld,%03ld", v / 1000L, v % 1000L); } else { seq_printf(seq, "%ld", v); } } return; } } static void drbd_syncer_progress(struct drbd_conf *mdev , struct seq_file *seq ) { unsigned long db ; unsigned long dt ; unsigned long dbdt ; unsigned long rt ; unsigned long rs_left ; unsigned int res ; int i ; int x ; int y ; int stalled ; unsigned long bm_bits ; unsigned long tmp ; unsigned long bit_pos ; { stalled = 0; drbd_get_syncer_progress(mdev, & rs_left, & res); x = (int )(res / 50U); y = 20 - x; seq_printf(seq, "\t["); i = 1; goto ldv_49654; ldv_49653: seq_printf(seq, "="); i = i + 1; ldv_49654: ; if (i < x) { goto ldv_49653; } else { } seq_printf(seq, ">"); i = 0; goto ldv_49657; ldv_49656: seq_printf(seq, "."); i = i + 1; ldv_49657: ; if (i < y) { goto ldv_49656; } else { } seq_printf(seq, "] "); if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 288U || (unsigned int )*((unsigned short *)mdev + 1138UL) == 304U) { seq_printf(seq, "verified:"); } else { seq_printf(seq, "sync\'ed:"); } seq_printf(seq, "%3u.%u%% ", res / 10U, res % 10U); if (mdev->rs_total > 1048576UL) { seq_printf(seq, "(%lu/%lu)M", (rs_left >> 10) << 2, (mdev->rs_total >> 10) << 2); } else { seq_printf(seq, "(%lu/%lu)K\n\t", rs_left << 2, mdev->rs_total << 2); } i = (mdev->rs_last_mark + 2) % 8; dt = ((unsigned long )jiffies - mdev->rs_mark_time[i]) / 250UL; if (dt > 6000UL) { stalled = 1; } else { } if (dt == 0UL) { dt = dt + 1UL; } else { } db = mdev->rs_mark_left[i] - rs_left; rt = ((rs_left / (db / 100UL + 1UL)) * dt) / 100UL; seq_printf(seq, "finish: %lu:%02lu:%02lu", rt / 3600UL, (rt % 3600UL) / 60UL, rt % 60UL); dbdt = db / dt << 2; seq_printf(seq, " speed: "); seq_printf_with_thousands_grouping(seq, (long )dbdt); seq_printf(seq, " ("); if (proc_details > 0) { i = (mdev->rs_last_mark + 7) % 8; dt = ((unsigned long )jiffies - mdev->rs_mark_time[i]) / 250UL; if (dt == 0UL) { dt = dt + 1UL; } else { } db = mdev->rs_mark_left[i] - rs_left; dbdt = db / dt << 2; seq_printf_with_thousands_grouping(seq, (long )dbdt); seq_printf(seq, " -- "); } else { } dt = (((unsigned long )jiffies - mdev->rs_start) - mdev->rs_paused) / 250UL; if (dt == 0UL) { dt = 1UL; } else { } db = mdev->rs_total - rs_left; dbdt = db / dt << 2; seq_printf_with_thousands_grouping(seq, (long )dbdt); seq_printf(seq, ")"); if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 272U || (unsigned int )*((unsigned short *)mdev + 1138UL) == 288U) { seq_printf(seq, " want: "); seq_printf_with_thousands_grouping(seq, (long )mdev->c_sync_rate); } else { } seq_printf(seq, " K/sec%s\n", stalled != 0 ? (char *)" (stalled)" : (char *)""); if (proc_details > 0) { tmp = drbd_bm_bits(mdev); bm_bits = tmp; if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 288U || (unsigned int )*((unsigned short *)mdev + 1138UL) == 304U) { bit_pos = bm_bits - mdev->ov_left; } else { bit_pos = mdev->bm_resync_fo; } seq_printf(seq, "\t%3d%% sector pos: %llu/%llu\n", (int )(bit_pos / (bm_bits / 100UL + 1UL)), (unsigned long long )bit_pos * 8ULL, (unsigned long long )bm_bits * 8ULL); } else { } return; } } static void resync_dump_detail(struct seq_file *seq , struct lc_element *e ) { struct bm_extent *bme ; struct lc_element const *__mptr ; { __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[3U] ; 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; tmp = drbd_buildtag(); seq_printf(seq, "version: 8.3.13 (api:%d/proto:%d-%d)\n%s\n", 88, 86, 96, tmp); i = 0; goto ldv_49679; ldv_49678: mdev = minor_to_mdev((unsigned int )i); if ((unsigned long )mdev == (unsigned long )((struct drbd_conf *)0)) { hole = 1; goto ldv_49677; } else { } if (hole != 0) { hole = 0; seq_printf(seq, "\n"); } else { } sn = drbd_conn_str((enum drbd_conns )mdev->state.ldv_38745.conn); if (((unsigned int )*((unsigned short *)mdev + 1138UL) == 0U && (unsigned int )*((unsigned char *)mdev + 2277UL) == 0U) && (unsigned int )*((unsigned char *)mdev + 2276UL) == 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_38745.pdsk); tmp___8 = drbd_disk_str((enum drbd_disk_state )mdev->state.ldv_38745.disk); tmp___9 = drbd_role_str((enum drbd_role )mdev->state.ldv_38745.peer); tmp___10 = drbd_role_str((enum drbd_role )mdev->state.ldv_38745.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 + 2278UL) != 0U ? 97 : 45, (unsigned int )*((unsigned char *)mdev + 2278UL) != 0U ? 112 : 45, (unsigned int )*((unsigned char *)mdev + 2278UL) != 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:%llu\n", (unsigned long long )tmp___11 << 2); } if ((((unsigned int )*((unsigned short *)mdev + 1138UL) == 256U || (unsigned int )*((unsigned short *)mdev + 1138UL) == 272U) || (unsigned int )*((unsigned short *)mdev + 1138UL) == 288U) || (unsigned int )*((unsigned short *)mdev + 1138UL) == 304U) { drbd_syncer_progress(mdev, seq); } 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_49677: i = i + 1; ldv_49679: ; if ((unsigned int )i < minor_count) { goto ldv_49678; } else { } return (0); } } static int drbd_proc_open(struct inode *inode , struct file *file ) { struct proc_dir_entry *tmp ; int tmp___0 ; bool tmp___1 ; { tmp___1 = try_module_get(& __this_module); if ((int )tmp___1) { tmp = PDE((struct inode const *)inode); tmp___0 = single_open(file, & drbd_seq_show, tmp->data); return (tmp___0); } else { } return (-19); } } static int drbd_proc_release(struct inode *inode , struct file *file ) { int tmp ; { module_put(& __this_module); tmp = single_release(inode, file); return (tmp); } } 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_4 ; 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_49715; ldv_49714: tmp = nondet_int(); switch (tmp) { case 0: ; if (ldv_s_drbd_proc_fops_file_operations == 0) { ldv_handler_precall(); res_drbd_proc_open_4 = drbd_proc_open(var_group1, var_group2); ldv_check_return_value(res_drbd_proc_open_4); if (res_drbd_proc_open_4 != 0) { goto ldv_module_exit; } else { } ldv_s_drbd_proc_fops_file_operations = ldv_s_drbd_proc_fops_file_operations + 1; } else { } goto ldv_49711; case 1: ; if (ldv_s_drbd_proc_fops_file_operations == 1) { ldv_handler_precall(); drbd_proc_release(var_group1, var_group2); ldv_s_drbd_proc_fops_file_operations = 0; } else { } goto ldv_49711; default: ; goto ldv_49711; } ldv_49711: ; ldv_49715: tmp___0 = nondet_int(); if (tmp___0 != 0 || ldv_s_drbd_proc_fops_file_operations != 0) { goto ldv_49714; } 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_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_27(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_28(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_29(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_30(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 * , ...) ; extern int sprintf(char * , char const * , ...) ; __inline static void INIT_LIST_HEAD(struct list_head *list ) { { list->next = list; list->prev = list; return; } } extern void __list_add(struct list_head * , struct list_head * , struct list_head * ) ; __inline static void list_add(struct list_head *new , struct list_head *head ) { { __list_add(new, head, head->next); return; } } __inline static void list_add_tail(struct list_head *new , struct list_head *head ) { { __list_add(new, head->prev, head); return; } } extern void __list_del_entry(struct list_head * ) ; extern void list_del(struct list_head * ) ; __inline static void list_del_init(struct list_head *entry ) { { __list_del_entry(entry); INIT_LIST_HEAD(entry); return; } } __inline static int list_empty(struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)head->next) == (unsigned long )head); } } __inline static void __list_splice(struct list_head const *list , struct list_head *prev , struct list_head *next ) { struct list_head *first ; struct list_head *last ; { first = 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; } } extern int memcmp(void const * , void const * , size_t ) ; __inline static void *ERR_PTR(long error ) { { return ((void *)error); } } extern void __xchg_wrong_size(void) ; __inline static void atomic_set(atomic_t *v , int i ) { { v->counter = i; return; } } __inline static void atomic_sub(int i , atomic_t *v ) { { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; subl %1,%0": "+m" (v->counter): "ir" (i)); return; } } __inline static void atomic_dec(atomic_t *v ) { { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; decl %0": "+m" (v->counter)); return; } } __inline static int atomic_xchg(atomic_t *v , int new ) { int __ret ; { __ret = new; switch (4UL) { case 1UL: __asm__ volatile ("xchgb %b0, %1\n": "+q" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5538; case 2UL: __asm__ volatile ("xchgw %w0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5538; case 4UL: __asm__ volatile ("xchgl %0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5538; case 8UL: __asm__ volatile ("xchgq %q0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5538; default: __xchg_wrong_size(); } ldv_5538: ; return (__ret); } } extern void lockdep_init_map(struct lockdep_map * , char const * , struct lock_class_key * , int ) ; int ldv_mutex_trylock_40(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_41(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_43(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_45(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_unlock_50(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_52(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_39(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_42(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_44(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_47(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_49(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_51(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_5990.rlock); return; } } __inline static void spin_unlock(spinlock_t *lock ) { { _raw_spin_unlock(& lock->ldv_5990.rlock); return; } } extern void complete(struct completion * ) ; extern int mod_timer(struct timer_list * , unsigned long ) ; extern void add_timer(struct timer_list * ) ; __inline static int PageTail(struct page const *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((struct page const *)page); tmp___0 = ldv__builtin_expect(tmp != 0, 0L); if (tmp___0 != 0L) { return (page->ldv_12914.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->ldv_12901.ldv_12900.ldv_12899._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" (65), "i" (12UL)); ldv_19819: ; goto ldv_19819; } 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" (67), "i" (12UL)); ldv_19820: ; goto ldv_19820; } 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" (68), "i" (12UL)); ldv_19821: ; goto ldv_19821; } 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.raw_lock.ldv_2009.head_tail = 0U; __constr_expr_0.lock.magic = 3735899821U; __constr_expr_0.lock.owner_cpu = 4294967295U; __constr_expr_0.lock.owner = 0xffffffffffffffffUL; __constr_expr_0.lock.dep_map.key = 0; __constr_expr_0.lock.dep_map.class_cache[0] = 0; __constr_expr_0.lock.dep_map.class_cache[1] = 0; __constr_expr_0.lock.dep_map.name = "(*sem).lock"; __constr_expr_0.lock.dep_map.cpu = 0; __constr_expr_0.lock.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.dep_map, "semaphore->lock", & __key, 0); return; } } extern int down_interruptible(struct semaphore * ) ; extern int down_trylock(struct semaphore * ) ; extern void up(struct semaphore * ) ; __inline static loff_t i_size_read(struct inode const *inode ) { { return ((loff_t )inode->i_size); } } extern long schedule_timeout_interruptible(long ) ; extern void flush_signals(struct task_struct * ) ; extern void force_sig(int , struct task_struct * ) ; extern int sock_setsockopt(struct socket * , int , int , char * , unsigned int ) ; __inline static struct crypto_tfm *crypto_hash_tfm(struct crypto_hash *tfm ) { { return (& tfm->base); } } __inline static struct hash_tfm *crypto_hash_crt(struct crypto_hash *tfm ) { struct crypto_tfm *tmp ; { tmp = crypto_hash_tfm(tfm); return (& tmp->crt_u.hash); } } __inline static unsigned int crypto_hash_digestsize(struct crypto_hash *tfm ) { struct hash_tfm *tmp ; { tmp = crypto_hash_crt(tfm); return (tmp->digestsize); } } __inline static int crypto_hash_init(struct hash_desc *desc ) { struct hash_tfm *tmp ; int tmp___0 ; { tmp = crypto_hash_crt(desc->tfm); tmp___0 = (*(tmp->init))(desc); return (tmp___0); } } __inline static int crypto_hash_update(struct hash_desc *desc , struct scatterlist *sg , unsigned int nbytes ) { struct hash_tfm *tmp ; int tmp___0 ; { tmp = crypto_hash_crt(desc->tfm); tmp___0 = (*(tmp->update))(desc, sg, nbytes); return (tmp___0); } } __inline static int crypto_hash_final(struct hash_desc *desc , u8 *out ) { struct hash_tfm *tmp ; int tmp___0 ; { tmp = crypto_hash_crt(desc->tfm); tmp___0 = (*(tmp->final))(desc, out); return (tmp___0); } } extern struct bio *bio_clone(struct bio * , gfp_t ) ; extern void generic_make_request(struct bio * ) ; __inline static unsigned int queue_max_hw_sectors(struct request_queue *q ) { { return (q->limits.max_hw_sectors); } } __inline static enum drbd_thread_state get_t_state(struct drbd_thread *thi ) { { __asm__ volatile ("": : : "memory"); return (thi->t_state); } } __inline static unsigned int mdev_to_minor(struct drbd_conf *mdev ) { { return (mdev->minor); } } __inline static int drbd_get_data_sock(struct drbd_conf *mdev ) { long tmp ; { ldv_mutex_lock_44(& mdev->data.mutex); tmp = ldv__builtin_expect((unsigned long )mdev->data.socket == (unsigned long )((struct socket *)0), 0L); if (tmp != 0L) { ldv_mutex_unlock_45(& mdev->data.mutex); return (0); } else { } return (1); } } __inline static void drbd_put_data_sock(struct drbd_conf *mdev ) { { ldv_mutex_unlock_46(& mdev->data.mutex); return; } } void drbd_force_state(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val ) ; void _drbd_thread_stop(struct drbd_thread *thi , int restart , int wait ) ; void drbd_thread_current_set_cpu(struct drbd_conf *mdev ) ; int drbd_gen_and_send_sync_uuid(struct drbd_conf *mdev ) ; int _drbd_send_cmd(struct drbd_conf *mdev , struct socket *sock , enum drbd_packets cmd , struct p_header80 *h , size_t size , unsigned int msg_flags ) ; int drbd_send_cmd(struct drbd_conf *mdev , int use_data_socket , enum drbd_packets cmd , struct p_header80 *h , size_t size ) ; int drbd_send_ack(struct drbd_conf *mdev , enum drbd_packets cmd , struct drbd_epoch_entry *e ) ; int drbd_send_ack_ex(struct drbd_conf *mdev , enum drbd_packets cmd , sector_t sector , int blksize , u64 block_id ) ; int drbd_send_oos(struct drbd_conf *mdev , struct drbd_request *req ) ; int drbd_send_block(struct drbd_conf *mdev , enum drbd_packets cmd , struct drbd_epoch_entry *e ) ; int drbd_send_dblock(struct drbd_conf *mdev , struct drbd_request *req ) ; int drbd_send_drequest(struct drbd_conf *mdev , int cmd , sector_t sector , int size , u64 block_id ) ; int drbd_send_drequest_csum(struct drbd_conf *mdev , sector_t sector , int size , void *digest , int digest_size , enum drbd_packets cmd ) ; int drbd_send_ov_request(struct drbd_conf *mdev , sector_t sector , int size ) ; void drbd_mdev_cleanup(struct drbd_conf *mdev ) ; void drbd_print_uuids(struct drbd_conf *mdev , char const *text ) ; void drbd_md_sync(struct drbd_conf *mdev ) ; void drbd_uuid_set(struct drbd_conf *mdev , int idx , u64 val ) ; void _drbd_uuid_set(struct drbd_conf *mdev , int idx , u64 val ) ; void drbd_uuid_set_bm(struct drbd_conf *mdev , u64 val ) ; wait_queue_head_t drbd_pp_wait ; rwlock_t global_state_lock ; int drbd_khelper(struct drbd_conf *mdev , char *cmd ) ; int drbd_worker(struct drbd_thread *thi ) ; int drbd_alter_sa(struct drbd_conf *mdev , int na ) ; void drbd_start_resync(struct drbd_conf *mdev , enum drbd_conns side ) ; void resume_next_sg(struct drbd_conf *mdev ) ; void suspend_other_sg(struct drbd_conf *mdev ) ; int drbd_resync_finished(struct drbd_conf *mdev ) ; void drbd_md_put_buffer(struct drbd_conf *mdev ) ; void drbd_ov_oos_found(struct drbd_conf *mdev , sector_t sector , int size ) ; void drbd_rs_controller_reset(struct drbd_conf *mdev ) ; __inline static void ov_oos_print(struct drbd_conf *mdev ) { { if (mdev->ov_last_oos_size != 0UL) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Out of sync: start=%llu, size=%lu (sectors)\n", (unsigned long long )mdev->ov_last_oos_start, mdev->ov_last_oos_size); } else { } mdev->ov_last_oos_size = 0UL; return; } } void drbd_csum_bio(struct drbd_conf *mdev , struct crypto_hash *tfm , struct bio *bio , void *digest ) ; void drbd_csum_ee(struct drbd_conf *mdev , struct crypto_hash *tfm , struct drbd_epoch_entry *e , void *digest ) ; int w_read_retry_remote(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_e_end_data_req(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_e_end_rsdata_req(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_e_end_csum_rs_req(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_e_end_ov_reply(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_e_end_ov_req(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_ov_finished(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_resync_timer(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_send_write_hint(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_send_dblock(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_send_barrier(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_send_read_req(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_prev_work_done(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_restart_disk_io(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_send_oos(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; int w_start_resync(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; void resync_timer_fn(unsigned long data ) ; void start_resync_timer_fn(unsigned long data ) ; int drbd_rs_should_slow_down(struct drbd_conf *mdev , sector_t sector ) ; int drbd_submit_ee(struct drbd_conf *mdev , struct drbd_epoch_entry *e , unsigned int const rw , int const fault_type ) ; struct drbd_epoch_entry *drbd_alloc_ee(struct drbd_conf *mdev , u64 id , sector_t sector , unsigned int data_size , gfp_t gfp_mask ) ; void drbd_free_some_ee(struct drbd_conf *mdev , struct drbd_epoch_entry *e , int is_net ) ; __inline static int drbd_setsockopt(struct socket *sock , int level , int optname , char *optval , int optlen ) { int err ; { if (level == 1) { err = sock_setsockopt(sock, level, optname, optval, (unsigned int )optlen); } else { err = (*((sock->ops)->setsockopt))(sock, level, optname, optval, (unsigned int )optlen); } return (err); } } __inline static void drbd_tcp_cork(struct socket *sock ) { int val ; { val = 1; drbd_setsockopt(sock, 6, 3, (char *)(& val), 4); return; } } __inline static void drbd_tcp_uncork(struct socket *sock ) { int val ; { val = 0; drbd_setsockopt(sock, 6, 3, (char *)(& val), 4); return; } } void drbd_al_begin_io(struct drbd_conf *mdev , sector_t sector ) ; void drbd_al_complete_io(struct drbd_conf *mdev , sector_t sector ) ; void drbd_rs_complete_io(struct drbd_conf *mdev , sector_t sector ) ; int drbd_try_rs_begin_io(struct drbd_conf *mdev , sector_t sector ) ; void drbd_rs_cancel_all(struct drbd_conf *mdev ) ; int drbd_rs_del_all(struct drbd_conf *mdev ) ; void drbd_rs_failed_io(struct drbd_conf *mdev , sector_t sector , int size ) ; void drbd_advance_rs_marks(struct drbd_conf *mdev , unsigned long still_to_go ) ; void __drbd_set_in_sync(struct drbd_conf *mdev , sector_t sector , int size , char const *file , unsigned int const line ) ; int __drbd_set_out_of_sync(struct drbd_conf *mdev , sector_t sector , int size , char const *file , unsigned int const line ) ; __inline static struct page *page_chain_next(struct page *page ) { { return ((struct page *)page->ldv_12914.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_49371; ldv_49370: tmp = page_count(page); if (tmp > 1) { return (1); } else { } page = page_chain_next(page); ldv_49371: ; 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_49370; } else { goto ldv_49372; } } else { } ldv_49372: ; 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_49376; } 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_49379: 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_49378; } else { } schedule(); goto ldv_49379; ldv_49378: finish_wait(& mdev->misc_wait, & __wait); ldv_49376: ; 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 ; union drbd_state __ns___0 ; { 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.\n", where); } else { } if ((int )mdev->state.ldv_38745.disk > 4) { __ns.i = mdev->state.i; __ns.ldv_38745.disk = 4U; _drbd_set_state(mdev, __ns, CS_HARD, 0); } else { } goto ldv_49404; } else { } case 2: ; case 1: set_bit(19U, (unsigned long volatile *)(& mdev->flags)); if ((int )mdev->state.ldv_38745.disk > 2) { __ns___0.i = mdev->state.i; __ns___0.ldv_38745.disk = 2U; _drbd_set_state(mdev, __ns___0, CS_HARD, 0); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s. Detaching...\n", where); } else { } goto ldv_49404; } ldv_49404: ; return; } } __inline static sector_t drbd_get_capacity(struct block_device *bdev ) { loff_t tmp ; sector_t tmp___0 ; { if ((unsigned long )bdev != (unsigned long )((struct block_device *)0)) { tmp = i_size_read((struct inode const *)bdev->bd_inode); tmp___0 = (sector_t )(tmp >> 9); } else { tmp___0 = 0UL; } return (tmp___0); } } __inline static void drbd_queue_work(struct drbd_work_queue *q , struct drbd_work *w ) { unsigned long flags ; raw_spinlock_t *tmp ; { tmp = spinlock_check(& q->q_lock); flags = _raw_spin_lock_irqsave(tmp); list_add_tail(& w->list, & q->q); up(& q->s); spin_unlock_irqrestore(& q->q_lock, flags); return; } } __inline static void wake_asender(struct drbd_conf *mdev ) { int tmp ; { tmp = constant_test_bit(1U, (unsigned long const volatile *)(& mdev->flags)); if (tmp != 0) { force_sig(24, mdev->asender.task); } else { } return; } } __inline static void request_ping(struct drbd_conf *mdev ) { { set_bit(2U, (unsigned long volatile *)(& mdev->flags)); wake_asender(mdev); return; } } __inline static int drbd_send_short_cmd(struct drbd_conf *mdev , enum drbd_packets cmd ) { struct p_header80 h ; int tmp ; { tmp = drbd_send_cmd(mdev, 1, cmd, & h, 8UL); return (tmp); } } __inline static void drbd_thread_stop(struct drbd_thread *thi ) { { _drbd_thread_stop(thi, 0, 1); return; } } __inline static void inc_rs_pending(struct drbd_conf *mdev ) { { atomic_inc(& mdev->rs_pending_cnt); return; } } void drbd_md_io_complete(struct bio *bio , int error ) ; void drbd_endio_sec(struct bio *bio , int error ) ; void drbd_endio_pri(struct bio *bio , int error ) ; __inline static void drbd_req_make_private_bio(struct drbd_request *req , struct bio *bio_src ) { struct bio *bio ; { bio = bio_clone(bio_src, 16U); req->private_bio = bio; bio->bi_private = (void *)req; bio->bi_end_io = & drbd_endio_pri; bio->bi_next = 0; return; } } int __req_mod(struct drbd_request *req , enum drbd_req_event what , struct bio_and_error *m ) ; void complete_master_bio(struct drbd_conf *mdev , struct bio_and_error *m ) ; __inline static int _req_mod(struct drbd_request *req , enum drbd_req_event what ) { struct drbd_conf *mdev ; struct bio_and_error m ; int rv ; { mdev = req->mdev; rv = __req_mod(req, what, & m); if ((unsigned long )m.bio != (unsigned long )((struct bio *)0)) { complete_master_bio(mdev, & m); } else { } return (rv); } } __inline static int req_mod(struct drbd_request *req , enum drbd_req_event what ) { unsigned long flags ; struct drbd_conf *mdev ; struct bio_and_error m ; int rv ; raw_spinlock_t *tmp ; { mdev = req->mdev; tmp = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp); rv = __req_mod(req, what, & m); spin_unlock_irqrestore(& mdev->req_lock, flags); if ((unsigned long )m.bio != (unsigned long )((struct bio *)0)) { complete_master_bio(mdev, & m); } else { } return (rv); } } static int w_make_ov_request(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; static int w_make_resync_request(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) ; void drbd_md_io_complete(struct bio *bio , int error ) { struct drbd_md_io *md_io ; struct drbd_conf *mdev ; struct drbd_md_io const *__mptr ; { md_io = (struct drbd_md_io *)bio->bi_private; __mptr = (struct drbd_md_io const *)md_io; mdev = (struct drbd_conf *)__mptr + 0xfffffffffffff068UL; md_io->error = error; drbd_md_put_buffer(mdev); md_io->done = 1U; __wake_up(& mdev->misc_wait, 3U, 1, 0); bio_put(bio); put_ldev(mdev); 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_47524.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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 161); } 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(3U, (unsigned long const volatile *)(& e->flags)); if (tmp___1 != 0) { __drbd_chk_io_error____0(mdev, 0, "drbd_endio_read_sec_final"); } else { } spin_unlock_irqrestore(& mdev->req_lock, flags); drbd_queue_work(& mdev->data.work, & e->w); put_ldev(mdev); return; } } static void drbd_endio_write_sec_final(struct drbd_epoch_entry *e ) { unsigned long flags ; struct drbd_conf *mdev ; sector_t e_sector ; int do_wake ; int is_syncer_req ; int do_al_complete_io ; raw_spinlock_t *tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { flags = 0UL; mdev = e->mdev; if (e->ldv_47524.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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 187); } else { } e_sector = e->sector; do_al_complete_io = (int )e->flags & 1; is_syncer_req = e->ldv_47524.block_id == 0xffffffffffffffffULL; tmp = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp); mdev->writ_cnt = mdev->writ_cnt + (e->size >> 9); list_del(& e->w.list); list_add_tail(& e->w.list, & mdev->done_ee); if (is_syncer_req != 0) { tmp___0 = list_empty((struct list_head const *)(& mdev->sync_ee)); do_wake = tmp___0; } else { tmp___1 = list_empty((struct list_head const *)(& mdev->active_ee)); do_wake = tmp___1; } tmp___2 = constant_test_bit(3U, (unsigned long const volatile *)(& e->flags)); if (tmp___2 != 0) { __drbd_chk_io_error____0(mdev, 0, "drbd_endio_write_sec_final"); } else { } spin_unlock_irqrestore(& mdev->req_lock, flags); if (is_syncer_req != 0) { drbd_rs_complete_io(mdev, e_sector); } else { } if (do_wake != 0) { __wake_up(& mdev->ee_wait, 3U, 1, 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 ; int tmp___0 ; int tmp___1 ; { e = (struct drbd_epoch_entry *)bio->bi_private; mdev = e->mdev; uptodate = (int )bio->bi_flags & 1; is_write = (int )bio->bi_rw & 1; if (error != 0) { tmp = ___ratelimit(& drbd_ratelimit_state, "drbd_endio_sec"); if (tmp != 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 { } } else { } if (error == 0 && uptodate == 0) { tmp___0 = ___ratelimit(& drbd_ratelimit_state, "drbd_endio_sec"); if (tmp___0 != 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); } else { } error = -5; } else { } if (error != 0) { set_bit(3U, (unsigned long volatile *)(& e->flags)); } else { } bio_put(bio); tmp___1 = atomic_dec_and_test(& e->pending_bios); if (tmp___1 != 0) { if (is_write != 0) { drbd_endio_write_sec_final(e); } else { drbd_endio_read_sec_final(e); } } else { } return; } } void drbd_endio_pri(struct bio *bio , int error ) { unsigned long flags ; struct drbd_request *req ; struct drbd_conf *mdev ; struct bio_and_error m ; enum drbd_req_event what ; int uptodate ; long tmp ; void *tmp___0 ; raw_spinlock_t *tmp___1 ; { 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 & 4097UL) == 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; tmp___1 = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp___1); __req_mod(req, what, & m); spin_unlock_irqrestore(& mdev->req_lock, flags); put_ldev(mdev); if ((unsigned long )m.bio != (unsigned long )((struct bio *)0)) { complete_master_bio(mdev, & m); } else { } return; } } int w_read_retry_remote(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_request *req ; struct drbd_work const *__mptr ; int tmp ; { __mptr = (struct drbd_work const *)w; req = (struct drbd_request *)__mptr; spin_lock_irq(& mdev->req_lock); if (cancel != 0 || *((unsigned int *)mdev + 569UL) != 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); } } 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_49887; ldv_49886: sg_set_page(& sg, page, 4096U, 0U); crypto_hash_update(& desc, & sg, sg.length); page = tmp; ldv_49887: tmp = page_chain_next(page); if ((unsigned long )tmp != (unsigned long )((struct page *)0)) { goto ldv_49886; } 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 + (unsigned long )bio->bi_idx; i = (int )bio->bi_idx; goto ldv_49900; ldv_49899: 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_49900: ; if ((int )bio->bi_vcnt > i) { goto ldv_49899; } else { } crypto_hash_final(& desc, (u8 *)digest); return; } } int w_e_send_csum(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_epoch_entry *e ; struct drbd_work const *__mptr ; int digest_size ; void *digest ; int ok ; long tmp ; long tmp___0 ; unsigned int tmp___1 ; sector_t sector ; unsigned int size ; long tmp___2 ; { __mptr = (struct drbd_work const *)w; e = (struct drbd_epoch_entry *)__mptr; ok = 1; if (e->ldv_47524.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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 382); } else { } tmp = ldv__builtin_expect(cancel != 0, 0L); if (tmp != 0L) { goto out; } else { } tmp___0 = ldv__builtin_expect((e->flags & 8UL) != 0UL, 1L); if (tmp___0 != 0L) { goto out; } else { } tmp___1 = crypto_hash_digestsize(mdev->csums_tfm); digest_size = (int )tmp___1; digest = kmalloc((size_t )digest_size, 16U); if ((unsigned long )digest != (unsigned long )((void *)0)) { sector = e->sector; size = e->size; drbd_csum_ee(mdev, mdev->csums_tfm, e, digest); drbd_free_some_ee(mdev, e, 0); e = 0; inc_rs_pending(mdev); ok = drbd_send_drequest_csum(mdev, sector, (int )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; } out: ; if ((unsigned long )e != (unsigned long )((struct drbd_epoch_entry *)0)) { drbd_free_some_ee(mdev, e, 0); } else { } 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, sector); if (tmp___0 != 0) { goto defer; } else { } e = drbd_alloc_ee(mdev, 2205466966ULL, sector, (unsigned int )size, 514U); if ((unsigned long )e == (unsigned long )((struct drbd_epoch_entry *)0)) { goto defer; } else { } e->w.cb = & w_e_send_csum; spin_lock_irq(& mdev->req_lock); list_add(& e->w.list, & mdev->read_ee); spin_unlock_irq(& mdev->req_lock); atomic_add(size >> 9, & mdev->rs_sect_ev); tmp___1 = drbd_submit_ee(mdev, e, 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); } } int w_resync_timer(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { { switch ((int )mdev->state.ldv_38745.conn) { case 18: w_make_ov_request(mdev, w, cancel); goto ldv_49929; case 17: w_make_resync_request(mdev, w, cancel); goto ldv_49929; } ldv_49929: ; return (1); } } void resync_timer_fn(unsigned long data ) { struct drbd_conf *mdev ; int tmp ; { mdev = (struct drbd_conf *)data; tmp = list_empty((struct list_head const *)(& mdev->resync_work.list)); if (tmp != 0) { drbd_queue_work(& mdev->data.work, & mdev->resync_work); } else { } return; } } static void fifo_set(struct fifo_buffer *fb , int value ) { int i ; { i = 0; goto ldv_49941; ldv_49940: *(fb->values + (unsigned long )i) = value; i = i + 1; ldv_49941: ; if ((unsigned int )i < fb->size) { goto ldv_49940; } 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_49954; ldv_49953: *(fb->values + (unsigned long )i) = *(fb->values + (unsigned long )i) + value; i = i + 1; ldv_49954: ; if ((unsigned int )i < fb->size) { goto ldv_49953; } else { } return; } } static int drbd_rs_controller(struct drbd_conf *mdev ) { unsigned int sect_in ; unsigned int want ; int req_sect ; int correction ; int cps ; int steps ; int curr_corr ; int max_sect ; int tmp ; { tmp = atomic_xchg(& mdev->rs_sect_in, 0); sect_in = (unsigned int )tmp; mdev->rs_in_flight = (int )((unsigned int )mdev->rs_in_flight - sect_in); spin_lock(& mdev->peer_seq_lock); steps = (int )mdev->rs_plan_s.size; if ((unsigned int )mdev->rs_in_flight + sect_in == 0U) { want = (unsigned int )(((mdev->sync_conf.rate * 50) / 250) * steps); } else { 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); } } static int drbd_rs_number_requests(struct drbd_conf *mdev ) { int number ; int tmp ; { if (mdev->rs_plan_s.size != 0U) { tmp = drbd_rs_controller(mdev); number = tmp >> 3; mdev->c_sync_rate = (number * 1000) / 25; } else { mdev->c_sync_rate = mdev->sync_conf.rate; number = (mdev->c_sync_rate * 25) / 1000; } return (number); } } static int w_make_resync_request(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { unsigned long bit ; sector_t sector ; sector_t capacity ; sector_t tmp ; int max_bio_size ; int number ; int rollback_i ; int size ; int align ; int queued ; int sndbuf ; int i ; long tmp___0 ; int tmp___1 ; unsigned int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; long tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; unsigned long tmp___12 ; { tmp = drbd_get_capacity(mdev->this_bdev); capacity = tmp; i = 0; tmp___0 = ldv__builtin_expect(cancel != 0, 0L); if (tmp___0 != 0L) { return (1); } else { } if (mdev->rs_total == 0UL) { drbd_resync_finished(mdev); return (1); } else { } tmp___1 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___1 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Disk broke down during resync!\n"); return (1); } else { } tmp___2 = queue_max_hw_sectors(mdev->rq_queue); max_bio_size = (int )(tmp___2 << 9); number = drbd_rs_number_requests(mdev); if (number == 0) { goto requeue; } else { } i = 0; goto ldv_50002; ldv_50001: ldv_mutex_lock_47(& 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_48(& 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); put_ldev(mdev); return (1); } else { } sector = bit << 3; tmp___3 = drbd_rs_should_slow_down(mdev, sector); if (tmp___3 != 0) { mdev->bm_resync_fo = bit; goto requeue; } else { tmp___4 = drbd_try_rs_begin_io(mdev, sector); if (tmp___4 != 0) { mdev->bm_resync_fo = bit; goto requeue; } else { } } mdev->bm_resync_fo = bit + 1UL; tmp___5 = drbd_bm_test_bit(mdev, bit); tmp___6 = ldv__builtin_expect(tmp___5 == 0, 0L); if (tmp___6 != 0L) { drbd_rs_complete_io(mdev, sector); goto next_sector; } else { } align = 1; rollback_i = i; ldv_49990: ; if (size + 4096 > max_bio_size) { goto ldv_49989; } else { } if (((sector_t )((1 << (align + 3)) + -1) & sector) != 0UL) { goto ldv_49989; } else { } if (((bit + 1UL) & 4095UL) == 0UL) { goto ldv_49989; } else { } tmp___7 = drbd_bm_test_bit(mdev, bit + 1UL); if (tmp___7 != 1) { goto ldv_49989; } else { } bit = bit + 1UL; size = size + 4096; if (4096 << align <= size) { align = align + 1; } else { } i = i + 1; goto ldv_49990; ldv_49989: ; 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___8 = read_for_csum(mdev, sector, size); switch (tmp___8) { 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_49994; 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared"), "i" (712), "i" (12UL)); ldv_49996: ; goto ldv_49996; } ldv_49994: ; } else { inc_rs_pending(mdev); tmp___11 = drbd_send_drequest(mdev, 9, sector, size, 0xffffffffffffffffULL); if (tmp___11 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_send_drequest() failed, aborting...\n"); atomic_dec(& mdev->rs_pending_cnt); tmp___10 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); if (tmp___10 < 0) { tmp___9 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "w_make_resync_request", 719, tmp___9); } else { } put_ldev(mdev); return (0); } else { } } i = i + 1; ldv_50002: ; if (i < number) { goto ldv_50001; } else { } tmp___12 = drbd_bm_bits(mdev); if (mdev->bm_resync_fo >= tmp___12) { put_ldev(mdev); return (1); } else { } requeue: mdev->rs_in_flight = mdev->rs_in_flight + (i << 3); mod_timer(& mdev->resync_timer, (unsigned long )jiffies + 25UL); put_ldev(mdev); return (1); } } static int w_make_ov_request(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { int number ; int i ; int size ; sector_t sector ; sector_t capacity ; sector_t tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { tmp = drbd_get_capacity(mdev->this_bdev); capacity = tmp; tmp___0 = ldv__builtin_expect(cancel != 0, 0L); if (tmp___0 != 0L) { return (1); } else { } number = drbd_rs_number_requests(mdev); sector = mdev->ov_position; i = 0; goto ldv_50020; ldv_50019: ; if (sector >= capacity) { return (1); } else { } size = 4096; tmp___1 = drbd_rs_should_slow_down(mdev, sector); if (tmp___1 != 0) { mdev->ov_position = sector; goto requeue; } else { tmp___2 = drbd_try_rs_begin_io(mdev, sector); if (tmp___2 != 0) { mdev->ov_position = sector; goto requeue; } else { } } if ((sector_t )(size >> 9) + sector > capacity) { size = (int )((capacity - sector) << 9); } else { } inc_rs_pending(mdev); tmp___5 = drbd_send_ov_request(mdev, sector, size); if (tmp___5 == 0) { atomic_dec(& mdev->rs_pending_cnt); tmp___4 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); if (tmp___4 < 0) { tmp___3 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "w_make_ov_request", 774, tmp___3); } else { } return (0); } else { } sector = sector + 8UL; i = i + 1; ldv_50020: ; if (i < number) { goto ldv_50019; } else { } mdev->ov_position = sector; requeue: mdev->rs_in_flight = mdev->rs_in_flight + (i << 3); mod_timer(& mdev->resync_timer, (unsigned long )jiffies + 25UL); return (1); } } void start_resync_timer_fn(unsigned long data ) { struct drbd_conf *mdev ; { mdev = (struct drbd_conf *)data; drbd_queue_work(& mdev->data.work, & mdev->start_resync_work); return; } } int w_start_resync(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { int tmp ; int tmp___0 ; { tmp = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); if (tmp != 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "w_start_resync later...\n"); mdev->start_resync_timer.expires = (unsigned long )jiffies + 25UL; add_timer(& mdev->start_resync_timer); return (1); } else { tmp___0 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); if (tmp___0 != 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "w_start_resync later...\n"); mdev->start_resync_timer.expires = (unsigned long )jiffies + 25UL; add_timer(& mdev->start_resync_timer); return (1); } else { } } drbd_start_resync(mdev, C_SYNC_SOURCE); clear_bit(29, (unsigned long volatile *)(& mdev->flags)); return (1); } } int w_ov_finished(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { { kfree((void const *)w); ov_oos_print(mdev); drbd_resync_finished(mdev); return (1); } } static int w_resync_finished(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { { kfree((void const *)w); drbd_resync_finished(mdev); return (1); } } static void ping_peer(struct drbd_conf *mdev ) { int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; { clear_bit(26, (unsigned long volatile *)(& mdev->flags)); request_ping(mdev); tmp = constant_test_bit(26U, (unsigned long const volatile *)(& mdev->flags)); if (tmp != 0 || (int )mdev->state.ldv_38745.conn <= 9) { goto ldv_50044; } 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_50047: 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_38745.conn <= 9) { goto ldv_50046; } else { } schedule(); goto ldv_50047; ldv_50046: finish_wait(& mdev->misc_wait, & __wait); ldv_50044: ; return; } } int drbd_resync_finished(struct drbd_conf *mdev ) { unsigned long db ; unsigned long dt ; unsigned long dbdt ; unsigned long n_oos ; union drbd_state os ; union drbd_state ns ; struct drbd_work *w ; char *khelper_cmd ; int verify_done ; void *tmp ; int tmp___0 ; int tmp___1 ; unsigned long s ; unsigned long t ; int ratio ; int i ; int i___0 ; { khelper_cmd = 0; verify_done = 0; tmp___0 = drbd_rs_del_all(mdev); if (tmp___0 != 0) { schedule_timeout_interruptible(25L); tmp = kmalloc(24UL, 32U); w = (struct drbd_work *)tmp; if ((unsigned long )w != (unsigned long )((struct drbd_work *)0)) { w->cb = & w_resync_finished; drbd_queue_work(& mdev->data.work, w); return (1); } else { } dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Warn failed to drbd_rs_del_all() and to kmalloc(w).\n"); } else { } dt = (((unsigned long )jiffies - mdev->rs_start) - mdev->rs_paused) / 250UL; if (dt == 0UL) { dt = 1UL; } else { } db = mdev->rs_total; dbdt = db / dt << 2; mdev->rs_paused = mdev->rs_paused / 250UL; tmp___1 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___1 == 0) { goto out; } else { } ping_peer(mdev); spin_lock_irq(& mdev->req_lock); os = mdev->state; verify_done = (unsigned int )*((unsigned short *)(& os) + 0UL) == 288U || (unsigned int )*((unsigned short *)(& os) + 0UL) == 304U; if ((int )os.ldv_38745.conn <= 10) { goto out_unlock; } else { } ns = os; ns.ldv_38745.conn = 10U; _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s done (total %lu sec; paused %lu sec; %lu K/sec)\n", verify_done != 0 ? (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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 901); } 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 checksums, eliminated: %luK; transferred %luK total %luK\n", ratio, mdev->rs_same_csum << 2, (mdev->rs_total - mdev->rs_same_csum) << 2, mdev->rs_total << 2); } else { } } } else { } 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_38745.disk = 4U; ns.ldv_38745.pdsk = 8U; } else { ns.ldv_38745.disk = 8U; ns.ldv_38745.pdsk = 4U; } } else { ns.ldv_38745.disk = 8U; ns.ldv_38745.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_50067; ldv_50066: _drbd_uuid_set(mdev, i, *(mdev->p_uuid + (unsigned long )i)); i = i + 1; ldv_50067: ; if (i <= 3) { goto ldv_50066; } 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 { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 288U && (unsigned int )*((unsigned short *)(& os) + 0UL) != 304U) { drbd_uuid_set_bm(mdev, 0ULL); drbd_print_uuids(mdev, "updated UUIDs"); if ((unsigned long )mdev->p_uuid != (unsigned long )((u64 *)0)) { i___0 = 0; goto ldv_50071; ldv_50070: *(mdev->p_uuid + (unsigned long )i___0) = (mdev->ldev)->md.uuid[i___0]; i___0 = i___0 + 1; ldv_50071: ; if (i___0 <= 3) { goto ldv_50070; } else { } } 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; if (verify_done != 0) { mdev->ov_start_sector = 0UL; } else { } drbd_md_sync(mdev); if ((unsigned long )khelper_cmd != (unsigned long )((char *)0)) { drbd_khelper(mdev, khelper_cmd); } else { } return (1); } } static void move_to_net_ee_or_free(struct drbd_conf *mdev , struct drbd_epoch_entry *e ) { int i ; int tmp ; { tmp = drbd_ee_has_active_page(e); if (tmp != 0) { i = (int )(((unsigned long )e->size + 4095UL) >> 12); atomic_add(i, & mdev->pp_in_use_by_net); atomic_sub(i, & mdev->pp_in_use); spin_lock_irq(& mdev->req_lock); list_add_tail(& e->w.list, & mdev->net_ee); spin_unlock_irq(& mdev->req_lock); __wake_up(& drbd_pp_wait, 3U, 1, 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", 1010, tmp); } else { } return (1); } else { } tmp___3 = ldv__builtin_expect((e->flags & 8UL) == 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", 1024, 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", 1046, 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 { } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 352U) { ok = drbd_send_ack(mdev, P_RS_CANCEL, e); } else { tmp___6 = ldv__builtin_expect((e->flags & 8UL) == 0UL, 1L); if (tmp___6 != 0L) { tmp___4 = ldv__builtin_expect((int )mdev->state.ldv_38745.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", 1078, 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", 1097, 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_47524.digest; tmp___6 = ldv__builtin_expect((e->flags & 8UL) == 0UL, 1L); if (tmp___6 != 0L) { if ((unsigned long )mdev->csums_tfm != (unsigned long )((struct crypto_hash *)0)) { tmp___3 = crypto_hash_digestsize(mdev->csums_tfm); digest_size = (int )tmp___3; if (di->digest_size != digest_size) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( digest_size == di->digest_size ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1114); } else { } digest = kmalloc((size_t )digest_size, 16U); } else { } if ((unsigned long )digest != (unsigned long )((void *)0)) { drbd_csum_ee(mdev, mdev->csums_tfm, e, digest); tmp___4 = memcmp((void const *)digest, (void const *)di->digest, (size_t )digest_size); eq = tmp___4 == 0; kfree((void const *)digest); } else { } if (eq != 0) { __drbd_set_in_sync(mdev, e->sector, (int )e->size, "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1124U); 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_47524.block_id = 0xffffffffffffffffULL; e->flags = e->flags & 0xffffffffffffffefUL; 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", 1141, 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 ; sector_t sector ; unsigned int size ; int digest_size ; void *digest ; int ok ; long tmp ; unsigned int tmp___0 ; long tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { __mptr = (struct drbd_work const *)w; e = (struct drbd_epoch_entry *)__mptr; sector = e->sector; size = e->size; ok = 1; tmp = ldv__builtin_expect(cancel != 0, 0L); if (tmp != 0L) { goto out; } else { } tmp___0 = crypto_hash_digestsize(mdev->verify_tfm); digest_size = (int )tmp___0; digest = kmalloc((size_t )digest_size, 16U); if ((unsigned long )digest == (unsigned long )((void *)0)) { ok = 0; goto out; } else { } tmp___1 = ldv__builtin_expect((e->flags & 8UL) == 0UL, 1L); if (tmp___1 != 0L) { drbd_csum_ee(mdev, mdev->verify_tfm, e, digest); } else { memset(digest, 0, (size_t )digest_size); } drbd_free_some_ee(mdev, e, 0); e = 0; inc_rs_pending(mdev); ok = drbd_send_drequest_csum(mdev, sector, (int )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", 1186, tmp___2); } else { } } else { } kfree((void const *)digest); out: ; if ((unsigned long )e != (unsigned long )((struct drbd_epoch_entry *)0)) { drbd_free_some_ee(mdev, e, 0); } else { } atomic_dec(& mdev->unacked_cnt); tmp___5 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); if (tmp___5 < 0) { tmp___4 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: unacked_cnt = %d < 0 !\n", "w_e_end_ov_req", 1192, 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1204U); return; } } int w_e_end_ov_reply(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_epoch_entry *e ; struct drbd_work const *__mptr ; struct digest_info *di ; void *digest ; sector_t sector ; unsigned int size ; int digest_size ; int ok ; int eq ; int tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; unsigned int tmp___3 ; int tmp___4 ; long tmp___5 ; int tmp___6 ; int tmp___7 ; { __mptr = (struct drbd_work const *)w; e = (struct drbd_epoch_entry *)__mptr; sector = e->sector; size = e->size; 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", 1219, 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_47524.digest; tmp___5 = ldv__builtin_expect((e->flags & 8UL) == 0UL, 1L); if (tmp___5 != 0L) { tmp___3 = crypto_hash_digestsize(mdev->verify_tfm); digest_size = (int )tmp___3; digest = kmalloc((size_t )digest_size, 16U); if ((unsigned long )digest != (unsigned long )((void *)0)) { drbd_csum_ee(mdev, mdev->verify_tfm, e, digest); if (di->digest_size != digest_size) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( digest_size == di->digest_size ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1238); } else { } tmp___4 = memcmp((void const *)digest, (void const *)di->digest, (size_t )digest_size); eq = tmp___4 == 0; kfree((void const *)digest); } else { } } else { } drbd_free_some_ee(mdev, e, 0); if (eq == 0) { drbd_ov_oos_found(mdev, sector, (int )size); } else { ov_oos_print(mdev); } ok = drbd_send_ack_ex(mdev, P_OV_RESULT, sector, (int )size, eq != 0 ? 4711ULL : 4712ULL); 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", "w_e_end_ov_reply", 1258, tmp___6); } else { } mdev->ov_left = mdev->ov_left - 1UL; if ((mdev->ov_left & 512UL) != 0UL) { drbd_advance_rs_marks(mdev, mdev->ov_left); } else { } if (mdev->ov_left == 0UL) { ov_oos_print(mdev); drbd_resync_finished(mdev); } else { } return (ok); } } int w_prev_work_done(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_wq_barrier *b ; struct drbd_work const *__mptr ; { __mptr = (struct drbd_work const *)w; b = (struct drbd_wq_barrier *)__mptr; complete(& b->done); return (1); } } int w_send_barrier(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_tl_epoch *b ; struct drbd_work const *__mptr ; struct p_barrier *p ; int ok ; int tmp ; { __mptr = (struct drbd_work const *)w; b = (struct drbd_tl_epoch *)__mptr; p = & mdev->data.sbuf.barrier; ok = 1; spin_lock_irq(& mdev->req_lock); if ((unsigned long )w->cb != (unsigned long )(& w_send_barrier) || (int )mdev->state.ldv_38745.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_oos(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_request *req ; struct drbd_work const *__mptr ; int ok ; long tmp ; { __mptr = (struct drbd_work const *)w; req = (struct drbd_request *)__mptr; tmp = ldv__builtin_expect(cancel != 0, 0L); if (tmp != 0L) { req_mod(req, send_canceled); return (1); } else { } ok = drbd_send_oos(mdev, req); req_mod(req, oos_handed_to_network); return (ok); } } int w_send_dblock(struct drbd_conf *mdev , struct drbd_work *w , int cancel ) { struct drbd_request *req ; struct drbd_work const *__mptr ; int ok ; long tmp ; { __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_38745.conn > 9) { val.i = 0U; val.ldv_38745.conn = 5U; mask.i = 0U; mask.ldv_38745.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 & 4096UL) != 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_50247: ; if (odev->sync_conf.after == -1) { return (1); } else { } odev = minor_to_mdev((unsigned int )odev->sync_conf.after); _b = (unsigned long )odev == (unsigned long )((struct drbd_conf *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "_drbd_may_sync_now", (char *)"!odev", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1413); } else { } if (_b != 0) { return (1); } else { } if (((((int )odev->state.ldv_38745.conn > 15 && (int )odev->state.ldv_38745.conn <= 21) || (unsigned int )*((unsigned char *)odev + 2278UL) != 0U) || (unsigned int )*((unsigned char *)odev + 2278UL) != 0U) || (unsigned int )*((unsigned char *)odev + 2278UL) != 0U) { return (0); } else { } goto ldv_50247; } } static int _drbd_pause_after(struct drbd_conf *mdev ) { struct drbd_conf *odev ; int i ; int rv ; union drbd_state __ns ; enum drbd_state_rv tmp ; int tmp___0 ; { rv = 0; i = 0; goto ldv_50258; ldv_50257: odev = minor_to_mdev((unsigned int )i); if ((unsigned long )odev == (unsigned long )((struct drbd_conf *)0)) { goto ldv_50254; } else { } if ((unsigned int )*((unsigned short *)odev + 1138UL) == 0U && (unsigned int )*((unsigned char *)odev + 2277UL) == 0U) { goto ldv_50254; } else { } tmp___0 = _drbd_may_sync_now(odev); if (tmp___0 == 0) { __ns.i = odev->state.i; __ns.ldv_38745.aftr_isp = 1U; tmp = __drbd_set_state(odev, __ns, CS_HARD, 0); rv = ((int )tmp != 2) | rv; } else { } ldv_50254: i = i + 1; ldv_50258: ; if ((unsigned int )i < minor_count) { goto ldv_50257; } else { } return (rv); } } static int _drbd_resume_next(struct drbd_conf *mdev ) { struct drbd_conf *odev ; int i ; int rv ; union drbd_state __ns ; enum drbd_state_rv tmp ; int tmp___0 ; { rv = 0; i = 0; goto ldv_50270; ldv_50269: odev = minor_to_mdev((unsigned int )i); if ((unsigned long )odev == (unsigned long )((struct drbd_conf *)0)) { goto ldv_50266; } else { } if ((unsigned int )*((unsigned short *)odev + 1138UL) == 0U && (unsigned int )*((unsigned char *)odev + 2277UL) == 0U) { goto ldv_50266; } else { } if ((unsigned int )*((unsigned char *)odev + 2278UL) != 0U) { tmp___0 = _drbd_may_sync_now(odev); if (tmp___0 != 0) { __ns.i = odev->state.i; __ns.ldv_38745.aftr_isp = 0U; tmp = __drbd_set_state(odev, __ns, CS_HARD, 0); rv = ((int )tmp != 2) | rv; } else { } } else { } ldv_50266: i = i + 1; ldv_50270: ; if ((unsigned int )i < minor_count) { goto ldv_50269; } 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_50283: ; 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_50283; } } 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_50290: changes = _drbd_pause_after(mdev); tmp = _drbd_resume_next(mdev); changes = tmp | changes; if (changes != 0) { goto ldv_50290; } else { } } else { } _raw_write_unlock_irq(& global_state_lock); return (retcode); } } void drbd_rs_controller_reset(struct drbd_conf *mdev ) { { atomic_set(& mdev->rs_sect_in, 0); atomic_set(& mdev->rs_sect_ev, 0); mdev->rs_in_flight = 0; mdev->rs_planed = 0; spin_lock(& mdev->peer_seq_lock); fifo_set(& mdev->rs_plan_s, 0); spin_unlock(& mdev->peer_seq_lock); return; } } void drbd_start_resync(struct drbd_conf *mdev , enum drbd_conns side ) { union drbd_state ns ; int r ; union drbd_state val ; union drbd_state mask ; union drbd_state val___0 ; union drbd_state mask___0 ; int tmp ; int tmp___0 ; enum drbd_state_rv tmp___1 ; unsigned long tw ; unsigned long tmp___2 ; unsigned long now ; int i ; char const *tmp___3 ; { if ((int )mdev->state.ldv_38745.conn > 15 && (int )mdev->state.ldv_38745.conn <= 21) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Resync already running!\n"); return; } else { } if ((int )mdev->state.ldv_38745.conn <= 21) { drbd_rs_cancel_all(mdev); } else { } if ((unsigned int )side == 17U) { r = drbd_khelper(mdev, (char *)"before-resync-target"); r = (r >> 8) & 255; if (r > 0) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "before-resync-target handler returned %d, dropping connection.\n", r); val.i = 0U; val.ldv_38745.conn = 1U; mask.i = 0U; mask.ldv_38745.conn = 31U; drbd_force_state(mdev, mask, val); return; } else { } } else { r = drbd_khelper(mdev, (char *)"before-resync-source"); r = (r >> 8) & 255; if (r > 0) { if (r == 3) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "before-resync-source handler returned %d, ignoring. Old userland tools?", r); } else { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "before-resync-source handler returned %d, dropping connection.\n", r); val___0.i = 0U; val___0.ldv_38745.conn = 1U; mask___0.i = 0U; mask___0.ldv_38745.conn = 31U; drbd_force_state(mdev, mask___0, val___0); return; } } else { } } drbd_state_lock(mdev); _raw_write_lock_irq(& global_state_lock); tmp = _get_ldev_if_state(mdev, D_NEGOTIATING); if (tmp == 0) { _raw_write_unlock_irq(& global_state_lock); drbd_state_unlock(mdev); return; } else { } ns.i = mdev->state.i; tmp___0 = _drbd_may_sync_now(mdev); ns.ldv_38745.aftr_isp = tmp___0 == 0; ns.ldv_38745.conn = (unsigned char )side; if ((unsigned int )side == 17U) { ns.ldv_38745.disk = 4U; } else { ns.ldv_38745.pdsk = 4U; } tmp___1 = __drbd_set_state(mdev, ns, CS_VERBOSE, 0); r = (int )tmp___1; ns = mdev->state; if ((int )ns.ldv_38745.conn <= 9) { r = 0; } else { } if (r == 1) { tmp___2 = drbd_bm_total_weight(mdev); tw = tmp___2; 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_50313; ldv_50312: mdev->rs_mark_left[i] = tw; mdev->rs_mark_time[i] = now; i = i + 1; ldv_50313: ; if (i <= 7) { goto ldv_50312; } else { } _drbd_pause_after(mdev); } else { } _raw_write_unlock_irq(& global_state_lock); if (r == 1) { tmp___3 = drbd_conn_str((enum drbd_conns )ns.ldv_38745.conn); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Began resync as %s (will sync %lu KB [%lu bits set]).\n", tmp___3, mdev->rs_total << 2, mdev->rs_total); if ((unsigned int )side == 17U) { mdev->bm_resync_fo = 0UL; } else { } if ((unsigned int )side == 16U && mdev->agreed_pro_version <= 95) { drbd_gen_and_send_sync_uuid(mdev); } else { } 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 { } drbd_rs_controller_reset(mdev); if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 272U) { mod_timer(& mdev->resync_timer, jiffies); } else { } drbd_md_sync(mdev); } else { } put_ldev(mdev); drbd_state_unlock(mdev); return; } } int drbd_worker(struct drbd_thread *thi ) { struct drbd_conf *mdev ; struct drbd_work *w ; struct list_head work_list ; int intr ; int i ; unsigned int tmp ; struct task_struct *tmp___0 ; int tmp___1 ; struct task_struct *tmp___2 ; int _b ; enum drbd_thread_state tmp___3 ; enum drbd_thread_state tmp___4 ; int _b___0 ; int tmp___5 ; struct list_head const *__mptr ; union drbd_state val ; union drbd_state mask ; int tmp___6 ; enum drbd_thread_state tmp___7 ; int tmp___8 ; int tmp___9 ; struct list_head const *__mptr___0 ; int tmp___10 ; int tmp___11 ; { mdev = thi->mdev; w = 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_50326; ldv_50336: drbd_thread_current_set_cpu(mdev); tmp___1 = down_trylock(& mdev->data.work.s); if (tmp___1 != 0) { ldv_mutex_lock_49(& mdev->data.mutex); if ((unsigned long )mdev->data.socket != (unsigned long )((struct socket *)0) && (unsigned int )*((unsigned char *)mdev->net_conf + 540UL) == 0U) { drbd_tcp_uncork(mdev->data.socket); } else { } ldv_mutex_unlock_50(& mdev->data.mutex); intr = down_interruptible(& mdev->data.work.s); ldv_mutex_lock_51(& mdev->data.mutex); if ((unsigned long )mdev->data.socket != (unsigned long )((struct socket *)0) && (unsigned int )*((unsigned char *)mdev->net_conf + 540UL) == 0U) { drbd_tcp_cork(mdev->data.socket); } else { } ldv_mutex_unlock_52(& 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1717); } else { } tmp___2 = get_current(); flush_signals(tmp___2); tmp___3 = get_t_state(thi); _b = (unsigned int )tmp___3 == 1U; if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_worker", (char *)"get_t_state(thi) == Running", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1719); } else { } if (_b != 0) { goto ldv_50326; } else { } goto ldv_50327; } else { } tmp___4 = get_t_state(thi); if ((unsigned int )tmp___4 != 1U) { goto ldv_50327; } 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), "ASSERT FAILED: %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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1732); } else { } if (_b___0 != 0) { spin_unlock_irq(& mdev->data.work.q_lock); goto ldv_50326; } 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_38745.conn <= 9); if (tmp___6 == 0) { if ((int )mdev->state.ldv_38745.conn > 9) { val.i = 0U; val.ldv_38745.conn = 5U; mask.i = 0U; mask.ldv_38745.conn = 31U; drbd_force_state(mdev, mask, val); } else { } } else { } ldv_50326: tmp___7 = get_t_state(thi); if ((unsigned int )tmp___7 == 1U) { goto ldv_50336; } else { } ldv_50327: 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1758); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1759); } else { } spin_lock_irq(& mdev->data.work.q_lock); i = 0; goto ldv_50343; ldv_50342: list_splice_init(& mdev->data.work.q, & work_list); spin_unlock_irq(& mdev->data.work.q_lock); goto ldv_50340; ldv_50339: __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_50340: tmp___10 = list_empty((struct list_head const *)(& work_list)); if (tmp___10 == 0) { goto ldv_50339; } else { } spin_lock_irq(& mdev->data.work.q_lock); ldv_50343: tmp___11 = list_empty((struct list_head const *)(& mdev->data.work.q)); if (tmp___11 == 0) { goto ldv_50342; } else { } sema_init(& mdev->data.work.s, 0); spin_unlock_irq(& mdev->data.work.q_lock); if ((unsigned int )*((unsigned char *)mdev + 2277UL) != 0U || (unsigned int )*((unsigned short *)mdev + 1138UL) != 0U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.disk == D_DISKLESS && mdev->state.conn == C_STANDALONE ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_worker.c.prepared", 1784); } 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_39(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_40(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_41(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_42(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_43(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_44(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_45(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_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 ldv_mutex_lock_49(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_50(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_51(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_52(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static int test_and_clear_bit(int nr , unsigned long volatile *addr ) { int oldbit ; { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; btr %2,%1\n\tsbb %0,%0": "=r" (oldbit), "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return (oldbit); } } __inline static __u32 __arch_swab32(__u32 val ) { { __asm__ ("bswapl %0": "=r" (val): "0" (val)); return (val); } } __inline static __u64 __arch_swab64(__u64 val ) { { __asm__ ("bswapq %0": "=r" (val): "0" (val)); return (val); } } __inline static __u16 __fswab16(__u16 val ) { { return ((__u16 )((int )((short )((int )val << 8)) | (int )((short )((int )val >> 8)))); } } __inline static __u32 __fswab32(__u32 val ) { __u32 tmp ; { tmp = __arch_swab32(val); return (tmp); } } __inline static __u64 __fswab64(__u64 val ) { __u64 tmp ; { tmp = __arch_swab64(val); return (tmp); } } extern void dump_stack(void) ; __inline static void list_move(struct list_head *list , struct list_head *head ) { { __list_del_entry(list); list_add(list, head); return; } } __inline static void INIT_HLIST_NODE(struct hlist_node *h ) { { h->next = 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; } } extern unsigned long __phys_addr(unsigned long ) ; extern unsigned long __per_cpu_offset[4096U] ; extern size_t strlen(char const * ) ; extern char *strcpy(char * , char const * ) ; extern int strcmp(char const * , char const * ) ; extern int nr_cpu_ids ; extern struct cpumask const * const cpu_possible_mask ; __inline static unsigned int cpumask_check(unsigned int cpu ) { bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; { __ret_warn_once = (unsigned int )nr_cpu_ids <= cpu; tmp___1 = 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", 108); } 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); } } int ldv_mutex_trylock_68(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_69(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_71(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_73(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_74(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_76(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_77(struct mutex *ldv_func_arg1 ) ; extern int mutex_lock_interruptible(struct mutex * ) ; int ldv_mutex_lock_interruptible_75(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_67(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_70(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_72(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_6279; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6279; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6279; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6279; default: __bad_percpu_size(); } ldv_6279: 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); } } __inline static void init_completion(struct completion *x ) { struct lock_class_key __key ; { x->done = 0U; __init_waitqueue_head(& x->wait, "&x->wait", & __key); return; } } extern void wait_for_completion(struct completion * ) ; extern int del_timer_sync(struct timer_list * ) ; extern unsigned long __get_free_pages(gfp_t , unsigned int ) ; extern void free_pages(unsigned long , unsigned int ) ; extern void __module_get(struct module * ) ; extern void get_random_bytes(void * , int ) ; extern u32 random32(void) ; extern int sock_create_kern(int , int , int , struct socket ** ) ; extern int sock_create_lite(int , int , int , struct socket ** ) ; extern void sock_release(struct socket * ) ; extern int sock_recvmsg(struct socket * , struct msghdr * , size_t , int ) ; 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" (65), "i" (12UL)); ldv_19797: ; goto ldv_19797; } 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" (67), "i" (12UL)); ldv_19798: ; goto ldv_19798; } 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" (68), "i" (12UL)); ldv_19799: ; goto ldv_19799; } 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; } } extern void io_schedule(void) ; extern long schedule_timeout(long ) ; extern long schedule_timeout_uninterruptible(long ) ; __inline static int test_tsk_thread_flag(struct task_struct *tsk , int flag ) { int tmp ; { tmp = test_ti_thread_flag((struct thread_info *)tsk->stack, flag); return (tmp); } } __inline static int signal_pending(struct task_struct *p ) { int tmp ; long tmp___0 ; { tmp = test_tsk_thread_flag(p, 2); tmp___0 = ldv__builtin_expect(tmp != 0, 0L); return ((int )tmp___0); } } char const *drbd_set_st_err_str(enum drbd_state_rv err ) ; extern struct crypto_tfm *crypto_alloc_base(char const * , u32 , u32 ) ; __inline static void crypto_free_tfm(struct crypto_tfm *tfm ) { { return; } } __inline static u32 crypto_tfm_alg_type(struct crypto_tfm *tfm ) { { return ((tfm->__crt_alg)->cra_flags & 15U); } } __inline static struct crypto_hash *__crypto_hash_cast(struct crypto_tfm *tfm ) { { return ((struct crypto_hash *)tfm); } } __inline static struct crypto_hash *crypto_alloc_hash(char const *alg_name , u32 type , u32 mask ) { struct crypto_tfm *tmp ; struct crypto_hash *tmp___0 ; { type = type & 4294967280U; mask = mask & 4294967280U; type = type | 8U; mask = mask | 14U; tmp = crypto_alloc_base(alg_name, type, mask); tmp___0 = __crypto_hash_cast(tmp); return (tmp___0); } } __inline static void crypto_free_hash(struct crypto_hash *tfm ) { struct crypto_tfm *tmp ; { tmp = crypto_hash_tfm(tfm); crypto_free_tfm(tmp); return; } } __inline static int crypto_hash_digest(struct hash_desc *desc , struct scatterlist *sg , unsigned int nbytes , u8 *out ) { struct hash_tfm *tmp ; int tmp___0 ; { tmp = crypto_hash_crt(desc->tfm); tmp___0 = (*(tmp->digest))(desc, sg, nbytes, out); return (tmp___0); } } __inline static int crypto_hash_setkey(struct crypto_hash *hash , u8 const *key , unsigned int keylen ) { struct hash_tfm *tmp ; int tmp___0 ; { tmp = crypto_hash_crt(hash); tmp___0 = (*(tmp->setkey))(hash, key, keylen); return (tmp___0); } } __inline static void set_capacity(struct gendisk *disk , sector_t size ) { { disk->part0.nr_sects = size; return; } } __inline static void *kmap(struct page *page ) { void *tmp ; { __might_sleep("include/linux/highmem.h", 51, 0); tmp = lowmem_page_address((struct page const *)page); return (tmp); } } __inline static void kunmap(struct page *page ) { { return; } } extern struct bio *bio_alloc(gfp_t , unsigned int ) ; extern struct lc_element *lc_find(struct lru_cache * , unsigned int ) ; __inline static char const *cmdname(enum drbd_packets cmd ) { char const *cmdnames[43U] ; { cmdnames[0] = "Data"; cmdnames[1] = "DataReply"; cmdnames[2] = "RSDataReply"; cmdnames[3] = "Barrier"; cmdnames[4] = "ReportBitMap"; cmdnames[5] = "BecomeSyncTarget"; cmdnames[6] = "BecomeSyncSource"; cmdnames[7] = "UnplugRemote"; cmdnames[8] = "DataRequest"; cmdnames[9] = "RSDataRequest"; cmdnames[10] = "SyncParam"; cmdnames[11] = "ReportProtocol"; cmdnames[12] = "ReportUUIDs"; cmdnames[13] = "ReportSizes"; cmdnames[14] = "ReportState"; cmdnames[15] = "ReportSyncUUID"; cmdnames[16] = "AuthChallenge"; cmdnames[17] = "AuthResponse"; cmdnames[18] = "StateChgRequest"; cmdnames[19] = "Ping"; cmdnames[20] = "PingAck"; cmdnames[21] = "RecvAck"; cmdnames[22] = "WriteAck"; cmdnames[23] = "RSWriteAck"; cmdnames[24] = "DiscardAck"; cmdnames[25] = "NegAck"; cmdnames[26] = "NegDReply"; cmdnames[27] = "NegRSDReply"; cmdnames[28] = "BarrierAck"; cmdnames[29] = "StateChgReply"; cmdnames[30] = "OVRequest"; cmdnames[31] = "OVReply"; cmdnames[32] = "OVResult"; cmdnames[33] = "CsumRSRequest"; cmdnames[34] = "CsumRSIsInSync"; cmdnames[35] = "SyncParam89"; cmdnames[36] = "CBitmap"; cmdnames[37] = 0; cmdnames[38] = 0; cmdnames[39] = "DelayProbe"; cmdnames[40] = "OutOfSync"; cmdnames[41] = 0; cmdnames[42] = 0; if ((unsigned int )cmd == 65521U) { return ("HandShakeM"); } else { } if ((unsigned int )cmd == 65522U) { return ("HandShakeS"); } else { } if ((unsigned int )cmd == 65534U) { return ("HandShake"); } else { } if ((unsigned int )cmd > 41U) { return ("Unknown"); } else { } return (cmdnames[(unsigned int )cmd]); } } void INFO_bm_xfer_stats(struct drbd_conf *mdev , char const *direction , struct bm_xfer_ctx *c ) ; __inline static void bm_xfer_ctx_bit_to_word_offset(struct bm_xfer_ctx *c ) { { c->word_offset = c->bit_offset >> 6; return; } } __inline static enum drbd_bitmap_code DCBP_get_code(struct p_compressed_bm *p ) { { return ((enum drbd_bitmap_code )((int )p->encoding & 15)); } } __inline static int DCBP_get_start(struct p_compressed_bm *p ) { { return ((int )((signed char )p->encoding) < 0); } } __inline static int DCBP_get_pad_bits(struct p_compressed_bm *p ) { { return (((int )p->encoding >> 4) & 7); } } enum drbd_state_rv drbd_change_state(struct drbd_conf *mdev , enum chg_state_flags f , union drbd_state mask , union drbd_state val ) ; enum drbd_state_rv _drbd_request_state(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val , enum chg_state_flags f ) ; int drbd_thread_start(struct drbd_thread *thi ) ; void tl_release(struct drbd_conf *mdev , unsigned int barrier_nr , unsigned int set_size ) ; void tl_clear(struct drbd_conf *mdev ) ; void drbd_free_sock(struct drbd_conf *mdev ) ; int drbd_send_protocol(struct drbd_conf *mdev ) ; int drbd_send_uuids(struct drbd_conf *mdev ) ; int drbd_send_sizes(struct drbd_conf *mdev , int trigger_reply , enum dds_flags flags ) ; int drbd_send_current_state(struct drbd_conf *mdev ) ; int drbd_send_cmd2(struct drbd_conf *mdev , enum drbd_packets cmd , char *data , size_t size ) ; int drbd_send_sync_param(struct drbd_conf *mdev , struct syncer_conf *sc ) ; int drbd_send_b_ack(struct drbd_conf *mdev , u32 barrier_nr , u32 set_size ) ; int drbd_send_ack_rp(struct drbd_conf *mdev , enum drbd_packets cmd , struct p_block_req *rp ) ; int drbd_send_ack_dp(struct drbd_conf *mdev , enum drbd_packets cmd , struct p_data *dp , int data_size ) ; int drbd_send_bitmap(struct drbd_conf *mdev ) ; int drbd_send_sr_reply(struct drbd_conf *mdev , enum drbd_state_rv retcode ) ; void drbd_uuid_new_current(struct drbd_conf *mdev ) ; int drbd_bitmap_io(struct drbd_conf *mdev , int (*io_fn)(struct drbd_conf * ) , char *why , enum bm_flag flags ) ; int drbd_bmio_set_n_write(struct drbd_conf *mdev ) ; int drbd_bmio_clear_n_write(struct drbd_conf *mdev ) ; mempool_t *drbd_ee_mempool ; struct page *drbd_pp_pool ; spinlock_t drbd_pp_lock ; int drbd_pp_vacant ; sector_t drbd_new_dev_size(struct drbd_conf *mdev , struct drbd_backing_dev *bdev , int assume_peer_has_space ) ; enum determine_dev_size drbd_determine_dev_size(struct drbd_conf *mdev , enum dds_flags flags ) ; void resync_after_online_grow(struct drbd_conf *mdev ) ; void drbd_reconsider_max_bio_size(struct drbd_conf *mdev ) ; enum drbd_state_rv drbd_set_role(struct drbd_conf *mdev , enum drbd_role new_role , int force ) ; void drbd_try_outdate_peer_async(struct drbd_conf *mdev ) ; int drbd_release_ee(struct drbd_conf *mdev , struct list_head *list ) ; void drbd_wait_ee_list_empty(struct drbd_conf *mdev , struct list_head *head ) ; void _drbd_wait_ee_list_empty(struct drbd_conf *mdev , struct list_head *head ) ; void drbd_flush_workqueue(struct drbd_conf *mdev ) ; void drbd_free_tl_hash(struct drbd_conf *mdev ) ; __inline static void drbd_tcp_nodelay(struct socket *sock ) { int val ; { val = 1; drbd_setsockopt(sock, 6, 1, (char *)(& val), 4); return; } } __inline static void drbd_tcp_quickack(struct socket *sock ) { int val ; { val = 2; drbd_setsockopt(sock, 6, 12, (char *)(& val), 4); return; } } void drbd_bump_write_ordering(struct drbd_conf *mdev , enum write_ordering_e wo ) ; int drbd_rs_begin_io(struct drbd_conf *mdev , sector_t sector ) ; void drbd_bcast_ee(struct drbd_conf *mdev , char const *reason , int const dgs , char const *seen_hash , char const *calc_hash , struct drbd_epoch_entry const *e ) ; __inline static int drbd_ee_has_active_page___0(struct drbd_epoch_entry *e ) { struct page *page ; int tmp ; struct page *tmp___0 ; { page = e->pages; goto ldv_49792; ldv_49791: tmp = page_count(page); if (tmp > 1) { return (1); } else { } page = page_chain_next(page); ldv_49792: ; 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_49791; } else { goto ldv_49793; } } else { } ldv_49793: ; return (0); } } __inline static int drbd_request_state(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val ) { enum drbd_state_rv tmp ; { tmp = _drbd_request_state(mdev, mask, val, 14); return ((int )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 = 2251799813685248UL; tmp___0 = drbd_md_first_sector(bdev); __min2 = tmp___0; s = __min1 < __min2 ? __min1 : __min2; } else { s = 0UL; } goto ldv_49866; case -2: __min1___0 = 2251799813685248UL; 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_49866; 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_49866: ; 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_38745.conn > 1; if (have_net_conf == 0) { put_net_conf(mdev); } else { } return (have_net_conf); } } __inline static int drbd_set_ed_uuid(struct drbd_conf *mdev , u64 val ) { int changed ; { changed = mdev->ed_uuid != val; mdev->ed_uuid = val; return (changed); } } __inline static int seq_cmp(u32 a , u32 b ) { { return ((int )a - (int )b); } } __inline static void update_peer_seq(struct drbd_conf *mdev , unsigned int new_seq ) { unsigned int m ; int tmp ; { 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" (234), "i" (12UL)); ldv_50142: ; goto ldv_50142; } 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" (243), "i" (12UL)); ldv_50147: ; goto ldv_50147; } 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_50164; ldv_50163: ; 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", 266); } else { } return (req); } else { } n = n->next; ldv_50164: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)n; req = (struct drbd_request *)__mptr + 0xffffffffffffffd8UL; if (1 != 0) { goto ldv_50163; } else { goto ldv_50165; } } else { } ldv_50165: ; 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_50232: ; goto ldv_50232; } } __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 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared"), "i" (136), "i" (12UL)); ldv_50312: ; goto ldv_50312; } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared"), "i" (137), "i" (12UL)); ldv_50313: ; goto ldv_50313; } else { } page = *head; if ((unsigned long )page == (unsigned long )((struct page *)0)) { return (0); } else { } goto ldv_50316; ldv_50315: tmp = page_chain_next(page); n = n - 1; if (n == 0) { goto ldv_50314; } else { } if ((unsigned long )tmp == (unsigned long )((struct page *)0)) { return (0); } else { } page = tmp; ldv_50316: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { goto ldv_50315; } else { } ldv_50314: page->ldv_12914.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_50324; ldv_50323: i = i + 1; page = tmp; ldv_50324: tmp = page_chain_next(page); if ((unsigned long )tmp != (unsigned long )((struct page *)0)) { goto ldv_50323; } 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_50333; ldv_50332: put_page(page); i = i + 1; page = tmp; ldv_50333: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { tmp = page_chain_next(page); if (1 != 0) { goto ldv_50332; } else { goto ldv_50334; } } else { } ldv_50334: ; 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared"), "i" (193), "i" (12UL)); ldv_50341: ; goto ldv_50341; } else { } chain_last->ldv_12914.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_50351; ldv_50350: tmp = alloc_pages(514U, 0U); if ((unsigned long )tmp == (unsigned long )((struct page *)0)) { goto ldv_50349; } else { } tmp->ldv_12914.private = (unsigned long )page; page = tmp; i = i + 1; ldv_50351: ; if (i < number) { goto ldv_50350; } else { } ldv_50349: ; 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 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_50363; ldv_50362: __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_50361; } else { } list_move(le, to_be_freed); le = tle; tle = le->next; ldv_50363: ; if ((unsigned long )(& mdev->net_ee) != (unsigned long )le) { goto ldv_50362; } else { } ldv_50361: ; return; } } static void drbd_kick_lo_and_reclaim_net(struct drbd_conf *mdev ) { struct list_head reclaimed ; struct drbd_epoch_entry *e ; struct drbd_epoch_entry *t ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { reclaimed.next = & reclaimed; reclaimed.prev = & reclaimed; spin_lock_irq(& mdev->req_lock); reclaim_net_ee(mdev, & reclaimed); spin_unlock_irq(& mdev->req_lock); __mptr = (struct list_head const *)reclaimed.next; e = (struct drbd_epoch_entry *)__mptr; __mptr___0 = (struct list_head const *)e->w.list.next; t = (struct drbd_epoch_entry *)__mptr___0; goto ldv_50377; ldv_50376: 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_50377: ; if ((unsigned long )(& e->w.list) != (unsigned long )(& reclaimed)) { goto ldv_50376; } 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_50388; ldv_50387: 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_50386; } else { } } else { } if (! retry) { goto ldv_50386; } 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_50386; } else { } schedule(); ldv_50388: ; if ((unsigned long )page == (unsigned long )((struct page *)0)) { goto ldv_50387; } else { } ldv_50386: 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->collision); 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_47524.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 & 16UL) != 0UL) { kfree((void const *)e->ldv_47524.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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 414); } else { } tmp___0 = hlist_unhashed((struct hlist_node const *)(& e->collision)); if (tmp___0 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( hlist_unhashed(&e->collision) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 415); } 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_50429; ldv_50428: 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_50429: ; if ((unsigned long )(& e->w.list) != (unsigned long )(& work_list)) { goto ldv_50428; } 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_38745.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_50446; ldv_50445: 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_50446: ; if ((unsigned long )(& e->w.list) != (unsigned long )(& reclaimed)) { goto ldv_50445; } 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_50455; ldv_50454: 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_50455: ; if ((unsigned long )(& e->w.list) != (unsigned long )(& work_list)) { goto ldv_50454; } 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_50463; ldv_50462: prepare_to_wait(& mdev->ee_wait, & wait, 2); spin_unlock_irq(& mdev->req_lock); io_schedule(); finish_wait(& mdev->ee_wait, & wait); spin_lock_irq(& mdev->req_lock); ldv_50463: tmp___0 = list_empty((struct list_head const *)head); if (tmp___0 == 0) { goto ldv_50462; } 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; __module_get(((*newsock)->ops)->owner); 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_50501: rv = sock_recvmsg(mdev->data.socket, & msg, size, (int )msg.msg_flags); if ((size_t )rv == size) { goto ldv_50500; } 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_50500; } else if (rv == 0) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "sock was shut down by peer\n"); goto ldv_50500; } else { goto ldv_50500; } goto ldv_50501; ldv_50500: tmp___1 = current_thread_info___0(); tmp___1->addr_limit = oldfs; if ((size_t )rv != size) { val.i = 0U; val.ldv_38745.conn = 4U; mask.i = 0U; mask.ldv_38745.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_50538; default: dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s failed, err = %d\n", what, err); } ldv_50538: ; if (disconnect_on_error != 0) { val.i = 0U; val.ldv_38745.conn = 1U; mask.i = 0U; mask.ldv_38745.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_38745.conn = 1U; mask.i = 0U; mask.ldv_38745.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 ; enum drbd_state_rv rv ; union drbd_state val ; union drbd_state mask ; int tmp ; int tmp___0 ; enum drbd_packets tmp___1 ; u32 tmp___2 ; struct task_struct *tmp___3 ; enum drbd_thread_state tmp___4 ; struct task_struct *tmp___5 ; int tmp___6 ; int tmp___7 ; long tmp___8 ; int tmp___9 ; int tmp___10 ; union drbd_state __ns ; { 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 812); } else { } val.i = 0U; val.ldv_38745.conn = 8U; mask.i = 0U; mask.ldv_38745.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_50598: try = 0; ldv_50590: s = drbd_try_connect(mdev); if ((unsigned long )s != (unsigned long )((struct socket *)0)) { goto ldv_50589; } else { try = try + 1; if (try > 2) { goto ldv_50589; } else { } } schedule_timeout_interruptible(25L); goto ldv_50590; ldv_50589: ; 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)) { schedule_timeout_interruptible((long )(((mdev->net_conf)->ping_timeo * 250) / 10)); ok = drbd_socket_okay(mdev, & sock); tmp___0 = drbd_socket_okay(mdev, & msock); ok = tmp___0 != 0 && ok != 0; if (ok != 0) { goto ldv_50592; } else { } } else { } retry: s = drbd_wait_for_connect(mdev); if ((unsigned long )s != (unsigned long )((struct socket *)0)) { tmp___1 = drbd_recv_fp(mdev, s); try = (int )tmp___1; 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_50595; 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_50595; default: dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Error receiving initial packet\n"); sock_release(s); tmp___2 = random32(); if ((int )tmp___2 & 1) { goto retry; } else { } } ldv_50595: ; } else { } if ((int )mdev->state.ldv_38745.conn <= 1) { goto out_release_sockets; } else { } tmp___5 = get_current(); tmp___6 = signal_pending(tmp___5); if (tmp___6 != 0) { tmp___3 = get_current(); flush_signals(tmp___3); __asm__ volatile ("": : : "memory"); tmp___4 = get_t_state(& mdev->receiver); if ((unsigned int )tmp___4 == 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___7 = drbd_socket_okay(mdev, & msock); ok = tmp___7 != 0 && ok != 0; if (ok != 0) { goto ldv_50592; } else { } } else { } goto ldv_50598; ldv_50592: (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___8 = (long )(((mdev->net_conf)->ping_timeo * 1000) / 10); (sock->sk)->sk_rcvtimeo = tmp___8; (sock->sk)->sk_sndtimeo = tmp___8; (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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 931); } 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___9 = drbd_do_auth(mdev); switch (tmp___9) { 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 { } (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; tmp___10 = drbd_send_protocol(mdev); if (tmp___10 == -1) { return (-1); } else { } set_bit(30U, (unsigned long volatile *)(& mdev->flags)); drbd_send_sync_param(mdev, & mdev->sync_conf); drbd_send_sizes(mdev, 0, 0); drbd_send_uuids(mdev); drbd_send_current_state(mdev); clear_bit(7, (unsigned long volatile *)(& mdev->flags)); clear_bit(24, (unsigned long volatile *)(& mdev->flags)); spin_lock_irq(& mdev->req_lock); __ns.i = mdev->state.i; __ns.ldv_38745.conn = 9U; rv = _drbd_set_state(mdev, __ns, CS_VERBOSE, 0); if ((unsigned int )*((unsigned short *)mdev + 1138UL) != 144U) { clear_bit(30, (unsigned long volatile *)(& mdev->flags)); } else { } spin_unlock_irq(& mdev->req_lock); if ((int )rv <= 0) { return (0); } else { } drbd_thread_start(& mdev->asender); mod_timer(& mdev->request_timer, (unsigned long )jiffies + 250UL); return (1); out_release_sockets: ; if ((unsigned long )sock != (unsigned long )((struct socket *)0)) { sock_release(sock); } else { } if ((unsigned long )msock != (unsigned long )((struct socket *)0)) { sock_release(msock); } else { } return (-1); } } static int drbd_recv_header(struct drbd_conf *mdev , enum drbd_packets *cmd , unsigned int *packet_size ) { union p_header *h ; int r ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; __u16 tmp___2 ; __u16 tmp___3 ; __u16 tmp___4 ; __u32 tmp___5 ; __u16 tmp___6 ; __u16 tmp___7 ; __u32 tmp___8 ; long tmp___9 ; { h = & mdev->data.rbuf.header; r = drbd_recv(mdev, (void *)h, 8UL); tmp___1 = ldv__builtin_expect(r != 8, 0L); if (tmp___1 != 0L) { tmp = get_current(); tmp___0 = signal_pending(tmp); if (tmp___0 == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read expecting header on sock: r=%d\n", r); } else { } return (0); } else { } tmp___9 = ldv__builtin_expect(h->h80.magic == 1728214147U, 1L); if (tmp___9 != 0L) { tmp___2 = __fswab16((int )h->h80.command); *cmd = (enum drbd_packets )tmp___2; tmp___3 = __fswab16((int )h->h80.length); *packet_size = (unsigned int )tmp___3; } else if ((unsigned int )h->h95.magic == 23171U) { tmp___4 = __fswab16((int )h->h95.command); *cmd = (enum drbd_packets )tmp___4; tmp___5 = __fswab32(h->h95.length); *packet_size = tmp___5; } else { tmp___6 = __fswab16((int )h->h80.length); tmp___7 = __fswab16((int )h->h80.command); tmp___8 = __fswab32(h->h80.magic); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "magic?? on data m: 0x%08x c: %d l: %d\n", tmp___8, (int )tmp___7, (int )tmp___6); return (0); } mdev->last_received = jiffies; return (1); } } static void drbd_flush(struct drbd_conf *mdev ) { int rv ; int tmp ; { if ((unsigned int )mdev->write_ordering > 1U) { tmp = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp != 0) { rv = blkdev_issue_flush((mdev->ldev)->backing_bdev, 208U, 0); if (rv != 0) { _dev_info((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 { } return; } } static enum finish_epoch drbd_may_finish_epoch(struct drbd_conf *mdev , struct drbd_epoch *epoch , enum epoch_event ev ) { int epoch_size ; struct drbd_epoch *next_epoch ; enum finish_epoch rv ; int tmp ; int tmp___0 ; int tmp___1 ; struct list_head const *__mptr ; int tmp___2 ; int tmp___3 ; { rv = FE_STILL_LIVE; spin_lock(& mdev->epoch_lock); ldv_50633: next_epoch = 0; epoch_size = atomic_read((atomic_t const *)(& epoch->epoch_size)); switch ((unsigned int )ev & 4294967263U) { case 0U: atomic_dec(& epoch->active); goto ldv_50623; case 1U: set_bit(0U, (unsigned long volatile *)(& epoch->flags)); goto ldv_50623; case 2U: ; goto ldv_50623; } ldv_50623: ; if (epoch_size != 0) { tmp___2 = atomic_read((atomic_t const *)(& epoch->active)); if (tmp___2 == 0) { tmp___3 = constant_test_bit(0U, (unsigned long const volatile *)(& epoch->flags)); if (tmp___3 != 0 || ((unsigned int )ev & 32U) != 0U) { 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 { } tmp___1 = constant_test_bit(0U, (unsigned long const volatile *)(& epoch->flags)); if (tmp___1 != 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", "drbd_may_finish_epoch", 1076, tmp); } else { } } else { } if ((unsigned long )mdev->current_epoch != (unsigned long )epoch) { __mptr = (struct list_head const *)epoch->list.next; next_epoch = (struct drbd_epoch *)__mptr; list_del(& epoch->list); ev = (enum epoch_event )(((unsigned int )ev & 32U) | 2U); mdev->epochs = mdev->epochs - 1U; kfree((void const *)epoch); if ((unsigned int )rv == 0U) { rv = FE_DESTROYED; } else { } } else { epoch->flags = 0UL; atomic_set(& epoch->epoch_size, 0); if ((unsigned int )rv == 0U) { rv = FE_RECYCLED; } else { } __wake_up(& mdev->ee_wait, 3U, 1, 0); } } else { } } else { } } else { } if ((unsigned long )next_epoch == (unsigned long )((struct drbd_epoch *)0)) { goto ldv_50632; } else { } epoch = next_epoch; goto ldv_50633; ldv_50632: spin_unlock(& mdev->epoch_lock); return (rv); } } void drbd_bump_write_ordering(struct drbd_conf *mdev , enum write_ordering_e wo ) { enum write_ordering_e pwo ; char *write_ordering_str[3U] ; enum write_ordering_e _min1 ; enum write_ordering_e _min2 ; { write_ordering_str[0] = (char *)"none"; write_ordering_str[1] = (char *)"drain"; write_ordering_str[2] = (char *)"flush"; pwo = mdev->write_ordering; _min1 = pwo; _min2 = wo; wo = (enum write_ordering_e )((unsigned int )_min1 < (unsigned int )_min2 ? (unsigned int )_min1 : (unsigned int )_min2); if ((unsigned int )wo == 2U && (unsigned int )*((unsigned char *)mdev->ldev + 372UL) != 0U) { wo = WO_drain_io; } else { } if ((unsigned int )wo == 1U && (unsigned int )*((unsigned char *)mdev->ldev + 380UL) != 0U) { wo = WO_none; } else { } mdev->write_ordering = wo; if ((unsigned int )mdev->write_ordering != (unsigned int )pwo || (unsigned int )wo == 2U) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Method to ensure write ordering: %s\n", write_ordering_str[(unsigned int )mdev->write_ordering]); } else { } return; } } int drbd_submit_ee(struct drbd_conf *mdev , struct drbd_epoch_entry *e , unsigned int const rw , int const fault_type ) { struct bio *bios ; struct bio *bio ; struct page *page ; sector_t sector ; unsigned int ds ; unsigned int n_bios ; unsigned int nr_pages ; int err ; unsigned int len ; unsigned int __min1 ; unsigned int __min2 ; int tmp ; struct page *tmp___0 ; { bios = 0; page = e->pages; sector = e->sector; ds = e->size; n_bios = 0U; nr_pages = (unsigned int )(((unsigned long )ds + 4095UL) >> 12); err = -12; next_bio: bio = bio_alloc(16U, 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_50665; ldv_50664: __min1 = ds; __min2 = 4096U; len = __min1 < __min2 ? __min1 : __min2; tmp = bio_add_page(bio, page, len, 0U); if (tmp == 0) { if ((unsigned int )bio->bi_vcnt == 0U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "bio_add_page failed for len=%u, bi_vcnt=0 (bi_sector=%llu)\n", len, (unsigned long long )bio->bi_sector); err = -28; goto fail; } else { } goto next_bio; } else { } ds = ds - len; sector = (sector_t )(len >> 9) + sector; nr_pages = nr_pages - 1U; page = page_chain_next(page); ldv_50665: ; 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_50664; } else { goto ldv_50666; } } else { } ldv_50666: ; 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1207); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1208); } else { } atomic_set(& e->pending_bios, (int )n_bios); ldv_50667: bio = bios; bios = bios->bi_next; bio->bi_next = 0; drbd_generic_make_request(mdev, fault_type, bio); if ((unsigned long )bios != (unsigned long )((struct bio *)0)) { goto ldv_50667; } else { } return (0); fail: ; goto ldv_50670; ldv_50669: bio = bios; bios = bios->bi_next; bio_put(bio); ldv_50670: ; if ((unsigned long )bios != (unsigned long )((struct bio *)0)) { goto ldv_50669; } else { } return (err); } } static int receive_Barrier(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { int rv ; struct p_barrier *p ; struct drbd_epoch *epoch ; enum finish_epoch tmp ; void *tmp___0 ; void *tmp___1 ; int tmp___2 ; int tmp___3 ; wait_queue_t __wait ; struct task_struct *tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; { p = & mdev->data.rbuf.barrier; inc_unacked(mdev); (mdev->current_epoch)->barrier_nr = p->barrier; tmp = drbd_may_finish_epoch(mdev, mdev->current_epoch, EV_GOT_BARRIER_NR); rv = (int )tmp; switch ((unsigned int )mdev->write_ordering) { case 0U: ; if (rv == 2) { return (1); } else { } tmp___0 = kmalloc(40UL, 16U); epoch = (struct drbd_epoch *)tmp___0; if ((unsigned long )epoch != (unsigned long )((struct drbd_epoch *)0)) { goto ldv_50681; } else { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Allocation of an epoch failed, slowing down\n"); } case 2U: ; case 1U: drbd_wait_ee_list_empty(mdev, & mdev->active_ee); drbd_flush(mdev); tmp___2 = atomic_read((atomic_t const *)(& (mdev->current_epoch)->epoch_size)); if (tmp___2 != 0) { tmp___1 = kmalloc(40UL, 16U); epoch = (struct drbd_epoch *)tmp___1; if ((unsigned long )epoch != (unsigned long )((struct drbd_epoch *)0)) { goto ldv_50681; } else { } } else { } epoch = mdev->current_epoch; tmp___3 = atomic_read((atomic_t const *)(& epoch->epoch_size)); if (tmp___3 == 0) { goto ldv_50684; } 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_50687: prepare_to_wait(& mdev->ee_wait, & __wait, 2); tmp___5 = atomic_read((atomic_t const *)(& epoch->epoch_size)); if (tmp___5 == 0) { goto ldv_50686; } else { } schedule(); goto ldv_50687; ldv_50686: finish_wait(& mdev->ee_wait, & __wait); ldv_50684: tmp___6 = atomic_read((atomic_t const *)(& epoch->active)); if (tmp___6 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( atomic_read(&epoch->active) == 0 ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1273); } else { } if (epoch->flags != 0UL) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( epoch->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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1274); } else { } return (1); default: dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Strangeness in mdev->write_ordering %d\n", (unsigned int )mdev->write_ordering); return (0); } ldv_50681: epoch->flags = 0UL; atomic_set(& epoch->epoch_size, 0); atomic_set(& epoch->active, 0); spin_lock(& mdev->epoch_lock); tmp___7 = atomic_read((atomic_t const *)(& (mdev->current_epoch)->epoch_size)); if (tmp___7 != 0) { list_add(& epoch->list, & (mdev->current_epoch)->list); mdev->current_epoch = epoch; mdev->epochs = mdev->epochs + 1U; } else { kfree((void const *)epoch); } spin_unlock(& mdev->epoch_lock); return (1); } } static struct drbd_epoch_entry *read_in_block(struct drbd_conf *mdev , u64 id , sector_t sector , int data_size ) { sector_t capacity ; sector_t tmp ; struct drbd_epoch_entry *e ; struct page *page ; int dgs ; int ds ; int rr ; void *dig_in ; void *dig_vv ; unsigned long *data ; unsigned int tmp___0 ; struct task_struct *tmp___1 ; int tmp___2 ; int _b ; int _b___0 ; int _b___1 ; unsigned int len ; int __min1 ; int __min2 ; void *tmp___3 ; int tmp___4 ; struct task_struct *tmp___5 ; int tmp___6 ; struct page *tmp___7 ; int tmp___8 ; { 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) { tmp___1 = get_current(); tmp___2 = signal_pending(tmp___1); if (tmp___2 == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving data digest: read %d expected %d\n", rr, dgs); } else { } return (0); } else { } } else { } data_size = data_size - dgs; _b = data_size == 0; if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "read_in_block", (char *)"data_size == 0", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1329); } else { } if (_b != 0) { return (0); } else { } _b___0 = (data_size & 511) != 0; if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "read_in_block", (char *)"data_size & 0x1ff", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1330); } else { } if (_b___0 != 0) { return (0); } else { } _b___1 = (unsigned int )data_size > 131072U; if (_b___1 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "read_in_block", (char *)"data_size > DRBD_MAX_BIO_SIZE", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1331); } else { } if (_b___1 != 0) { return (0); } else { } if ((sector_t )(data_size >> 9) + sector > capacity) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "request from peer beyond end of local disk: capacity: %llus < sector: %llus + size: %u\n", (unsigned long long )capacity, (unsigned long long )sector, data_size); return (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_50717; ldv_50716: __min1 = ds; __min2 = 4096; len = (unsigned int )(__min1 < __min2 ? __min1 : __min2); tmp___3 = kmap(page); data = (unsigned long *)tmp___3; rr = drbd_recv(mdev, (void *)data, (size_t )len); tmp___4 = drbd_insert_fault(mdev, 9U); if (tmp___4 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Fault injection: Corrupting data on receive\n"); *data = ~ *data; } else { } kunmap(page); if ((unsigned int )rr != len) { drbd_free_some_ee(mdev, e, 0); tmp___5 = get_current(); tmp___6 = signal_pending(tmp___5); if (tmp___6 == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving data: read %d expected %d\n", rr, len); } else { } return (0); } else { } ds = ds - rr; page = page_chain_next(page); ldv_50717: ; if ((unsigned long )page != (unsigned long )((struct page *)0)) { tmp___7 = page_chain_next(page); __builtin_prefetch((void const *)tmp___7); if (1 != 0) { goto ldv_50716; } else { goto ldv_50718; } } else { } ldv_50718: ; if (dgs != 0) { drbd_csum_ee(mdev, mdev->integrity_r_tfm, e, dig_vv); tmp___8 = memcmp((void const *)dig_in, (void const *)dig_vv, (size_t )dgs); if (tmp___8 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Digest integrity check FAILED: %llus +%u\n", (unsigned long long )sector, data_size); drbd_bcast_ee(mdev, "digest failed", 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 ; struct task_struct *tmp ; int tmp___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_50738; ldv_50737: __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; tmp = get_current(); tmp___0 = signal_pending(tmp); if (tmp___0 == 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); } else { } goto ldv_50736; } else { } data_size = data_size - rr; ldv_50738: ; if (data_size != 0) { goto ldv_50737; } else { } ldv_50736: kunmap(page); drbd_pp_free(mdev, page, 0); return (rv); } } static int recv_dless_read(struct drbd_conf *mdev , struct drbd_request *req , sector_t sector , int data_size ) { struct bio_vec *bvec ; struct bio *bio ; int dgs ; int rr ; int i ; int expect ; void *dig_in ; void *dig_vv ; unsigned int tmp ; struct task_struct *tmp___0 ; int tmp___1 ; int __min1 ; int __min2 ; void *tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; int tmp___5 ; { 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) { tmp___0 = get_current(); tmp___1 = signal_pending(tmp___0); if (tmp___1 == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving data reply digest: read %d expected %d\n", rr, dgs); } else { } return (0); } else { } } else { } data_size = data_size - dgs; mdev->recv_cnt = mdev->recv_cnt + (unsigned int )(data_size >> 9); bio = req->master_bio; if (bio->bi_sector != sector) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( sector == bio->bi_sector ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1448); } else { } bvec = bio->bi_io_vec + (unsigned long )bio->bi_idx; i = (int )bio->bi_idx; goto ldv_50757; ldv_50756: __min1 = data_size; __min2 = (int )bvec->bv_len; expect = __min1 < __min2 ? __min1 : __min2; tmp___2 = kmap(bvec->bv_page); rr = drbd_recv(mdev, tmp___2 + (unsigned long )bvec->bv_offset, (size_t )expect); kunmap(bvec->bv_page); if (rr != expect) { tmp___3 = get_current(); tmp___4 = signal_pending(tmp___3); if (tmp___4 == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving data reply: read %d expected %d\n", rr, expect); } else { } return (0); } else { } data_size = data_size - rr; bvec = bvec + 1; i = i + 1; ldv_50757: ; if ((int )bio->bi_vcnt > i) { goto ldv_50756; } else { } if (dgs != 0) { drbd_csum_bio(mdev, mdev->integrity_r_tfm, bio, dig_vv); tmp___5 = memcmp((void const *)dig_in, (void const *)dig_vv, (size_t )dgs); if (tmp___5 != 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1474); } else { } return (1); } } static int e_end_resync_block(struct drbd_conf *mdev , struct drbd_work *w , int unused ) { struct drbd_epoch_entry *e ; sector_t sector ; int ok ; int tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; { e = (struct drbd_epoch_entry *)w; sector = e->sector; tmp = hlist_unhashed((struct hlist_node const *)(& e->collision)); if (tmp == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( hlist_unhashed(&e->collision) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1486); } else { } tmp___0 = ldv__builtin_expect((e->flags & 8UL) == 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1489U); 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", 1497, 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", 1510, 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 { } dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "submit failed, triggering re-connect\n"); spin_lock_irq(& mdev->req_lock); list_del(& e->w.list); spin_unlock_irq(& mdev->req_lock); drbd_free_some_ee(mdev, e, 0); fail: put_ldev(mdev); return (0); } } static int receive_DataReply(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { struct drbd_request *req ; sector_t sector ; int ok ; struct p_data *p ; __u64 tmp ; long tmp___0 ; { p = & mdev->data.rbuf.data; tmp = __fswab64(p->sector); sector = (sector_t )tmp; spin_lock_irq(& mdev->req_lock); req = _ar_id_to_req(mdev, p->block_id, sector); spin_unlock_irq(& mdev->req_lock); tmp___0 = 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1576); } 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 ; 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 ((mdev->net_conf)->wire_protocol == 3) { tmp___0 = ldv__builtin_expect((e->flags & 8UL) == 0UL, 1L); if (tmp___0 != 0L) { pcmd = ((int )mdev->state.ldv_38745.conn > 15 && (int )mdev->state.ldv_38745.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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1614U); } 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", 1620, tmp___1); } else { } } else { } if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) != 0U) { spin_lock_irq(& mdev->req_lock); tmp___3 = hlist_unhashed((struct hlist_node const *)(& e->collision)); if (tmp___3 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !hlist_unhashed(&e->collision) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1626); } else { } hlist_del_init(& e->collision); spin_unlock_irq(& mdev->req_lock); } else { tmp___4 = hlist_unhashed((struct hlist_node const *)(& e->collision)); if (tmp___4 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( hlist_unhashed(&e->collision) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1630); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1643); } else { } ok = drbd_send_ack(mdev, P_DISCARD_ACK, e); spin_lock_irq(& mdev->req_lock); tmp = hlist_unhashed((struct hlist_node const *)(& e->collision)); if (tmp != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !hlist_unhashed(&e->collision) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1647); } else { } hlist_del_init(& e->collision); spin_unlock_irq(& mdev->req_lock); atomic_dec(& mdev->unacked_cnt); tmp___1 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); if (tmp___1 < 0) { tmp___0 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: unacked_cnt = %d < 0 !\n", "e_send_discard_ack", 1651, tmp___0); } else { } return (ok); } } static bool overlapping_resync_write(struct drbd_conf *mdev , struct drbd_epoch_entry *data_e ) { struct drbd_epoch_entry *rs_e ; bool rv ; struct list_head const *__mptr ; int tmp ; struct list_head const *__mptr___0 ; { rv = 0; spin_lock_irq(& mdev->req_lock); __mptr = (struct list_head const *)mdev->sync_ee.next; rs_e = (struct drbd_epoch_entry *)__mptr; goto ldv_50836; ldv_50835: tmp = overlaps(data_e->sector, (int )data_e->size, rs_e->sector, (int )rs_e->size); if (tmp != 0) { rv = 1; goto ldv_50834; } else { } __mptr___0 = (struct list_head const *)rs_e->w.list.next; rs_e = (struct drbd_epoch_entry *)__mptr___0; ldv_50836: ; if ((unsigned long )(& rs_e->w.list) != (unsigned long )(& mdev->sync_ee)) { goto ldv_50835; } else { } ldv_50834: spin_unlock_irq(& mdev->req_lock); return (rv); } } 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_50846: prepare_to_wait(& mdev->seq_wait, & wait, 1); tmp___0 = seq_cmp(packet_seq, mdev->peer_seq + 1U); if (tmp___0 <= 0) { goto ldv_50845; } else { } tmp___1 = get_current(); tmp___2 = signal_pending(tmp___1); if (tmp___2 != 0) { ret = -512; goto ldv_50845; } 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_50845; } else { } goto ldv_50846; ldv_50845: finish_wait(& mdev->seq_wait, & wait); if (mdev->peer_seq + 1U == (unsigned int )packet_seq) { mdev->peer_seq = mdev->peer_seq + 1U; } else { } spin_unlock(& mdev->peer_seq_lock); return (ret); } } static unsigned long wire_flags_to_bio(struct drbd_conf *mdev , u32 dpf ) { { return ((unsigned long )(((((dpf & 2U) != 0U ? 16 : 0) | ((dpf & 16U) != 0U ? 1024 : 0)) | ((dpf & 32U) != 0U ? 2048 : 0)) | ((dpf & 64U) != 0U ? 128 : 0))); } } static int receive_Data(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { sector_t sector ; struct drbd_epoch_entry *e ; struct p_data *p ; int rw ; u32 dp_flags ; __u32 tmp ; int tmp___0 ; int tmp___1 ; __u64 tmp___2 ; __u32 tmp___3 ; unsigned long tmp___4 ; int size ; int discard ; int tmp___5 ; wait_queue_t wait ; struct task_struct *tmp___6 ; struct drbd_request *i ; struct hlist_node *n ; struct hlist_head *slot ; int first ; long tmp___7 ; long tmp___8 ; __u32 tmp___9 ; int tmp___10 ; struct hlist_head *tmp___11 ; int have_unacked ; int have_conflict ; struct task_struct *tmp___12 ; struct task_struct *tmp___13 ; int tmp___14 ; struct hlist_node const *__mptr ; struct task_struct *tmp___15 ; int tmp___16 ; bool tmp___17 ; int tmp___18 ; wait_queue_t __wait ; struct task_struct *tmp___19 ; bool tmp___20 ; int tmp___21 ; int tmp___22 ; { p = & mdev->data.rbuf.data; rw = 1; tmp___1 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___1 == 0) { spin_lock(& mdev->peer_seq_lock); tmp = __fswab32(p->seq_num); if (mdev->peer_seq + 1U == tmp) { mdev->peer_seq = mdev->peer_seq + 1U; } else { } spin_unlock(& mdev->peer_seq_lock); drbd_send_ack_dp(mdev, P_NEG_ACK, p, (int )data_size); atomic_inc(& (mdev->current_epoch)->epoch_size); tmp___0 = drbd_drain_block(mdev, (int )data_size); return (tmp___0); } else { } tmp___2 = __fswab64(p->sector); sector = (sector_t )tmp___2; e = read_in_block(mdev, p->block_id, sector, (int )data_size); if ((unsigned long )e == (unsigned long )((struct drbd_epoch_entry *)0)) { put_ldev(mdev); return (0); } else { } e->w.cb = & e_end_block; tmp___3 = __fswab32(p->dp_flags); dp_flags = tmp___3; tmp___4 = wire_flags_to_bio(mdev, dp_flags); rw = (int )((unsigned int )tmp___4 | (unsigned int )rw); if ((dp_flags & 4U) != 0U) { e->flags = e->flags | 2UL; } else { } spin_lock(& mdev->epoch_lock); e->epoch = mdev->current_epoch; atomic_inc(& (e->epoch)->epoch_size); atomic_inc(& (e->epoch)->active); spin_unlock(& mdev->epoch_lock); if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) == 0U) { spin_lock_irq(& mdev->req_lock); } else { size = (int const )e->size; tmp___5 = constant_test_bit(6U, (unsigned long const volatile *)(& mdev->flags)); discard = tmp___5; tmp___6 = get_current(); wait.flags = 0U; wait.private = (void *)tmp___6; wait.func = & autoremove_wake_function; wait.task_list.next = & wait.task_list; wait.task_list.prev = & wait.task_list; if ((mdev->net_conf)->wire_protocol != 3) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->net_conf->wire_protocol == DRBD_PROT_C ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1798); } else { } tmp___7 = ldv__builtin_expect((unsigned long )mdev->ee_hash == (unsigned long )((struct hlist_head *)0), 0L); if (tmp___7 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared"), "i" (1799), "i" (12UL)); ldv_50868: ; goto ldv_50868; } else { } tmp___8 = ldv__builtin_expect((unsigned long )mdev->tl_hash == (unsigned long )((struct hlist_head *)0), 0L); if (tmp___8 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared"), "i" (1800), "i" (12UL)); ldv_50869: ; goto ldv_50869; } else { } tmp___9 = __fswab32(p->seq_num); tmp___10 = drbd_wait_peer_seq(mdev, tmp___9); if (tmp___10 != 0) { goto out_interrupted; } else { } spin_lock_irq(& mdev->req_lock); tmp___11 = ee_hash_slot(mdev, sector); hlist_add_head(& e->collision, tmp___11); slot = tl_hash_slot(mdev, sector); first = 1; ldv_50880: have_unacked = 0; have_conflict = 0; prepare_to_wait(& mdev->misc_wait, & wait, 1); n = slot->first; goto ldv_50877; ldv_50876: tmp___14 = overlaps(i->sector, (int )i->size, sector, size); if (tmp___14 != 0) { if (first != 0) { tmp___12 = get_current(); tmp___13 = get_current(); dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s[%u] Concurrent local write detected!\tnew: %llus +%u; pending: %llus +%u\n", (char *)(& tmp___13->comm), tmp___12->pid, (unsigned long long )sector, size, (unsigned long long )i->sector, i->size); } else { } if ((i->rq_state & 16UL) != 0UL) { have_unacked = have_unacked + 1; } else { } have_conflict = have_conflict + 1; } else { } n = n->next; ldv_50877: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)n; i = (struct drbd_request *)__mptr + 0xffffffffffffffd8UL; if (1 != 0) { goto ldv_50876; } else { goto ldv_50878; } } else { } ldv_50878: ; if (have_conflict == 0) { goto ldv_50879; } 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___15 = get_current(); tmp___16 = signal_pending(tmp___15); if (tmp___16 != 0) { hlist_del_init(& e->collision); spin_unlock_irq(& mdev->req_lock); finish_wait(& mdev->misc_wait, & wait); goto out_interrupted; } else { } spin_unlock_irq(& mdev->req_lock); if (first != 0) { first = 0; dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "Concurrent write! [W AFTERWARDS] sec=%llus\n", (unsigned long long )sector); } else if (discard != 0) { if (have_unacked != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( have_unacked == 0 ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1906); } else { } } else { } schedule(); spin_lock_irq(& mdev->req_lock); goto ldv_50880; ldv_50879: finish_wait(& mdev->misc_wait, & wait); } list_add(& e->w.list, & mdev->active_ee); spin_unlock_irq(& mdev->req_lock); if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 272U) { tmp___17 = overlapping_resync_write(mdev, e); if (tmp___17) { tmp___18 = 0; } else { tmp___18 = 1; } if (tmp___18) { goto ldv_50881; } else { } tmp___19 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___19; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_50884: prepare_to_wait(& mdev->ee_wait, & __wait, 2); tmp___20 = overlapping_resync_write(mdev, e); if (tmp___20) { tmp___21 = 0; } else { tmp___21 = 1; } if (tmp___21) { goto ldv_50883; } else { } schedule(); goto ldv_50884; ldv_50883: finish_wait(& mdev->ee_wait, & __wait); ldv_50881: ; } else { } switch ((mdev->net_conf)->wire_protocol) { case 3: inc_unacked(mdev); goto ldv_50886; case 2: drbd_send_ack(mdev, P_RECV_ACK, e); goto ldv_50886; case 1: ; goto ldv_50886; } ldv_50886: ; if ((int )mdev->state.ldv_38745.pdsk <= 3) { __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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 1938U); e->flags = e->flags | 1UL; e->flags = e->flags & 0xfffffffffffffffdUL; drbd_al_begin_io(mdev, e->sector); } else { } tmp___22 = drbd_submit_ee(mdev, e, (unsigned int const )rw, 4); if (tmp___22 == 0) { return (1); } else { } dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "submit failed, triggering re-connect\n"); spin_lock_irq(& mdev->req_lock); list_del(& e->w.list); hlist_del_init(& e->collision); spin_unlock_irq(& mdev->req_lock); if ((int )e->flags & 1) { drbd_al_complete_io(mdev, e->sector); } else { } out_interrupted: drbd_may_finish_epoch(mdev, e->epoch, EV_CLEANUP); put_ldev(mdev); drbd_free_some_ee(mdev, e, 0); return (0); } } int drbd_rs_should_slow_down(struct drbd_conf *mdev , sector_t sector ) { struct gendisk *disk ; unsigned long db ; unsigned long dt ; unsigned long dbdt ; struct lc_element *tmp ; int curr_events ; int throttle ; struct bm_extent *bm_ext ; struct lc_element const *__mptr ; int tmp___0 ; unsigned long res ; unsigned int _cpu ; void const *__vpp_verify ; unsigned long __ptr ; unsigned long res___0 ; unsigned int _cpu___0 ; void const *__vpp_verify___0 ; unsigned long __ptr___0 ; int tmp___1 ; unsigned long rs_left ; int i ; unsigned long tmp___2 ; { disk = (((mdev->ldev)->backing_bdev)->bd_contains)->bd_disk; throttle = 0; if (mdev->sync_conf.c_min_rate == 0) { return (0); } else { } spin_lock_irq(& mdev->al_lock); tmp = lc_find(mdev->resync, (unsigned int )(sector >> 15)); if ((unsigned long )tmp != (unsigned long )((struct lc_element *)0)) { __mptr = (struct lc_element const *)tmp; bm_ext = (struct bm_extent *)__mptr + 0xfffffffffffffff0UL; tmp___0 = constant_test_bit(2U, (unsigned long const volatile *)(& bm_ext->flags)); if (tmp___0 != 0) { spin_unlock_irq(& mdev->al_lock); return (0); } else { } } else { } spin_unlock_irq(& mdev->al_lock); res = 0UL; _cpu = 4294967295U; goto ldv_50910; ldv_50909: __vpp_verify = 0; __asm__ ("": "=r" (__ptr): "0" (disk->part0.dkstats)); res = ((struct disk_stats *)(__per_cpu_offset[_cpu] + __ptr))->sectors[0] + res; ldv_50910: _cpu = cpumask_next((int )_cpu, cpu_possible_mask); if ((unsigned int )nr_cpu_ids > _cpu) { goto ldv_50909; } else { } res___0 = 0UL; _cpu___0 = 4294967295U; goto ldv_50920; ldv_50919: __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_50920: _cpu___0 = cpumask_next((int )_cpu___0, cpu_possible_mask); if ((unsigned int )nr_cpu_ids > _cpu___0) { goto ldv_50919; } else { } tmp___1 = atomic_read((atomic_t const *)(& mdev->rs_sect_ev)); curr_events = ((int )res + (int )res___0) - tmp___1; if (mdev->rs_last_events == 0 || curr_events - mdev->rs_last_events > 64) { mdev->rs_last_events = curr_events; i = (mdev->rs_last_mark + 7) % 8; if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 288U || (unsigned int )*((unsigned short *)mdev + 1138UL) == 304U) { rs_left = mdev->ov_left; } else { tmp___2 = drbd_bm_total_weight(mdev); rs_left = tmp___2 - mdev->rs_failed; } dt = (unsigned long )(((long )jiffies - (long )mdev->rs_mark_time[i]) / 250L); if (dt == 0UL) { dt = dt + 1UL; } else { } db = mdev->rs_mark_left[i] - rs_left; dbdt = db / dt << 2; if ((unsigned long )mdev->sync_conf.c_min_rate < dbdt) { throttle = 1; } else { } } else { } return (throttle); } } static int receive_DataRequest(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int digest_size ) { sector_t sector ; sector_t capacity ; sector_t tmp ; struct drbd_epoch_entry *e ; struct digest_info *di ; int size ; int verb ; unsigned int fault_type ; struct p_block_req *p ; __u64 tmp___0 ; __u32 tmp___1 ; int tmp___2 ; int tmp___3 ; char const *tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; void *tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; unsigned long now ; int i ; unsigned long tmp___12 ; char const *tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; { tmp = drbd_get_capacity(mdev->this_bdev); capacity = tmp; di = 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2044, (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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2049, (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_50939; case 9U: ; case 33U: ; case 30U: drbd_send_ack_rp(mdev, P_NEG_RS_DREPLY, p); goto ldv_50939; 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", 2067, tmp___2); } else { } drbd_send_ack_ex(mdev, P_OV_RESULT, sector, size, 4711ULL); goto ldv_50939; default: tmp___4 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "unexpected command (%s) in receive_DataRequest\n", tmp___4); } ldv_50939: ; 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; mdev->bm_resync_fo = sector >> 3; goto ldv_50952; case 31U: ; case 33U: fault_type = 3U; tmp___8 = kmalloc((unsigned long )digest_size + 16UL, 16U); di = (struct digest_info *)tmp___8; if ((unsigned long )di == (unsigned long )((struct digest_info *)0)) { goto out_free_e; } else { } di->digest_size = (int )digest_size; di->digest = (void *)di + 16U; e->ldv_47524.digest = di; e->flags = e->flags | 16UL; tmp___9 = drbd_recv(mdev, di->digest, (size_t )digest_size); if ((unsigned int )tmp___9 != digest_size) { goto out_free_e; } else { } if ((unsigned int )cmd == 33U) { if (mdev->agreed_pro_version <= 88) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->agreed_pro_version >= 89 ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2122); } else { } e->w.cb = & w_e_end_csum_rs_req; mdev->bm_resync_fo = sector >> 3; } else if ((unsigned int )cmd == 31U) { atomic_add(size >> 9, & mdev->rs_sect_in); e->w.cb = & w_e_end_ov_reply; atomic_dec(& mdev->rs_pending_cnt); tmp___11 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); if (tmp___11 < 0) { tmp___10 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "receive_DataRequest", 2130, tmp___10); } else { } goto submit_for_resync; } else { } goto ldv_50952; case 30U: ; if (mdev->ov_start_sector == 0xffffffffffffffffUL && mdev->agreed_pro_version > 89) { now = jiffies; mdev->ov_start_sector = sector; mdev->ov_position = sector; tmp___12 = drbd_bm_bits(mdev); mdev->ov_left = tmp___12 - (sector >> 3); mdev->rs_total = mdev->ov_left; i = 0; goto ldv_50964; ldv_50963: mdev->rs_mark_left[i] = mdev->ov_left; mdev->rs_mark_time[i] = now; i = i + 1; ldv_50964: ; if (i <= 7) { goto ldv_50963; } else { } _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_50952; default: tmp___13 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "unexpected command (%s) in receive_DataRequest\n", tmp___13); fault_type = 10U; goto out_free_e; } ldv_50952: ; if ((unsigned int )*((unsigned char *)mdev + 2276UL) != 4U) { tmp___14 = drbd_rs_should_slow_down(mdev, sector); if (tmp___14 != 0) { schedule_timeout_uninterruptible(25L); } else { } } else { } tmp___15 = drbd_rs_begin_io(mdev, sector); if (tmp___15 != 0) { goto out_free_e; } else { } submit_for_resync: atomic_add(size >> 9, & mdev->rs_sect_ev); submit: inc_unacked(mdev); spin_lock_irq(& mdev->req_lock); list_add_tail(& e->w.list, & mdev->read_ee); spin_unlock_irq(& mdev->req_lock); tmp___16 = drbd_submit_ee(mdev, e, 0U, (int const )fault_type); if (tmp___16 == 0) { return (1); } else { } dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "submit failed, triggering re-connect\n"); spin_lock_irq(& mdev->req_lock); list_del(& e->w.list); spin_unlock_irq(& mdev->req_lock); out_free_e: put_ldev(mdev); drbd_free_some_ee(mdev, e, 0); return (0); } } static int drbd_asb_recover_0p(struct drbd_conf *mdev ) { int self ; int peer ; int rv ; unsigned long ch_self ; unsigned long ch_peer ; int tmp ; 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_50978; case 0: ; goto ldv_50978; case 1: ; if (self == 0 && peer == 1) { rv = -1; goto ldv_50978; } else { } if (self == 1 && peer == 0) { rv = 1; goto ldv_50978; } else { } case 2: ; if (self == 0 && peer == 1) { rv = 1; goto ldv_50978; } else { } if (self == 1 && peer == 0) { rv = -1; goto ldv_50978; } 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_50978; } else { if (ch_peer == 0UL) { rv = 1; goto ldv_50978; } else { } if (ch_self == 0UL) { rv = -1; goto ldv_50978; } else { } } if ((mdev->net_conf)->after_sb_0p == 3) { goto ldv_50978; } 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_50978; case 5: rv = -1; goto ldv_50978; case 6: rv = 1; } ldv_50978: ; return (rv); } } static int drbd_asb_recover_1p(struct drbd_conf *mdev ) { int hg ; int rv ; enum drbd_state_rv rv2 ; union drbd_state val ; union drbd_state mask ; { rv = -100; 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_50996; case 0: ; goto ldv_50996; case 7: hg = drbd_asb_recover_0p(mdev); if (hg == -1 && (unsigned int )*((unsigned char *)mdev + 2276UL) == 2U) { rv = hg; } else { } if (hg == 1 && (unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { rv = hg; } else { } goto ldv_50996; case 10: rv = drbd_asb_recover_0p(mdev); goto ldv_50996; case 8: ; return ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U ? 1 : -1); case 9: hg = drbd_asb_recover_0p(mdev); if (hg == -1 && (unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { drbd_set_role(mdev, R_SECONDARY, 0); val.i = 0U; val.ldv_38745.role = 2U; mask.i = 0U; mask.ldv_38745.role = 3U; rv2 = drbd_change_state(mdev, CS_VERBOSE, mask, val); if ((int )rv2 != 1) { drbd_khelper(mdev, (char *)"pri-lost-after-sb"); } else { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Successfully gave up primary role.\n"); rv = hg; } } else { rv = hg; } } ldv_50996: ; return (rv); } } static int drbd_asb_recover_2p(struct drbd_conf *mdev ) { int hg ; int rv ; enum drbd_state_rv rv2 ; union drbd_state val ; union drbd_state mask ; { rv = -100; 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_51019; case 10: rv = drbd_asb_recover_0p(mdev); goto ldv_51019; case 0: ; goto ldv_51019; case 9: hg = drbd_asb_recover_0p(mdev); if (hg == -1) { val.i = 0U; val.ldv_38745.role = 2U; mask.i = 0U; mask.ldv_38745.role = 3U; rv2 = drbd_change_state(mdev, CS_VERBOSE, mask, val); if ((int )rv2 != 1) { drbd_khelper(mdev, (char *)"pri-lost-after-sb"); } else { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Successfully gave up primary role.\n"); rv = hg; } } else { rv = hg; } } ldv_51019: ; 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 (-1091); } 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_38745.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 (-1091); } 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) { if (mdev->agreed_pro_version <= 95 ? (((mdev->ldev)->md.uuid[2] ^ *(mdev->p_uuid + 3UL)) & 0xfffffffffffffffeULL) == 0ULL : peer + 281474976710656ULL == (*(mdev->p_uuid + 1UL) & 0xfffffffffffffffeULL)) { if (mdev->agreed_pro_version <= 90) { return (-1091); } else { } *(mdev->p_uuid + 1UL) = *(mdev->p_uuid + 2UL); *(mdev->p_uuid + 2UL) = *(mdev->p_uuid + 3UL); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Lost last syncUUID packet, corrected:\n"); drbd_uuid_dump(mdev, (char *)"peer", mdev->p_uuid, *(mdev->p_uuid + 4UL), *(mdev->p_uuid + 5UL)); return (-1); } else { } } else { } *rule_nr = 60; self = (mdev->ldev)->md.uuid[0] & 0xfffffffffffffffeULL; i = 2; goto ldv_51050; ldv_51049: peer = *(mdev->p_uuid + (unsigned long )i) & 0xfffffffffffffffeULL; if (self == peer) { return (-2); } else { } i = i + 1; ldv_51050: ; if (i <= 3) { goto ldv_51049; } 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) { if (mdev->agreed_pro_version <= 95 ? (((mdev->ldev)->md.uuid[3] ^ *(mdev->p_uuid + 2UL)) & 0xfffffffffffffffeULL) == 0ULL : self + 281474976710656ULL == ((mdev->ldev)->md.uuid[1] & 0xfffffffffffffffeULL)) { if (mdev->agreed_pro_version <= 90) { return (-1091); } else { } _drbd_uuid_set(mdev, 1, (mdev->ldev)->md.uuid[2]); _drbd_uuid_set(mdev, 2, (mdev->ldev)->md.uuid[3]); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Last syncUUID did not get through, corrected:\n"); if ((int )mdev->state.ldv_38745.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_51053; ldv_51052: self = (mdev->ldev)->md.uuid[i] & 0xfffffffffffffffeULL; if (self == peer) { return (2); } else { } i = i + 1; ldv_51053: ; if (i <= 3) { goto ldv_51052; } 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_51059; ldv_51058: self = (mdev->ldev)->md.uuid[i] & 0xfffffffffffffffeULL; j = 2; goto ldv_51056; ldv_51055: peer = *(mdev->p_uuid + (unsigned long )j) & 0xfffffffffffffffeULL; if (self == peer) { return (-100); } else { } j = j + 1; ldv_51056: ; if (j <= 3) { goto ldv_51055; } else { } i = i + 1; ldv_51059: ; if (i <= 3) { goto ldv_51058; } 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 ret ; int __x___0 ; int tmp ; long ret___0 ; int __x___2 ; int pcount ; int forced ; long ret___1 ; int __x___4 ; long ret___2 ; int __x___6 ; long ret___3 ; int __x___8 ; char const *tmp___0 ; int tmp___1 ; int tmp___2 ; long ret___4 ; int __x___10 ; unsigned long tmp___3 ; unsigned long tmp___4 ; { rv = C_MASK; mydisk = (enum drbd_disk_state )mdev->state.ldv_38745.disk; if ((unsigned int )mydisk == 3U) { mydisk = (enum drbd_disk_state )mdev->new_state_tmp.ldv_38745.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 < -1000) { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "To resolve this both sides have to support at least protocol %d\n", -1000 - hg); return (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___0 = hg; ret = (long )(__x___0 < 0 ? - __x___0 : __x___0); if (ret == 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___2 = hg; ret___0 = (long )(__x___2 < 0 ? - __x___2 : __x___2); if (ret___0 == 100L) { drbd_khelper(mdev, (char *)"initial-split-brain"); } else { } if (hg == 100 || (hg == -100 && (unsigned int )*((unsigned char *)mdev->net_conf + 540UL) != 0U)) { pcount = ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) + ((unsigned int )peer_role == 1U); forced = hg == -100; switch (pcount) { case 0: hg = drbd_asb_recover_0p(mdev); goto ldv_51082; case 1: hg = drbd_asb_recover_1p(mdev); goto ldv_51082; case 2: hg = drbd_asb_recover_2p(mdev); goto ldv_51082; } ldv_51082: __x___4 = hg; ret___1 = (long )(__x___4 < 0 ? - __x___4 : __x___4); if (ret___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 + 540UL) != 0U && (*(mdev->p_uuid + 5UL) & 1ULL) == 0ULL) { hg = -1; } else { } if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) == 0U && (int )*(mdev->p_uuid + 5UL) & 1) { hg = 1; } else { } __x___6 = hg; ret___2 = (long )(__x___6 < 0 ? - __x___6 : __x___6); if (ret___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 + 2276UL) == 1U) && (int )mdev->state.ldv_38745.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 + 540UL) != 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___8 = hg; ret___3 = (long )(__x___8 < 0 ? - __x___8 : __x___8); 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, ret___3 > 1L ? (char *)"full" : (char *)"bit-map based"); } return (C_MASK); } else { } } __x___10 = hg; ret___4 = (long )(__x___10 < 0 ? - __x___10 : __x___10); if (ret___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", BM_LOCKED_SET_ALLOWED); 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 + 540UL) != 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_38745.conn = 1U; mask.i = 0U; mask.ldv_38745.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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2883); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2887); } 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 || data_size == 0U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "verify-alg of wrong size, peer wants %u, accepting only up to %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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2912); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2918); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 2919); } 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 + 1138UL) == 144U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Different verify-alg settings. me=\"%s\" peer=\"%s\"\n", (unsigned char *)(& mdev->sync_conf.verify_alg), (char *)(& p->verify_alg)); goto disconnect; } else { } verify_tfm = drbd_crypto_alloc_digest_safe((struct drbd_conf const *)mdev, (char const *)(& p->verify_alg), "verify-alg"); tmp___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 + 1138UL) == 144U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Different csums-alg settings. me=\"%s\" peer=\"%s\"\n", (unsigned char *)(& mdev->sync_conf.csums_alg), (char *)(& p->csums_alg)); goto disconnect; } else { } csums_tfm = drbd_crypto_alloc_digest_safe((struct drbd_conf const *)mdev, (char const *)(& p->csums_alg), "csums-alg"); tmp___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((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_38745.conn = 1U; mask.i = 0U; mask.ldv_38745.conn = 31U; drbd_force_state(mdev, mask, val); return (0); } } static void warn_if_differ_considerably(struct drbd_conf *mdev , char const *s , sector_t a , sector_t b ) { sector_t d ; { if (a == 0UL || 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 ; 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 ; __u32 tmp___9 ; sector_t tmp___10 ; int tmp___11 ; __u64 tmp___12 ; sector_t tmp___13 ; int tmp___14 ; { 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 + 2277UL) == 0U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "some backing storage is needed\n"); val.i = 0U; val.ldv_38745.conn = 1U; mask.i = 0U; mask.ldv_38745.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 + 1138UL) == 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_38745.disk > 4) && (int )mdev->state.ldv_38745.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_38745.conn = 1U; mask___0.i = 0U; mask___0.ldv_38745.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_determine_dev_size(mdev, ddsf); put_ldev(mdev); if ((int )dd == -1) { return (0); } else { } drbd_md_sync(mdev); } else { drbd_set_my_capacity(mdev, p_size); } tmp___9 = __fswab32(p->max_bio_size); mdev->peer_max_bio_size = (int )tmp___9; drbd_reconsider_max_bio_size(mdev); tmp___11 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___11 != 0) { tmp___10 = drbd_get_capacity((mdev->ldev)->backing_bdev); if ((mdev->ldev)->known_size != tmp___10) { (mdev->ldev)->known_size = drbd_get_capacity((mdev->ldev)->backing_bdev); ldsc = 1; } else { } put_ldev(mdev); } else { } if ((int )mdev->state.ldv_38745.conn > 9) { tmp___12 = __fswab64(p->c_size); tmp___13 = drbd_get_capacity(mdev->this_bdev); if (tmp___12 != (unsigned long long )tmp___13 || ldsc != 0) { drbd_send_sizes(mdev, 0, ddsf); } else { } tmp___14 = test_and_clear_bit(24, (unsigned long volatile *)(& mdev->flags)); if (tmp___14 != 0 || ((int )dd == 2 && (unsigned int )*((unsigned short *)mdev + 1138UL) == 160U)) { if ((int )mdev->state.ldv_38745.pdsk > 3 && (int )mdev->state.ldv_38745.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 ; int updated_uuids ; 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 ; int tmp___5 ; { p = & mdev->data.rbuf.uuids; updated_uuids = 0; tmp = kmalloc(48UL, 16U); p_uuid = (u64 *)tmp; i = 0; goto ldv_51197; ldv_51196: tmp___0 = __fswab64(p->uuid[i]); *(p_uuid + (unsigned long )i) = tmp___0; i = i + 1; ldv_51197: ; if (i <= 5) { goto ldv_51196; } else { } kfree((void const *)mdev->p_uuid); mdev->p_uuid = p_uuid; if ((((int )mdev->state.ldv_38745.conn <= 9 && (int )mdev->state.ldv_38745.disk <= 3) && (unsigned int )*((unsigned char *)mdev + 2276UL) == 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_38745.conn = 1U; mask.i = 0U; mask.ldv_38745.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 + 1138UL) == 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", BM_LOCKED_TEST_ALLOWED); _drbd_uuid_set(mdev, 0, *p_uuid); _drbd_uuid_set(mdev, 1, 0ULL); __ns.i = mdev->state.i; __ns.ldv_38745.disk = 8U; __ns.ldv_38745.pdsk = 8U; _drbd_set_state(mdev, __ns, CS_VERBOSE, 0); drbd_md_sync(mdev); updated_uuids = 1; } else { } put_ldev(mdev); } else if ((int )mdev->state.ldv_38745.disk <= 3 && (unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { updated_uuids = 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_51206; } 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_51209: 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_51208; } else { } schedule(); goto ldv_51209; ldv_51208: finish_wait(& mdev->misc_wait, & __wait); ldv_51206: ; if ((int )mdev->state.ldv_38745.conn > 9 && (int )mdev->state.ldv_38745.disk <= 3) { tmp___5 = drbd_set_ed_uuid(mdev, *p_uuid); updated_uuids = tmp___5 | updated_uuids; } else { } if (updated_uuids != 0) { drbd_print_uuids(mdev, "receiver updated UUIDs to"); } else { } return (1); } } static union drbd_state convert_state(union drbd_state ps ) { union drbd_state ms ; enum drbd_conns c_tab[32U] ; { c_tab[0] = 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_38745.conn = (unsigned char )c_tab[(int )ps.ldv_38745.conn]; ms.ldv_38745.peer = ps.ldv_38745.role; ms.ldv_38745.role = ps.ldv_38745.peer; ms.ldv_38745.pdsk = ps.ldv_38745.disk; ms.ldv_38745.disk = ps.ldv_38745.pdsk; ms.ldv_38745.peer_isp = (unsigned char )((int )ps.ldv_38745.aftr_isp | (int )ps.ldv_38745.user_isp); return (ms); } } static int receive_req_state(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { struct p_req_state *p ; union drbd_state mask ; union drbd_state val ; enum drbd_state_rv rv ; __u32 tmp ; __u32 tmp___0 ; int tmp___1 ; int tmp___2 ; { p = & mdev->data.rbuf.req_state; tmp = __fswab32(p->mask); mask.i = tmp; tmp___0 = __fswab32(p->val); val.i = tmp___0; tmp___1 = constant_test_bit(6U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___1 != 0) { tmp___2 = constant_test_bit(8U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___2 != 0) { drbd_send_sr_reply(mdev, SS_CONCURRENT_ST_CHG); 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 ; enum drbd_state_rv tmp___8 ; 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_38745.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 ((int )os.ldv_38745.conn <= 7) { return (0); } else { } if ((((*((unsigned int *)(& os) + 0UL) == 32768U || *((unsigned int *)(& os) + 0UL) == 57344U) && (unsigned int )real_peer_disk == 8U) && (int )os.ldv_38745.conn > 10) && (unsigned int )*((unsigned char *)(& os) + 1UL) == 16U) { if ((int )peer_state.ldv_38745.conn > 10 && (int )peer_state.ldv_38745.conn <= 15) { real_peer_disk = D_INCONSISTENT; } else if ((int )os.ldv_38745.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_38745.conn > 16) { real_peer_disk = D_UP_TO_DATE; } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 144U) { ns.ldv_38745.conn = 10U; } else { } if ((unsigned int )*((unsigned short *)(& peer_state) + 0UL) == 352U) { ns.ldv_38745.conn = 23U; } else { } if ((unsigned long )mdev->p_uuid != (unsigned long )((u64 *)0) && (int )peer_state.ldv_38745.disk > 2) { tmp___5 = _get_ldev_if_state(mdev, D_NEGOTIATING); if (tmp___5 != 0) { cr = (int )os.ldv_38745.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(13U, (unsigned long const volatile *)(& mdev->flags)); cr = tmp___2 | cr; cr = ((unsigned int )*((unsigned short *)(& os) + 0UL) == 160U && ((int )peer_state.ldv_38745.conn > 10 && (int )peer_state.ldv_38745.conn <= 14)) | cr; if (cr != 0) { tmp___3 = drbd_sync_handshake(mdev, (enum drbd_role )peer_state.ldv_38745.role, real_peer_disk); ns.ldv_38745.conn = (unsigned char )tmp___3; } else { } put_ldev(mdev); if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 496U) { ns.ldv_38745.conn = 10U; if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 6U) { val.i = 0U; val.ldv_38745.disk = 2U; mask.i = 0U; mask.ldv_38745.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_38745.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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 3348); } else { } val___0.i = 0U; val___0.ldv_38745.conn = 1U; mask___0.i = 0U; mask___0.ldv_38745.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(13, (unsigned long volatile *)(& mdev->flags)); ns.ldv_38745.peer = peer_state.ldv_38745.role; ns.ldv_38745.pdsk = (unsigned char )real_peer_disk; ns.ldv_38745.peer_isp = (unsigned char )((int )peer_state.ldv_38745.aftr_isp | (int )peer_state.ldv_38745.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_38745.disk = mdev->new_state_tmp.ldv_38745.disk; } else { } cs_flags = (enum chg_state_flags )(((int )os.ldv_38745.conn > 9 || (int )ns.ldv_38745.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_38745.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_38745.conn = 6U; val___1.ldv_38745.susp = 0U; mask___1.i = 0U; mask___1.ldv_38745.conn = 31U; mask___1.ldv_38745.susp = 1U; drbd_force_state(mdev, mask___1, val___1); return (0); } else { } } else { } } else { } } else { } } else { } tmp___8 = _drbd_set_state(mdev, ns, cs_flags, 0); rv = (int )tmp___8; ns = mdev->state; spin_unlock_irq(& mdev->req_lock); if (rv <= 0) { val___2.i = 0U; val___2.ldv_38745.conn = 1U; mask___2.i = 0U; mask___2.ldv_38745.conn = 31U; drbd_force_state(mdev, mask___2, val___2); return (0); } else { } if ((int )os.ldv_38745.conn > 9) { if (((int )ns.ldv_38745.conn > 10 && (int )peer_state.ldv_38745.conn <= 10) && (unsigned int )*((unsigned char *)(& peer_state) + 1UL) != 6U) { drbd_send_uuids(mdev); drbd_send_current_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 + 1138UL) == 240U || (unsigned int )*((unsigned short *)mdev + 1138UL) == 368U) || (int )mdev->state.ldv_38745.conn <= 9) || (int )mdev->state.ldv_38745.disk <= 2) { goto ldv_51260; } 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_51263: prepare_to_wait(& mdev->misc_wait, & __wait, 2); if ((((unsigned int )*((unsigned short *)mdev + 1138UL) == 240U || (unsigned int )*((unsigned short *)mdev + 1138UL) == 368U) || (int )mdev->state.ldv_38745.conn <= 9) || (int )mdev->state.ldv_38745.disk <= 2) { goto ldv_51262; } else { } schedule(); goto ldv_51263; ldv_51262: finish_wait(& mdev->misc_wait, & __wait); ldv_51260: 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_print_uuids(mdev, "updated sync uuid"); 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 int receive_bitmap_plain(struct drbd_conf *mdev , unsigned int data_size , unsigned long *buffer , struct bm_xfer_ctx *c ) { unsigned int num_words ; size_t __min1 ; size_t __min2 ; unsigned int want ; int err ; { __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 (-5); } else { } if (want == 0U) { return (0); } else { } err = drbd_recv(mdev, (void *)buffer, (size_t )want); if ((unsigned int )err != want) { if (err >= 0) { err = -5; } else { } return (err); } else { } drbd_bm_merge_lel(mdev, c->word_offset, (size_t )num_words, buffer); c->word_offset = c->word_offset + (unsigned long )num_words; c->bit_offset = c->word_offset * 64UL; if (c->bit_offset > c->bm_bits) { c->bit_offset = c->bm_bits; } else { } return (1); } } static int recv_bm_rle_bits(struct drbd_conf *mdev , struct p_compressed_bm *p , struct bm_xfer_ctx *c ) { struct bitstream bs ; u64 look_ahead ; u64 rl ; u64 tmp ; unsigned long s ; unsigned long e ; int len ; __u16 tmp___0 ; int toggle ; int tmp___1 ; int have ; int bits ; int tmp___2 ; { s = c->bit_offset; tmp___0 = __fswab16((int )p->head.length); len = (int )((unsigned int )tmp___0 - 1U); tmp___1 = DCBP_get_start(p); toggle = tmp___1; tmp___2 = DCBP_get_pad_bits(p); bitstream_init(& bs, (void *)(& p->code), (size_t )len, (unsigned int )tmp___2); bits = bitstream_get_bits(& bs, & look_ahead, 64); if (bits < 0) { return (-5); } else { } have = bits; goto ldv_51293; ldv_51292: bits = vli_decode_bits(& rl, look_ahead); if (bits <= 0) { return (-5); } else { } if (toggle != 0) { e = (unsigned long )(((unsigned long long )s + rl) - 1ULL); if (c->bm_bits <= e) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "bitmap overflow (e:%lu) while decoding bm RLE packet\n", e); return (-5); } else { } _drbd_bm_set_bits(mdev, 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 (-5); } else { } look_ahead = look_ahead >> bits; have = have - bits; bits = bitstream_get_bits(& bs, & tmp, 64 - have); if (bits < 0) { return (-5); } else { } look_ahead = (tmp << have) | look_ahead; have = have + bits; s = (unsigned long )((unsigned long long )s + rl); toggle = toggle == 0; ldv_51293: ; if (have > 0) { goto ldv_51292; } else { } c->bit_offset = s; bm_xfer_ctx_bit_to_word_offset(c); return (c->bm_bits != s); } } static int decode_bitmap_c(struct drbd_conf *mdev , struct p_compressed_bm *p , struct bm_xfer_ctx *c ) { int tmp ; enum drbd_bitmap_code tmp___0 ; union drbd_state val ; union drbd_state mask ; { tmp___0 = DCBP_get_code(p); if ((unsigned int )tmp___0 == 2U) { tmp = recv_bm_rle_bits(mdev, p, c); return (tmp); } else { } dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "receive_bitmap_c: unknown encoding %u\n", (int )p->encoding); val.i = 0U; val.ldv_38745.conn = 6U; mask.i = 0U; mask.ldv_38745.conn = 31U; drbd_force_state(mdev, mask, val); return (-5); } } void INFO_bm_xfer_stats(struct drbd_conf *mdev , char const *direction , struct bm_xfer_ctx *c ) { unsigned int plain ; unsigned int total ; unsigned int r ; { plain = (unsigned int )(((c->bm_words + 510UL) / 511UL + c->bm_words) + 1UL) * 8U; total = c->bytes[0] + c->bytes[1]; if (total == 0U) { return; } else { } if (total >= plain) { return; } else { } 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 ; int err ; int ok ; struct p_header80 *h ; unsigned long tmp ; struct bm_xfer_ctx __constr_expr_0 ; unsigned long tmp___0 ; size_t tmp___1 ; struct p_compressed_bm *p ; size_t __len ; void *__ret ; int tmp___2 ; int tmp___3 ; enum drbd_state_rv rv ; int tmp___4 ; union drbd_state val ; union drbd_state mask ; char const *tmp___5 ; { ok = 0; h = & mdev->data.rbuf.header.h80; drbd_bm_lock(mdev, (char *)"receive bitmap", BM_LOCKED_SET_ALLOWED); tmp = __get_free_pages(16U, 0U); buffer = (void *)tmp; if ((unsigned long )buffer == (unsigned long )((void *)0)) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "failed to allocate one page buffer in %s\n", "receive_bitmap"); goto out; } else { } tmp___0 = drbd_bm_bits(mdev); tmp___1 = drbd_bm_words(mdev); __constr_expr_0.bm_bits = tmp___0; __constr_expr_0.bm_words = tmp___1; __constr_expr_0.bit_offset = 0UL; __constr_expr_0.word_offset = 0UL; __constr_expr_0.packets[0] = 0U; __constr_expr_0.packets[1] = 0U; __constr_expr_0.bytes[0] = 0U; __constr_expr_0.bytes[1] = 0U; c = __constr_expr_0; ldv_51330: ; if ((unsigned int )cmd == 4U) { err = receive_bitmap_plain(mdev, data_size, (unsigned long *)buffer, & c); } else if ((unsigned int )cmd == 36U) { if (data_size > 4088U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ReportCBitmap packet too large\n"); goto out; } else { } p = (struct p_compressed_bm *)buffer; __len = 8UL; if (__len > 63UL) { __ret = memcpy((void *)p, (void const *)h, __len); } else { __ret = memcpy((void *)p, (void const *)h, __len); } tmp___2 = drbd_recv(mdev, (void *)(& p->head.payload), (size_t )data_size); if ((unsigned int )tmp___2 != data_size) { goto out; } else { } if (data_size <= 1U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ReportCBitmap packet too small (l:%u)\n", data_size); goto out; } else { } err = decode_bitmap_c(mdev, p, & c); } else { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "receive_bitmap: cmd neither ReportBitMap nor ReportCBitMap (is 0x%x)", (unsigned int )cmd); goto out; } c.packets[(unsigned int )cmd == 4U] = c.packets[(unsigned int )cmd == 4U] + 1U; c.bytes[(unsigned int )cmd == 4U] = (c.bytes[(unsigned int )cmd == 4U] + data_size) + 8U; if (err <= 0) { if (err < 0) { goto out; } else { } goto ldv_51329; } else { } tmp___3 = drbd_recv_header(mdev, & cmd, & data_size); if (tmp___3 == 0) { goto out; } else { } goto ldv_51330; ldv_51329: INFO_bm_xfer_stats(mdev, "receive", & c); if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 224U) { tmp___4 = drbd_send_bitmap(mdev); ok = tmp___4 == 0; if (ok == 0) { goto out; } else { } val.i = 0U; val.ldv_38745.conn = 15U; mask.i = 0U; mask.ldv_38745.conn = 31U; rv = _drbd_request_state(mdev, mask, val, CS_VERBOSE); if ((int )rv != 1) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( rv == 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 3673); } else { } } else if ((unsigned int )*((unsigned short *)mdev + 1138UL) != 208U) { tmp___5 = drbd_conn_str((enum drbd_conns )mdev->state.ldv_38745.conn); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "unexpected cstate (%s) in receive_bitmap\n", tmp___5); } else { } ok = 1; out: drbd_bm_unlock(mdev); if (ok != 0 && (unsigned int )*((unsigned short *)mdev + 1138UL) == 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_51353; ldv_51352: __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), "ASSERT FAILED: %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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 3703); } else { } if (_b != 0) { goto ldv_51351; } else { } size = size - r; ldv_51353: ; if (size > 0) { goto ldv_51352; } else { } ldv_51351: ; return (size == 0); } } static int receive_UnplugRemote(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { { drbd_tcp_quickack(mdev->data.socket); return (1); } } static int receive_out_of_sync(struct drbd_conf *mdev , enum drbd_packets cmd , unsigned int data_size ) { struct p_block_desc *p ; char const *tmp ; __u32 tmp___0 ; __u64 tmp___1 ; { p = & mdev->data.rbuf.block_desc; switch ((int )mdev->state.ldv_38745.conn) { case 15: ; case 14: ; case 23: ; goto ldv_51368; default: tmp = drbd_conn_str((enum drbd_conns )mdev->state.ldv_38745.conn); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED cstate = %s, expected: WFSyncUUID|WFBitMapT|Behind\n", tmp); } ldv_51368: tmp___0 = __fswab32(p->blksize); tmp___1 = __fswab64(p->sector); __drbd_set_out_of_sync(mdev, (sector_t )tmp___1, (int )tmp___0, "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 3732U); return (1); } } static struct data_cmd drbd_cmd_handler[43U] = { {1, 32UL, & receive_Data}, {1, 32UL, & receive_DataReply}, {1, 32UL, & receive_RSDataReply}, {0, 16UL, & receive_Barrier}, {1, 8UL, & receive_bitmap}, {0, 0UL, 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, 24UL, & receive_out_of_sync}, {0, 0UL, 0}, {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 ; char const *tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; long tmp___5 ; char const *tmp___6 ; long tmp___7 ; enum drbd_thread_state tmp___8 ; union drbd_state val ; union drbd_state mask ; { header = & mdev->data.rbuf.header; goto ldv_51389; ldv_51388: 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 > 41U, 0L); if (tmp___0 != 0L) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "unknown packet type %d, l: %d!\n", (unsigned int )cmd, packet_size); goto err_out; } else { tmp___1 = 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; if ((size_t )packet_size != shs && drbd_cmd_handler[(unsigned int )cmd].expect_payload == 0) { tmp___2 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "No payload expected %s l:%d\n", tmp___2, packet_size); goto err_out; } else { } if (shs != 0UL) { rv = drbd_recv(mdev, (void *)(& header->h80.payload), shs); tmp___5 = ldv__builtin_expect((size_t )rv != shs, 0L); if (tmp___5 != 0L) { tmp___3 = get_current(); tmp___4 = signal_pending(tmp___3); if (tmp___4 == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read while reading sub header: rv=%d\n", rv); } else { } goto err_out; } else { } } else { } rv = (*(drbd_cmd_handler[(unsigned int )cmd].function))(mdev, cmd, packet_size - (unsigned int )shs); tmp___7 = ldv__builtin_expect(rv == 0, 0L); if (tmp___7 != 0L) { tmp___6 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "error receiving %s, l: %d!\n", tmp___6, packet_size); goto err_out; } else { } ldv_51389: tmp___8 = get_t_state(& mdev->receiver); if ((unsigned int )tmp___8 == 1U) { goto ldv_51388; } else { } if (0) { err_out: val.i = 0U; val.ldv_38745.conn = 6U; mask.i = 0U; mask.ldv_38745.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 + 1138UL) != 0U) { spin_unlock_irq(& mdev->req_lock); return; } else { } h = mdev->ee_hash; goto ldv_51404; ldv_51403: ; 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_51404: ; if ((unsigned long )(mdev->ee_hash + (unsigned long )mdev->ee_hash_s) > (unsigned long )h) { goto ldv_51403; } else { } kfree((void const *)mdev->ee_hash); mdev->ee_hash = 0; mdev->ee_hash_s = 0U; h = mdev->tl_hash; goto ldv_51407; ldv_51406: ; 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_51407: ; if ((unsigned long )(mdev->tl_hash + (unsigned long )mdev->tl_hash_s) > (unsigned long )h) { goto ldv_51406; } 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 ; union drbd_state val ; union drbd_state mask ; int tmp ; int tmp___0 ; enum drbd_state_rv tmp___1 ; int tmp___2 ; wait_queue_t __wait ; struct task_struct *tmp___3 ; int tmp___4 ; union drbd_state val___0 ; union drbd_state mask___0 ; int tmp___5 ; wait_queue_t __wait___0 ; struct task_struct *tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; { rv = 0; if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 0U) { return; } else { } val.i = 0U; val.ldv_38745.conn = 5U; mask.i = 0U; mask.ldv_38745.conn = 31U; drbd_force_state(mdev, mask, val); 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 = is_susp(mdev->state); if (tmp == 0) { tl_clear(mdev); } else { } _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Connection closed\n"); drbd_md_sync(mdev); fp = FP_DONT_CARE; tmp___0 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___0 != 0) { fp = (enum drbd_fencing_p )(mdev->ldev)->dc.fencing; put_ldev(mdev); } else { } if (((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U && (unsigned int )fp != 0U) && (int )mdev->state.ldv_38745.pdsk > 5) { drbd_try_outdate_peer_async(mdev); } else { } spin_lock_irq(& mdev->req_lock); os = mdev->state; if ((int )os.ldv_38745.conn > 1) { ns = os; ns.ldv_38745.conn = 2U; tmp___1 = _drbd_set_state(mdev, ns, CS_VERBOSE, 0); rv = (int )tmp___1; } else { } spin_unlock_irq(& mdev->req_lock); if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 16U) { tmp___2 = atomic_read((atomic_t const *)(& mdev->net_cnt)); if (tmp___2 == 0) { goto ldv_51421; } 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_51424: 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_51423; } else { } schedule(); goto ldv_51424; ldv_51423: finish_wait(& mdev->net_cnt_wait, & __wait); ldv_51421: crypto_free_hash(mdev->cram_hmac_tfm); mdev->cram_hmac_tfm = 0; kfree((void const *)mdev->net_conf); mdev->net_conf = 0; val___0.i = 0U; val___0.ldv_38745.conn = 0U; mask___0.i = 0U; mask___0.ldv_38745.conn = 31U; drbd_request_state(mdev, mask___0, val___0); } else { } tmp___5 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___5 == 0) { goto ldv_51429; } 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_51432: prepare_to_wait(& mdev->misc_wait, & __wait___0, 2); tmp___7 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___7 == 0) { goto ldv_51431; } else { } schedule(); goto ldv_51432; ldv_51431: finish_wait(& mdev->misc_wait, & __wait___0); ldv_51429: tmp___8 = drbd_release_ee(mdev, & mdev->net_ee); i = (unsigned int )tmp___8; if (i != 0U) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "net_ee not empty, killed %u entries\n", i); } else { } tmp___9 = atomic_read((atomic_t const *)(& mdev->pp_in_use_by_net)); i = (unsigned int )tmp___9; if (i != 0U) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "pp_in_use_by_net = %d, expected 0\n", i); } else { } tmp___10 = atomic_read((atomic_t const *)(& mdev->pp_in_use)); i = (unsigned int )tmp___10; if (i != 0U) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "pp_in_use = %d, expected 0\n", i); } else { } tmp___11 = list_empty((struct list_head const *)(& mdev->read_ee)); if (tmp___11 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->read_ee) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 3989); } else { } tmp___12 = list_empty((struct list_head const *)(& mdev->active_ee)); if (tmp___12 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->active_ee) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 3990); } else { } tmp___13 = list_empty((struct list_head const *)(& mdev->sync_ee)); if (tmp___13 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->sync_ee) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 3991); } else { } tmp___14 = list_empty((struct list_head const *)(& mdev->done_ee)); if (tmp___14 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->done_ee) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 3992); } else { } atomic_set(& (mdev->current_epoch)->epoch_size, 0); tmp___15 = list_empty((struct list_head const *)(& (mdev->current_epoch)->list)); if (tmp___15 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( list_empty(&mdev->current_epoch->list) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 3996); } 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_75(& 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_76(& mdev->data.mutex); return (0); } else { } memset((void *)p, 0, 80UL); p->protocol_min = 1442840576U; p->protocol_max = 1610612736U; ok = _drbd_send_cmd(mdev, mdev->data.socket, P_HAND_SHAKE, (struct p_header80 *)p, 80UL, 0U); ldv_mutex_unlock_77(& mdev->data.mutex); return (ok); } } static int drbd_do_handshake(struct drbd_conf *mdev ) { struct p_handshake *p ; int expect ; unsigned int length ; enum drbd_packets cmd ; int rv ; char const *tmp ; struct task_struct *tmp___0 ; int tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; int __min1 ; int __min2 ; { p = & mdev->data.rbuf.handshake; expect = 72; rv = drbd_send_handshake(mdev); if (rv == 0) { return (0); } else { } rv = drbd_recv_header(mdev, & cmd, & length); if (rv == 0) { return (0); } else { } if ((unsigned int )cmd != 65534U) { tmp = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "expected HandShake packet, received: %s (0x%04x)\n", tmp, (unsigned int )cmd); return (-1); } else { } if ((unsigned int )expect != length) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "expected HandShake length: %u, received: %u\n", expect, length); return (-1); } else { } rv = drbd_recv(mdev, (void *)(& p->head.payload), (size_t )expect); if (rv != expect) { tmp___0 = get_current(); tmp___1 = signal_pending(tmp___0); if (tmp___1 == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving handshake packet: l=%u\n", rv); } else { } return (0); } else { } tmp___2 = __fswab32(p->protocol_min); p->protocol_min = tmp___2; tmp___3 = __fswab32(p->protocol_max); p->protocol_max = tmp___3; if (p->protocol_max == 0U) { p->protocol_max = p->protocol_min; } else { } if (p->protocol_min > 96U || p->protocol_max <= 85U) { goto incompat; } else { } __min1 = 96; __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, 96, p->protocol_min, p->protocol_max); return (-1); } } static int drbd_do_auth(struct drbd_conf *mdev ) { char my_challenge[64U] ; struct scatterlist sg ; char *response ; char *right_response ; char *peers_ch ; unsigned int key_len ; size_t tmp ; unsigned int resp_size ; struct hash_desc desc ; enum drbd_packets cmd ; unsigned int length ; int rv ; char const *tmp___0 ; void *tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; void *tmp___4 ; char const *tmp___5 ; struct task_struct *tmp___6 ; int tmp___7 ; void *tmp___8 ; int tmp___9 ; { response = 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((size_t )length, 16U); peers_ch = (char *)tmp___1; if ((unsigned long )peers_ch == (unsigned long )((char *)0)) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "kmalloc of peers_ch failed\n"); rv = -1; goto fail; } else { } rv = drbd_recv(mdev, (void *)peers_ch, (size_t )length); if ((unsigned int )rv != length) { tmp___2 = get_current(); tmp___3 = signal_pending(tmp___2); if (tmp___3 == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read AuthChallenge: l=%u\n", rv); } else { } rv = 0; goto fail; } else { } resp_size = crypto_hash_digestsize(mdev->cram_hmac_tfm); tmp___4 = kmalloc((size_t )resp_size, 16U); response = (char *)tmp___4; if ((unsigned long )response == (unsigned long )((char *)0)) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "kmalloc of response failed\n"); rv = -1; goto fail; } else { } sg_init_table(& sg, 1U); sg_set_buf(& sg, (void const *)peers_ch, length); rv = crypto_hash_digest(& desc, & sg, sg.length, (u8 *)response); if (rv != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "crypto_hash_digest() failed with %d\n", rv); rv = -1; goto fail; } else { } rv = drbd_send_cmd2(mdev, 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___5 = cmdname(cmd); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "expected AuthResponse packet, received: %s (0x%04x)\n", tmp___5, (unsigned int )cmd); rv = 0; goto fail; } else { } if (length != resp_size) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "expected AuthResponse payload of wrong size\n"); rv = 0; goto fail; } else { } rv = drbd_recv(mdev, (void *)response, (size_t )resp_size); if ((unsigned int )rv != resp_size) { tmp___6 = get_current(); tmp___7 = signal_pending(tmp___6); if (tmp___7 == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short read receiving AuthResponse: l=%u\n", rv); } else { } rv = 0; goto fail; } else { } tmp___8 = kmalloc((size_t )resp_size, 16U); right_response = (char *)tmp___8; if ((unsigned long )right_response == (unsigned long )((char *)0)) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "kmalloc of right_response failed\n"); rv = -1; goto fail; } else { } sg_set_buf(& sg, (void const *)(& my_challenge), 64U); rv = crypto_hash_digest(& desc, & sg, sg.length, (u8 *)right_response); if (rv != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "crypto_hash_digest() failed with %d\n", rv); rv = -1; goto fail; } else { } tmp___9 = memcmp((void const *)response, (void const *)right_response, (size_t )resp_size); rv = tmp___9 == 0; if (rv != 0) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Peer authenticated using %d bytes of \'%s\' HMAC\n", resp_size, (unsigned char *)(& (mdev->net_conf)->cram_hmac_alg)); } else { rv = -1; } fail: kfree((void const *)peers_ch); kfree((void const *)response); kfree((void const *)right_response); return (rv); } } int drbdd_init(struct drbd_thread *thi ) { struct drbd_conf *mdev ; unsigned int minor ; unsigned int tmp ; int h ; struct task_struct *tmp___0 ; union drbd_state val ; union drbd_state mask ; int tmp___1 ; { mdev = thi->mdev; tmp = mdev_to_minor(mdev); minor = tmp; tmp___0 = get_current(); sprintf((char *)(& tmp___0->comm), "drbd%d_receiver", minor); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "receiver (re)started\n"); ldv_51475: h = drbd_connect(mdev); if (h == 0) { drbd_disconnect(mdev); schedule_timeout_interruptible(250L); } else { } if (h == -1) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Discarding network configuration.\n"); val.i = 0U; val.ldv_38745.conn = 1U; mask.i = 0U; mask.ldv_38745.conn = 31U; drbd_force_state(mdev, mask, val); } else { } if (h == 0) { goto ldv_51475; } else { } if (h > 0) { tmp___1 = get_net_conf(mdev); if (tmp___1 != 0) { drbdd(mdev); put_net_conf(mdev); } else { } } else { } drbd_disconnect(mdev); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "receiver terminated\n"); return (0); } } static int got_RqSReply(struct drbd_conf *mdev , struct p_header80 *h ) { struct p_req_state_reply *p ; int retcode ; __u32 tmp ; char const *tmp___0 ; { p = (struct p_req_state_reply *)h; tmp = __fswab32(p->retcode); retcode = (int )tmp; if (retcode > 0) { set_bit(9U, (unsigned long volatile *)(& mdev->flags)); } else { set_bit(10U, (unsigned long volatile *)(& mdev->flags)); tmp___0 = drbd_set_st_err_str((enum drbd_state_rv )retcode); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Requested state change failed by peer: %s (%d)\n", tmp___0, retcode); } __wake_up(& mdev->state_wait, 3U, 1, 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4339); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4345U); 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", 4350, 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_51515; ldv_51514: ; 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_51513; } else { } return (req); } else { } n = n->next; ldv_51515: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)n; req = (struct drbd_request *)__mptr + 0xffffffffffffffd8UL; if (1 != 0) { goto ldv_51514; } else { goto ldv_51513; } } else { } ldv_51513: ; 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: failed to find req %p, sector %llus\n", func, (void *)id, (unsigned long long )sector); return (0); } else { } __req_mod(req, what, & m); spin_unlock_irq(& mdev->req_lock); if ((unsigned long )m.bio != (unsigned long )((struct bio *)0)) { complete_master_bio(mdev, & m); } else { } return (1); } } static int got_BlockAck(struct drbd_conf *mdev , struct p_header80 *h ) { struct p_block_ack *p ; sector_t sector ; __u64 tmp ; int blksize ; __u32 tmp___0 ; enum drbd_req_event what ; __u32 tmp___1 ; int tmp___2 ; int tmp___3 ; __u16 tmp___4 ; int tmp___5 ; { p = (struct p_block_ack *)h; tmp = __fswab64(p->sector); sector = (sector_t )tmp; tmp___0 = __fswab32(p->blksize); blksize = (int )tmp___0; tmp___1 = __fswab32(p->seq_num); update_peer_seq(mdev, tmp___1); if (p->block_id == 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4417U); 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", 4418, 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4423); } else { } what = write_acked_by_peer_and_sis; goto ldv_51543; 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4427); } else { } what = write_acked_by_peer; goto ldv_51543; 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4431); } else { } what = recv_acked_by_peer; goto ldv_51543; 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4435); } else { } what = conflict_discarded_by_peer; goto ldv_51543; 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4439); return (0); } ldv_51543: tmp___5 = validate_req_change_req_state(mdev, p->block_id, sector, & _ack_id_to_req, "got_BlockAck", what); return (tmp___5); } } static int got_NegAck(struct drbd_conf *mdev , struct p_header80 *h ) { struct p_block_ack *p ; sector_t sector ; __u64 tmp ; int size ; __u32 tmp___0 ; struct drbd_request *req ; struct bio_and_error m ; __u32 tmp___1 ; int tmp___2 ; int tmp___3 ; { p = (struct p_block_ack *)h; tmp = __fswab64(p->sector); sector = (sector_t )tmp; tmp___0 = __fswab32(p->blksize); size = (int )tmp___0; tmp___1 = __fswab32(p->seq_num); update_peer_seq(mdev, tmp___1); if (p->block_id == 0xffffffffffffffffULL) { atomic_dec(& mdev->rs_pending_cnt); tmp___3 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); if (tmp___3 < 0) { tmp___2 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "got_NegAck", 4458, tmp___2); } else { } drbd_rs_failed_io(mdev, sector, size); return (1); } else { } spin_lock_irq(& mdev->req_lock); req = _ack_id_to_req(mdev, p->block_id, sector); if ((unsigned long )req == (unsigned long )((struct drbd_request *)0)) { spin_unlock_irq(& mdev->req_lock); if ((mdev->net_conf)->wire_protocol == 1 || (mdev->net_conf)->wire_protocol == 2) { __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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4475U); return (1); } else { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s: failed to find req %p, sector %llus\n", "got_NegAck", (void *)p->block_id, (unsigned long long )sector); return (0); } } else { } __req_mod(req, neg_acked, & m); spin_unlock_irq(& mdev->req_lock); if ((unsigned long )m.bio != (unsigned long )((struct bio *)0)) { complete_master_bio(mdev, & m); } else { } return (1); } } static int got_NegDReply(struct drbd_conf *mdev , struct p_header80 *h ) { struct p_block_ack *p ; sector_t sector ; __u64 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; int tmp___2 ; { p = (struct p_block_ack *)h; tmp = __fswab64(p->sector); sector = (sector_t )tmp; tmp___0 = __fswab32(p->seq_num); update_peer_seq(mdev, tmp___0); tmp___1 = __fswab32(p->blksize); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Got NegDReply; Sector %llus, len %u; Fail original request.\n", (unsigned long long )sector, tmp___1); tmp___2 = validate_req_change_req_state(mdev, p->block_id, sector, & _ar_id_to_req, "got_NegDReply", 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 ; __u16 tmp___4 ; int tmp___5 ; { p = (struct p_block_ack *)h; tmp = __fswab64(p->sector); sector = (sector_t )tmp; tmp___0 = __fswab32(p->blksize); size = (int )tmp___0; tmp___1 = __fswab32(p->seq_num); update_peer_seq(mdev, tmp___1); atomic_dec(& mdev->rs_pending_cnt); tmp___3 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); if (tmp___3 < 0) { tmp___2 = atomic_read((atomic_t const *)(& mdev->rs_pending_cnt)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "in %s:%d: rs_pending_cnt = %d < 0 !\n", "got_NegRSDReply", 4515, tmp___2); } else { } tmp___5 = _get_ldev_if_state(mdev, D_FAILED); if (tmp___5 != 0) { drbd_rs_complete_io(mdev, sector); tmp___4 = __fswab16((int )h->command); switch ((int )tmp___4) { case 27: drbd_rs_failed_io(mdev, sector, size); case 41: ; goto ldv_51581; 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4525); put_ldev(mdev); return (0); } ldv_51581: put_ldev(mdev); } else { } return (1); } } static int got_BarrierAck(struct drbd_conf *mdev , struct p_header80 *h ) { struct p_barrier_ack *p ; __u32 tmp ; int tmp___0 ; int tmp___1 ; { p = (struct p_barrier_ack *)h; tmp = __fswab32(p->set_size); tl_release(mdev, p->barrier, tmp); if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 352U) { tmp___0 = atomic_read((atomic_t const *)(& mdev->ap_in_flight)); if (tmp___0 == 0) { tmp___1 = test_and_set_bit(29, (unsigned long volatile *)(& mdev->flags)); if (tmp___1 == 0) { mdev->start_resync_timer.expires = (unsigned long )jiffies + 250UL; add_timer(& mdev->start_resync_timer); } else { } } else { } } else { } return (1); } } static int got_OVResult(struct drbd_conf *mdev , struct p_header80 *h ) { struct p_block_ack *p ; struct drbd_work *w ; sector_t sector ; int size ; __u64 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u64 tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; void *tmp___6 ; { p = (struct p_block_ack *)h; tmp = __fswab64(p->sector); sector = (sector_t )tmp; tmp___0 = __fswab32(p->blksize); size = (int )tmp___0; tmp___1 = __fswab32(p->seq_num); update_peer_seq(mdev, tmp___1); tmp___2 = __fswab64(p->block_id); if (tmp___2 == 4712ULL) { drbd_ov_oos_found(mdev, sector, size); } else { ov_oos_print(mdev); } tmp___3 = _get_ldev_if_state(mdev, 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", 4572, tmp___4); } else { } mdev->ov_left = mdev->ov_left - 1UL; if ((mdev->ov_left & 512UL) != 0UL) { drbd_advance_rs_marks(mdev, mdev->ov_left); } else { } if (mdev->ov_left == 0UL) { tmp___6 = kmalloc(24UL, 16U); w = (struct drbd_work *)tmp___6; if ((unsigned long )w != (unsigned long )((struct drbd_work *)0)) { w->cb = & w_ov_finished; drbd_queue_work_front(& mdev->data.work, w); } else { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "kmalloc(w) failed."); ov_oos_print(mdev); drbd_resync_finished(mdev); } } else { } put_ldev(mdev); return (1); } } static int got_skip(struct drbd_conf *mdev , struct p_header80 *h ) { { return (1); } } static struct asender_cmd *get_asender_cmd(int cmd ) { struct asender_cmd asender_tbl[43U] ; { asender_tbl[0].pkt_size = 0UL; asender_tbl[0].process = 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; asender_tbl[41].pkt_size = 32UL; asender_tbl[41].process = & got_NegRSDReply; asender_tbl[42].pkt_size = 0UL; asender_tbl[42].process = 0; if (cmd > 42 || (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 ; int ping_timeout_active ; unsigned int tmp ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; struct task_struct *tmp___2 ; int _b ; int tmp___3 ; int tmp___4 ; int tmp___5 ; struct task_struct *tmp___6 ; int tmp___7 ; struct task_struct *tmp___8 ; int tmp___9 ; struct task_struct *tmp___10 ; long tmp___11 ; __u16 tmp___12 ; __u16 tmp___13 ; __u32 tmp___14 ; long tmp___15 ; __u16 tmp___16 ; __u16 tmp___17 ; __u16 tmp___18 ; __u16 tmp___19 ; __u32 tmp___20 ; long tmp___21 ; int _b___0 ; int tmp___22 ; struct asender_cmd *tmp___23 ; enum drbd_thread_state tmp___24 ; union drbd_state val ; union drbd_state mask ; union drbd_state val___0 ; union drbd_state mask___0 ; { mdev = thi->mdev; h = & mdev->meta.rbuf.header.h80; cmd = 0; buf = (void *)h; received = 0; expect = 8; ping_timeout_active = 0; tmp = mdev_to_minor(mdev); tmp___0 = get_current(); sprintf((char *)(& tmp___0->comm), "drbd%d_asender", tmp); tmp___1 = get_current(); tmp___1->policy = 2U; tmp___2 = get_current(); tmp___2->rt_priority = 2U; goto ldv_51632; ldv_51642: drbd_thread_current_set_cpu(mdev); tmp___4 = test_and_clear_bit(2, (unsigned long volatile *)(& mdev->flags)); if (tmp___4 != 0) { tmp___3 = drbd_send_ping(mdev); _b = tmp___3 == 0; if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_asender", (char *)"!drbd_send_ping(mdev)", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4654); } else { } if (_b != 0) { goto reconnect; } else { } ((mdev->meta.socket)->sk)->sk_rcvtimeo = (long )(((mdev->net_conf)->ping_timeo * 250) / 10); ping_timeout_active = 1; } else { } if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) == 0U) { tmp___5 = atomic_read((atomic_t const *)(& mdev->unacked_cnt)); if (tmp___5 > 3) { drbd_tcp_cork(mdev->meta.socket); } else { } } else { } ldv_51631: 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_51630; } else { } goto ldv_51631; ldv_51630: ; if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) == 0U) { drbd_tcp_uncork(mdev->meta.socket); } else { } tmp___8 = get_current(); tmp___9 = signal_pending(tmp___8); if (tmp___9 != 0) { goto ldv_51632; } 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 ((1 != 0 && 1 != 0) && (long )((unsigned long )jiffies - (unsigned long )((mdev->meta.socket)->sk)->sk_rcvtimeo) - (long )mdev->last_received < 0L) { goto ldv_51632; } else { } if (ping_timeout_active != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "PingAck did not arrive in time.\n"); goto reconnect; } else { } set_bit(2U, (unsigned long volatile *)(& mdev->flags)); goto ldv_51632; } else if (rv == -4) { goto ldv_51632; } 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), "ASSERT FAILED: %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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4748); } else { } if (_b___0 != 0) { goto reconnect; } else { } } else { } if (received == expect) { mdev->last_received = jiffies; if ((unsigned long )cmd == (unsigned long )((struct asender_cmd *)0)) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( cmd != NULL ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4753); } else { } tmp___22 = (*(cmd->process))(mdev, h); if (tmp___22 == 0) { goto reconnect; } else { } tmp___23 = get_asender_cmd(20); if ((unsigned long )tmp___23 == (unsigned long )cmd) { ping_timeout_active = 0; } else { } buf = (void *)h; received = 0; expect = 8; cmd = 0; } else { } ldv_51632: tmp___24 = get_t_state(thi); if ((unsigned int )tmp___24 == 1U) { goto ldv_51642; } else { } if (0) { reconnect: val.i = 0U; val.ldv_38745.conn = 5U; mask.i = 0U; mask.ldv_38745.conn = 31U; drbd_force_state(mdev, mask, val); drbd_md_sync(mdev); } else { } if (0) { disconnect: val___0.i = 0U; val___0.ldv_38745.conn = 1U; mask___0.i = 0U; mask___0.ldv_38745.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_38745.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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_receiver.c.prepared", 4781); } 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_51671; ldv_51670: tmp = nondet_int(); switch (tmp) { default: ; goto ldv_51669; } ldv_51669: ; ldv_51671: tmp___0 = nondet_int(); if (tmp___0 != 0) { goto ldv_51670; } else { } ldv_check_final_state(); return; } } void ldv_mutex_lock_67(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_68(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_69(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_70(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_71(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_72(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_73(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_74(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_75(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___7 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_76(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_77(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 ) ; extern void lockdep_rcu_suspicious(char const * , int const , char const * ) ; int ldv_mutex_trylock_90(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_91(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_93(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_95(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_96(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_89(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_92(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_94(struct mutex *ldv_func_arg1 ) ; __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_6267; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6267; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6267; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6267; default: __bad_percpu_size(); } ldv_6267: ti = (struct thread_info *)(pfo_ret__ - 8152UL); return (ti); } } __inline static void __rcu_read_lock(void) { struct thread_info *tmp ; { tmp = current_thread_info___1(); tmp->preempt_count = tmp->preempt_count + 1; __asm__ volatile ("": : : "memory"); return; } } __inline static void __rcu_read_unlock(void) { struct thread_info *tmp ; { __asm__ volatile ("": : : "memory"); tmp = current_thread_info___1(); tmp->preempt_count = tmp->preempt_count + -1; __asm__ volatile ("": : : "memory"); return; } } extern int rcu_is_cpu_idle(void) ; __inline static void rcu_lock_acquire(struct lockdep_map *map ) { { lock_acquire(map, 0U, 0, 2, 1, 0, (unsigned long )((void *)0)); return; } } __inline static void rcu_lock_release(struct lockdep_map *map ) { { lock_release(map, 1, (unsigned long )((void *)0)); return; } } extern struct lockdep_map rcu_lock_map ; extern int debug_lockdep_rcu_enabled(void) ; __inline static void rcu_read_lock(void) { bool __warned ; int tmp ; int tmp___0 ; { __rcu_read_lock(); rcu_lock_acquire(& rcu_lock_map); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_is_cpu_idle(); if (tmp___0 != 0) { __warned = 1; lockdep_rcu_suspicious("include/linux/rcupdate.h", 731, "rcu_read_lock() used illegally while idle"); } else { } } else { } return; } } __inline static void rcu_read_unlock(void) { bool __warned ; int tmp ; int tmp___0 ; { tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_is_cpu_idle(); if (tmp___0 != 0) { __warned = 1; lockdep_rcu_suspicious("include/linux/rcupdate.h", 752, "rcu_read_unlock() used illegally while idle"); } else { } } else { } rcu_lock_release(& rcu_lock_map); __rcu_read_unlock(); return; } } extern int cpu_number ; extern void __bad_size_call_parameter(void) ; __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 + 0xffffffffffffff98UL); } else { __mptr___0 = (struct device const *)(& part->__dev); return ((struct gendisk *)__mptr___0 + 0xffffffffffffff98UL); } } else { } return (0); } } __inline static void part_inc_in_flight(struct hd_struct *part , int rw ) { struct gendisk *tmp ; { atomic_inc((atomic_t *)(& part->in_flight) + (unsigned long )rw); if (part->partno != 0) { tmp = part_to_disk(part); atomic_inc((atomic_t *)(& tmp->part0.in_flight) + (unsigned long )rw); } else { } return; } } __inline static void part_dec_in_flight(struct hd_struct *part , int rw ) { struct gendisk *tmp ; { atomic_dec((atomic_t *)(& part->in_flight) + (unsigned long )rw); if (part->partno != 0) { tmp = part_to_disk(part); atomic_dec((atomic_t *)(& tmp->part0.in_flight) + (unsigned long )rw); } else { } return; } } extern void part_round_stats(int , struct hd_struct * ) ; extern struct bio_pair *bio_split(struct bio * , int ) ; extern void bio_pair_release(struct bio_pair * ) ; bool allow_oos ; void _tl_add_barrier(struct drbd_conf *mdev , struct drbd_tl_epoch *new ) ; mempool_t *drbd_request_mempool ; void drbd_make_request(struct request_queue *q , struct bio *bio ) ; int drbd_merge_bvec(struct request_queue *q , struct bvec_merge_data *bvm , struct bio_vec *bvec ) ; __inline static void __drbd_chk_io_error____1(struct drbd_conf *mdev , int forcedetach , char const *where ) { int tmp ; union drbd_state __ns ; union drbd_state __ns___0 ; { 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.\n", where); } else { } if ((int )mdev->state.ldv_38745.disk > 4) { __ns.i = mdev->state.i; __ns.ldv_38745.disk = 4U; _drbd_set_state(mdev, __ns, CS_HARD, 0); } else { } goto ldv_49354; } else { } case 2: ; case 1: set_bit(19U, (unsigned long volatile *)(& mdev->flags)); if ((int )mdev->state.ldv_38745.disk > 2) { __ns___0.i = mdev->state.i; __ns___0.ldv_38745.disk = 2U; _drbd_set_state(mdev, __ns___0, CS_HARD, 0); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s. Detaching...\n", where); } else { } goto ldv_49354; } ldv_49354: ; 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(struct drbd_conf *mdev ) { union drbd_state s ; { s = mdev->state; switch ((unsigned int )s.ldv_38745.conn) { case 0U: ; case 8U: ; case 10U: ; case 16U: ; case 17U: ; case 18U: ; case 19U: ; case 20U: ; case 21U: ; case 22U: ; case 23U: ; case 1U: ; case 2U: ; case 3U: ; case 4U: ; case 5U: ; case 6U: ; case 7U: ; case 9U: ; case 11U: ; case 12U: ; goto ldv_49526; case 13U: ; if (mdev->agreed_pro_version <= 95) { return (0); } else { } goto ldv_49526; case 14U: ; case 15U: ; case 31U: ; return (0); } ldv_49526: ; switch ((unsigned int )s.ldv_38745.disk) { case 0U: ; case 4U: ; case 5U: ; case 7U: ; case 8U: ; case 2U: ; goto ldv_49537; case 1U: ; case 3U: ; case 6U: ; case 15U: ; return (0); } ldv_49537: ; return (1); } } __inline static bool may_inc_ap_bio(struct drbd_conf *mdev ) { int mxb ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { tmp = drbd_get_max_buffers(mdev); mxb = tmp; tmp___0 = is_susp(mdev->state); if (tmp___0 != 0) { return (0); } else { } tmp___1 = constant_test_bit(15U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___1 != 0) { return (0); } else { } tmp___2 = drbd_state_is_stable(mdev); 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(16U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___4 != 0) { return (0); } else { } return (1); } } __inline static bool inc_ap_bio_cond(struct drbd_conf *mdev , int count ) { bool rv ; { rv = 0; spin_lock_irq(& mdev->req_lock); rv = may_inc_ap_bio(mdev); if ((int )rv) { atomic_add(count, & mdev->ap_bio_cnt); } else { } spin_unlock_irq(& mdev->req_lock); return (rv); } } __inline static void inc_ap_bio(struct drbd_conf *mdev , int count ) { bool tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; bool tmp___1 ; { tmp = inc_ap_bio_cond(mdev, count); if ((int )tmp) { goto ldv_49558; } 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_49561: prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___1 = inc_ap_bio_cond(mdev, count); if ((int )tmp___1) { goto ldv_49560; } else { } schedule(); goto ldv_49561; ldv_49560: finish_wait(& mdev->misc_wait, & __wait); ldv_49558: ; 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", 2407); } else { } if (ap_bio < mxb) { __wake_up(& mdev->misc_wait, 3U, 1, 0); } else { } if (ap_bio == 0) { tmp___2 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___2 != 0) { tmp___1 = test_and_set_bit(17, (unsigned long volatile *)(& mdev->flags)); if (tmp___1 == 0) { drbd_queue_work(& mdev->data.work, & mdev->bm_io_work.w); } else { } } else { } } else { } return; } } __inline static struct hlist_head *ee_hash_slot___0(struct drbd_conf *mdev , sector_t sector ) { long tmp ; { tmp = 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" (234), "i" (12UL)); ldv_49671: ; goto ldv_49671; } 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" (243), "i" (12UL)); ldv_49676: ; goto ldv_49676; } 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 ? 2048UL : 0UL; req->mdev = mdev; req->master_bio = bio_src; req->epoch = 0U; req->sector = bio_src->bi_sector; req->size = bio_src->bi_size; INIT_HLIST_NODE(& req->collision); INIT_LIST_HEAD(& req->tl_requests); INIT_LIST_HEAD(& req->w.list); } else { } return (req); } } __inline static void drbd_req_free(struct drbd_request *req ) { { mempool_free((void *)req, drbd_request_mempool); return; } } void _req_may_be_done(struct drbd_request *req , struct bio_and_error *m ) ; void request_timer_fn(unsigned long data ) ; __inline static bool drbd_should_do_remote(union drbd_state s ) { { return ((bool )(*((unsigned int *)(& s) + 0UL) == 65536U || (((int )s.ldv_38745.pdsk > 3 && (int )s.ldv_38745.conn > 13) && (int )s.ldv_38745.conn <= 21))); } } __inline static bool drbd_should_send_oos(union drbd_state s ) { { return ((bool )((unsigned int )*((unsigned short *)(& s) + 0UL) == 352U || (unsigned int )*((unsigned short *)(& s) + 0UL) == 208U)); } } static void _drbd_start_io_acct(struct drbd_conf *mdev , struct drbd_request *req , struct bio *bio ) { int rw ; int cpu ; struct thread_info *tmp ; int pscr_ret__ ; void const *__vpp_verify ; int pfo_ret__ ; int pfo_ret_____0 ; int pfo_ret_____1 ; int pfo_ret_____2 ; void const *__vpp_verify___0 ; unsigned long __ptr ; void const *__vpp_verify___1 ; unsigned long __ptr___0 ; struct gendisk *tmp___0 ; void const *__vpp_verify___2 ; unsigned long __ptr___1 ; void const *__vpp_verify___3 ; unsigned long __ptr___2 ; struct gendisk *tmp___1 ; struct thread_info *tmp___2 ; { rw = (int const )bio->bi_rw & (int const )1; rcu_read_lock(); tmp = current_thread_info___1(); tmp->preempt_count = tmp->preempt_count + 1; __asm__ volatile ("": : : "memory"); __vpp_verify = 0; switch (4UL) { case 1UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "m" (cpu_number)); goto ldv_49768; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_49768; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_49768; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_49768; default: __bad_percpu_size(); } ldv_49768: pscr_ret__ = pfo_ret__; goto ldv_49774; case 2UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret_____0): "m" (cpu_number)); goto ldv_49778; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_49778; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_49778; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_49778; default: __bad_percpu_size(); } ldv_49778: pscr_ret__ = pfo_ret_____0; goto ldv_49774; case 4UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret_____1): "m" (cpu_number)); goto ldv_49787; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_49787; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_49787; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_49787; default: __bad_percpu_size(); } ldv_49787: pscr_ret__ = pfo_ret_____1; goto ldv_49774; case 8UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret_____2): "m" (cpu_number)); goto ldv_49796; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_49796; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_49796; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_49796; default: __bad_percpu_size(); } ldv_49796: pscr_ret__ = pfo_ret_____2; goto ldv_49774; default: __bad_size_call_parameter(); goto ldv_49774; } ldv_49774: cpu = pscr_ret__; part_round_stats(cpu, & (mdev->vdisk)->part0); __vpp_verify___0 = 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___1 = 0; tmp___0 = part_to_disk(& (mdev->vdisk)->part0); __asm__ ("": "=r" (__ptr___0): "0" (tmp___0->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___2 = 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___3 = 0; tmp___1 = part_to_disk(& (mdev->vdisk)->part0); __asm__ ("": "=r" (__ptr___2): "0" (tmp___1->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); __asm__ volatile ("": : : "memory"); tmp___2 = current_thread_info___1(); tmp___2->preempt_count = tmp___2->preempt_count + -1; __asm__ volatile ("": : : "memory"); 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 ; struct thread_info *tmp ; int pscr_ret__ ; void const *__vpp_verify ; int pfo_ret__ ; int pfo_ret_____0 ; int pfo_ret_____1 ; int pfo_ret_____2 ; void const *__vpp_verify___0 ; unsigned long __ptr ; void const *__vpp_verify___1 ; unsigned long __ptr___0 ; struct gendisk *tmp___0 ; struct thread_info *tmp___1 ; { rw = (int )(req->master_bio)->bi_rw & 1; duration = (unsigned long )jiffies - req->start_time; rcu_read_lock(); tmp = current_thread_info___1(); tmp->preempt_count = tmp->preempt_count + 1; __asm__ volatile ("": : : "memory"); __vpp_verify = 0; switch (4UL) { case 1UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "m" (cpu_number)); goto ldv_49834; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_49834; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_49834; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_49834; default: __bad_percpu_size(); } ldv_49834: pscr_ret__ = pfo_ret__; goto ldv_49840; case 2UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret_____0): "m" (cpu_number)); goto ldv_49844; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_49844; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_49844; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_49844; default: __bad_percpu_size(); } ldv_49844: pscr_ret__ = pfo_ret_____0; goto ldv_49840; case 4UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret_____1): "m" (cpu_number)); goto ldv_49853; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_49853; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_49853; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_49853; default: __bad_percpu_size(); } ldv_49853: pscr_ret__ = pfo_ret_____1; goto ldv_49840; case 8UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret_____2): "m" (cpu_number)); goto ldv_49862; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_49862; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_49862; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_49862; default: __bad_percpu_size(); } ldv_49862: pscr_ret__ = pfo_ret_____2; goto ldv_49840; default: __bad_size_call_parameter(); goto ldv_49840; } ldv_49840: cpu = pscr_ret__; __vpp_verify___0 = 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___1 = 0; tmp___0 = part_to_disk(& (mdev->vdisk)->part0); __asm__ ("": "=r" (__ptr___0): "0" (tmp___0->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); __asm__ volatile ("": : : "memory"); tmp___1 = current_thread_info___1(); tmp___1->preempt_count = tmp___1->preempt_count + -1; __asm__ volatile ("": : : "memory"); 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 & 256UL) == 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 136U); } else { } if (((s & 256UL) != 0UL && (s & 4UL) != 0UL) && (s & 512UL) != 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 139U); } else { } if ((s & 15UL) != 0UL) { tmp___0 = _get_ldev_if_state(mdev, D_FAILED); if (tmp___0 != 0) { if ((s & 4096UL) != 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_38745.conn > 9 && (s & 64UL) != 0UL) && req->epoch == (mdev->newest_tle)->br_number) { queue_barrier(mdev); } else { } if ((s & 128UL) != 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_49906; ldv_49905: 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_49906: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)n; i = (struct drbd_request *)__mptr + 0xffffffffffffffd8UL; if (1 != 0) { goto ldv_49905; } else { goto ldv_49907; } } else { } ldv_49907: slot = ee_hash_slot___0(mdev, req->sector); n = slot->first; goto ldv_49913; ldv_49912: tmp___0 = overlaps(sector, size, e->sector, (int )e->size); if (tmp___0 != 0) { __wake_up(& mdev->misc_wait, 3U, 1, 0); goto ldv_49911; } else { } n = n->next; ldv_49913: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)n; e = (struct drbd_epoch_entry *)__mptr___0 + 0xffffffffffffffe8UL; if (1 != 0) { goto ldv_49912; } else { goto ldv_49911; } } else { } ldv_49911: ; } 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 = (req->rq_state & 2048UL) != 0UL; if ((s & 32UL) != 0UL) { return; } else { } if ((s & 16UL) != 0UL) { return; } else { } if ((int )s & 1 && (s & 8UL) == 0UL) { return; } else { } if ((unsigned long )req->master_bio != (unsigned long )((struct bio *)0)) { ok = (s & 4UL) != 0UL || (s & 256UL) != 0UL; tmp = PTR_ERR((void const *)req->private_bio); error = (int )tmp; tmp___0 = hlist_unhashed((struct hlist_node const *)(& req->collision)); if (tmp___0 == 0) { hlist_del(& req->collision); } else if ((s & 880UL) != 0UL) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( (s & (RQ_NET_MASK & ~RQ_NET_DONE)) == 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 321); } 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 ((int )s & 1) { return; } else { } if ((s & 1008UL) == 0UL || (s & 128UL) != 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->collision)); if (tmp == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( hlist_unhashed(&req->collision) ) 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 390); } else { } tmp___0 = get_net_conf(mdev); if (tmp___0 == 0) { return (0); } else { } _b = mdev->tl_hash_s == 0U; if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "_req_conflicts", (char *)"mdev->tl_hash_s == 0", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 396); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared"), "i" (398), "i" (12UL)); ldv_49946: ; goto ldv_49946; } else { } slot = tl_hash_slot___0(mdev, sector); n = slot->first; goto ldv_49952; ldv_49951: 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_49952: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)n; i = (struct drbd_request *)__mptr + 0xffffffffffffffd8UL; if (1 != 0) { goto ldv_49951; } else { goto ldv_49953; } } else { } ldv_49953: ; 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared"), "i" (416), "i" (12UL)); ldv_49954: ; goto ldv_49954; } else { } slot = ee_hash_slot___0(mdev, sector); n = slot->first; goto ldv_49959; ldv_49958: 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_49959: ; if ((unsigned long )n != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)n; e = (struct drbd_epoch_entry *)__mptr___0 + 0xffffffffffffffe8UL; if (1 != 0) { goto ldv_49958; } else { goto ldv_49960; } } else { } ldv_49960: ; } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 466); goto ldv_49969; case 1U: ; if ((req->rq_state & 1008UL) != 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 478); } else { } req->rq_state = req->rq_state | 16UL; inc_ap_pending(mdev); goto ldv_49969; case 2U: ; if ((req->rq_state & 15UL) != 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 485); } else { } req->rq_state = req->rq_state | 1UL; goto ldv_49969; case 23U: ; if ((req->rq_state & 2048UL) != 0UL) { 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); goto ldv_49969; case 22U: req->rq_state = req->rq_state | 8UL; if ((req->rq_state & 2048UL) != 0UL) { _req_may_be_done_not_susp(req, m); } else { goto goto_queue_for_net_read; } goto ldv_49969; case 21U: 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); goto ldv_49969; case 20U: req->rq_state = req->rq_state | 2UL; req->rq_state = req->rq_state & 0xfffffffffffffffeUL; _req_may_be_done_not_susp(req, m); goto ldv_49969; case 19U: __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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 525U); req->rq_state = req->rq_state | 2UL; req->rq_state = req->rq_state & 0xfffffffffffffffeUL; if ((req->rq_state & 1008UL) != 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 530); } else { } __drbd_chk_io_error____1(mdev, 0, "__req_mod"); goto_queue_for_net_read: ; if (*((unsigned int *)mdev + 569UL) != 65536U) { _req_may_be_done_not_susp(req, m); goto ldv_49969; } else { } req->rq_state = req->rq_state | 16UL; inc_ap_pending(mdev); case 4U: tmp = ar_hash_slot___0(mdev, req->sector); hlist_add_head(& req->collision, tmp); set_bit(4U, (unsigned long volatile *)(& mdev->flags)); if ((req->rq_state & 16UL) == 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 562); } else { } req->rq_state = req->rq_state | 32UL; req->w.cb = (req->rq_state & 15UL) != 0UL ? & w_read_retry_remote : & w_send_read_req; drbd_queue_work(& mdev->data.work, & req->w); goto ldv_49969; case 3U: tmp___0 = tl_hash_slot___0(mdev, req->sector); hlist_add_head(& req->collision, tmp___0); set_bit(4U, (unsigned long volatile *)(& mdev->flags)); tmp___1 = constant_test_bit(0U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___1 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( test_bit(CREATE_BARRIER, &mdev->flags) == 0 ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 598); } else { } req->epoch = (mdev->newest_tle)->br_number; (mdev->newest_tle)->n_writes = (mdev->newest_tle)->n_writes + 1; if ((req->rq_state & 16UL) == 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 606); } else { } req->rq_state = req->rq_state | 32UL; 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_49969; case 5U: req->rq_state = req->rq_state | 32UL; req->w.cb = & w_send_oos; drbd_queue_work(& mdev->data.work, & req->w); goto ldv_49969; case 11U: ; case 6U: ; case 7U: req->rq_state = req->rq_state & 0xffffffffffffffdfUL; _req_may_be_done_not_susp(req, m); goto ldv_49969; case 8U: ; if ((int )(req->master_bio)->bi_rw & 1) { atomic_add((int )(req->size >> 9), & mdev->ap_in_flight); } else { } if ((int )(req->master_bio)->bi_rw & 1 && (mdev->net_conf)->wire_protocol == 1) { if ((req->rq_state & 16UL) != 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", 644, tmp___3); } else { } req->rq_state = req->rq_state & 0xffffffffffffffefUL; req->rq_state = req->rq_state | 256UL; } else { } } else { } req->rq_state = req->rq_state & 0xffffffffffffffdfUL; req->rq_state = req->rq_state | 64UL; _req_may_be_done_not_susp(req, m); goto ldv_49969; case 9U: req->rq_state = req->rq_state & 0xffffffffffffffdfUL; req->rq_state = req->rq_state | 128UL; _req_may_be_done_not_susp(req, m); goto ldv_49969; case 10U: ; if ((req->rq_state & 16UL) != 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", 669, tmp___6); } else { } } else { } req->rq_state = req->rq_state & 0xfffffffffffffeefUL; req->rq_state = req->rq_state | 128UL; if ((req->rq_state & 64UL) != 0UL && (req->rq_state & 2048UL) != 0UL) { atomic_sub((int )(req->size >> 9), & mdev->ap_in_flight); } else { } if ((req->rq_state & 32UL) == 0UL) { _req_may_be_done(req, m); } else { } goto ldv_49969; case 15U: ; if ((unsigned int )what == 15U) { dev_alert((struct device const *)(& (mdev->vdisk)->part0.__dev), "Got DiscardAck packet %llus +%u! DRBD is not a random data generator!\n", (unsigned long long )req->sector, req->size); } else { } req->rq_state = req->rq_state | 128UL; case 14U: ; case 13U: ; if ((unsigned int )what == 14U) { req->rq_state = req->rq_state | 512UL; } else { } case 12U: req->rq_state = req->rq_state | 256UL; if ((req->rq_state & 16UL) == 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 705); } 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", 706, tmp___9); } else { } atomic_sub((int )(req->size >> 9), & mdev->ap_in_flight); req->rq_state = req->rq_state & 0xffffffffffffffefUL; _req_may_be_done_not_susp(req, m); goto ldv_49969; case 16U: ; if ((req->rq_state & 16UL) != 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", 715, tmp___12); } else { } atomic_sub((int )(req->size >> 9), & mdev->ap_in_flight); } else { } req->rq_state = req->rq_state & 0xfffffffffffffeefUL; req->rq_state = req->rq_state | 128UL; _req_may_be_done_not_susp(req, m); goto ldv_49969; case 25U: ; if ((req->rq_state & 2UL) == 0UL) { goto ldv_49969; } else { } _req_may_be_done(req, m); goto ldv_49969; case 26U: ; if ((req->rq_state & 2UL) == 0UL) { goto ldv_49969; } 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_49969; case 24U: ; if ((req->rq_state & 256UL) == 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 & 2048UL) != 0UL ? 1 : 2; } else { } goto ldv_49969; } else { } case 17U: ; if ((req->rq_state & 2048UL) == 0UL) { goto ldv_49969; } else { } if ((req->rq_state & 16UL) != 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 & 1008UL) != 0UL) { req->rq_state = req->rq_state | 128UL; if ((mdev->net_conf)->wire_protocol == 1) { atomic_sub((int )(req->size >> 9), & mdev->ap_in_flight); } else { } } else { } _req_may_be_done(req, m); goto ldv_49969; case 18U: ; if ((req->rq_state & 16UL) == 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 781); } 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", 782, tmp___15); } else { } req->rq_state = req->rq_state & 0xffffffffffffffefUL; req->rq_state = req->rq_state | 384UL; _req_may_be_done_not_susp(req, m); goto ldv_49969; } ldv_49969: ; return (rv); } } static int drbd_may_do_local_read(struct drbd_conf *mdev , sector_t sector , int size ) { unsigned long sbnr ; unsigned long ebnr ; sector_t esector ; sector_t nr_sectors ; int tmp ; { if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 16U) { return (1); } else { } if ((int )mdev->state.ldv_38745.disk > 4) { return (0); } else { } if ((int )mdev->state.ldv_38745.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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 814); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 815); } 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 , unsigned long start_time ) { int rw ; int size ; sector_t sector ; struct drbd_tl_epoch *b ; struct drbd_request *req ; int local ; int remote ; int send_oos ; int err ; int ret ; union drbd_state s ; int tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; bool tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; void *tmp___7 ; int tmp___8 ; int tmp___9 ; bool tmp___10 ; bool tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; int tmp___17 ; int congested ; int tmp___18 ; union drbd_state __ns ; union drbd_state __ns___0 ; int tmp___19 ; int tmp___20 ; int tmp___21 ; int tmp___22 ; int tmp___23 ; { rw = (int const )bio->bi_rw & (int const )4097; size = (int const )bio->bi_size; sector = bio->bi_sector; b = 0; send_oos = 0; err = -5; ret = 0; req = drbd_req_new(mdev, bio); if ((unsigned long )req == (unsigned long )((struct drbd_request *)0)) { dec_ap_bio(mdev); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "could not kmalloc() req\n"); bio_endio(bio, -12); return (0); } else { } req->start_time = start_time; local = _get_ldev_if_state(mdev, 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_38745.pdsk > 7; } if ((rw == 4096 && (int )mdev->state.ldv_38745.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 | 4096UL; drbd_al_begin_io(mdev, sector); } else { } } else { } s = mdev->state; if (remote != 0) { tmp___1 = drbd_should_do_remote(s); if ((int )tmp___1) { tmp___2 = 1; } else { tmp___2 = 0; } } else { tmp___2 = 0; } remote = tmp___2; if (rw == 1) { tmp___3 = drbd_should_send_oos(s); if ((int )tmp___3) { tmp___4 = 1; } else { tmp___4 = 0; } } else { tmp___4 = 0; } send_oos = tmp___4; if (remote != 0 && send_oos != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !(remote && send_oos) ) 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 898); } else { } if (local == 0 && remote == 0) { tmp___6 = is_susp(mdev->state); if (tmp___6 == 0) { tmp___5 = ___ratelimit(& drbd_ratelimit_state, "drbd_make_request_common"); if (tmp___5 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "IO ERROR: neither local nor remote disk\n"); } else { } goto fail_free_complete; } else { } } else { } if ((rw == 1 && (remote != 0 || send_oos != 0)) && (unsigned long )mdev->unused_spare_tle == (unsigned long )((struct drbd_tl_epoch *)0)) { tmp___8 = constant_test_bit(0U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___8 != 0) { allocate_barrier: tmp___7 = kmalloc(56UL, 16U); b = (struct drbd_tl_epoch *)tmp___7; 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___9 = is_susp(mdev->state); if (tmp___9 != 0) { ret = 1; spin_unlock_irq(& mdev->req_lock); goto fail_free_complete; } else { } if (remote != 0 || send_oos != 0) { tmp___10 = drbd_should_do_remote(mdev->state); remote = (int )tmp___10; if (rw == 1) { tmp___11 = drbd_should_send_oos(mdev->state); if ((int )tmp___11) { tmp___12 = 1; } else { tmp___12 = 0; } } else { tmp___12 = 0; } send_oos = tmp___12; if (remote != 0 && send_oos != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !(remote && send_oos) ) 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 940); } else { } if (remote == 0 && send_oos == 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 || send_oos != 0)) && (unsigned long )mdev->unused_spare_tle == (unsigned long )((struct drbd_tl_epoch *)0)) { tmp___13 = constant_test_bit(0U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___13 != 0) { spin_unlock_irq(& mdev->req_lock); goto allocate_barrier; } else { } } else { } _drbd_start_io_acct(mdev, req, bio); if ((remote != 0 || send_oos != 0) && (unsigned long )mdev->unused_spare_tle != (unsigned long )((struct drbd_tl_epoch *)0)) { tmp___15 = test_and_clear_bit(0, (unsigned long volatile *)(& mdev->flags)); if (tmp___15 != 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___14 = constant_test_bit(0U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___14 != 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 984); } 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___16 = _req_conflicts(req); if (tmp___16 != 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 { } if (send_oos != 0) { tmp___17 = __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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 1026U); if (tmp___17 != 0) { _req_mod(req, queue_for_send_oos); } else { } } else { } if ((remote != 0 && (mdev->net_conf)->on_congestion != 0) && mdev->agreed_pro_version > 95) { congested = 0; if ((mdev->net_conf)->cong_fill != 0) { tmp___18 = atomic_read((atomic_t const *)(& mdev->ap_in_flight)); if (tmp___18 >= (mdev->net_conf)->cong_fill) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Congestion-fill threshold reached\n"); congested = 1; } else { } } else { } if ((mdev->act_log)->used >= (unsigned int )(mdev->net_conf)->cong_extents) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Congestion-extents threshold reached\n"); congested = 1; } else { } if (congested != 0) { queue_barrier(mdev); if ((mdev->net_conf)->on_congestion == 1) { __ns.i = mdev->state.i; __ns.ldv_38745.conn = 22U; _drbd_set_state(mdev, __ns, 0, 0); } else { __ns___0.i = mdev->state.i; __ns___0.ldv_38745.conn = 1U; _drbd_set_state(mdev, __ns___0, 0, 0); } } else { } } else { } spin_unlock_irq(& mdev->req_lock); kfree((void const *)b); if (local != 0) { (req->private_bio)->bi_bdev = (mdev->ldev)->backing_bdev; tmp___20 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___20 != 0) { tmp___19 = drbd_insert_fault(mdev, rw != 1 ? (rw == 0 ? 5U : 6U) : 4U); if (tmp___19 != 0) { bio_endio(req->private_bio, -5); } else { generic_make_request(req->private_bio); } put_ldev(mdev); } else { bio_endio(req->private_bio, -5); } } else { } return (0); fail_conflicting: _drbd_end_io_acct(mdev, req); spin_unlock_irq(& mdev->req_lock); if (remote != 0) { tmp___21 = atomic_dec_and_test(& mdev->ap_pending_cnt); if (tmp___21 != 0) { __wake_up(& mdev->misc_wait, 3U, 1, 0); } else { } tmp___23 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); if (tmp___23 < 0) { tmp___22 = 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", 1089, tmp___22); } else { } } else { } err = 0; fail_free_complete: ; if ((req->rq_state & 4096UL) != 0UL) { 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 + 2276UL) != 1U && (! allow_oos || 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); } } void drbd_make_request(struct request_queue *q , struct bio *bio ) { unsigned int s_enr ; unsigned int e_enr ; struct drbd_conf *mdev ; unsigned long start_time ; int tmp ; int tmp___0 ; long tmp___1 ; struct bio_pair *bp ; sector_t sect ; int sps ; int mask ; sector_t first_sectors ; int tmp___2 ; int tmp___3 ; { mdev = (struct drbd_conf *)q->queuedata; tmp = drbd_fail_request_early(mdev, (int )bio->bi_rw & 1); if (tmp != 0) { bio_endio(bio, -1); return; } else { } start_time = jiffies; if (bio->bi_size == 0U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( bio->bi_size > 0 ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 1151); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 1152); } else { } s_enr = (unsigned int )(bio->bi_sector >> 8); e_enr = (unsigned int )(((bio->bi_sector + (sector_t )(bio->bi_size >> 9)) - 1UL) >> 8); tmp___1 = ldv__builtin_expect(s_enr == e_enr, 1L); if (tmp___1 != 0L) { ldv_50064: inc_ap_bio(mdev, 1); tmp___0 = drbd_make_request_common(mdev, bio, start_time); if (tmp___0 != 0) { goto ldv_50064; } else { } return; } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_req.c.prepared", 1199); } else { } goto ldv_50072; ldv_50071: inc_ap_bio(mdev, 1); ldv_50072: tmp___2 = drbd_make_request_common(mdev, & bp->bio1, start_time); if (tmp___2 != 0) { goto ldv_50071; } else { } goto ldv_50075; ldv_50074: inc_ap_bio(mdev, 1); ldv_50075: tmp___3 = drbd_make_request_common(mdev, & bp->bio2, start_time); if (tmp___3 != 0) { goto ldv_50074; } else { } dec_ap_bio(mdev); bio_pair_release(bp); } return; } } 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 request_timer_fn(unsigned long data ) { struct drbd_conf *mdev ; struct drbd_request *req ; struct list_head *le ; unsigned long ent ; unsigned long dt ; unsigned long et ; unsigned long nt ; unsigned long now ; int tmp ; int tmp___0 ; unsigned long __x ; unsigned long __y ; unsigned long _min1 ; unsigned long _min2 ; unsigned long tmp___1 ; unsigned long tmp___2 ; int tmp___3 ; struct list_head const *__mptr ; union drbd_state __ns ; { mdev = (struct drbd_conf *)data; ent = 0UL; dt = 0UL; tmp = get_net_conf(mdev); if (tmp != 0) { if ((int )mdev->state.ldv_38745.conn > 8) { ent = (unsigned long )((((mdev->net_conf)->timeout * 250) / 10) * (mdev->net_conf)->ko_count); } else { } put_net_conf(mdev); } else { } tmp___0 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___0 != 0) { dt = (unsigned long )(((mdev->ldev)->dc.disk_timeout * 250) / 10); put_ldev(mdev); } else { } __x = dt; __y = ent; if (__x != 0UL) { if (__y != 0UL) { _min1 = __x; _min2 = __y; tmp___1 = _min1 < _min2 ? _min1 : _min2; } else { tmp___1 = __x; } tmp___2 = tmp___1; } else { tmp___2 = __y; } et = tmp___2; if (et == 0UL) { return; } else { } now = jiffies; spin_lock_irq(& mdev->req_lock); le = & (mdev->oldest_tle)->requests; tmp___3 = list_empty((struct list_head const *)le); if (tmp___3 != 0) { spin_unlock_irq(& mdev->req_lock); mod_timer(& mdev->request_timer, now + et); return; } else { } le = le->prev; __mptr = (struct list_head const *)le; req = (struct drbd_request *)__mptr + 0xffffffffffffffb8UL; if (((ent != 0UL && (req->rq_state & 16UL) != 0UL) && ((1 != 0 && 1 != 0) && (long )(req->start_time + ent) - (long )now < 0L)) && (((1 == 0 || 1 == 0) || (long )now - (long )mdev->last_reconnect_jif < 0L) || ((1 == 0 || 1 == 0) || (long )(mdev->last_reconnect_jif + ent) - (long )now < 0L))) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Remote failed to finish a request within ko-count * timeout\n"); __ns.i = mdev->state.i; __ns.ldv_38745.conn = 3U; _drbd_set_state(mdev, __ns, 3, 0); } else { } if (((dt != 0UL && (int )req->rq_state & 1) && ((1 != 0 && 1 != 0) && (long )(req->start_time + dt) - (long )now < 0L)) && (((1 == 0 || 1 == 0) || (long )now - (long )mdev->last_reattach_jif < 0L) || ((1 == 0 || 1 == 0) || (long )(mdev->last_reattach_jif + dt) - (long )now < 0L))) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local backing device failed to meet the disk-timeout\n"); __drbd_chk_io_error____1(mdev, 1, "request_timer_fn"); } else { } nt = ((1 == 0 || 1 == 0) || (long )(req->start_time + et) - (long )now >= 0L ? req->start_time : now) + et; spin_unlock_irq(& mdev->req_lock); mod_timer(& mdev->request_timer, nt); return; } } void ldv_mutex_lock_89(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_90(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_91(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_92(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_93(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_94(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_95(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_96(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } extern void __cmpxchg_wrong_size(void) ; __inline static int atomic_cmpxchg(atomic_t *v , int old , int new ) { int __ret ; int __old ; int __new ; u8 volatile *__ptr ; u16 volatile *__ptr___0 ; u32 volatile *__ptr___1 ; u64 volatile *__ptr___2 ; { __old = old; __new = new; switch (4UL) { case 1UL: __ptr = (u8 volatile *)(& v->counter); __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; cmpxchgb %2,%1": "=a" (__ret), "+m" (*__ptr): "q" (__new), "0" (__old): "memory"); goto ldv_5523; case 2UL: __ptr___0 = (u16 volatile *)(& v->counter); __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; cmpxchgw %2,%1": "=a" (__ret), "+m" (*__ptr___0): "r" (__new), "0" (__old): "memory"); goto ldv_5523; case 4UL: __ptr___1 = (u32 volatile *)(& v->counter); __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; cmpxchgl %2,%1": "=a" (__ret), "+m" (*__ptr___1): "r" (__new), "0" (__old): "memory"); goto ldv_5523; case 8UL: __ptr___2 = (u64 volatile *)(& v->counter); __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; cmpxchgq %2,%1": "=a" (__ret), "+m" (*__ptr___2): "r" (__new), "0" (__old): "memory"); goto ldv_5523; default: __cmpxchg_wrong_size(); } ldv_5523: ; return (__ret); } } int ldv_mutex_trylock_106(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_107(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_109(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_111(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_112(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_105(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_108(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_110(struct mutex *ldv_func_arg1 ) ; __inline static struct request_queue *bdev_get_queue(struct block_device *bdev ) { { return ((bdev->bd_disk)->queue); } } __inline static unsigned short queue_logical_block_size(struct request_queue *q ) { int retval ; { retval = 512; if ((unsigned long )q != (unsigned long )((struct request_queue *)0) && (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_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 * ) ; void *drbd_md_get_buffer(struct drbd_conf *mdev ) ; int drbd_md_sync_page_io(struct drbd_conf *mdev , struct drbd_backing_dev *bdev , sector_t sector , int rw ) ; int drbd_al_read_log(struct drbd_conf *mdev , struct drbd_backing_dev *bdev ) ; void drbd_al_apply_to_bm(struct drbd_conf *mdev ) ; void drbd_al_shrink(struct drbd_conf *mdev ) ; void drbd_bcast_sync_progress(struct drbd_conf *mdev ) ; __inline static void __drbd_chk_io_error____2(struct drbd_conf *mdev , int forcedetach , char const *where ) { int tmp ; union drbd_state __ns ; union drbd_state __ns___0 ; { 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.\n", where); } else { } if ((int )mdev->state.ldv_38745.disk > 4) { __ns.i = mdev->state.i; __ns.ldv_38745.disk = 4U; _drbd_set_state(mdev, __ns, CS_HARD, 0); } else { } goto ldv_48540; } else { } case 2: ; case 1: set_bit(19U, (unsigned long volatile *)(& mdev->flags)); if ((int )mdev->state.ldv_38745.disk > 2) { __ns___0.i = mdev->state.i; __ns___0.ldv_38745.disk = 2U; _drbd_set_state(mdev, __ns___0, CS_HARD, 0); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s. Detaching...\n", where); } else { } goto ldv_48540; } ldv_48540: ; 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 ) ; void *drbd_md_get_buffer(struct drbd_conf *mdev ) { int r ; wait_queue_t __wait ; struct task_struct *tmp ; void *tmp___0 ; void *tmp___1 ; { r = atomic_cmpxchg(& mdev->md_io_in_use, 0, 1); if (r == 0 || (int )mdev->state.ldv_38745.disk <= 2) { goto ldv_48840; } 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_48843: prepare_to_wait(& mdev->misc_wait, & __wait, 2); r = atomic_cmpxchg(& mdev->md_io_in_use, 0, 1); if (r == 0 || (int )mdev->state.ldv_38745.disk <= 2) { goto ldv_48842; } else { } schedule(); goto ldv_48843; ldv_48842: finish_wait(& mdev->misc_wait, & __wait); ldv_48840: ; if (r == 0) { tmp___0 = lowmem_page_address((struct page const *)mdev->md_io_page); tmp___1 = tmp___0; } else { tmp___1 = 0; } return (tmp___1); } } void drbd_md_put_buffer(struct drbd_conf *mdev ) { int tmp ; { tmp = atomic_dec_and_test(& mdev->md_io_in_use); if (tmp != 0) { __wake_up(& mdev->misc_wait, 3U, 1, 0); } else { } return; } } static bool md_io_allowed(struct drbd_conf *mdev ) { enum drbd_disk_state ds ; { ds = (enum drbd_disk_state )mdev->state.ldv_38745.disk; return ((bool )((unsigned int )ds > 2U || (unsigned int )ds == 1U)); } } void wait_until_done_or_disk_failure(struct drbd_conf *mdev , struct drbd_backing_dev *bdev , unsigned int *done ) { long dt ; long __ret ; wait_queue_t __wait ; struct task_struct *tmp ; bool tmp___0 ; int tmp___1 ; bool tmp___2 ; { dt = (long )((bdev->dc.disk_timeout * 250) / 10); if (dt == 0L) { dt = 9223372036854775807L; } else { } __ret = dt; if (*done == 0U) { tmp___2 = md_io_allowed(mdev); if ((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; ldv_48860: prepare_to_wait(& mdev->misc_wait, & __wait, 2); if (*done != 0U) { goto ldv_48859; } else { tmp___0 = md_io_allowed(mdev); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto ldv_48859; } else { } } __ret = schedule_timeout(__ret); if (__ret == 0L) { goto ldv_48859; } else { } goto ldv_48860; ldv_48859: finish_wait(& mdev->misc_wait, & __wait); } else { } } else { } dt = __ret; if (dt == 0L) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "meta-data IO operation timed out\n"); } else { } return; } } 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 ; int ok ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { mdev->md_io.done = 0U; mdev->md_io.error = -19; if (rw & 1) { tmp = constant_test_bit(14U, (unsigned long const volatile *)(& mdev->flags)); if (tmp == 0) { rw = rw | 3072; } else { } } else { } rw = rw | 16; bio = bio_alloc_drbd(16U); 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 *)(& mdev->md_io); bio->bi_end_io = & drbd_md_io_complete; bio->bi_rw = (unsigned long )rw; tmp___1 = _get_ldev_if_state(mdev, D_ATTACHING); if (tmp___1 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: get_ldev_if_state() == 1 in _drbd_md_sync_page_io()\n"); ok = 0; goto out; } else { } atomic_inc(& bio->bi_cnt); atomic_inc(& mdev->md_io_in_use); tmp___2 = drbd_insert_fault(mdev, rw & 1 ? 0U : 1U); if (tmp___2 != 0) { bio_endio(bio, -5); } else { submit_bio(rw, bio); } wait_until_done_or_disk_failure(mdev, bdev, & mdev->md_io.done); ok = (int )bio->bi_flags & 1 && mdev->md_io.error == 0; 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 = atomic_read((atomic_t const *)(& mdev->md_io_in_use)); if (tmp != 1) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( atomic_read(&mdev->md_io_in_use) == 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 210); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared"), "i" (212), "i" (12UL)); ldv_48884: ; goto ldv_48884; } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 221); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 222); } 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((struct page const *)mdev->md_io_page); p = tmp___2; tmp___3 = lowmem_page_address((struct page const *)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((struct page const *)mdev->md_io_page); p___0 = tmp___10; tmp___11 = lowmem_page_address((struct page const *)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 ; int wake ; struct bm_extent *bm_ext ; struct lc_element const *__mptr ; int tmp___0 ; int tmp___1 ; long tmp___2 ; { al_flags = 0UL; spin_lock_irq(& mdev->al_lock); tmp = lc_find(mdev->resync, enr / 4U); tmp___2 = ldv__builtin_expect((unsigned long )tmp != (unsigned long )((struct lc_element *)0), 0L); if (tmp___2 != 0L) { __mptr = (struct lc_element const *)tmp; bm_ext = (struct bm_extent *)__mptr + 0xfffffffffffffff0UL; tmp___1 = constant_test_bit(0U, (unsigned long const volatile *)(& bm_ext->flags)); if (tmp___1 != 0) { tmp___0 = test_and_set_bit(2, (unsigned long volatile *)(& bm_ext->flags)); wake = tmp___0 == 0; spin_unlock_irq(& mdev->al_lock); if (wake != 0) { __wake_up(& mdev->al_wait, 3U, 1, 0); } else { } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 311); } else { } al_ext = _al_get(mdev, enr); if ((unsigned long )al_ext != (unsigned long )((struct lc_element *)0)) { goto ldv_48914; } 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_48917: 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_48916; } else { } schedule(); goto ldv_48917; ldv_48916: finish_wait(& mdev->al_wait, & __wait); ldv_48914: ; 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; } } static unsigned int al_extent_to_bm_page(unsigned int al_enr ) { { return (al_enr >> 5); } } static unsigned int rs_extent_to_bm_page(unsigned int rs_enr ) { { return (rs_enr >> 3); } } int w_al_write_transaction(struct drbd_conf *mdev , struct drbd_work *w , int unused ) { struct update_al_work *aw ; struct drbd_work const *__mptr ; struct lc_element *updated ; unsigned int new_enr ; unsigned int evicted ; struct al_transaction *buffer ; sector_t sector ; int i ; int n ; int mx ; unsigned int extent_nr ; u32 xor_sum ; char const *tmp ; int tmp___0 ; unsigned int tmp___1 ; char const *tmp___2 ; void *tmp___3 ; __u32 tmp___4 ; unsigned int tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; int __min1 ; int __min2 ; unsigned int idx ; struct lc_element *tmp___8 ; __u32 tmp___9 ; __u32 tmp___10 ; __u32 tmp___11 ; int tmp___12 ; { __mptr = (struct drbd_work const *)w; aw = (struct update_al_work *)__mptr; updated = aw->al_ext; new_enr = aw->enr; evicted = aw->old_enr; xor_sum = 0U; tmp___0 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___0 == 0) { tmp = drbd_disk_str((enum drbd_disk_state )mdev->state.ldv_38745.disk); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "disk is %s, cannot start al transaction (-%d +%d)\n", tmp, evicted, new_enr); complete(& ((struct update_al_work *)w)->event); return (1); } else { } if ((int )mdev->state.ldv_38745.conn <= 9 && evicted != 4294967295U) { tmp___1 = al_extent_to_bm_page(evicted); drbd_bm_write_page(mdev, tmp___1); } else { } if ((int )mdev->state.ldv_38745.disk <= 3) { tmp___2 = drbd_disk_str((enum drbd_disk_state )mdev->state.ldv_38745.disk); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "disk is %s, cannot write al transaction (-%d +%d)\n", tmp___2, evicted, new_enr); complete(& ((struct update_al_work *)w)->event); put_ldev(mdev); return (1); } else { } tmp___3 = drbd_md_get_buffer(mdev); buffer = (struct al_transaction *)tmp___3; if ((unsigned long )buffer == (unsigned long )((struct al_transaction *)0)) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "disk failed while waiting for md_io buffer\n"); complete(& ((struct update_al_work *)w)->event); put_ldev(mdev); return (1); } else { } buffer->magic = 1728214147U; tmp___4 = __fswab32(mdev->al_tr_number); buffer->tr_number = tmp___4; tmp___5 = lc_index_of(mdev->act_log, updated); n = (int )tmp___5; tmp___6 = __fswab32((__u32 )n); buffer->updates[0].pos = tmp___6; tmp___7 = __fswab32(new_enr); buffer->updates[0].extent = tmp___7; xor_sum = xor_sum ^ new_enr; __min1 = 61; __min2 = (int )((mdev->act_log)->nr_elements - (unsigned int )mdev->al_tr_cycle); mx = __min1 < __min2 ? __min1 : __min2; i = 0; goto ldv_48957; ldv_48956: idx = (unsigned int )(mdev->al_tr_cycle + i); tmp___8 = lc_element_by_index(mdev->act_log, idx); extent_nr = tmp___8->lc_number; tmp___9 = __fswab32(idx); buffer->updates[i + 1].pos = tmp___9; tmp___10 = __fswab32(extent_nr); buffer->updates[i + 1].extent = tmp___10; xor_sum = xor_sum ^ extent_nr; i = i + 1; ldv_48957: ; if (i < mx) { goto ldv_48956; } else { } goto ldv_48960; ldv_48959: buffer->updates[i + 1].pos = 4294967295U; buffer->updates[i + 1].extent = 4294967295U; xor_sum = ~ xor_sum; i = i + 1; ldv_48960: ; if (i <= 60) { goto ldv_48959; } 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___11 = __fswab32(xor_sum); buffer->xor_sum = tmp___11; sector = (sector_t )(((mdev->ldev)->md.md_offset + (u64 )(mdev->ldev)->md.al_offset) + (u64 )mdev->al_tr_pos); tmp___12 = drbd_md_sync_page_io(mdev, mdev->ldev, sector, 1); if (tmp___12 == 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 475); } else { } mdev->al_tr_number = mdev->al_tr_number + 1U; drbd_md_put_buffer(mdev); 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_48974; ldv_48973: tmp___1 = __fswab32(b->updates[i].extent); xor_sum = tmp___1 ^ xor_sum; i = i + 1; ldv_48974: ; if (i <= 61) { goto ldv_48973; } 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)); tmp = drbd_md_get_buffer(mdev); buffer = (struct al_transaction *)tmp; if ((unsigned long )buffer == (unsigned long )((struct al_transaction *)0)) { return (0); } else { } i = 0; goto ldv_48994; ldv_48993: rv = drbd_al_read_tr(mdev, bdev, buffer, i); if (rv == 0) { goto ldv_48992; } else { } if (rv == -1) { drbd_md_put_buffer(mdev); 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_48992; } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 570); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 575); } else { } to = i; to_tnr = cnr; } else { } ldv_48992: i = i + 1; ldv_48994: ; if (i <= mx) { goto ldv_48993; } else { } if (found_valid == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "No usable activity log found.\n"); drbd_md_put_buffer(mdev); return (1); } else { } i = from; ldv_49009: rv = drbd_al_read_tr(mdev, bdev, buffer, i); _b = rv == 0; if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_al_read_log", (char *)"rv == 0", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 596); } else { } if (_b != 0) { goto cancel; } else { } if (rv == -1) { drbd_md_put_buffer(mdev); return (0); } else { } tmp___1 = __fswab32(buffer->tr_number); trn = tmp___1; spin_lock_irq(& mdev->al_lock); j = 61; goto ldv_49006; ldv_49005: 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_49004; } else { } lc_set(mdev->act_log, extent_nr, pos); active_extents = active_extents + 1; ldv_49004: j = j - 1; ldv_49006: ; if (j >= 0) { goto ldv_49005; } else { } spin_unlock_irq(& mdev->al_lock); transactions = transactions + 1; cancel: ; if (i == to) { goto ldv_49008; } else { } i = i + 1; if (i > mx) { i = 0; } else { } goto ldv_49009; ldv_49008: 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 { } drbd_md_put_buffer(mdev); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Found %d transactions (%d active extents) in activity log.\n", transactions, active_extents); return (1); } } void drbd_al_apply_to_bm(struct drbd_conf *mdev ) { unsigned int enr ; unsigned long add ; char ppb[10U] ; int i ; int tmp ; int tmp___0 ; wait_queue_t __wait ; struct task_struct *tmp___1 ; int tmp___2 ; struct lc_element *tmp___3 ; unsigned long tmp___4 ; struct _ddebug descriptor ; long tmp___5 ; char *tmp___6 ; { add = 0UL; tmp___0 = lc_try_lock(mdev->act_log); if (tmp___0 != 0) { goto ldv_49018; } 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_49021: prepare_to_wait(& mdev->al_wait, & __wait, 2); tmp___2 = lc_try_lock(mdev->act_log); if (tmp___2 != 0) { goto ldv_49020; } else { } schedule(); goto ldv_49021; ldv_49020: finish_wait(& mdev->al_wait, & __wait); ldv_49018: i = 0; goto ldv_49026; ldv_49025: tmp___3 = lc_element_by_index(mdev->act_log, (unsigned int )i); enr = tmp___3->lc_number; if (enr == 4294967295U) { goto ldv_49022; } else { } tmp___4 = drbd_bm_ALe_set_all(mdev, (unsigned long )enr); tmp = (int )tmp___4; descriptor.modname = "drbd"; descriptor.function = "drbd_al_apply_to_bm"; descriptor.filename = "/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared"; descriptor.format = "AL: set %d bits in extent %u\n"; descriptor.lineno = 665U; descriptor.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___5 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& (mdev->vdisk)->part0.__dev), "AL: set %d bits in extent %u\n", tmp, enr); } else { } add = (unsigned long )tmp + add; ldv_49022: i = i + 1; ldv_49026: ; if ((unsigned int )i < (mdev->act_log)->nr_elements) { goto ldv_49025; } else { } lc_unlock(mdev->act_log); __wake_up(& mdev->al_wait, 3U, 1, 0); tmp___6 = ppsize((char *)(& ppb), (unsigned long long )(add << 2)); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Marked additional %s as out-of-sync based on AL.\n", tmp___6); return; } } static int _try_lc_del(struct drbd_conf *mdev , struct lc_element *al_ext ) { int rv ; long tmp ; { spin_lock_irq(& mdev->al_lock); rv = al_ext->refcnt == 0U; tmp = 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 703); } else { } i = 0; goto ldv_49044; ldv_49043: al_ext = lc_element_by_index(mdev->act_log, (unsigned int )i); if (al_ext->lc_number == 4294967295U) { goto ldv_49038; } else { } tmp___0 = _try_lc_del(mdev, al_ext); if (tmp___0 != 0) { goto ldv_49039; } 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_49042: prepare_to_wait(& mdev->al_wait, & __wait, 2); tmp___2 = _try_lc_del(mdev, al_ext); if (tmp___2 != 0) { goto ldv_49041; } else { } schedule(); goto ldv_49042; ldv_49041: finish_wait(& mdev->al_wait, & __wait); ldv_49039: ; ldv_49038: i = i + 1; ldv_49044: ; if ((unsigned int )i < (mdev->act_log)->nr_elements) { goto ldv_49043; } 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 int tmp___1 ; unsigned long tmp___2 ; { __mptr = (struct drbd_work const *)w; udw = (struct update_odbm_work *)__mptr; tmp___0 = _get_ldev_if_state(mdev, 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 { } tmp___1 = rs_extent_to_bm_page(udw->enr); drbd_bm_write_page(mdev, tmp___1); put_ldev(mdev); kfree((void const *)udw); tmp___2 = drbd_bm_total_weight(mdev); if (tmp___2 <= mdev->rs_failed) { switch ((int )mdev->state.ldv_38745.conn) { case 16: ; case 17: ; case 20: ; case 21: drbd_resync_finished(mdev); default: ; goto ldv_49060; } ldv_49060: ; } 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 ; char const *tmp___0 ; int rs_left ; int tmp___1 ; void *tmp___2 ; { 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 761); } 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) { tmp___0 = drbd_conn_str((enum drbd_conns )mdev->state.ldv_38745.conn); dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "BAD! sector=%llus enr=%u rs_left=%d rs_failed=%d count=%d cstate=%s\n", (unsigned long long )sector, ext->lce.lc_number, ext->rs_left, ext->rs_failed, count, tmp___0); ext->rs_left = drbd_bm_e_weight(mdev, (unsigned long )enr); } else { } } else { tmp___1 = drbd_bm_e_weight(mdev, (unsigned long )enr); rs_left = tmp___1; if (ext->flags != 0UL) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "changing resync lce: %d[%u;%02lx] -> %d[%u;00]\n", ext->lce.lc_number, ext->rs_left, ext->flags, enr, rs_left); ext->flags = 0UL; } else { } if (ext->rs_failed != 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Kicking resync_lru element enr=%u out with rs_failed=%d\n", ext->lce.lc_number, ext->rs_failed); } else { } ext->rs_left = rs_left; 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___2 = kmalloc(32UL, 32U); udw = (struct update_odbm_work *)tmp___2; if ((unsigned long )udw != (unsigned long )((struct update_odbm_work *)0)) { udw->enr = ext->lce.lc_number; udw->w.cb = & w_update_odbm; drbd_queue_work_front(& mdev->data.work, & udw->w); } else { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Could not kmalloc an udw\n"); } } else { } } else { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "lc_get() failed! locked=%d/%d flags=%lu\n", mdev->resync_locked, (mdev->resync)->nr_elements, (mdev->resync)->flags); } return; } } void drbd_advance_rs_marks(struct drbd_conf *mdev , unsigned long still_to_go ) { unsigned long now ; unsigned long last ; int next ; { now = 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) { if ((mdev->rs_mark_left[mdev->rs_last_mark] != still_to_go && (unsigned int )*((unsigned short *)mdev + 1138UL) != 336U) && (unsigned int )*((unsigned short *)mdev + 1138UL) != 320U) { mdev->rs_mark_time[next] = now; mdev->rs_mark_left[next] = still_to_go; mdev->rs_last_mark = next; } else { } } else { } return; } } void __drbd_set_in_sync(struct drbd_conf *mdev , sector_t sector , int size , char const *file , unsigned int const line ) { unsigned long sbnr ; unsigned long ebnr ; unsigned long lbnr ; unsigned long count ; sector_t esector ; sector_t nr_sectors ; int wake_up ; unsigned long flags ; int _b ; int _b___0 ; long tmp ; long tmp___0 ; int tmp___1 ; unsigned long tmp___2 ; raw_spinlock_t *tmp___3 ; int tmp___4 ; { count = 0UL; wake_up = 0; if ((size <= 0 || (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), "ASSERT FAILED: %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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 879); } else { } if (_b != 0) { return; } else { } _b___0 = esector >= nr_sectors; if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "__drbd_set_in_sync", (char *)"esector >= nr_sectors", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 880); } 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) { tmp___2 = drbd_bm_total_weight(mdev); drbd_advance_rs_marks(mdev, tmp___2); tmp___3 = spinlock_check(& mdev->al_lock); flags = _raw_spin_lock_irqsave(tmp___3); drbd_try_clear_on_disk_bm(mdev, sector, (int )count, 1); spin_unlock_irqrestore(& mdev->al_lock, flags); wake_up = 1; put_ldev(mdev); } else { } } else { } if (wake_up != 0) { __wake_up(& mdev->al_wait, 3U, 1, 0); } else { } return; } } int __drbd_set_out_of_sync(struct drbd_conf *mdev , sector_t sector , int size , char const *file , unsigned int const line ) { unsigned long sbnr ; unsigned long ebnr ; unsigned long lbnr ; unsigned long flags ; sector_t esector ; sector_t nr_sectors ; unsigned int enr ; unsigned int count ; struct lc_element *e ; int tmp ; int _b ; int _b___0 ; raw_spinlock_t *tmp___0 ; int tmp___1 ; struct lc_element const *__mptr ; struct lc_element const *__mptr___0 ; { count = 0U; if ((size <= 0 || (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 (0); } else { } tmp = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp == 0) { return (0); } else { } nr_sectors = drbd_get_capacity(mdev->this_bdev); esector = ((sector_t )(size >> 9) + sector) - 1UL; _b = sector >= nr_sectors; if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "__drbd_set_out_of_sync", (char *)"sector >= nr_sectors", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 946); } else { } if (_b != 0) { goto out; } else { } _b___0 = esector >= nr_sectors; if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "__drbd_set_out_of_sync", (char *)"esector >= nr_sectors", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 948); } 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 ((int )count); } } static struct bm_extent *_bme_get(struct drbd_conf *mdev , unsigned int enr ) { struct lc_element *e ; struct bm_extent *bm_ext ; int wakeup ; unsigned long rs_flags ; struct lc_element const *__mptr ; long tmp ; { wakeup = 0; spin_lock_irq(& mdev->al_lock); if (mdev->resync_locked > (mdev->resync)->nr_elements / 2U) { spin_unlock_irq(& mdev->al_lock); return (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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared"), "i" (1010), "i" (12UL)); ldv_49147: ; goto ldv_49147; } 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 sa ; int __ret ; wait_queue_t __wait ; struct task_struct *tmp ; struct task_struct *tmp___0 ; int tmp___1 ; int tmp___2 ; int __ret___0 ; wait_queue_t __wait___0 ; struct task_struct *tmp___3 ; int tmp___4 ; int tmp___5 ; struct task_struct *tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; unsigned int tmp___10 ; long tmp___11 ; int tmp___12 ; { enr = (unsigned int )(sector >> 15); sa = 200; retry: __ret = 0; bm_ext = _bme_get(mdev, enr); if ((unsigned long )bm_ext == (unsigned long )((struct bm_extent *)0)) { tmp = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_49168: 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_49166; } else { } tmp___0 = get_current(); tmp___1 = signal_pending(tmp___0); if (tmp___1 == 0) { schedule(); goto ldv_49167; } else { } __ret = -512; goto ldv_49166; ldv_49167: ; goto ldv_49168; ldv_49166: 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_49177; ldv_49176: __ret___0 = 0; tmp___8 = _is_in_al(mdev, enr * 4U + (unsigned int )i); if (tmp___8 != 0) { tmp___9 = constant_test_bit(2U, (unsigned long const volatile *)(& bm_ext->flags)); if (tmp___9 == 0) { tmp___3 = get_current(); __wait___0.flags = 0U; __wait___0.private = (void *)tmp___3; __wait___0.func = & autoremove_wake_function; __wait___0.task_list.next = & __wait___0.task_list; __wait___0.task_list.prev = & __wait___0.task_list; ldv_49174: 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_49172; } else { tmp___5 = constant_test_bit(2U, (unsigned long const volatile *)(& bm_ext->flags)); if (tmp___5 != 0) { goto ldv_49172; } else { } } tmp___6 = get_current(); tmp___7 = signal_pending(tmp___6); if (tmp___7 == 0) { schedule(); goto ldv_49173; } else { } __ret___0 = -512; goto ldv_49172; ldv_49173: ; goto ldv_49174; ldv_49172: finish_wait(& mdev->al_wait, & __wait___0); } else { } } else { } sig = __ret___0; if (sig != 0) { goto _L; } else { tmp___12 = constant_test_bit(2U, (unsigned long const volatile *)(& bm_ext->flags)); if (tmp___12 != 0 && sa != 0) { _L: /* CIL Label */ spin_lock_irq(& mdev->al_lock); tmp___10 = lc_put(mdev->resync, & bm_ext->lce); if (tmp___10 == 0U) { bm_ext->flags = 0UL; mdev->resync_locked = mdev->resync_locked - 1U; __wake_up(& mdev->al_wait, 3U, 1, 0); } else { } spin_unlock_irq(& mdev->al_lock); if (sig != 0) { return (-4); } else { } tmp___11 = schedule_timeout_interruptible(25L); if (tmp___11 != 0L) { return (-4); } else { } if (sa != 0) { sa = sa - 1; if (sa == 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "drbd_rs_begin_io() stepped aside for 20sec.Resync stalled?\n"); } else { } } else { } goto retry; } else { } } i = i + 1; ldv_49177: ; if (i <= 3) { goto ldv_49176; } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1127); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1128); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1152); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared"), "i" (1167), "i" (12UL)); ldv_49198: ; goto ldv_49198; } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1175); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1178); } else { } mdev->resync_locked = mdev->resync_locked + 1U; goto check_al; } check_al: i = 0; goto ldv_49200; ldv_49199: 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_49200: ; if (i <= 3) { goto ldv_49199; } 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) { bm_ext->flags = 0UL; 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_49229; ldv_49228: 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_49227; } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1280); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1281); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1293); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1294); } else { } lc_del(mdev->resync, & bm_ext->lce); ldv_49227: i = i + 1; ldv_49229: ; if ((unsigned int )i < (mdev->resync)->nr_elements) { goto ldv_49228; } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1297); } else { } put_ldev(mdev); } else { } spin_unlock_irq(& mdev->al_lock); __wake_up(& mdev->al_wait, 3U, 1, 0); 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), "ASSERT FAILED: %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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1328); } else { } if (_b != 0) { return; } else { } _b___0 = esector >= nr_sectors; if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_rs_failed_io", (char *)"esector >= nr_sectors", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_actlog.c.prepared", 1329); } 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_105(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_106(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_107(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_108(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_109(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_110(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_111(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_112(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_drbd_socket(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static __u32 __fswahw32(__u32 val ) { { return ((val << 16) | (val >> (8UL * sizeof(val) - 16UL))); } } __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; } } 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 ) ; 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_127(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_128(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_130(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_133(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_126(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_129(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_131(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_132(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___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_6355; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6355; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6355; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6355; default: __bad_percpu_size(); } ldv_6355: 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 int del_timer(struct timer_list * ) ; extern int kernel_sendmsg(struct socket * , struct msghdr * , struct kvec * , size_t , size_t ) ; extern int kernel_sock_shutdown(struct socket * , enum sock_shutdown_cmd ) ; extern struct kmem_cache *kmem_cache_create(char const * , size_t , size_t , unsigned long , void (*)(void * ) ) ; extern void kmem_cache_destroy(struct kmem_cache * ) ; __inline static int PageSlab(struct page const *page ) { int tmp ; { tmp = constant_test_bit(7U, (unsigned long const volatile *)(& page->flags)); return (tmp); } } extern int register_blkdev(unsigned int , char const * ) ; extern void unregister_blkdev(unsigned int , char const * ) ; extern struct block_device *bdget(dev_t ) ; extern void bdput(struct block_device * ) ; extern int blkdev_put(struct block_device * , fmode_t ) ; extern int set_cpus_allowed_ptr(struct task_struct * , struct cpumask const * ) ; extern int wake_up_process(struct task_struct * ) ; extern struct proc_dir_entry *proc_create_data(char const * , umode_t , struct proc_dir_entry * , struct file_operations const * , void * ) ; extern void remove_proc_entry(char const * , struct proc_dir_entry * ) ; extern int register_reboot_notifier(struct notifier_block * ) ; extern int unregister_reboot_notifier(struct notifier_block * ) ; extern struct task_struct *kthread_create_on_node(int (*)(void * ) , void * , int , char const * , ...) ; extern void del_gendisk(struct gendisk * ) ; extern void set_disk_ro(struct gendisk * , int ) ; extern struct gendisk *alloc_disk(int ) ; extern void put_disk(struct gendisk * ) ; __inline static int bdi_congested(struct backing_dev_info *bdi , int bdi_bits ) { int tmp ; { if ((unsigned long )bdi->congested_fn != (unsigned long )((congested_fn *)0)) { tmp = (*(bdi->congested_fn))(bdi->congested_data, bdi_bits); return (tmp); } else { } return ((int )((unsigned int )bdi->state & (unsigned int )bdi_bits)); } } extern mempool_t *mempool_create(int , mempool_alloc_t * , mempool_free_t * , void * ) ; extern void mempool_destroy(mempool_t * ) ; extern void *mempool_alloc_slab(gfp_t , void * ) ; extern void mempool_free_slab(void * , void * ) ; extern void *mempool_alloc_pages(gfp_t , void * ) ; extern void mempool_free_pages(void * , void * ) ; __inline static mempool_t *mempool_create_page_pool(int min_nr , int order ) { mempool_t *tmp ; { tmp = mempool_create(min_nr, & mempool_alloc_pages, & mempool_free_pages, (void *)((long )order)); return (tmp); } } extern void bioset_free(struct bio_set * ) ; extern struct bio *bio_alloc_bioset(gfp_t , int , struct bio_set * ) ; extern void bio_free(struct bio * , struct bio_set * ) ; extern void blk_cleanup_queue(struct request_queue * ) ; extern void blk_queue_make_request(struct request_queue * , make_request_fn * ) ; extern void blk_queue_bounce_limit(struct request_queue * , u64 ) ; extern void blk_queue_max_hw_sectors(struct request_queue * , unsigned int ) ; extern void blk_queue_merge_bvec(struct request_queue * , merge_bvec_fn * ) ; extern struct request_queue *blk_alloc_queue(gfp_t ) ; extern void lc_destroy(struct lru_cache * ) ; bool disable_sendpage ; bool 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" (593), "i" (12UL)); ldv_48464: ; goto ldv_48464; } 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" (618), "i" (12UL)); ldv_48479: ; goto ldv_48479; } 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_126(& mdev->data.mutex); tmp = ldv__builtin_expect((unsigned long )mdev->data.socket == (unsigned long )((struct socket *)0), 0L); if (tmp != 0L) { ldv_mutex_unlock_127(& mdev->data.mutex); return (0); } else { } return (1); } } __inline static void drbd_put_data_sock___0(struct drbd_conf *mdev ) { { ldv_mutex_unlock_128(& 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 , enum drbd_state_rv err ) ; void drbd_calc_cpu_mask(struct drbd_conf *mdev ) ; void drbd_free_resources(struct drbd_conf *mdev ) ; int drbd_send(struct drbd_conf *mdev , struct socket *sock , void *buf , size_t size , unsigned int msg_flags ) ; int drbd_send_uuids_skip_initial_sync(struct drbd_conf *mdev ) ; int drbd_send_state(struct drbd_conf *mdev , union drbd_state state ) ; int _drbd_send_bitmap(struct drbd_conf *mdev ) ; void drbd_free_bc(struct drbd_backing_dev *ldev ) ; int drbd_md_read(struct drbd_conf *mdev , struct drbd_backing_dev *bdev ) ; void drbd_md_set_flag(struct drbd_conf *mdev , int flag ) ; void drbd_md_clear_flag(struct drbd_conf *mdev , int flag ) ; int drbd_md_test_flag(struct drbd_backing_dev *bdev , int flag ) ; void drbd_md_mark_dirty(struct drbd_conf *mdev ) ; void drbd_queue_bitmap_io(struct drbd_conf *mdev , int (*io_fn)(struct drbd_conf * ) , void (*done)(struct drbd_conf * , int ) , char *why , enum bm_flag flags ) ; struct kmem_cache *drbd_request_cache ; struct kmem_cache *drbd_ee_cache ; struct kmem_cache *drbd_bm_ext_cache ; struct kmem_cache *drbd_al_ext_cache ; mempool_t *drbd_request_mempool ; mempool_t *drbd_ee_mempool ; struct page *drbd_pp_pool ; spinlock_t drbd_pp_lock ; int drbd_pp_vacant ; wait_queue_head_t drbd_pp_wait ; mempool_t *drbd_md_io_page_pool ; struct bio_set *drbd_md_io_bio_set ; 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_49573; } 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_49576: 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_49575; } else { } schedule(); goto ldv_49576; ldv_49575: finish_wait(& mdev->misc_wait, & __wait); ldv_49573: ; return; } } __inline static void __drbd_chk_io_error____3(struct drbd_conf *mdev , int forcedetach , char const *where ) { int tmp ; union drbd_state __ns ; union drbd_state __ns___0 ; { 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.\n", where); } else { } if ((int )mdev->state.ldv_38745.disk > 4) { __ns.i = mdev->state.i; __ns.ldv_38745.disk = 4U; _drbd_set_state(mdev, __ns, CS_HARD, 0); } else { } goto ldv_49601; } else { } case 2: ; case 1: set_bit(19U, (unsigned long volatile *)(& mdev->flags)); if ((int )mdev->state.ldv_38745.disk > 2) { __ns___0.i = mdev->state.i; __ns___0.ldv_38745.disk = 2U; _drbd_set_state(mdev, __ns___0, CS_HARD, 0); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Local IO failed in %s. Detaching...\n", where); } else { } goto ldv_49601; } ldv_49601: ; 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 = 2251799813685248UL; tmp___0 = drbd_md_first_sector(bdev); __min2 = tmp___0; s = __min1 < __min2 ? __min1 : __min2; } else { s = 0UL; } goto ldv_49642; case -2: __min1___0 = 2251799813685248UL; 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_49642; 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_49642: ; 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(struct drbd_conf *mdev ) { union drbd_state s ; { s = mdev->state; switch ((unsigned int )s.ldv_38745.conn) { case 0U: ; case 8U: ; case 10U: ; case 16U: ; case 17U: ; case 18U: ; case 19U: ; case 20U: ; case 21U: ; case 22U: ; case 23U: ; case 1U: ; case 2U: ; case 3U: ; case 4U: ; case 5U: ; case 6U: ; case 7U: ; case 9U: ; case 11U: ; case 12U: ; goto ldv_49773; case 13U: ; if (mdev->agreed_pro_version <= 95) { return (0); } else { } goto ldv_49773; case 14U: ; case 15U: ; case 31U: ; return (0); } ldv_49773: ; switch ((unsigned int )s.ldv_38745.disk) { case 0U: ; case 4U: ; case 5U: ; case 7U: ; case 8U: ; case 2U: ; goto ldv_49784; case 1U: ; case 3U: ; case 6U: ; case 15U: ; return (0); } ldv_49784: ; return (1); } } __inline static bool may_inc_ap_bio___0(struct drbd_conf *mdev ) { int mxb ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { tmp = drbd_get_max_buffers(mdev); mxb = tmp; tmp___0 = is_susp(mdev->state); if (tmp___0 != 0) { return (0); } else { } tmp___1 = constant_test_bit(15U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___1 != 0) { return (0); } else { } tmp___2 = drbd_state_is_stable___0(mdev); 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(16U, (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); } } void tl_restart(struct drbd_conf *mdev , enum drbd_req_event what ) ; __inline static int __vli_encode_bits(u64 *out , u64 const in ) { u64 max ; u64 adj ; { max = 0ULL; adj = 1ULL; if ((unsigned long long )in == 0ULL) { return (-22); } else { } max = max + 2ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = ((unsigned long long )in - adj) << 1; } else { } return (2); } else { } adj = max + 1ULL; max = max + 2ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 2) | 1ULL; } else { } return (3); } else { } adj = max + 1ULL; max = max + 4ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 3) | 3ULL; } else { } return (5); } else { } adj = max + 1ULL; max = max + 8ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 4) | 7ULL; } else { } return (7); } else { } adj = max + 1ULL; max = max + 32ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 5) | 15ULL; } else { } return (10); } else { } adj = max + 1ULL; max = max + 256ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 6) | 31ULL; } else { } return (14); } else { } adj = max + 1ULL; max = max + 8192ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 8) | 63ULL; } else { } return (21); } else { } adj = max + 1ULL; max = max + 2097152ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 8) | 127ULL; } else { } return (29); } else { } adj = max + 1ULL; max = max + 17179869184ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 8) | 191ULL; } else { } return (42); } else { } adj = max + 1ULL; max = max + 72057594037927936ULL; if ((unsigned long long )in <= max) { if ((unsigned long )out != (unsigned long )((u64 *)0)) { *out = (((unsigned long long )in - adj) << 8) | 255ULL; } else { } return (64); } else { } adj = max + 1ULL; return (-75); } } __inline static int bitstream_put_bits(struct bitstream *bs , u64 val , unsigned int const bits ) { unsigned char *b ; unsigned int tmp ; unsigned char *tmp___0 ; unsigned char *tmp___1 ; { b = bs->cur.b; if ((unsigned int )bits == 0U) { return (0); } else { } if ((unsigned long )((long )(bs->cur.b + (unsigned long )(((bs->cur.bit + (unsigned int )bits) - 1U) >> 3)) - (long )bs->buf) >= bs->buf_len) { return (-105); } else { } if ((unsigned int )bits <= 63U) { val = (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_50038; ldv_50037: tmp___1 = b; b = b + 1; *tmp___1 = (int )*tmp___1 | (int )((unsigned char )(val >> (int )tmp)); tmp = tmp + 8U; ldv_50038: ; if (tmp < (unsigned int )bits) { goto ldv_50037; } 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, 0, & __this_module}; static void bio_destructor_drbd(struct bio *bio ) { { bio_free(bio, drbd_md_io_bio_set); return; } } struct bio *bio_alloc_drbd(gfp_t gfp_mask ) { struct bio *bio ; struct bio *tmp ; { if ((unsigned long )drbd_md_io_bio_set == (unsigned long )((struct bio_set *)0)) { tmp = bio_alloc(gfp_mask, 1U); return (tmp); } else { } bio = bio_alloc_bioset(gfp_mask, 1, drbd_md_io_bio_set); if ((unsigned long )bio == (unsigned long )((struct bio *)0)) { return (0); } else { } bio->bi_destructor = & bio_destructor_drbd; return (bio); } } static int tl_init(struct drbd_conf *mdev ) { struct drbd_tl_epoch *b ; void *tmp ; { tmp = kmalloc(56UL, 208U); b = (struct drbd_tl_epoch *)tmp; if ((unsigned long )b == (unsigned long )((struct drbd_tl_epoch *)0)) { return (0); } else { } INIT_LIST_HEAD(& b->requests); INIT_LIST_HEAD(& b->w.list); b->next = 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); INIT_LIST_HEAD(& mdev->barrier_acked_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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 296); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 297); } 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; 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_50275; ldv_50274: __mptr = (struct list_head const *)le; r = (struct drbd_request *)__mptr + 0xffffffffffffffb8UL; _req_mod(r, barrier_acked); le = tle; tle = le->next; ldv_50275: ; if ((unsigned long )(& b->requests) != (unsigned long )le) { goto ldv_50274; } else { } list_splice_init(& b->requests, & mdev->barrier_acked_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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 398); } 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", 404, tmp___1); } else { } return; bail: spin_unlock_irq(& mdev->req_lock); val.i = 0U; val.ldv_38745.conn = 6U; mask.i = 0U; mask.ldv_38745.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 ; struct list_head const *__mptr___0 ; { b = mdev->oldest_tle; pn = & mdev->oldest_tle; goto ldv_50310; ldv_50309: n_writes = 0; n_reads = 0; INIT_LIST_HEAD(& carry_reads); le = b->requests.next; tle = le->next; goto ldv_50302; ldv_50301: __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_50302: ; if ((unsigned long )(& b->requests) != (unsigned long )le) { goto ldv_50301; } else { } tmp = b->next; if (n_writes != 0) { if ((unsigned int )what == 24U) { 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", 467, 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 471); } 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_50308; } else { } *pn = tmp; kfree((void const *)b); } b = tmp; list_splice((struct list_head const *)(& carry_reads), & b->requests); ldv_50310: ; if ((unsigned long )b != (unsigned long )((struct drbd_tl_epoch *)0)) { goto ldv_50309; } else { } ldv_50308: ; switch ((unsigned int )what) { case 25U: ; case 26U: le = mdev->barrier_acked_requests.next; tle = le->next; goto ldv_50316; ldv_50315: __mptr___0 = (struct list_head const *)le; req = (struct drbd_request *)__mptr___0 + 0xffffffffffffffb8UL; _req_mod(req, what); le = tle; tle = le->next; ldv_50316: ; if ((unsigned long )(& mdev->barrier_acked_requests) != (unsigned long )le) { goto ldv_50315; } else { } case 10U: ; case 24U: ; goto ldv_50320; default: dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "what = %d in _tl_restart()\n", (unsigned int )what); } ldv_50320: ; 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 526); } else { } le = mdev->out_of_sequence_requests.next; tle = le->next; goto ldv_50331; ldv_50330: __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_50331: ; if ((unsigned long )(& mdev->out_of_sequence_requests) != (unsigned long )le) { goto ldv_50330; } 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; } } void tl_abort_disk_io(struct drbd_conf *mdev ) { struct drbd_tl_epoch *b ; struct list_head *le ; struct list_head *tle ; struct drbd_request *req ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { spin_lock_irq(& mdev->req_lock); b = mdev->oldest_tle; goto ldv_50351; ldv_50350: le = b->requests.next; tle = le->next; goto ldv_50348; ldv_50347: __mptr = (struct list_head const *)le; req = (struct drbd_request *)__mptr + 0xffffffffffffffb8UL; if ((req->rq_state & 1UL) == 0UL) { goto ldv_50346; } else { } _req_mod(req, abort_disk_io); ldv_50346: le = tle; tle = le->next; ldv_50348: ; if ((unsigned long )(& b->requests) != (unsigned long )le) { goto ldv_50347; } else { } b = b->next; ldv_50351: ; if ((unsigned long )b != (unsigned long )((struct drbd_tl_epoch *)0)) { goto ldv_50350; } else { } le = mdev->barrier_acked_requests.next; tle = le->next; goto ldv_50357; ldv_50356: __mptr___0 = (struct list_head const *)le; req = (struct drbd_request *)__mptr___0 + 0xffffffffffffffb8UL; if ((req->rq_state & 1UL) == 0UL) { goto ldv_50355; } else { } _req_mod(req, abort_disk_io); ldv_50355: le = tle; tle = le->next; ldv_50357: ; if ((unsigned long )(& mdev->barrier_acked_requests) != (unsigned long )le) { goto ldv_50356; } else { } 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_38745.conn > 9 && (int )ns.ldv_38745.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) != 4U && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 4U))) || ((int )os.ldv_38745.conn > 9 && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 16U)) || ((unsigned int )*((unsigned short *)(& os) + 0UL) == 160U && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U)); } } enum drbd_state_rv drbd_change_state(struct drbd_conf *mdev , enum chg_state_flags f , union drbd_state mask , union drbd_state val ) { unsigned long flags ; union drbd_state os ; union drbd_state ns ; enum drbd_state_rv rv ; raw_spinlock_t *tmp ; { tmp = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp); os = mdev->state; ns.i = (os.i & ~ mask.i) | val.i; rv = _drbd_set_state(mdev, ns, f, 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 enum drbd_state_rv is_valid_state(struct drbd_conf *mdev , union drbd_state ns ) ; static enum drbd_state_rv is_valid_state_transition(struct drbd_conf *mdev , union drbd_state ns , union drbd_state os ) ; static union drbd_state sanitize_state(struct drbd_conf *mdev , union drbd_state os , union drbd_state ns , enum sanitize_state_warnings *warn ) ; int drbd_send_state_req(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val ) ; static enum drbd_state_rv _req_st_cond(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val ) { union drbd_state os ; union drbd_state ns ; unsigned long flags ; enum drbd_state_rv rv ; int tmp ; int tmp___0 ; raw_spinlock_t *tmp___1 ; int tmp___2 ; { tmp = test_and_clear_bit(9, (unsigned long volatile *)(& mdev->flags)); if (tmp != 0) { return (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 = SS_UNKNOWN_ERROR; 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 = SS_CW_NO_NEED; } else { } if ((int )rv == 0) { rv = is_valid_state(mdev, ns); if ((int )rv == 1) { rv = is_valid_state_transition(mdev, ns, os); if ((int )rv == 1) { rv = SS_UNKNOWN_ERROR; } else { } } else { } } else { } spin_unlock_irqrestore(& mdev->req_lock, flags); return (rv); } } static enum drbd_state_rv drbd_req_state(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val , enum chg_state_flags f ) { struct completion done ; unsigned long flags ; union drbd_state os ; union drbd_state ns ; enum drbd_state_rv rv ; raw_spinlock_t *tmp ; int tmp___0 ; wait_queue_t __wait ; struct task_struct *tmp___1 ; raw_spinlock_t *tmp___2 ; int tmp___3 ; struct task_struct *tmp___4 ; { init_completion(& done); if (((unsigned int )f & 8U) != 0U) { ldv_mutex_lock_129(& 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___3 = cl_wide_st_chg(mdev, os, ns); if (tmp___3 != 0) { rv = is_valid_state(mdev, ns); if ((int )rv == 1) { rv = is_valid_state_transition(mdev, ns, os); } else { } spin_unlock_irqrestore(& mdev->req_lock, flags); if ((int )rv <= 0) { if (((unsigned int )f & 2U) != 0U) { print_st_err(mdev, os, ns, (int )rv); } else { } goto abort; } else { } drbd_state_lock___0(mdev); tmp___0 = drbd_send_state_req(mdev, mask, val); if (tmp___0 == 0) { drbd_state_unlock(mdev); rv = SS_CW_FAILED_BY_PEER; if (((unsigned int )f & 2U) != 0U) { print_st_err(mdev, os, ns, (int )rv); } else { } goto abort; } else { } rv = _req_st_cond(mdev, mask, val); if ((int )rv != 0) { goto ldv_50432; } 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_50435: prepare_to_wait(& mdev->state_wait, & __wait, 2); rv = _req_st_cond(mdev, mask, val); if ((int )rv != 0) { goto ldv_50434; } else { } schedule(); goto ldv_50435; ldv_50434: finish_wait(& mdev->state_wait, & __wait); ldv_50432: ; if ((int )rv <= 0) { drbd_state_unlock(mdev); if (((unsigned int )f & 2U) != 0U) { print_st_err(mdev, os, ns, (int )rv); } else { } goto abort; } else { } tmp___2 = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp___2); os = mdev->state; ns.i = (os.i & ~ mask.i) | val.i; rv = _drbd_set_state(mdev, ns, f, & done); drbd_state_unlock(mdev); } else { rv = _drbd_set_state(mdev, ns, f, & done); } spin_unlock_irqrestore(& mdev->req_lock, flags); if (((unsigned int )f & 4U) != 0U && (int )rv == 1) { tmp___4 = get_current(); if ((unsigned long )tmp___4 == (unsigned long )mdev->worker.task) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( current != mdev->worker.task ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 754); } else { } wait_for_completion(& done); } else { } abort: ; if (((unsigned int )f & 8U) != 0U) { ldv_mutex_unlock_130(& mdev->state_mutex); } else { } return (rv); } } enum drbd_state_rv _drbd_request_state(struct drbd_conf *mdev , union drbd_state mask , union drbd_state val , enum chg_state_flags f ) { enum drbd_state_rv rv ; wait_queue_t __wait ; struct task_struct *tmp ; { rv = drbd_req_state(mdev, mask, val, f); if ((int )rv != -18) { goto ldv_50446; } 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_50449: prepare_to_wait(& mdev->state_wait, & __wait, 2); rv = drbd_req_state(mdev, mask, val, f); if ((int )rv != -18) { goto ldv_50448; } else { } schedule(); goto ldv_50449; ldv_50448: finish_wait(& mdev->state_wait, & __wait); ldv_50446: ; 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_38745.pdsk); tmp___1 = drbd_disk_str((enum drbd_disk_state )ns.ldv_38745.disk); tmp___2 = drbd_role_str((enum drbd_role )ns.ldv_38745.peer); tmp___3 = drbd_role_str((enum drbd_role )ns.ldv_38745.role); tmp___4 = drbd_conn_str((enum drbd_conns )ns.ldv_38745.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 , enum drbd_state_rv err ) { char const *tmp ; { if ((int )err == -18) { return; } else { } tmp = drbd_set_st_err_str(err); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "State change failed: %s\n", tmp); print_st(mdev, (char *)" state", os); print_st(mdev, (char *)"wanted", ns); return; } } static enum drbd_state_rv is_valid_state(struct drbd_conf *mdev , union drbd_state ns ) { enum drbd_fencing_p fp ; enum drbd_state_rv rv ; int tmp ; int tmp___0 ; { rv = 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 + 540UL) == 0U && (unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U) && (unsigned int )*((unsigned char *)(& ns) + 0UL) == 4U) { rv = SS_TWO_PRIMARIES; } else { } put_net_conf(mdev); } else { } if ((int )rv <= 0) { } else if ((unsigned int )*((unsigned char *)(& ns) + 0UL) == 2U && mdev->open_cnt != 0) { rv = SS_DEVICE_IN_USE; } else if (((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U && (int )ns.ldv_38745.conn <= 9) && (int )ns.ldv_38745.disk <= 7) { rv = SS_NO_UP_TO_DATE_DISK; } else if ((((unsigned int )fp != 0U && (unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U) && (int )ns.ldv_38745.conn <= 9) && (int )ns.ldv_38745.pdsk > 5) { rv = SS_PRIMARY_NOP; } else if (((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U && (int )ns.ldv_38745.disk <= 4) && (int )ns.ldv_38745.pdsk <= 4) { rv = SS_NO_UP_TO_DATE_DISK; } else if ((int )ns.ldv_38745.conn > 10 && (int )ns.ldv_38745.disk <= 3) { rv = SS_NO_LOCAL_DISK; } else if ((int )ns.ldv_38745.conn > 10 && (int )ns.ldv_38745.pdsk <= 3) { rv = SS_NO_REMOTE_DISK; } else if (((int )ns.ldv_38745.conn > 10 && (int )ns.ldv_38745.disk <= 7) && (int )ns.ldv_38745.pdsk <= 7) { rv = SS_NO_UP_TO_DATE_DISK; } 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 = SS_CONNECTED_OUTDATES; } 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 = SS_NO_VERIFY_ALG; } else if (((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 304U) && mdev->agreed_pro_version <= 87) { rv = SS_NOT_SUPPORTED; } else if ((int )ns.ldv_38745.conn > 9 && *((unsigned int *)(& ns) + 0UL) == 49152U) { rv = SS_CONNECTED_OUTDATES; } else { } return (rv); } } static enum drbd_state_rv is_valid_state_transition(struct drbd_conf *mdev , union drbd_state ns , union drbd_state os ) { enum drbd_state_rv rv ; int tmp ; { rv = 1; if (((unsigned int )*((unsigned short *)(& ns) + 0UL) == 192U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 176U) && (int )os.ldv_38745.conn > 10) { rv = SS_RESYNC_RUNNING; } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 16U && (unsigned int )*((unsigned short *)(& os) + 0UL) == 0U) { rv = SS_ALREADY_STANDALONE; } else { } if ((int )ns.ldv_38745.disk > 1 && (unsigned int )*((unsigned char *)(& os) + 1UL) == 0U) { rv = SS_IS_DISKLESS; } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 128U && (int )os.ldv_38745.conn <= 1) { rv = SS_NO_NET_CONFIG; } else { } if (((unsigned int )*((unsigned char *)(& ns) + 1UL) == 10U && (int )os.ldv_38745.disk <= 4) && (unsigned int )*((unsigned char *)(& os) + 1UL) != 2U) { rv = SS_LOWER_THAN_OUTDATED; } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 16U && (unsigned int )*((unsigned short *)(& os) + 0UL) == 32U) { rv = SS_IN_TRANSIENT_STATE; } else { } if ((int )ns.ldv_38745.conn == (int )os.ldv_38745.conn && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 144U) { rv = SS_IN_TRANSIENT_STATE; } else { } tmp = constant_test_bit(30U, (unsigned long const volatile *)(& mdev->flags)); if (tmp != 0 && ((unsigned int )*((unsigned short *)(& os) + 0UL) != 144U && ((unsigned int )*((unsigned short *)(& ns) + 0UL) != 144U || (unsigned int )*((unsigned short *)(& os) + 0UL) != 128U))) { rv = SS_IN_TRANSIENT_STATE; } else { } if (((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 304U) && (int )os.ldv_38745.conn <= 9) { rv = SS_NEED_CONNECTION; } else { } if ((((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 304U) && (int )ns.ldv_38745.conn != (int )os.ldv_38745.conn) && (int )os.ldv_38745.conn > 10) { rv = SS_RESYNC_RUNNING; } else { } if (((unsigned int )*((unsigned short *)(& ns) + 0UL) == 176U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 192U) && (int )os.ldv_38745.conn <= 9) { rv = SS_NEED_CONNECTION; } else { } if (((unsigned int )*((unsigned short *)(& ns) + 0UL) == 272U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 256U) && (int )os.ldv_38745.conn <= 8) { rv = SS_NEED_CONNECTION; } else { } return (rv); } } static void print_sanitize_warnings(struct drbd_conf *mdev , enum sanitize_state_warnings warn ) { char const *msg_table[6U] ; { msg_table[0] = ""; msg_table[1] = "Online-verify aborted."; msg_table[2] = "Resync aborted."; msg_table[3] = "Connection lost while negotiating, no data!"; msg_table[4] = "Implicitly upgraded disk"; msg_table[5] = "Implicitly upgraded pdsk"; if ((unsigned int )warn != 0U) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s\n", msg_table[(unsigned int )warn]); } else { } return; } } static union drbd_state sanitize_state(struct drbd_conf *mdev , union drbd_state os , union drbd_state ns , enum sanitize_state_warnings *warn ) { enum drbd_fencing_p fp ; enum drbd_disk_state disk_min ; enum drbd_disk_state disk_max ; enum drbd_disk_state pdsk_min ; enum drbd_disk_state pdsk_max ; int tmp ; int tmp___0 ; { if ((unsigned long )warn != (unsigned long )((enum sanitize_state_warnings *)0)) { *warn = NO_WARNING; } 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 { } if (((int )ns.ldv_38745.conn > 2 && (int )ns.ldv_38745.conn <= 7) && (int )os.ldv_38745.conn <= 1) { ns.ldv_38745.conn = os.ldv_38745.conn; } else { } if (((((int )os.ldv_38745.conn > 2 && (int )os.ldv_38745.conn <= 7) && (unsigned int )*((unsigned short *)(& ns) + 0UL) != 32U) && (unsigned int )*((unsigned short *)(& ns) + 0UL) != 16U) && (int )ns.ldv_38745.conn <= 10) { ns.ldv_38745.conn = os.ldv_38745.conn; } else { } if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 4U && (unsigned int )*((unsigned char *)(& os) + 1UL) == 0U) { ns.ldv_38745.disk = 0U; } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 16U && (unsigned int )*((unsigned short *)(& ns) + 0UL) != 0U) { ns.ldv_38745.conn = os.ldv_38745.conn; } else { } if ((int )ns.ldv_38745.conn <= 9) { ns.ldv_38745.peer_isp = 0U; ns.ldv_38745.peer = 0U; if ((int )ns.ldv_38745.pdsk > 6 || (int )ns.ldv_38745.pdsk <= 3) { ns.ldv_38745.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_38745.aftr_isp = 0U; } else { } if (((int )os.ldv_38745.conn > 10 && (int )ns.ldv_38745.conn > 10) && ((int )ns.ldv_38745.disk <= 2 || (int )ns.ldv_38745.pdsk <= 2)) { if ((unsigned long )warn != (unsigned long )((enum sanitize_state_warnings *)0)) { *warn = (unsigned int )*((unsigned short *)(& os) + 0UL) == 288U || (unsigned int )*((unsigned short *)(& os) + 0UL) == 304U ? ABORTED_ONLINE_VERIFY : ABORTED_RESYNC; } else { } ns.ldv_38745.conn = 10U; } else { } if ((int )ns.ldv_38745.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_38745.disk = mdev->new_state_tmp.ldv_38745.disk; ns.ldv_38745.pdsk = mdev->new_state_tmp.ldv_38745.pdsk; } else { if ((unsigned long )warn != (unsigned long )((enum sanitize_state_warnings *)0)) { *warn = CONNECTION_LOST_NEGOTIATING; } else { } ns.ldv_38745.disk = 0U; ns.ldv_38745.pdsk = 6U; } put_ldev(mdev); } else { } } else { } if ((int )ns.ldv_38745.conn > 9 && (int )ns.ldv_38745.conn <= 21) { if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 14U || (unsigned int )*((unsigned char *)(& ns) + 1UL) == 10U) { ns.ldv_38745.disk = 8U; } else { } if (*((unsigned int *)(& ns) + 0UL) == 57344U || *((unsigned int *)(& ns) + 0UL) == 40960U) { ns.ldv_38745.pdsk = 8U; } else { } } else { } disk_min = D_DISKLESS; disk_max = D_UP_TO_DATE; pdsk_min = D_INCONSISTENT; pdsk_max = D_UNKNOWN; switch ((unsigned int )ns.ldv_38745.conn) { case 14U: ; case 21U: ; case 12U: ; case 15U: ; case 23U: disk_min = D_INCONSISTENT; disk_max = D_OUTDATED; pdsk_min = D_UP_TO_DATE; pdsk_max = D_UP_TO_DATE; goto ldv_50494; case 18U: ; case 19U: disk_min = D_UP_TO_DATE; disk_max = D_UP_TO_DATE; pdsk_min = D_UP_TO_DATE; pdsk_max = D_UP_TO_DATE; goto ldv_50494; case 10U: disk_min = D_DISKLESS; disk_max = D_UP_TO_DATE; pdsk_min = D_DISKLESS; pdsk_max = D_UP_TO_DATE; goto ldv_50494; case 13U: ; case 20U: ; case 11U: ; case 22U: disk_min = D_UP_TO_DATE; disk_max = D_UP_TO_DATE; pdsk_min = D_INCONSISTENT; pdsk_max = D_CONSISTENT; goto ldv_50494; case 17U: disk_min = D_INCONSISTENT; disk_max = D_INCONSISTENT; pdsk_min = D_UP_TO_DATE; pdsk_max = D_UP_TO_DATE; goto ldv_50494; case 16U: disk_min = D_UP_TO_DATE; disk_max = D_UP_TO_DATE; pdsk_min = D_INCONSISTENT; pdsk_max = D_INCONSISTENT; goto ldv_50494; case 0U: ; case 1U: ; case 2U: ; case 3U: ; case 4U: ; case 5U: ; case 6U: ; case 7U: ; case 8U: ; case 9U: ; case 31U: ; goto ldv_50494; } ldv_50494: ; if ((unsigned int )ns.ldv_38745.disk > (unsigned int )disk_max) { ns.ldv_38745.disk = (unsigned char )disk_max; } else { } if ((unsigned int )ns.ldv_38745.disk < (unsigned int )disk_min) { if ((unsigned long )warn != (unsigned long )((enum sanitize_state_warnings *)0)) { *warn = IMPLICITLY_UPGRADED_DISK; } else { } ns.ldv_38745.disk = (unsigned char )disk_min; } else { } if ((unsigned int )ns.ldv_38745.pdsk > (unsigned int )pdsk_max) { ns.ldv_38745.pdsk = (unsigned char )pdsk_max; } else { } if ((unsigned int )ns.ldv_38745.pdsk < (unsigned int )pdsk_min) { if ((unsigned long )warn != (unsigned long )((enum sanitize_state_warnings *)0)) { *warn = IMPLICITLY_UPGRADED_PDSK; } else { } ns.ldv_38745.pdsk = (unsigned char )pdsk_min; } else { } if (((unsigned int )fp == 2U && (((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U && (int )ns.ldv_38745.conn <= 9) && (int )ns.ldv_38745.pdsk > 5)) && (((unsigned int )*((unsigned char *)(& os) + 0UL) != 1U || (int )os.ldv_38745.conn > 9) || (int )os.ldv_38745.pdsk <= 5)) { ns.ldv_38745.susp_fen = 1U; } else { } if ((mdev->sync_conf.on_no_data == 1 && (((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U && (int )ns.ldv_38745.disk <= 7) && (int )ns.ldv_38745.pdsk <= 7)) && (((unsigned int )*((unsigned char *)(& os) + 0UL) != 1U || (int )os.ldv_38745.disk > 7) || (int )os.ldv_38745.pdsk > 7)) { ns.ldv_38745.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_38745.conn = 20U; } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 272U) { ns.ldv_38745.conn = 21U; } else { } } else { if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 320U) { ns.ldv_38745.conn = 16U; } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 336U) { ns.ldv_38745.conn = 17U; } else { } } return (ns); } } static void set_ov_position(struct drbd_conf *mdev , enum drbd_conns cs ) { unsigned long bit ; { if (mdev->agreed_pro_version <= 89) { mdev->ov_start_sector = 0UL; } else { } mdev->rs_total = drbd_bm_bits(mdev); mdev->ov_position = 0UL; if ((unsigned int )cs == 19U) { mdev->ov_start_sector = 0xffffffffffffffffUL; } else { bit = mdev->ov_start_sector >> 3; if (mdev->rs_total <= bit) { mdev->ov_start_sector = (mdev->rs_total - 1UL) << 3; mdev->rs_total = 1UL; } else { mdev->rs_total = mdev->rs_total - bit; } mdev->ov_position = mdev->ov_start_sector; } mdev->ov_left = mdev->rs_total; return; } } static void drbd_resume_al(struct drbd_conf *mdev ) { int tmp ; { tmp = test_and_clear_bit(28, (unsigned long volatile *)(& mdev->flags)); if (tmp != 0) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Resumed AL updates\n"); } else { } return; } } enum drbd_state_rv __drbd_set_state(struct drbd_conf *mdev , union drbd_state ns , enum chg_state_flags flags , struct completion *done ) { union drbd_state os ; enum drbd_state_rv rv ; enum sanitize_state_warnings ssw ; struct after_state_chg_work *ascw ; enum drbd_state_rv tmp ; char *pbp ; char pb[300U] ; char const *tmp___0 ; char const *tmp___1 ; int tmp___2 ; char const *tmp___3 ; char const *tmp___4 ; int tmp___5 ; char const *tmp___6 ; char const *tmp___7 ; int tmp___8 ; char const *tmp___9 ; char const *tmp___10 ; int tmp___11 ; char const *tmp___12 ; char const *tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; int tmp___17 ; int tmp___18 ; int tmp___19 ; int tmp___20 ; int tmp___21 ; int tmp___22 ; int tmp___23 ; unsigned long tmp___24 ; unsigned long now ; int i ; u32 mdf ; int tmp___25 ; int tmp___26 ; void *tmp___27 ; { rv = 1; os = mdev->state; ns = sanitize_state(mdev, os, ns, & ssw); if (ns.i == os.i) { return (SS_NOTHING_TO_DO); } else { } if (((unsigned int )flags & 1U) == 0U) { rv = is_valid_state(mdev, ns); if ((int )rv <= 0) { tmp = is_valid_state(mdev, os); if ((int )tmp == (int )rv) { rv = is_valid_state_transition(mdev, ns, os); } else { rv = is_valid_state_transition(mdev, ns, os); } } else { } } else { } if ((int )rv <= 0) { if (((unsigned int )flags & 2U) != 0U) { print_st_err(mdev, os, ns, rv); } else { } return (rv); } else { } print_sanitize_warnings(mdev, ssw); pbp = (char *)(& pb); *pbp = 0; if ((int )ns.ldv_38745.role != (int )os.ldv_38745.role) { tmp___0 = drbd_role_str((enum drbd_role )ns.ldv_38745.role); tmp___1 = drbd_role_str((enum drbd_role )os.ldv_38745.role); tmp___2 = sprintf(pbp, "role( %s -> %s ) ", tmp___1, tmp___0); pbp = pbp + (unsigned long )tmp___2; } else { } if ((int )ns.ldv_38745.peer != (int )os.ldv_38745.peer) { tmp___3 = drbd_role_str((enum drbd_role )ns.ldv_38745.peer); tmp___4 = drbd_role_str((enum drbd_role )os.ldv_38745.peer); tmp___5 = sprintf(pbp, "peer( %s -> %s ) ", tmp___4, tmp___3); pbp = pbp + (unsigned long )tmp___5; } else { } if ((int )ns.ldv_38745.conn != (int )os.ldv_38745.conn) { tmp___6 = drbd_conn_str((enum drbd_conns )ns.ldv_38745.conn); tmp___7 = drbd_conn_str((enum drbd_conns )os.ldv_38745.conn); tmp___8 = sprintf(pbp, "conn( %s -> %s ) ", tmp___7, tmp___6); pbp = pbp + (unsigned long )tmp___8; } else { } if ((int )ns.ldv_38745.disk != (int )os.ldv_38745.disk) { tmp___9 = drbd_disk_str((enum drbd_disk_state )ns.ldv_38745.disk); tmp___10 = drbd_disk_str((enum drbd_disk_state )os.ldv_38745.disk); tmp___11 = sprintf(pbp, "disk( %s -> %s ) ", tmp___10, tmp___9); pbp = pbp + (unsigned long )tmp___11; } else { } if ((int )ns.ldv_38745.pdsk != (int )os.ldv_38745.pdsk) { tmp___12 = drbd_disk_str((enum drbd_disk_state )ns.ldv_38745.pdsk); tmp___13 = drbd_disk_str((enum drbd_disk_state )os.ldv_38745.pdsk); tmp___14 = sprintf(pbp, "pdsk( %s -> %s ) ", tmp___13, tmp___12); pbp = pbp + (unsigned long )tmp___14; } else { } tmp___18 = is_susp(ns); tmp___19 = is_susp(os); if (tmp___18 != tmp___19) { tmp___15 = is_susp(ns); tmp___16 = is_susp(os); tmp___17 = sprintf(pbp, "susp( %d -> %d ) ", tmp___16, tmp___15); pbp = pbp + (unsigned long )tmp___17; } else { } if ((int )ns.ldv_38745.aftr_isp != (int )os.ldv_38745.aftr_isp) { tmp___20 = sprintf(pbp, "aftr_isp( %d -> %d ) ", (int )os.ldv_38745.aftr_isp, (int )ns.ldv_38745.aftr_isp); pbp = pbp + (unsigned long )tmp___20; } else { } if ((int )ns.ldv_38745.peer_isp != (int )os.ldv_38745.peer_isp) { tmp___21 = sprintf(pbp, "peer_isp( %d -> %d ) ", (int )os.ldv_38745.peer_isp, (int )ns.ldv_38745.peer_isp); pbp = pbp + (unsigned long )tmp___21; } else { } if ((int )ns.ldv_38745.user_isp != (int )os.ldv_38745.user_isp) { tmp___22 = sprintf(pbp, "user_isp( %d -> %d ) ", (int )os.ldv_38745.user_isp, (int )ns.ldv_38745.user_isp); pbp = pbp + (unsigned long )tmp___22; } else { } _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s\n", (char *)(& pb)); if (((unsigned int )*((unsigned char *)(& ns) + 1UL) == 0U && (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 { } if (((unsigned int )*((unsigned char *)(& os) + 1UL) != 4U && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 4U) || ((unsigned int )*((unsigned char *)(& os) + 1UL) != 0U && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 0U)) { atomic_inc(& mdev->local_cnt); } else { } mdev->state = ns; if ((unsigned int )*((unsigned char *)(& os) + 1UL) == 2U && (int )ns.ldv_38745.disk > 2) { drbd_print_uuids(mdev, "attached to UUIDs"); } else { } __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_38745.conn <= 9) { tmp___24 = drbd_bm_bits(mdev); mdev->ov_start_sector = (tmp___24 - mdev->ov_left) << 3; _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Online Verify reached sector %llu\n", (unsigned long long )mdev->ov_start_sector); } else { } 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; set_ov_position(mdev, (enum drbd_conns )ns.ldv_38745.conn); mdev->rs_start = now; mdev->rs_last_events = 0; mdev->rs_last_sect_ev = 0; mdev->ov_last_oos_size = 0UL; mdev->ov_last_oos_start = 0UL; i = 0; goto ldv_50538; ldv_50537: mdev->rs_mark_left[i] = mdev->ov_left; mdev->rs_mark_time[i] = now; i = i + 1; ldv_50538: ; if (i <= 7) { goto ldv_50537; } else { } drbd_rs_controller_reset(mdev); if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 288U) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Starting Online Verify from sector %llu\n", (unsigned long long )mdev->ov_position); mod_timer(& mdev->resync_timer, jiffies); } else { } } else { } tmp___26 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___26 != 0) { mdf = (mdev->ldev)->md.flags & 4294967176U; tmp___25 = constant_test_bit(11U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___25 != 0) { mdf = mdf | 64U; } else { } if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U || ((int )mdev->state.ldv_38745.pdsk <= 3 && (unsigned int )*((unsigned char *)mdev + 2276UL) == 4U)) { mdf = mdf | 2U; } else { } if ((int )mdev->state.ldv_38745.conn > 9) { mdf = mdf | 4U; } else { } if ((int )mdev->state.ldv_38745.disk > 4) { mdf = mdf | 1U; } else { } if ((int )mdev->state.ldv_38745.disk > 5) { mdf = mdf | 16U; } else { } if ((int )mdev->state.ldv_38745.pdsk <= 5 && (int )mdev->state.ldv_38745.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_38745.disk <= 6 && (int )ns.ldv_38745.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(13U, (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_38745.conn > 8 && (int )ns.ldv_38745.conn <= 7) && (int )ns.ldv_38745.conn > 2) { drbd_thread_restart_nowait(& mdev->receiver); } else { } if ((int )os.ldv_38745.conn <= 9 && (int )ns.ldv_38745.conn > 9) { drbd_resume_al(mdev); } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 144U && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 144U) { mdev->last_reconnect_jif = jiffies; } else { } if (((unsigned int )*((unsigned char *)(& os) + 1UL) == 2U || (unsigned int )*((unsigned char *)(& os) + 1UL) == 6U) && (int )ns.ldv_38745.disk > 3) { mdev->last_reattach_jif = jiffies; } else { } tmp___27 = kmalloc(48UL, 32U); ascw = (struct after_state_chg_work *)tmp___27; if ((unsigned long )ascw != (unsigned long )((struct after_state_chg_work *)0)) { ascw->os = os; ascw->ns = ns; ascw->flags = flags; ascw->w.cb = & w_after_state_ch; ascw->done = done; drbd_queue_work(& mdev->data.work, & ascw->w); } else { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Could not kmalloc an ascw\n"); } return (rv); } } static int w_after_state_ch(struct drbd_conf *mdev , struct drbd_work *w , int unused ) { struct after_state_chg_work *ascw ; struct drbd_work const *__mptr ; { __mptr = (struct drbd_work const *)w; ascw = (struct after_state_chg_work *)__mptr; after_state_ch(mdev, ascw->os, ascw->ns, ascw->flags); if (((unsigned int )ascw->flags & 4U) != 0U) { if ((unsigned long )ascw->done == (unsigned long )((struct completion *)0)) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( ascw->done != NULL ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 1434); } 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_38745.conn = 10U; mask.i = 0U; mask.ldv_38745.conn = 31U; _drbd_request_state(mdev, mask, val, CS_VERBOSE); return; } else { } switch ((int )mdev->state.ldv_38745.conn) { case 12: val___0.i = 0U; val___0.ldv_38745.conn = 15U; mask___0.i = 0U; mask___0.ldv_38745.conn = 31U; _drbd_request_state(mdev, mask___0, val___0, CS_VERBOSE); goto ldv_50562; case 11: drbd_start_resync(mdev, C_SYNC_SOURCE); goto ldv_50562; } ldv_50562: ; return; } } int drbd_bitmap_io_from_worker(struct drbd_conf *mdev , int (*io_fn)(struct drbd_conf * ) , char *why , enum bm_flag flags ) { int rv ; struct task_struct *tmp ; { tmp = get_current(); if ((unsigned long )tmp != (unsigned long )mdev->worker.task) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( current == mdev->worker.task ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 1466); } else { } set_bit(15U, (unsigned long volatile *)(& mdev->flags)); drbd_bm_lock(mdev, why, flags); rv = (*io_fn)(mdev); drbd_bm_unlock(mdev); drbd_resume_io(mdev); return (rv); } } static void after_state_ch(struct drbd_conf *mdev , union drbd_state os , union drbd_state ns , enum chg_state_flags flags ) { enum drbd_fencing_p fp ; enum drbd_req_event what ; union drbd_state nsm ; int tmp ; int tmp___0 ; union drbd_state __ns ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; enum drbd_io_error_p eh ; int was_io_error ; char const *tmp___6 ; char const *tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; { 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_38745.disk > 7) || (int )os.ldv_38745.pdsk > 7) && (((unsigned int )*((unsigned char *)(& ns) + 0UL) == 1U && (int )ns.ldv_38745.disk <= 7) && (int )ns.ldv_38745.pdsk <= 7)) { drbd_khelper(mdev, (char *)"pri-on-incon-degr"); } else { } if ((int )os.ldv_38745.disk <= 3 && (int )ns.ldv_38745.disk > 3) { mod_timer(& mdev->request_timer, (unsigned long )jiffies + 250UL); } else { } nsm.i = 4294967295U; if ((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { if ((int )os.ldv_38745.conn <= 9 && (int )ns.ldv_38745.conn > 9) { what = resend; } else { } if (((unsigned int )*((unsigned char *)(& os) + 1UL) == 2U || (unsigned int )*((unsigned char *)(& os) + 1UL) == 6U) && (int )ns.ldv_38745.disk > 3) { what = restart_frozen_disk_io; } else { } if ((unsigned int )what != 27U) { nsm.ldv_38745.susp_nod = 0U; } else { } } else { } if ((unsigned int )*((unsigned char *)(& ns) + 2UL) != 0U) { if ((int )os.ldv_38745.pdsk > 5 && (int )ns.ldv_38745.pdsk <= 5) { tl_clear(mdev); tmp___0 = constant_test_bit(27U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___0 != 0) { drbd_uuid_new_current(mdev); clear_bit(27, (unsigned long volatile *)(& mdev->flags)); } else { } spin_lock_irq(& mdev->req_lock); __ns.i = mdev->state.i; __ns.ldv_38745.susp_fen = 0U; _drbd_set_state(mdev, __ns, CS_VERBOSE, 0); spin_unlock_irq(& mdev->req_lock); } else { } if ((int )os.ldv_38745.conn <= 9 && (int )ns.ldv_38745.conn > 9) { clear_bit(27, (unsigned long volatile *)(& mdev->flags)); what = resend; nsm.ldv_38745.susp_fen = 0U; } else { } } else { } if ((unsigned int )what != 27U) { 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 )*((unsigned short *)(& os) + 0UL) != 256U && (unsigned int )*((unsigned short *)(& os) + 0UL) != 320U) && ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 256U || (unsigned int )*((unsigned short *)(& ns) + 0UL) == 320U)) && mdev->agreed_pro_version > 95) { tmp___1 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___1 != 0) { drbd_gen_and_send_sync_uuid(mdev); put_ldev(mdev); } else { } } else { } if (*((unsigned int *)(& os) + 0UL) == 0U && (int )ns.ldv_38745.pdsk > 0) { drbd_send_uuids(mdev); drbd_send_state(mdev, ns); } else { } if (((unsigned int )*((unsigned short *)(& os) + 0UL) != 208U && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 208U) && (unsigned int )*((unsigned short *)mdev + 1138UL) == 208U) { drbd_queue_bitmap_io(mdev, & drbd_send_bitmap, 0, (char *)"send_bitmap (WFBitMapS)", BM_LOCKED_TEST_ALLOWED); } else { } if ((((int )os.ldv_38745.pdsk > 3 && *((unsigned int *)(& os) + 0UL) != 49152U) && *((unsigned int *)(& os) + 0UL) != 40960U) && (((int )ns.ldv_38745.pdsk <= 3 || *((unsigned int *)(& ns) + 0UL) == 49152U) || *((unsigned int *)(& ns) + 0UL) == 40960U)) { tmp___3 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___3 != 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_38745.disk > 7) { tmp___2 = is_susp(mdev->state); if (tmp___2 != 0) { set_bit(27U, (unsigned long volatile *)(& mdev->flags)); } else { drbd_uuid_new_current(mdev); drbd_send_uuids(mdev); } } else { } put_ldev(mdev); } else { } } else { } if ((int )ns.ldv_38745.pdsk <= 3) { tmp___4 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___4 != 0) { if ((((unsigned int )*((unsigned char *)(& os) + 0UL) == 8U && (unsigned int )*((unsigned char *)(& ns) + 0UL) == 4U) && (mdev->ldev)->md.uuid[1] == 0ULL) && (int )ns.ldv_38745.disk > 7) { 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_bitmap_io_from_worker(mdev, & drbd_bm_write, (char *)"demote diskless peer", BM_LOCKED_SET_ALLOWED); } else { } put_ldev(mdev); } else { } } else { } if (((unsigned int )*((unsigned char *)(& os) + 0UL) == 1U && (unsigned int )*((unsigned char *)(& ns) + 0UL) == 2U) && (int )mdev->state.ldv_38745.conn <= 10) { tmp___5 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___5 != 0) { drbd_bitmap_io_from_worker(mdev, & drbd_bm_write, (char *)"demote", BM_LOCKED_TEST_ALLOWED); put_ldev(mdev); } else { } } else { } if (((int )ns.ldv_38745.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, ns); } else { } if ((int )ns.ldv_38745.conn > 9 && ((int )os.ldv_38745.aftr_isp != (int )ns.ldv_38745.aftr_isp || (int )os.ldv_38745.user_isp != (int )ns.ldv_38745.user_isp)) { drbd_send_state(mdev, ns); } 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_38745.conn > 9) { drbd_send_state(mdev, ns); } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) != 352U && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 352U) { drbd_send_state(mdev, ns); } 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", BM_LOCKED_TEST_ALLOWED); } else { } if ((((int )os.ldv_38745.conn <= 9 && (int )ns.ldv_38745.conn <= 9) && (int )os.ldv_38745.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", BM_LOCKED_MASK); } else { } if ((unsigned int )*((unsigned char *)(& os) + 1UL) != 4U && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 4U) { eh = EP_PASS_ON; was_io_error = 0; if ((unsigned long )mdev->ldev != (unsigned long )((struct drbd_backing_dev *)0)) { eh = (enum drbd_io_error_p )(mdev->ldev)->dc.on_io_error; was_io_error = test_and_clear_bit(19, (unsigned long volatile *)(& mdev->flags)); tl_abort_disk_io(mdev); if ((unsigned int )*((unsigned char *)mdev + 2277UL) != 4U) { tmp___6 = drbd_disk_str((enum drbd_disk_state )mdev->state.ldv_38745.disk); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: disk is %s during detach\n", tmp___6); } else { } if ((int )ns.ldv_38745.conn > 9) { drbd_send_state(mdev, ns); } else { } drbd_rs_cancel_all(mdev); drbd_md_sync(mdev); } else { } put_ldev(mdev); if (was_io_error != 0 && (unsigned int )eh == 1U) { drbd_khelper(mdev, (char *)"local-io-error"); } else { } } else { } if ((unsigned int )*((unsigned char *)(& os) + 1UL) != 0U && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 0U) { if ((unsigned int )*((unsigned char *)mdev + 2277UL) != 0U) { tmp___7 = drbd_disk_str((enum drbd_disk_state )mdev->state.ldv_38745.disk); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: disk is %s while going diskless\n", tmp___7); } else { } mdev->rs_total = 0UL; mdev->rs_failed = 0UL; atomic_set(& mdev->rs_pending_cnt, 0); if ((int )ns.ldv_38745.conn > 9) { drbd_send_state(mdev, ns); } else { } put_ldev(mdev); } else { } if (((unsigned int )*((unsigned char *)(& os) + 1UL) == 16U && (unsigned int )*((unsigned char *)(& ns) + 1UL) == 8U) && (int )ns.ldv_38745.conn > 9) { drbd_send_state(mdev, ns); } else { } if ((int )ns.ldv_38745.disk > 3 && (int )ns.ldv_38745.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_38745.conn > 10 && (int )ns.ldv_38745.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_38745.disk <= 7 && (int )os.ldv_38745.conn > 15) && (unsigned int )*((unsigned short *)(& ns) + 0UL) == 160U) { drbd_send_state(mdev, ns); } else { } if ((unsigned int )*((unsigned short *)(& os) + 0UL) == 144U && (unsigned int )*((unsigned short *)(& ns) + 0UL) != 144U) { clear_bit(30, (unsigned long volatile *)(& mdev->flags)); __wake_up(& mdev->state_wait, 3U, 1, 0); } else { } if ((int )os.ldv_38745.conn > 10 && (int )ns.ldv_38745.conn <= 10) { tmp___9 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___9 != 0) { drbd_queue_bitmap_io(mdev, & drbd_bm_write_copy_pages, 0, (char *)"write from resync_finished", BM_IS_LOCKED); put_ldev(mdev); } else { } } else { } if ((unsigned int )*((unsigned short *)(& ns) + 0UL) == 0U) { tmp___10 = is_susp(ns); if (tmp___10 == 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_38745.aftr_isp != (int )ns.ldv_38745.aftr_isp) { resume_next_sg(mdev); } else { } tmp___11 = constant_test_bit(23U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___11 != 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_5990.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 ; bool tmp___2 ; int tmp___3 ; struct task_struct *tmp___4 ; unsigned int tmp___5 ; long tmp___6 ; raw_spinlock_t *tmp___7 ; struct task_struct *tmp___8 ; struct task_struct *tmp___9 ; { 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) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 1885); } else { } thi->reset_cpu_mask = 1; thi->t_state = Running; spin_unlock_irqrestore(& thi->t_lock, flags); tmp___4 = get_current(); flush_signals(tmp___4); tmp___5 = mdev_to_minor(mdev); nt = kthread_create_on_node(& drbd_thread_setup, (void *)thi, -1, "drbd%d_%s", tmp___5, me); tmp___6 = IS_ERR((void const *)nt); if (tmp___6 != 0L) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Couldn\'t start thread\n"); module_put(& __this_module); return (0); } else { } tmp___7 = spinlock_check(& thi->t_lock); flags = _raw_spin_lock_irqsave(tmp___7); thi->task = nt; thi->t_state = Running; spin_unlock_irqrestore(& thi->t_lock, flags); wake_up_process(nt); goto ldv_50618; case 2U: thi->t_state = Restarting; tmp___8 = get_current(); tmp___9 = get_current(); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Restarting %s thread (from %s [%d])\n", me, (char *)(& tmp___9->comm), tmp___8->pid); case 1U: ; case 3U: ; default: spin_unlock_irqrestore(& thi->t_lock, flags); goto ldv_50618; } ldv_50618: ; 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_50639; ldv_50638: tmp___2 = ord; ord = ord - 1; if (tmp___2 == 0) { cpumask_set_cpu((unsigned int )cpu, mdev->cpu_mask); return; } else { } ldv_50639: tmp___3 = cpumask_next(cpu, cpu_online_mask); cpu = (int )tmp___3; if (cpu < nr_cpu_ids) { goto ldv_50638; } 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), "ASSERT FAILED: %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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2000); } else { } if (_b != 0) { return; } else { } if (thi->reset_cpu_mask == 0) { return; } else { } thi->reset_cpu_mask = 0; set_cpus_allowed_ptr(p, (struct cpumask const *)mdev->cpu_mask); return; } } int _drbd_send_cmd(struct drbd_conf *mdev , struct socket *sock , enum drbd_packets cmd , struct p_header80 *h , size_t size , unsigned int msg_flags ) { int sent ; int ok ; int _b ; int _b___0 ; __u16 tmp ; __u16 tmp___0 ; char const *tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; { _b = (unsigned long )h == (unsigned long )((struct p_header80 *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "_drbd_send_cmd", (char *)"!h", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2016); } else { } if (_b != 0) { return (0); } else { } _b___0 = size == 0UL; if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "_drbd_send_cmd", (char *)"!size", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2017); } 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___2 = get_current(); tmp___3 = signal_pending(tmp___2); if (tmp___3 == 0) { tmp___1 = cmdname(cmd); dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "short sent %s size=%d sent=%d\n", tmp___1, (int )size, sent); } else { } } else { } return (ok); } } int drbd_send_cmd(struct drbd_conf *mdev , int use_data_socket , enum drbd_packets cmd , struct p_header80 *h , size_t size ) { int ok ; struct socket *sock ; long tmp ; { ok = 0; if (use_data_socket != 0) { ldv_mutex_lock_131(& mdev->data.mutex); sock = mdev->data.socket; } else { ldv_mutex_lock_132(& 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_133(& mdev->data.mutex); } else { ldv_mutex_unlock_134(& 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_135(& 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_136(& mdev->data.mutex); return (rv); } } int drbd_send_protocol(struct drbd_conf *mdev ) { struct p_protocol *p ; int size ; int cf ; int rv ; size_t tmp ; void *tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; __u32 tmp___6 ; { size = 32; if (mdev->agreed_pro_version > 86) { tmp = strlen((char const *)(& (mdev->net_conf)->integrity_alg)); size = (int )(((unsigned int )tmp + (unsigned int )size) + 1U); } else { } tmp___0 = kmalloc((size_t )size, 16U); p = (struct p_protocol *)tmp___0; if ((unsigned long )p == (unsigned long )((struct p_protocol *)0)) { return (0); } else { } tmp___1 = __fswab32((__u32 )(mdev->net_conf)->wire_protocol); p->protocol = tmp___1; tmp___2 = __fswab32((__u32 )(mdev->net_conf)->after_sb_0p); p->after_sb_0p = tmp___2; tmp___3 = __fswab32((__u32 )(mdev->net_conf)->after_sb_1p); p->after_sb_1p = tmp___3; tmp___4 = __fswab32((__u32 )(mdev->net_conf)->after_sb_2p); p->after_sb_2p = tmp___4; tmp___5 = __fswab32((__u32 )(mdev->net_conf)->two_primaries); p->two_primaries = tmp___5; cf = 0; if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) != 0U) { cf = cf | 1; } else { } if ((unsigned int )*((unsigned char *)mdev->net_conf + 540UL) != 0U) { if (mdev->agreed_pro_version > 91) { cf = cf | 2; } else { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "--dry-run is not supported by peer"); kfree((void const *)p); return (-1); } } else { } tmp___6 = __fswab32((__u32 )cf); p->conn_flags = tmp___6; if (mdev->agreed_pro_version > 86) { strcpy((char *)(& p->integrity_alg), (char const *)(& (mdev->net_conf)->integrity_alg)); } else { } rv = drbd_send_cmd(mdev, 1, 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_50705; ldv_50704: ; 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_50705: ; if (i <= 3) { goto ldv_50704; } 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 + 540UL) != 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 + 2273UL) == 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); } } void drbd_print_uuids(struct drbd_conf *mdev , char const *text ) { u64 *uuid ; int tmp ; { tmp = _get_ldev_if_state(mdev, D_NEGOTIATING); if (tmp != 0) { uuid = (u64 *)(& (mdev->ldev)->md.uuid); _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s %016llX:%016llX:%016llX:%016llX\n", text, *uuid, *(uuid + 1UL), *(uuid + 2UL), *(uuid + 3UL)); put_ldev(mdev); } else { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "%s effective data uuid: %016llX\n", text, mdev->ed_uuid); } return; } } int drbd_gen_and_send_sync_uuid(struct drbd_conf *mdev ) { struct p_rs_uuid p ; u64 uuid ; __u64 tmp ; int tmp___0 ; { if ((unsigned int )*((unsigned char *)mdev + 2277UL) != 16U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.disk == D_UP_TO_DATE ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2233); } else { } uuid = (mdev->ldev)->md.uuid[1]; if (uuid != 0ULL && uuid != 4ULL) { uuid = uuid + 281474976710656ULL; } else { get_random_bytes((void *)(& uuid), 8); } drbd_uuid_set(mdev, 1, uuid); drbd_print_uuids(mdev, "updated sync UUID"); drbd_md_sync(mdev); tmp = __fswab64(uuid); p.uuid = tmp; tmp___0 = drbd_send_cmd(mdev, 1, 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 max_bio_size ; int ok ; unsigned int tmp ; int __min1 ; int __min2 ; int tmp___0 ; int __min1___0 ; int __min2___0 ; __u64 tmp___1 ; __u64 tmp___2 ; sector_t tmp___3 ; __u64 tmp___4 ; __u64 tmp___5 ; __u32 tmp___6 ; __u16 tmp___7 ; __u16 tmp___8 ; { tmp___0 = _get_ldev_if_state(mdev, D_NEGOTIATING); if (tmp___0 != 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2257); } else { } d_size = drbd_get_max_capacity___0(mdev->ldev); u_size = (sector_t )(mdev->ldev)->dc.disk_size; q_order_type = drbd_queue_order_type(mdev); tmp = queue_max_hw_sectors((((mdev->ldev)->backing_bdev)->bd_disk)->queue); max_bio_size = (int )(tmp << 9); __min1 = max_bio_size; __min2 = 131072; max_bio_size = __min1 < __min2 ? __min1 : __min2; put_ldev(mdev); } else { d_size = 0UL; u_size = 0UL; q_order_type = 0; max_bio_size = 131072; } if (mdev->agreed_pro_version <= 94) { __min1___0 = max_bio_size; __min2___0 = 32768; max_bio_size = __min1___0 < __min2___0 ? __min1___0 : __min2___0; } else { } tmp___1 = __fswab64((__u64 )d_size); p.d_size = tmp___1; tmp___2 = __fswab64((__u64 )u_size); p.u_size = tmp___2; if (trigger_reply == 0) { tmp___3 = drbd_get_capacity(mdev->this_bdev); tmp___4 = (__u64 )tmp___3; } else { tmp___4 = 0ULL; } tmp___5 = __fswab64(tmp___4); p.c_size = tmp___5; tmp___6 = __fswab32((__u32 )max_bio_size); p.max_bio_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_current_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_137(& 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_138(& mdev->data.mutex); drbd_state_unlock(mdev); return (ok); } } int drbd_send_state(struct drbd_conf *mdev , union drbd_state state ) { struct socket *sock ; struct p_state p ; int ok ; __u32 tmp ; long tmp___0 ; { ok = 0; ldv_mutex_lock_139(& mdev->data.mutex); tmp = __fswab32(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_140(& mdev->data.mutex); 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 , enum drbd_state_rv retcode ) { struct p_req_state_reply p ; __u32 tmp ; int tmp___0 ; { tmp = __fswab32((__u32 )retcode); p.retcode = tmp; tmp___0 = drbd_send_cmd(mdev, 0, 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_50778: ; 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_50776; } 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_50777; } 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_50776: ; if (c->bit_offset < c->bm_bits) { goto ldv_50778; } else { } ldv_50777: len = ((unsigned int )((long )bs.cur.b) - (unsigned int )((long )(& p->code))) + (unsigned int )(bs.cur.bit != 0U); if ((unsigned long )(len << 3) > plain_bits) { c->bit_offset = c->bit_offset - plain_bits; bm_xfer_ctx_bit_to_word_offset(c); c->bit_offset = c->word_offset * 64UL; return (0); } else { } bm_xfer_ctx_bit_to_word_offset(c); DCBP_set_pad_bits(p, (int )(- bs.cur.bit) & 7); return ((int )len); } } static int send_bitmap_rle_or_plain(struct drbd_conf *mdev , struct p_header80 *h , struct bm_xfer_ctx *c ) { struct p_compressed_bm *p ; unsigned long num_words ; int len ; int ok ; size_t __min1 ; size_t __min2 ; { p = (struct p_compressed_bm *)h; len = fill_bitmap_rle_bits(mdev, p, c); if (len < 0) { return (-5); } else { } if (len != 0) { DCBP_set_code(p, 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 { } } if (ok != 0) { if (len == 0) { INFO_bm_xfer_stats(mdev, "send", c); return (0); } else { return (1); } } else { } return (-5); } } int _drbd_send_bitmap(struct drbd_conf *mdev ) { struct bm_xfer_ctx c ; struct p_header80 *p ; int err ; int _b ; unsigned long tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; struct bm_xfer_ctx __constr_expr_0 ; unsigned long tmp___3 ; size_t tmp___4 ; { _b = (unsigned long )mdev->bitmap == (unsigned long )((struct drbd_bitmap *)0); if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "_drbd_send_bitmap", (char *)"!mdev->bitmap", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 2529); } 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_50801: err = send_bitmap_rle_or_plain(mdev, p, & c); if (err > 0) { goto ldv_50801; } else { } free_pages((unsigned long )p, 0U); return (err == 0); } } int drbd_send_bitmap(struct drbd_conf *mdev ) { int err ; int tmp ; int tmp___0 ; { tmp = drbd_get_data_sock___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_38745.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_38745.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_47524.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_141(& 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_142(& 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_38745.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___2(); oldfs = tmp->addr_limit; len = (int )size; if ((int )disable_sendpage) { 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((struct page const *)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___2(); __constr_expr_0.seg = 0xffffffffffffffffUL; tmp___3->addr_limit = __constr_expr_0; ldv_50900: 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_50897; } else { goto ldv_50898; } } 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_50897; } else { } len = len - sent; offset = offset + sent; ldv_50898: ; if (len > 0) { goto ldv_50900; } else { } ldv_50897: tmp___6 = current_thread_info___2(); 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 + (unsigned long )bio->bi_idx; i = (int )bio->bi_idx; goto ldv_50908; ldv_50907: 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_50908: ; if ((int )bio->bi_vcnt > i) { goto ldv_50907; } 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 + (unsigned long )bio->bi_idx; i = (int )bio->bi_idx; goto ldv_50917; ldv_50916: 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_50917: ; if ((int )bio->bi_vcnt > i) { goto ldv_50916; } 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_50931; ldv_50930: __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_50931: ; 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_50930; } else { goto ldv_50932; } } else { } ldv_50932: ; 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 & 16UL) != 0UL ? 2 : 0) | ((bi_rw & 1024UL) != 0UL ? 16 : 0)) | ((bi_rw & 2048UL) != 0UL ? 32 : 0)) | ((bi_rw & 128UL) != 0UL ? 64 : 0))); } else { return ((bi_rw & 16UL) != 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 ; int tmp___8 ; unsigned char digest[64U] ; int tmp___9 ; { 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); 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_38745.conn > 15 && (int )mdev->state.ldv_38745.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); tmp___8 = drbd_send(mdev, mdev->data.socket, dgb, (size_t )dgs, 0U); ok = tmp___8 == dgs; } else { } if (ok != 0) { if ((mdev->net_conf)->wire_protocol == 1 || dgs != 0) { ok = _drbd_send_bio(mdev, req->master_bio); } else { ok = _drbd_send_zc_bio(mdev, req->master_bio); } if (dgs > 0 && dgs <= 64) { drbd_csum_bio(mdev, mdev->integrity_w_tfm, req->master_bio, (void *)(& digest)); tmp___9 = memcmp((void const *)mdev->int_dig_out, (void const *)(& digest), (size_t )dgs); if (tmp___9 != 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Digest mismatch, buffer modified by upper layers during write: %llus +%u\n", (unsigned long long )req->sector, req->size); } else { } } else { } } else { } 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 ; int tmp___7 ; { 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_47524.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); tmp___7 = drbd_send(mdev, mdev->data.socket, dgb, (size_t )dgs, 0U); ok = tmp___7 == dgs; } else { } if (ok != 0) { ok = _drbd_send_zc_ee(mdev, e); } else { } drbd_put_data_sock___0(mdev); return (ok); } } int drbd_send_oos(struct drbd_conf *mdev , struct drbd_request *req ) { struct p_block_desc p ; __u64 tmp ; __u32 tmp___0 ; int tmp___1 ; { tmp = __fswab64((__u64 )req->sector); p.sector = tmp; tmp___0 = __fswab32(req->size); p.blksize = tmp___0; tmp___1 = drbd_send_cmd(mdev, 1, P_OUT_OF_SYNC, & p.head, 24UL); return (tmp___1); } } int drbd_send(struct drbd_conf *mdev , struct socket *sock , void *buf , size_t size , unsigned int msg_flags ) { struct kvec iov ; struct msghdr msg ; int rv ; int sent ; int tmp ; struct task_struct *tmp___0 ; 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_50974: rv = kernel_sendmsg(sock, & msg, & iov, 1UL, size); if (rv == -11) { tmp = we_should_drop_the_connection(mdev, sock); if (tmp != 0) { goto ldv_50972; } else { goto ldv_50973; } } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3087); } else { } if (rv == -4) { tmp___0 = get_current(); flush_signals(tmp___0); rv = 0; } else { } if (rv < 0) { goto ldv_50972; } else { } sent = sent + rv; iov.iov_base = iov.iov_base + (unsigned long )rv; iov.iov_len = iov.iov_len - (size_t )rv; ldv_50973: ; if ((size_t )sent < size) { goto ldv_50974; } else { } ldv_50972: ; 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_38745.conn = 4U; mask.i = 0U; mask.ldv_38745.conn = 31U; drbd_force_state(mdev, mask, val); } else { val___0.i = 0U; val___0.ldv_38745.conn = 3U; mask___0.i = 0U; mask___0.ldv_38745.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_143(& drbd_main_mutex); tmp = spinlock_check(& mdev->req_lock); flags = _raw_spin_lock_irqsave(tmp); if ((unsigned int )*((unsigned char *)mdev + 2276UL) != 1U) { if ((mode & 2U) != 0U) { rv = -30; } else if (! allow_oos) { 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_144(& 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_145(& drbd_main_mutex); mdev->open_cnt = mdev->open_cnt - 1; ldv_mutex_unlock_146(& drbd_main_mutex); return (0); } } static void drbd_set_defaults(struct drbd_conf *mdev ) { struct syncer_conf __constr_expr_0 ; union drbd_state __constr_expr_1 ; { __constr_expr_0.rate = 250; __constr_expr_0.after = -1; __constr_expr_0.al_extents = 127; __constr_expr_0.verify_alg[0] = (unsigned char)0; __constr_expr_0.verify_alg[1] = (unsigned char)0; __constr_expr_0.verify_alg[2] = (unsigned char)0; __constr_expr_0.verify_alg[3] = (unsigned char)0; __constr_expr_0.verify_alg[4] = (unsigned char)0; __constr_expr_0.verify_alg[5] = (unsigned char)0; __constr_expr_0.verify_alg[6] = (unsigned char)0; __constr_expr_0.verify_alg[7] = (unsigned char)0; __constr_expr_0.verify_alg[8] = (unsigned char)0; __constr_expr_0.verify_alg[9] = (unsigned char)0; __constr_expr_0.verify_alg[10] = (unsigned char)0; __constr_expr_0.verify_alg[11] = (unsigned char)0; __constr_expr_0.verify_alg[12] = (unsigned char)0; __constr_expr_0.verify_alg[13] = (unsigned char)0; __constr_expr_0.verify_alg[14] = (unsigned char)0; __constr_expr_0.verify_alg[15] = (unsigned char)0; __constr_expr_0.verify_alg[16] = (unsigned char)0; __constr_expr_0.verify_alg[17] = (unsigned char)0; __constr_expr_0.verify_alg[18] = (unsigned char)0; __constr_expr_0.verify_alg[19] = (unsigned char)0; __constr_expr_0.verify_alg[20] = (unsigned char)0; __constr_expr_0.verify_alg[21] = (unsigned char)0; __constr_expr_0.verify_alg[22] = (unsigned char)0; __constr_expr_0.verify_alg[23] = (unsigned char)0; __constr_expr_0.verify_alg[24] = (unsigned char)0; __constr_expr_0.verify_alg[25] = (unsigned char)0; __constr_expr_0.verify_alg[26] = (unsigned char)0; __constr_expr_0.verify_alg[27] = (unsigned char)0; __constr_expr_0.verify_alg[28] = (unsigned char)0; __constr_expr_0.verify_alg[29] = (unsigned char)0; __constr_expr_0.verify_alg[30] = (unsigned char)0; __constr_expr_0.verify_alg[31] = (unsigned char)0; __constr_expr_0.verify_alg[32] = (unsigned char)0; __constr_expr_0.verify_alg[33] = (unsigned char)0; __constr_expr_0.verify_alg[34] = (unsigned char)0; __constr_expr_0.verify_alg[35] = (unsigned char)0; __constr_expr_0.verify_alg[36] = (unsigned char)0; __constr_expr_0.verify_alg[37] = (unsigned char)0; __constr_expr_0.verify_alg[38] = (unsigned char)0; __constr_expr_0.verify_alg[39] = (unsigned char)0; __constr_expr_0.verify_alg[40] = (unsigned char)0; __constr_expr_0.verify_alg[41] = (unsigned char)0; __constr_expr_0.verify_alg[42] = (unsigned char)0; __constr_expr_0.verify_alg[43] = (unsigned char)0; __constr_expr_0.verify_alg[44] = (unsigned char)0; __constr_expr_0.verify_alg[45] = (unsigned char)0; __constr_expr_0.verify_alg[46] = (unsigned char)0; __constr_expr_0.verify_alg[47] = (unsigned char)0; __constr_expr_0.verify_alg[48] = (unsigned char)0; __constr_expr_0.verify_alg[49] = (unsigned char)0; __constr_expr_0.verify_alg[50] = (unsigned char)0; __constr_expr_0.verify_alg[51] = (unsigned char)0; __constr_expr_0.verify_alg[52] = (unsigned char)0; __constr_expr_0.verify_alg[53] = (unsigned char)0; __constr_expr_0.verify_alg[54] = (unsigned char)0; __constr_expr_0.verify_alg[55] = (unsigned char)0; __constr_expr_0.verify_alg[56] = (unsigned char)0; __constr_expr_0.verify_alg[57] = (unsigned char)0; __constr_expr_0.verify_alg[58] = (unsigned char)0; __constr_expr_0.verify_alg[59] = (unsigned char)0; __constr_expr_0.verify_alg[60] = (unsigned char)0; __constr_expr_0.verify_alg[61] = (unsigned char)0; __constr_expr_0.verify_alg[62] = (unsigned char)0; __constr_expr_0.verify_alg[63] = (unsigned char)0; __constr_expr_0.verify_alg_len = 0; __constr_expr_0.cpu_mask[0] = (unsigned char)0; __constr_expr_0.cpu_mask[1] = (unsigned char)0; __constr_expr_0.cpu_mask[2] = (unsigned char)0; __constr_expr_0.cpu_mask[3] = (unsigned char)0; __constr_expr_0.cpu_mask[4] = (unsigned char)0; __constr_expr_0.cpu_mask[5] = (unsigned char)0; __constr_expr_0.cpu_mask[6] = (unsigned char)0; __constr_expr_0.cpu_mask[7] = (unsigned char)0; __constr_expr_0.cpu_mask[8] = (unsigned char)0; __constr_expr_0.cpu_mask[9] = (unsigned char)0; __constr_expr_0.cpu_mask[10] = (unsigned char)0; __constr_expr_0.cpu_mask[11] = (unsigned char)0; __constr_expr_0.cpu_mask[12] = (unsigned char)0; __constr_expr_0.cpu_mask[13] = (unsigned char)0; __constr_expr_0.cpu_mask[14] = (unsigned char)0; __constr_expr_0.cpu_mask[15] = (unsigned char)0; __constr_expr_0.cpu_mask[16] = (unsigned char)0; __constr_expr_0.cpu_mask[17] = (unsigned char)0; __constr_expr_0.cpu_mask[18] = (unsigned char)0; __constr_expr_0.cpu_mask[19] = (unsigned char)0; __constr_expr_0.cpu_mask[20] = (unsigned char)0; __constr_expr_0.cpu_mask[21] = (unsigned char)0; __constr_expr_0.cpu_mask[22] = (unsigned char)0; __constr_expr_0.cpu_mask[23] = (unsigned char)0; __constr_expr_0.cpu_mask[24] = (unsigned char)0; __constr_expr_0.cpu_mask[25] = (unsigned char)0; __constr_expr_0.cpu_mask[26] = (unsigned char)0; __constr_expr_0.cpu_mask[27] = (unsigned char)0; __constr_expr_0.cpu_mask[28] = (unsigned char)0; __constr_expr_0.cpu_mask[29] = (unsigned char)0; __constr_expr_0.cpu_mask[30] = (unsigned char)0; __constr_expr_0.cpu_mask[31] = (unsigned char)0; __constr_expr_0.cpu_mask_len = 0; __constr_expr_0.csums_alg[0] = (unsigned char)0; __constr_expr_0.csums_alg[1] = (unsigned char)0; __constr_expr_0.csums_alg[2] = (unsigned char)0; __constr_expr_0.csums_alg[3] = (unsigned char)0; __constr_expr_0.csums_alg[4] = (unsigned char)0; __constr_expr_0.csums_alg[5] = (unsigned char)0; __constr_expr_0.csums_alg[6] = (unsigned char)0; __constr_expr_0.csums_alg[7] = (unsigned char)0; __constr_expr_0.csums_alg[8] = (unsigned char)0; __constr_expr_0.csums_alg[9] = (unsigned char)0; __constr_expr_0.csums_alg[10] = (unsigned char)0; __constr_expr_0.csums_alg[11] = (unsigned char)0; __constr_expr_0.csums_alg[12] = (unsigned char)0; __constr_expr_0.csums_alg[13] = (unsigned char)0; __constr_expr_0.csums_alg[14] = (unsigned char)0; __constr_expr_0.csums_alg[15] = (unsigned char)0; __constr_expr_0.csums_alg[16] = (unsigned char)0; __constr_expr_0.csums_alg[17] = (unsigned char)0; __constr_expr_0.csums_alg[18] = (unsigned char)0; __constr_expr_0.csums_alg[19] = (unsigned char)0; __constr_expr_0.csums_alg[20] = (unsigned char)0; __constr_expr_0.csums_alg[21] = (unsigned char)0; __constr_expr_0.csums_alg[22] = (unsigned char)0; __constr_expr_0.csums_alg[23] = (unsigned char)0; __constr_expr_0.csums_alg[24] = (unsigned char)0; __constr_expr_0.csums_alg[25] = (unsigned char)0; __constr_expr_0.csums_alg[26] = (unsigned char)0; __constr_expr_0.csums_alg[27] = (unsigned char)0; __constr_expr_0.csums_alg[28] = (unsigned char)0; __constr_expr_0.csums_alg[29] = (unsigned char)0; __constr_expr_0.csums_alg[30] = (unsigned char)0; __constr_expr_0.csums_alg[31] = (unsigned char)0; __constr_expr_0.csums_alg[32] = (unsigned char)0; __constr_expr_0.csums_alg[33] = (unsigned char)0; __constr_expr_0.csums_alg[34] = (unsigned char)0; __constr_expr_0.csums_alg[35] = (unsigned char)0; __constr_expr_0.csums_alg[36] = (unsigned char)0; __constr_expr_0.csums_alg[37] = (unsigned char)0; __constr_expr_0.csums_alg[38] = (unsigned char)0; __constr_expr_0.csums_alg[39] = (unsigned char)0; __constr_expr_0.csums_alg[40] = (unsigned char)0; __constr_expr_0.csums_alg[41] = (unsigned char)0; __constr_expr_0.csums_alg[42] = (unsigned char)0; __constr_expr_0.csums_alg[43] = (unsigned char)0; __constr_expr_0.csums_alg[44] = (unsigned char)0; __constr_expr_0.csums_alg[45] = (unsigned char)0; __constr_expr_0.csums_alg[46] = (unsigned char)0; __constr_expr_0.csums_alg[47] = (unsigned char)0; __constr_expr_0.csums_alg[48] = (unsigned char)0; __constr_expr_0.csums_alg[49] = (unsigned char)0; __constr_expr_0.csums_alg[50] = (unsigned char)0; __constr_expr_0.csums_alg[51] = (unsigned char)0; __constr_expr_0.csums_alg[52] = (unsigned char)0; __constr_expr_0.csums_alg[53] = (unsigned char)0; __constr_expr_0.csums_alg[54] = (unsigned char)0; __constr_expr_0.csums_alg[55] = (unsigned char)0; __constr_expr_0.csums_alg[56] = (unsigned char)0; __constr_expr_0.csums_alg[57] = (unsigned char)0; __constr_expr_0.csums_alg[58] = (unsigned char)0; __constr_expr_0.csums_alg[59] = (unsigned char)0; __constr_expr_0.csums_alg[60] = (unsigned char)0; __constr_expr_0.csums_alg[61] = (unsigned char)0; __constr_expr_0.csums_alg[62] = (unsigned char)0; __constr_expr_0.csums_alg[63] = (unsigned char)0; __constr_expr_0.csums_alg_len = 0; __constr_expr_0.use_rle = 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_38745.role = 2U; __constr_expr_1.ldv_38745.peer = 0U; __constr_expr_1.ldv_38745.conn = 0U; __constr_expr_1.ldv_38745.disk = 0U; __constr_expr_1.ldv_38745.pdsk = 6U; __constr_expr_1.ldv_38745.susp = 0U; __constr_expr_1.ldv_38745.aftr_isp = (unsigned char)0; __constr_expr_1.ldv_38745.peer_isp = (unsigned char)0; __constr_expr_1.ldv_38745.user_isp = (unsigned char)0; __constr_expr_1.ldv_38745.susp_nod = 0U; __constr_expr_1.ldv_38745.susp_fen = 0U; __constr_expr_1.ldv_38745._pad = (unsigned short)0; mdev->state = __constr_expr_1; return; } } void drbd_init_set_defaults(struct drbd_conf *mdev ) { struct lock_class_key __key ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; struct lock_class_key __key___2 ; struct lock_class_key __key___3 ; struct lock_class_key __key___4 ; struct lock_class_key __key___5 ; struct lock_class_key __key___6 ; struct lock_class_key __key___7 ; struct lock_class_key __key___8 ; struct lock_class_key __key___9 ; struct lock_class_key __key___10 ; struct lock_class_key __key___11 ; struct lock_class_key __key___12 ; struct lock_class_key __key___13 ; struct lock_class_key __key___14 ; struct lock_class_key __key___15 ; struct lock_class_key __key___16 ; struct lock_class_key __key___17 ; { drbd_set_defaults(mdev); atomic_set(& mdev->ap_bio_cnt, 0); atomic_set(& mdev->ap_pending_cnt, 0); atomic_set(& mdev->rs_pending_cnt, 0); atomic_set(& mdev->unacked_cnt, 0); atomic_set(& mdev->local_cnt, 0); atomic_set(& mdev->net_cnt, 0); atomic_set(& mdev->packet_seq, 0); atomic_set(& mdev->pp_in_use, 0); atomic_set(& mdev->pp_in_use_by_net, 0); atomic_set(& mdev->rs_sect_in, 0); atomic_set(& mdev->rs_sect_ev, 0); atomic_set(& mdev->ap_in_flight, 0); atomic_set(& mdev->md_io_in_use, 0); __mutex_init(& mdev->data.mutex, "&mdev->data.mutex", & __key); __mutex_init(& mdev->meta.mutex, "&mdev->meta.mutex", & __key___0); sema_init(& mdev->data.work.s, 0); sema_init(& mdev->meta.work.s, 0); __mutex_init(& mdev->state_mutex, "&mdev->state_mutex", & __key___1); spinlock_check(& mdev->data.work.q_lock); __raw_spin_lock_init(& mdev->data.work.q_lock.ldv_5990.rlock, "&(&mdev->data.work.q_lock)->rlock", & __key___2); spinlock_check(& mdev->meta.work.q_lock); __raw_spin_lock_init(& mdev->meta.work.q_lock.ldv_5990.rlock, "&(&mdev->meta.work.q_lock)->rlock", & __key___3); spinlock_check(& mdev->al_lock); __raw_spin_lock_init(& mdev->al_lock.ldv_5990.rlock, "&(&mdev->al_lock)->rlock", & __key___4); spinlock_check(& mdev->req_lock); __raw_spin_lock_init(& mdev->req_lock.ldv_5990.rlock, "&(&mdev->req_lock)->rlock", & __key___5); spinlock_check(& mdev->peer_seq_lock); __raw_spin_lock_init(& mdev->peer_seq_lock.ldv_5990.rlock, "&(&mdev->peer_seq_lock)->rlock", & __key___6); spinlock_check(& mdev->epoch_lock); __raw_spin_lock_init(& mdev->epoch_lock.ldv_5990.rlock, "&(&mdev->epoch_lock)->rlock", & __key___7); INIT_LIST_HEAD(& mdev->active_ee); INIT_LIST_HEAD(& mdev->sync_ee); INIT_LIST_HEAD(& mdev->done_ee); INIT_LIST_HEAD(& mdev->read_ee); INIT_LIST_HEAD(& mdev->net_ee); INIT_LIST_HEAD(& mdev->resync_reads); INIT_LIST_HEAD(& mdev->data.work.q); INIT_LIST_HEAD(& mdev->meta.work.q); INIT_LIST_HEAD(& mdev->resync_work.list); INIT_LIST_HEAD(& mdev->unplug_work.list); INIT_LIST_HEAD(& mdev->go_diskless.list); INIT_LIST_HEAD(& mdev->md_sync_work.list); INIT_LIST_HEAD(& mdev->start_resync_work.list); INIT_LIST_HEAD(& mdev->bm_io_work.w.list); mdev->resync_work.cb = & w_resync_timer; mdev->unplug_work.cb = & w_send_write_hint; mdev->go_diskless.cb = & w_go_diskless; mdev->md_sync_work.cb = & w_md_sync; mdev->bm_io_work.w.cb = & w_bitmap_io; mdev->start_resync_work.cb = & w_start_resync; init_timer_key(& mdev->resync_timer, "&mdev->resync_timer", & __key___8); init_timer_key(& mdev->md_sync_timer, "&mdev->md_sync_timer", & __key___9); init_timer_key(& mdev->start_resync_timer, "&mdev->start_resync_timer", & __key___10); init_timer_key(& mdev->request_timer, "&mdev->request_timer", & __key___11); mdev->resync_timer.function = & resync_timer_fn; mdev->resync_timer.data = (unsigned long )mdev; mdev->md_sync_timer.function = & md_sync_timer_fn; mdev->md_sync_timer.data = (unsigned long )mdev; mdev->start_resync_timer.function = & start_resync_timer_fn; mdev->start_resync_timer.data = (unsigned long )mdev; mdev->request_timer.function = & request_timer_fn; mdev->request_timer.data = (unsigned long )mdev; __init_waitqueue_head(& mdev->misc_wait, "&mdev->misc_wait", & __key___12); __init_waitqueue_head(& mdev->state_wait, "&mdev->state_wait", & __key___13); __init_waitqueue_head(& mdev->net_cnt_wait, "&mdev->net_cnt_wait", & __key___14); __init_waitqueue_head(& mdev->ee_wait, "&mdev->ee_wait", & __key___15); __init_waitqueue_head(& mdev->al_wait, "&mdev->al_wait", & __key___16); __init_waitqueue_head(& mdev->seq_wait, "&mdev->seq_wait", & __key___17); drbd_thread_init(mdev, & mdev->receiver, & drbdd_init); drbd_thread_init(mdev, & mdev->worker, & drbd_worker); drbd_thread_init(mdev, & mdev->asender, & drbd_asender); mdev->agreed_pro_version = 96; mdev->write_ordering = WO_bdev_flush; mdev->resync_wenr = 4294967295U; mdev->peer_max_bio_size = 4096; mdev->local_max_bio_size = 4096; return; } } void drbd_mdev_cleanup(struct drbd_conf *mdev ) { int i ; int tmp ; int tmp___0 ; unsigned int tmp___1 ; unsigned int tmp___2 ; unsigned int tmp___3 ; unsigned int tmp___4 ; unsigned int tmp___5 ; sector_t tmp___6 ; unsigned long tmp___7 ; unsigned long tmp___8 ; unsigned long tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; int tmp___17 ; int tmp___18 ; int tmp___19 ; int tmp___20 ; { if ((unsigned int )mdev->receiver.t_state != 0U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: receiver t_state == %d expected 0.\n", (unsigned int )mdev->receiver.t_state); } else { } tmp___0 = atomic_read((atomic_t const *)(& (mdev->current_epoch)->epoch_size)); if (tmp___0 != 0) { tmp = atomic_read((atomic_t const *)(& (mdev->current_epoch)->epoch_size)); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "epoch_size:%d\n", tmp); } else { } tmp___9 = 0UL; mdev->rs_failed = tmp___9; tmp___8 = tmp___9; mdev->rs_total = tmp___8; tmp___7 = tmp___8; mdev->rs_start = tmp___7; tmp___6 = tmp___7; mdev->p_size = tmp___6; tmp___5 = (unsigned int )tmp___6; mdev->writ_cnt = tmp___5; tmp___4 = tmp___5; mdev->send_cnt = tmp___4; tmp___3 = tmp___4; mdev->recv_cnt = tmp___3; tmp___2 = tmp___3; mdev->read_cnt = tmp___2; tmp___1 = tmp___2; mdev->bm_writ_cnt = tmp___1; mdev->al_writ_cnt = tmp___1; mdev->rs_last_events = 0; mdev->rs_last_sect_ev = 0; i = 0; goto ldv_51030; ldv_51029: mdev->rs_mark_left[i] = 0UL; mdev->rs_mark_time[i] = 0UL; i = i + 1; ldv_51030: ; if (i <= 7) { goto ldv_51029; } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3297); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3313); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3314); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3315); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3316); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3317); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3318); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3319); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3320); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3321); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3322); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3323); } else { } drbd_set_defaults(mdev); return; } } static void drbd_destroy_mempools(void) { struct page *page ; { goto ldv_51037; ldv_51036: page = drbd_pp_pool; drbd_pp_pool = (struct page *)page->ldv_12914.private; __free_pages(page, 0U); drbd_pp_vacant = drbd_pp_vacant - 1; ldv_51037: ; if ((unsigned long )drbd_pp_pool != (unsigned long )((struct page *)0)) { goto ldv_51036; } else { } if ((unsigned long )drbd_md_io_bio_set != (unsigned long )((struct bio_set *)0)) { bioset_free(drbd_md_io_bio_set); } else { } if ((unsigned long )drbd_md_io_page_pool != (unsigned long )((mempool_t *)0)) { mempool_destroy(drbd_md_io_page_pool); } 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_md_io_bio_set = 0; drbd_md_io_page_pool = 0; 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_md_io_page_pool = 0; drbd_md_io_bio_set = 0; drbd_request_cache = kmem_cache_create("drbd_req", 112UL, 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_md_io_page_pool = mempool_create_page_pool(128, 0); if ((unsigned long )drbd_md_io_page_pool == (unsigned long )((mempool_t *)0)) { goto Enomem; } else { } drbd_request_mempool = mempool_create(number, & mempool_alloc_slab, & mempool_free_slab, (void *)drbd_request_cache); if ((unsigned long )drbd_request_mempool == (unsigned long )((mempool_t *)0)) { goto Enomem; } else { } drbd_ee_mempool = mempool_create(number, & mempool_alloc_slab, & mempool_free_slab, (void *)drbd_ee_cache); if ((unsigned long )drbd_ee_mempool == (unsigned long )((mempool_t *)0)) { goto Enomem; } else { } spinlock_check(& drbd_pp_lock); __raw_spin_lock_init(& drbd_pp_lock.ldv_5990.rlock, "&(&drbd_pp_lock)->rlock", & __key); i = 0; goto ldv_51048; ldv_51047: page = alloc_pages(131282U, 0U); if ((unsigned long )page == (unsigned long )((struct page *)0)) { goto Enomem; } else { } page->ldv_12914.private = (unsigned long )drbd_pp_pool; drbd_pp_pool = page; i = i + 1; ldv_51048: ; if (i < number) { goto ldv_51047; } 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 { } del_timer_sync(& mdev->request_timer); 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3501); } else { } tmp___0 = list_empty((struct list_head const *)(& mdev->data.work.q)); _b = tmp___0 == 0; if (_b != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_delete_device", (char *)"!list_empty(&mdev->data.work.q)", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3503); } else { } if (_b != 0) { lp = mdev->data.work.q.next; goto ldv_51069; ldv_51068: dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "lp = %p\n", lp); lp = lp->next; ldv_51069: ; if ((unsigned long )(& mdev->data.work.q) != (unsigned long )lp) { goto ldv_51068; } 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); if ((unsigned long )drbd_proc != (unsigned long )((struct proc_dir_entry *)0)) { remove_proc_entry("drbd", 0); } else { } drbd_nl_cleanup(); if ((unsigned long )minor_table != (unsigned long )((struct drbd_conf **)0)) { i = minor_count; goto ldv_51076; ldv_51075: drbd_delete_device(i); ldv_51076: tmp = i; i = i - 1U; if (tmp != 0U) { goto ldv_51075; } 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 ; bool tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { mdev = (struct drbd_conf *)congested_data; reason = 45; r = 0; tmp = may_inc_ap_bio___0(mdev); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { r = bdi_bits; reason = 100; goto out; } else { } tmp___1 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___1 != 0) { q = bdev_get_queue((mdev->ldev)->backing_bdev); r = bdi_congested(& q->backing_dev_info, bdi_bits); put_ldev(mdev); if (r != 0) { reason = 98; } else { } } else { } if ((bdi_bits & 4) != 0) { tmp___2 = constant_test_bit(21U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___2 != 0) { r = r | 4; 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(4728UL, 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); blk_queue_max_hw_sectors(q, 16U); blk_queue_bounce_limit(q, 0xffffffffffffffffULL); blk_queue_merge_bvec(q, & drbd_merge_bvec); q->queue_lock = & mdev->req_lock; mdev->md_io_page = alloc_pages(208U, 0U); if ((unsigned long )mdev->md_io_page == (unsigned long )((struct page *)0)) { goto out_no_io_page; } else { } tmp___2 = drbd_bm_init(mdev); if (tmp___2 != 0) { goto out_no_bitmap; } else { } tmp___3 = tl_init(mdev); if (tmp___3 == 0) { goto out_no_tl; } else { } tmp___4 = kzalloc(120UL, 208U); mdev->app_reads_hash = (struct hlist_head *)tmp___4; if ((unsigned long )mdev->app_reads_hash == (unsigned long )((struct hlist_head *)0)) { goto out_no_app_reads; } else { } tmp___5 = kzalloc(40UL, 208U); mdev->current_epoch = (struct drbd_epoch *)tmp___5; if ((unsigned long )mdev->current_epoch == (unsigned long )((struct drbd_epoch *)0)) { goto out_no_epoch; } else { } INIT_LIST_HEAD(& (mdev->current_epoch)->list); mdev->epochs = 1U; return (mdev); out_no_epoch: kfree((void const *)mdev->app_reads_hash); out_no_app_reads: tl_cleanup(mdev); out_no_tl: drbd_bm_cleanup(mdev); out_no_bitmap: __free_pages(mdev->md_io_page, 0U); out_no_io_page: put_disk(disk); out_no_disk: blk_cleanup_queue(q); out_no_q: free_cpumask_var(mdev->cpu_mask); out_no_cpumask: kfree((void const *)mdev); return (0); } } void drbd_free_mdev(struct drbd_conf *mdev ) { { kfree((void const *)mdev->current_epoch); kfree((void const *)mdev->app_reads_hash); tl_cleanup(mdev); if ((unsigned long )mdev->bitmap != (unsigned long )((struct drbd_bitmap *)0)) { drbd_bm_cleanup(mdev); } else { } __free_pages(mdev->md_io_page, 0U); put_disk(mdev->vdisk); blk_cleanup_queue(mdev->rq_queue); free_cpumask_var(mdev->cpu_mask); drbd_free_tl_hash(mdev); kfree((void const *)mdev); return; } } int drbd_init(void) { int err ; struct lock_class_key __key ; void *tmp ; struct lock_class_key __key___0 ; char const *tmp___0 ; { if (minor_count == 0U || minor_count > 256U) { printk("<3>drbd: invalid minor_count (%d)\n", minor_count); return (-22); } else { } err = drbd_nl_init(); if (err != 0) { return (err); } else { } err = register_blkdev(147U, "drbd"); if (err != 0) { printk("<3>drbd: unable to register block device major %d\n", 147); return (err); } else { } register_reboot_notifier(& drbd_notifier); err = -12; __init_waitqueue_head(& drbd_pp_wait, "&drbd_pp_wait", & __key); drbd_proc = 0; tmp = kzalloc((unsigned long )minor_count * 8UL, 208U); minor_table = (struct drbd_conf **)tmp; if ((unsigned long )minor_table == (unsigned long )((struct drbd_conf **)0)) { goto Enomem; } else { } err = drbd_create_mempools(); if (err != 0) { goto Enomem; } else { } drbd_proc = proc_create_data("drbd", 33060, 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.13 (api:%d/proto:%d-%d)\n", 88, 86, 96); tmp___0 = drbd_buildtag(); printk("<6>drbd: %s\n", tmp___0); printk("<6>drbd: registered as block device major %d\n", 147); printk("<6>drbd: minor_table @ 0x%p\n", minor_table); return (0); Enomem: drbd_cleanup(); if (err == -12) { printk("<3>drbd: ran out of memory\n"); } else { printk("<3>drbd: initialization failure\n"); } return (err); } } void drbd_free_bc(struct drbd_backing_dev *ldev ) { { if ((unsigned long )ldev == (unsigned long )((struct drbd_backing_dev *)0)) { return; } else { } blkdev_put(ldev->backing_bdev, 131U); blkdev_put(ldev->md_bdev, 131U); kfree((void const *)ldev); return; } } void drbd_free_sock(struct drbd_conf *mdev ) { { if ((unsigned long )mdev->data.socket != (unsigned long )((struct socket *)0)) { ldv_mutex_lock_147(& mdev->data.mutex); kernel_sock_shutdown(mdev->data.socket, SHUT_RDWR); sock_release(mdev->data.socket); mdev->data.socket = 0; ldv_mutex_unlock_148(& mdev->data.mutex); } else { } if ((unsigned long )mdev->meta.socket != (unsigned long )((struct socket *)0)) { ldv_mutex_lock_149(& mdev->meta.mutex); kernel_sock_shutdown(mdev->meta.socket, SHUT_RDWR); sock_release(mdev->meta.socket); mdev->meta.socket = 0; ldv_mutex_unlock_150(& 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 ; __u32 tmp___11 ; sector_t tmp___12 ; int tmp___13 ; sector_t tmp___14 ; { del_timer(& mdev->md_sync_timer); tmp = test_and_clear_bit(5, (unsigned long volatile *)(& mdev->flags)); if (tmp == 0) { return; } else { } tmp___0 = _get_ldev_if_state(mdev, D_FAILED); if (tmp___0 == 0) { return; } else { } tmp___1 = drbd_md_get_buffer(mdev); buffer = (struct meta_data_on_disk *)tmp___1; if ((unsigned long )buffer == (unsigned long )((struct meta_data_on_disk *)0)) { goto out; } else { } 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_51142; ldv_51141: tmp___4 = __fswab64((mdev->ldev)->md.uuid[i]); buffer->uuid[i] = tmp___4; i = i + 1; ldv_51142: ; if (i <= 3) { goto ldv_51141; } 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 = __fswab32((__u32 )mdev->peer_max_bio_size); buffer->la_peer_max_bio_size = tmp___11; tmp___12 = drbd_md_ss__(mdev, mdev->ldev); if ((unsigned long long )tmp___12 != (mdev->ldev)->md.md_offset) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( drbd_md_ss__(mdev, mdev->ldev) == mdev->ldev->md.md_offset ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 3923); } else { } sector = (sector_t )(mdev->ldev)->md.md_offset; tmp___13 = drbd_md_sync_page_io(mdev, mdev->ldev, sector, 1); if (tmp___13 == 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "meta data update failed!\n"); drbd_chk_io_error____1(mdev, 1, 1, "drbd_md_sync"); } else { } tmp___14 = drbd_get_capacity(mdev->this_bdev); (mdev->ldev)->md.la_size_sect = (u64 )tmp___14; drbd_md_put_buffer(mdev); out: put_ldev(mdev); return; } } int drbd_md_read(struct drbd_conf *mdev , struct drbd_backing_dev *bdev ) { struct meta_data_on_disk *buffer ; int i ; int rv ; int tmp ; void *tmp___0 ; int tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; __u32 tmp___8 ; __u32 tmp___9 ; __u32 tmp___10 ; __u64 tmp___11 ; __u64 tmp___12 ; __u32 tmp___13 ; __u32 tmp___14 ; __u64 tmp___15 ; int peer ; __u32 tmp___16 ; int __max1 ; int __max2 ; { rv = 101; tmp = _get_ldev_if_state(mdev, D_ATTACHING); if (tmp == 0) { return (118); } else { } tmp___0 = drbd_md_get_buffer(mdev); buffer = (struct meta_data_on_disk *)tmp___0; if ((unsigned long )buffer == (unsigned long )((struct meta_data_on_disk *)0)) { goto out; } else { } 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_51155; ldv_51154: tmp___12 = __fswab64(buffer->uuid[i]); bdev->md.uuid[i] = tmp___12; i = i + 1; ldv_51155: ; if (i <= 3) { goto ldv_51154; } 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; spin_lock_irq(& mdev->req_lock); if ((int )mdev->state.ldv_38745.conn <= 9) { tmp___16 = __fswab32(buffer->la_peer_max_bio_size); peer = (int )tmp___16; __max1 = peer; __max2 = 4096; peer = __max1 > __max2 ? __max1 : __max2; mdev->peer_max_bio_size = peer; } else { } spin_unlock_irq(& mdev->req_lock); if (mdev->sync_conf.al_extents <= 6) { mdev->sync_conf.al_extents = 127; } else { } err: drbd_md_put_buffer(mdev); out: put_ldev(mdev); return (rv); } } void drbd_md_mark_dirty(struct drbd_conf *mdev ) { int tmp ; { tmp = test_and_set_bit(5, (unsigned long volatile *)(& mdev->flags)); if (tmp == 0) { mod_timer(& mdev->md_sync_timer, (unsigned long )jiffies + 1250UL); } else { } return; } } static void drbd_uuid_move_history(struct drbd_conf *mdev ) { int i ; { i = 2; goto ldv_51169; ldv_51168: (mdev->ldev)->md.uuid[i + 1] = (mdev->ldev)->md.uuid[i]; i = i + 1; ldv_51169: ; if (i <= 2) { goto ldv_51168; } else { } return; } } void _drbd_uuid_set(struct drbd_conf *mdev , int idx , u64 val ) { { if (idx == 0) { if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { val = val | 1ULL; } else { val = val & 0xfffffffffffffffeULL; } drbd_set_ed_uuid(mdev, val); } else { } (mdev->ldev)->md.uuid[idx] = val; drbd_md_mark_dirty(mdev); return; } } void drbd_uuid_set(struct drbd_conf *mdev , int idx , u64 val ) { { if ((mdev->ldev)->md.uuid[idx] != 0ULL) { drbd_uuid_move_history(mdev); (mdev->ldev)->md.uuid[2] = (mdev->ldev)->md.uuid[idx]; } else { } _drbd_uuid_set(mdev, idx, val); return; } } void drbd_uuid_new_current(struct drbd_conf *mdev ) { u64 val ; unsigned long long bm_uuid ; { bm_uuid = (mdev->ldev)->md.uuid[1]; if (bm_uuid != 0ULL) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "bm UUID was already set: %llX\n", bm_uuid); } else { } (mdev->ldev)->md.uuid[1] = (mdev->ldev)->md.uuid[0]; get_random_bytes((void *)(& val), 8); _drbd_uuid_set(mdev, 0, val); drbd_print_uuids(mdev, "new current UUID"); drbd_md_sync(mdev); return; } } void drbd_uuid_set_bm(struct drbd_conf *mdev , u64 val ) { unsigned long long bm_uuid ; { if ((mdev->ldev)->md.uuid[1] == 0ULL && 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; } else { bm_uuid = (mdev->ldev)->md.uuid[1]; if (bm_uuid != 0ULL) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "bm UUID was already set: %llX\n", bm_uuid); } else { } (mdev->ldev)->md.uuid[1] = val & 0xfffffffffffffffeULL; } 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 ; int tmp___0 ; { __mptr = (struct drbd_work const *)w; work = (struct bm_io_work *)__mptr; rv = -5; tmp = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); if (tmp != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( atomic_read(&mdev->ap_bio_cnt) == 0 ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 4181); } else { } tmp___0 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___0 != 0) { drbd_bm_lock(mdev, work->why, work->flags); rv = (*(work->io_fn))(mdev); drbd_bm_unlock(mdev); put_ldev(mdev); } else { } clear_bit(16, (unsigned long volatile *)(& mdev->flags)); __asm__ volatile ("": : : "memory"); __wake_up(& mdev->misc_wait, 3U, 1, 0); if ((unsigned long )work->done != (unsigned long )((void (*)(struct drbd_conf * , int ))0)) { (*(work->done))(mdev, rv); } else { } clear_bit(17, (unsigned long volatile *)(& mdev->flags)); work->why = 0; work->flags = 0; return (1); } } void drbd_ldev_destroy(struct drbd_conf *mdev ) { { 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 { } clear_bit(18, (unsigned long volatile *)(& mdev->flags)); return; } } static int w_go_diskless(struct drbd_conf *mdev , struct drbd_work *w , int unused ) { union drbd_state val ; union drbd_state mask ; { if ((unsigned int )*((unsigned char *)mdev + 2277UL) != 4U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.disk == D_FAILED ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 4223); } else { } val.i = 0U; val.ldv_38745.disk = 0U; mask.i = 0U; mask.ldv_38745.disk = 15U; drbd_force_state(mdev, mask, val); return (1); } } void drbd_go_diskless(struct drbd_conf *mdev ) { int tmp ; { if ((unsigned int )*((unsigned char *)mdev + 2277UL) != 4U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.disk == D_FAILED ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 4234); } else { } tmp = test_and_set_bit(18, (unsigned long volatile *)(& mdev->flags)); if (tmp == 0) { drbd_queue_work(& mdev->data.work, & mdev->go_diskless); } else { } return; } } void drbd_queue_bitmap_io(struct drbd_conf *mdev , int (*io_fn)(struct drbd_conf * ) , void (*done)(struct drbd_conf * , int ) , char *why , enum bm_flag flags ) { struct task_struct *tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { tmp = get_current(); if ((unsigned long )tmp != (unsigned long )mdev->worker.task) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( current == mdev->worker.task ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 4256); } else { } tmp___0 = constant_test_bit(17U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !test_bit(BITMAP_IO_QUEUED, &mdev->flags) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 4258); } else { } tmp___1 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___1 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( !test_bit(BITMAP_IO, &mdev->flags) ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 4259); } 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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 4260); } else { } if ((unsigned long )mdev->bm_io_work.why != (unsigned long )((char *)0)) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "FIXME going to queue \'%s\' but \'%s\' still pending?\n", why, mdev->bm_io_work.why); } else { } mdev->bm_io_work.io_fn = io_fn; mdev->bm_io_work.done = done; mdev->bm_io_work.why = why; mdev->bm_io_work.flags = flags; spin_lock_irq(& mdev->req_lock); set_bit(16U, (unsigned long volatile *)(& mdev->flags)); tmp___4 = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); if (tmp___4 == 0) { tmp___3 = test_and_set_bit(17, (unsigned long volatile *)(& mdev->flags)); if (tmp___3 == 0) { drbd_queue_work(& mdev->data.work, & mdev->bm_io_work.w); } else { } } else { } spin_unlock_irq(& mdev->req_lock); return; } } int drbd_bitmap_io(struct drbd_conf *mdev , int (*io_fn)(struct drbd_conf * ) , char *why , enum bm_flag flags ) { int rv ; struct task_struct *tmp ; { tmp = get_current(); if ((unsigned long )tmp == (unsigned long )mdev->worker.task) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( current != mdev->worker.task ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_main.c.prepared", 4293); } else { } if (((unsigned int )flags & 9U) == 0U) { drbd_suspend_io(mdev); } else { } drbd_bm_lock(mdev, why, flags); rv = (*io_fn)(mdev); drbd_bm_unlock(mdev); if (((unsigned int )flags & 9U) == 0U) { drbd_resume_io(mdev); } else { } return (rv); } } void drbd_md_set_flag(struct drbd_conf *mdev , int flag ) { { if (((mdev->ldev)->md.flags & (u32 )flag) != (u32 )flag) { drbd_md_mark_dirty(mdev); (mdev->ldev)->md.flags = (mdev->ldev)->md.flags | (u32 )flag; } else { } return; } } void drbd_md_clear_flag(struct drbd_conf *mdev , int flag ) { { if (((mdev->ldev)->md.flags & (u32 )flag) != 0U) { drbd_md_mark_dirty(mdev); (mdev->ldev)->md.flags = (mdev->ldev)->md.flags & (u32 )(~ flag); } else { } return; } } int drbd_md_test_flag(struct drbd_backing_dev *bdev , int flag ) { { return ((bdev->md.flags & (u32 )flag) != 0U); } } static void md_sync_timer_fn(unsigned long data ) { struct drbd_conf *mdev ; { mdev = (struct drbd_conf *)data; drbd_queue_work_front(& mdev->data.work, & mdev->md_sync_work); return; } } static int w_md_sync(struct drbd_conf *mdev , struct drbd_work *w , int unused ) { { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "md_sync_timer expired! Worker calls drbd_md_sync().\n"); drbd_md_sync(mdev); return (1); } } static unsigned long _drbd_fault_random(struct fault_random_state *rsp ) { long refresh ; unsigned long tmp ; __u32 tmp___0 ; { tmp = rsp->count; rsp->count = rsp->count - 1UL; if (tmp == 0UL) { get_random_bytes((void *)(& refresh), 8); rsp->state = rsp->state + (unsigned long )refresh; rsp->count = 10000UL; } else { } rsp->state = rsp->state * 39916801UL + 479001701UL; tmp___0 = __fswahw32((__u32 )rsp->state); return ((unsigned long )tmp___0); } } static char *_drbd_fault_str(unsigned int type ) { char *_faults[10U] ; { _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) { sprintf((char *)(& buildtag), "srcversion: %-24s", __this_module.srcversion); } else { } return ((char const *)(& buildtag)); } } void ldv_main6_sequence_infinite_withcheck_stateful(void) { struct block_device *var_group1 ; fmode_t var_drbd_open_73_p1 ; int res_drbd_open_73 ; struct gendisk *var_group2 ; fmode_t var_drbd_release_74_p1 ; struct notifier_block *var_group3 ; unsigned long var_drbd_notify_sys_80_p1 ; void *var_drbd_notify_sys_80_p2 ; unsigned long var_md_sync_timer_fn_109_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_51349; ldv_51348: tmp___0 = nondet_int(); switch (tmp___0) { case 0: ; if (ldv_s_drbd_ops_block_device_operations == 0) { ldv_handler_precall(); res_drbd_open_73 = drbd_open(var_group1, var_drbd_open_73_p1); ldv_check_return_value(res_drbd_open_73); if (res_drbd_open_73 != 0) { goto ldv_module_exit; } else { } ldv_s_drbd_ops_block_device_operations = ldv_s_drbd_ops_block_device_operations + 1; } else { } goto ldv_51343; case 1: ; if (ldv_s_drbd_ops_block_device_operations == 1) { ldv_handler_precall(); drbd_release(var_group2, var_drbd_release_74_p1); ldv_s_drbd_ops_block_device_operations = 0; } else { } goto ldv_51343; case 2: ldv_handler_precall(); drbd_notify_sys(var_group3, var_drbd_notify_sys_80_p1, var_drbd_notify_sys_80_p2); goto ldv_51343; case 3: ldv_handler_precall(); md_sync_timer_fn(var_md_sync_timer_fn_109_p0); goto ldv_51343; default: ; goto ldv_51343; } ldv_51343: ; ldv_51349: tmp___1 = nondet_int(); if (tmp___1 != 0 || ldv_s_drbd_ops_block_device_operations != 0) { goto ldv_51348; } 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_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_125(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_126(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_127(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_128(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_129(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_130(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_131(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_132(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_133(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_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_mutex_of_drbd_socket(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_140(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_141(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_142(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_143(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_drbd_main_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_144(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_drbd_main_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_145(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_drbd_main_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_146(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_drbd_main_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_147(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_148(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_149(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_150(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_182(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_183(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_185(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_181(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_184(struct mutex *ldv_func_arg1 ) ; static char const *drbd_conn_s_names[24U] = { "StandAlone", "Disconnecting", "Unconnected", "Timeout", "BrokenPipe", "NetworkFailure", "ProtocolError", "TearDown", "WFConnection", "WFReportParams", "Connected", "StartingSyncS", "StartingSyncT", "WFBitMapS", "WFBitMapT", "WFSyncUUID", "SyncSource", "SyncTarget", "VerifyS", "VerifyT", "PausedSyncS", "PausedSyncT", "Ahead", "Behind"}; static char const *drbd_role_s_names[3U] = { "Unknown", "Primary", "Secondary"}; static char const *drbd_disk_s_names[9U] = { "Diskless", "Attaching", "Failed", "Negotiating", "Inconsistent", "Outdated", "DUnknown", "Consistent", "UpToDate"}; static char const *drbd_state_sw_errors[20U] = { 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 <= 23U ? 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_rv 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; } } void ldv_mutex_lock_184(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_185(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(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 int bitmap_parse(char const *buf , unsigned int buflen , unsigned long *maskp , int nmaskbits ) { int tmp ; { tmp = __bitmap_parse(buf, buflen, 0, maskp, nmaskbits); 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_192(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_193(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_195(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_197(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_198(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_200(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_202(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_191(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_194(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_196(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_199(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_201(struct mutex *ldv_func_arg1 ) ; __inline static struct thread_info *current_thread_info___3(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_6283; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6283; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6283; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6283; default: __bad_percpu_size(); } ldv_6283: 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 * , struct cred * ) , void (*)(struct subprocess_info * ) , void * ) ; extern int call_usermodehelper_exec(struct subprocess_info * , int ) ; __inline static int call_usermodehelper_fns(char *path , char **argv , char **envp , int wait , int (*init)(struct subprocess_info * , struct cred * ) , void (*cleanup)(struct subprocess_info * ) , void *data ) { struct subprocess_info *info ; gfp_t gfp_mask ; int tmp ; { gfp_mask = wait == 0 ? 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 , int 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 ) ; extern bool capable(int ) ; extern struct block_device *blkdev_get_by_path(char const * , fmode_t , void * ) ; __inline static void pagefault_disable___0(void) { struct thread_info *tmp ; { tmp = current_thread_info___3(); 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___3(); tmp->preempt_count = tmp->preempt_count + -1; __asm__ volatile ("": : : "memory"); return; } } extern int cn_add_callback(struct cb_id * , char const * , void (*)(struct cn_msg * , struct netlink_skb_parms * ) ) ; extern void cn_del_callback(struct cb_id * ) ; extern int cn_netlink_send(struct cn_msg * , u32 , gfp_t ) ; extern void add_disk(struct gendisk * ) ; __inline static void *kmap_atomic___0(struct page *page ) { void *tmp ; { pagefault_disable___0(); tmp = lowmem_page_address((struct page const *)page); return (tmp); } } __inline static void __kunmap_atomic___0(void *addr ) { { pagefault_enable___0(); return; } } extern void blk_queue_max_segments(struct request_queue * , unsigned short ) ; extern void blk_queue_logical_block_size(struct request_queue * , unsigned short ) ; extern void blk_queue_stack_limits(struct request_queue * , struct request_queue * ) ; extern void blk_queue_segment_boundary(struct request_queue * , unsigned long ) ; extern struct lru_cache *lc_create(char const * , struct kmem_cache * , unsigned int , size_t , size_t ) ; enum drbd_disk_state drbd_try_outdate_peer(struct drbd_conf *mdev ) ; __inline static sector_t drbd_get_max_capacity___1(struct drbd_backing_dev *bdev ) { sector_t s ; sector_t __min1 ; sector_t __min2 ; sector_t tmp___0 ; sector_t tmp___1 ; sector_t __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 = 2251799813685248UL; tmp___0 = drbd_md_first_sector(bdev); __min2 = tmp___0; s = __min1 < __min2 ? __min1 : __min2; } else { s = 0UL; } goto ldv_49457; case -2: __min1___0 = 2251799813685248UL; 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_49457; 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_49457: ; 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[90U] = { {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}, {"on_congestion", 0, 4}, {"cong_fill", 0, 4}, {"cong_extents", 0, 4}, {"force", 32768, 4}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {"detach_force", 40960, 4}, {"disk_timeout", 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_50241; ldv_50240: 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_50238; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_50238: tags = tags + (unsigned long )dlen; ldv_50241: tmp___1 = tags; tags = tags + 1; tmp___2 = get_unaligned_le16((void const *)tmp___1); tag = (int )tmp___2; if (tag != 0) { goto ldv_50240; } 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 ; u32 tmp___5 ; unsigned short *tmp___6 ; u16 tmp___7 ; { goto ldv_50303; ldv_50302: 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_50270; 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_50270; 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_50270; case 5: tmp___1 = get_unaligned_le32((void const *)tags); arg->meta_dev_idx = (int )tmp___1; goto ldv_50270; case 6: tmp___2 = get_unaligned_le32((void const *)tags); arg->on_io_error = (int )tmp___2; goto ldv_50270; case 7: tmp___3 = get_unaligned_le32((void const *)tags); arg->fencing = (int )tmp___3; goto ldv_50270; case 37: arg->use_bmbv = (int )((signed char )*((char *)tags)) != 0; goto ldv_50270; case 53: arg->no_disk_flush = (int )((signed char )*((char *)tags)) != 0; goto ldv_50270; case 54: arg->no_md_flush = (int )((signed char )*((char *)tags)) != 0; goto ldv_50270; case 56: tmp___4 = get_unaligned_le32((void const *)tags); arg->max_bio_bvecs = (int )tmp___4; goto ldv_50270; case 57: arg->no_disk_barrier = (int )((signed char )*((char *)tags)) != 0; goto ldv_50270; case 58: arg->no_disk_drain = (int )((signed char )*((char *)tags)) != 0; goto ldv_50270; case 89: tmp___5 = get_unaligned_le32((void const *)tags); arg->disk_timeout = (int )tmp___5; goto ldv_50270; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_50270: tags = tags + (unsigned long )dlen; ldv_50303: tmp___6 = tags; tags = tags + 1; tmp___7 = get_unaligned_le16((void const *)tmp___6); tag = (int )tmp___7; if (tag != 0) { goto ldv_50302; } else { } return (1); } } static int detach_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct detach *arg ) ; static int detach_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct detach *arg ) { int tag ; int dlen ; unsigned short *tmp ; u16 tmp___0 ; unsigned short *tmp___1 ; u16 tmp___2 ; { goto ldv_50320; ldv_50319: tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; switch (tag & 8191) { case 88: arg->detach_force = (int )((signed char )*((char *)tags)) != 0; goto ldv_50317; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_50317: tags = tags + (unsigned long )dlen; ldv_50320: tmp___1 = tags; tags = tags + 1; tmp___2 = get_unaligned_le16((void const *)tmp___1); tag = (int )tmp___2; if (tag != 0) { goto ldv_50319; } 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 ; u32 tmp___16 ; u32 tmp___17 ; u32 tmp___18 ; unsigned short *tmp___19 ; u16 tmp___20 ; { goto ldv_50411; ldv_50410: 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_50343; 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_50343; 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_50343; 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_50343; 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_50343; case 14: tmp___1 = get_unaligned_le32((void const *)tags); arg->timeout = (int )tmp___1; goto ldv_50343; case 15: tmp___2 = get_unaligned_le32((void const *)tags); arg->wire_protocol = (int )tmp___2; goto ldv_50343; case 16: tmp___3 = get_unaligned_le32((void const *)tags); arg->try_connect_int = (int )tmp___3; goto ldv_50343; case 17: tmp___4 = get_unaligned_le32((void const *)tags); arg->ping_int = (int )tmp___4; goto ldv_50343; case 18: tmp___5 = get_unaligned_le32((void const *)tags); arg->max_epoch_size = (int )tmp___5; goto ldv_50343; case 19: tmp___6 = get_unaligned_le32((void const *)tags); arg->max_buffers = (int )tmp___6; goto ldv_50343; case 20: tmp___7 = get_unaligned_le32((void const *)tags); arg->unplug_watermark = (int )tmp___7; goto ldv_50343; case 21: tmp___8 = get_unaligned_le32((void const *)tags); arg->sndbuf_size = (int )tmp___8; goto ldv_50343; case 22: tmp___9 = get_unaligned_le32((void const *)tags); arg->ko_count = (int )tmp___9; goto ldv_50343; case 24: tmp___10 = get_unaligned_le32((void const *)tags); arg->after_sb_0p = (int )tmp___10; goto ldv_50343; case 25: tmp___11 = get_unaligned_le32((void const *)tags); arg->after_sb_1p = (int )tmp___11; goto ldv_50343; case 26: tmp___12 = get_unaligned_le32((void const *)tags); arg->after_sb_2p = (int )tmp___12; goto ldv_50343; case 39: tmp___13 = get_unaligned_le32((void const *)tags); arg->rr_conflict = (int )tmp___13; goto ldv_50343; case 40: tmp___14 = get_unaligned_le32((void const *)tags); arg->ping_timeo = (int )tmp___14; goto ldv_50343; case 67: tmp___15 = get_unaligned_le32((void const *)tags); arg->rcvbuf_size = (int )tmp___15; goto ldv_50343; case 81: tmp___16 = get_unaligned_le32((void const *)tags); arg->on_congestion = (int )tmp___16; goto ldv_50343; case 82: tmp___17 = get_unaligned_le32((void const *)tags); arg->cong_fill = (int )tmp___17; goto ldv_50343; case 83: tmp___18 = get_unaligned_le32((void const *)tags); arg->cong_extents = (int )tmp___18; goto ldv_50343; case 60: arg->mind_af = (int )((signed char )*((char *)tags)) != 0; goto ldv_50343; case 27: arg->want_lose = (int )((signed char )*((char *)tags)) != 0; goto ldv_50343; case 28: arg->two_primaries = (int )((signed char )*((char *)tags)) != 0; goto ldv_50343; case 41: arg->always_asbp = (int )((signed char )*((char *)tags)) != 0; goto ldv_50343; case 61: arg->no_cork = (int )((signed char )*((char *)tags)) != 0; goto ldv_50343; case 62: arg->auto_sndbuf_size = (int )((signed char )*((char *)tags)) != 0; goto ldv_50343; case 70: arg->dry_run = (int )((signed char )*((char *)tags)) != 0; goto ldv_50343; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_50343: tags = tags + (unsigned long )dlen; ldv_50411: tmp___19 = tags; tags = tags + 1; tmp___20 = get_unaligned_le16((void const *)tmp___19); tag = (int )tmp___20; if (tag != 0) { goto ldv_50410; } else { } return (1); } } static int disconnect_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct disconnect *arg ) ; static int disconnect_from_tags(struct drbd_conf *mdev , unsigned short *tags , struct disconnect *arg ) { int tag ; int dlen ; unsigned short *tmp ; u16 tmp___0 ; unsigned short *tmp___1 ; u16 tmp___2 ; { goto ldv_50428; ldv_50427: tmp = tags; tags = tags + 1; tmp___0 = get_unaligned_le16((void const *)tmp); dlen = (int )tmp___0; switch (tag & 8191) { case 84: arg->force = (int )((signed char )*((char *)tags)) != 0; goto ldv_50425; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_50425: tags = tags + (unsigned long )dlen; ldv_50428: tmp___1 = tags; tags = tags + 1; tmp___2 = get_unaligned_le16((void const *)tmp___1); tag = (int )tmp___2; if (tag != 0) { goto ldv_50427; } 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_50447; ldv_50446: 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_50442; case 68: arg->resize_force = (int )((signed char )*((char *)tags)) != 0; goto ldv_50442; case 69: arg->no_resync = (int )((signed char )*((char *)tags)) != 0; goto ldv_50442; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_50442: tags = tags + (unsigned long )dlen; ldv_50447: tmp___1 = tags; tags = tags + 1; tmp___2 = get_unaligned_le16((void const *)tmp___1); tag = (int )tmp___2; if (tag != 0) { goto ldv_50446; } 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_50503; ldv_50502: 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_50461; case 31: tmp___2 = get_unaligned_le32((void const *)tags); arg->after = (int )tmp___2; goto ldv_50461; case 32: tmp___3 = get_unaligned_le32((void const *)tags); arg->al_extents = (int )tmp___3; goto ldv_50461; 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_50461; 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_50461; 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_50461; case 65: arg->use_rle = (int )((signed char )*((char *)tags)) != 0; goto ldv_50461; case 75: tmp___4 = get_unaligned_le32((void const *)tags); arg->on_no_data = (int )tmp___4; goto ldv_50461; case 76: tmp___5 = get_unaligned_le32((void const *)tags); arg->c_plan_ahead = (int )tmp___5; goto ldv_50461; case 77: tmp___6 = get_unaligned_le32((void const *)tags); arg->c_delay_target = (int )tmp___6; goto ldv_50461; case 78: tmp___7 = get_unaligned_le32((void const *)tags); arg->c_fill_target = (int )tmp___7; goto ldv_50461; case 79: tmp___8 = get_unaligned_le32((void const *)tags); arg->c_max_rate = (int )tmp___8; goto ldv_50461; case 80: tmp___9 = get_unaligned_le32((void const *)tags); arg->c_min_rate = (int )tmp___9; goto ldv_50461; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_50461: tags = tags + (unsigned long )dlen; ldv_50503: tmp___10 = tags; tags = tags + 1; tmp___11 = get_unaligned_le16((void const *)tmp___10); tag = (int )tmp___11; if (tag != 0) { goto ldv_50502; } 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_50802; ldv_50801: 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_50799; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_50799: tags = tags + (unsigned long )dlen; ldv_50802: tmp___1 = tags; tags = tags + 1; tmp___2 = get_unaligned_le16((void const *)tmp___1); tag = (int )tmp___2; if (tag != 0) { goto ldv_50801; } 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_50819; ldv_50818: 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_50816; default: ; if ((tag & 8192) != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Unknown tag: %d\n", tag & 8191); return (0); } else { } } ldv_50816: tags = tags + (unsigned long )dlen; ldv_50819: tmp___1 = tags; tags = tags + 1; tmp___2 = get_unaligned_le16((void const *)tmp___1); tag = (int )tmp___2; if (tag != 0) { goto ldv_50818; } 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 ; void *__gu_p___28 ; unsigned short *tmp___23 ; void *__gu_p___29 ; unsigned short *tmp___24 ; void *__gu_p___30 ; { tmp = tags; tags = tags + 1; __gu_p = (void *)tmp; switch (2UL) { case 1UL: *((u8 *)__gu_p) = 2U; goto ldv_50864; case 2UL: put_unaligned_le16(16386, __gu_p); goto ldv_50864; case 4UL: put_unaligned_le32(16386U, __gu_p); goto ldv_50864; case 8UL: put_unaligned_le64(16386ULL, __gu_p); goto ldv_50864; default: __bad_unaligned_access_size(); goto ldv_50864; } ldv_50864: tmp___0 = tags; tags = tags + 1; __gu_p___0 = (void *)tmp___0; switch (2UL) { case 1UL: *((u8 *)__gu_p___0) = 8U; goto ldv_50871; case 2UL: put_unaligned_le16(8, __gu_p___0); goto ldv_50871; case 4UL: put_unaligned_le32(8U, __gu_p___0); goto ldv_50871; case 8UL: put_unaligned_le64(8ULL, __gu_p___0); goto ldv_50871; default: __bad_unaligned_access_size(); goto ldv_50871; } ldv_50871: __gu_p___1 = (void *)tags; switch (8UL) { case 1UL: *((u8 *)__gu_p___1) = (unsigned char )arg->disk_size; goto ldv_50878; case 2UL: put_unaligned_le16((int )((unsigned short )arg->disk_size), __gu_p___1); goto ldv_50878; case 4UL: put_unaligned_le32((unsigned int )arg->disk_size, __gu_p___1); goto ldv_50878; case 8UL: put_unaligned_le64(arg->disk_size, __gu_p___1); goto ldv_50878; default: __bad_unaligned_access_size(); goto ldv_50878; } ldv_50878: 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_50885; case 2UL: put_unaligned_le16(57347, __gu_p___2); goto ldv_50885; case 4UL: put_unaligned_le32(57347U, __gu_p___2); goto ldv_50885; case 8UL: put_unaligned_le64(57347ULL, __gu_p___2); goto ldv_50885; default: __bad_unaligned_access_size(); goto ldv_50885; } ldv_50885: 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_50892; case 2UL: put_unaligned_le16((int )((unsigned short )arg->backing_dev_len), __gu_p___3); goto ldv_50892; case 4UL: put_unaligned_le32((unsigned int )arg->backing_dev_len, __gu_p___3); goto ldv_50892; case 8UL: put_unaligned_le64((unsigned long long )arg->backing_dev_len, __gu_p___3); goto ldv_50892; default: __bad_unaligned_access_size(); goto ldv_50892; } ldv_50892: __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_50902; case 2UL: put_unaligned_le16(57348, __gu_p___4); goto ldv_50902; case 4UL: put_unaligned_le32(57348U, __gu_p___4); goto ldv_50902; case 8UL: put_unaligned_le64(57348ULL, __gu_p___4); goto ldv_50902; default: __bad_unaligned_access_size(); goto ldv_50902; } ldv_50902: 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_50909; case 2UL: put_unaligned_le16((int )((unsigned short )arg->meta_dev_len), __gu_p___5); goto ldv_50909; case 4UL: put_unaligned_le32((unsigned int )arg->meta_dev_len, __gu_p___5); goto ldv_50909; case 8UL: put_unaligned_le64((unsigned long long )arg->meta_dev_len, __gu_p___5); goto ldv_50909; default: __bad_unaligned_access_size(); goto ldv_50909; } ldv_50909: __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_50919; case 2UL: put_unaligned_le16(8197, __gu_p___6); goto ldv_50919; case 4UL: put_unaligned_le32(8197U, __gu_p___6); goto ldv_50919; case 8UL: put_unaligned_le64(8197ULL, __gu_p___6); goto ldv_50919; default: __bad_unaligned_access_size(); goto ldv_50919; } ldv_50919: tmp___6 = tags; tags = tags + 1; __gu_p___7 = (void *)tmp___6; switch (2UL) { case 1UL: *((u8 *)__gu_p___7) = 4U; goto ldv_50926; case 2UL: put_unaligned_le16(4, __gu_p___7); goto ldv_50926; case 4UL: put_unaligned_le32(4U, __gu_p___7); goto ldv_50926; case 8UL: put_unaligned_le64(4ULL, __gu_p___7); goto ldv_50926; default: __bad_unaligned_access_size(); goto ldv_50926; } ldv_50926: __gu_p___8 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___8) = (unsigned char )arg->meta_dev_idx; goto ldv_50933; case 2UL: put_unaligned_le16((int )((unsigned short )arg->meta_dev_idx), __gu_p___8); goto ldv_50933; case 4UL: put_unaligned_le32((unsigned int )arg->meta_dev_idx, __gu_p___8); goto ldv_50933; case 8UL: put_unaligned_le64((unsigned long long )arg->meta_dev_idx, __gu_p___8); goto ldv_50933; default: __bad_unaligned_access_size(); goto ldv_50933; } ldv_50933: 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_50940; case 2UL: put_unaligned_le16(6, __gu_p___9); goto ldv_50940; case 4UL: put_unaligned_le32(6U, __gu_p___9); goto ldv_50940; case 8UL: put_unaligned_le64(6ULL, __gu_p___9); goto ldv_50940; default: __bad_unaligned_access_size(); goto ldv_50940; } ldv_50940: tmp___8 = tags; tags = tags + 1; __gu_p___10 = (void *)tmp___8; switch (2UL) { case 1UL: *((u8 *)__gu_p___10) = 4U; goto ldv_50947; case 2UL: put_unaligned_le16(4, __gu_p___10); goto ldv_50947; case 4UL: put_unaligned_le32(4U, __gu_p___10); goto ldv_50947; case 8UL: put_unaligned_le64(4ULL, __gu_p___10); goto ldv_50947; default: __bad_unaligned_access_size(); goto ldv_50947; } ldv_50947: __gu_p___11 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___11) = (unsigned char )arg->on_io_error; goto ldv_50954; case 2UL: put_unaligned_le16((int )((unsigned short )arg->on_io_error), __gu_p___11); goto ldv_50954; case 4UL: put_unaligned_le32((unsigned int )arg->on_io_error, __gu_p___11); goto ldv_50954; case 8UL: put_unaligned_le64((unsigned long long )arg->on_io_error, __gu_p___11); goto ldv_50954; default: __bad_unaligned_access_size(); goto ldv_50954; } ldv_50954: 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_50961; case 2UL: put_unaligned_le16(7, __gu_p___12); goto ldv_50961; case 4UL: put_unaligned_le32(7U, __gu_p___12); goto ldv_50961; case 8UL: put_unaligned_le64(7ULL, __gu_p___12); goto ldv_50961; default: __bad_unaligned_access_size(); goto ldv_50961; } ldv_50961: tmp___10 = tags; tags = tags + 1; __gu_p___13 = (void *)tmp___10; switch (2UL) { case 1UL: *((u8 *)__gu_p___13) = 4U; goto ldv_50968; case 2UL: put_unaligned_le16(4, __gu_p___13); goto ldv_50968; case 4UL: put_unaligned_le32(4U, __gu_p___13); goto ldv_50968; case 8UL: put_unaligned_le64(4ULL, __gu_p___13); goto ldv_50968; default: __bad_unaligned_access_size(); goto ldv_50968; } ldv_50968: __gu_p___14 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___14) = (unsigned char )arg->fencing; goto ldv_50975; case 2UL: put_unaligned_le16((int )((unsigned short )arg->fencing), __gu_p___14); goto ldv_50975; case 4UL: put_unaligned_le32((unsigned int )arg->fencing, __gu_p___14); goto ldv_50975; case 8UL: put_unaligned_le64((unsigned long long )arg->fencing, __gu_p___14); goto ldv_50975; default: __bad_unaligned_access_size(); goto ldv_50975; } ldv_50975: 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_50982; case 2UL: put_unaligned_le16(32805, __gu_p___15); goto ldv_50982; case 4UL: put_unaligned_le32(32805U, __gu_p___15); goto ldv_50982; case 8UL: put_unaligned_le64(32805ULL, __gu_p___15); goto ldv_50982; default: __bad_unaligned_access_size(); goto ldv_50982; } ldv_50982: tmp___12 = tags; tags = tags + 1; __gu_p___16 = (void *)tmp___12; switch (2UL) { case 1UL: *((u8 *)__gu_p___16) = 1U; goto ldv_50989; case 2UL: put_unaligned_le16(1, __gu_p___16); goto ldv_50989; case 4UL: put_unaligned_le32(1U, __gu_p___16); goto ldv_50989; case 8UL: put_unaligned_le64(1ULL, __gu_p___16); goto ldv_50989; default: __bad_unaligned_access_size(); goto ldv_50989; } ldv_50989: *((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_50996; case 2UL: put_unaligned_le16(32821, __gu_p___17); goto ldv_50996; case 4UL: put_unaligned_le32(32821U, __gu_p___17); goto ldv_50996; case 8UL: put_unaligned_le64(32821ULL, __gu_p___17); goto ldv_50996; default: __bad_unaligned_access_size(); goto ldv_50996; } ldv_50996: tmp___14 = tags; tags = tags + 1; __gu_p___18 = (void *)tmp___14; switch (2UL) { case 1UL: *((u8 *)__gu_p___18) = 1U; goto ldv_51003; case 2UL: put_unaligned_le16(1, __gu_p___18); goto ldv_51003; case 4UL: put_unaligned_le32(1U, __gu_p___18); goto ldv_51003; case 8UL: put_unaligned_le64(1ULL, __gu_p___18); goto ldv_51003; default: __bad_unaligned_access_size(); goto ldv_51003; } ldv_51003: *((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_51010; case 2UL: put_unaligned_le16(32822, __gu_p___19); goto ldv_51010; case 4UL: put_unaligned_le32(32822U, __gu_p___19); goto ldv_51010; case 8UL: put_unaligned_le64(32822ULL, __gu_p___19); goto ldv_51010; default: __bad_unaligned_access_size(); goto ldv_51010; } ldv_51010: tmp___16 = tags; tags = tags + 1; __gu_p___20 = (void *)tmp___16; switch (2UL) { case 1UL: *((u8 *)__gu_p___20) = 1U; goto ldv_51017; case 2UL: put_unaligned_le16(1, __gu_p___20); goto ldv_51017; case 4UL: put_unaligned_le32(1U, __gu_p___20); goto ldv_51017; case 8UL: put_unaligned_le64(1ULL, __gu_p___20); goto ldv_51017; default: __bad_unaligned_access_size(); goto ldv_51017; } ldv_51017: *((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_51024; case 2UL: put_unaligned_le16(56, __gu_p___21); goto ldv_51024; case 4UL: put_unaligned_le32(56U, __gu_p___21); goto ldv_51024; case 8UL: put_unaligned_le64(56ULL, __gu_p___21); goto ldv_51024; default: __bad_unaligned_access_size(); goto ldv_51024; } ldv_51024: tmp___18 = tags; tags = tags + 1; __gu_p___22 = (void *)tmp___18; switch (2UL) { case 1UL: *((u8 *)__gu_p___22) = 4U; goto ldv_51031; case 2UL: put_unaligned_le16(4, __gu_p___22); goto ldv_51031; case 4UL: put_unaligned_le32(4U, __gu_p___22); goto ldv_51031; case 8UL: put_unaligned_le64(4ULL, __gu_p___22); goto ldv_51031; default: __bad_unaligned_access_size(); goto ldv_51031; } ldv_51031: __gu_p___23 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___23) = (unsigned char )arg->max_bio_bvecs; goto ldv_51038; case 2UL: put_unaligned_le16((int )((unsigned short )arg->max_bio_bvecs), __gu_p___23); goto ldv_51038; case 4UL: put_unaligned_le32((unsigned int )arg->max_bio_bvecs, __gu_p___23); goto ldv_51038; case 8UL: put_unaligned_le64((unsigned long long )arg->max_bio_bvecs, __gu_p___23); goto ldv_51038; default: __bad_unaligned_access_size(); goto ldv_51038; } ldv_51038: 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_51045; case 2UL: put_unaligned_le16(32825, __gu_p___24); goto ldv_51045; case 4UL: put_unaligned_le32(32825U, __gu_p___24); goto ldv_51045; case 8UL: put_unaligned_le64(32825ULL, __gu_p___24); goto ldv_51045; default: __bad_unaligned_access_size(); goto ldv_51045; } ldv_51045: tmp___20 = tags; tags = tags + 1; __gu_p___25 = (void *)tmp___20; switch (2UL) { case 1UL: *((u8 *)__gu_p___25) = 1U; goto ldv_51052; case 2UL: put_unaligned_le16(1, __gu_p___25); goto ldv_51052; case 4UL: put_unaligned_le32(1U, __gu_p___25); goto ldv_51052; case 8UL: put_unaligned_le64(1ULL, __gu_p___25); goto ldv_51052; default: __bad_unaligned_access_size(); goto ldv_51052; } ldv_51052: *((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_51059; case 2UL: put_unaligned_le16(32826, __gu_p___26); goto ldv_51059; case 4UL: put_unaligned_le32(32826U, __gu_p___26); goto ldv_51059; case 8UL: put_unaligned_le64(32826ULL, __gu_p___26); goto ldv_51059; default: __bad_unaligned_access_size(); goto ldv_51059; } ldv_51059: tmp___22 = tags; tags = tags + 1; __gu_p___27 = (void *)tmp___22; switch (2UL) { case 1UL: *((u8 *)__gu_p___27) = 1U; goto ldv_51066; case 2UL: put_unaligned_le16(1, __gu_p___27); goto ldv_51066; case 4UL: put_unaligned_le32(1U, __gu_p___27); goto ldv_51066; case 8UL: put_unaligned_le64(1ULL, __gu_p___27); goto ldv_51066; default: __bad_unaligned_access_size(); goto ldv_51066; } ldv_51066: *((char *)tags) = (char )arg->no_disk_drain; tags = tags + 1U; tmp___23 = tags; tags = tags + 1; __gu_p___28 = (void *)tmp___23; switch (2UL) { case 1UL: *((u8 *)__gu_p___28) = 89U; goto ldv_51073; case 2UL: put_unaligned_le16(89, __gu_p___28); goto ldv_51073; case 4UL: put_unaligned_le32(89U, __gu_p___28); goto ldv_51073; case 8UL: put_unaligned_le64(89ULL, __gu_p___28); goto ldv_51073; default: __bad_unaligned_access_size(); goto ldv_51073; } ldv_51073: tmp___24 = tags; tags = tags + 1; __gu_p___29 = (void *)tmp___24; switch (2UL) { case 1UL: *((u8 *)__gu_p___29) = 4U; goto ldv_51080; case 2UL: put_unaligned_le16(4, __gu_p___29); goto ldv_51080; case 4UL: put_unaligned_le32(4U, __gu_p___29); goto ldv_51080; case 8UL: put_unaligned_le64(4ULL, __gu_p___29); goto ldv_51080; default: __bad_unaligned_access_size(); goto ldv_51080; } ldv_51080: __gu_p___30 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___30) = (unsigned char )arg->disk_timeout; goto ldv_51087; case 2UL: put_unaligned_le16((int )((unsigned short )arg->disk_timeout), __gu_p___30); goto ldv_51087; case 4UL: put_unaligned_le32((unsigned int )arg->disk_timeout, __gu_p___30); goto ldv_51087; case 8UL: put_unaligned_le64((unsigned long long )arg->disk_timeout, __gu_p___30); goto ldv_51087; default: __bad_unaligned_access_size(); goto ldv_51087; } ldv_51087: tags = tags + 4U; return (tags); } } static unsigned short *net_conf_to_tags(struct drbd_conf *mdev , struct net_conf *arg , unsigned short *tags ) ; static unsigned short *net_conf_to_tags(struct drbd_conf *mdev , struct net_conf *arg , unsigned short *tags ) { void *__gu_p ; unsigned short *tmp ; void *__gu_p___0 ; unsigned short *tmp___0 ; size_t __len ; void *__ret ; void *__gu_p___1 ; unsigned short *tmp___1 ; void *__gu_p___2 ; unsigned short *tmp___2 ; size_t __len___0 ; void *__ret___0 ; void *__gu_p___3 ; unsigned short *tmp___3 ; void *__gu_p___4 ; unsigned short *tmp___4 ; size_t __len___1 ; void *__ret___1 ; void *__gu_p___5 ; unsigned short *tmp___5 ; void *__gu_p___6 ; unsigned short *tmp___6 ; size_t __len___2 ; void *__ret___2 ; void *__gu_p___7 ; unsigned short *tmp___7 ; void *__gu_p___8 ; unsigned short *tmp___8 ; size_t __len___3 ; void *__ret___3 ; void *__gu_p___9 ; unsigned short *tmp___9 ; void *__gu_p___10 ; unsigned short *tmp___10 ; void *__gu_p___11 ; void *__gu_p___12 ; unsigned short *tmp___11 ; void *__gu_p___13 ; unsigned short *tmp___12 ; void *__gu_p___14 ; void *__gu_p___15 ; unsigned short *tmp___13 ; void *__gu_p___16 ; unsigned short *tmp___14 ; void *__gu_p___17 ; void *__gu_p___18 ; unsigned short *tmp___15 ; void *__gu_p___19 ; unsigned short *tmp___16 ; void *__gu_p___20 ; void *__gu_p___21 ; unsigned short *tmp___17 ; void *__gu_p___22 ; unsigned short *tmp___18 ; void *__gu_p___23 ; void *__gu_p___24 ; unsigned short *tmp___19 ; void *__gu_p___25 ; unsigned short *tmp___20 ; void *__gu_p___26 ; void *__gu_p___27 ; unsigned short *tmp___21 ; void *__gu_p___28 ; unsigned short *tmp___22 ; void *__gu_p___29 ; void *__gu_p___30 ; unsigned short *tmp___23 ; void *__gu_p___31 ; unsigned short *tmp___24 ; void *__gu_p___32 ; void *__gu_p___33 ; unsigned short *tmp___25 ; void *__gu_p___34 ; unsigned short *tmp___26 ; void *__gu_p___35 ; void *__gu_p___36 ; unsigned short *tmp___27 ; void *__gu_p___37 ; unsigned short *tmp___28 ; void *__gu_p___38 ; void *__gu_p___39 ; unsigned short *tmp___29 ; void *__gu_p___40 ; unsigned short *tmp___30 ; void *__gu_p___41 ; void *__gu_p___42 ; unsigned short *tmp___31 ; void *__gu_p___43 ; unsigned short *tmp___32 ; void *__gu_p___44 ; void *__gu_p___45 ; unsigned short *tmp___33 ; void *__gu_p___46 ; unsigned short *tmp___34 ; void *__gu_p___47 ; void *__gu_p___48 ; unsigned short *tmp___35 ; void *__gu_p___49 ; unsigned short *tmp___36 ; void *__gu_p___50 ; void *__gu_p___51 ; unsigned short *tmp___37 ; void *__gu_p___52 ; unsigned short *tmp___38 ; void *__gu_p___53 ; void *__gu_p___54 ; unsigned short *tmp___39 ; void *__gu_p___55 ; unsigned short *tmp___40 ; void *__gu_p___56 ; void *__gu_p___57 ; unsigned short *tmp___41 ; void *__gu_p___58 ; unsigned short *tmp___42 ; void *__gu_p___59 ; void *__gu_p___60 ; unsigned short *tmp___43 ; void *__gu_p___61 ; unsigned short *tmp___44 ; void *__gu_p___62 ; void *__gu_p___63 ; unsigned short *tmp___45 ; void *__gu_p___64 ; unsigned short *tmp___46 ; void *__gu_p___65 ; unsigned short *tmp___47 ; void *__gu_p___66 ; unsigned short *tmp___48 ; void *__gu_p___67 ; unsigned short *tmp___49 ; void *__gu_p___68 ; unsigned short *tmp___50 ; void *__gu_p___69 ; unsigned short *tmp___51 ; void *__gu_p___70 ; unsigned short *tmp___52 ; void *__gu_p___71 ; unsigned short *tmp___53 ; void *__gu_p___72 ; unsigned short *tmp___54 ; void *__gu_p___73 ; unsigned short *tmp___55 ; void *__gu_p___74 ; unsigned short *tmp___56 ; void *__gu_p___75 ; unsigned short *tmp___57 ; void *__gu_p___76 ; unsigned short *tmp___58 ; { tmp = tags; tags = tags + 1; __gu_p = (void *)tmp; switch (2UL) { case 1UL: *((u8 *)__gu_p) = 8U; goto ldv_51126; case 2UL: put_unaligned_le16(57352, __gu_p); goto ldv_51126; case 4UL: put_unaligned_le32(57352U, __gu_p); goto ldv_51126; case 8UL: put_unaligned_le64(57352ULL, __gu_p); goto ldv_51126; default: __bad_unaligned_access_size(); goto ldv_51126; } ldv_51126: 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_51133; case 2UL: put_unaligned_le16((int )((unsigned short )arg->my_addr_len), __gu_p___0); goto ldv_51133; case 4UL: put_unaligned_le32((unsigned int )arg->my_addr_len, __gu_p___0); goto ldv_51133; case 8UL: put_unaligned_le64((unsigned long long )arg->my_addr_len, __gu_p___0); goto ldv_51133; default: __bad_unaligned_access_size(); goto ldv_51133; } ldv_51133: __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_51143; case 2UL: put_unaligned_le16(57353, __gu_p___1); goto ldv_51143; case 4UL: put_unaligned_le32(57353U, __gu_p___1); goto ldv_51143; case 8UL: put_unaligned_le64(57353ULL, __gu_p___1); goto ldv_51143; default: __bad_unaligned_access_size(); goto ldv_51143; } ldv_51143: 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_51150; case 2UL: put_unaligned_le16((int )((unsigned short )arg->peer_addr_len), __gu_p___2); goto ldv_51150; case 4UL: put_unaligned_le32((unsigned int )arg->peer_addr_len, __gu_p___2); goto ldv_51150; case 8UL: put_unaligned_le64((unsigned long long )arg->peer_addr_len, __gu_p___2); goto ldv_51150; default: __bad_unaligned_access_size(); goto ldv_51150; } ldv_51150: __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_51160; case 2UL: put_unaligned_le16(49162, __gu_p___3); goto ldv_51160; case 4UL: put_unaligned_le32(49162U, __gu_p___3); goto ldv_51160; case 8UL: put_unaligned_le64(49162ULL, __gu_p___3); goto ldv_51160; default: __bad_unaligned_access_size(); goto ldv_51160; } ldv_51160: 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_51167; case 2UL: put_unaligned_le16((int )((unsigned short )arg->shared_secret_len), __gu_p___4); goto ldv_51167; case 4UL: put_unaligned_le32((unsigned int )arg->shared_secret_len, __gu_p___4); goto ldv_51167; case 8UL: put_unaligned_le64((unsigned long long )arg->shared_secret_len, __gu_p___4); goto ldv_51167; default: __bad_unaligned_access_size(); goto ldv_51167; } ldv_51167: __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_51177; case 2UL: put_unaligned_le16(49163, __gu_p___5); goto ldv_51177; case 4UL: put_unaligned_le32(49163U, __gu_p___5); goto ldv_51177; case 8UL: put_unaligned_le64(49163ULL, __gu_p___5); goto ldv_51177; default: __bad_unaligned_access_size(); goto ldv_51177; } ldv_51177: 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_51184; case 2UL: put_unaligned_le16((int )((unsigned short )arg->cram_hmac_alg_len), __gu_p___6); goto ldv_51184; case 4UL: put_unaligned_le32((unsigned int )arg->cram_hmac_alg_len, __gu_p___6); goto ldv_51184; case 8UL: put_unaligned_le64((unsigned long long )arg->cram_hmac_alg_len, __gu_p___6); goto ldv_51184; default: __bad_unaligned_access_size(); goto ldv_51184; } ldv_51184: __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_51194; case 2UL: put_unaligned_le16(49196, __gu_p___7); goto ldv_51194; case 4UL: put_unaligned_le32(49196U, __gu_p___7); goto ldv_51194; case 8UL: put_unaligned_le64(49196ULL, __gu_p___7); goto ldv_51194; default: __bad_unaligned_access_size(); goto ldv_51194; } ldv_51194: 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_51201; case 2UL: put_unaligned_le16((int )((unsigned short )arg->integrity_alg_len), __gu_p___8); goto ldv_51201; case 4UL: put_unaligned_le32((unsigned int )arg->integrity_alg_len, __gu_p___8); goto ldv_51201; case 8UL: put_unaligned_le64((unsigned long long )arg->integrity_alg_len, __gu_p___8); goto ldv_51201; default: __bad_unaligned_access_size(); goto ldv_51201; } ldv_51201: __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_51211; case 2UL: put_unaligned_le16(14, __gu_p___9); goto ldv_51211; case 4UL: put_unaligned_le32(14U, __gu_p___9); goto ldv_51211; case 8UL: put_unaligned_le64(14ULL, __gu_p___9); goto ldv_51211; default: __bad_unaligned_access_size(); goto ldv_51211; } ldv_51211: tmp___10 = tags; tags = tags + 1; __gu_p___10 = (void *)tmp___10; switch (2UL) { case 1UL: *((u8 *)__gu_p___10) = 4U; goto ldv_51218; case 2UL: put_unaligned_le16(4, __gu_p___10); goto ldv_51218; case 4UL: put_unaligned_le32(4U, __gu_p___10); goto ldv_51218; case 8UL: put_unaligned_le64(4ULL, __gu_p___10); goto ldv_51218; default: __bad_unaligned_access_size(); goto ldv_51218; } ldv_51218: __gu_p___11 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___11) = (unsigned char )arg->timeout; goto ldv_51225; case 2UL: put_unaligned_le16((int )((unsigned short )arg->timeout), __gu_p___11); goto ldv_51225; case 4UL: put_unaligned_le32((unsigned int )arg->timeout, __gu_p___11); goto ldv_51225; case 8UL: put_unaligned_le64((unsigned long long )arg->timeout, __gu_p___11); goto ldv_51225; default: __bad_unaligned_access_size(); goto ldv_51225; } ldv_51225: 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_51232; case 2UL: put_unaligned_le16(8207, __gu_p___12); goto ldv_51232; case 4UL: put_unaligned_le32(8207U, __gu_p___12); goto ldv_51232; case 8UL: put_unaligned_le64(8207ULL, __gu_p___12); goto ldv_51232; default: __bad_unaligned_access_size(); goto ldv_51232; } ldv_51232: tmp___12 = tags; tags = tags + 1; __gu_p___13 = (void *)tmp___12; switch (2UL) { case 1UL: *((u8 *)__gu_p___13) = 4U; goto ldv_51239; case 2UL: put_unaligned_le16(4, __gu_p___13); goto ldv_51239; case 4UL: put_unaligned_le32(4U, __gu_p___13); goto ldv_51239; case 8UL: put_unaligned_le64(4ULL, __gu_p___13); goto ldv_51239; default: __bad_unaligned_access_size(); goto ldv_51239; } ldv_51239: __gu_p___14 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___14) = (unsigned char )arg->wire_protocol; goto ldv_51246; case 2UL: put_unaligned_le16((int )((unsigned short )arg->wire_protocol), __gu_p___14); goto ldv_51246; case 4UL: put_unaligned_le32((unsigned int )arg->wire_protocol, __gu_p___14); goto ldv_51246; case 8UL: put_unaligned_le64((unsigned long long )arg->wire_protocol, __gu_p___14); goto ldv_51246; default: __bad_unaligned_access_size(); goto ldv_51246; } ldv_51246: 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_51253; case 2UL: put_unaligned_le16(16, __gu_p___15); goto ldv_51253; case 4UL: put_unaligned_le32(16U, __gu_p___15); goto ldv_51253; case 8UL: put_unaligned_le64(16ULL, __gu_p___15); goto ldv_51253; default: __bad_unaligned_access_size(); goto ldv_51253; } ldv_51253: tmp___14 = tags; tags = tags + 1; __gu_p___16 = (void *)tmp___14; switch (2UL) { case 1UL: *((u8 *)__gu_p___16) = 4U; goto ldv_51260; case 2UL: put_unaligned_le16(4, __gu_p___16); goto ldv_51260; case 4UL: put_unaligned_le32(4U, __gu_p___16); goto ldv_51260; case 8UL: put_unaligned_le64(4ULL, __gu_p___16); goto ldv_51260; default: __bad_unaligned_access_size(); goto ldv_51260; } ldv_51260: __gu_p___17 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___17) = (unsigned char )arg->try_connect_int; goto ldv_51267; case 2UL: put_unaligned_le16((int )((unsigned short )arg->try_connect_int), __gu_p___17); goto ldv_51267; case 4UL: put_unaligned_le32((unsigned int )arg->try_connect_int, __gu_p___17); goto ldv_51267; case 8UL: put_unaligned_le64((unsigned long long )arg->try_connect_int, __gu_p___17); goto ldv_51267; default: __bad_unaligned_access_size(); goto ldv_51267; } ldv_51267: 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_51274; case 2UL: put_unaligned_le16(17, __gu_p___18); goto ldv_51274; case 4UL: put_unaligned_le32(17U, __gu_p___18); goto ldv_51274; case 8UL: put_unaligned_le64(17ULL, __gu_p___18); goto ldv_51274; default: __bad_unaligned_access_size(); goto ldv_51274; } ldv_51274: tmp___16 = tags; tags = tags + 1; __gu_p___19 = (void *)tmp___16; switch (2UL) { case 1UL: *((u8 *)__gu_p___19) = 4U; goto ldv_51281; case 2UL: put_unaligned_le16(4, __gu_p___19); goto ldv_51281; case 4UL: put_unaligned_le32(4U, __gu_p___19); goto ldv_51281; case 8UL: put_unaligned_le64(4ULL, __gu_p___19); goto ldv_51281; default: __bad_unaligned_access_size(); goto ldv_51281; } ldv_51281: __gu_p___20 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___20) = (unsigned char )arg->ping_int; goto ldv_51288; case 2UL: put_unaligned_le16((int )((unsigned short )arg->ping_int), __gu_p___20); goto ldv_51288; case 4UL: put_unaligned_le32((unsigned int )arg->ping_int, __gu_p___20); goto ldv_51288; case 8UL: put_unaligned_le64((unsigned long long )arg->ping_int, __gu_p___20); goto ldv_51288; default: __bad_unaligned_access_size(); goto ldv_51288; } ldv_51288: 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_51295; case 2UL: put_unaligned_le16(18, __gu_p___21); goto ldv_51295; case 4UL: put_unaligned_le32(18U, __gu_p___21); goto ldv_51295; case 8UL: put_unaligned_le64(18ULL, __gu_p___21); goto ldv_51295; default: __bad_unaligned_access_size(); goto ldv_51295; } ldv_51295: tmp___18 = tags; tags = tags + 1; __gu_p___22 = (void *)tmp___18; switch (2UL) { case 1UL: *((u8 *)__gu_p___22) = 4U; goto ldv_51302; case 2UL: put_unaligned_le16(4, __gu_p___22); goto ldv_51302; case 4UL: put_unaligned_le32(4U, __gu_p___22); goto ldv_51302; case 8UL: put_unaligned_le64(4ULL, __gu_p___22); goto ldv_51302; default: __bad_unaligned_access_size(); goto ldv_51302; } ldv_51302: __gu_p___23 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___23) = (unsigned char )arg->max_epoch_size; goto ldv_51309; case 2UL: put_unaligned_le16((int )((unsigned short )arg->max_epoch_size), __gu_p___23); goto ldv_51309; case 4UL: put_unaligned_le32((unsigned int )arg->max_epoch_size, __gu_p___23); goto ldv_51309; case 8UL: put_unaligned_le64((unsigned long long )arg->max_epoch_size, __gu_p___23); goto ldv_51309; default: __bad_unaligned_access_size(); goto ldv_51309; } ldv_51309: 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_51316; case 2UL: put_unaligned_le16(19, __gu_p___24); goto ldv_51316; case 4UL: put_unaligned_le32(19U, __gu_p___24); goto ldv_51316; case 8UL: put_unaligned_le64(19ULL, __gu_p___24); goto ldv_51316; default: __bad_unaligned_access_size(); goto ldv_51316; } ldv_51316: tmp___20 = tags; tags = tags + 1; __gu_p___25 = (void *)tmp___20; switch (2UL) { case 1UL: *((u8 *)__gu_p___25) = 4U; goto ldv_51323; case 2UL: put_unaligned_le16(4, __gu_p___25); goto ldv_51323; case 4UL: put_unaligned_le32(4U, __gu_p___25); goto ldv_51323; case 8UL: put_unaligned_le64(4ULL, __gu_p___25); goto ldv_51323; default: __bad_unaligned_access_size(); goto ldv_51323; } ldv_51323: __gu_p___26 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___26) = (unsigned char )arg->max_buffers; goto ldv_51330; case 2UL: put_unaligned_le16((int )((unsigned short )arg->max_buffers), __gu_p___26); goto ldv_51330; case 4UL: put_unaligned_le32((unsigned int )arg->max_buffers, __gu_p___26); goto ldv_51330; case 8UL: put_unaligned_le64((unsigned long long )arg->max_buffers, __gu_p___26); goto ldv_51330; default: __bad_unaligned_access_size(); goto ldv_51330; } ldv_51330: 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_51337; case 2UL: put_unaligned_le16(20, __gu_p___27); goto ldv_51337; case 4UL: put_unaligned_le32(20U, __gu_p___27); goto ldv_51337; case 8UL: put_unaligned_le64(20ULL, __gu_p___27); goto ldv_51337; default: __bad_unaligned_access_size(); goto ldv_51337; } ldv_51337: tmp___22 = tags; tags = tags + 1; __gu_p___28 = (void *)tmp___22; switch (2UL) { case 1UL: *((u8 *)__gu_p___28) = 4U; goto ldv_51344; case 2UL: put_unaligned_le16(4, __gu_p___28); goto ldv_51344; case 4UL: put_unaligned_le32(4U, __gu_p___28); goto ldv_51344; case 8UL: put_unaligned_le64(4ULL, __gu_p___28); goto ldv_51344; default: __bad_unaligned_access_size(); goto ldv_51344; } ldv_51344: __gu_p___29 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___29) = (unsigned char )arg->unplug_watermark; goto ldv_51351; case 2UL: put_unaligned_le16((int )((unsigned short )arg->unplug_watermark), __gu_p___29); goto ldv_51351; case 4UL: put_unaligned_le32((unsigned int )arg->unplug_watermark, __gu_p___29); goto ldv_51351; case 8UL: put_unaligned_le64((unsigned long long )arg->unplug_watermark, __gu_p___29); goto ldv_51351; default: __bad_unaligned_access_size(); goto ldv_51351; } ldv_51351: 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_51358; case 2UL: put_unaligned_le16(21, __gu_p___30); goto ldv_51358; case 4UL: put_unaligned_le32(21U, __gu_p___30); goto ldv_51358; case 8UL: put_unaligned_le64(21ULL, __gu_p___30); goto ldv_51358; default: __bad_unaligned_access_size(); goto ldv_51358; } ldv_51358: tmp___24 = tags; tags = tags + 1; __gu_p___31 = (void *)tmp___24; switch (2UL) { case 1UL: *((u8 *)__gu_p___31) = 4U; goto ldv_51365; case 2UL: put_unaligned_le16(4, __gu_p___31); goto ldv_51365; case 4UL: put_unaligned_le32(4U, __gu_p___31); goto ldv_51365; case 8UL: put_unaligned_le64(4ULL, __gu_p___31); goto ldv_51365; default: __bad_unaligned_access_size(); goto ldv_51365; } ldv_51365: __gu_p___32 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___32) = (unsigned char )arg->sndbuf_size; goto ldv_51372; case 2UL: put_unaligned_le16((int )((unsigned short )arg->sndbuf_size), __gu_p___32); goto ldv_51372; case 4UL: put_unaligned_le32((unsigned int )arg->sndbuf_size, __gu_p___32); goto ldv_51372; case 8UL: put_unaligned_le64((unsigned long long )arg->sndbuf_size, __gu_p___32); goto ldv_51372; default: __bad_unaligned_access_size(); goto ldv_51372; } ldv_51372: 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_51379; case 2UL: put_unaligned_le16(22, __gu_p___33); goto ldv_51379; case 4UL: put_unaligned_le32(22U, __gu_p___33); goto ldv_51379; case 8UL: put_unaligned_le64(22ULL, __gu_p___33); goto ldv_51379; default: __bad_unaligned_access_size(); goto ldv_51379; } ldv_51379: tmp___26 = tags; tags = tags + 1; __gu_p___34 = (void *)tmp___26; switch (2UL) { case 1UL: *((u8 *)__gu_p___34) = 4U; goto ldv_51386; case 2UL: put_unaligned_le16(4, __gu_p___34); goto ldv_51386; case 4UL: put_unaligned_le32(4U, __gu_p___34); goto ldv_51386; case 8UL: put_unaligned_le64(4ULL, __gu_p___34); goto ldv_51386; default: __bad_unaligned_access_size(); goto ldv_51386; } ldv_51386: __gu_p___35 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___35) = (unsigned char )arg->ko_count; goto ldv_51393; case 2UL: put_unaligned_le16((int )((unsigned short )arg->ko_count), __gu_p___35); goto ldv_51393; case 4UL: put_unaligned_le32((unsigned int )arg->ko_count, __gu_p___35); goto ldv_51393; case 8UL: put_unaligned_le64((unsigned long long )arg->ko_count, __gu_p___35); goto ldv_51393; default: __bad_unaligned_access_size(); goto ldv_51393; } ldv_51393: 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_51400; case 2UL: put_unaligned_le16(24, __gu_p___36); goto ldv_51400; case 4UL: put_unaligned_le32(24U, __gu_p___36); goto ldv_51400; case 8UL: put_unaligned_le64(24ULL, __gu_p___36); goto ldv_51400; default: __bad_unaligned_access_size(); goto ldv_51400; } ldv_51400: tmp___28 = tags; tags = tags + 1; __gu_p___37 = (void *)tmp___28; switch (2UL) { case 1UL: *((u8 *)__gu_p___37) = 4U; goto ldv_51407; case 2UL: put_unaligned_le16(4, __gu_p___37); goto ldv_51407; case 4UL: put_unaligned_le32(4U, __gu_p___37); goto ldv_51407; case 8UL: put_unaligned_le64(4ULL, __gu_p___37); goto ldv_51407; default: __bad_unaligned_access_size(); goto ldv_51407; } ldv_51407: __gu_p___38 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___38) = (unsigned char )arg->after_sb_0p; goto ldv_51414; case 2UL: put_unaligned_le16((int )((unsigned short )arg->after_sb_0p), __gu_p___38); goto ldv_51414; case 4UL: put_unaligned_le32((unsigned int )arg->after_sb_0p, __gu_p___38); goto ldv_51414; case 8UL: put_unaligned_le64((unsigned long long )arg->after_sb_0p, __gu_p___38); goto ldv_51414; default: __bad_unaligned_access_size(); goto ldv_51414; } ldv_51414: 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_51421; case 2UL: put_unaligned_le16(25, __gu_p___39); goto ldv_51421; case 4UL: put_unaligned_le32(25U, __gu_p___39); goto ldv_51421; case 8UL: put_unaligned_le64(25ULL, __gu_p___39); goto ldv_51421; default: __bad_unaligned_access_size(); goto ldv_51421; } ldv_51421: tmp___30 = tags; tags = tags + 1; __gu_p___40 = (void *)tmp___30; switch (2UL) { case 1UL: *((u8 *)__gu_p___40) = 4U; goto ldv_51428; case 2UL: put_unaligned_le16(4, __gu_p___40); goto ldv_51428; case 4UL: put_unaligned_le32(4U, __gu_p___40); goto ldv_51428; case 8UL: put_unaligned_le64(4ULL, __gu_p___40); goto ldv_51428; default: __bad_unaligned_access_size(); goto ldv_51428; } ldv_51428: __gu_p___41 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___41) = (unsigned char )arg->after_sb_1p; goto ldv_51435; case 2UL: put_unaligned_le16((int )((unsigned short )arg->after_sb_1p), __gu_p___41); goto ldv_51435; case 4UL: put_unaligned_le32((unsigned int )arg->after_sb_1p, __gu_p___41); goto ldv_51435; case 8UL: put_unaligned_le64((unsigned long long )arg->after_sb_1p, __gu_p___41); goto ldv_51435; default: __bad_unaligned_access_size(); goto ldv_51435; } ldv_51435: 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_51442; case 2UL: put_unaligned_le16(26, __gu_p___42); goto ldv_51442; case 4UL: put_unaligned_le32(26U, __gu_p___42); goto ldv_51442; case 8UL: put_unaligned_le64(26ULL, __gu_p___42); goto ldv_51442; default: __bad_unaligned_access_size(); goto ldv_51442; } ldv_51442: tmp___32 = tags; tags = tags + 1; __gu_p___43 = (void *)tmp___32; switch (2UL) { case 1UL: *((u8 *)__gu_p___43) = 4U; goto ldv_51449; case 2UL: put_unaligned_le16(4, __gu_p___43); goto ldv_51449; case 4UL: put_unaligned_le32(4U, __gu_p___43); goto ldv_51449; case 8UL: put_unaligned_le64(4ULL, __gu_p___43); goto ldv_51449; default: __bad_unaligned_access_size(); goto ldv_51449; } ldv_51449: __gu_p___44 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___44) = (unsigned char )arg->after_sb_2p; goto ldv_51456; case 2UL: put_unaligned_le16((int )((unsigned short )arg->after_sb_2p), __gu_p___44); goto ldv_51456; case 4UL: put_unaligned_le32((unsigned int )arg->after_sb_2p, __gu_p___44); goto ldv_51456; case 8UL: put_unaligned_le64((unsigned long long )arg->after_sb_2p, __gu_p___44); goto ldv_51456; default: __bad_unaligned_access_size(); goto ldv_51456; } ldv_51456: 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_51463; case 2UL: put_unaligned_le16(39, __gu_p___45); goto ldv_51463; case 4UL: put_unaligned_le32(39U, __gu_p___45); goto ldv_51463; case 8UL: put_unaligned_le64(39ULL, __gu_p___45); goto ldv_51463; default: __bad_unaligned_access_size(); goto ldv_51463; } ldv_51463: tmp___34 = tags; tags = tags + 1; __gu_p___46 = (void *)tmp___34; switch (2UL) { case 1UL: *((u8 *)__gu_p___46) = 4U; goto ldv_51470; case 2UL: put_unaligned_le16(4, __gu_p___46); goto ldv_51470; case 4UL: put_unaligned_le32(4U, __gu_p___46); goto ldv_51470; case 8UL: put_unaligned_le64(4ULL, __gu_p___46); goto ldv_51470; default: __bad_unaligned_access_size(); goto ldv_51470; } ldv_51470: __gu_p___47 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___47) = (unsigned char )arg->rr_conflict; goto ldv_51477; case 2UL: put_unaligned_le16((int )((unsigned short )arg->rr_conflict), __gu_p___47); goto ldv_51477; case 4UL: put_unaligned_le32((unsigned int )arg->rr_conflict, __gu_p___47); goto ldv_51477; case 8UL: put_unaligned_le64((unsigned long long )arg->rr_conflict, __gu_p___47); goto ldv_51477; default: __bad_unaligned_access_size(); goto ldv_51477; } ldv_51477: 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_51484; case 2UL: put_unaligned_le16(40, __gu_p___48); goto ldv_51484; case 4UL: put_unaligned_le32(40U, __gu_p___48); goto ldv_51484; case 8UL: put_unaligned_le64(40ULL, __gu_p___48); goto ldv_51484; default: __bad_unaligned_access_size(); goto ldv_51484; } ldv_51484: tmp___36 = tags; tags = tags + 1; __gu_p___49 = (void *)tmp___36; switch (2UL) { case 1UL: *((u8 *)__gu_p___49) = 4U; goto ldv_51491; case 2UL: put_unaligned_le16(4, __gu_p___49); goto ldv_51491; case 4UL: put_unaligned_le32(4U, __gu_p___49); goto ldv_51491; case 8UL: put_unaligned_le64(4ULL, __gu_p___49); goto ldv_51491; default: __bad_unaligned_access_size(); goto ldv_51491; } ldv_51491: __gu_p___50 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___50) = (unsigned char )arg->ping_timeo; goto ldv_51498; case 2UL: put_unaligned_le16((int )((unsigned short )arg->ping_timeo), __gu_p___50); goto ldv_51498; case 4UL: put_unaligned_le32((unsigned int )arg->ping_timeo, __gu_p___50); goto ldv_51498; case 8UL: put_unaligned_le64((unsigned long long )arg->ping_timeo, __gu_p___50); goto ldv_51498; default: __bad_unaligned_access_size(); goto ldv_51498; } ldv_51498: 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_51505; case 2UL: put_unaligned_le16(67, __gu_p___51); goto ldv_51505; case 4UL: put_unaligned_le32(67U, __gu_p___51); goto ldv_51505; case 8UL: put_unaligned_le64(67ULL, __gu_p___51); goto ldv_51505; default: __bad_unaligned_access_size(); goto ldv_51505; } ldv_51505: tmp___38 = tags; tags = tags + 1; __gu_p___52 = (void *)tmp___38; switch (2UL) { case 1UL: *((u8 *)__gu_p___52) = 4U; goto ldv_51512; case 2UL: put_unaligned_le16(4, __gu_p___52); goto ldv_51512; case 4UL: put_unaligned_le32(4U, __gu_p___52); goto ldv_51512; case 8UL: put_unaligned_le64(4ULL, __gu_p___52); goto ldv_51512; default: __bad_unaligned_access_size(); goto ldv_51512; } ldv_51512: __gu_p___53 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___53) = (unsigned char )arg->rcvbuf_size; goto ldv_51519; case 2UL: put_unaligned_le16((int )((unsigned short )arg->rcvbuf_size), __gu_p___53); goto ldv_51519; case 4UL: put_unaligned_le32((unsigned int )arg->rcvbuf_size, __gu_p___53); goto ldv_51519; case 8UL: put_unaligned_le64((unsigned long long )arg->rcvbuf_size, __gu_p___53); goto ldv_51519; default: __bad_unaligned_access_size(); goto ldv_51519; } ldv_51519: tags = tags + 4U; tmp___39 = tags; tags = tags + 1; __gu_p___54 = (void *)tmp___39; switch (2UL) { case 1UL: *((u8 *)__gu_p___54) = 81U; goto ldv_51526; case 2UL: put_unaligned_le16(81, __gu_p___54); goto ldv_51526; case 4UL: put_unaligned_le32(81U, __gu_p___54); goto ldv_51526; case 8UL: put_unaligned_le64(81ULL, __gu_p___54); goto ldv_51526; default: __bad_unaligned_access_size(); goto ldv_51526; } ldv_51526: tmp___40 = tags; tags = tags + 1; __gu_p___55 = (void *)tmp___40; switch (2UL) { case 1UL: *((u8 *)__gu_p___55) = 4U; goto ldv_51533; case 2UL: put_unaligned_le16(4, __gu_p___55); goto ldv_51533; case 4UL: put_unaligned_le32(4U, __gu_p___55); goto ldv_51533; case 8UL: put_unaligned_le64(4ULL, __gu_p___55); goto ldv_51533; default: __bad_unaligned_access_size(); goto ldv_51533; } ldv_51533: __gu_p___56 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___56) = (unsigned char )arg->on_congestion; goto ldv_51540; case 2UL: put_unaligned_le16((int )((unsigned short )arg->on_congestion), __gu_p___56); goto ldv_51540; case 4UL: put_unaligned_le32((unsigned int )arg->on_congestion, __gu_p___56); goto ldv_51540; case 8UL: put_unaligned_le64((unsigned long long )arg->on_congestion, __gu_p___56); goto ldv_51540; default: __bad_unaligned_access_size(); goto ldv_51540; } ldv_51540: tags = tags + 4U; tmp___41 = tags; tags = tags + 1; __gu_p___57 = (void *)tmp___41; switch (2UL) { case 1UL: *((u8 *)__gu_p___57) = 82U; goto ldv_51547; case 2UL: put_unaligned_le16(82, __gu_p___57); goto ldv_51547; case 4UL: put_unaligned_le32(82U, __gu_p___57); goto ldv_51547; case 8UL: put_unaligned_le64(82ULL, __gu_p___57); goto ldv_51547; default: __bad_unaligned_access_size(); goto ldv_51547; } ldv_51547: tmp___42 = tags; tags = tags + 1; __gu_p___58 = (void *)tmp___42; switch (2UL) { case 1UL: *((u8 *)__gu_p___58) = 4U; goto ldv_51554; case 2UL: put_unaligned_le16(4, __gu_p___58); goto ldv_51554; case 4UL: put_unaligned_le32(4U, __gu_p___58); goto ldv_51554; case 8UL: put_unaligned_le64(4ULL, __gu_p___58); goto ldv_51554; default: __bad_unaligned_access_size(); goto ldv_51554; } ldv_51554: __gu_p___59 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___59) = (unsigned char )arg->cong_fill; goto ldv_51561; case 2UL: put_unaligned_le16((int )((unsigned short )arg->cong_fill), __gu_p___59); goto ldv_51561; case 4UL: put_unaligned_le32((unsigned int )arg->cong_fill, __gu_p___59); goto ldv_51561; case 8UL: put_unaligned_le64((unsigned long long )arg->cong_fill, __gu_p___59); goto ldv_51561; default: __bad_unaligned_access_size(); goto ldv_51561; } ldv_51561: tags = tags + 4U; tmp___43 = tags; tags = tags + 1; __gu_p___60 = (void *)tmp___43; switch (2UL) { case 1UL: *((u8 *)__gu_p___60) = 83U; goto ldv_51568; case 2UL: put_unaligned_le16(83, __gu_p___60); goto ldv_51568; case 4UL: put_unaligned_le32(83U, __gu_p___60); goto ldv_51568; case 8UL: put_unaligned_le64(83ULL, __gu_p___60); goto ldv_51568; default: __bad_unaligned_access_size(); goto ldv_51568; } ldv_51568: tmp___44 = tags; tags = tags + 1; __gu_p___61 = (void *)tmp___44; switch (2UL) { case 1UL: *((u8 *)__gu_p___61) = 4U; goto ldv_51575; case 2UL: put_unaligned_le16(4, __gu_p___61); goto ldv_51575; case 4UL: put_unaligned_le32(4U, __gu_p___61); goto ldv_51575; case 8UL: put_unaligned_le64(4ULL, __gu_p___61); goto ldv_51575; default: __bad_unaligned_access_size(); goto ldv_51575; } ldv_51575: __gu_p___62 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___62) = (unsigned char )arg->cong_extents; goto ldv_51582; case 2UL: put_unaligned_le16((int )((unsigned short )arg->cong_extents), __gu_p___62); goto ldv_51582; case 4UL: put_unaligned_le32((unsigned int )arg->cong_extents, __gu_p___62); goto ldv_51582; case 8UL: put_unaligned_le64((unsigned long long )arg->cong_extents, __gu_p___62); goto ldv_51582; default: __bad_unaligned_access_size(); goto ldv_51582; } ldv_51582: tags = tags + 4U; tmp___45 = tags; tags = tags + 1; __gu_p___63 = (void *)tmp___45; switch (2UL) { case 1UL: *((u8 *)__gu_p___63) = 60U; goto ldv_51589; case 2UL: put_unaligned_le16(41020, __gu_p___63); goto ldv_51589; case 4UL: put_unaligned_le32(41020U, __gu_p___63); goto ldv_51589; case 8UL: put_unaligned_le64(41020ULL, __gu_p___63); goto ldv_51589; default: __bad_unaligned_access_size(); goto ldv_51589; } ldv_51589: tmp___46 = tags; tags = tags + 1; __gu_p___64 = (void *)tmp___46; switch (2UL) { case 1UL: *((u8 *)__gu_p___64) = 1U; goto ldv_51596; case 2UL: put_unaligned_le16(1, __gu_p___64); goto ldv_51596; case 4UL: put_unaligned_le32(1U, __gu_p___64); goto ldv_51596; case 8UL: put_unaligned_le64(1ULL, __gu_p___64); goto ldv_51596; default: __bad_unaligned_access_size(); goto ldv_51596; } ldv_51596: *((char *)tags) = (char )arg->mind_af; tags = tags + 1U; tmp___47 = tags; tags = tags + 1; __gu_p___65 = (void *)tmp___47; switch (2UL) { case 1UL: *((u8 *)__gu_p___65) = 27U; goto ldv_51603; case 2UL: put_unaligned_le16(32795, __gu_p___65); goto ldv_51603; case 4UL: put_unaligned_le32(32795U, __gu_p___65); goto ldv_51603; case 8UL: put_unaligned_le64(32795ULL, __gu_p___65); goto ldv_51603; default: __bad_unaligned_access_size(); goto ldv_51603; } ldv_51603: tmp___48 = tags; tags = tags + 1; __gu_p___66 = (void *)tmp___48; switch (2UL) { case 1UL: *((u8 *)__gu_p___66) = 1U; goto ldv_51610; case 2UL: put_unaligned_le16(1, __gu_p___66); goto ldv_51610; case 4UL: put_unaligned_le32(1U, __gu_p___66); goto ldv_51610; case 8UL: put_unaligned_le64(1ULL, __gu_p___66); goto ldv_51610; default: __bad_unaligned_access_size(); goto ldv_51610; } ldv_51610: *((char *)tags) = (char )arg->want_lose; tags = tags + 1U; tmp___49 = tags; tags = tags + 1; __gu_p___67 = (void *)tmp___49; switch (2UL) { case 1UL: *((u8 *)__gu_p___67) = 28U; goto ldv_51617; case 2UL: put_unaligned_le16(32796, __gu_p___67); goto ldv_51617; case 4UL: put_unaligned_le32(32796U, __gu_p___67); goto ldv_51617; case 8UL: put_unaligned_le64(32796ULL, __gu_p___67); goto ldv_51617; default: __bad_unaligned_access_size(); goto ldv_51617; } ldv_51617: tmp___50 = tags; tags = tags + 1; __gu_p___68 = (void *)tmp___50; switch (2UL) { case 1UL: *((u8 *)__gu_p___68) = 1U; goto ldv_51624; case 2UL: put_unaligned_le16(1, __gu_p___68); goto ldv_51624; case 4UL: put_unaligned_le32(1U, __gu_p___68); goto ldv_51624; case 8UL: put_unaligned_le64(1ULL, __gu_p___68); goto ldv_51624; default: __bad_unaligned_access_size(); goto ldv_51624; } ldv_51624: *((char *)tags) = (char )arg->two_primaries; tags = tags + 1U; tmp___51 = tags; tags = tags + 1; __gu_p___69 = (void *)tmp___51; switch (2UL) { case 1UL: *((u8 *)__gu_p___69) = 41U; goto ldv_51631; case 2UL: put_unaligned_le16(32809, __gu_p___69); goto ldv_51631; case 4UL: put_unaligned_le32(32809U, __gu_p___69); goto ldv_51631; case 8UL: put_unaligned_le64(32809ULL, __gu_p___69); goto ldv_51631; default: __bad_unaligned_access_size(); goto ldv_51631; } ldv_51631: tmp___52 = tags; tags = tags + 1; __gu_p___70 = (void *)tmp___52; switch (2UL) { case 1UL: *((u8 *)__gu_p___70) = 1U; goto ldv_51638; case 2UL: put_unaligned_le16(1, __gu_p___70); goto ldv_51638; case 4UL: put_unaligned_le32(1U, __gu_p___70); goto ldv_51638; case 8UL: put_unaligned_le64(1ULL, __gu_p___70); goto ldv_51638; default: __bad_unaligned_access_size(); goto ldv_51638; } ldv_51638: *((char *)tags) = (char )arg->always_asbp; tags = tags + 1U; tmp___53 = tags; tags = tags + 1; __gu_p___71 = (void *)tmp___53; switch (2UL) { case 1UL: *((u8 *)__gu_p___71) = 61U; goto ldv_51645; case 2UL: put_unaligned_le16(32829, __gu_p___71); goto ldv_51645; case 4UL: put_unaligned_le32(32829U, __gu_p___71); goto ldv_51645; case 8UL: put_unaligned_le64(32829ULL, __gu_p___71); goto ldv_51645; default: __bad_unaligned_access_size(); goto ldv_51645; } ldv_51645: tmp___54 = tags; tags = tags + 1; __gu_p___72 = (void *)tmp___54; switch (2UL) { case 1UL: *((u8 *)__gu_p___72) = 1U; goto ldv_51652; case 2UL: put_unaligned_le16(1, __gu_p___72); goto ldv_51652; case 4UL: put_unaligned_le32(1U, __gu_p___72); goto ldv_51652; case 8UL: put_unaligned_le64(1ULL, __gu_p___72); goto ldv_51652; default: __bad_unaligned_access_size(); goto ldv_51652; } ldv_51652: *((char *)tags) = (char )arg->no_cork; tags = tags + 1U; tmp___55 = tags; tags = tags + 1; __gu_p___73 = (void *)tmp___55; switch (2UL) { case 1UL: *((u8 *)__gu_p___73) = 62U; goto ldv_51659; case 2UL: put_unaligned_le16(41022, __gu_p___73); goto ldv_51659; case 4UL: put_unaligned_le32(41022U, __gu_p___73); goto ldv_51659; case 8UL: put_unaligned_le64(41022ULL, __gu_p___73); goto ldv_51659; default: __bad_unaligned_access_size(); goto ldv_51659; } ldv_51659: tmp___56 = tags; tags = tags + 1; __gu_p___74 = (void *)tmp___56; switch (2UL) { case 1UL: *((u8 *)__gu_p___74) = 1U; goto ldv_51666; case 2UL: put_unaligned_le16(1, __gu_p___74); goto ldv_51666; case 4UL: put_unaligned_le32(1U, __gu_p___74); goto ldv_51666; case 8UL: put_unaligned_le64(1ULL, __gu_p___74); goto ldv_51666; default: __bad_unaligned_access_size(); goto ldv_51666; } ldv_51666: *((char *)tags) = (char )arg->auto_sndbuf_size; tags = tags + 1U; tmp___57 = tags; tags = tags + 1; __gu_p___75 = (void *)tmp___57; switch (2UL) { case 1UL: *((u8 *)__gu_p___75) = 70U; goto ldv_51673; case 2UL: put_unaligned_le16(41030, __gu_p___75); goto ldv_51673; case 4UL: put_unaligned_le32(41030U, __gu_p___75); goto ldv_51673; case 8UL: put_unaligned_le64(41030ULL, __gu_p___75); goto ldv_51673; default: __bad_unaligned_access_size(); goto ldv_51673; } ldv_51673: tmp___58 = tags; tags = tags + 1; __gu_p___76 = (void *)tmp___58; switch (2UL) { case 1UL: *((u8 *)__gu_p___76) = 1U; goto ldv_51680; case 2UL: put_unaligned_le16(1, __gu_p___76); goto ldv_51680; case 4UL: put_unaligned_le32(1U, __gu_p___76); goto ldv_51680; case 8UL: put_unaligned_le64(1ULL, __gu_p___76); goto ldv_51680; default: __bad_unaligned_access_size(); goto ldv_51680; } ldv_51680: *((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_51777; case 2UL: put_unaligned_le16(30, __gu_p); goto ldv_51777; case 4UL: put_unaligned_le32(30U, __gu_p); goto ldv_51777; case 8UL: put_unaligned_le64(30ULL, __gu_p); goto ldv_51777; default: __bad_unaligned_access_size(); goto ldv_51777; } ldv_51777: tmp___0 = tags; tags = tags + 1; __gu_p___0 = (void *)tmp___0; switch (2UL) { case 1UL: *((u8 *)__gu_p___0) = 4U; goto ldv_51784; case 2UL: put_unaligned_le16(4, __gu_p___0); goto ldv_51784; case 4UL: put_unaligned_le32(4U, __gu_p___0); goto ldv_51784; case 8UL: put_unaligned_le64(4ULL, __gu_p___0); goto ldv_51784; default: __bad_unaligned_access_size(); goto ldv_51784; } ldv_51784: __gu_p___1 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___1) = (unsigned char )arg->rate; goto ldv_51791; case 2UL: put_unaligned_le16((int )((unsigned short )arg->rate), __gu_p___1); goto ldv_51791; case 4UL: put_unaligned_le32((unsigned int )arg->rate, __gu_p___1); goto ldv_51791; case 8UL: put_unaligned_le64((unsigned long long )arg->rate, __gu_p___1); goto ldv_51791; default: __bad_unaligned_access_size(); goto ldv_51791; } ldv_51791: 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_51798; case 2UL: put_unaligned_le16(31, __gu_p___2); goto ldv_51798; case 4UL: put_unaligned_le32(31U, __gu_p___2); goto ldv_51798; case 8UL: put_unaligned_le64(31ULL, __gu_p___2); goto ldv_51798; default: __bad_unaligned_access_size(); goto ldv_51798; } ldv_51798: tmp___2 = tags; tags = tags + 1; __gu_p___3 = (void *)tmp___2; switch (2UL) { case 1UL: *((u8 *)__gu_p___3) = 4U; goto ldv_51805; case 2UL: put_unaligned_le16(4, __gu_p___3); goto ldv_51805; case 4UL: put_unaligned_le32(4U, __gu_p___3); goto ldv_51805; case 8UL: put_unaligned_le64(4ULL, __gu_p___3); goto ldv_51805; default: __bad_unaligned_access_size(); goto ldv_51805; } ldv_51805: __gu_p___4 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___4) = (unsigned char )arg->after; goto ldv_51812; case 2UL: put_unaligned_le16((int )((unsigned short )arg->after), __gu_p___4); goto ldv_51812; case 4UL: put_unaligned_le32((unsigned int )arg->after, __gu_p___4); goto ldv_51812; case 8UL: put_unaligned_le64((unsigned long long )arg->after, __gu_p___4); goto ldv_51812; default: __bad_unaligned_access_size(); goto ldv_51812; } ldv_51812: 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_51819; case 2UL: put_unaligned_le16(32, __gu_p___5); goto ldv_51819; case 4UL: put_unaligned_le32(32U, __gu_p___5); goto ldv_51819; case 8UL: put_unaligned_le64(32ULL, __gu_p___5); goto ldv_51819; default: __bad_unaligned_access_size(); goto ldv_51819; } ldv_51819: tmp___4 = tags; tags = tags + 1; __gu_p___6 = (void *)tmp___4; switch (2UL) { case 1UL: *((u8 *)__gu_p___6) = 4U; goto ldv_51826; case 2UL: put_unaligned_le16(4, __gu_p___6); goto ldv_51826; case 4UL: put_unaligned_le32(4U, __gu_p___6); goto ldv_51826; case 8UL: put_unaligned_le64(4ULL, __gu_p___6); goto ldv_51826; default: __bad_unaligned_access_size(); goto ldv_51826; } ldv_51826: __gu_p___7 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___7) = (unsigned char )arg->al_extents; goto ldv_51833; case 2UL: put_unaligned_le16((int )((unsigned short )arg->al_extents), __gu_p___7); goto ldv_51833; case 4UL: put_unaligned_le32((unsigned int )arg->al_extents, __gu_p___7); goto ldv_51833; case 8UL: put_unaligned_le64((unsigned long long )arg->al_extents, __gu_p___7); goto ldv_51833; default: __bad_unaligned_access_size(); goto ldv_51833; } ldv_51833: 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_51840; case 2UL: put_unaligned_le16(49204, __gu_p___8); goto ldv_51840; case 4UL: put_unaligned_le32(49204U, __gu_p___8); goto ldv_51840; case 8UL: put_unaligned_le64(49204ULL, __gu_p___8); goto ldv_51840; default: __bad_unaligned_access_size(); goto ldv_51840; } ldv_51840: 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_51847; case 2UL: put_unaligned_le16((int )((unsigned short )arg->verify_alg_len), __gu_p___9); goto ldv_51847; case 4UL: put_unaligned_le32((unsigned int )arg->verify_alg_len, __gu_p___9); goto ldv_51847; case 8UL: put_unaligned_le64((unsigned long long )arg->verify_alg_len, __gu_p___9); goto ldv_51847; default: __bad_unaligned_access_size(); goto ldv_51847; } ldv_51847: __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_51857; case 2UL: put_unaligned_le16(49203, __gu_p___10); goto ldv_51857; case 4UL: put_unaligned_le32(49203U, __gu_p___10); goto ldv_51857; case 8UL: put_unaligned_le64(49203ULL, __gu_p___10); goto ldv_51857; default: __bad_unaligned_access_size(); goto ldv_51857; } ldv_51857: 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_51864; case 2UL: put_unaligned_le16((int )((unsigned short )arg->cpu_mask_len), __gu_p___11); goto ldv_51864; case 4UL: put_unaligned_le32((unsigned int )arg->cpu_mask_len, __gu_p___11); goto ldv_51864; case 8UL: put_unaligned_le64((unsigned long long )arg->cpu_mask_len, __gu_p___11); goto ldv_51864; default: __bad_unaligned_access_size(); goto ldv_51864; } ldv_51864: __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_51874; case 2UL: put_unaligned_le16(49216, __gu_p___12); goto ldv_51874; case 4UL: put_unaligned_le32(49216U, __gu_p___12); goto ldv_51874; case 8UL: put_unaligned_le64(49216ULL, __gu_p___12); goto ldv_51874; default: __bad_unaligned_access_size(); goto ldv_51874; } ldv_51874: 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_51881; case 2UL: put_unaligned_le16((int )((unsigned short )arg->csums_alg_len), __gu_p___13); goto ldv_51881; case 4UL: put_unaligned_le32((unsigned int )arg->csums_alg_len, __gu_p___13); goto ldv_51881; case 8UL: put_unaligned_le64((unsigned long long )arg->csums_alg_len, __gu_p___13); goto ldv_51881; default: __bad_unaligned_access_size(); goto ldv_51881; } ldv_51881: __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_51891; case 2UL: put_unaligned_le16(32833, __gu_p___14); goto ldv_51891; case 4UL: put_unaligned_le32(32833U, __gu_p___14); goto ldv_51891; case 8UL: put_unaligned_le64(32833ULL, __gu_p___14); goto ldv_51891; default: __bad_unaligned_access_size(); goto ldv_51891; } ldv_51891: tmp___12 = tags; tags = tags + 1; __gu_p___15 = (void *)tmp___12; switch (2UL) { case 1UL: *((u8 *)__gu_p___15) = 1U; goto ldv_51898; case 2UL: put_unaligned_le16(1, __gu_p___15); goto ldv_51898; case 4UL: put_unaligned_le32(1U, __gu_p___15); goto ldv_51898; case 8UL: put_unaligned_le64(1ULL, __gu_p___15); goto ldv_51898; default: __bad_unaligned_access_size(); goto ldv_51898; } ldv_51898: *((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_51905; case 2UL: put_unaligned_le16(75, __gu_p___16); goto ldv_51905; case 4UL: put_unaligned_le32(75U, __gu_p___16); goto ldv_51905; case 8UL: put_unaligned_le64(75ULL, __gu_p___16); goto ldv_51905; default: __bad_unaligned_access_size(); goto ldv_51905; } ldv_51905: tmp___14 = tags; tags = tags + 1; __gu_p___17 = (void *)tmp___14; switch (2UL) { case 1UL: *((u8 *)__gu_p___17) = 4U; goto ldv_51912; case 2UL: put_unaligned_le16(4, __gu_p___17); goto ldv_51912; case 4UL: put_unaligned_le32(4U, __gu_p___17); goto ldv_51912; case 8UL: put_unaligned_le64(4ULL, __gu_p___17); goto ldv_51912; default: __bad_unaligned_access_size(); goto ldv_51912; } ldv_51912: __gu_p___18 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___18) = (unsigned char )arg->on_no_data; goto ldv_51919; case 2UL: put_unaligned_le16((int )((unsigned short )arg->on_no_data), __gu_p___18); goto ldv_51919; case 4UL: put_unaligned_le32((unsigned int )arg->on_no_data, __gu_p___18); goto ldv_51919; case 8UL: put_unaligned_le64((unsigned long long )arg->on_no_data, __gu_p___18); goto ldv_51919; default: __bad_unaligned_access_size(); goto ldv_51919; } ldv_51919: 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_51926; case 2UL: put_unaligned_le16(76, __gu_p___19); goto ldv_51926; case 4UL: put_unaligned_le32(76U, __gu_p___19); goto ldv_51926; case 8UL: put_unaligned_le64(76ULL, __gu_p___19); goto ldv_51926; default: __bad_unaligned_access_size(); goto ldv_51926; } ldv_51926: tmp___16 = tags; tags = tags + 1; __gu_p___20 = (void *)tmp___16; switch (2UL) { case 1UL: *((u8 *)__gu_p___20) = 4U; goto ldv_51933; case 2UL: put_unaligned_le16(4, __gu_p___20); goto ldv_51933; case 4UL: put_unaligned_le32(4U, __gu_p___20); goto ldv_51933; case 8UL: put_unaligned_le64(4ULL, __gu_p___20); goto ldv_51933; default: __bad_unaligned_access_size(); goto ldv_51933; } ldv_51933: __gu_p___21 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___21) = (unsigned char )arg->c_plan_ahead; goto ldv_51940; case 2UL: put_unaligned_le16((int )((unsigned short )arg->c_plan_ahead), __gu_p___21); goto ldv_51940; case 4UL: put_unaligned_le32((unsigned int )arg->c_plan_ahead, __gu_p___21); goto ldv_51940; case 8UL: put_unaligned_le64((unsigned long long )arg->c_plan_ahead, __gu_p___21); goto ldv_51940; default: __bad_unaligned_access_size(); goto ldv_51940; } ldv_51940: 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_51947; case 2UL: put_unaligned_le16(77, __gu_p___22); goto ldv_51947; case 4UL: put_unaligned_le32(77U, __gu_p___22); goto ldv_51947; case 8UL: put_unaligned_le64(77ULL, __gu_p___22); goto ldv_51947; default: __bad_unaligned_access_size(); goto ldv_51947; } ldv_51947: tmp___18 = tags; tags = tags + 1; __gu_p___23 = (void *)tmp___18; switch (2UL) { case 1UL: *((u8 *)__gu_p___23) = 4U; goto ldv_51954; case 2UL: put_unaligned_le16(4, __gu_p___23); goto ldv_51954; case 4UL: put_unaligned_le32(4U, __gu_p___23); goto ldv_51954; case 8UL: put_unaligned_le64(4ULL, __gu_p___23); goto ldv_51954; default: __bad_unaligned_access_size(); goto ldv_51954; } ldv_51954: __gu_p___24 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___24) = (unsigned char )arg->c_delay_target; goto ldv_51961; case 2UL: put_unaligned_le16((int )((unsigned short )arg->c_delay_target), __gu_p___24); goto ldv_51961; case 4UL: put_unaligned_le32((unsigned int )arg->c_delay_target, __gu_p___24); goto ldv_51961; case 8UL: put_unaligned_le64((unsigned long long )arg->c_delay_target, __gu_p___24); goto ldv_51961; default: __bad_unaligned_access_size(); goto ldv_51961; } ldv_51961: 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_51968; case 2UL: put_unaligned_le16(78, __gu_p___25); goto ldv_51968; case 4UL: put_unaligned_le32(78U, __gu_p___25); goto ldv_51968; case 8UL: put_unaligned_le64(78ULL, __gu_p___25); goto ldv_51968; default: __bad_unaligned_access_size(); goto ldv_51968; } ldv_51968: tmp___20 = tags; tags = tags + 1; __gu_p___26 = (void *)tmp___20; switch (2UL) { case 1UL: *((u8 *)__gu_p___26) = 4U; goto ldv_51975; case 2UL: put_unaligned_le16(4, __gu_p___26); goto ldv_51975; case 4UL: put_unaligned_le32(4U, __gu_p___26); goto ldv_51975; case 8UL: put_unaligned_le64(4ULL, __gu_p___26); goto ldv_51975; default: __bad_unaligned_access_size(); goto ldv_51975; } ldv_51975: __gu_p___27 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___27) = (unsigned char )arg->c_fill_target; goto ldv_51982; case 2UL: put_unaligned_le16((int )((unsigned short )arg->c_fill_target), __gu_p___27); goto ldv_51982; case 4UL: put_unaligned_le32((unsigned int )arg->c_fill_target, __gu_p___27); goto ldv_51982; case 8UL: put_unaligned_le64((unsigned long long )arg->c_fill_target, __gu_p___27); goto ldv_51982; default: __bad_unaligned_access_size(); goto ldv_51982; } ldv_51982: 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_51989; case 2UL: put_unaligned_le16(79, __gu_p___28); goto ldv_51989; case 4UL: put_unaligned_le32(79U, __gu_p___28); goto ldv_51989; case 8UL: put_unaligned_le64(79ULL, __gu_p___28); goto ldv_51989; default: __bad_unaligned_access_size(); goto ldv_51989; } ldv_51989: tmp___22 = tags; tags = tags + 1; __gu_p___29 = (void *)tmp___22; switch (2UL) { case 1UL: *((u8 *)__gu_p___29) = 4U; goto ldv_51996; case 2UL: put_unaligned_le16(4, __gu_p___29); goto ldv_51996; case 4UL: put_unaligned_le32(4U, __gu_p___29); goto ldv_51996; case 8UL: put_unaligned_le64(4ULL, __gu_p___29); goto ldv_51996; default: __bad_unaligned_access_size(); goto ldv_51996; } ldv_51996: __gu_p___30 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___30) = (unsigned char )arg->c_max_rate; goto ldv_52003; case 2UL: put_unaligned_le16((int )((unsigned short )arg->c_max_rate), __gu_p___30); goto ldv_52003; case 4UL: put_unaligned_le32((unsigned int )arg->c_max_rate, __gu_p___30); goto ldv_52003; case 8UL: put_unaligned_le64((unsigned long long )arg->c_max_rate, __gu_p___30); goto ldv_52003; default: __bad_unaligned_access_size(); goto ldv_52003; } ldv_52003: 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_52010; case 2UL: put_unaligned_le16(80, __gu_p___31); goto ldv_52010; case 4UL: put_unaligned_le32(80U, __gu_p___31); goto ldv_52010; case 8UL: put_unaligned_le64(80ULL, __gu_p___31); goto ldv_52010; default: __bad_unaligned_access_size(); goto ldv_52010; } ldv_52010: tmp___24 = tags; tags = tags + 1; __gu_p___32 = (void *)tmp___24; switch (2UL) { case 1UL: *((u8 *)__gu_p___32) = 4U; goto ldv_52017; case 2UL: put_unaligned_le16(4, __gu_p___32); goto ldv_52017; case 4UL: put_unaligned_le32(4U, __gu_p___32); goto ldv_52017; case 8UL: put_unaligned_le64(4ULL, __gu_p___32); goto ldv_52017; default: __bad_unaligned_access_size(); goto ldv_52017; } ldv_52017: __gu_p___33 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___33) = (unsigned char )arg->c_min_rate; goto ldv_52024; case 2UL: put_unaligned_le16((int )((unsigned short )arg->c_min_rate), __gu_p___33); goto ldv_52024; case 4UL: put_unaligned_le32((unsigned int )arg->c_min_rate, __gu_p___33); goto ldv_52024; case 8UL: put_unaligned_le64((unsigned long long )arg->c_min_rate, __gu_p___33); goto ldv_52024; default: __bad_unaligned_access_size(); goto ldv_52024; } ldv_52024: 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_52112; case 2UL: put_unaligned_le16(33, __gu_p); goto ldv_52112; case 4UL: put_unaligned_le32(33U, __gu_p); goto ldv_52112; case 8UL: put_unaligned_le64(33ULL, __gu_p); goto ldv_52112; default: __bad_unaligned_access_size(); goto ldv_52112; } ldv_52112: tmp___0 = tags; tags = tags + 1; __gu_p___0 = (void *)tmp___0; switch (2UL) { case 1UL: *((u8 *)__gu_p___0) = 4U; goto ldv_52119; case 2UL: put_unaligned_le16(4, __gu_p___0); goto ldv_52119; case 4UL: put_unaligned_le32(4U, __gu_p___0); goto ldv_52119; case 8UL: put_unaligned_le64(4ULL, __gu_p___0); goto ldv_52119; default: __bad_unaligned_access_size(); goto ldv_52119; } ldv_52119: __gu_p___1 = (void *)tags; switch (4UL) { case 1UL: *((u8 *)__gu_p___1) = (unsigned char )arg->state_i; goto ldv_52126; case 2UL: put_unaligned_le16((int )((unsigned short )arg->state_i), __gu_p___1); goto ldv_52126; case 4UL: put_unaligned_le32((unsigned int )arg->state_i, __gu_p___1); goto ldv_52126; case 8UL: put_unaligned_le64((unsigned long long )arg->state_i, __gu_p___1); goto ldv_52126; default: __bad_unaligned_access_size(); goto ldv_52126; } ldv_52126: 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_52447; 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_52447; default: afs = (char *)"ssocks"; snprintf((char *)(& ad), 60UL, "DRBD_PEER_ADDRESS=%pI4", & ((struct sockaddr_in *)(& (mdev->net_conf)->peer_addr))->sin_addr); } ldv_52447: 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), 2); if (ret != 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "helper command: %s %s %s exit code %u (0x%x)\n", (char *)(& usermode_helper), cmd, (char *)(& mb), (ret >> 8) & 255, ret); } else { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "helper command: %s %s %s exit code %u (0x%x)\n", (char *)(& usermode_helper), cmd, (char *)(& mb), (ret >> 8) & 255, ret); } if (ret < 0) { ret = 0; } else { } return (ret); } } enum drbd_disk_state drbd_try_outdate_peer(struct drbd_conf *mdev ) { char *ex_to_string ; int r ; enum drbd_disk_state nps ; enum drbd_fencing_p fp ; int tmp ; union drbd_state val ; union drbd_state mask ; union drbd_state val___0 ; union drbd_state mask___0 ; { if (*((unsigned int *)mdev + 569UL) != 49152U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.pdsk == D_UNKNOWN ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/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_38745.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_52459; case 4: ex_to_string = (char *)"peer was fenced"; nps = D_OUTDATED; goto ldv_52459; case 5: ; if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 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_38745.pdsk; } goto ldv_52459; 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_38745.disk = 5U; mask.i = 0U; mask.ldv_38745.disk = 15U; _drbd_request_state(mdev, mask, val, CS_WAIT_COMPLETE); goto ldv_52459; 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_52459; 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_52459: _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "fence-peer helper returned %d (%s)\n", (r >> 8) & 255, ex_to_string); out: ; if ((unsigned int )*((unsigned char *)mdev + 2278UL) != 0U && (unsigned int )nps > 5U) { val___0.i = 0U; val___0.ldv_38745.susp_fen = 0U; mask___0.i = 0U; mask___0.ldv_38745.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 ns ; int tmp ; { mdev = (struct drbd_conf *)data; nps = drbd_try_outdate_peer(mdev); spin_lock_irq(& mdev->req_lock); ns = mdev->state; if ((int )ns.ldv_38745.conn <= 8) { tmp = constant_test_bit(30U, (unsigned long const volatile *)(& mdev->flags)); if (tmp == 0) { ns.ldv_38745.pdsk = (unsigned char )nps; _drbd_set_state(mdev, ns, CS_VERBOSE, 0); } else { } } else { } spin_unlock_irq(& mdev->req_lock); return (0); } } void drbd_try_outdate_peer_async(struct drbd_conf *mdev ) { struct task_struct *opa ; struct task_struct *__k ; unsigned int tmp ; struct task_struct *tmp___0 ; long tmp___1 ; long tmp___2 ; { tmp = mdev_to_minor(mdev); tmp___0 = kthread_create_on_node(& _try_outdate_peer_async, (void *)mdev, -1, "drbd%d_a_helper", tmp); __k = tmp___0; tmp___1 = IS_ERR((void const *)__k); if (tmp___1 == 0L) { wake_up_process(__k); } else { } opa = __k; tmp___2 = IS_ERR((void const *)opa); if (tmp___2 != 0L) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "out of mem, failed to invoke fence-peer helper\n"); } else { } return; } } enum drbd_state_rv drbd_set_role(struct drbd_conf *mdev , enum drbd_role new_role , int force ) { int max_tries ; enum drbd_state_rv rv ; int try ; int forced ; union drbd_state mask ; union drbd_state val ; enum drbd_disk_state nps ; int tmp ; int tmp___0 ; wait_queue_t __wait ; struct task_struct *tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { max_tries = 4; rv = 0; try = 0; forced = 0; if ((unsigned int )new_role == 1U) { request_ping(mdev); } else { } ldv_mutex_lock_199(& mdev->state_mutex); mask.i = 0U; mask.ldv_38745.role = 3U; val.i = 0U; val.ldv_38745.role = (unsigned char )new_role; goto ldv_52497; ldv_52500: rv = _drbd_request_state(mdev, mask, val, CS_WAIT_COMPLETE); if ((int )rv == -10 && *((unsigned int *)(& mask) + 0UL) != 0U) { val.ldv_38745.pdsk = 0U; mask.ldv_38745.pdsk = 0U; goto ldv_52497; } else { } if (((int )rv == -2 && force != 0) && ((int )mdev->state.ldv_38745.disk <= 7 && (int )mdev->state.ldv_38745.disk > 3)) { mask.ldv_38745.disk = 15U; val.ldv_38745.disk = 8U; forced = 1; goto ldv_52497; } else { } if (((int )rv == -2 && (unsigned int )*((unsigned char *)mdev + 2277UL) == 14U) && *((unsigned int *)(& mask) + 0UL) == 0U) { if (*((unsigned int *)mdev + 569UL) != 49152U) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->state.pdsk == D_UNKNOWN ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_nl.c.prepared", 405); } else { } nps = drbd_try_outdate_peer(mdev); if ((unsigned int )nps == 5U || (unsigned int )nps == 4U) { val.ldv_38745.disk = 8U; mask.ldv_38745.disk = 15U; } else { } val.ldv_38745.pdsk = (unsigned char )nps; mask.ldv_38745.pdsk = 15U; goto ldv_52497; } else { } if ((int )rv == 2) { goto fail; } else { } if ((int )rv == -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_38745.pdsk = 15U; val.ldv_38745.pdsk = (unsigned char )nps; goto ldv_52497; } else { } if ((int )rv == -1) { schedule_timeout_interruptible((long )((((mdev->net_conf)->ping_timeo + 1) * 250) / 10)); if (try < max_tries) { try = max_tries + -1; } else { } goto ldv_52497; } else { } if ((int )rv <= 0) { rv = _drbd_request_state(mdev, mask, val, 6); if ((int )rv <= 0) { goto fail; } else { } } else { } goto ldv_52499; ldv_52497: tmp = try; try = try + 1; if (tmp < max_tries) { goto ldv_52500; } else { } ldv_52499: ; if ((int )rv <= 0) { goto fail; } else { } if (forced != 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "Forced to consider local data as UpToDate!\n"); } else { } tmp___0 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); if (tmp___0 == 0) { goto ldv_52501; } 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_52504: prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___2 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); if (tmp___2 == 0) { goto ldv_52503; } else { } schedule(); goto ldv_52504; ldv_52503: finish_wait(& mdev->misc_wait, & __wait); ldv_52501: ; if ((unsigned int )new_role == 2U) { set_disk_ro(mdev->vdisk, 1); tmp___3 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___3 != 0) { (mdev->ldev)->md.uuid[0] = (mdev->ldev)->md.uuid[0] & 0xfffffffffffffffeULL; put_ldev(mdev); } else { } } else { tmp___4 = get_net_conf(mdev); if (tmp___4 != 0) { (mdev->net_conf)->want_lose = 0U; put_net_conf(mdev); } else { } set_disk_ro(mdev->vdisk, 0); tmp___5 = _get_ldev_if_state(mdev, D_INCONSISTENT); if (tmp___5 != 0) { if ((((int )mdev->state.ldv_38745.conn <= 9 || (int )mdev->state.ldv_38745.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 ((int )mdev->state.ldv_38745.conn > 8) { if (forced != 0) { drbd_send_uuids(mdev); } else { } drbd_send_current_state(mdev); } else { } drbd_md_sync(mdev); kobject_uevent(& (mdev->vdisk)->part0.__dev.kobj, KOBJ_CHANGE); fail: ldv_mutex_unlock_200(& mdev->state_mutex); return (rv); } } static struct drbd_conf *ensure_mdev(int minor , int create ) { struct drbd_conf *mdev ; struct gendisk *disk ; { if ((unsigned int )minor >= minor_count) { return (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 ; enum drbd_state_rv tmp___0 ; { memset((void *)(& primary_args), 0, 4UL); tmp = primary_from_tags(mdev, (unsigned short *)(& nlp->tag_list), & primary_args); if (tmp == 0) { reply->ret_code = 126; return (0); } else { } tmp___0 = drbd_set_role(mdev, R_PRIMARY, (int )primary_args.primary_force); reply->ret_code = (int )tmp___0; return (0); } } static int drbd_nl_secondary(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { enum drbd_state_rv tmp ; { tmp = drbd_set_role(mdev, R_SECONDARY, 0); reply->ret_code = (int )tmp; return (0); } } static void drbd_md_set_sector_offsets(struct drbd_conf *mdev , struct drbd_backing_dev *bdev ) { sector_t md_size_sect ; sector_t tmp ; sector_t tmp___0 ; sector_t tmp___1 ; { md_size_sect = 0UL; 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_52528; 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_52528; 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_52528; } ldv_52528: ; 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_52539; ldv_52538: size = (size >> 10) + (unsigned long long )((size & 512ULL) != 0ULL); base = base + 1; ldv_52539: ; if (size > 9999ULL && (unsigned int )base <= 4U) { goto ldv_52538; } else { } sprintf(buf, "%u %cB", (unsigned int )size, (int )units[base]); return (buf); } } void drbd_suspend_io(struct drbd_conf *mdev ) { int tmp ; int tmp___0 ; wait_queue_t __wait ; struct task_struct *tmp___1 ; int tmp___2 ; { set_bit(15U, (unsigned long volatile *)(& mdev->flags)); tmp = is_susp(mdev->state); if (tmp != 0) { return; } else { } tmp___0 = atomic_read((atomic_t const *)(& mdev->ap_bio_cnt)); if (tmp___0 == 0) { goto ldv_52544; } 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_52547: 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_52546; } else { } schedule(); goto ldv_52547; ldv_52546: finish_wait(& mdev->misc_wait, & __wait); ldv_52544: ; return; } } void drbd_resume_io(struct drbd_conf *mdev ) { { clear_bit(15, (unsigned long volatile *)(& mdev->flags)); __wake_up(& mdev->misc_wait, 3U, 1, 0); return; } } enum determine_dev_size drbd_determine_dev_size(struct drbd_conf *mdev , enum dds_flags flags ) { sector_t prev_first_sect ; sector_t prev_size ; sector_t la_size ; sector_t size ; char ppb[10U] ; int md_moved ; int la_size_changed ; enum determine_dev_size rv ; int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; int err ; sector_t tmp___2 ; long tmp___3 ; char *tmp___4 ; sector_t tmp___5 ; sector_t tmp___6 ; sector_t tmp___7 ; int err___0 ; { rv = 0; drbd_suspend_io(mdev); tmp = lc_try_lock(mdev->act_log); if (tmp != 0) { goto ldv_52563; } 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_52566: prepare_to_wait(& mdev->al_wait, & __wait, 2); tmp___1 = lc_try_lock(mdev->act_log); if (tmp___1 != 0) { goto ldv_52565; } else { } schedule(); goto ldv_52566; ldv_52565: finish_wait(& mdev->al_wait, & __wait); ldv_52563: 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"); err___0 = drbd_bitmap_io(mdev, & drbd_bm_write, (char *)"size changed", BM_LOCKED_MASK); if (err___0 != 0) { rv = dev_size_error; goto out; } else { } 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_38745.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), "ASSERT FAILED: %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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_nl.c.prepared", 809); } 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_52595; ldv_52594: 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_52595: ; if ((unsigned int )i < t->nr_elements) { goto ldv_52594; } 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); } } static void drbd_setup_queue_param(struct drbd_conf *mdev , unsigned int max_bio_size ) { struct request_queue *q ; int max_hw_sectors ; int max_segments ; struct request_queue *b ; unsigned int _min1 ; unsigned int tmp ; unsigned int _min2 ; int tmp___0 ; struct request_queue *b___0 ; int tmp___1 ; { q = mdev->rq_queue; max_hw_sectors = (int )(max_bio_size >> 9); max_segments = 0; tmp___0 = _get_ldev_if_state(mdev, D_ATTACHING); if (tmp___0 != 0) { b = (((mdev->ldev)->backing_bdev)->bd_disk)->queue; tmp = queue_max_hw_sectors(b); _min1 = tmp; _min2 = max_bio_size >> 9; max_hw_sectors = (int )(_min1 < _min2 ? _min1 : _min2); max_segments = (mdev->ldev)->dc.max_bio_bvecs; put_ldev(mdev); } else { } blk_queue_logical_block_size(q, 512); blk_queue_max_hw_sectors(q, (unsigned int )max_hw_sectors); blk_queue_max_segments(q, max_segments != 0 ? (int )((unsigned short )max_segments) : 128); blk_queue_segment_boundary(q, 4095UL); tmp___1 = _get_ldev_if_state(mdev, D_ATTACHING); if (tmp___1 != 0) { b___0 = (((mdev->ldev)->backing_bdev)->bd_disk)->queue; blk_queue_stack_limits(q, b___0); if (q->backing_dev_info.ra_pages != b___0->backing_dev_info.ra_pages) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Adjusting my ra_pages to backing device\'s (%lu -> %lu)\n", q->backing_dev_info.ra_pages, b___0->backing_dev_info.ra_pages); q->backing_dev_info.ra_pages = b___0->backing_dev_info.ra_pages; } else { } put_ldev(mdev); } else { } return; } } void drbd_reconsider_max_bio_size(struct drbd_conf *mdev ) { int now ; int new ; int local ; int peer ; unsigned int tmp ; unsigned int tmp___0 ; int tmp___1 ; int __min1 ; int __min2 ; int __min1___0 ; int __min2___0 ; { tmp = queue_max_hw_sectors(mdev->rq_queue); now = (int )(tmp << 9); local = mdev->local_max_bio_size; peer = mdev->peer_max_bio_size; tmp___1 = _get_ldev_if_state(mdev, D_ATTACHING); if (tmp___1 != 0) { tmp___0 = queue_max_hw_sectors((((mdev->ldev)->backing_bdev)->bd_disk)->queue); local = (int )(tmp___0 << 9); mdev->local_max_bio_size = local; put_ldev(mdev); } else { } if ((int )mdev->state.ldv_38745.conn > 9) { if (mdev->agreed_pro_version <= 93) { __min1 = mdev->peer_max_bio_size; __min2 = 32768; peer = __min1 < __min2 ? __min1 : __min2; } else if (mdev->agreed_pro_version == 94) { peer = 32768; } else { peer = 131072; } } else { } __min1___0 = local; __min2___0 = peer; new = __min1___0 < __min2___0 ? __min1___0 : __min2___0; if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U && new < now) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED new < now; (%d < %d)\n", new, now); } else { } if (new != now) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "max BIO size = %u\n", new); } else { } drbd_setup_queue_param(mdev, (unsigned int )new); return; } } static void drbd_reconfig_start(struct drbd_conf *mdev ) { int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; int tmp___2 ; wait_queue_t __wait___0 ; struct task_struct *tmp___3 ; int tmp___4 ; { tmp = test_and_set_bit(22, (unsigned long volatile *)(& mdev->flags)); if (tmp == 0) { goto ldv_52625; } 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_52628: 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_52627; } else { } schedule(); goto ldv_52628; ldv_52627: finish_wait(& mdev->state_wait, & __wait); ldv_52625: tmp___2 = constant_test_bit(23U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___2 == 0) { goto ldv_52629; } 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_52632: 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_52631; } else { } schedule(); goto ldv_52632; ldv_52631: finish_wait(& mdev->state_wait, & __wait___0); ldv_52629: drbd_thread_start(& mdev->worker); drbd_flush_workqueue(mdev); return; } } static void drbd_reconfig_done(struct drbd_conf *mdev ) { { spin_lock_irq(& mdev->req_lock); if (((unsigned int )*((unsigned char *)mdev + 2277UL) == 0U && (unsigned int )*((unsigned short *)mdev + 1138UL) == 0U) && (unsigned int )*((unsigned char *)mdev + 2276UL) == 2U) { set_bit(23U, (unsigned long volatile *)(& mdev->flags)); drbd_thread_stop_nowait(& mdev->worker); } else { clear_bit(22, (unsigned long volatile *)(& mdev->flags)); } 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_38745.conn <= 9) { tmp___0 = test_and_set_bit(28, (unsigned long volatile *)(& mdev->flags)); s = tmp___0 == 0; } else { } spin_unlock_irq(& mdev->req_lock); if (s != 0) { _dev_info((struct device const *)(& (mdev->vdisk)->part0.__dev), "Suspended AL updates\n"); } else { } return; } } static int drbd_nl_disk_conf(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { enum drbd_ret_code retcode ; enum determine_dev_size dd ; sector_t max_possible_sectors ; sector_t min_md_device_sectors ; struct drbd_backing_dev *nbc ; struct block_device *bdev ; struct lru_cache *resync_lru ; union drbd_state ns ; union drbd_state os ; enum drbd_state_rv rv ; int cp_discovered ; int logical_block_size ; int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; void *tmp___2 ; int tmp___3 ; int prot ; int tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; sector_t tmp___9 ; sector_t tmp___10 ; sector_t tmp___11 ; sector_t tmp___12 ; sector_t tmp___13 ; int tmp___14 ; int tmp___15 ; wait_queue_t __wait___0 ; struct task_struct *tmp___16 ; int tmp___17 ; int tmp___18 ; union drbd_state val ; union drbd_state mask ; 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 ; int tmp___35 ; unsigned long tmp___36 ; unsigned long tmp___37 ; int tmp___38 ; int tmp___39 ; int tmp___40 ; 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_38745.disk > 0) { retcode = ERR_DISK_CONFIGURED; goto fail; } else { } tmp = atomic_read((atomic_t const *)(& mdev->local_cnt)); if (tmp == 0) { goto ldv_52658; } 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_52661: prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___1 = atomic_read((atomic_t const *)(& mdev->local_cnt)); if (tmp___1 == 0) { goto ldv_52660; } else { } schedule(); goto ldv_52661; ldv_52660: finish_wait(& mdev->misc_wait, & __wait); ldv_52658: tmp___2 = kzalloc(400UL, 208U); nbc = (struct drbd_backing_dev *)tmp___2; 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___3 = disk_conf_from_tags(mdev, (unsigned short *)(& nlp->tag_list), & nbc->dc); if (tmp___3 == 0) { retcode = ERR_MANDATORY_TAG; goto fail; } else { } if (nbc->dc.meta_dev_idx < -3) { retcode = ERR_MD_IDX_INVALID; goto fail; } else { } tmp___4 = get_net_conf(mdev); if (tmp___4 != 0) { prot = (mdev->net_conf)->wire_protocol; put_net_conf(mdev); if (nbc->dc.fencing == 2 && prot == 1) { retcode = ERR_STONITH_AND_PROT_A; goto fail; } else { } } else { } bdev = blkdev_get_by_path((char const *)(& nbc->dc.backing_dev), 131U, (void *)mdev); tmp___6 = IS_ERR((void const *)bdev); if (tmp___6 != 0L) { tmp___5 = PTR_ERR((void const *)bdev); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "open(\"%s\") failed with %ld\n", (unsigned char *)(& nbc->dc.backing_dev), tmp___5); retcode = ERR_OPEN_DISK; goto fail; } else { } nbc->backing_bdev = bdev; bdev = blkdev_get_by_path((char const *)(& nbc->dc.meta_dev), 131U, nbc->dc.meta_dev_idx < 0 ? (void *)mdev : (void *)drbd_m_holder); tmp___8 = IS_ERR((void const *)bdev); if (tmp___8 != 0L) { tmp___7 = PTR_ERR((void const *)bdev); dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "open(\"%s\") failed with %ld\n", (unsigned char *)(& nbc->dc.meta_dev), tmp___7); retcode = ERR_OPEN_MD_DISK; goto fail; } else { } nbc->md_bdev = bdev; 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 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 fail; } else { } drbd_md_set_sector_offsets(mdev, nbc); tmp___10 = drbd_get_max_capacity___1(nbc); if ((unsigned long long )tmp___10 < nbc->dc.disk_size) { tmp___9 = 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___9, nbc->dc.disk_size); retcode = ERR_DISK_TOO_SMALL; goto fail; } else { } if (nbc->dc.meta_dev_idx < 0) { max_possible_sectors = 2251799813685248UL; min_md_device_sectors = 2048UL; } else { max_possible_sectors = 8587575296UL; min_md_device_sectors = (unsigned long )(nbc->dc.meta_dev_idx + 1) * 262144UL; } tmp___11 = drbd_get_capacity(nbc->md_bdev); if (tmp___11 < min_md_device_sectors) { retcode = ERR_MD_DISK_TOO_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 fail; } else { } tmp___12 = drbd_get_max_capacity___1(nbc); tmp___13 = drbd_get_capacity(mdev->this_bdev); if (tmp___12 < tmp___13) { retcode = ERR_DISK_TOO_SMALL; goto fail; } else { } nbc->known_size = drbd_get_capacity(nbc->backing_bdev); if (nbc->known_size > max_possible_sectors) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "==> truncating very big lower level device to currently maximum possible %llu sectors <==\n", (unsigned long long )max_possible_sectors); if (nbc->dc.meta_dev_idx >= 0) { dev_warn((struct device const *)(& (mdev->vdisk)->part0.__dev), "==>> using internal or flexible meta data may help <<==\n"); } else { } } else { } drbd_suspend_io(mdev); tmp___14 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); if (tmp___14 == 0) { goto ldv_52663; } else { tmp___15 = is_susp(mdev->state); if (tmp___15 != 0) { goto ldv_52663; } else { } } tmp___16 = get_current(); __wait___0.flags = 0U; __wait___0.private = (void *)tmp___16; __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_52666: prepare_to_wait(& mdev->misc_wait, & __wait___0, 2); tmp___17 = atomic_read((atomic_t const *)(& mdev->ap_pending_cnt)); if (tmp___17 == 0) { goto ldv_52665; } else { tmp___18 = is_susp(mdev->state); if (tmp___18 != 0) { goto ldv_52665; } else { } } schedule(); goto ldv_52666; ldv_52665: finish_wait(& mdev->misc_wait, & __wait___0); ldv_52663: drbd_flush_workqueue(mdev); val.i = 0U; val.ldv_38745.disk = 1U; mask.i = 0U; mask.ldv_38745.disk = 15U; rv = _drbd_request_state(mdev, mask, val, CS_VERBOSE); retcode = (enum drbd_ret_code )rv; drbd_resume_io(mdev); if ((int )rv <= 0) { goto 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_code )tmp___23; if ((unsigned int )retcode != 101U) { goto force_diskless_dec; } else { } if (((int )mdev->state.ldv_38745.conn <= 9 && (unsigned int )*((unsigned char *)mdev + 2276UL) == 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_TOO_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 + 372UL) != 0U) { set_bit(14U, (unsigned long volatile *)(& mdev->flags)); } else { clear_bit(14, (unsigned long volatile *)(& mdev->flags)); } if ((unsigned long )mdev->ldev != (unsigned long )((struct drbd_backing_dev *)0)) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT( mdev->ldev == NULL ) in %s:%d\n", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_nl.c.prepared", 1217); } else { } mdev->ldev = nbc; mdev->resync = resync_lru; nbc = 0; resync_lru = 0; mdev->write_ordering = WO_bdev_flush; drbd_bump_write_ordering(mdev, WO_bdev_flush); 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 + 2276UL) != 1U || (unsigned int )*((unsigned char *)mdev + 2278UL) == 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; drbd_reconsider_max_bio_size(mdev); clear_bit(7, (unsigned long volatile *)(& mdev->flags)); if ((unsigned int )*((unsigned char *)mdev + 2276UL) != 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_determine_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", BM_LOCKED_MASK); 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", BM_LOCKED_MASK); if (tmp___33 < 0) { retcode = ERR_IO_MD_DISK; goto force_diskless_dec; } else { } } if (cp_discovered != 0) { drbd_al_apply_to_bm(mdev); tmp___35 = drbd_bitmap_io(mdev, & drbd_bm_write, (char *)"crashed primary apply AL", BM_LOCKED_MASK); if (tmp___35 != 0) { retcode = ERR_IO_MD_DISK; goto force_diskless_dec; } else { } } else { } tmp___36 = _drbd_bm_total_weight(mdev); tmp___37 = drbd_bm_bits(mdev); if (tmp___36 == tmp___37) { drbd_suspend_al(mdev); } else { } spin_lock_irq(& mdev->req_lock); os = mdev->state; ns.i = os.i; tmp___39 = drbd_md_test_flag(mdev->ldev, 1); if (tmp___39 != 0) { tmp___38 = drbd_md_test_flag(mdev->ldev, 16); if (tmp___38 != 0) { ns.ldv_38745.disk = 7U; } else { ns.ldv_38745.disk = 5U; } } else { ns.ldv_38745.disk = 4U; } tmp___40 = drbd_md_test_flag(mdev->ldev, 32); if (tmp___40 != 0) { ns.ldv_38745.pdsk = 5U; } else { } if ((unsigned int )*((unsigned char *)(& ns) + 1UL) == 14U && (*((unsigned int *)(& ns) + 0UL) == 40960U || (mdev->ldev)->dc.fencing == 0)) { ns.ldv_38745.disk = 8U; } else { } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 160U) { mdev->new_state_tmp.i = ns.i; ns.i = os.i; ns.ldv_38745.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 ((int )rv <= 0) { goto force_diskless_dec; } else { } if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { (mdev->ldev)->md.uuid[0] = (mdev->ldev)->md.uuid[0] | 1ULL; } else { (mdev->ldev)->md.uuid[0] = (mdev->ldev)->md.uuid[0] & 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_38745.disk = 2U; mask___0.i = 0U; mask___0.ldv_38745.disk = 15U; drbd_force_state(mdev, mask___0, val___0); drbd_md_sync(mdev); fail: ; if ((unsigned long )nbc != (unsigned long )((struct drbd_backing_dev *)0)) { if ((unsigned long )nbc->backing_bdev != (unsigned long )((struct block_device *)0)) { blkdev_put(nbc->backing_bdev, 131U); } else { } if ((unsigned long )nbc->md_bdev != (unsigned long )((struct block_device *)0)) { blkdev_put(nbc->md_bdev, 131U); } else { } kfree((void const *)nbc); } else { } lc_destroy(resync_lru); reply->ret_code = (int )retcode; drbd_reconfig_done(mdev); return (0); } } static int drbd_nl_detach(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { enum drbd_ret_code retcode ; int ret ; struct detach dt ; int tmp ; union drbd_state val ; union drbd_state mask ; union drbd_state val___0 ; union drbd_state mask___0 ; int tmp___0 ; int __ret ; wait_queue_t __wait ; struct task_struct *tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; { dt.detach_force = (unsigned char)0; tmp = detach_from_tags(mdev, (unsigned short *)(& nlp->tag_list), & dt); if (tmp == 0) { reply->ret_code = 126; goto out; } else { } if ((unsigned int )*((unsigned char *)(& dt) + 0UL) != 0U) { val.i = 0U; val.ldv_38745.disk = 2U; mask.i = 0U; mask.ldv_38745.disk = 15U; drbd_force_state(mdev, mask, val); reply->ret_code = 1; goto out; } else { } drbd_suspend_io(mdev); drbd_md_get_buffer(mdev); val___0.i = 0U; val___0.ldv_38745.disk = 2U; mask___0.i = 0U; mask___0.ldv_38745.disk = 15U; tmp___0 = drbd_request_state(mdev, mask___0, val___0); retcode = (enum drbd_ret_code )tmp___0; drbd_md_put_buffer(mdev); __ret = 0; if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 4U) { 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_52699: prepare_to_wait(& mdev->misc_wait, & __wait, 1); if ((unsigned int )*((unsigned char *)mdev + 2277UL) != 4U) { goto ldv_52697; } else { } tmp___2 = get_current(); tmp___3 = signal_pending(tmp___2); if (tmp___3 == 0) { schedule(); goto ldv_52698; } else { } __ret = -512; goto ldv_52697; ldv_52698: ; goto ldv_52699; ldv_52697: finish_wait(& mdev->misc_wait, & __wait); } else { } ret = __ret; drbd_resume_io(mdev); if ((long )retcode == 4294967285L) { retcode = 2; } else { } if (ret != 0) { retcode = ERR_INTR; } else { } reply->ret_code = (int )retcode; out: ; return (0); } } static int drbd_nl_net_conf(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { int i ; int ns ; enum drbd_ret_code retcode ; struct net_conf *new_conf ; struct crypto_hash *tfm ; struct crypto_hash *integrity_w_tfm ; struct crypto_hash *integrity_r_tfm ; struct hlist_head *new_tl_hash ; struct hlist_head *new_ee_hash ; struct drbd_conf *odev ; char hmac_name[64U] ; void *int_dig_out ; void *int_dig_in ; void *int_dig_vv ; struct sockaddr *new_my_addr ; struct sockaddr *new_peer_addr ; struct sockaddr *taken_addr ; void *tmp ; int tmp___0 ; enum drbd_fencing_p fp ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; long tmp___5 ; struct crypto_tfm *tmp___6 ; int tmp___7 ; long tmp___8 ; struct crypto_tfm *tmp___9 ; int tmp___10 ; long tmp___11 ; void *tmp___12 ; void *tmp___13 ; unsigned int tmp___14 ; int tmp___15 ; union drbd_state __ns ; enum drbd_state_rv tmp___16 ; { new_conf = 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_38745.conn > 0) { retcode = ERR_NET_CONFIGURED; goto fail; } else { } tmp = kzalloc(544UL, 208U); new_conf = (struct net_conf *)tmp; if ((unsigned long )new_conf == (unsigned long )((struct net_conf *)0)) { retcode = 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; new_conf->on_congestion = 0; new_conf->cong_extents = 127; tmp___0 = net_conf_from_tags(mdev, (unsigned short *)(& nlp->tag_list), new_conf); if (tmp___0 == 0) { retcode = ERR_MANDATORY_TAG; goto fail; } else { } if ((unsigned int )*((unsigned char *)new_conf + 540UL) != 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 (new_conf->on_congestion != 0 && new_conf->wire_protocol != 1) { retcode = ERR_CONG_NOT_PROTO_A; goto fail; } else { } if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 1U && (unsigned int )*((unsigned char *)new_conf + 540UL) != 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_52727; ldv_52726: 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_52725; } 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_52725: i = i + 1; ldv_52727: ; if ((unsigned int )i < minor_count) { goto ldv_52726; } 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((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 + 540UL) != 0U && mdev->ee_hash_s != (unsigned int )ns) { tmp___13 = kzalloc((unsigned long )ns * 8UL, 208U); new_ee_hash = (struct hlist_head *)tmp___13; if ((unsigned long )new_ee_hash == (unsigned long )((struct hlist_head *)0)) { retcode = 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((size_t )i, 208U); if ((unsigned long )int_dig_out == (unsigned long )((void *)0)) { retcode = ERR_NOMEM; goto fail; } else { } int_dig_in = kmalloc((size_t )i, 208U); if ((unsigned long )int_dig_in == (unsigned long )((void *)0)) { retcode = ERR_NOMEM; goto fail; } else { } int_dig_vv = kmalloc((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_38745.conn = 2U; tmp___16 = _drbd_set_state(mdev, __ns, CS_VERBOSE, 0); retcode = (enum drbd_ret_code )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 ; struct disconnect dc ; int tmp ; union drbd_state __ns ; union drbd_state val ; union drbd_state mask ; enum drbd_state_rv tmp___0 ; union drbd_state val___0 ; union drbd_state mask___0 ; union drbd_state val___1 ; union drbd_state mask___1 ; enum drbd_state_rv tmp___1 ; union drbd_state val___2 ; union drbd_state mask___2 ; int __ret ; wait_queue_t __wait ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; { memset((void *)(& dc), 0, 4UL); tmp = disconnect_from_tags(mdev, (unsigned short *)(& nlp->tag_list), & dc); if (tmp == 0) { retcode = 126; goto fail; } else { } if ((unsigned int )*((unsigned char *)(& dc) + 0UL) != 0U) { spin_lock_irq(& mdev->req_lock); if ((int )mdev->state.ldv_38745.conn > 7) { __ns.i = mdev->state.i; __ns.ldv_38745.conn = 1U; _drbd_set_state(mdev, __ns, CS_HARD, 0); } else { } spin_unlock_irq(& mdev->req_lock); goto done; } else { } val.i = 0U; val.ldv_38745.conn = 1U; mask.i = 0U; mask.ldv_38745.conn = 31U; tmp___0 = _drbd_request_state(mdev, mask, val, CS_ORDERED); retcode = (int )tmp___0; if (retcode == 2) { goto done; } else if (retcode == -9) { goto done; } else if (retcode == -7) { val___0.i = 0U; val___0.ldv_38745.conn = 1U; val___0.ldv_38745.pdsk = 5U; mask___0.i = 0U; mask___0.ldv_38745.conn = 31U; mask___0.ldv_38745.pdsk = 15U; retcode = drbd_request_state(mdev, mask___0, val___0); } else if (retcode == -10) { val___1.i = 0U; val___1.ldv_38745.conn = 1U; val___1.ldv_38745.disk = 5U; mask___1.i = 0U; mask___1.ldv_38745.conn = 31U; mask___1.ldv_38745.disk = 15U; tmp___1 = _drbd_request_state(mdev, mask___1, val___1, CS_ORDERED); retcode = (int )tmp___1; if (retcode == -11 || retcode == -16) { val___2.i = 0U; val___2.ldv_38745.conn = 1U; mask___2.i = 0U; mask___2.ldv_38745.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 + 1138UL) == 16U) { tmp___2 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___2; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_52762: prepare_to_wait(& mdev->state_wait, & __wait, 1); if ((unsigned int )*((unsigned short *)mdev + 1138UL) != 16U) { goto ldv_52760; } else { } tmp___3 = get_current(); tmp___4 = signal_pending(tmp___3); if (tmp___4 == 0) { schedule(); goto ldv_52761; } else { } __ret = -512; goto ldv_52760; ldv_52761: ; goto ldv_52762; ldv_52760: 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_38745.role != (int )mdev->state.ldv_38745.peer) { iass = (unsigned int )*((unsigned char *)mdev + 2276UL) == 1U; } else { iass = constant_test_bit(6U, (unsigned long const volatile *)(& mdev->flags)); } if (iass != 0) { drbd_start_resync(mdev, C_SYNC_SOURCE); } else { val.i = 0U; val.ldv_38745.conn = 15U; mask.i = 0U; mask.ldv_38745.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_38745.conn > 10) { retcode = 130; goto fail; } else { } if ((unsigned int )*((unsigned char *)mdev + 2276UL) == 2U && (unsigned int )*((unsigned char *)mdev + 2276UL) == 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_ldev; } else { } tmp___1 = drbd_get_capacity((mdev->ldev)->backing_bdev); if ((mdev->ldev)->known_size != tmp___1) { (mdev->ldev)->known_size = drbd_get_capacity((mdev->ldev)->backing_bdev); } else { } (mdev->ldev)->dc.disk_size = rs.resize_size; ddsf = (enum dds_flags )(((unsigned int )*((unsigned char *)(& rs) + 8UL) != 0U) | ((int )*((unsigned char *)(& rs) + 8UL) & 2)); dd = drbd_determine_dev_size(mdev, ddsf); drbd_md_sync(mdev); put_ldev(mdev); if ((int )dd == -1) { retcode = 140; goto fail; } else { } if ((unsigned int )*((unsigned short *)mdev + 1138UL) == 160U) { if ((int )dd == 2) { set_bit(24U, (unsigned long volatile *)(& mdev->flags)); } else { } drbd_send_uuids(mdev); drbd_send_sizes(mdev, 1, ddsf); } else { } fail: reply->ret_code = retcode; return (0); fail_ldev: put_ldev(mdev); goto fail; } } 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 + 1138UL) == 256U || (unsigned int )*((unsigned short *)mdev + 1138UL) == 272U) || (unsigned int )*((unsigned short *)mdev + 1138UL) == 320U) || (unsigned int )*((unsigned short *)mdev + 1138UL) == 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 + 1138UL) == 288U || (unsigned int )*((unsigned short *)mdev + 1138UL) == 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, (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), "ASSERT FAILED: %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/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_nl.c.prepared", 1918); } else { } if (_b != 0) { sc.rate = 1; } else { } _b___0 = sc.al_extents <= 6; if (_b___0 != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "ASSERT FAILED: %s: (%s) in %s:%d\n", "drbd_nl_syncer_conf", (char *)"sc.al_extents < 7", (char *)"/work/ldvuser/novikov/work/current--X--drivers/block/drbd/drbd.ko--X--defaultlinux--X--32_7a--X--cpachecker/linux/csd_deg_dscv/20/dscv_tempdir/dscv/ri/32_7a/drivers/block/drbd/drbd_nl.c.prepared", 1919); } 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((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_52807; } 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_52810: prepare_to_wait(& mdev->al_wait, & __wait, 2); tmp___13 = lc_try_lock(mdev->act_log); if (tmp___13 != 0) { goto ldv_52809; } else { } schedule(); goto ldv_52810; ldv_52809: finish_wait(& mdev->al_wait, & __wait); ldv_52807: 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_38745.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 ; int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; union drbd_state val ; union drbd_state mask ; enum drbd_state_rv tmp___2 ; union drbd_state val___0 ; union drbd_state mask___0 ; union drbd_state __ns ; enum drbd_state_rv tmp___3 ; union drbd_state val___1 ; union drbd_state mask___1 ; { drbd_suspend_io(mdev); tmp = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); if (tmp == 0) { goto ldv_52817; } 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_52820: prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___1 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___1 == 0) { goto ldv_52819; } else { } schedule(); goto ldv_52820; ldv_52819: finish_wait(& mdev->misc_wait, & __wait); ldv_52817: val.i = 0U; val.ldv_38745.conn = 12U; mask.i = 0U; mask.ldv_38745.conn = 31U; tmp___2 = _drbd_request_state(mdev, mask, val, CS_ORDERED); retcode = (int )tmp___2; if (retcode <= 0 && retcode != -15) { val___0.i = 0U; val___0.ldv_38745.conn = 12U; mask___0.i = 0U; mask___0.ldv_38745.conn = 31U; retcode = drbd_request_state(mdev, mask___0, val___0); } else { } goto ldv_52837; ldv_52836: spin_lock_irq(& mdev->req_lock); if ((int )mdev->state.ldv_38745.conn <= 9) { __ns.i = mdev->state.i; __ns.ldv_38745.disk = 4U; tmp___3 = _drbd_set_state(mdev, __ns, CS_VERBOSE, 0); retcode = (int )tmp___3; } else { } spin_unlock_irq(& mdev->req_lock); if (retcode != -15) { goto ldv_52831; } else { } val___1.i = 0U; val___1.ldv_38745.conn = 12U; mask___1.i = 0U; mask___1.ldv_38745.conn = 31U; retcode = drbd_request_state(mdev, mask___1, val___1); ldv_52837: ; if (retcode == -15) { goto ldv_52836; } else { } ldv_52831: drbd_resume_io(mdev); reply->ret_code = retcode; return (0); } } static int drbd_bmio_set_susp_al(struct drbd_conf *mdev ) { int rv ; { rv = drbd_bmio_set_n_write(mdev); drbd_suspend_al(mdev); return (rv); } } static int drbd_nl_invalidate_peer(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { int retcode ; int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; union drbd_state val ; union drbd_state mask ; enum drbd_state_rv tmp___2 ; union drbd_state val___0 ; union drbd_state mask___0 ; int tmp___3 ; union drbd_state val___1 ; union drbd_state mask___1 ; { drbd_suspend_io(mdev); tmp = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); if (tmp == 0) { goto ldv_52848; } 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_52851: prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___1 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___1 == 0) { goto ldv_52850; } else { } schedule(); goto ldv_52851; ldv_52850: finish_wait(& mdev->misc_wait, & __wait); ldv_52848: val.i = 0U; val.ldv_38745.conn = 11U; mask.i = 0U; mask.ldv_38745.conn = 31U; tmp___2 = _drbd_request_state(mdev, mask, val, CS_ORDERED); retcode = (int )tmp___2; if (retcode <= 0) { if (retcode == -15 && (unsigned int )*((unsigned char *)mdev + 2276UL) == 1U) { val___0.i = 0U; val___0.ldv_38745.pdsk = 4U; mask___0.i = 0U; mask___0.ldv_38745.pdsk = 15U; retcode = drbd_request_state(mdev, mask___0, val___0); if (retcode > 0) { tmp___3 = drbd_bitmap_io(mdev, & drbd_bmio_set_susp_al, (char *)"set_n_write from invalidate_peer", BM_LOCKED_SET_ALLOWED); if (tmp___3 != 0) { retcode = 118; } else { } } else { } } else { val___1.i = 0U; val___1.ldv_38745.conn = 11U; mask___1.i = 0U; mask___1.ldv_38745.conn = 31U; retcode = drbd_request_state(mdev, mask___1, val___1); } } else { } drbd_resume_io(mdev); 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_38745.user_isp = 1U; mask.i = 0U; mask.ldv_38745.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 s ; union drbd_state val ; union drbd_state mask ; int tmp ; { retcode = 101; val.i = 0U; val.ldv_38745.user_isp = 0U; mask.i = 0U; mask.ldv_38745.user_isp = 1U; tmp = drbd_request_state(mdev, mask, val); if (tmp == 2) { s = mdev->state; if ((unsigned int )*((unsigned short *)(& s) + 0UL) == 320U || (unsigned int )*((unsigned short *)(& s) + 0UL) == 336U) { retcode = (unsigned int )*((unsigned char *)(& s) + 2UL) == 0U ? ((unsigned int )*((unsigned char *)(& s) + 2UL) != 0U ? 157 : 135) : 156; } else { retcode = 135; } } else { } reply->ret_code = retcode; return (0); } } static int drbd_nl_suspend_io(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { union drbd_state val ; union drbd_state mask ; { val.i = 0U; val.ldv_38745.susp = 1U; mask.i = 0U; mask.ldv_38745.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)); } else { } drbd_suspend_io(mdev); val.i = 0U; val.ldv_38745.susp = 0U; val.ldv_38745.susp_nod = 0U; val.ldv_38745.susp_fen = 0U; mask.i = 0U; mask.ldv_38745.susp = 1U; mask.ldv_38745.susp_nod = 1U; mask.ldv_38745.susp_fen = 1U; reply->ret_code = drbd_request_state(mdev, mask, val); if (reply->ret_code == 1) { if ((int )mdev->state.ldv_38745.conn <= 9) { tl_clear(mdev); } else { } if ((unsigned int )*((unsigned char *)mdev + 2277UL) == 0U || (unsigned int )*((unsigned char *)mdev + 2277UL) == 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_38745.disk = 5U; mask.i = 0U; mask.ldv_38745.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_52920; case 2UL: put_unaligned_le16(0, __gu_p); goto ldv_52920; case 4UL: put_unaligned_le32(0U, __gu_p); goto ldv_52920; case 8UL: put_unaligned_le64(0ULL, __gu_p); goto ldv_52920; default: __bad_unaligned_access_size(); goto ldv_52920; } ldv_52920: ; 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_38745.conn > 15 && (int )s.ldv_38745.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_52936; case 2UL: put_unaligned_le16(0, __gu_p); goto ldv_52936; case 4UL: put_unaligned_le32(0U, __gu_p); goto ldv_52936; case 8UL: put_unaligned_le64(0ULL, __gu_p); goto ldv_52936; default: __bad_unaligned_access_size(); goto ldv_52936; } ldv_52936: ; 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_52949; case 2UL: put_unaligned_le16(0, __gu_p); goto ldv_52949; case 4UL: put_unaligned_le32(0U, __gu_p); goto ldv_52949; case 8UL: put_unaligned_le64(0ULL, __gu_p); goto ldv_52949; default: __bad_unaligned_access_size(); goto ldv_52949; } ldv_52949: ; return ((int )((unsigned int )((long )tl) - (unsigned int )((long )(& reply->tag_list)))); } } static int drbd_nl_get_timeout_flag(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { unsigned short *tl ; char rv ; int tmp ; void *__gu_p ; unsigned short *tmp___0 ; { tl = (unsigned short *)(& reply->tag_list); if (*((unsigned int *)mdev + 569UL) != 40960U) { tmp = constant_test_bit(7U, (unsigned long const volatile *)(& mdev->flags)); rv = 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_52963; case 2UL: put_unaligned_le16(0, __gu_p); goto ldv_52963; case 4UL: put_unaligned_le32(0U, __gu_p); goto ldv_52963; case 8UL: put_unaligned_le64(0ULL, __gu_p); goto ldv_52963; default: __bad_unaligned_access_size(); goto ldv_52963; } ldv_52963: ; return ((int )((unsigned int )((long )tl) - (unsigned int )((long )(& reply->tag_list)))); } } static int drbd_nl_start_ov(struct drbd_conf *mdev , struct drbd_nl_cfg_req *nlp , struct drbd_nl_cfg_reply *reply ) { struct start_ov args ; int tmp ; int tmp___0 ; wait_queue_t __wait ; struct task_struct *tmp___1 ; int tmp___2 ; union drbd_state val ; union drbd_state mask ; { args.start_sector = (unsigned long long )mdev->ov_start_sector; tmp = start_ov_from_tags(mdev, (unsigned short *)(& nlp->tag_list), & args); if (tmp == 0) { reply->ret_code = 126; return (0); } else { } drbd_suspend_io(mdev); tmp___0 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___0 == 0) { goto ldv_52974; } 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_52977: prepare_to_wait(& mdev->misc_wait, & __wait, 2); tmp___2 = constant_test_bit(16U, (unsigned long const volatile *)(& mdev->flags)); if (tmp___2 == 0) { goto ldv_52976; } else { } schedule(); goto ldv_52977; ldv_52976: finish_wait(& mdev->misc_wait, & __wait); ldv_52974: mdev->ov_start_sector = (sector_t )args.start_sector & 0xfffffffffffffff7UL; val.i = 0U; val.ldv_38745.conn = 18U; mask.i = 0U; mask.ldv_38745.conn = 31U; reply->ret_code = drbd_request_state(mdev, mask, val); drbd_resume_io(mdev); 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_201(& 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 + 1138UL) == 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 + 1138UL) != 0U) { retcode = 151; goto out_dec; } else { } drbd_uuid_set(mdev, 1, 0ULL); drbd_uuid_new_current(mdev); if ((unsigned int )*((unsigned char *)(& args) + 0UL) != 0U) { err = drbd_bitmap_io(mdev, & drbd_bmio_clear_n_write, (char *)"clear_n_write from new_c_uuid", BM_LOCKED_MASK); if (err != 0) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "Writing bitmap failed with %d\n", err); retcode = 118; } else { } if (skip_initial_sync != 0) { drbd_send_uuids_skip_initial_sync(mdev); _drbd_uuid_set(mdev, 1, 0ULL); drbd_print_uuids(mdev, "cleared bitmap UUID"); spin_lock_irq(& mdev->req_lock); __ns.i = mdev->state.i; __ns.ldv_38745.disk = 8U; __ns.ldv_38745.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_202(& 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, 1320}, {& 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 ; bool tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; void *tmp___3 ; { nlp = (struct drbd_nl_cfg_req *)(& req->data); reply_size = 34; tmp = try_module_get(& __this_module); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { printk("<3>drbd: try_module_get() failed!\n"); return; } else { } tmp___1 = capable(21); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { retcode = 152; goto fail; } else { } mdev = ensure_mdev((int )nlp->drbd_minor, nlp->flags & 1); if ((unsigned long )mdev == (unsigned long )((struct drbd_conf *)0)) { retcode = 127; goto fail; } else { } if (nlp->packet_type > 27 || nlp->packet_type == 27) { retcode = 137; goto fail; } else { } cm = (struct cn_handler_struct *)(& cnd_table) + (unsigned long )nlp->packet_type; if ((unsigned long )cm->function == (unsigned long )((int (*)(struct drbd_conf * , struct drbd_nl_cfg_req * , struct drbd_nl_cfg_reply * ))0)) { retcode = 137; goto fail; } else { } reply_size = cm->reply_body_size + reply_size; tmp___3 = kzalloc((size_t )reply_size, 208U); cn_reply = (struct cn_msg *)tmp___3; 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_53026; case 2UL: put_unaligned_le16((int )((unsigned short )tag), __gu_p); goto ldv_53026; case 4UL: put_unaligned_le32((unsigned int )tag, __gu_p); goto ldv_53026; case 8UL: put_unaligned_le64((unsigned long long )tag, __gu_p); goto ldv_53026; default: __bad_unaligned_access_size(); goto ldv_53026; } ldv_53026: 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_53033; case 2UL: put_unaligned_le16((int )len, __gu_p___0); goto ldv_53033; case 4UL: put_unaligned_le32((unsigned int )len, __gu_p___0); goto ldv_53033; case 8UL: put_unaligned_le64((unsigned long long )len, __gu_p___0); goto ldv_53033; default: __bad_unaligned_access_size(); goto ldv_53033; } ldv_53033: __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_53059; case 2UL: put_unaligned_le16((int )((unsigned short )tag), __gu_p); goto ldv_53059; case 4UL: put_unaligned_le32((unsigned int )tag, __gu_p); goto ldv_53059; case 8UL: put_unaligned_le64((unsigned long long )tag, __gu_p); goto ldv_53059; default: __bad_unaligned_access_size(); goto ldv_53059; } ldv_53059: ; 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_53067; case 2UL: put_unaligned_le16(4, __gu_p___0); goto ldv_53067; case 4UL: put_unaligned_le32(4U, __gu_p___0); goto ldv_53067; case 8UL: put_unaligned_le64(4ULL, __gu_p___0); goto ldv_53067; default: __bad_unaligned_access_size(); goto ldv_53067; } ldv_53067: __gu_p___1 = (void *)tl; switch (4UL) { case 1UL: *((u8 *)__gu_p___1) = (unsigned char )*((int *)val); goto ldv_53074; case 2UL: put_unaligned_le16((int )((unsigned short )*((int *)val)), __gu_p___1); goto ldv_53074; case 4UL: put_unaligned_le32((unsigned int )*((int *)val), __gu_p___1); goto ldv_53074; case 8UL: put_unaligned_le64((unsigned long long )*((int *)val), __gu_p___1); goto ldv_53074; default: __bad_unaligned_access_size(); goto ldv_53074; } ldv_53074: tl = tl + 4U; goto ldv_53079; 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_53083; case 2UL: put_unaligned_le16(8, __gu_p___2); goto ldv_53083; case 4UL: put_unaligned_le32(8U, __gu_p___2); goto ldv_53083; case 8UL: put_unaligned_le64(8ULL, __gu_p___2); goto ldv_53083; default: __bad_unaligned_access_size(); goto ldv_53083; } ldv_53083: __gu_p___3 = (void *)tl; switch (8UL) { case 1UL: *((u8 *)__gu_p___3) = (unsigned char )*((u64 *)val); goto ldv_53090; case 2UL: put_unaligned_le16((int )((unsigned short )*((u64 *)val)), __gu_p___3); goto ldv_53090; case 4UL: put_unaligned_le32((unsigned int )*((u64 *)val), __gu_p___3); goto ldv_53090; case 8UL: put_unaligned_le64(*((u64 *)val), __gu_p___3); goto ldv_53090; default: __bad_unaligned_access_size(); goto ldv_53090; } ldv_53090: tl = tl + 8U; goto ldv_53079; default: ; } ldv_53079: ; 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_53106; case 2UL: put_unaligned_le16(0, __gu_p); goto ldv_53106; case 4UL: put_unaligned_le32(0U, __gu_p); goto ldv_53106; case 8UL: put_unaligned_le64(0ULL, __gu_p); goto ldv_53106; default: __bad_unaligned_access_size(); goto ldv_53106; } ldv_53106: 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_53121; case 2UL: put_unaligned_le16(0, __gu_p); goto ldv_53121; case 4UL: put_unaligned_le32(0U, __gu_p); goto ldv_53121; case 8UL: put_unaligned_le64(0ULL, __gu_p); goto ldv_53121; default: __bad_unaligned_access_size(); goto ldv_53121; } ldv_53121: 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 ; unsigned int __min1 ; unsigned int __min2 ; 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___0 ; unsigned int __min2___0 ; 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 = kzalloc(33026UL, 16U); cn_reply = (struct cn_msg *)tmp; if ((unsigned long )cn_reply == (unsigned long )((struct cn_msg *)0)) { dev_err((struct device const *)(& (mdev->vdisk)->part0.__dev), "could not kmalloc buffer for drbd_bcast_ee, sector %llu, size %u\n", (unsigned long long )e->sector, e->size); return; } else { } reply = (struct drbd_nl_cfg_reply *)(& cn_reply->data); tl = (unsigned short *)(& reply->tag_list); tl = tl_add_str(tl, 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_47524.block_id)); __min1 = e->size; __min2 = 32768U; len = __min1 < __min2 ? __min1 : __min2; tmp___0 = tl; tl = tl + 1; __gu_p = (void *)tmp___0; switch (2UL) { case 1UL: *((u8 *)__gu_p) = 50U; goto ldv_53144; case 2UL: put_unaligned_le16(49202, __gu_p); goto ldv_53144; case 4UL: put_unaligned_le32(49202U, __gu_p); goto ldv_53144; case 8UL: put_unaligned_le64(49202ULL, __gu_p); goto ldv_53144; default: __bad_unaligned_access_size(); goto ldv_53144; } ldv_53144: tmp___1 = tl; tl = tl + 1; __gu_p___0 = (void *)tmp___1; switch (2UL) { case 1UL: *((u8 *)__gu_p___0) = (unsigned char )len; goto ldv_53151; case 2UL: put_unaligned_le16((int )((unsigned short )len), __gu_p___0); goto ldv_53151; case 4UL: put_unaligned_le32(len, __gu_p___0); goto ldv_53151; case 8UL: put_unaligned_le64((unsigned long long )len, __gu_p___0); goto ldv_53151; default: __bad_unaligned_access_size(); goto ldv_53151; } ldv_53151: page = e->pages; goto ldv_53167; ldv_53166: tmp___2 = kmap_atomic___0(page); d = tmp___2; __min1___0 = len; __min2___0 = 4096U; l = __min1___0 < __min2___0 ? __min1___0 : __min2___0; __len = (size_t )l; __ret = memcpy((void *)tl, (void const *)d, __len); __kunmap_atomic___0(d); tl = tl + (unsigned long )l; len = len - l; if (len == 0U) { goto ldv_53165; } else { } page = page_chain_next(page); ldv_53167: ; 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_53166; } else { goto ldv_53165; } } else { } ldv_53165: tmp___4 = tl; tl = tl + 1; __gu_p___1 = (void *)tmp___4; switch (2UL) { case 1UL: *((u8 *)__gu_p___1) = 0U; goto ldv_53170; case 2UL: put_unaligned_le16(0, __gu_p___1); goto ldv_53170; case 4UL: put_unaligned_le32(0U, __gu_p___1); goto ldv_53170; case 8UL: put_unaligned_le64(0ULL, __gu_p___1); goto ldv_53170; default: __bad_unaligned_access_size(); goto ldv_53170; } ldv_53170: 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_53186; case 2UL: put_unaligned_le16(0, __gu_p); goto ldv_53186; case 4UL: put_unaligned_le32(0U, __gu_p); goto ldv_53186; case 8UL: put_unaligned_le64(0ULL, __gu_p); goto ldv_53186; default: __bad_unaligned_access_size(); goto ldv_53186; } ldv_53186: 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_53198: cn_id_drbd.idx = cn_idx; err = cn_add_callback(& cn_id_drbd, "cn_drbd", & drbd_connector_callback); if (err == 0) { goto ldv_53197; } else { } cn_idx = cn_idx + 6977U; tmp = try; try = try - 1; if (tmp != 0) { goto ldv_53198; } else { } ldv_53197: ; if (err != 0) { printk("<3>drbd: cn_drbd failed to register\n"); return (err); } else { } return (0); } } void drbd_nl_cleanup(void) { struct cb_id cn_id_drbd ; { cn_id_drbd.idx = cn_idx; cn_id_drbd.val = 1U; cn_del_callback(& cn_id_drbd); return; } } void drbd_nl_send_reply(struct cn_msg *req , int ret_code ) { char buffer[32U] ; struct cn_msg *cn_reply ; struct drbd_nl_cfg_reply *reply ; int rr ; { cn_reply = (struct cn_msg *)(& buffer); reply = (struct drbd_nl_cfg_reply *)(& cn_reply->data); memset((void *)(& buffer), 0, 32UL); cn_reply->id = req->id; cn_reply->seq = req->seq; cn_reply->ack = req->ack + 1U; cn_reply->len = 12U; cn_reply->flags = 0U; reply->packet_type = 27; reply->minor = ((struct drbd_nl_cfg_req *)(& req->data))->drbd_minor; reply->ret_code = ret_code; rr = cn_netlink_send(cn_reply, 8U, 16U); if (rr != 0 && rr != -3) { printk("<6>drbd: cn_netlink_send()=%d\n", rr); } else { } return; } } void ldv_mutex_lock_191(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_192(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_193(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_194(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_195(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_196(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_197(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_198(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_199(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_200(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_201(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_202(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) __attribute__((__no_instrument_function__)) ; __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_cred_guard_mutex_of_signal_struct ; int ldv_mutex_lock_interruptible_cred_guard_mutex_of_signal_struct(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_cred_guard_mutex_of_signal_struct == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex_cred_guard_mutex_of_signal_struct = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_cred_guard_mutex_of_signal_struct(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_cred_guard_mutex_of_signal_struct == 1) { } else { ldv_error(); } nondetermined = ldv_undef_int(); if (nondetermined) { ldv_mutex_cred_guard_mutex_of_signal_struct = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_cred_guard_mutex_of_signal_struct(struct mutex *lock ) { { if (ldv_mutex_cred_guard_mutex_of_signal_struct == 1) { } else { ldv_error(); } ldv_mutex_cred_guard_mutex_of_signal_struct = 2; return; } } int ldv_mutex_trylock_cred_guard_mutex_of_signal_struct(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_cred_guard_mutex_of_signal_struct == 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_cred_guard_mutex_of_signal_struct = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_cred_guard_mutex_of_signal_struct(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_cred_guard_mutex_of_signal_struct == 1) { } else { ldv_error(); } atomic_value_after_dec = ldv_undef_int(); if (atomic_value_after_dec == 0) { ldv_mutex_cred_guard_mutex_of_signal_struct = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_cred_guard_mutex_of_signal_struct(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_cred_guard_mutex_of_signal_struct == 1) { nondetermined = ldv_undef_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(struct mutex *lock ) { { if (ldv_mutex_cred_guard_mutex_of_signal_struct == 2) { } else { ldv_error(); } ldv_mutex_cred_guard_mutex_of_signal_struct = 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_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_cred_guard_mutex_of_signal_struct = 1; ldv_mutex_drbd_main_mutex = 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_cred_guard_mutex_of_signal_struct == 1) { } else { ldv_error(); } if (ldv_mutex_drbd_main_mutex == 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; } }